Beispiel #1
0
        public void SpawnGO(object list)
        {
            var Params = (List <object>)list;

            int  Entry          = (int)Params[0];
            int  X              = (int)Params[1];
            int  Y              = (int)Params[2];
            int  Z              = (int)Params[3];
            int  O              = (int)Params[4];
            uint AllowVfxUpdate = (uint)Params[5];

            GameObject_proto Proto = GameObjectService.GetGameObjectProto((uint)Entry);

            GameObject_spawn Spawn = new GameObject_spawn();

            Spawn.Guid = (uint)GameObjectService.GenerateGameObjectSpawnGUID();
            Spawn.BuildFromProto(Proto);
            Spawn.WorldO         = O;
            Spawn.WorldX         = X;
            Spawn.WorldY         = Y;
            Spawn.WorldZ         = Z;
            Spawn.ZoneId         = (ushort)Obj.ZoneId;
            Spawn.AllowVfxUpdate = AllowVfxUpdate;
            GameObject go = Obj.Region.CreateGameObject(Spawn);

            go.Respawn = 0;
            go.EvtInterface.AddEventNotify(EventName.OnDie, RemoveGOs); // We are removing spawns from server when adds die

            goList.Add(go);                                             // Adding adds to the list for easy removal
        }
        public static void Spawn(Player plr, uint entry)
        {
            GameObject_proto proto = GameObjectService.GetGameObjectProto(entry);

            if (proto == null)
            {
                plr.SendClientMessage($"Invalid go entry({entry})", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                return;
            }

            plr.UpdateWorldPosition();

            GameObject_spawn spawn = new GameObject_spawn();

            spawn.Guid = (uint)GameObjectService.GenerateGameObjectSpawnGUID();
            spawn.BuildFromProto(proto);
            spawn.WorldO = plr._Value.WorldO;
            spawn.WorldY = plr._Value.WorldY;
            spawn.WorldZ = plr._Value.WorldZ;
            spawn.WorldX = plr._Value.WorldX;
            spawn.ZoneId = plr.Zone.ZoneId;

            WorldMgr.Database.AddObject(spawn);

            plr.Region.CreateGameObject(spawn);
        }
        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);
            }
        }
        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);
        }
Beispiel #5
0
        public void Spawn()
        {
            GameObject?.Destroy();

            GameObject_proto proto = GameObjectService.GetGameObjectProto(Info.GameObjectId);

            if (proto == null)
            {
                Log.Error("KeepDoor", "No Door Proto");
                return;
            }

            // Log.Info("KeepDoor", "Spawning Keep Door = " + Info.DoorId + " Number = " + Info.Number);

            GameObject_spawn spawn = new GameObject_spawn
            {
                Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                WorldO = Info.O,
                WorldY = Info.Y,
                WorldZ = Info.Z,
                WorldX = Info.X,
                ZoneId = Info.ZoneId,
                DoorId = Info.DoorId,
            };

            spawn.BuildFromProto(proto);

            GameObject = new KeepGameObject(spawn, this, Keep);
            Region.AddObject(GameObject, spawn.ZoneId);

            GameObject.SetAttackable(Keep.KeepStatus != KeepStatus.KEEPSTATUS_LOCKED);

            WarZoneLib.RegionData.HideDoor(false, Info.ZoneId, Info.DoorId);
        }
Beispiel #6
0
            public KeepGameObject(GameObject_spawn spawn, KeepDoor keepDoor, Keep keep)
            {
                _keep     = keep;
                Spawn     = spawn;
                Name      = spawn.Proto.Name;
                _keepDoor = keepDoor;

                if (Constants.DoomsdaySwitch == 0)
                {
                    if (keepDoor.Info.Number == (int)KeepDoorType.InnerMain || keepDoor.Info.Number == (int)KeepDoorType.OuterMain)
                    {
                        Realm = keep.Realm;
                        Spawn.Proto.HealthPoints = (uint)_keep.Tier * 10000;
                    }
                }
                else
                {
                    if (keepDoor.Info.Number == (int)KeepDoorType.InnerMain || keepDoor.Info.Number == (int)KeepDoorType.OuterMain)
                    {
                        Realm = keep.Realm;
                        Spawn.Proto.HealthPoints = 4 * 10000;
                    }
                }

                _enterExitPoints[0] = new Point3D(_keepDoor.Info.TeleportX1, _keepDoor.Info.TeleportY1, _keepDoor.Info.TeleportZ1);
                _enterExitPoints[1] = new Point3D(_keepDoor.Info.TeleportX2, _keepDoor.Info.TeleportY2, _keepDoor.Info.TeleportZ2);

                EvtInterface.AddEventNotify(EventName.OnReceiveDamage, OnReceiveDamage);
            }
