Ejemplo n.º 1
0
 public byte[] npcSpawn(Character character)
 {
     OutPacket initNPCData = new OutPacket(615);
     initNPCData.WriteInt(615);
     initNPCData.WriteShort(0x04);
     initNPCData.WriteShort(0x04);
     initNPCData.WriteByte(0x01);
     initNPCData.WriteInt(character.getuID());
     initNPCData.WriteInt(character.getArea().getaID());
     initNPCData.WriteFloat(character.getPosition()[0]);
     initNPCData.WriteFloat(character.getPosition()[1]);
     initNPCData.WriteByte(3);
     initNPCData.WriteInt(this.uID);
     initNPCData.WriteInt();
     initNPCData.WritePaddedString(this.getName(), 16);
     initNPCData.Skip(18);
     initNPCData.WriteInt(this.getModule());
     initNPCData.Skip(10);
     initNPCData.WriteInt(this.getmID());
     initNPCData.Skip(16);
     initNPCData.WriteFloat(this.npcPosition[0]);
     initNPCData.WriteFloat(this.npcPosition[1]);
     initNPCData.Skip(502);
     initNPCData.WriteByte(0x22);
     initNPCData.WriteByte(0x08);
     return initNPCData.ToArray();
 }
Ejemplo n.º 2
0
 public static byte[] createDroppedItem(int itemuID, float posX, float posY, int itemID, int itemQuantity)
 {
     OutPacket op = new OutPacket(56);
     op.WriteInt(56);
     op.WriteShort(5);
     op.WriteShort(14);
     op.Skip(12);
     op.WriteInt(itemID);
     op.Skip(4);
     op.WriteInt(itemQuantity);
     op.WriteInt(itemuID);
     op.WriteFloat(posX);
     op.WriteFloat(posY);
     return op.ToArray();
 }
Ejemplo n.º 3
0
        public static byte[] refreshGuild(Character chr)
        {
            Guild guild = chr.getGuild();

            OutPacket op = new OutPacket(1644);
            op.WriteInt		(32);
            op.WriteShort	(4);
            op.WriteShort	(97);
            op.WriteInt		(1);
            op.WriteInt		(chr.getuID());
            op.Skip			(16);

            op.WriteInt		(1612);
            op.WriteShort	(4);
            op.WriteShort	(65);
            op.WriteInt		(1);
            op.WriteInt		(chr.getuID());
            op.WriteShort	(1);
            op.WritePaddedString(guild.guildName, 18);
            op.WriteShort	(guild.guildIcon);
            op.WriteShort	(guild.guildType);
            op.WriteInt		((guild.guildFame / 100) + (guild.guildGold / 10));
            op.WriteInt		(guild.guildFame);
            op.WriteLong	(guild.guildGold);
            op.WriteInt		(guild.guildHat);

            for(int i = 0;i < 50;i++)
            {
                op.WriteInt(guild.guildMembers.ElementAt(i) == null ? 0 : guild.guildMembers.ElementAt(i).getuID());
            } // 60 - 259

            for(int i = 0;i < 50;i++)
            {
                op.WriteByte(guild.guildMembers.ElementAt(i) == null ? (byte)0 : guild.guildMembers.ElementAt(i).getGuildRank());
            } // 260 - 309

            for(int i = 0;i < 50;i++)
            {
                if(guild.guildMembers.ElementAt(i) == null)
                {
                    op.Skip(17);
                    continue;
                }
                if(guild.guildMembers.ElementAt(i).getOnlineCharacter() == null)
                {
                    op.Skip(17);
                    continue;
                }
                Character tmp = guild.guildMembers.ElementAt(i).getOnlineCharacter();
                op.WritePaddedString(tmp.getName(), 17);
            } // 310 - 1159

            for(int i = 0;i < 50;i++)
            {
                if(guild.guildMembers.ElementAt(i) == null)
                {
                    op.Skip(1);
                    continue;
                }
                if(guild.guildMembers.ElementAt(i).getOnlineCharacter() == null)
                {
                    op.Skip(1);
                    continue;
                }
                Character tmp = guild.guildMembers.ElementAt(i).getOnlineCharacter();
                op.WriteByte(tmp.getcClass());
            }
            return op.ToArray();
        }
