azerothcore / mod-eluna

Eluna Lua Engine © for WoW Emulators
https://elunaluaengine.github.io/
GNU General Public License v3.0
98 stars 128 forks source link

Adding HandleStatModifier for Unit #161

Closed iThorgrim closed 8 months ago

iThorgrim commented 8 months ago

Greetings,

This pull request introduces the HandleStatModifier method for Unit in the Eluna module.

Here's a brief overview of the addition:

/**
 * The [Unit] modifies a specific stat
 *
 * @param int32 stat : The stat to modify
 * @param int8 type : The type of modifier to apply
 * @param float value : The value to apply to the stat
 * @param bool apply = false : Whether the modifier should be applied or removed
 * @return bool : Whether the stat modification was successful
 */
int HandleStatModifier(lua_State* L, Unit* unit)
{
    // Implementation...
}

This new method allows you to modify a specific stat of a [Unit], defining the type of modifier to apply, the value to apply to the stat, and whether the modifier should be applied or removed.

Your feedback on this addition would be greatly appreciated. Kind Regards,

Vaiocti (iThorgrim)

iThorgrim commented 8 months ago

Tests were carried out over several months on my own server. image