Beispiel #7
0
        public void Spawn(bool attackable)
        {
            GameObject?.Destroy();

            GameObject_proto proto = GameObjectService.GetGameObjectProto(Info.GameObjectId);

            if (proto == null)
            {
                Log.Error("KeepDoor", "No Door Proto");
                return;
            }

            _logger.Debug($"Spawning Keep Door = {Info.DoorId} Number = {Info.Number} for Keep = {Keep.Info.Name}");

            GameObject_spawn spawn = new GameObject_spawn
            {
                Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                WorldO = Info.O,
                WorldY = Info.Y,
                WorldZ = Info.Z,
                WorldX = Info.X,
                ZoneId = Info.ZoneId,
                DoorId = Info.DoorId,
            };

            spawn.BuildFromProto(proto);

            GameObject = new KeepGameObject(spawn, this, Keep);
            Region.AddObject(GameObject, spawn.ZoneId);

            GameObject.SetAttackable(attackable);

            Occlusion.SetFixtureVisible(Info.DoorId, true);
        }
Beispiel #8
0
 public PQuestGameObject(GameObject_spawn spawn, PQuestObjective objective)
 {
     this.Spawn     = spawn;
     Name           = spawn.Proto.Name;
     this.Objective = objective;
     this.Respawn   = 0;
 }
Beispiel #9
0
 public Part(GameObject_spawn spawn, FLAG_EFFECTS?flagEffect, int pickUpTime = 0, int dropTime = 0) : base(spawn)
 {
     _pickupTime = pickUpTime;
     _dropTime   = dropTime;
     _flagEffect = flagEffect;
     Position    = new Point3D(spawn.WorldX, spawn.WorldY, spawn.WorldZ);
 }
Beispiel #10
0
        public GoldChest(GameObject_spawn spawn, PQuest_Info info, ref Dictionary <uint, ContributionInfo> players, float bagCountMod, RegionMgr region)
        {
            Spawn            = spawn;
            _publicQuestInfo = info;
            //Note: _amountOfBags is the original calulation for generating bags, testing math.min to see if this is the cause of the empty bags (clientside limitations)
            int _amountOfBags = (int)(players.Count * bagCountMod);

            if (info.PQType == 2 && WorldMgr.WorldSettingsMgr.GetGenericSetting(16) == 0)
            {
                //foreach (ContributionInfo contrib in players.Values)
                //{
                //    RollForPersonalBag(contrib, 1f, players, region);

                //}
                EvtInterface.AddEvent(Destroy, 180 * 1000, 1);
                // AssignPersonalLoot(player);
            }
            else  //PQs still use the original roll system
            {
                GenerateLootBags(Math.Min(_amountOfBags, 24));
                // Note - if there are more than 42 players, the lowest rarity bag should be green.

#warning if there are more than 114 players, 25 bags will be awarded. Nalgol has the PQ boards restricted to 24 players, for an unknown reason. This could cause something to break.

                AssignLoot(players);

                foreach (KeyValuePair <uint, ContributionInfo> playerRoll in players)
                {
                    Scoreboard(playerRoll.Value, _preRoll.IndexOf(playerRoll), _postRoll.IndexOf(playerRoll));
                }

                EvtInterface.AddEvent(Destroy, 180 * 1000, 1);
            }
        }
Beispiel #11
0
        public Pendulum(GameObject_proto proto, byte vfxstart, int WX, int WY, int WZ)
        {
            GameObject_spawn sp = new GameObject_spawn();

            sp.ZoneId    = 179;
            sp.DisplayID = 7394;
            sp.WorldX    = WX;
            sp.WorldY    = WY;
            sp.WorldZ    = WZ;
            sp.WorldO    = 2048;
            sp.Proto     = proto;
            VfxState     = vfxstart;
            Spawn        = sp;
            Name         = proto.Name;
            Vfxstart     = vfxstart;

            if (Vfxstart == 0)
            {
                lastswing = 5;
            }
            else
            {
                lastswing = 6;
            }
        }
