示例#1
0
        /// <summary>
        /// Reload game objects in your region
        /// </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 ReloadGameObjects(Player plr, ref List <string> values)
        {
            GameObjectService.LoadGameObjectProtos();
            plr.SendClientMessage("RELOADGAMEOBJECTS: Game objects loaded : " + GameObjectService.GameObjectProtos.Count);

            List <Object> allCells = new List <Object>();

            allCells.AddRange(plr._Cell.Objects);
            foreach (Object obj in allCells)
            {
                GameObject gameObject = obj as GameObject;

                if (gameObject != null)
                {
                    try
                    {
                        GameObject_proto proto = GameObjectService.GameObjectProtos[gameObject.Entry];
                        gameObject.Spawn.Proto = proto;
                    }
                    catch
                    {
                        plr.SendClientMessage("RELOADGAMEOBJECTS: GameObject with Entry " + gameObject.Entry + " not found in GameObjects, removing GameObject");
                        gameObject.Spawn.Proto = null;
                    }
                    gameObject.Region.CreateGameObject(gameObject.Spawn);
                    gameObject.Dispose();
                }
            }
            plr.SendClientMessage("RELOADGAMEOBJECTS: GameObject spawns loaded : " + GameObjectService.GameObjectSpawns.Count);
            return(true);
        }
示例#2
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
        }
示例#3
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);
        }
示例#4
0
 public GameObjectRenderer(GameObjectService gameObjectService, PalettesService palettesService, GraphicsAccessor graphicsAccessor) : base(graphicsAccessor)
 {
     BYTE_STRIDE        = 256 * 4;
     _buffer            = new byte[256 * 256 * 4];
     _gameObjectService = gameObjectService;
     _palettesService   = palettesService;
 }
示例#5
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);
        }
示例#6
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);
        }
示例#7
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);
            }
        }
示例#8
0
        public GameObjectEditor(ProjectService projectService, PalettesService palettesService, GraphicsService graphicsService, GameObjectService gameObjectService)
        {
            InitializeComponent();

            _projectService    = projectService;
            _gameObjectService = gameObjectService;
            _graphicsService   = graphicsService;
            _palettesService   = palettesService;
            _graphicsAccessor  = new GraphicsAccessor(graphicsService.GetGlobalTiles(), graphicsService.GetExtraTiles());
            viewObjects.Add(viewObject);

            Dpi dpi = this.GetDpi();

            _bitmap              = new WriteableBitmap(256, 256, dpi.X, dpi.Y, PixelFormats.Bgra32, null);
            _renderer            = new GameObjectRenderer(_gameObjectService, _palettesService, _graphicsAccessor);
            _renderer.RenderGrid = true;

            GameObjectRenderer.Source = _bitmap;

            List <Palette> palettes = _palettesService.GetPalettes();

            ObjectSelector.Initialize(_gameObjectService, _palettesService, _graphicsAccessor, palettes[0]);

            PaletteSelector.ItemsSource   = palettes;
            PaletteSelector.SelectedIndex = 0;

            _graphicsService.GraphicsUpdated      += _graphicsService_GraphicsUpdated;
            _graphicsService.ExtraGraphicsUpdated += _graphicsService_GraphicsUpdated;
        }
        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);
        }
        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);
        }
        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);
                }
            }
        }
示例#12
0
        private void _ProjectPanel_ProjectLoaded(Project project)
        {
            _project           = project;
            _projectService    = new ProjectService(new ErrorService(), project);
            _graphicsService   = new GraphicsService(_errorService, project);
            _levelService      = new LevelService(_errorService, project);
            _palettesService   = new PalettesService(_errorService, project);
            _worldService      = new WorldService(_errorService, project);
            _tileService       = new TileService(_errorService, project);
            _textService       = new TextService(_errorService, project);
            _clipBoardService  = new ClipBoardService();
            _romService        = new RomService(_errorService, _graphicsService, _palettesService, _tileService, _levelService, _worldService, _textService);
            _gameObjectService = new GameObjectService(_errorService, project);

            _levelService.LevelUpdated += _levelService_LevelUpdated;
            _worldService.WorldUpdated += _worldService_WorldUpdated;


            List <WorldInfo> worldInfos = new List <WorldInfo>();

            worldInfos.AddRange(project.WorldInfo);
            worldInfos.Add(project.EmptyWorld);

            FilePanel.Initialize(_levelService, _worldService);

            SplashText.Visibility   = Visibility.Collapsed;
            _config.LastProjectPath = _project.DirectoryPath + "\\" + _project.Name + ".json";
        }
        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);
            }
        }
