Example #1
0
 public GameObject(GameObject_spawn Spawn)
     : this()
 {
     this.Spawn = Spawn;
     Name = Spawn.Proto.Name;
 }
Example #2
0
        public static bool GoSpawn(Player Plr, ref List<string> Values)
        {
            int Entry = GetInt(ref Values);

            GameObject_proto Proto = WorldMgr.GetGameObjectProto((uint)Entry);
            if (Proto == null)
            {
                Plr.SendMessage(0, "Server", "Invalid go entry(" + Entry + ")", SystemData.ChatLogFilters.CHATLOGFILTERS_SHOUT);
                return false;
            }

            Plr.CalcWorldPositions();

            GameObject_spawn Spawn = new GameObject_spawn();
            Spawn.Guid = (uint)WorldMgr.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);

            return true;
        }
Example #3
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);
        }
Example #4
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;
        }
Example #5
0
 public void AddSpawn(GameObject_spawn Spawn)
 {
     GameObjectSpawns.Add(Spawn);
 }
Example #6
0
 public GameObject CreateGameObject(GameObject_spawn Spawn)
 {
     GameObject Obj = new GameObject(Spawn);
     AddObject(Obj, Spawn.ZoneId);
     return Obj;
 }