diff --git a/methods/CMangos/UnitMethods.h b/methods/CMangos/UnitMethods.h index cc885de581..6c890a9f95 100644 --- a/methods/CMangos/UnitMethods.h +++ b/methods/CMangos/UnitMethods.h @@ -2604,7 +2604,10 @@ namespace LuaUnit { "RemoveBindSightAuras", METHOD_REG_NONE }, // not implemented { "RemoveCharmAuras", METHOD_REG_NONE }, // not implemented { "DisableMelee", METHOD_REG_NONE }, // not implemented - { "SummonGuardian", METHOD_REG_NONE } // not implemented + { "SummonGuardian", METHOD_REG_NONE }, // not implemented + { "CanModifyStats", METHOD_REG_NONE }, // not implemented + { "AddFlatStatModifier", METHOD_REG_NONE }, // not implemented + { "AddPctStatModifier", METHOD_REG_NONE } // not implemented }; }; #endif diff --git a/methods/Mangos/UnitMethods.h b/methods/Mangos/UnitMethods.h index e91cb427e9..1449f6463d 100644 --- a/methods/Mangos/UnitMethods.h +++ b/methods/Mangos/UnitMethods.h @@ -2621,7 +2621,10 @@ namespace LuaUnit { "RemoveCharmAuras", METHOD_REG_NONE }, // not implemented { "DisableMelee", METHOD_REG_NONE }, // not implemented { "SummonGuardian", METHOD_REG_NONE }, // not implemented - { "SetImmuneTo", METHOD_REG_NONE } // not implemented + { "SetImmuneTo", METHOD_REG_NONE }, // not implemented + { "CanModifyStats", METHOD_REG_NONE }, // not implemented + { "AddFlatStatModifier", METHOD_REG_NONE }, // not implemented + { "AddPctStatModifier", METHOD_REG_NONE } // not implemented }; }; #endif diff --git a/methods/TrinityCore/UnitMethods.h b/methods/TrinityCore/UnitMethods.h index 379887a9d6..aa2bc0d63d 100644 --- a/methods/TrinityCore/UnitMethods.h +++ b/methods/TrinityCore/UnitMethods.h @@ -2506,6 +2506,69 @@ namespace LuaUnit return 0; } + /** + * Returns whether or not the [Unit] can have stat modifiers applied. + * + * @return bool canModifyStats + */ + int CanModifyStats(Eluna* E, Unit* unit) + { + E->Push(unit->CanModifyStats()); + return 1; + } + + /** + * Modifies a flat amount of a specific stat of the [Unit] + * + *
+ * enum UnitModifierFlatType + * { + * BASE_VALUE = 0, + * TOTAL_VALUE = 1 + * }; + *+ * + * @param uint32 statType : The stat to modify + * @param [UnitModifierFlatType] modType : The type of modifier to apply + * @param float value : The value to apply to the stat + * @param bool apply = true : True applies a positive modifier, false applies a negative + */ + int AddFlatStatModifier(Eluna* E, Unit* unit) + { + uint32 statType = E->CHECKVAL
+ * enum UnitModifierPctType + * { + * BASE_PCT = 0, + * TOTAL_PCT = 1 + * }; + *+ * + * @param uint32 statType : The stat to modify + * @param [UnitModifierPctType] modType : The type of modifier to apply + * @param float value : The value to apply to the stat + */ + int AddPctStatModifier(Eluna* E, Unit* unit) + { + uint32 statType = E->CHECKVAL