From 33a8128cfc4b9dc2d91c88f7fef8fce3d05144a9 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 9 Jul 2021 11:15:38 +0800 Subject: [PATCH] Add option to EGS to enable ring loot and xp --- .../src/entities_game_service/creature_manager/creature.cpp | 4 +++- ryzom/server/src/entities_game_service/egs_variables.cpp | 2 ++ .../src/entities_game_service/player_manager/character.cpp | 4 +++- .../player_manager/character_inventory_manipulation.cpp | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ryzom/server/src/entities_game_service/creature_manager/creature.cpp b/ryzom/server/src/entities_game_service/creature_manager/creature.cpp index 5a0f8873a..6b4dfc3e7 100644 --- a/ryzom/server/src/entities_game_service/creature_manager/creature.cpp +++ b/ryzom/server/src/entities_game_service/creature_manager/creature.cpp @@ -83,6 +83,8 @@ extern CCreatureDespawnMsg CreatureDespawnMsg; extern CVariable VerboseQuartering; extern std::string CurrentCreatureSpawningDebug; +extern CVariable RingLootEnabled; + NL_INSTANCE_COUNTER_IMPL(CCreature); //----------------------------------------------- @@ -804,7 +806,7 @@ void CCreature::deathOccurs() if( _LootInventory != NULL ) { - if( _LootRight.size() > 0 && !IsRingShard ) // some PJ have loot right + if (_LootRight.size() > 0 && (!IsRingShard || RingLootEnabled.get())) // some PJ have loot right { if (!_CustomLootTableId.empty()) { diff --git a/ryzom/server/src/entities_game_service/egs_variables.cpp b/ryzom/server/src/entities_game_service/egs_variables.cpp index 7288af5b3..fa3ecab1c 100644 --- a/ryzom/server/src/entities_game_service/egs_variables.cpp +++ b/ryzom/server/src/entities_game_service/egs_variables.cpp @@ -662,6 +662,8 @@ CVariable ClientNPCIconRefreshTimerDelay("egs", "ClientNPCIconRefreshTim // - Ring CVariable TickFrequencyNpcControlUpdate("egs","TickFrequencyNpcControlUpdate","Min time in tick between 2 updates of udate of npc control", 6, 0, true); +CVariable RingXpEnabled("egs", "RingXpEnabled", "Enable earning XP in Ring", false, 0, true); +CVariable RingLootEnabled("egs", "RingLootEnabled", "Enable looting mobs in Ring", false, 0, true); // Scores CVariable PhysicalCharacteristicsBaseValue( "egs", "PhysicalCharacteristicsBaseValue", "Physical characteristic base value used to compute base score value", 10, 0, true ); 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 cc40400df..6d2b3b46d 100644 --- a/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -208,6 +208,8 @@ extern CVariable NoValueCheckingPriv; extern CVariable OutpostJoinPvpTimer; extern CVariable DefaultWeightHands; +extern CVariable RingXpEnabled; + extern vector Mainlands; CVariable SpawnedDeadMektoubDelay("egs","SpawnedDeadMektoubDelay", "nb tick before a dead mektoub despawn)", 2592000, 0, true ); @@ -7105,7 +7107,7 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS nlassert( skillEnum != SKILLS::unknown ); // treat ring scenarios as a special case... - if(IsRingShard) + if (IsRingShard && !RingXpEnabled.get()) { // don't gain reward points for crafting in the ring DROP_IF(reinterpret_cast(&skillName)->left(2).toUpper()=="SC","No XP gain for using crafting skill "< DefaultWeightHands("egs", "DefaultWeightHands", "Weight of hands for calculate STA consumed by action for handed fight", 500,0,true); +extern CVariable RingLootEnabled; // **************************************************************************** void CCharacter::initInventories() @@ -564,7 +565,7 @@ bool CCharacter::pickUpItem(const CEntityId& entity) _LootContainer = pCreature->getLootInventory(); // give money for loot (nb : only first loot table is used for money) - if ( (pCreature->getForm() != NULL) && !pCreature->moneyHasBeenLooted() && !IsRingShard) + if ( (pCreature->getForm() != NULL) && !pCreature->moneyHasBeenLooted() && (!IsRingShard || RingLootEnabled.get())) { const CStaticLootTable * lootTable; if (!pCreature->getCustomLootTableId().empty())