azerothcore / mod-autobalance

Module for AzerothCore(MaNGOS -> TrinityCore -> SunwellCore)
http://www.azerothcore.org
102 stars 109 forks source link

Guardian/Pet creatures hp not scaling #101

Closed duncrafter closed 1 year ago

duncrafter commented 2 years ago

Currently most summoned creatures (Guardians/Pets etc.) health is not scaling properly. Example: Lupine Delusions in SFK, Remote-Controlled Golems in DM/EVC

valleyss commented 2 years ago

same thing here.

duncrafter commented 2 years ago

https://github.com/azerothcore/azerothcore-wotlk/issues/9291 Probably the reason

CanadianMath commented 1 year ago

Can we fix this by manually adding things to a list?

duncrafter commented 1 year ago

A community member named Vitaliy posted this solution in a now deleted(?)/vanished comment, which works, as far as I can tell, without any issues:

``class AutoBalance_AllCreatureScript : public AllCreatureScript
{
public:
AutoBalance_AllCreatureScript()
: AllCreatureScript("AutoBalance_AllCreatureScript")
{
}

just add this:
void OnCreatureAddWorld(Creature* creature) override
{
if (!enabled)
return;

    ModifyCreatureAttributes(creature, true);
}
CanadianMath commented 1 year ago

Oh, is that bottom text just added to the AutoBalance.cpp under the above? Seems shockingly simple.

duncrafter commented 1 year ago

Yes, with a two-line space between old code and addition. My knowledge of C++ is very limited, but I think this starts the code for attribute modification when a creature is added to the world?

cdenq commented 1 year ago

This issue is still persistent as of 2023.

Likewise, testing out the changes suggested by the deleted post, the following error occurs when building the server:

15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(1913,10): error C2535: 'void AutoBalance_AllCreatureScript::OnCreatureAddWorld(Creature *)': member function already defined or declared
15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(1892,10): message : see declaration of 'AutoBalance_AllCreatureScript::OnCreatureAddWorld'
15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(1894,10): error C2065: 'enabled': undeclared identifier
15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(1897,9): error C2660: 'AutoBalance_AllCreatureScript::ModifyCreatureAttributes': function does not take 2 arguments
15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(2058,10): message : see declaration of 'AutoBalance_AllCreatureScript::ModifyCreatureAttributes'
15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(1897,9): message : while trying to match the argument list '(Creature *, bool)'
pangolp commented 1 year ago

This issue is still persistent as of 2023.

Likewise, testing out the changes suggested by the deleted post, the following error occurs when building the server:

15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(1913,10): error C2535: 'void AutoBalance_AllCreatureScript::OnCreatureAddWorld(Creature *)': member function already defined or declared
15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(1892,10): message : see declaration of 'AutoBalance_AllCreatureScript::OnCreatureAddWorld'
15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(1894,10): error C2065: 'enabled': undeclared identifier
15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(1897,9): error C2660: 'AutoBalance_AllCreatureScript::ModifyCreatureAttributes': function does not take 2 arguments
15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(2058,10): message : see declaration of 'AutoBalance_AllCreatureScript::ModifyCreatureAttributes'
15>C:\AzerothCore\modules\mod-autobalance\src\AutoBalance.cpp(1897,9): message : while trying to match the argument list '(Creature *, bool)'

I'll try to check it tomorrow.