示例#14
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);
        }
        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);
        }
        public void TestIEnumerable()
        {
            var service = new GameObjectService();

            Assert.IsNotNull(service.GetEntities());

            Assert.AreEqual(0, service.GetEntities().Count());
        }
示例#17
0
 public LevelRenderer(GraphicsAccessor graphicsAccessor, LevelDataAccessor levelDataAccessor, PalettesService paletteService, GameObjectService gameObjectService, List <TileTerrain> terrain) : base(graphicsAccessor)
 {
     _levelDataAccessor = levelDataAccessor;
     _gameObjectService = gameObjectService;
     _paletteService    = paletteService;
     _terrain           = terrain;
     _buffer            = new byte[BITMAP_WIDTH * BITMAP_HEIGHT * 4];
 }
示例#18
0
        public void Initialize(GameObjectService gameObjectService, PalettesService palettesService, GraphicsAccessor graphicsAccessor, Palette palette)
        {
            _gameObjectService = gameObjectService;
            _graphicsAccessor  = graphicsAccessor;
            _palette           = palette;
            _palettesService   = palettesService;

            _objectTypes = new List <GameObjectType>();

            _renderer = new GameObjectRenderer(gameObjectService, _palettesService, graphicsAccessor);

            Dpi dpi = this.GetDpi();

            _bitmap = new WriteableBitmap(256, 256, dpi.X, dpi.Y, PixelFormats.Bgra32, null);

            _selectedGroup = new Dictionary <GameObjectType, string>();

            switch (ObjectGroup)
            {
            case GameObjectGroup.Level:
                _objectTypes.Add(GameObjectType.Global);
                _objectTypes.Add(GameObjectType.TypeA);
                _objectTypes.Add(GameObjectType.TypeB);

                break;

            case GameObjectGroup.World:
                _objectTypes.Add(GameObjectType.World);
                break;

            case GameObjectGroup.All:
                _objectTypes.Add(GameObjectType.Global);
                _objectTypes.Add(GameObjectType.TypeA);
                _objectTypes.Add(GameObjectType.TypeB);
                _objectTypes.Add(GameObjectType.World);
                break;
            }

            foreach (var objectType in _objectTypes)
            {
                _selectedGroup[objectType] = null;
            }


            _selectedObject = null;

            GameObjectImage.Source      = _bitmap;
            GameObjectTypes.ItemsSource = _objectTypes;

            _renderer.Update(palette);

            CanvasArea.Background         = new SolidColorBrush(palette.RgbColors[0][0].ToMediaColor());
            GameObjectTypes.SelectedIndex = 0;

            _gameObjectService.GameObjectUpdated += GameObjectsUpdated;
        }
示例#19
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));
            }
        }
示例#20
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);
        }
示例#21
0
        /// <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);
        }
示例#22
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);
        }
示例#23
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
        }
示例#24
0
        public CapturePoint(Scenario_Object scenarioObject, Func <Player, bool> captureCheck, Action <CapturePoint> onCapture)
        {
            ObjectiveID   = scenarioObject.Identifier;
            ObjectiveName = scenarioObject.ObjectiveName;
            _x            = scenarioObject.WorldPosX;
            _y            = scenarioObject.WorldPosY;
            _z            = scenarioObject.PosZ;
            _o            = scenarioObject.Heading;
            _proto        = GameObjectService.GetGameObjectProto(scenarioObject.ProtoEntry);
            _captureCheck = captureCheck;
            _onCapture    = onCapture;

            _captureText         = scenarioObject.CaptureObjectiveText.Replace("%n", ObjectiveName);
            _captureDesc         = scenarioObject.CaptureObjectiveDescription.Replace("%n", ObjectiveName);
            _holdText            = scenarioObject.HoldObjectiveText.Replace("%n", ObjectiveName);
            _holdDesc            = scenarioObject.HoldObjectiveDescription.Replace("%n", ObjectiveName);
            _captureAnnouncement = scenarioObject.CaptureAnnouncement;

            CaptureDuration = 3;
        }
        // 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);
        }
        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;
            }
        }
示例#27
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);
        }
        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 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);
            }
        }
示例#30
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);
        }