mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Add UpdateEntry method for creature. Closes #67
Fix optional arg Fix mangos code
This commit is contained in:
@@ -656,6 +656,19 @@ namespace LuaCreature
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int UpdateEntry(lua_State* L, Creature* creature)
|
||||||
|
{
|
||||||
|
uint32 entry = Eluna::CHECKVAL<uint32>(L, 2);
|
||||||
|
uint32 dataGuidLow = Eluna::CHECKVAL<uint32>(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
|
/*int ResetLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||||
{
|
{
|
||||||
creature->ResetLootMode();
|
creature->ResetLootMode();
|
||||||
|
|||||||
@@ -778,6 +778,7 @@ ElunaRegister<Creature> CreatureMethods[] =
|
|||||||
{ "SaveToDB", &LuaCreature::SaveToDB }, // :SaveToDB() - Saves to database
|
{ "SaveToDB", &LuaCreature::SaveToDB }, // :SaveToDB() - Saves to database
|
||||||
{ "SelectVictim", &LuaCreature::SelectVictim }, // :SelectVictim() - Selects a victim
|
{ "SelectVictim", &LuaCreature::SelectVictim }, // :SelectVictim() - Selects a victim
|
||||||
{ "MoveWaypoint", &LuaCreature::MoveWaypoint }, // :MoveWaypoint()
|
{ "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 },
|
{ NULL, NULL },
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user