Ejemplo n.º 4
0
        public static byte[] quitGuildForInternal(Character chr)
        {
            /* This packet shows teh laziness of koreanz, they use one f*****g shit probably for everything - 3 packets just in one case ;
             * to show teh playa, that he has a guild or na ;
             * that he lives / joinz guild etc ;
             * oh lulz at u koreanz, I'd not like to work on Karma too ;
             * I already see on my eyez how much0 CRSpace team was butthurted to work on this shit XD*/

            OutPacket op = new OutPacket(1748);
            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		(72); // yeah - new packet & f**k rzaah 32-35
            op.WriteShort	(4);  // 36 - 37
            op.WriteShort	(63); // 38 - 39
            op.WriteInt		(1); // 40 - 43
            op.WriteInt		(chr.getuID()); // 44 - 47
            op.WriteInt		(1); // 48 - 51
            op.WriteInt		(chr.getuID()); // 52 - 55
            op.WriteInt		(3487029); // 555 - but wut for? // 56 - 59
            op.Skip			(12); // 60 - 71
            op.WriteInt		(135570688); // lukz f4mili4r <: // 72 - 75
            op.WriteInt		(chr.getuID()); // 76 - 79
            op.WriteInt		(3487029); // 555 - n again, wut for???? // 80 - 83
            op.Skip			(12); // 84 - 95
            op.WriteInt		(781505280); // damn koreanz, trying to stop us by their hash identificator shit! but we g0n4 fight to da last sold13r!! // 96 - 99
            op.WriteInt		(); // first skipped integer? :0 wutwut // 100 - 103

            op.WriteInt		(32); // another p4ck3t ; n yeah, it was already here ^ // 104 - 107
            op.WriteShort	(4); // 108 - 109
            op.WriteShort	(97); // 110 - 111
            op.WriteInt		(1); // 112 - 115
            op.WriteInt		(chr.getuID()); // 116 - 119
            op.Skip			(16); // 120 - 135

            op.WriteInt		(1612); // 4nd y34h, gi4nt sh1t upc0min qq & nother pckt & another dick in rzaah's ass // 136 - 139
            op.WriteShort	(4); // 140 - 141
            op.WriteShort	(65); // 142 - 143
            op.WriteInt		(1); // 144 - 147
            op.WriteInt		(chr.getuID()); // 148 - 152
            return op.ToArray();
        }
Ejemplo n.º 5
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();
        }
