feat: add GetRank method for creatures (#173)

This commit is contained in:
kabigon
2024-05-04 21:23:51 +02:00
committed by GitHub
parent 2bd22cf927
commit 152a491663
2 changed files with 12 additions and 0 deletions

View File

@@ -957,6 +957,17 @@ auto const& threatlist = creature->GetThreatMgr().GetThreatList();
return 1;
}
/**
* Returns the [Creature]'s rank.
*
* @return [Rank] rank
*/
int GetRank(lua_State* L, Creature* creature)
{
Eluna::Push(L, creature->GetCreatureTemplate()->rank);
return 1;
}
#if defined(CLASSIC) || defined(TBC) || defined(WOTLK)
/**
* Returns the [Creature]'s shield block value.

View File

@@ -831,6 +831,7 @@ ElunaRegister<Creature> CreatureMethods[] =
{ "GetUnitFlags", &LuaCreature::GetUnitFlags },
{ "GetUnitFlagsTwo", &LuaCreature::GetUnitFlagsTwo },
{ "GetExtraFlags", &LuaCreature::GetExtraFlags },
{ "GetRank", &LuaCreature::GetRank },
#if defined(CLASSIC) || defined(TBC) || defined(WOTLK)
{ "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue },
#endif