diff --git a/CreatureMethods.h b/CreatureMethods.h index 23a2cf1..cc205bf 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -656,6 +656,19 @@ namespace LuaCreature return 1; } + int UpdateEntry(lua_State* L, Creature* creature) + { + uint32 entry = Eluna::CHECKVAL(L, 2); + uint32 dataGuidLow = Eluna::CHECKVAL(L, 3, 0); + +#ifdef MANGOS + creature->UpdateEntry(entry, ALLIANCE, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL); +#else + creature->UpdateEntry(entry, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL); +#endif + return 0; + } + /*int ResetLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features { creature->ResetLootMode(); diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 5fda33f..16b8e66 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -778,6 +778,7 @@ ElunaRegister CreatureMethods[] = { "SaveToDB", &LuaCreature::SaveToDB }, // :SaveToDB() - Saves to database { "SelectVictim", &LuaCreature::SelectVictim }, // :SelectVictim() - Selects a victim { "MoveWaypoint", &LuaCreature::MoveWaypoint }, // :MoveWaypoint() + { "UpdateEntry", &LuaCreature::UpdateEntry }, // :UpdateEntry(entry[, dataGuidLow]) - Sets the creature's data from the given entry and guid. Guid can be left out. { NULL, NULL }, };