Esempio n. 1
0
        public static void FixDeathComesGOs()
        {
            var entry = GOMgr.GetEntry(GOEntryId.EyeOfAcherusControlMechanism);

            entry.Used += ControlMechanismUsed;

            entry            = GOMgr.GetEntry(GOEntryId.AbandonedMail);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.SaroniteArrow);
            entry.Activated += NewAvalonSpawnsActivated;

            entry            = GOMgr.GetEntry(GOEntryId.Unknown_269);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.Unknown_350);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.Unknown_351);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.Unknown_352);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.Unknown_353);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.Unknown_354);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.Unknown_359);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.Unknown_361);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.Unknown_363);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.Unknown_364);
            entry.Activated += NewAvalonSpawnsActivated;
            entry            = GOMgr.GetEntry(GOEntryId.Unknown_365);
            entry.Activated += NewAvalonSpawnsActivated;
        }
Esempio n. 2
0
        public static void InitGOs()
        {
            var rethilgoreDoorEntry = GOMgr.GetEntry(GOEntryId.CourtyardDoor);          // rethilgore door

            if (rethilgoreDoorEntry != null)
            {
                rethilgoreDoorEntry.Activated += go =>
                {
                    var instance = go.Map as ShadowfangKeep;
                    if (instance != null && instance.rethilgoreDoor == null)
                    {
                        // set the instance's Door object after the Door spawned
                        instance.rethilgoreDoor = go;
                    }
                };
            }

            var fenrusDoorEntry = GOMgr.GetEntry(GOEntryId.SorcerersGate);              // fenrus door

            if (fenrusDoorEntry != null)
            {
                fenrusDoorEntry.Activated += go =>
                {
                    var instance = go.Map as ShadowfangKeep;
                    if (instance != null && instance.fenrusDoor == null)
                    {
                        // set the instance's Door object after the Door spawned
                        instance.fenrusDoor = go;
                    }
                };
            }
        }
Esempio n. 3
0
        public static void FixGOs()
        {
            var entry = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison);

            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_2);
            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_3);
            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_4);
            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_5);
            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_6);
            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_7);
            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_8);
            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_9);
            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_10);
            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_11);
            entry.Used += SoulPrisonUsed;
            entry       = GOMgr.GetEntry(GOEntryId.AcherusSoulPrison_12);
            entry.Used += SoulPrisonUsed;
        }
Esempio n. 4
0
        protected override void SpawnGOs()
        {
            base.SpawnGOs();
            GOEntry allianceDoorEntry = GOMgr.GetEntry(GOEntryId.ALLIANCEDOOR);
            GOEntry hordeDoorEntry    = GOMgr.GetEntry(GOEntryId.HORDEDOOR);

            _allianceDoor = allianceDoorEntry.FirstSpawnEntry.Spawn(this);
            _hordeDoor    = hordeDoorEntry.FirstSpawnEntry.Spawn(this);
        }
Esempio n. 5
0
        /// <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);
        }
Esempio n. 6
0
        public static void InitGOs()
        {
            scourgeTransporter = GOMgr.GetEntry(GOEntryId.ScourgeTransporter_3);
            scourgeTransporter.DefaultGossip = new GossipMenu(1,
                                                              new MultiStringGossipMenuItem(DefaultAddonLocalizer.Instance.GetTranslations(AddonMsgKey.NPCTiare),
                                                                                            convo => convo.Speaker.SpellCast.Trigger(SpellId.UpperSpireTeleport, convo.Character))
                                                              );

            iceWall = GOMgr.GetEntry(GOEntryId.IceWall_2);
        }
Esempio n. 7
0
        /// <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));
        }
