Core/Entities: Added possibility to inherit StringIds from other entities
Port From (https://github.com/TrinityCore/TrinityCore/commit/88bbd27f8d007dca17bb0d244fcf7e753506734e)
This commit is contained in:
@@ -2915,6 +2915,15 @@ namespace Game.Entities
|
||||
return Global.ObjectMgr.GetCreatureTemplate(GetEntry()) != null ? Global.ObjectMgr.GetCreatureTemplate(GetEntry()).ScriptID : 0;
|
||||
}
|
||||
|
||||
public void InheritStringIds(Creature parent)
|
||||
{
|
||||
// copy references to stringIds from template and spawn
|
||||
m_stringIds = parent.m_stringIds;
|
||||
|
||||
// then copy script stringId, not just its reference
|
||||
SetScriptStringId(parent.GetStringId(StringIdType.Script));
|
||||
}
|
||||
|
||||
public bool HasStringId(string id)
|
||||
{
|
||||
return m_stringIds.Contains(id);
|
||||
|
||||
Reference in New Issue
Block a user