Add option to EGS to enable ring loot and xp

merge/2021-11-19
kaetemi 3 years ago
parent d465191e96
commit 33a8128cfc
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -83,6 +83,8 @@ extern CCreatureDespawnMsg CreatureDespawnMsg;
extern CVariable<bool> VerboseQuartering;
extern std::string CurrentCreatureSpawningDebug;
extern CVariable<bool> 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())
{

@ -662,6 +662,8 @@ CVariable<uint32> ClientNPCIconRefreshTimerDelay("egs", "ClientNPCIconRefreshTim
// - Ring
CVariable<uint32> TickFrequencyNpcControlUpdate("egs","TickFrequencyNpcControlUpdate","Min time in tick between 2 updates of udate of npc control", 6, 0, true);
CVariable<bool> RingXpEnabled("egs", "RingXpEnabled", "Enable earning XP in Ring", false, 0, true);
CVariable<bool> RingLootEnabled("egs", "RingLootEnabled", "Enable looting mobs in Ring", false, 0, true);
// Scores
CVariable<sint32> PhysicalCharacteristicsBaseValue( "egs", "PhysicalCharacteristicsBaseValue", "Physical characteristic base value used to compute base score value", 10, 0, true );

@ -208,6 +208,8 @@ extern CVariable<string> NoValueCheckingPriv;
extern CVariable<uint32> OutpostJoinPvpTimer;
extern CVariable<uint32> DefaultWeightHands;
extern CVariable<bool> RingXpEnabled;
extern vector<CMainlandSummary> Mainlands;
CVariable<uint32> 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<CSString*>(&skillName)->left(2).toUpper()=="SC","No XP gain for using crafting skill "<<skillName<<"("<<ContSkill<<") for character "<<getId().toString(),return 0.0);

@ -93,6 +93,7 @@ extern float MaxHarvestDistance;
extern SKILLS::ESkills BarehandCombatSkill;
CVariable<uint32> DefaultWeightHands("egs", "DefaultWeightHands", "Weight of hands for calculate STA consumed by action for handed fight", 500,0,true);
extern CVariable<bool> 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())

Loading…
Cancel
Save