Esempio n. 8
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                var mod = trigger.Text.NextModifiers();
                var id  = trigger.Text.NextEnum(GOEntryId.End);

                var entry = GOMgr.GetEntry(id, false);

                var target = trigger.Args.Target;
                var map    = target != null ? target.Map : World.Kalimdor;

                if (mod == "c")
                {
                    // spawn closest
                    GOSpawnEntry closest;

                    if (entry != null)
                    {
                        // Entry specified
                        closest = entry.SpawnEntries.GetClosestEntry(target);
                    }
                    else
                    {
                        // no entry, just spawn any nearby Template
                        var templates = GOMgr.GetSpawnPoolTemplatesByMap(map.Id);
                        closest = templates == null ? null : templates.GetClosestEntry(target);
                    }

                    if (closest == null)
                    {
                        trigger.Reply("No valid SpawnEntries found (Entry: {0})", entry);
                    }
                    else
                    {
                        closest.Spawn(map);
                        trigger.Reply("Spawned: " + closest.Entry);
                        if (target != null)
                        {
                            target.TeleportTo(map, closest.Position);
                        }
                    }
                }
                else
                {
                    if (entry != null)
                    {
                        // spawn a new GO
                        var go = entry.Spawn(trigger.Args.Target, trigger.Args.Target);
                        trigger.Reply("Successfully spawned new GO: {0}.", go.Name);
                    }
                    else
                    {
                        trigger.Reply("Invalid GO.");
                    }
                }
            }
Esempio n. 9
0
        /// <summary>
        /// Creates a normal-looking portal to represent a node in the network
        /// </summary>
        public static WorldObject CreateDefaultPortal(TeleportNode node, Map map, Vector3 pos)
        {
            var teleportMenu = WorldLocationMgr.CreateTeleMenu(node.Destinations);
            var portalEntry  = GOMgr.GetEntry(DefaultPortalGOid);
            var go           = portalEntry.Spawn(map, pos);

            go.State      = GameObjectState.Enabled;
            go.ScaleX     = 1.5f;
            go.GossipMenu = teleportMenu;
            return(go);
        }
Esempio n. 10
0
        /// <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(GameObject.Create(entry, map, spawnEntry, spawnPoint));
            }
            return((GameObject)null);
        }
Esempio n. 11
0
        public static void InitGOs()
        {
            _ulduarTeleport = GOMgr.GetEntry(GOEntryId.UlduarTeleporter);

            _ulduarTeleport.DefaultGossip = new GossipMenu(1,
                                                           new MultiStringGossipMenuItem(DefaultAddonLocalizer.Instance.GetTranslations(AddonMsgKey.NPCTiare),
                                                                                         convo => convo.Speaker.SpellCast.Trigger(SpellId.AntechamberTeleport, convo.Character))
                                                           );

            __doodadUlIniverseGlobe01 = GOMgr.GetEntry(GOEntryId.Doodad_UL_UniverseGlobe01);
        }
Esempio n. 12
0
        public static void RegisterEvents()
        {
            var consoleEntry = GOMgr.GetEntry(TonkControlConsoleGOEntryId);

            if (consoleEntry == null)
            {
                return;
            }
            consoleEntry.Used      += TonkConsoleUsed;
            consoleEntry.Activated += TonkConsoleActivated;
        }
Esempio n. 13
0
        protected override void AddSpawns()
        {
            neutralBannerSpawn = GOMgr.GetEntry(GOEntryId.BlacksmithBanner_2).FirstSpawnEntry;
            neutralAuraSpawn   = GOMgr.GetEntry(GOEntryId.NeutralBannerAura).SpawnEntries[(int)ArathiBases.Blacksmith];

            allianceBannerSpawn = GOMgr.GetEntry(GOEntryId.AllianceBanner_10).SpawnEntries[(int)ArathiBases.Blacksmith];
            allianceAuraSpawn   = GOMgr.GetEntry(GOEntryId.AllianceBannerAura).SpawnEntries[(int)ArathiBases.Blacksmith];

            hordeBannerSpawn = GOMgr.GetEntry(GOEntryId.HordeBanner_10).SpawnEntries[(int)ArathiBases.Blacksmith];
            hordeAuraSpawn   = GOMgr.GetEntry(GOEntryId.HordeBannerAura).SpawnEntries[(int)ArathiBases.Blacksmith];

            allianceAttackBannerSpawn = GOMgr.GetEntry(GOEntryId.ContestedBanner_26).SpawnEntries[(int)ArathiBases.Blacksmith];
            hordeAttackBannerSpawn    = GOMgr.GetEntry(GOEntryId.ContestedBanner_25).SpawnEntries[(int)ArathiBases.Blacksmith];
        }
