Exemplo n.º 1
0
        public static byte[] createGuildResponse(Character chr, byte managementType, byte managementArg = 0, string guildName = null)
        {
            OutPacket op = new OutPacket(88); // 32 & 56
            op.WriteInt		(32);
            op.WriteShort	(4);
            op.WriteShort	(97);
            op.WriteInt		(1);
            op.WriteInt		(chr.getuID()); // 12-15
            op.Skip			(16); // 16-31

            op.WriteInt		(56);
            op.WriteShort	(4);
            op.WriteShort	(61);
            op.WriteInt		(1);
            op.WriteInt		(chr.getuID());
            op.WriteShort	(1);
            op.WriteByte	(managementType);
            op.WriteByte	(managementArg);
            op.WritePaddedString(guildName ?? "", 20);
            op.WriteInt		(chr.getFame());
            op.WriteInt		(/* 344 ?? */);
            op.WriteLong	(chr.getCoin());
            return op.ToArray();
        }
Exemplo n.º 2
0
 public static void releaseGeneralQuestPacket(Character chr, byte karma = 0x0, byte penance = 0x0, int fame = 0x0, long exp = 0x0, long money = 0x0, byte guildPos = 0x0, byte faction = 0x0)
 {
     OutPacket op = new OutPacket(64);
     op.WriteInt(64);
     op.WriteShort(0x05);
     op.WriteShort(0x3b);
     op.WriteInt(715218689);
     op.WriteInt(chr.getuID());
     op.WriteByte(0x0); // karma
     op.WriteByte(0x0); // penance
     op.WriteShort(); // ?
     op.WriteByte(FameNickNames.Instance.getFameNickID(fame != 0x0 ? fame : chr.getFame()) > 0 ? (byte)1 : (byte)0); // appear player name above the head
     op.WriteByte(FameNickNames.Instance.getFameNickID(fame != 0x0 ? fame : chr.getFame())); // fame nickname
     op.WriteByte(chr.getAccount().gmLvl > 0 ? (byte)1 : (byte)0); // blue nickname??
     op.WriteByte(4); // ?
     op.WriteByte(4); // ?
     op.WriteByte(4); // ?
     op.WriteByte(4); // ?
     op.WriteByte(4); // ?
     op.WriteInt(fame != 0x0 ? fame : chr.getFame()); // fame
     op.WriteReversedLong(exp != 0x0 ? exp : chr.getExp()); // exp
     op.WriteLong(money != 0x0 ? money : chr.getCoin()); // money
     op.WriteByte(guildPos != 0x0 ? guildPos : (byte)0x0); // Guild Pos | TODO
     op.WriteByte(faction != 0x0 ? faction : chr.getFaction()); // Faction
     op.WriteByte(2); // 0 - gives an yellow message (?) | 1 - hides inventory
     Console.WriteLine(BitConverter.ToString(op.ToArray()));
     chr.getAccount().mClient.WriteRawPacket(op.ToArray());
 }
Exemplo n.º 3
0
        public static byte[] buyItemFromVendorSecondSite(Character buy, Character sold, int index, int invSlot, int x, int y, int amount)
        {
            Console.WriteLine("Handling Buying vendor item");

            byte[] chid = BitTools.intToByteArray(buy.getuID());
            byte[] chid1 = BitTools.intToByteArray(sold.getuID());
            byte[] newMoneySold = BitTools.intToByteArray((int)sold.getCoin());

            byte[] venBuy = new byte[40];
            venBuy[0] = (byte)venBuy.Length;

            venBuy[4] = (byte)0x04;
            venBuy[6] = (byte)0x3a;

            venBuy[8] = (byte)0x01;
            venBuy[9] = (byte)0x6b;
            venBuy[10] = (byte)0x15;
            venBuy[11] = (byte)0x08;

            for(int i = 0;i < 4;i++)
            {
                venBuy[12 + i] = chid1[i];
                venBuy[20 + i] = chid1[i];
                venBuy[32 + i] = newMoneySold[i];
            }

            venBuy[16] = (byte)0x01;

            venBuy[18] = (byte)0xDB;
            venBuy[19] = (byte)0x2A;

            venBuy[24] = (byte)index;
            venBuy[25] = (byte)invSlot;
            venBuy[26] = (byte)x;
            venBuy[27] = (byte)y;
            venBuy[28] = (byte)amount;
            return venBuy;
        }