From 39e04126a068c007f1254ee1ce59d77155853073 Mon Sep 17 00:00:00 2001 From: Nuno Date: Mon, 8 May 2023 21:45:23 +0200 Subject: [PATCH] Added aqua_speed for rite geo 50 tryker --- .../src/entities_game_service/entities_game_service.cpp | 7 ++++--- .../mission_manager/missions_commands.cpp | 16 ++++++++++++++++ .../entities_game_service/player_manager/character.cpp | 17 +++++++++++++++++ .../entities_game_service/player_manager/character.h | 4 ++++ .../player_manager/character_inlines.h | 6 ++++++ 5 files changed, 47 insertions(+), 3 deletions(-) diff --git a/ryzom/server/src/entities_game_service/entities_game_service.cpp b/ryzom/server/src/entities_game_service/entities_game_service.cpp index f2d2b1cee..4031b5f5b 100644 --- a/ryzom/server/src/entities_game_service/entities_game_service.cpp +++ b/ryzom/server/src/entities_game_service/entities_game_service.cpp @@ -389,6 +389,7 @@ void processMirrorUpdates() { user->entersWater(); } + user->applyRegenAndClipCurrentValue(); } } TheDataset.endChangedValuesForProp(); @@ -672,7 +673,7 @@ string getServerInfos(float x, float y) pos.y = y; pos.z = 0; CRyzomTime::EWeather weather = WeatherEverywhere.getWeather(pos, CTimeDateSeasonManager::getRyzomTimeReference()); - + return toString("%f|%d|%s|%u", CTimeDateSeasonManager::getRyzomTimeReference().getRyzomTime(), CTimeDateSeasonManager::getRyzomTimeReference().getRyzomDay(), @@ -1642,7 +1643,7 @@ nlassert(nodeLeaf->getType() == ICDBStructNode::TEXT); // { // if( args.size() == 0 ) // return false; -// +// // NLMEMORY::StatisticsReport( args[0].c_str(), args.size() > 1 ); // return true; //} @@ -2047,7 +2048,7 @@ void cbMirrorUp( const std::string &serviceName, NLNET::TServiceId serviceId, vo IOSIsUp = true; nlinfo("IOS connection, serviceId %d",serviceId.get()); DynChatEGS.iosConnection(); - + CGuildManager::getInstance()->onIOSConnection(); CPVPManager2::getInstance()->onIOSMirrorUp(); diff --git a/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp b/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp index 45a918a52..aecf7cf76 100644 --- a/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp +++ b/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp @@ -5229,3 +5229,19 @@ NLMISC_COMMAND(executePhrase,"execute a sabrina phrase","uid cyclic? [setCurrentSpeedSwimBonus(value); + } +} + diff --git a/ryzom/server/src/entities_game_service/player_manager/character.cpp b/ryzom/server/src/entities_game_service/player_manager/character.cpp index b7b53df05..642a1b44d 100644 --- a/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -591,6 +591,7 @@ CCharacter::CCharacter() _MinPriceFilter = 0; _MaxPriceFilter = ~0u; _LastAppliedWeightMalus = 0; + _CurrentSpeedSwimBonus = 0; _CurrentRegenerateReposBonus = 0; _TpTicketSlot = INVENTORIES::INVALID_INVENTORY_SLOT; // setup timer for tickUpdate() calling @@ -2777,6 +2778,22 @@ void CCharacter::applyRegenAndClipCurrentValue() _LastAppliedWeightMalus = getWeightMalus(); _PhysScores.SpeedVariationModifier += _LastAppliedWeightMalus; sint16 speedVariationModifier = std::max((sint)_PhysScores.SpeedVariationModifier, (sint) - 100); + CSheetId aqua_speed("aqua_speed.sbrick"); + if (isInWater() && (haveBrick(aqua_speed) || _CurrentSpeedSwimBonus > 0)) + { + setBonusMalusName("aqua_speed", addEffectInDB(aqua_speed, true)); + if (_CurrentSpeedSwimBonus > 0) + speedVariationModifier = std::min(speedVariationModifier + (sint16)_CurrentSpeedSwimBonus, 100); + else + speedVariationModifier = std::min(speedVariationModifier + 100, 100); + } + else + { + sint8 bonus = getBonusMalusName("aqua_speed"); + if (bonus > -1) + removeEffectInDB(bonus, true); + } + // Speed // while stunned/root/mezzed etc speed is forced to 0 float oldCurrentSpeed; diff --git a/ryzom/server/src/entities_game_service/player_manager/character.h b/ryzom/server/src/entities_game_service/player_manager/character.h index 187169e13..f55ee5e4e 100644 --- a/ryzom/server/src/entities_game_service/player_manager/character.h +++ b/ryzom/server/src/entities_game_service/player_manager/character.h @@ -2713,6 +2713,7 @@ public: uint32 getLastExchangeMount() const; bool getRespawnMainLandInTown() const; void setRespawnMainLandInTown(bool status); + void setCurrentSpeedSwimBonus(uint32 speed); const std::list &getLastLogStats() const; void updateConnexionStat(); @@ -3886,6 +3887,9 @@ private: /// backup last used weight malus sint32 _LastAppliedWeightMalus; + /// aqua speed bonus (used for tryker rite) + uint32 _CurrentSpeedSwimBonus; + /// Regenerte factor float _CurrentRegenerateReposBonus; NLMISC::TGameCycle _CurrentRegenerateReposBonusTickUpdate; diff --git a/ryzom/server/src/entities_game_service/player_manager/character_inlines.h b/ryzom/server/src/entities_game_service/player_manager/character_inlines.h index 471bfc42c..9840eef32 100644 --- a/ryzom/server/src/entities_game_service/player_manager/character_inlines.h +++ b/ryzom/server/src/entities_game_service/player_manager/character_inlines.h @@ -1256,6 +1256,12 @@ inline void CCharacter::setRespawnMainLandInTown(bool status) { _RespawnMainLandInTown = status; } + +inline void CCharacter::setCurrentSpeedSwimBonus(uint32 speed) +{ + _CurrentSpeedSwimBonus = speed; +} + //------------------------------------------------------------------------------ inline const std::list& CCharacter::getLastLogStats() const -- 2.11.4.GIT