Esempio n. 14
0
        public static void FixGOs()
        {
            GOEntry allianceDoorEntry = GOMgr.GetEntry(GOEntryId.ALLIANCEDOOR);
            GOEntry hordeDoorEntry    = GOMgr.GetEntry(GOEntryId.HORDEDOOR);

            allianceDoorEntry.FirstSpawnEntry.State = GameObjectState.Enabled;
            allianceDoorEntry.Flags |= GameObjectFlags.DoesNotDespawn | GameObjectFlags.InUse;
            allianceDoorEntry.FirstSpawnEntry.AutoSpawns = false;

            hordeDoorEntry.FirstSpawnEntry.State = GameObjectState.Enabled;
            hordeDoorEntry.Flags |= GameObjectFlags.DoesNotDespawn | GameObjectFlags.InUse;
            hordeDoorEntry.FirstSpawnEntry.AutoSpawns = false;

            GOEntry bersekerBuffEntry = GOMgr.GetEntry(GOEntryId.BerserkBuff_6);
            GOEntry foodBuffEntry     = GOMgr.GetEntry(GOEntryId.FoodBuff_5);
            GOEntry speedBuffEntry    = GOMgr.GetEntry(GOEntryId.SpeedBuff_3);

            GOEntry allianceAttackFlagEntry  = GOMgr.GetEntry(GOEntryId.ContestedBanner_26);
            GOEntry hordeControlledFlagEntry = GOMgr.GetEntry(GOEntryId.HordeBanner_10);

            GOEntry hordeAttackFlagEntry        = GOMgr.GetEntry(GOEntryId.ContestedBanner_25);
            GOEntry allianceControlledFlagEntry = GOMgr.GetEntry(GOEntryId.AllianceBanner_10);

            GOEntry farmBannerEntry       = GOMgr.GetEntry(GOEntryId.FarmBanner_2);
            GOEntry mineBannerEntry       = GOMgr.GetEntry(GOEntryId.MineBanner_2);
            GOEntry lumbermillBannerEntry = GOMgr.GetEntry(GOEntryId.LumberMillBanner_2);
            GOEntry stablesBannerEntry    = GOMgr.GetEntry(GOEntryId.StableBanner_2);
            GOEntry blacksmithBannerEntry = GOMgr.GetEntry(GOEntryId.BlacksmithBanner_2);

            GOEntry neutralBannerAuraEntry  = GOMgr.GetEntry(GOEntryId.NeutralBannerAura);
            GOEntry hordeBannerAuraEntry    = GOMgr.GetEntry(GOEntryId.HordeBannerAura);
            GOEntry allianceBannerAuraEntry = GOMgr.GetEntry(GOEntryId.AllianceBannerAura);

            farmBannerEntry.FirstSpawnEntry.AutoSpawns       = false;
            mineBannerEntry.FirstSpawnEntry.AutoSpawns       = false;
            lumbermillBannerEntry.FirstSpawnEntry.AutoSpawns = false;
            stablesBannerEntry.FirstSpawnEntry.AutoSpawns    = false;
            blacksmithBannerEntry.FirstSpawnEntry.AutoSpawns = false;

            allianceAttackFlagEntry.SpawnEntries.ForEach(spawn => spawn.AutoSpawns     = false);
            allianceControlledFlagEntry.SpawnEntries.ForEach(spawn => spawn.AutoSpawns = false);
            hordeAttackFlagEntry.SpawnEntries.ForEach(spawn => spawn.AutoSpawns        = false);
            hordeControlledFlagEntry.SpawnEntries.ForEach(spawn => spawn.AutoSpawns    = false);

            neutralBannerAuraEntry.SpawnEntries.ForEach(spawn => spawn.AutoSpawns  = false);
            hordeBannerAuraEntry.SpawnEntries.ForEach(spawn => spawn.AutoSpawns    = false);
            allianceBannerAuraEntry.SpawnEntries.ForEach(spawn => spawn.AutoSpawns = false);
        }
Esempio n. 15
0
            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.");
                }
            }
Esempio n. 16
0
        public static void InitGOs()
        {
            var cathedralDoorEntry = GOMgr.GetEntry(GOEntryId.HighInquisitorsDoor);

            if (cathedralDoorEntry != null)
            {
                cathedralDoorEntry.Activated += go =>
                {
                    var instance = go.Map as ScarletMonastery;
                    if (instance != null && instance.cathedralDoor == null)
                    {
                        // set the instance's Door object after the Door spawned
                        instance.cathedralDoor = go;
                    }
                };
            }
        }
