Ejemplo n.º 1
0
 public static byte[] NPCTalk(int UK1, int ID, int LinkBack, int DT)
 {
     PacketBuilder Packet = new PacketBuilder(2032, 16);
     Packet.Long(UK1);
     Packet.Short(ID);
     Packet.Int(LinkBack);
     Packet.Int(DT);
     Packet.Long(0);//Uknonwn
     return Packet.getFinal();
 }
Ejemplo n.º 2
0
 public static byte[] Effect(int UID, string value)
 {
     PacketBuilder Packet = new PacketBuilder(1015, 13 + value.Length);
     Packet.Long(UID);
     Packet.Int(10);
     Packet.Int(1);
     Packet.Int(value.Length);
     Packet.Text(value);
     Packet.Short(0);
     return Packet.getFinal();
 }
Ejemplo n.º 3
0
 public static byte[] RemoveItemDropEffect(int UID, int GID, int X, int Y)
 {
     PacketBuilder Packet = new PacketBuilder(1101, 20);
     Packet.Long(UID);
     Packet.Long(GID);
     Packet.Short(X);
     Packet.Short(Y);
     Packet.Short(4);//Color
     Packet.Int(4); //Drop/Remove(Bool) 1:drop - 4:remove w/ effect, other: remove
     Packet.Int(0);
     return Packet.getFinal();
 }
Ejemplo n.º 4
0
 public static byte[] NPCTalk(int LinkBack, int DT, string Text)
 {
     PacketBuilder Packet = new PacketBuilder(2032, 16 + Text.Length);
     Packet.Long(0); //Unknown
     Packet.Short(0); //Unknown
     Packet.Int(LinkBack);
     Packet.Int(DT);
     Packet.Int(1); //# of strings
     Packet.Int(Text.Length);
     Packet.Text(Text);
     Packet.Short(0); //Unknown
     return Packet.getFinal();
 }
Ejemplo n.º 5
0
 public static byte[] TerrainNPC(int TNpcID, int MaxHp, int CurrentHp, int X, int Y, int TNpcType, string Name, int Facing)
 {
     PacketBuilder Packet = new PacketBuilder(1109, 28 + Name.Length);
     Packet.Long(TNpcID);
     Packet.Long(MaxHp);
     Packet.Long(CurrentHp);
     Packet.Short(X);
     Packet.Short(Y);
     Packet.Long(TNpcType);
     Packet.Short(26);//unknown, possibly subnpctype
     Packet.Int(Facing);
     Packet.Int(Name.Length);
     Packet.Text(Name);
     return Packet.getFinal();
 }
