Implement get class mask and get race mask

This commit is contained in:
Rochet2
2017-07-26 23:17:49 +03:00
parent 9dbe004bcc
commit 093b5d82fa
2 changed files with 24 additions and 0 deletions

View File

@@ -251,6 +251,8 @@ ElunaRegister<Unit> UnitMethods[] =
{ "GetGender", &LuaUnit::GetGender },
{ "GetRace", &LuaUnit::GetRace },
{ "GetClass", &LuaUnit::GetClass },
{ "GetRaceMask", &LuaUnit::GetRaceMask },
{ "GetClassMask", &LuaUnit::GetClassMask },
{ "GetRaceAsString", &LuaUnit::GetRaceAsString },
{ "GetClassAsString", &LuaUnit::GetClassAsString },
{ "GetAura", &LuaUnit::GetAura },

View File

@@ -1058,6 +1058,28 @@ namespace LuaUnit
return 1;
}
/**
* Returns the race mask
*
* @return uint32 racemask
*/
int GetRaceMask(lua_State* L, Unit* unit)
{
Eluna::Push(L, unit->getRaceMask());
return 1;
}
/**
* Returns the class mask
*
* @return uint32 classmask
*/
int GetClassMask(lua_State* L, Unit* unit)
{
Eluna::Push(L, unit->getClassMask());
return 1;
}
/**
* Returns the [Unit]'s creature type ID like wolf or humanoid.
*