Esempio n. 17
0
#pragma warning restore 0649

        #endregion

        protected WSGFaction(WarsongGulch instance,
                             SpellId flagSpell,
                             SpellId flagDropSpell,
                             SpellId flagDropDebuff,
                             SpellId flagCarrierDebuffSpellId,
                             GOEntryId flagStand,
                             GOEntryId flagDropId)
        {
            Instance                = instance;
            _flagSpell              = SpellHandler.Get(flagSpell);
            _flagDropSpell          = SpellHandler.Get(flagDropSpell);
            _flagDropDebuff         = SpellHandler.Get(flagDropDebuff);
            _flagCarrierDebuffSpell = SpellHandler.Get(flagCarrierDebuffSpellId);
            FlagStandEntry          = GOMgr.GetEntry(flagStand);
            DroppedFlagEntry        = GOMgr.GetEntry(flagDropId);

            _flagRespawnTime = WarsongGulch.FlagRespawnTimeMillis;
            Score            = 0;
        }
Esempio n. 18
0
        public static void RegisterEvents()
        {
            var blastenheimer5000Elwynn   = GOMgr.GetEntry(Blastenheimer5000ElwynnId) as GOGooberEntry;
            var blastenheimer5000Terokkar = GOMgr.GetEntry(Blastenheimer5000TerokkarId) as GOGooberEntry;
            var blastenheimer5000Mulgore  = GOMgr.GetEntry(Blastenheimer5000MulgoreId) as GOGooberEntry;

            if (blastenheimer5000Elwynn != null)
            {
                blastenheimer5000Elwynn.Used += Blastenheimer5000Used;
            }
            if (blastenheimer5000Terokkar != null)
            {
                blastenheimer5000Terokkar.Used += Blastenheimer5000Used;
            }
            if (blastenheimer5000Mulgore != null)
            {
                blastenheimer5000Mulgore.Used += Blastenheimer5000Used;
            }
        }
Esempio n. 19
0
        /// <summary>Finalize this GOSpawnEntry</summary>
        /// <param name="addToPool">If set to false, will not try to add it to any pool (recommended for custom GOSpawnEntry that share a pool)</param>
        public override void FinalizeDataHolder(bool addToPool)
        {
            if (Entry == null)
            {
                Entry = GOMgr.GetEntry(EntryId, false);
                if (Entry == null)
                {
                    ContentMgr.OnInvalidDBData("{0} had an invalid EntryId.", (object)this);
                    return;
                }
            }

            if (Scale == 0.0)
            {
                Scale = 1f;
            }
            if (EntryId == GOEntryId.Loot)
            {
                EntryId = (GOEntryId)EntryIdRaw;
            }
            else
            {
                EntryIdRaw = (uint)EntryId;
            }
            if (Rotations == null)
            {
                Rotations = new float[4];
            }
            base.FinalizeDataHolder(addToPool);
            if (MapId == MapId.End || MapId == MapId.None)
            {
                return;
            }
            Entry.SpawnEntries.Add(this);
            ArrayUtil.Set(ref GOMgr.SpawnEntries, SpawnId, this);
            if (!addToPool)
            {
                return;
            }
            AddToPoolTemplate();
        }
        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;
        }
Esempio n. 22
0
        public override void Apply()
        {
            var goId    = (GOEntryId)Effect.MiscValue;
            var goEntry = GOMgr.GetEntry(goId);
            var caster  = m_cast.CasterUnit;

            if (goEntry != null)
            {
                if (Cast.TargetLoc.X != 0)
                {
                    var worldLocation = new WorldLocation(caster.Map, Cast.TargetLoc);
                    go = goEntry.Spawn(worldLocation);
                }
                else
                {
                    go = goEntry.Spawn(caster, null);
                }

                go.State       = GameObjectState.Enabled;
                go.Orientation = caster.Orientation;
                go.ScaleX      = 1;
            }
        }
Esempio n. 23
0
        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);
            }
        }
Esempio n. 24
0
        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);
            }
        }
