Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
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);
        }