Ejemplo n.º 6
0
 public static byte[] TerrainNPC(Struct.TerrainNPC TNpc)
 {
     PacketBuilder Packet = new PacketBuilder(1109, 28);
     Packet.Long(TNpc.UID);
     Packet.Long(TNpc.MaximumHP);
     Packet.Long(TNpc.CurrentHP);
     Packet.Short(TNpc.X);
     Packet.Short(TNpc.Y);
     Packet.Short(TNpc.Type);
     Packet.Short(TNpc.Flag);
     Packet.Int(17);
     Packet.Short(0);
     Packet.Int(0);
     return Packet.getFinal();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Old. Dont use.
 /// </summary>
 public static byte[] SpawnMonsterOLD(int UID, int Mesh, int X, int Y, string Name, int HP, int Level, int Direction)
 {
     PacketBuilder Packet = new PacketBuilder(1014, 97 + Name.Length);
     Packet.Long(UID);
     Packet.Long(Mesh);
     Packet.Long(0); //TODO: Status
     Packet.Long(0); //Unknown
     Packet.Short(0); //TODO: Guilds
     Packet.Int(0); //Unknown
     Packet.Int(0); //GuildRank
     Packet.Long(0); //Unknown
     Packet.Long(0); //Headgear
     Packet.Long(0); //Armor or garment
     Packet.Long(0); //Right hand
     Packet.Long(0); //Left hand
     Packet.Long(0); //Unknown
     Packet.Short(HP);
     Packet.Short(Level); //Level
     Packet.Short(X);
     Packet.Short(Y);
     Packet.Short(330);
     Packet.Int(Direction);
     Packet.Int(100);//Action
     Packet.Short(0);
     Packet.Int(Level);
     Packet.Int(0); //Unknown
     Packet.Long(0); //Unknown
     Packet.Long(0); //TODO: Nobility
     Packet.Long(UID);
     Packet.Short(0); //Unknown
     Packet.Short(0); //Unknown
     Packet.Long(0); //Unknown
     Packet.Int(0); //Unknown
     Packet.Short(0); //Unknown, 0 for mobs
     Packet.Short(0); //Unknwon, 0 for mobs
     Packet.Long(0); //Unknown
     Packet.Short(0); //Unknown
     Packet.Int(1); //String count
     Packet.Int(Name.Length);
     Packet.Text(Name);
     return Packet.getFinal();
 }
Ejemplo n.º 8
0
 public static byte[] Chat(int MessageID, string From, string To, string Message, Struct.ChatType CType)
 {
     PacketBuilder Packet = new PacketBuilder(1004, 32 + From.Length + To.Length + Message.Length);
     Packet.Int(255); //Color - Red
     Packet.Int(255); //Color - Blue
     Packet.Short(255); //Color - Red
     Packet.Short((int)CType); //Chat Type
     Packet.Short(0); //Unknown
     Packet.Long(MessageID); //Message ID
     Packet.Int(255);//unknown
     Packet.Int(255);//unknown
     Packet.Int(255);//unknown
     Packet.Int(255);//unknown
     Packet.Long(0); //Unknown
     Packet.Int(4); //Strings+1
     Packet.Int(From.Length);
     Packet.Text(From);
     Packet.Int(To.Length);
     Packet.Text(To);
     Packet.Int(0); //Unknown
     Packet.Int(Message.Length);
     Packet.Text(Message);
     Packet.Int(0);
     Packet.Int(0);
     Packet.Int(0);
     return Packet.getFinal();
 }
Ejemplo n.º 9
0
 public static byte[] WarehouseItems(ClientSocket CSocket, int ID)
 {
     if (ID == 8) //TC ... elseif next
     {
         PacketBuilder Packet = new PacketBuilder(1102, 16 + (CSocket.Client.TCWhs.Count * 24));
         Packet.Long(ID);
         Packet.Long(0);
         Packet.Long(CSocket.Client.TCWhs.Count);
         foreach (KeyValuePair<int, Struct.ItemInfo> WHItem in CSocket.Client.TCWhs)
         {
             Struct.ItemInfo Item = WHItem.Value;
             Packet.Long(Item.UID);
             Packet.Long(Item.ItemID);
             Packet.Int(0);
             Packet.Int(Item.Soc1);
             Packet.Int(Item.Soc2);
             Packet.Int(0);
             Packet.Int(0);
             Packet.Int(Item.Plus);
             Packet.Int(Item.Bless);
             Packet.Int(0);
             Packet.Int(Item.Enchant);
             Packet.Int(0);
             Packet.Int(0);
             Packet.Int(0);
             Packet.Int(0);
             Packet.Int(0);
             Packet.Int(0);
             Packet.Int(Item.Color);
         }
         return Packet.getFinal();
     }
     return null;
 }
Ejemplo n.º 10
0
 public static byte[] CharacterInfo(ClientSocket CSocket)
 {
     PacketBuilder Packet = new PacketBuilder(1006, 162 + CSocket.Client.Name.Length + CSocket.Client.Spouse.Length);
     Packet.Long(CSocket.Client.ID);
     Packet.Long(CSocket.Client.Model);
     Packet.Short(CSocket.Client.Hair); //Hairstyle
     Packet.Short(0);//placeholder
     Packet.Long(CSocket.Client.Money); // Money
     Packet.Long(CSocket.Client.EPs); // EPs
     Packet.Long(CSocket.Client.Exp); // Exp
     Packet.Long(0);//placeholder
     Packet.Long(CSocket.Client.MentorExp);//TODO Mentor Exp
     Packet.Short(CSocket.Client.MercenaryExp);//TODO Merc Exp
     Packet.Short(0);//placeholder
     Packet.Short(CSocket.Client.BP);
     Packet.Short(0);//placeholder
     Packet.Short(CSocket.Client.Power);//power aka. force
     Packet.Short(CSocket.Client.Constitution);//Constitution
     Packet.Short(CSocket.Client.Dexterity);//Dexterity
     Packet.Short(CSocket.Client.Speed);//Speed
     Packet.Short(CSocket.Client.Vitality);//TODO Vitality
     Packet.Short(CSocket.Client.Soul);//soul
     Packet.Short(CSocket.Client.AdditionalPoint);//TODO Additional Point
     Packet.Short(CSocket.Client.CurrentHP);
     Packet.Short(CSocket.Client.MaxHP);
     Packet.Short(CSocket.Client.CurrentMP);//mana
     Packet.Short(CSocket.Client.MaxMP);
     Packet.Short(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Short(CSocket.Client.PkPoints);
     Packet.Int(CSocket.Client.Level); // Level
     Packet.Int((int)CSocket.Client.Class);//Class
     Packet.Int(CSocket.Client.Nobility);//TODO Nobility
     Packet.Int(CSocket.Client.Metempsychosis);//TODO Metempsychosis
     Packet.Int(CSocket.Client.AutoAllocate);//TODO Auto Allocate
     Packet.Int(CSocket.Client.MentorLevel);
     Packet.Int(CSocket.Client.MercenaryRank);//TODO Merc Rank
     Packet.Int(CSocket.Client.NobilityRank);//TODO Nobility Rank
     Packet.Short(CSocket.Client.MaxSummons);//TODO Max Summons
     Packet.Short(CSocket.Client.Exploit);//TODO Exploit
     Packet.Short(0);//placeholder
     Packet.Long(CSocket.Client.TokenPoints);//TODO Token Points
     Packet.Short(CSocket.Client.EudBagSize);
     Packet.Short(0);//placeholder
     Packet.Short(CSocket.Client.MuteFlag);//TODO Mute Flag
     Packet.Short(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Long(0);//placeholder
     Packet.Short(CSocket.Client.Vip);
     Packet.Short(0);
     Packet.Long(CSocket.Client.Wood);
     Packet.Short(CSocket.Client.Business);//TODO Business
     Packet.Short(0);
     Packet.Long(CSocket.Client.PPs);
     Packet.Int(2);//amount of strings
     Packet.Int(CSocket.Client.Name.Length);
     Packet.Text(CSocket.Client.Name);
     Packet.Int(CSocket.Client.Spouse.Length);
     Packet.Text(CSocket.Client.Spouse);
     Packet.Int(0);
     Packet.Short(0);
     /*byte[] D = Packet.getFinal();
     string packet = "";
     foreach(byte d in D)
         packet += Convert.ToString(d, 16).PadLeft(2, '0') + " ";
     Console.WriteLine(packet);
     return D;*/
     return Packet.getFinal();
 }