internal override void Init(GOEntry entry, GOSpawnEntry spawnEntry, GOSpawnPoint spawnPoint) { base.Init(entry, spawnEntry, spawnPoint); this.m_goTransportEntry = this.Entry as GOMOTransportEntry; TransportMgr.TransportEntries.TryGetValue(this.m_entry.GOId, out this.m_transportEntry); this.m_isMOTransport = this.m_goTransportEntry != null && this.m_transportEntry != null; }
/// <summary>Initialize the GO</summary> /// <param name="entry"></param> /// <param name="templ"></param> internal virtual void Init(GOEntry entry, GOSpawnEntry spawnEntry, GOSpawnPoint spawnPoint) { this.EntityId = EntityId.GetGameObjectId((uint)Interlocked.Increment(ref GameObject._lastGOUID), entry.GOId); this.Type |= ObjectTypes.GameObject; this.m_entry = entry; this.m_spawnPoint = spawnPoint; this.GoId = entry.GOId; this.DisplayId = entry.DisplayId; this.EntryId = entry.Id; this.GOType = entry.Type; this.Flags = this.m_entry.Flags; this.m_faction = this.m_entry.Faction ?? Faction.NullFaction; this.ScaleX = this.m_entry.Scale; this.GossipMenu = entry.DefaultGossip; if (this.QuestHolderInfo != null && this.GossipMenu == null) { this.GossipMenu = new GossipMenu(); } spawnEntry = spawnEntry ?? entry.FirstSpawnEntry; if (spawnEntry != null) { this.Phase = spawnEntry.Phase; this.State = spawnEntry.State; if ((double)spawnEntry.Scale != 1.0) { this.ScaleX = spawnEntry.Scale; } this.Orientation = spawnEntry.Orientation; this.AnimationProgress = spawnEntry.AnimProgress; this.SetRotationFields(spawnEntry.Rotations); } this.m_entry.InitGO(this); }
/// <summary>Creates a new GameObject with the given parameters</summary> public static GameObject Create(GOEntry entry, IWorldLocation where, GOSpawnEntry spawnEntry = null, GOSpawnPoint spawnPoint = null) { GameObject gameObject = entry.GOCreator(); gameObject.GoId = entry.GOId; Func <GameObjectHandler> handlerCreator = entry.HandlerCreator; gameObject.Init(entry, spawnEntry, spawnPoint); if (handlerCreator != null) { gameObject.Handler = handlerCreator(); gameObject.Phase = where.Phase; Vector3 position = where.Position; if (spawnPoint == null) { position.Z = where.Map.Terrain.GetGroundHeightUnderneath(position); } where.Map.AddObject(gameObject, ref position); gameObject.MarkUpdate(GameObjectFields.DYNAMIC); return(gameObject); } log.Warn("GOEntry {0} did not have a HandlerCreator set - Type: {1}", entry, entry.Type); gameObject.Delete(); return(null); }
/// <summary>Initialize the GO</summary> /// <param name="entry"></param> /// <param name="templ"></param> internal virtual void Init(GOEntry entry, GOSpawnEntry spawnEntry, GOSpawnPoint spawnPoint) { EntityId = EntityId.GetGameObjectId((uint)Interlocked.Increment(ref _lastGOUID), entry.GOId); Type |= ObjectTypes.GameObject; m_entry = entry; m_spawnPoint = spawnPoint; GoId = entry.GOId; DisplayId = entry.DisplayId; EntryId = entry.Id; GOType = entry.Type; Flags = m_entry.Flags; m_faction = m_entry.Faction ?? Faction.NullFaction; ScaleX = m_entry.Scale; GossipMenu = entry.DefaultGossip; if (QuestHolderInfo != null && GossipMenu == null) { GossipMenu = new GossipMenu(); } spawnEntry = spawnEntry ?? entry.FirstSpawnEntry; if (spawnEntry != null) { Phase = spawnEntry.Phase; State = spawnEntry.State; if (spawnEntry.Scale != 1.0) { ScaleX = spawnEntry.Scale; } Orientation = spawnEntry.Orientation; AnimationProgress = spawnEntry.AnimProgress; SetRotationFields(spawnEntry.Rotations); } m_entry.InitGO(this); }
/// <summary> /// Creates a new GameObject with the given parameters /// </summary> public static GameObject Create(GOEntry entry, IWorldLocation where, GOSpawnEntry spawnEntry = null, GOSpawnPoint spawnPoint = null) { var go = entry.GOCreator(); var handlerCreator = entry.HandlerCreator; go.Init(entry, spawnEntry, spawnPoint); if (handlerCreator != null) { go.Handler = handlerCreator(); } else { log.Warn("GOEntry {0} did not have a HandlerCreator set - Type: {1}", entry, entry.Type); go.Delete(); return null; } go.Phase = where.Phase; var pos = where.Position; if (spawnPoint == null) { pos.Z = where.Map.Terrain.GetGroundHeightUnderneath(pos); } where.Map.AddObject(go, ref pos); go.MarkUpdate(GameObjectFields.DYNAMIC); return go; }
internal override void Init(GOEntry entry, GOSpawnEntry spawnEntry, GOSpawnPoint spawnPoint) { base.Init(entry, spawnEntry, spawnPoint); m_goTransportEntry = Entry as GOMOTransportEntry; TransportMgr.TransportEntries.TryGetValue(m_entry.GOId, out m_transportEntry); m_isMOTransport = m_goTransportEntry != null && m_transportEntry != null; }
/// <summary> /// Creates a new GameObject with the given parameters /// </summary> public static GameObject Create(GOEntryId id, Map map, GOSpawnEntry spawnEntry = null, GOSpawnPoint spawnPoint = null) { var entry = GOMgr.GetEntry(id); if (entry != null) { return Create(entry, map, spawnEntry, spawnPoint); } return null; }
/// <summary> /// Creates the given kind of GameObject with the default Template /// </summary> public static GameObject Create(GOEntryId id, IWorldLocation location, GOSpawnEntry spawnEntry = null, GOSpawnPoint spawnPoint = null) { var entry = GOMgr.GetEntry(id); if (entry == null) { return null; } return Create(entry, location, spawnEntry, spawnPoint); }
/// <summary>Creates a new GameObject with the given parameters</summary> public static GameObject Create(GOEntryId id, Map map, GOSpawnEntry spawnEntry = null, GOSpawnPoint spawnPoint = null) { GOEntry entry = GOMgr.GetEntry(id, true); if (entry != null) { return(Create(entry, map, spawnEntry, spawnPoint)); } return(null); }
/// <summary> /// Creates the given kind of GameObject with the default Template /// </summary> public static GameObject Create(GOEntryId id, IWorldLocation location, GOSpawnEntry spawnEntry = null, GOSpawnPoint spawnPoint = null) { GOEntry entry = GOMgr.GetEntry(id, true); if (entry == null) { return(null); } return(Create(entry, location, spawnEntry, spawnPoint)); }
/// <summary> /// Initialize the GO /// </summary> /// <param name="entry"></param> /// <param name="templ"></param> internal virtual void Init(GOEntry entry, GOSpawnEntry spawnEntry, GOSpawnPoint spawnPoint) { EntityId = EntityId.GetGameObjectId((uint)Interlocked.Increment(ref _lastGOUID), entry.GOId); Type |= ObjectTypes.GameObject; //DynamicFlagsLow = GameObjectDynamicFlagsLow.Activated; m_entry = entry; m_spawnPoint = spawnPoint; DisplayId = entry.DisplayId; EntryId = entry.Id; GOType = entry.Type; Flags = m_entry.Flags; m_faction = m_entry.Faction ?? Faction.NullFaction; ScaleX = m_entry.Scale; GossipMenu = entry.DefaultGossip; if (QuestHolderInfo != null && GossipMenu == null) { // make sure, there is a GossipMenu that allows the player to start/finish quests GossipMenu = new GossipMenu(); } spawnEntry = spawnEntry ?? entry.FirstSpawnEntry; if (spawnEntry != null) { Phase = spawnEntry.Phase; State = spawnEntry.State; if (spawnEntry.Scale != 1) { ScaleX = spawnEntry.Scale; } Orientation = spawnEntry.Orientation; AnimationProgress = spawnEntry.AnimProgress; SetRotationFields(spawnEntry.Rotations); } m_entry.InitGO(this); }
public static GameObject Create(GOEntry entry, Map map, GOSpawnEntry spawnEntry = null, GOSpawnPoint spawnPoint = null) { return(Create(entry, new WorldLocation(map, Vector3.Zero, 1U), spawnEntry, spawnPoint)); }
public static GameObject Create(GOEntry entry, Map map, GOSpawnEntry spawnEntry = null, GOSpawnPoint spawnPoint = null) { return Create(entry, new WorldLocation(map, Vector3.Zero), spawnEntry, spawnPoint); }
/// <summary> /// Creates a new GameObject with the given parameters /// </summary> public static GameObject Create(GOEntry entry, IWorldLocation where, GOSpawnEntry spawnEntry = null, GOSpawnPoint spawnPoint = null) { var go = entry.GOCreator(); var handlerCreator = entry.HandlerCreator; go.Init(entry, spawnEntry, spawnPoint); if (handlerCreator != null) { go.Handler = handlerCreator(); } else { log.Warn("GOEntry {0} did not have a HandlerCreator set - Type: {1}", entry, entry.Type); go.Delete(); return null; } go.Phase = where.Phase; var pos = where.Position; where.Map.AddObject(go, ref pos); return go; }
/// <summary> /// Creates a new GameObject with the given parameters /// </summary> public static GameObject Create(GOEntry entry, IWorldLocation where, GOSpawnEntry spawnEntry = null, GOSpawnPoint spawnPoint = null) { var go = entry.GOCreator(); var handlerCreator = entry.HandlerCreator; go.Init(entry, spawnEntry, spawnPoint); if (handlerCreator != null) { go.Handler = handlerCreator(); } else { log.Warn("GOEntry {0} did not have a HandlerCreator set - Type: {1}", entry, entry.Type); go.Delete(); return(null); } go.Phase = where.Phase; var pos = where.Position; if (spawnPoint == null) { pos.Z = where.Map.Terrain.GetGroundHeightUnderneath(pos); } where.Map.AddObject(go, ref pos); go.MarkUpdate(GameObjectFields.DYNAMIC); return(go); }
/// <summary> /// Initialize the GO /// </summary> /// <param name="entry"></param> /// <param name="templ"></param> internal virtual void Init(GOEntry entry, GOSpawnEntry spawnEntry, GOSpawnPoint spawnPoint) { EntityId = EntityId.GetGameObjectId((uint)Interlocked.Increment(ref _lastGOUID), entry.GOId); Type |= ObjectTypes.GameObject; //DynamicFlagsLow = GameObjectDynamicFlagsLow.Activated; m_entry = entry; m_spawnPoint = spawnPoint; DisplayId = entry.DisplayId; EntryId = entry.Id; GOType = entry.Type; Flags = m_entry.Flags; m_faction = m_entry.Faction ?? Faction.NullFaction; ScaleX = m_entry.Scale; spawnEntry = spawnEntry ?? entry.FirstSpawnEntry; if (spawnEntry != null) { Phase = spawnEntry.Phase; State = spawnEntry.State; if (spawnEntry.Scale != 1) { ScaleX = spawnEntry.Scale; } Orientation = spawnEntry.Orientation; AnimationProgress = spawnEntry.AnimProgress; SetRotationFields(spawnEntry.Rotations); } m_entry.InitGO(this); }