Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.IO;
- namespace MiddleMan
- {
- class PlayerData
- {
- public static List<byte> Block2Client = new List<byte>();
- public static List<byte> Block2Server = new List<byte>();
- public static bool BlockPackets = false;//stops the GMS client sending packets when ccing/logging
- public static byte NumPortals = 1;//number of portals you've been in (for looting)
- public static byte lootType = 0;//0 = specific drops, 1 = mesos, 2 = all
- public static MapData Map;//Map info stored here(map items/players etc)
- public static System.Drawing.Point Pos = new System.Drawing.Point();//player pos
- static bool spam = false;
- static string spamMessage;
- public static void Spam()
- {
- while (true)
- {
- if (spam)
- Client.Packets.SendSpam(spamMessage);
- else
- System.Threading.Thread.Sleep(2000);//Lets just slowwww stuff down kai
- }
- }
- public static bool ParseChat(string chat)
- {
- if (chat.StartsWith("!"))
- {
- string[] splitted = chat.Split(' ');
- switch (splitted[0].Remove(0, 1).ToLower())
- {
- #region lad - loot all drops(when dropped)
- case "lad":
- lootType = 2;
- Server.Packets.SendNotice("This is GMTiara here! Foreigners is going on a vacation. Sorry you had to see that.");
- break;
- #endregion
- #region lsd - loot specific drops(when dropped)
- case "lsd"://loot drops specific
- lootType = 0;
- Server.Packets.SendNotice("Looting specific items only");
- break;
- #endregion
- #region lmd - loot meso drops(when dropped)
- case "lmd"://loot drops meso
- lootType = 1;
- Server.Packets.SendNotice("Looting mesos only");
- break;
- #endregion
- #region la - loot all drops(now)
- case "la"://loot all on floor now
- foreach (Item item in Map.Items)
- {
- Client.Packets.LootItem(item.UID, item.x, item.y);
- }
- break;
- #endregion
- #region lam - loot all mesos(now)
- case "lam"://loot all mesos
- foreach (Item item in Map.Items)
- {
- if (item.isMeso)
- Client.Packets.LootItem(item.UID, item.x, item.y);
- }
- break;
- #endregion
- #region spam
- case "spam":
- spam = spam == true ? false : true;
- try { spamMessage = splitted[1]; }
- catch { }
- break;
- #endregion
- #region send packet hex string
- case "p":
- Client.Packets.SendHex(chat.Remove(0, 3));
- break;
- #endregion
- #region SendSkillToGMSClient
- case "skill":
- Server.Packets.AddSkill(int.Parse(splitted[1]));
- break;
- #endregion
- #region Packet speed
- case "speed":
- if (Client.Client.slowPacket)
- {
- Client.Client.slowPacket = false;
- Console.WriteLine("Normal packets");
- Server.Packets.SendNotice("Normal packet speed");
- }
- else
- {
- Client.Client.slowPacket = true;
- Console.WriteLine("Slow packets");
- Server.Packets.SendNotice("Slow packets");
- }
- break;
- #endregion
- #region Block packet ToClient
- case "2c":
- try
- {
- if (PlayerData.Block2Client.Contains(byte.Parse(splitted[1], System.Globalization.NumberStyles.HexNumber)))
- {
- PlayerData.Block2Client.Remove(byte.Parse(splitted[1], System.Globalization.NumberStyles.HexNumber));
- Server.Packets.SendNotice("Unblocking 0x" + splitted[1]);
- }
- else
- {
- PlayerData.Block2Client.Add(byte.Parse(splitted[1], System.Globalization.NumberStyles.HexNumber));
- Server.Packets.SendNotice("Blocking 0x" + splitted[1]);
- }
- StreamWriter sw = new StreamWriter("BlockToClient.txt");
- foreach (byte BYTE in Block2Client)
- sw.WriteLine("{0:X}", BYTE);
- sw.Close();
- }
- catch (Exception e)
- {
- Server.Packets.SendNotice(e.ToString());
- Server.Packets.SendNotice("failed lul");
- }
- break;
- #endregion
- #region Block packet ToServer
- case "2s":
- try
- {
- if (PlayerData.Block2Server.Contains(byte.Parse(splitted[1], System.Globalization.NumberStyles.HexNumber)))
- {
- PlayerData.Block2Server.Remove(byte.Parse(splitted[1], System.Globalization.NumberStyles.HexNumber));
- Server.Packets.SendNotice("Unblocking 0x" + splitted[1]);
- }
- else
- {
- PlayerData.Block2Server.Add(byte.Parse(splitted[1], System.Globalization.NumberStyles.HexNumber));
- Server.Packets.SendNotice("Blocking 0x" + splitted[1]);
- }
- StreamWriter sw = new StreamWriter("BlockToServer.txt");
- foreach (byte BYTE in Block2Server)
- sw.WriteLine("{0:X}", BYTE);
- sw.Close();
- }
- catch (Exception e)
- {
- Server.Packets.SendNotice(e.ToString());
- Server.Packets.SendNotice("failed lul");
- }
- break;
- #endregion
- #region Change job
- case "job":
- try
- {
- Server.Packets.ChangeJob(Convert.ToInt16(splitted[1]));
- }
- catch
- {
- Server.Packets.SendNotice("failed lul");
- }
- break;
- #endregion
- #region level
- case "level":
- try
- {
- Server.Packets.ChangeLevel(Convert.ToByte(splitted[1]));
- }
- catch
- {
- Server.Packets.SendNotice("failed lul");
- }
- break;
- #endregion
- #region blocked packets
- case "blocked":
- string blocked = "C->S: ";
- foreach (byte BYTE in PlayerData.Block2Server)
- {
- blocked = blocked + "0x" + BYTE.ToString("X2") + ", ";
- }
- blocked = blocked + " S->C: ";
- foreach (byte BYTE in PlayerData.Block2Client)
- {
- blocked = blocked + "0x" + BYTE.ToString("X2") + ", ";
- }
- Server.Packets.SendNotice(blocked);
- break;
- #endregion
- default:
- return true;
- }
- }
- else
- return true;
- return false;
- }
- }
- public enum ToServer
- {
- _CharSelect = 0x13,
- _LoginToWorld = 0x14,
- _Pong = 0x19,
- _MovePlayer = 0x28,
- _CloseAttack = 0x2B,
- _Chat = 0x30,
- _NPC_TALK_CONT = 0x3B,
- _LootItem = 0xC0,
- _NpcMovement = 0xBB,
- }
- public enum ToClient
- {
- _SEND_LOGIN_INFO_REPLY = 0x00,
- _ServerIP = 0x0C,
- _ChangeChannel = 0x10,
- _Ping = 0x11,
- _UPDATE_STAT = 0x1C,
- _AddSkill = 0x21,
- _Notice = 0x41,
- _ChangeMap = 0x72,
- _MOVE_PLAYER = 0xA7,
- _ItemDropped = 0xEE,
- _SHOW_NPC = 0xE3,
- _CONTROL_NPC = 0xE5,
- _ANIMATE_NPC = 0xE6,
- _TakeDrop = 0xEF,
- _NPC_TALK = 0x10E,
- }
- }
Add Comment
Please, Sign In to add comment