diff --git a/CreatureMethods.h b/CreatureMethods.h index e0ddb85..46b0291 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -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(L, 2); + + creature->SetReactState((ReactStates)state); + return 0; + } +#endif /** * Makes the [Creature] able to fly if enabled. diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 6d21bf3..d11e8cb 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -808,6 +808,9 @@ ElunaRegister 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 },