Beispiel #12
0
        /// <summary>
        /// Creates a game object spawn entity from given Campaign portal object.
        /// </summary>
        /// <param name="battleFrontObject">Portal object providing raw data</param>
        /// <returns>newly created spawn entity</returns>
        private GameObject_spawn CreateSpawn(int zoneId, int x, int y, int z, int o)
        {
            GameObject_proto proto = GameObjectService.GetGameObjectProto(PORTAL_PROTO_ENTRY);

            proto = (GameObject_proto)proto.Clone();

            GameObject_spawn spawn = new GameObject_spawn();

            spawn.BuildFromProto(proto);

            // boule blanche : 3457
            // grosse boule blanche : 1675
            proto.Scale = 25;
            // spawn.DisplayID = 1675;
            spawn.DisplayID = 1675;
            spawn.ZoneId    = (ushort)zoneId;

            spawn.WorldX = x;
            spawn.WorldY = y;
            spawn.WorldZ = z;
            spawn.WorldO = o;

            spawn.IsValid   = true;
            spawn.IsDeleted = false;
            spawn.Guid      = 132456;

            return(spawn);
        }
Beispiel #13
0
        public GameObject CreateGameObject(GameObject_spawn Spawn)
        {
            GameObject Obj = new GameObject(Spawn);

            AddObject(Obj, Spawn.ZoneId);
            return(Obj);
        }
Beispiel #14
0
        /// <summary>
        /// Creates a game object spawn entity from given Campaign portal object.
        /// </summary>
        /// <param name="battleFrontObject">Portal object providing raw data</param>
        /// <returns>newly created spawn entity</returns>
        private GameObject_spawn CreateSpawn(BattleFrontObject battleFrontObject)
        {
            GameObject_proto proto = GameObjectService.GetGameObjectProto(PORTAL_PROTO_ENTRY);

            proto = (GameObject_proto)proto.Clone();

            GameObject_spawn spawn = new GameObject_spawn();

            spawn.BuildFromProto(proto);

            // boule blanche : 3457
            // grosse boule blanche : 1675
            proto.Scale = 25;
            // spawn.DisplayID = 1675;
            spawn.DisplayID = 1675;
            spawn.ZoneId    = battleFrontObject.ZoneId;

            Point3D worldPos = GetWorldPosition(battleFrontObject);

            spawn.WorldX = worldPos.X;
            spawn.WorldY = worldPos.Y;
            spawn.WorldZ = worldPos.Z;
            spawn.WorldO = battleFrontObject.O;

            return(spawn);
        }
Beispiel #15
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 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);
                }
            }
        }
Beispiel #17
0
        public GameObject CreateGameObject(GameObject_spawn spawn)
        {
            if (spawn == null || spawn.Proto == null)
            {
                return(null);
            }

            GameObject obj = new GameObject(spawn);

            AddObject(obj, spawn.ZoneId);
            return(obj);
        }
Beispiel #18
0
        public GameObject CreateGameObject(GameObject_spawn Spawn)
        {
            if (Spawn == null || Spawn.Proto == null)
            {
                return(null);
            }

            GameObject Obj = new GameObject(Spawn);

            AddObject(Obj, Spawn.ZoneId);
            return(Obj);
        }
Beispiel #19
0
        public LootChest CreateLootChest(GameObject_spawn spawn)
        {
            if (spawn == null || spawn.Proto == null)
            {
                return(null);
            }

            var obj = new LootChest(spawn);

            AddObject(obj, spawn.ZoneId);
            return(obj);
        }
 public GameObject(GameObject_spawn spawn)
     : this()
 {
     Spawn = spawn;
     if (!string.IsNullOrEmpty(Spawn.AlternativeName))
     {
         Name = Spawn.AlternativeName;
     }
     else
     {
         Name = spawn.Proto.Name;
     }
     VfxState = (byte)spawn.VfxState;
 }
Beispiel #21
0
        public void EnergyFlux()
        {
            Brain.SpeakYourMind(" using EnergyFlux");

            // Remove any old electron fluxes (max of 4)
            var fluxes = Owner.GetInRange <GameObject>(150);

            if (fluxes.Count > 4)
            {
                foreach (var flux in fluxes)
                {
                    if (flux.Entry == 3100414)
                    {
                        flux.EvtInterface.AddEvent(flux.Destroy, 2 * 1000, 1);
                        break;
                    }
                }
            }

            GameObject_proto proto = GameObjectService.GetGameObjectProto(3100414);

            var newTarget = Brain.SetRandomTarget();

            if (newTarget != null)
            {
                GameObject_spawn spawn = new GameObject_spawn
                {
                    Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                    WorldO = 2093,
                    WorldX = newTarget.WorldPosition.X + StaticRandom.Instance.Next(50),
                    WorldY = newTarget.WorldPosition.Y + StaticRandom.Instance.Next(50),
                    WorldZ = newTarget.WorldPosition.Z,
                    ZoneId = (ushort)Owner.ZoneId
                };

                spawn.BuildFromProto(proto);
                proto.IsAttackable = 1;

                var go = Owner.Region.CreateGameObject(spawn);
                // When the gameobject dies, remove it.
                go.EvtInterface.AddEventNotify(EventName.OnDie, RemoveGOs);
                // When the boss dies, remove all child "fluxes"
                Owner.EvtInterface.AddEventNotify(EventName.OnDie, RemoveAllFluxes);
                // Buff the flux with the lightning rod buff.
                go.BuffInterface.QueueBuff(new BuffQueueInfo(go, 48, AbilityMgr.GetBuffInfo((ushort)1543),
                                                             BuffAssigned));
            }
        }
