mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
feat: add ModifyThreatPct(creature,target)
This commit is contained in:
@@ -440,6 +440,7 @@ ElunaRegister<Unit> UnitMethods[] =
|
||||
{ "DealDamage", &LuaUnit::DealDamage },
|
||||
{ "DealHeal", &LuaUnit::DealHeal },
|
||||
{ "AddThreat", &LuaUnit::AddThreat },
|
||||
{ "ModifyThreatPct", &LuaUnit::ModifyThreatPct },
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -2982,6 +2982,23 @@ namespace LuaUnit
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifies threat in pct to the [Unit] from the victim
|
||||
*
|
||||
* @param [Unit] victim : [Unit] that caused the threat
|
||||
* @param int32 percent : threat amount in pct
|
||||
*/
|
||||
int ModifyThreatPct(lua_State* L, Unit* unit)
|
||||
{
|
||||
Unit* victim = Eluna::CHECKOBJ<Unit>(L, 2);
|
||||
int32 threatPct = Eluna::CHECKVAL<int32>(L, 3, true);
|
||||
|
||||
#ifdef AZEROTHCORE
|
||||
unit->getThreatMgr().modifyThreatPercent(victim, threatPct);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*int RestoreDisplayId(lua_State* L, Unit* unit)
|
||||
{
|
||||
unit->RestoreDisplayId();
|
||||
|
||||
Reference in New Issue
Block a user