Ejemplo n.º 6
0
        public static byte[] initCharPacket(Character chr)
        {
            OutPacket op = new OutPacket(653);
            op.WritePaddedString(chr.getName(), 17); // 0-16
            op.WriteRepeatedByte(0x30, 16); // 17-32
            op.WriteByte();
            op.WriteShort(chr.getFaction()); // 34-35
            op.WriteInt(chr.getFame()); // 36-39
            op.WriteShort(chr.getcClass() == 2 ? (byte)0x02 : (byte)0x01); // 40-41
            op.WriteShort(chr.getFace()); // 42-43
            op.WriteInt(1);
            op.WriteShort(chr.getcClass()); // 48-49
            op.WriteShort(157); // 50-51 ; 1 -> hide player nick above the head & toggles guild on [1] / off [0] | 157 for random 154 warrior [probably guildType or guildIcon!! (important!!)]
            op.WriteShort(2); // 52-53 ; 7 -> 137 monk // your guild pos master/member etc.
            op.WriteShort(chr.getLevel()); // 54-55
            op.WriteInt(chr.getCurHP()); // 56-59
            op.WriteInt(chr.getCurMP()); // 60-63 but wtf.. mana is short o.o
            op.WriteInt(chr.getMap()); // 64-67 let's guess.. a map?
            op.WriteFloat(chr.getPosition()[0]); // 68-71
            op.WriteFloat(chr.getPosition()[1]); // 72-75
            for(byte i = 0;i < 17;i++)
            {
                if(chr.getEquipment().getEquipments().ContainsKey(i))
                {
                    op.WriteByte();
                    op.WriteByte(chr.getEquipment().getEquipments()[i].getEnding() > 0 ? (byte)0xff : (byte)0);
                    op.WriteShort();
                    op.WriteInt(chr.getEquipment().getEquipments()[i].getItemID());
                    op.WriteInt(chr.getEquipment().getEquipments()[i].getEnding() > 0 ? (int)chr.getEquipment().getEquipments()[i].getEnding() / 1000 : 1);
                } else op.WriteZero(12);
            }

            op.Position = 465;
            op.WriteByte(70);

            op.Position = 314;
            for(byte i = 0;i < 16;i++)
            {
                /*if(character.getBuffs().getBuffs().ContainsKey(i)) {
                    op.WriteShort(character.getBuffs().getBuffs()[i].getBuffSlot());
                    op.WriteShort(character.getBuffs().getBuffs()[i].getBuffID());
                    op.WriteShort(character.getBuffs().getBuffs()[i].getBuffTime());
                    op.WriteShort(character.getBuffs().getBuffs()[i].getBuffValue());
                } else*/
                op.Skip(8);
            }

            op.Skip(16);

            op.WriteByte(0); // no explanation
            op.WriteByte(0); // no explanation
            op.WriteByte(/*character.getKao()*/);
            op.WriteByte(/*character.getPenance()*/);
            op.WriteByte(chr.getEffect());
            op.WriteByte(0); // no explanation
            op.WriteByte(FameNickNames.Instance.getFameNickID(chr.getFame()));
            op.WriteByte(chr.getVp()); // 465
            op.WriteByte((byte)chr.getAccount().gmLvl); // 466
            op.WriteByte(0); // no explanation
            op.WriteByte(0); // -> 1 -> tells the client that UI mutation effect should be toggled off | 468
            op.WriteByte((byte)(chr.getInvPages() - 3)); // inventory pages | 469
            op.WriteByte(0); // no explanation
            op.WriteByte(0); // no explanation
            op.WriteShort(0); /*weird PK thing*/ // 472 - 473 but in fact.. it has some date time etc.
            op.WriteLong(0); // 474 - 481

            op.Position = 560;
            op.WriteInt(1); // ok.. so this is kinda weird - last place where you've leveled / died with your character?
            op.WriteFloat(-2558); // unknown posX
            op.WriteFloat(8950); // unknown posY
            op.WriteByte(0); // no explanation
            op.WriteByte(0); // no explanation
            op.WriteByte(0); // no explanation
            op.WriteByte(0); // no explanation
            for(int i = 0;i < chr.getCStats().Length;i++) op.WriteShort(chr.getCStats()[i]); // 576-577 / 578-579 / 580-581 / 582-583 / 584-585
            op.WriteShort(chr.getCurSP());
            op.WriteInt();
            op.WriteInt();

            op.WriteLong();
            op.WriteShort(chr.getStatPoints());
            op.WriteShort(chr.getSkillPoints()); // 606-607
            op.Position = 648;
            op.WriteByte(Convert.ToByte(chr.getDeleteState()));
            return op.ToArray();
        }
Ejemplo n.º 7
0
 public byte[] npcSpawnChained(Character chr)
 {
     OutPacket initNPCData = new OutPacket(589);
     initNPCData.WriteByte(3);
     initNPCData.WriteInt(this.uID);
     initNPCData.WriteInt();
     initNPCData.WritePaddedString(this.getName(), 16);
     initNPCData.Skip(18);
     initNPCData.WriteInt(this.getModule());
     initNPCData.Skip(10);
     initNPCData.WriteInt(this.getmID());
     initNPCData.Skip(16);
     initNPCData.WriteFloat(this.npcPosition[0]);
     initNPCData.WriteFloat(this.npcPosition[1]);
     return initNPCData.ToArray();
 }