Beispiel #22
0
        public static void Point(Player plr)
        {
            if (plr.Zone == null)
            {
                SendCsr(plr, "CAMPAIGN POINT: Must be in a zone to use this command.");
                return;
            }

            IBattlefrontFlag closestFlag = plr.Region.Bttlfront.GetClosestFlag(plr.WorldPosition);

            if (closestFlag == null)
            {
                SendCsr(plr, "CAMPAIGN POINT: Must be in an open-world RvR zone.");
                return;
            }
            else if (!(closestFlag is BattlefrontFlag))
            {
                SendCsr(plr, "CAMPAIGN POINT: This command is supported in legacy RvR.");
                return;
            }

            plr.SendClientMessage("Flag: " + closestFlag.ObjectiveName);
            GameObject_proto proto = GameObjectService.GetGameObjectProto(429);

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

            spawn.BuildFromProto(proto);
            plr.Region.CreateGameObject(spawn);

            BattlefrontResourceSpawn res = new BattlefrontResourceSpawn
            {
                Entry = ((BattlefrontFlag)closestFlag).ID,
                X     = plr.X,
                Y     = plr.Y,
                Z     = plr.Z,
                O     = plr.Heading
            };

            WorldMgr.Database.AddObject(res);
        }
Beispiel #23
0
        public DartTrap(GameObject_proto proto, byte vfxstart, int WX, int WY, int WZ)
        {
            GameObject_spawn sp = new GameObject_spawn();

            sp.ZoneId    = 179;
            sp.DisplayID = 7471;
            sp.WorldX    = WX;
            sp.WorldY    = WY;
            sp.WorldZ    = WZ;
            sp.WorldO    = 1012;
            sp.Proto     = proto;
            VfxState     = vfxstart;
            Spawn        = sp;
            Name         = proto.Name;
            Vfxstart     = vfxstart;
        }
