private void ExplodeFlags()
        {
            GroundTarget gt1 = new GroundTarget(Flags[0].WorldPosition, GameObjectService.GetGameObjectProto(23));

            Region.AddObject(gt1, 230);

            GroundTarget gt2 = new GroundTarget(Flags[1].WorldPosition, GameObjectService.GetGameObjectProto(23));

            Region.AddObject(gt2, 230);

            GroundTarget gt3 = new GroundTarget(new Point3D(364572, 365590, 12036), GameObjectService.GetGameObjectProto(23));

            Region.AddObject(gt3, 230);


            EvtInterface.AddEvent(() =>
            {
                Explosion(gt1);
                Explosion(gt2);
                Explosion(gt3);
            }, 1000, 1);

            //remove ground targets after explosions
            EvtInterface.AddEvent(() =>
            {
                gt1.RemoveFromWorld();
                gt2.RemoveFromWorld();
                gt3.RemoveFromWorld();
            }, 10000, 1);

            EvtInterface.AddEvent(Unlock, 5000, 1);
        }
示例#2
0
        private void CreateGlow(ClickFlag flag)
        {
            if (_glowObject != null)
            {
                _glowObject.RemoveFromWorld();
            }
            // Spawn objective glow (Big Poofy Glowy Nuet)
            GameObject_proto glowProto = GameObjectService.GetGameObjectProto(99858);

            if (glowProto != null)
            {
                GameObject_spawn spawn = new GameObject_spawn
                {
                    Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                    WorldO = flag.Heading,
                    WorldX = flag.WorldPosition.X,
                    WorldY = flag.WorldPosition.Y,
                    WorldZ = (ushort)flag.WorldPosition.Z,
                    ZoneId = Region.RegionId,
                };
                spawn.BuildFromProto(glowProto);

                _glowObject          = new GameObject(spawn);
                _glowObject.VfxState = (byte)flag.Owner;
                Region.AddObject(_glowObject, spawn.ZoneId);
            }
        }
        public DominationScenarioKhaine(Scenario_Info info, int tier)
            : base(info, tier)
        {
            foreach (Scenario_Object scenarioObject in info.ScenObjects.OrderBy(e => e.Identifier).ToList())
            {
                if (scenarioObject.Type == "Flag")
                {
                    ClickFlag clickFlag = new ClickFlag(scenarioObject.Identifier, scenarioObject.ObjectiveName,
                                                        scenarioObject.WorldPosX, scenarioObject.WorldPosY, scenarioObject.PosZ, scenarioObject.Heading,
                                                        scenarioObject.PointGain, scenarioObject.PointOverTimeGain, new ClickFlag.ClickFlagDelegate(OnHold), new ClickFlag.ClickFlagDelegate(OnCaptured));
                    Flags.Add(clickFlag);
                    Region.AddObject(clickFlag, info.MapId);

                    clickFlag.Open            = true;
                    clickFlag.Owner           = 0;
                    clickFlag.ShowGlow        = true;
                    clickFlag.HoldDuration    = 0;
                    clickFlag.CaptureCastTime = 10;
                }
                else
                {
                    LoadScenarioObject(scenarioObject);
                }
            }
        }
        public void CreateGlow()
        {
            if (Region != null)
            {
                if (_glowObject != null)
                {
                    _glowObject.RemoveFromWorld();
                }
                // Spawn objective glow (Big Poofy Glowy Nuet)
                GameObject_proto glowProto = GameObjectService.GetGameObjectProto(99858);

                if (glowProto != null)
                {
                    GameObject_spawn spawn = new GameObject_spawn
                    {
                        Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                        WorldO = Heading,
                        WorldX = _x,
                        WorldY = _y,
                        WorldZ = _z,
                        ZoneId = Region.RegionId,
                    };
                    spawn.BuildFromProto(glowProto);

                    _glowObject          = new GameObject(spawn);
                    _glowObject.VfxState = (byte)GlowOwner;

                    Region.AddObject(_glowObject, spawn.ZoneId);
                }
            }
        }
        private void CreateSalvage(int x, int y, int z, int o)
        {
            if (_salvage != null)
            {
                _salvage.RemoveFromWorld();
            }

            GameObject_proto glowProto = GameObjectService.GetGameObjectProto(100598);

            GameObject_spawn spawn = new GameObject_spawn
            {
                Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                WorldO = 0,
                WorldX = x,
                WorldY = y,
                WorldZ = (ushort)z,
                ZoneId = Region.RegionId,
            };

            spawn.BuildFromProto(glowProto);

            _salvage = new Part(spawn, FLAG_EFFECTS.Mball1, 2000, 2000)
            {
                PickedUp   = new Part.PartDelegate(SalvagePickedUp),
                DroppedOff = new Part.PartDelegate(SalvageDroppedOff),
                Lost       = new Part.PartDelegate(SalvageLost)
            };
            Region.AddObject(_salvage, spawn.ZoneId);
        }
        /// <summary>
        /// Loads keeps, keep units and doors.
        /// </summary>
        private void LoadKeeps()
        {
            List <Keep_Info> keeps = BattlefrontService.GetKeepInfos(Region.RegionId);

            if (keeps == null)
            {
                return; // t1 or database lack
            }
            foreach (Keep_Info info in keeps)
            {
                Keep keep = new Keep(info, (byte)this.Tier, Region);
                keep.Realm = (Realms)keep.Info.Realm;
                _Keeps.Add(keep);
                Region.AddObject(keep, info.ZoneId);

                if (info.Creatures != null)
                {
                    foreach (Keep_Creature crea in info.Creatures)
                    {
                        keep.Creatures.Add(new KeepNpcCreature(Region, crea, keep));
                    }
                }

                if (info.Doors != null)
                {
                    foreach (Keep_Door door in info.Doors)
                    {
                        keep.Doors.Add(new KeepDoor(Region, door, keep));
                    }
                }
            }
        }
        private void AddGlow(Realms assaultingRealm)
        {
            GameObject_proto glowProto = GameObjectService.GetGameObjectProto(99858); //99858

            if (glowProto != null)
            {
                GameObject_spawn spawn = new GameObject_spawn
                {
                    Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                    WorldO = Heading,
                    WorldX = WorldPosition.X,
                    WorldY = WorldPosition.Y,
                    WorldZ = WorldPosition.Z,
                    ZoneId = ZoneId,
                };
                spawn.BuildFromProto(glowProto);

                var siegeRangeFlag = new GameObject(spawn);
                if (assaultingRealm == Realms.REALMS_REALM_DESTRUCTION)
                {
                    siegeRangeFlag.VfxState = 2; //1 blue, 2 red, 3 white, 4 - white;
                }
                else
                {
                    siegeRangeFlag.VfxState = 1; //1 blue, 2 red, 3 white, 4 - white;
                }
                Region.AddObject(siegeRangeFlag, ZoneId);
            }
        }