Esempio n. 25
0
        public override void Apply()
        {
            var goId    = (GOEntryId)Effect.MiscValue;
            var goEntry = GOMgr.GetEntry(goId);
            var caster  = m_cast.CasterUnit;

            if (goEntry != null)
            {
                GO             = goEntry.Spawn(caster, caster);
                GO.State       = GameObjectState.Enabled;
                GO.Orientation = caster.Orientation;
                GO.ScaleX      = 1;
                GO.Faction     = caster.Faction;
                GO.CreatedBy   = caster.EntityId;

                // TODO: Handle SummoningRitualHandler properly
                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)
                {
                    // not channelled: Activate decay delay
                    GO.RemainingDecayDelayMillis = Effect.Spell.Durations.Random();
                }
            }
            else
            {
                log.Error("Summoning Spell {0} refers to invalid Object: {1} ({2})", Effect.Spell, goId, (uint)goId);
            }
        }
Esempio n. 26
0
        public void SpawnAllianceBerserkerBuff()
        {
            GOEntry allianceBerserkerBuff = GOMgr.GetEntry(GOEntryId.BerserkBuff_2);

            _allianceBerserkerBuff = allianceBerserkerBuff.FirstSpawnEntry.Spawn(this);
        }
Esempio n. 27
0
        public void SpawnAllianceFoodBuff()
        {
            GOEntry allianceFoodBuff = GOMgr.GetEntry(GOEntryId.FoodBuff_2);

            _allianceFoodBuff = allianceFoodBuff.FirstSpawnEntry.Spawn(this);
        }
Esempio n. 28
0
        public void SpawnHordeBerserkerBuff()
        {
            GOEntry hordeBerserkerBuff = GOMgr.GetEntry(GOEntryId.BerserkBuff);

            _hordeBerserkerBuff = hordeBerserkerBuff.FirstSpawnEntry.Spawn(this);
        }
Esempio n. 29
0
        public void SpawnHordeFoodBuff()
        {
            GOEntry hordeFoodBuff = GOMgr.GetEntry(GOEntryId.FoodBuff);

            _hordeFoodBuff = hordeFoodBuff.FirstSpawnEntry.Spawn(this);
        }
Esempio n. 30
0
        /// <summary>
        /// Finalize this GOSpawnEntry
        /// </summary>
        /// <param name="addToPool">If set to false, will not try to add it to any pool (recommended for custom GOSpawnEntry that share a pool)</param>
        public override void FinalizeDataHolder(bool addToPool)
        {
            // get Entry
            if (Entry == null)
            {
                Entry = GOMgr.GetEntry(EntryId, false);
                if (Entry == null)
                {
                    ContentMgr.OnInvalidDBData("{0} had an invalid EntryId.", this);
                    return;
                }
            }

            // fix data inconsistencies
            if (Scale == 0)
            {
                Scale = 1;
            }

            if (EntryId == 0)
            {
                EntryId = (GOEntryId)EntryIdRaw;
            }
            else
            {
                EntryIdRaw = (uint)EntryId;
            }

            if (Rotations == null)
            {
                Rotations = new float[GOConstants.MaxRotations];
            }

            //GOMgr.Templates.Add(Id, this);

            // do the default thing
            base.FinalizeDataHolder(addToPool);

            if (MapId != MapId.End)
            {
                // valid map
                Entry.SpawnEntries.Add(this);

                // add to list of GOSpawnEntries
                ArrayUtil.Set(ref GOMgr.SpawnEntries, SpawnId, this);

                if (addToPool)
                {
                    // add to pool
                    AddToPoolTemplate();
                }
            }

            // Is this GO associated with an event
            if (_eventId != 0)
            {
                // The event id loaded can be negative if this
                // entry is expected to despawn during an event
                var eventId = (uint)Math.Abs(_eventId);

                //Check if the event is valid
                var worldEvent = WorldEventMgr.GetEvent(eventId);
                if (worldEvent != null)
                {
                    // Add this GO to the list of related spawns
                    // for the given world event
                    var eventGO = new WorldEventGameObject()
                    {
                        _eventId = _eventId, EventId = eventId, Guid = SpawnId, Spawn = _eventId > 0
                    };

                    worldEvent.GOSpawns.Add(eventGO);
                }
                EventId = eventId;
            }
        }