Beispiel #24
0
        public GameObject CreateGameObject(uint Entry, ushort ZoneId, ushort Px, ushort Py, ushort Pz)
        {
            GameObject_proto Proto = WorldMgr.GetGameObjectProto(Entry);

            if (Proto == null)
            {
                return(null);
            }

            GameObject_spawn Spawn = new GameObject_spawn();

            Spawn.Entry = Entry;
            Spawn.Guid  = (uint)WorldMgr.GenerateGameObjectSpawnGUID();
            Spawn.BuildFromProto(Proto);
            Spawn.ZoneId = ZoneId;
            ZoneMgr.CalculWorldPosition(ZoneId, Px, Py, Pz, ref Spawn.WorldX, ref Spawn.WorldY, ref Spawn.WorldZ);
            return(CreateGameObject(Spawn));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="plr">Player that initiated the command</param>
        /// <param name="values">List of command arguments (after command name)</param>
        /// <returns>True if command was correctly handled, false if operation was canceled</returns>
        public static bool RespawnAdd(Player plr, ref List <string> values)
        {
            byte         realm   = (byte)GetInt(ref values);
            Zone_Respawn respawn = new Zone_Respawn
            {
                PinX   = (ushort)plr.X,
                PinY   = (ushort)plr.Y,
                PinZ   = (ushort)plr.Z,
                WorldO = plr.Heading,
                ZoneID = plr.Zone.ZoneId,
                Realm  = realm
            };

            WorldMgr.Database.AddObject(respawn);
            ZoneService.LoadZone_Respawn();

            GameObject_proto proto = GameObjectService.GetGameObjectProto(563);

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

            spawn.BuildFromProto(proto);
            plr.Region.CreateGameObject(spawn);

            GMCommandLog log = new GMCommandLog
            {
                PlayerName = plr.Name,
                AccountId  = (uint)plr.Client._Account.AccountId,
                Command    = "ADD RESPAWN TO " + plr.Zone.ZoneId + " " + (ushort)plr.X + " " + (ushort)plr.Y,
                Date       = DateTime.Now
            };

            CharMgr.Database.AddObject(log);

            return(true);
        }
Beispiel #26
0
        public static LootChest Create(RegionMgr region, Point3D location, ushort zoneId, bool convertPin = true)
        {
            if (region == null)
            {
                Log.Error("LootChest", "Attempt to create for NULL region");
                return(null);
            }

            GameObject_proto proto = GameObjectService.GetGameObjectProto(188);
            GameObject_spawn spawn = new GameObject_spawn();

            if (convertPin)  // Non-fort zone location points are PIN position system, forts are worldposition.
            {
                var targetPosition = ZoneService.GetWorldPosition(ZoneService.GetZone_Info(zoneId), (ushort)location.X,
                                                                  (ushort)location.Y, (ushort)location.Z);

                spawn.Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID();
                spawn.WorldO = 0;
                spawn.WorldY = targetPosition.Y + StaticRandom.Instance.Next(50, 100);
                spawn.WorldZ = targetPosition.Z;
                spawn.WorldX = targetPosition.X + StaticRandom.Instance.Next(50, 100);
                spawn.ZoneId = zoneId;
            }
            else
            {
                spawn.Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID();
                spawn.WorldO = 0;
                spawn.WorldY = location.Y + StaticRandom.Instance.Next(50, 100);
                spawn.WorldZ = location.Z;
                spawn.WorldX = location.X + StaticRandom.Instance.Next(50, 100);
                spawn.ZoneId = zoneId;
            }


            spawn.BuildFromProto(proto);
            var chest = region.CreateLootChest(spawn);

            chest.LootBags = new Dictionary <uint, KeyValuePair <Item_Info, List <Talisman> > >();


            return(chest);
        }
        // Make RoR Great Again - adding wall
        public void AddWall()
        {
            GameObject_proto proto = GameObjectService.GetGameObjectProto(2000441);

            GameObject_spawn spawn = new GameObject_spawn
            {
                Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                WorldX = 137348,
                WorldY = 524446,
                WorldZ = 11128,
                WorldO = 2008,
                ZoneId = 169
            };

            spawn.BuildFromProto(proto);
            GameObject GO = Obj.Region.CreateGameObject(spawn);

            GO.Say("**Wall of magical force is now blocking the exit**", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);
            magicWalls.Add(GO);
        }
Beispiel #28
0
        public LootChest(GameObject_spawn spawn)
        {
            Spawn = spawn;
            if (!string.IsNullOrEmpty(Spawn.AlternativeName))
            {
                Name = Spawn.AlternativeName;
            }
            else
            {
                Name = spawn.Proto.Name;
            }
            VfxState = (byte)spawn.VfxState;

            this.Y = spawn.WorldY;
            this.Z = spawn.WorldZ;
            this.X = spawn.WorldX;


            EvtInterface.AddEvent(Destroy, 180 * 1000, 1);
        }
Beispiel #29
0
        public void CreateExitPortal(int X, int Y, int Z, int O)
        {
            GameObject_proto Proto = GameObjectService.GetGameObjectProto(98878); // This is portal

            GameObject_spawn Spawn = new GameObject_spawn();

            Spawn.Guid = (uint)GameObjectService.GenerateGameObjectSpawnGUID();
            Spawn.BuildFromProto(Proto);
            Spawn.WorldO = O;
            Spawn.WorldX = X;
            Spawn.WorldY = Y;
            Spawn.WorldZ = Z;
            Spawn.ZoneId = (ushort)Obj.ZoneId;
            GameObject go = Obj.Region.CreateGameObject(Spawn);

            go.Respawn = 0;
            go.EvtInterface.AddEvent(go.Destroy, 30 * 10 * 1000, 1);

            //goList.Add(go); // Adding adds to the list for easy removal
        }
Beispiel #30
0
            public KeepGameObject(GameObject_spawn spawn, KeepDoor keepDoor, BattleFrontKeep keep)
            {
                _keep     = keep;
                Spawn     = spawn;
                Name      = spawn.Proto.Name;
                _keepDoor = keepDoor;


                if (keepDoor.Info.Number == (int)KeepDoorType.InnerMain || keepDoor.Info.Number == (int)KeepDoorType.OuterMain)
                {
                    Realm = keep.Realm;
                    Spawn.Proto.HealthPoints = 4 * 500000;
                    Health = Spawn.Proto.HealthPoints;
                }

                _enterExitPoints[0] = new Point3D(_keepDoor.Info.TeleportX1, _keepDoor.Info.TeleportY1, _keepDoor.Info.TeleportZ1);
                _enterExitPoints[1] = new Point3D(_keepDoor.Info.TeleportX2, _keepDoor.Info.TeleportY2, _keepDoor.Info.TeleportZ2);

                EvtInterface.AddEventNotify(EventName.OnReceiveDamage, OnReceiveDamage);
            }