Spawn linked traps at gameobject creation instead of using DB spawns.

This commit is contained in:
hondacrx
2017-11-29 17:54:55 -05:00
parent 32619fa6b5
commit b97c21be44
2 changed files with 28 additions and 40 deletions
+14 -1
View File
@@ -337,6 +337,19 @@ namespace Game.Entities
if (map.Is25ManRaid())
loot.maxDuplicates = 3;
uint linkedEntry = GetGoInfo().GetLinkedGameObjectEntry();
if (linkedEntry != 0)
{
GameObject linkedGO = new GameObject();
if (linkedGO.Create(linkedEntry, map, phaseMask, pos, rotation, 255, GameObjectState.Ready))
{
SetLinkedTrap(linkedGO);
map.AddToMap(linkedGO);
}
else
linkedGO.Dispose();
}
return true;
}
@@ -2347,7 +2360,7 @@ namespace Game.Entities
}
public void SetLinkedTrap(GameObject linkedTrap) { m_linkedTrap = linkedTrap.GetGUID(); }
GameObject GetLinkedTrap()
public GameObject GetLinkedTrap()
{
return ObjectAccessor.GetGameObject(this, m_linkedTrap);
}