Ejemplo n.º 1
0
        public static bool NpcSpawn(Player Plr, ref List<string> Values)
        {
            int Entry = GetInt(ref Values);

            Creature_proto Proto = WorldMgr.GetCreatureProto((uint)Entry);
            if (Proto == null)
            {
                Proto = WorldMgr.Database.SelectObject<Creature_proto>("Entry=" + Entry);

                if(Proto != null)
                    Plr.SendMessage(0, "Server", "Npc Entry is valid but npc stats are empty. No sniff data about this npc", SystemData.ChatLogFilters.CHATLOGFILTERS_SHOUT);
                else
                    Plr.SendMessage(0, "Server", "Invalid npc entry(" + Entry + ")", SystemData.ChatLogFilters.CHATLOGFILTERS_SHOUT);

                return false;
            }

            Plr.CalcWorldPositions();

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

            GMCommandLog Log = new GMCommandLog();
            Log.PlayerName = Plr.Name;
            Log.AccountId = (uint)Plr.Client._Account.AccountId;
            Log.Command = "SPAWN CREATURE " + Spawn.Entry + " " + Spawn.Guid + " AT " + Spawn.ZoneId + " " + Plr._Value.WorldX + " " + Plr._Value.WorldY;
            Log.Date = DateTime.Now;
            WorldMgr.Database.AddObject(Log);

            return true;
        }
Ejemplo n.º 2
0
 public Creature(Creature_spawn Spawn) : this()
 {
     this.Spawn = Spawn;
     Name = Spawn.Proto.Name;
 }
Ejemplo n.º 3
0
        public static bool NpcSpawn(Player Plr, ref List<string> Values)
        {
            int Entry = GetInt(ref Values);

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

            Plr.CalcWorldPositions();

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

            return true;
        }
Ejemplo n.º 4
0
        public Creature CreateCreature(uint Entry, ushort ZoneId, ushort Px, ushort Py, ushort Pz)
        {
            Creature_proto Proto = WorldMgr.GetCreatureProto((uint)Entry);
            if (Proto == null)
                return null;

            Creature_spawn Spawn = new Creature_spawn();
            Spawn.Guid = (uint)WorldMgr.GenerateCreatureSpawnGUID();
            Spawn.BuildFromProto(Proto);
            Spawn.ZoneId = ZoneId;
            ZoneMgr.CalculWorldPosition(ZoneId, Px, Py, Pz, ref Spawn._WorldO, ref Spawn._WorldY, ref Spawn._WorldZ);
            return CreateCreature(Spawn);
        }
Ejemplo n.º 5
0
        public Creature CreateCreature(Creature_spawn Spawn)
        {
            if (Spawn == null || Spawn.Proto == null)
                return null;

            Creature Crea = new Creature(Spawn);
            AddObject((Object)Crea,Spawn.ZoneId);
            return Crea;
        }
Ejemplo n.º 6
0
 public void AddSpawn(Creature_spawn Spawn)
 {
     CreatureSpawns.Add(Spawn);
 }
Ejemplo n.º 7
0
 public Creature CreateCreature(Creature_spawn Spawn)
 {
     Creature Crea = new Creature(Spawn);
     AddObject((Object)Crea,Spawn.ZoneId);
     return Crea;
 }