示例#8
0
        public FlagDominationScenario(Scenario_Info info, int tier)
            : base(info, tier)
        {
            foreach (Scenario_Object obj in info.ScenObjects)
            {
                if (obj.Type == "Capture Point")
                {
                    CapturePoint cPoint = new CapturePoint(obj, CaptureValid, OnCapture);
                    _capturePoints.Add(cPoint);
                    Region.AddObject(cPoint, info.MapId);
                }

                else if (obj.Type == "Flag")
                {
                    _flag = new HoldObject(obj.Identifier, obj.ObjectiveName, new Point3D(obj.WorldPosX, obj.WorldPosY, obj.PosZ), 60001, 13000, FlagPickedUp, ObjectDropped, ObjectReset, null, 299, 299);
                    Region.AddObject(_flag, info.MapId);
                    AddTrackedObject(_flag);
                }

                else
                {
                    LoadScenarioObject(obj);
                }
            }

            ZoneMgr curZone = Region.GetZoneMgr(Info.MapId);

            Region.LoadCells((ushort)(curZone.Info.OffX + 8), (ushort)(curZone.Info.OffY + 8), 8);
        }
示例#9
0
        protected override void SetDeath(Unit killer)
        {
            Health = 0;

            States.Add((byte)CreatureState.Dead);

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(killer.IsPet() ? killer.GetPet().Owner.Oid : killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            AbtInterface.Cancel(true);
            ScrInterface.OnDie(this);


            BuffInterface.RemoveBuffsOnDeath();

            EvtInterface.Notify(EventName.OnDie, this, killer);

            Pet    pet      = killer as Pet;
            Player credited = (pet != null) ? pet.Owner : (killer as Player);

            if (credited != null)
            {
                HandleDeathRewards(credited);
            }

            AiInterface.ProcessCombatEnd();

            SetRespawnTimer();

            EvtInterface.RemoveEventNotify(EventName.OnReceiveDamage, OnReceiveDamage);

            if (!FlagGuard.Info.KeepLord)
            {
                _keep.OnKeepNpcAttacked(0);
                return;
            }

            /*Log.Info(_keep.Info.Name, (_keep.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction") + " keep lord slain by " + killer.Name + " of " + (killer.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction"));*/

            if (_keep.Realm == killer.Realm)
            {
                /*if (FlagGuard.Info.KeepLord)
                 *  Log.Info(_keep.Info.Name, (_keep.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction") + " keep lord respawned.");*/
                _logger.Debug($"Kill request from own realm {killer.Name} {_keep.Realm}");
                FlagGuard.Creature = new KeepCreature(Spawn, FlagGuard, _keep);
                Region.AddObject(FlagGuard.Creature, Spawn.ZoneId);
                Destroy();
            }
            else
            {
                _keep.OnLordKilled();
            }
        }
示例#10
0
        public override void RezUnit()
        {
            FlagGrd.UpdateFlagOwningRealm();

            FlagGrd.Creature = new GuardCreature(Spawn, FlagGrd);
            Region.AddObject(FlagGrd.Creature, Spawn.ZoneId);
            Destroy();
        }
示例#11
0
        public InstanceBossSpawn RezInstanceSpawn()
        {
            InstanceBossSpawn newCreature = new InstanceBossSpawn(Spawn, BossId, InstanceID, Instance);

            Region.AddObject(newCreature, Spawn.ZoneId);
            Destroy();
            return(newCreature);
        }
示例#12
0
        public override void RezUnit()
        {
            Objective.ActiveCreatures.Remove(this);
            PQuestCreature NewCreatue = new PQuestCreature(Spawn, Objective);

            Objective.ActiveCreatures.Add(NewCreatue);
            Region.AddObject((Object)NewCreatue, Spawn.ZoneId);
            Dispose();
        }
示例#13
0
        //public override ushort GetStrikeDamage()
        //{
        //    ushort strikeDamage = (ushort)(50f * Level); // Normal NPC
        //    switch (DefenceRank)
        //    {
        //        case 1: strikeDamage = (ushort)(120f * Level); break; // Champ
        //        case 2: strikeDamage = (ushort)(300f * Level); break; // Hero
        //        case 3: strikeDamage = (ushort)(700f * Level); break; // Lord
        //    }

        //    if (Spawn.Proto.WeaponDPS != 0)
        //        strikeDamage = (ushort)(Spawn.Proto.WeaponDPS * Level); // Override

        //    return strikeDamage;
        //}

        public override void RezUnit()
        {
            // Keep lord dosent respawn;
            if (FlagGuard.Info.KeepLord)
            {
                return;
            }

            FlagGuard.Creature = new KeepCreature(Spawn, FlagGuard, _keep);
            Region.AddObject(FlagGuard.Creature, Spawn.ZoneId);
            Destroy();
        }
示例#14
0
        protected override void SetDeath(Unit killer)
        {
            Health = 0;

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(killer.IsPet() ? killer.GetPet().Owner.Oid : killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            AbtInterface.Cancel(true);
            ScrInterface.OnDie(this);
            BuffInterface.RemoveBuffsOnDeath();

            EvtInterface.Notify(EventName.OnDie, this, killer);

            Pet    pet      = killer as Pet;
            Player credited = (pet != null) ? pet.Owner : (killer as Player);

            if (credited != null)
            {
                HandleDeathRewards(credited);
            }

            ClearTrackedDamage();

            _buildState = EConstructionState.Destroying;

            foreach (Player plr in _interactors)
            {
                plr.Palisade = null;
            }

            _interactors.Clear();

            foreach (NewBuff buff in _interactionBuffs)
            {
                buff.BuffHasExpired = true;
            }

            _interactionBuffs.Clear();

            GroundTarget gt = new GroundTarget(_constructor, new Point3D(WorldPosition), GameObjectService.GetGameObjectProto(23));

            Region.AddObject(gt, Zone.ZoneId);

            gt.BuffInterface.QueueBuff(new BuffQueueInfo(_constructor, 40, AbilityMgr.GetBuffInfo(23762)));

            gt.SetExpiry(TCPManager.GetTimeStampMS() + 5000);
        }
示例#15
0
            public override void RezUnit()
            {
                _keepDoor.GameObject = new KeepGameObject(Spawn, _keepDoor, _keep);
                Region.AddObject(_keepDoor.GameObject, Spawn.ZoneId);

                Occlusion.SetFixtureVisible(_keepDoor.Info.DoorId, true);
                Destroy();

                //if (_keepDoor.Info.Number == (int)KeepDoorType.OuterMain && _keep.LastMessage >= Keep.KeepMessage.Outer0)
                //    _keep.LastMessage = Keep.KeepMessage.Safe;
                //else if (_keepDoor.Info.Number == (int)KeepDoorType.InnerMain && _keep.LastMessage >= Keep.KeepMessage.Inner0)
                //    _keep.LastMessage = Keep.KeepMessage.Outer0;
            }
示例#16
0
 public override void RezUnit()
 {
     if (_objective.Objective.NoRespawn != 1 && this.Spawn.NoRespawn != 1)
     {
         lock (_objective.ActiveCreatures) {
             _objective.ActiveCreatures.Remove(this);
             PQuestCreature newCreature = new PQuestCreature(Spawn, _objective, _publicQuest);
             newCreature.PQSpawnId = this.PQSpawnId;
             _objective.ActiveCreatures.Add(newCreature);
             Region.AddObject(newCreature, Spawn.ZoneId);
         }
         Destroy();
     }
 }
示例#17
0
            public override void RezUnit()
            {
                _keepDoor.GameObject = new KeepGameObject(Spawn, _keepDoor, _keep);
                Region.AddObject(_keepDoor.GameObject, Spawn.ZoneId);

                WarZoneLib.RegionData.HideDoor(false, Spawn.ZoneId, _keepDoor.Info.DoorId);
                Destroy();

                if (_keepDoor.Info.Number == (int)KeepDoorType.OuterMain && _keep.LastMessage >= Keep.KeepMessage.Outer0)
                {
                    _keep.LastMessage = Keep.KeepMessage.Safe;
                }
                else if (_keepDoor.Info.Number == (int)KeepDoorType.InnerMain && _keep.LastMessage >= Keep.KeepMessage.Inner0)
                {
                    _keep.LastMessage = Keep.KeepMessage.Outer0;
                }
            }
        public CaptureTheFlagScenario(Scenario_Info info, byte tier) : base(info, tier)
        {
            foreach (Scenario_Object obj in info.ScenObjects)
            {
                if (obj.Type == "Flag")
                {
                    HoldObject flag = new HoldObject(obj.Identifier, obj.ObjectiveName, new Point3D(obj.WorldPosX, obj.WorldPosY, obj.PosZ), 60001, 13000, ObjectPickedUp, FlagDropped, FlagReset, FlagBuffAssigned, 3442, 3442);

                    if (obj.ObjectiveName == "Order Flag")
                    {
                        flag.VfxState = 2;
                        _captureScore = obj.PointGain;
                        flag.SetActive(Realms.REALMS_REALM_DESTRUCTION);
                    }

                    else if (obj.ObjectiveName == "Destruction Flag")
                    {
                        flag.VfxState = 5;
                        _captureScore = obj.PointGain;
                        flag.SetActive(Realms.REALMS_REALM_ORDER);
                    }

                    else
                    {
                        flag.SetActive(0);
                        flag.HoldResetTimeSeconds = 180;
                        _captureScore             = obj.PointGain;
                    }

                    flag.ObjectType = 1;

                    _flags.Add(flag);
                    Region.AddObject(flag, info.MapId);
                    AddTrackedObject(flag);
                }
                else
                {
                    LoadScenarioObject(obj);
                }

                ZoneMgr curZone = Region.GetZoneMgr(Info.MapId);

                Region.LoadCells((ushort)(curZone.Info.OffX + 8), (ushort)(curZone.Info.OffY + 8), 8);
            }
        }
示例#19
0
        public DominationScenarioPushCenter(Scenario_Info info, int tier)
            : base(info, tier)
        {
            int i         = 0;
            int flagCount = info.ScenObjects.Where(e => e.Type == "Flag").ToList().Count;

            foreach (Scenario_Object scenarioObject in info.ScenObjects.OrderBy(e => e.Identifier).ToList())
            {
                if (scenarioObject.Type == "Flag")
                {
                    ClickFlag clickFlag = new ClickFlag(scenarioObject.Identifier, scenarioObject.ObjectiveName,
                                                        scenarioObject.WorldPosX, scenarioObject.WorldPosY, scenarioObject.PosZ, scenarioObject.Heading,
                                                        scenarioObject.PointGain, scenarioObject.PointOverTimeGain, new ClickFlag.ClickFlagDelegate(OnHold), new ClickFlag.ClickFlagDelegate(OnCaptured));
                    Flags.Add(clickFlag);
                    Region.AddObject(clickFlag, info.MapId);

                    clickFlag.Open = false;

                    if (i < (flagCount / 2))
                    {
                        clickFlag.Open  = false;
                        clickFlag.Owner = 1;
                    }
                    else if (i == flagCount / 2)
                    {
                        clickFlag.Open  = true;
                        clickFlag.Owner = 0;
                        CurrentFlag     = clickFlag;
                        CreateGlow(CurrentFlag);
                    }
                    else
                    {
                        clickFlag.Open  = false;
                        clickFlag.Owner = 2;
                    }
                    i++;
                }

                else
                {
                    LoadScenarioObject(scenarioObject);
                }
            }
        }
        public DoubleDominationScenario(Scenario_Info info, int tier)
            : base(info, tier)
        {
            //flags.Add(new Flag(RKF_1, "The Landing", 360109, 428854, 6433, 1024));

            foreach (Scenario_Object scenarioObject in info.ScenObjects)
            {
                if (scenarioObject.Type == "Capture Point")
                {
                    CapturePoint cPoint = new CapturePoint(scenarioObject, null, OnCapture);
                    _capturePoints.Add(cPoint);
                    Region.AddObject(cPoint, info.MapId);
                }

                else
                {
                    LoadScenarioObject(scenarioObject);
                }
            }
        }
示例#21
0
        public override void OnLoad()
        {
            X = Zone.CalculPin((uint)HomePosition.X, true);
            Y = Zone.CalculPin((uint)HomePosition.Y, false);
            Z = HomePosition.Z;

            base.OnLoad();

            WorldPosition.SetCoordsFrom(HomePosition);

            HomePosition = new Point3D(WorldPosition);

            SetOffset((ushort)(HomePosition.X >> 12), (ushort)(HomePosition.Y >> 12));

            // Spawn objective glow (Big Poofy Glowy Nuet)
            GameObject_proto glowProto = GameObjectService.GetGameObjectProto(99858);

            if (glowProto == null)
            {
                return;
            }

            GameObject_spawn spawn = new GameObject_spawn
            {
                Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                WorldO = Heading,
                WorldY = WorldPosition.Y + 2,
                WorldZ = WorldPosition.Z,
                WorldX = WorldPosition.X + 6,
                ZoneId = Zone.ZoneId,
            };

            spawn.BuildFromProto(glowProto);

            _glowObject = new GameObject(spawn);

            SetGlowColorFor(RealmCapturableFor);

            Region.AddObject(_glowObject, spawn.ZoneId);
        }
示例#22
0
        public DominationScenarioPush(Scenario_Info info, int tier)
            : base(info, tier)
        {
            //flags.Add(new Flag(RKF_1, "The Landing", 360109, 428854, 6433, 1024));

            FlagLevel[0] = new List <ProximityFlag>();
            FlagLevel[1] = new List <ProximityFlag>();
            FlagLevel[2] = new List <ProximityFlag>();

            foreach (Scenario_Object scenarioObject in info.ScenObjects)
            {
                Log.Info("DominationScenarioPush", "Adding flag " + scenarioObject.ObjectiveName + " realm:" + scenarioObject.Realm);
                if (scenarioObject.Type == "Flag")
                {
                    ProximityFlag proximityFlag = new ProximityFlag(scenarioObject.Identifier, scenarioObject.ObjectiveName,
                                                                    scenarioObject.WorldPosX, scenarioObject.WorldPosY, scenarioObject.PosZ, scenarioObject.Heading,
                                                                    scenarioObject.PointGain, scenarioObject.PointOverTimeGain, scenarioObject);
                    Flags.Add(proximityFlag);
                    Region.AddObject(proximityFlag, info.MapId);

                    if (scenarioObject.Realm == 0)
                    {
                        FlagLevel[1].Add(proximityFlag);
                    }
                    else if (scenarioObject.Realm == 1)
                    {
                        FlagLevel[0].Add(proximityFlag);
                    }
                    else if (scenarioObject.Realm == 2)
                    {
                        FlagLevel[2].Add(proximityFlag);
                    }
                }

                else
                {
                    LoadScenarioObject(scenarioObject);
                }
            }
        }
        private void CreateBomb(int x, int y, int z, int o)
        {
            _carrier = null;
            if (_bomb != null)
            {
                _bomb.RemoveFromWorld();
                _bomb = null;
            }
            if (_carrier != null)
            {
                _carrier.OSInterface.RemoveEffect((byte)0xB);
                _carrier = null;
            }

            GameObject_proto glowProto = GameObjectService.GetGameObjectProto(100112);

            GameObject_spawn spawn = new GameObject_spawn
            {
                Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                WorldO = 0,
                WorldX = x,
                WorldY = y,
                WorldZ = (ushort)z,
                ZoneId = Region.RegionId,
            };

            spawn.BuildFromProto(glowProto);

            _bomb = new Part(spawn, FLAG_EFFECTS.Bomb, 2000, 2000)
            {
                PickedUp   = new Part.PartDelegate(BombPickedUp),
                DroppedOff = new Part.PartDelegate(BombDroppedOff),
                Lost       = new Part.PartDelegate(BombLost)
            };
            Region.AddObject(_bomb, spawn.ZoneId);
            if (_centerGlow != null)
            {
                _centerGlow.VfxState = 0;
            }
        }
        public MurderballScenario(Scenario_Info info, int tier)
            : base(info, tier)
        {
            foreach (Scenario_Object obj in info.ScenObjects)
            {
                HoldObject ball;

                if (obj.ProtoEntry != 0)
                {
                    GameObject_proto proto = GameObjectService.GetGameObjectProto(obj.ProtoEntry);

                    ball = new HoldObject(obj.Identifier, obj.ObjectiveName, new Point3D(obj.WorldPosX, obj.WorldPosY, obj.PosZ), 14031, 30000, BallPickedUp, BallDropped, ObjectReset, BallBuffAssigned, proto.DisplayID, proto.DisplayID);
                }
                else
                {
                    ball = new HoldObject(obj.Identifier, obj.ObjectiveName, new Point3D(obj.WorldPosX, obj.WorldPosY, obj.PosZ), 14031, 30000, BallPickedUp, BallDropped, ObjectReset, BallBuffAssigned, 235, 233);
                }

                _murderballTicks.Add(ball, 0);
                Region.AddObject(ball, info.MapId);
            }
        }
        /// <summary>
        /// Loads battlefront objectives.
        /// </summary>

        private void LoadObjectives()
        {
            List <Battlefront_Objective> objectives = BattlefrontService.GetBattlefrontObjectives(Region.RegionId);

            if (objectives == null)
            {
                return; // t1 or database lack
            }
            float orderDistanceSum  = 0f;
            float destroDistanceSum = 0f;

            foreach (Battlefront_Objective obj in objectives)
            {
                NewDawnBattlefieldObjective flag = new NewDawnBattlefieldObjective(obj, Region.GetTier());
                Objectives.Add(flag);
                Region.AddObject(flag, obj.ZoneId);
                flag.Battlefront = this;

                //orderDistanceSum += flag.GetWarcampDistance(Realms.REALMS_REALM_ORDER);
                //destroDistanceSum += flag.GetWarcampDistance(Realms.REALMS_REALM_DESTRUCTION);
            }
        }
        private GameObject AddObject(int x, int y, int z, int o, uint entry)
        {
            GameObject_proto glowProto = GameObjectService.GetGameObjectProto(entry);

            GameObject_spawn spawn = new GameObject_spawn
            {
                Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                WorldO = o,
                WorldX = x,
                WorldY = y,
                WorldZ = (ushort)z,
                ZoneId = Region.RegionId,
            };

            spawn.BuildFromProto(glowProto);

            var obj = new GameObject(spawn);

            Region.AddObject(obj, spawn.ZoneId);

            return(obj);
        }
        public DominationScenario(Scenario_Info info, int tier)
            : base(info, tier)
        {
            //flags.Add(new Flag(RKF_1, "The Landing", 360109, 428854, 6433, 1024));

            foreach (Scenario_Object scenarioObject in info.ScenObjects)
            {
                if (scenarioObject.Type == "Flag")
                {
                    ProximityFlag proximityFlag = new ProximityFlag(scenarioObject.Identifier, scenarioObject.ObjectiveName,
                                                                    scenarioObject.WorldPosX, scenarioObject.WorldPosY, scenarioObject.PosZ, scenarioObject.Heading,
                                                                    scenarioObject.PointGain, scenarioObject.PointOverTimeGain);
                    Flags.Add(proximityFlag);
                    Region.AddObject(proximityFlag, info.MapId);
                }

                else
                {
                    LoadScenarioObject(scenarioObject);
                }
            }
        }
示例#28
0
        public override void OnLoad()
        {
            Z = _z;
            X = Zone.CalculPin((uint)_x, true);
            Y = Zone.CalculPin((uint)_y, false);
            base.OnLoad();

            Heading         = (ushort)_o;
            WorldPosition.X = _x;
            WorldPosition.Y = _y;
            WorldPosition.Z = _z;

            SetOffset((ushort)(_x >> 12), (ushort)(_y >> 12));

            IsActive = true;

            // Spawn objective glow (Big Poofy Glowy Nuet)
            GameObject_proto glowProto = GameObjectService.GetGameObjectProto(99858);

            if (glowProto == null)
            {
                return;
            }

            GameObject_spawn spawn = new GameObject_spawn
            {
                Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                WorldO = Heading,
                WorldY = WorldPosition.Y,
                WorldZ = WorldPosition.Z - 256,
                WorldX = WorldPosition.X,
                ZoneId = Zone.ZoneId,
            };

            spawn.BuildFromProto(glowProto);

            _glowObject = new GameObject(spawn);
            Region.AddObject(_glowObject, spawn.ZoneId);
        }
示例#29
0
        public void createPenulums()
        {
            GameObject_proto proto;

            GameObjectService.GameObjectProtos.TryGetValue(98908, out proto);

            Firetrap ft;
            Pendulum go;
            DartTrap dt;

            //left side
            go            = new Pendulum(proto, 2, 348784, 282876, 12659);
            _Pendulums[0] = go;
            Region.AddObject(go, ZoneID, true);
            go            = new Pendulum(proto, 0, 348664, 282876, 12659);
            _Pendulums[2] = go;
            Region.AddObject(go, ZoneID, true);
            go            = new Pendulum(proto, 0, 348544, 282876, 12659);
            _Pendulums[4] = go;
            Region.AddObject(go, ZoneID, true);
            go            = new Pendulum(proto, 2, 348424, 282876, 12659);
            _Pendulums[6] = go;
            Region.AddObject(go, ZoneID, true);
            go            = new Pendulum(proto, 2, 348304, 282876, 12659);
            _Pendulums[8] = go;
            Region.AddObject(go, ZoneID, true);
            go             = new Pendulum(proto, 0, 348184, 282876, 12659);
            _Pendulums[10] = go;
            Region.AddObject(go, ZoneID, true);

            //rightside

            go            = new Pendulum(proto, 0, 348784, 280031, 12659);
            _Pendulums[1] = go;
            Region.AddObject(go, ZoneID, true);
            go            = new Pendulum(proto, 2, 348664, 280031, 12659);
            _Pendulums[3] = go;
            Region.AddObject(go, ZoneID, true);
            go            = new Pendulum(proto, 0, 348544, 280031, 12659);
            _Pendulums[5] = go;
            Region.AddObject(go, ZoneID, true);
            go            = new Pendulum(proto, 2, 348424, 280031, 12659);
            _Pendulums[7] = go;
            Region.AddObject(go, ZoneID, true);
            go            = new Pendulum(proto, 2, 348304, 280031, 12659);
            _Pendulums[9] = go;
            Region.AddObject(go, ZoneID, true);
            go             = new Pendulum(proto, 0, 348184, 280031, 12659);
            _Pendulums[11] = go;
            Region.AddObject(go, ZoneID, true);


            //firetraps
            //frontrow
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft           = new Firetrap(proto, 341050, 276799, 13371);
            _Firetrap[0] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft           = new Firetrap(proto, 341050, 276932, 13371);
            _Firetrap[1] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft           = new Firetrap(proto, 341050, 277329, 13371);
            _Firetrap[2] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft           = new Firetrap(proto, 341050, 277197, 13371);
            _Firetrap[3] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft           = new Firetrap(proto, 341050, 277065, 13371);
            _Firetrap[4] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft           = new Firetrap(proto, 341182, 276799, 13371);
            _Firetrap[5] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft           = new Firetrap(proto, 341182, 276932, 13371);
            _Firetrap[6] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft           = new Firetrap(proto, 341182, 277329, 13371);
            _Firetrap[7] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft           = new Firetrap(proto, 341182, 277197, 13371);
            _Firetrap[8] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft           = new Firetrap(proto, 341182, 277065, 13371);
            _Firetrap[9] = ft;
            Region.AddObject(ft, ZoneID, true);

            //backrow

            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342397, 276799, 13371);
            _Firetrap[10] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342397, 276932, 13371);
            _Firetrap[11] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342397, 277329, 13371);
            _Firetrap[12] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342397, 277197, 13371);
            _Firetrap[13] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342397, 277065, 13371);
            _Firetrap[14] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342529, 276799, 13371);
            _Firetrap[15] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342529, 276932, 13371);
            _Firetrap[16] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342529, 277329, 13371);
            _Firetrap[17] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342529, 277197, 13371);
            _Firetrap[18] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342529, 277065, 13371);
            _Firetrap[19] = ft;
            Region.AddObject(ft, ZoneID, true);

            //mainfield

            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341458, 276866, 13406);
            _Firetrap[20] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341458, 277131, 13406);
            _Firetrap[21] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341458, 276999, 13406);
            _Firetrap[22] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341458, 277263, 13406);
            _Firetrap[23] = ft;
            Region.AddObject(ft, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341590, 276866, 13406);
            _Firetrap[24] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341590, 277131, 13406);
            _Firetrap[25] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341590, 276999, 13406);
            _Firetrap[26] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341590, 277263, 13406);
            _Firetrap[27] = ft;
            Region.AddObject(ft, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341722, 276866, 13406);
            _Firetrap[28] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341722, 277131, 13406);
            _Firetrap[29] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341722, 276999, 13406);
            _Firetrap[30] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341722, 277263, 13406);
            _Firetrap[31] = ft;
            Region.AddObject(ft, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341854, 276866, 13406);
            _Firetrap[32] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341854, 277131, 13406);
            _Firetrap[33] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341854, 276999, 13406);
            _Firetrap[34] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341854, 277263, 13406);
            _Firetrap[35] = ft;
            Region.AddObject(ft, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341986, 276866, 13406);
            _Firetrap[36] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341986, 277131, 13406);
            _Firetrap[37] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341986, 276999, 13406);
            _Firetrap[38] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 341986, 277263, 13406);
            _Firetrap[39] = ft;
            Region.AddObject(ft, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342118, 276866, 13406);
            _Firetrap[40] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342118, 277131, 13406);
            _Firetrap[41] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342118, 276999, 13406);
            _Firetrap[42] = ft;
            Region.AddObject(ft, ZoneID, true);
            GameObjectService.GameObjectProtos.TryGetValue(100490, out proto);
            ft            = new Firetrap(proto, 342118, 277263, 13406);
            _Firetrap[43] = ft;
            Region.AddObject(ft, ZoneID, true);



            //Darttrap

            GameObjectService.GameObjectProtos.TryGetValue(100489, out proto);
            dt           = new DartTrap(proto, 10, 340385, 281620, 13050);
            _Darttrap[0] = dt;
            Region.AddObject(dt, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100489, out proto);
            dt           = new DartTrap(proto, 2, 340385, 281290, 13050);
            _Darttrap[1] = dt;
            Region.AddObject(dt, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100489, out proto);
            dt           = new DartTrap(proto, 11, 339883, 281603, 13085);
            _Darttrap[2] = dt;
            Region.AddObject(dt, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100489, out proto);
            dt           = new DartTrap(proto, 3, 339883, 281302, 13085);
            _Darttrap[3] = dt;
            Region.AddObject(dt, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100489, out proto);
            dt           = new DartTrap(proto, 6, 339675, 281456, 13085);
            _Darttrap[4] = dt;
            Region.AddObject(dt, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100489, out proto);
            dt           = new DartTrap(proto, 9, 339469, 281601, 13085);
            _Darttrap[5] = dt;
            Region.AddObject(dt, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100489, out proto);
            dt           = new DartTrap(proto, 17, 339469, 281304, 13085);
            _Darttrap[6] = dt;
            Region.AddObject(dt, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100489, out proto);
            dt           = new DartTrap(proto, 14, 339064, 281596, 13050);
            _Darttrap[7] = dt;
            Region.AddObject(dt, ZoneID, true);

            GameObjectService.GameObjectProtos.TryGetValue(100489, out proto);
            dt           = new DartTrap(proto, 6, 339064, 281296, 13050);
            _Darttrap[8] = dt;
            Region.AddObject(dt, ZoneID, true);



            /*
             *
             * foreach (var p in GameObjectService.GameObjectSpawns.Where(e => e.Value.ZoneId == 179))
             * {
             *  if (p.Value.Entry == 98908)
             *  {
             *      GameObject go = new GameObject(p.Value);
             *
             *      _Objects.Add(go);
             *      //Region.AddObject(go, zoneid, true);
             *
             *  }
             * }
             *
             */
        }