Merge pull request #365 from tikki100/SetReactState

[Feature] Exposed SetReactState
This commit is contained in:
Rochet2
2021-06-05 14:01:58 +03:00
committed by GitHub
2 changed files with 17 additions and 0 deletions

View File

@@ -983,6 +983,20 @@ auto const& threatlist = creature->getThreatManager().getThreatList();
return 0;
}
#if defined(TRINITY) || defined(AZEROTHCORE)
/**
* Sets the [Creature]'s ReactState to `state`.
*
* @param [ReactState] state
*/
int SetReactState(lua_State* L, Creature* creature)
{
uint32 state = Eluna::CHECKVAL<uint32>(L, 2);
creature->SetReactState((ReactStates)state);
return 0;
}
#endif
/**
* Makes the [Creature] able to fly if enabled.

View File

@@ -808,6 +808,9 @@ ElunaRegister<Creature> CreatureMethods[] =
{ "SetLootMode", &LuaCreature::SetLootMode },
#endif
{ "SetNPCFlags", &LuaCreature::SetNPCFlags },
#if defined(TRINITY) || AZEROTHCORE
{ "SetReactState", &LuaCreature::SetReactState },
#endif
{ "SetDeathState", &LuaCreature::SetDeathState },
{ "SetWalk", &LuaCreature::SetWalk },
{ "SetHomePosition", &LuaCreature::SetHomePosition },