mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 16:37:06 +00:00
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:
parent
8580efa00f
commit
a2537e7954
8 changed files with 75 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -145,7 +145,6 @@ struct CreatureInfo
|
|||
uint32 vendorId;
|
||||
uint32 MechanicImmuneMask;
|
||||
uint32 ExtraFlags;
|
||||
uint32 ScriptID;
|
||||
|
||||
// helpers
|
||||
HighGuid GetHighGuid() const
|
||||
|
|
|
|||
|
|
@ -426,7 +426,6 @@ struct GameObjectInfo
|
|||
uint32 unk2;
|
||||
uint32 MinMoneyLoot;
|
||||
uint32 MaxMoneyLoot;
|
||||
uint32 ScriptId;
|
||||
|
||||
// helpers
|
||||
bool IsDespawnAtAction() const
|
||||
|
|
|
|||
|
|
@ -622,8 +622,7 @@ struct ItemPrototype
|
|||
float ArmorDamageModifier;
|
||||
uint32 Duration;
|
||||
uint32 ItemLimitCategory; // id from ItemLimitCategory.dbc
|
||||
uint32 HolidayId; // id from Holidays.dbc
|
||||
uint32 ScriptId;
|
||||
uint32 HolidayId;
|
||||
uint32 DisenchantID;
|
||||
uint32 FoodType;
|
||||
float StatScalingFactor;
|
||||
|
|
|
|||
|
|
@ -571,7 +571,7 @@ void ObjectMgr::LoadCreatureTemplates()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (difficultyInfo->ScriptID)
|
||||
if (sScriptMgr.GetBoundScriptId(SCRIPTED_UNIT, difficultyInfo->Entry))
|
||||
{
|
||||
sLog.outErrorDb("Difficulty %u mode creature (Entry: %u) has `ScriptName`, but in any case will used difficulty 0 mode creature (Entry: %u) ScriptName.",
|
||||
diff + 1, cInfo->DifficultyEntry[diff], i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue