Example #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;
        }
Example #2
0
        public static bool RespawnAdd(Player Plr, ref List<string> Values)
        {
            byte Realm = (byte)GetInt(ref Values);
            Zone_Respawn Respawn = new Zone_Respawn();
            Respawn.PinX = (UInt16)Plr.X;
            Respawn.PinY = (UInt16)Plr.Y;
            Respawn.PinZ = (UInt16)Plr.Z;
            Respawn.WorldO = Plr.Heading;
            Respawn.ZoneID = Plr.Zone.ZoneId;
            Respawn.Realm = (byte)Realm;
            WorldMgr.Database.AddObject(Respawn);
            WorldMgr.LoadZone_Respawn();

            GMCommandLog Log = new GMCommandLog();
            Log.PlayerName = Plr.Name;
            Log.AccountId = (uint)Plr.Client._Account.AccountId;
            Log.Command = "ADD RESPAWN TO " + Plr.Zone.ZoneId + " " + (UInt16)Plr.X + " " + (UInt16)Plr.Y;
            Log.Date = DateTime.Now;
            WorldMgr.Database.AddObject(Log);

            return true;
        }
Example #3
0
        public static bool ModifyRenown(Player Plr, ref List<string> Values)
        {
            int RenownLevel = GetInt(ref Values);
            Plr = GetTargetOrMe(Plr);
            Plr.SetRenownLevel((byte)RenownLevel);

            GMCommandLog Log = new GMCommandLog();
            Log.PlayerName = Plr.Name;
            Log.AccountId = (uint)Plr.Client._Account.AccountId;
            Log.Command = "SET RENOWN TO " + Plr.Name + " " + RenownLevel;
            Log.Date = DateTime.Now;
            WorldMgr.Database.AddObject(Log);

            return true;
        }
