public override void Apply() { GOEntry entry = GOMgr.GetEntry((GOEntryId)Effect.MiscValue, true); Unit casterUnit = m_cast.CasterUnit; if (entry == null) { return; } if (Cast.TargetLoc.X != 0.0) { WorldLocation worldLocation = new WorldLocation(casterUnit.Map, Cast.TargetLoc, 1U); go = entry.Spawn(worldLocation); } else { go = entry.Spawn(casterUnit, null); } go.State = GameObjectState.Enabled; go.Orientation = casterUnit.Orientation; go.ScaleX = 1f; }
public override void Apply() { GOEntry entry = GOMgr.GetEntry((GOEntryId)this.Effect.MiscValue, true); Unit casterUnit = this.m_cast.CasterUnit; if (entry == null) { return; } if ((double)this.Cast.TargetLoc.X != 0.0) { WorldLocation worldLocation = new WorldLocation(casterUnit.Map, this.Cast.TargetLoc, 1U); this.go = entry.Spawn((IWorldLocation)worldLocation); } else { this.go = entry.Spawn((IWorldLocation)casterUnit, (Unit)null); } this.go.State = GameObjectState.Enabled; this.go.Orientation = casterUnit.Orientation; this.go.ScaleX = 1f; }
public override void Process(CmdTrigger <RealmServerCmdArgs> trigger) { string str = trigger.Text.NextModifiers(); GOEntry entry = GOMgr.GetEntry(trigger.Text.NextEnum(GOEntryId.End), false); Unit target = trigger.Args.Target; Map map = target != null ? target.Map : World.Kalimdor; if (str == "c") { GOSpawnEntry goSpawnEntry; if (entry != null) { goSpawnEntry = entry.SpawnEntries.GetClosestEntry(target); } else { List <GOSpawnPoolTemplate> poolTemplatesByMap = GOMgr.GetSpawnPoolTemplatesByMap(map.Id); goSpawnEntry = poolTemplatesByMap == null ? null : poolTemplatesByMap.GetClosestEntry(target); } if (goSpawnEntry == null) { trigger.Reply("No valid SpawnEntries found (Entry: {0})", (object)entry); } else { goSpawnEntry.Spawn(map); trigger.Reply("Spawned: " + goSpawnEntry.Entry); if (target == null) { return; } target.TeleportTo(map, goSpawnEntry.Position); } } else if (entry != null) { GameObject gameObject = entry.Spawn(trigger.Args.Target, trigger.Args.Target); trigger.Reply("Successfully spawned new GO: {0}.", (object)gameObject.Name); } else { trigger.Reply("Invalid GO."); } }
public override void Apply() { GOEntryId miscValue = (GOEntryId)this.Effect.MiscValue; GOEntry entry = GOMgr.GetEntry(miscValue, true); Unit casterUnit = this.m_cast.CasterUnit; if (entry != null) { this.GO = entry.Spawn((IWorldLocation)casterUnit, casterUnit); this.GO.State = GameObjectState.Enabled; this.GO.Orientation = casterUnit.Orientation; this.GO.ScaleX = 1f; this.GO.Faction = casterUnit.Faction; this.GO.CreatedBy = casterUnit.EntityId; if (this.GO.Handler is SummoningRitualHandler) { ((SummoningRitualHandler)this.GO.Handler).Target = this.firstTarget; } if (this.m_cast.IsChanneling) { this.m_cast.CasterUnit.ChannelObject = (WorldObject)this.GO; } else { if (this.Effect.Spell.Durations.Min <= 0) { return; } this.GO.RemainingDecayDelayMillis = this.Effect.Spell.Durations.Random(); } } else { SummonObjectEffectHandler.log.Error("Summoning Spell {0} refers to invalid Object: {1} ({2})", (object)this.Effect.Spell, (object)miscValue, (object)miscValue); } }
public override void Apply() { GOEntryId miscValue = (GOEntryId)Effect.MiscValue; GOEntry entry = GOMgr.GetEntry(miscValue, true); Unit casterUnit = m_cast.CasterUnit; if (entry != null) { GO = entry.Spawn(casterUnit, casterUnit); GO.State = GameObjectState.Enabled; GO.Orientation = casterUnit.Orientation; GO.ScaleX = 1f; GO.Faction = casterUnit.Faction; GO.CreatedBy = casterUnit.EntityId; if (GO.Handler is SummoningRitualHandler) { ((SummoningRitualHandler)GO.Handler).Target = firstTarget; } if (m_cast.IsChanneling) { m_cast.CasterUnit.ChannelObject = GO; } else { if (Effect.Spell.Durations.Min <= 0) { return; } GO.RemainingDecayDelayMillis = Effect.Spell.Durations.Random(); } } else { log.Error("Summoning Spell {0} refers to invalid Object: {1} ({2})", Effect.Spell, miscValue, miscValue); } }
/// <summary> /// Summons the dropped flag. /// </summary> /// <param name="location">The target location (can [and should] be a unit)</param> public void SummonDroppedFlag(IWorldLocation location) { _flag = DroppedFlagEntry.Spawn(location, null); // Flags never have an owner. }