diff --git a/src/AutoBalance.cpp b/src/AutoBalance.cpp index 0787165..43126f6 100644 --- a/src/AutoBalance.cpp +++ b/src/AutoBalance.cpp @@ -2847,7 +2847,10 @@ class AutoBalance_AllCreatureScript : public AllCreatureScript uint32 prevMaxPower = creature->GetMaxPower(POWER_MANA); uint32 prevHealth = creature->GetHealth(); uint32 prevPower = creature->GetPower(POWER_MANA); - + + uint32 prevPlayerDamageRequired = creature->GetPlayerDamageReq(); + uint32 prevCreateHealth = creature->GetCreateHealth(); + Powers pType= creature->getPowerType(); creature->SetArmor(newBaseArmor); @@ -2873,6 +2876,20 @@ class AutoBalance_AllCreatureScript : public AllCreatureScript else creature->setPowerType(pType); // fix creatures with different power types + uint32 playerDamageRequired = creature->GetPlayerDamageReq(); + if(prevPlayerDamageRequired == 0) + { + // If already reached damage threshold for loot, drop to zero again + creature->LowerPlayerDamageReq(playerDamageRequired, true); + } + else + { + // Scale the damage requirements similar to creature HP scaling + uint32 scaledPlayerDmgReq = float(prevPlayerDamageRequired) * float(scaledHealth) / float(prevCreateHealth); + // Do some math + creature->LowerPlayerDamageReq(playerDamageRequired - scaledPlayerDmgReq, true); + } + // // Reward Scaling //