Example #4
0
        public static bool NpcRemove(Player Plr, ref List<string> Values)
        {
            Object Obj = GetObjectTarget(Plr);
            if (!Obj.IsCreature())
                return false;

            int Database = GetInt(ref Values);

            Obj.Dispose();

            if (Database > 0)
            {
                Creature_spawn Spawn = Obj.GetCreature().Spawn;
                WorldMgr.Database.DeleteObject(Spawn);

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

            Plr.SendMessage(0, "Server", "Npc Removed : " + Obj.GetCreature().Spawn.Guid, SystemData.ChatLogFilters.CHATLOGFILTERS_SHOUT);

            return true;
        }
Example #5
0
        public static bool AddXp(Player Plr, ref List<string> Values)
        {
            int Xp = GetInt(ref Values);
            Plr = GetTargetOrMe(Plr);
            Plr.AddXp((uint)Xp);

            GMCommandLog Log = new GMCommandLog();
            Log.PlayerName = Plr.Name;
            Log.AccountId = (uint)Plr.Client._Account.AccountId;
            Log.Command = "ADD XP TO " + Plr.Name + " " + Xp;
            Log.Date = DateTime.Now;
            WorldMgr.Database.AddObject(Log);

            return true;
        }
Example #6
0
        public static bool Kill(Player Plr, ref List<string> Values)
        {
            Unit Target = Plr.CbtInterface.GetCurrentTarget();
            if (Target == null || Target.IsDead)
                return false;

            if (Target.IsPlayer())
            {
                if (Plr.GmLevel < 3)
                    return false;

                GMCommandLog Log = new GMCommandLog();
                Log.PlayerName = Plr.Name;
                Log.AccountId = (uint)Plr.Client._Account.AccountId;
                Log.Command = "KILL PLAYER " + Target.Name;
                Log.Date = DateTime.Now;
                WorldMgr.Database.AddObject(Log);
            }

            Plr.DealDamages(Target, int.MaxValue);

            return true;
        }
Example #7
0
        public static bool AddTok(Player Plr, ref List<string> Values)
        {
            int TokEntry = GetInt(ref Values);

            Tok_Info Info = WorldMgr.GetTok((ushort)TokEntry);
            if (Info == null)
                return false;

            Plr = GetTargetOrMe(Plr);
            Plr.TokInterface.AddTok(Info.Entry);

            GMCommandLog Log = new GMCommandLog();
            Log.PlayerName = Plr.Name;
            Log.AccountId = (uint)Plr.Client._Account.AccountId;
            Log.Command = "ADD TOK TO " + Plr.Name + " " + TokEntry;
            Log.Date = DateTime.Now;
            WorldMgr.Database.AddObject(Log);

            return false;
        }
Example #8
0
        public static bool AddItem(Player Plr, ref List<string> Values)
        {
            int ItemId = GetInt(ref Values);
            int Count = 1;
            if (Values.Count > 0)
                Count = GetInt(ref Values);

            Plr = GetTargetOrMe(Plr);
            if (Plr.ItmInterface.CreateItem((uint)ItemId, (ushort)Count) == ItemError.RESULT_OK)
            {
                GMCommandLog Log = new GMCommandLog();
                Log.PlayerName = Plr.Name;
                Log.AccountId = (uint)Plr.Client._Account.AccountId;
                Log.Command = "ADD ITEM TO " + Plr.Name + " " + ItemId + " " + Count;
                Log.Date = DateTime.Now;
                WorldMgr.Database.AddObject(Log);

                return true;
            }

            return false;
        }
Example #9
0
        public static bool TeleportSummon(Player Plr, ref List<string> Values)
        {
            string PlayerName = GetString(ref Values);

            Player Target = Player.GetPlayer(PlayerName);

            if (Target == null)
            {
                Plr.SendMessage(0, "Server", "Player not found :" + PlayerName, SystemData.ChatLogFilters.CHATLOGFILTERS_SHOUT);
                return false;
            }

            Target.Teleport(Plr.Zone, (uint)Plr.WorldPosition.X, (uint)Plr.WorldPosition.Y, (UInt16)Plr.WorldPosition.Z, 0);

            GMCommandLog Log = new GMCommandLog();
            Log.PlayerName = Plr.Name;
            Log.AccountId = (uint)Plr.Client._Account.AccountId;
            Log.Command = "SUMMON PLAYER " + Target.Name + " TO " + Plr.Zone.ZoneId + " " + Plr._Value.WorldX + " " + Plr._Value.WorldY;
            Log.Date = DateTime.Now;
            WorldMgr.Database.AddObject(Log);

            return true;
        }
Example #10
0
        public static bool TeleportMap(Player Plr, ref List<string> Values)
        {
            int ZoneID = GetInt(ref Values);
            int WorldX = GetInt(ref Values);
            int WorldY = GetInt(ref Values);
            int WorldZ = GetInt(ref Values);

            Plr.Teleport((UInt16)ZoneID, (uint)WorldX, (uint)WorldY, (UInt16)WorldZ, 0);

            GMCommandLog Log = new GMCommandLog();
            Log.PlayerName = Plr.Name;
            Log.AccountId = (uint)Plr.Client._Account.AccountId;
            Log.Command = "TELEPORT TO " + ZoneID + " " + WorldX + " " + WorldY;
            Log.Date = DateTime.Now;
            WorldMgr.Database.AddObject(Log);

            return true;
        }
Example #11
0
        public static bool Revive(Player Plr, ref List<string> Values)
        {
            Unit Target = Plr.CbtInterface.GetCurrentTarget();
            if (Target == null || !Target.IsDead)
                return false;

            Target.RezUnit();

            if (Target.IsPlayer())
            {
                GMCommandLog Log = new GMCommandLog();
                Log.PlayerName = Plr.Name;
                Log.AccountId = (uint)Plr.Client._Account.AccountId;
                Log.Command = "REZ PLAYER " + Target.Name;
                Log.Date = DateTime.Now;
                WorldMgr.Database.AddObject(Log);
            }

            return true;
        }