Script refactoring done as per previous cores

Script name now no longer exists in creature_template, item_template,
instance_template, and gameobject_template.

They are now held in the script_binding table.
This commit is contained in:
Charles A Edwards 2016-08-10 14:31:06 +01:00 committed by Antz
parent 8580efa00f
commit a2537e7954
8 changed files with 75 additions and 16 deletions

View file

@ -2339,7 +2339,8 @@ std::string Creature::GetScriptName() const
uint32 Creature::GetScriptId() const
{
return ObjectMgr::GetCreatureTemplate(GetEntry())->ScriptID;
// scripts bound to DB guid have priority over ones bound to creature entry
return sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, -int32(GetGUIDLow())) ? sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, -int32(GetGUIDLow())) : sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, GetEntry());
}
VendorItemData const* Creature::GetVendorItems() const