WriteUInt() public method

public WriteUInt ( uint pValue ) : void
pValue uint
return void
Example #1
0
        public static void SendPartyInformation(ZoneClient client)
        {
            if (Program.Entity.Parties.Where(c => c.CharNo == client.Character.ID).Count() == 1)
            {
                Party PartyNo = Program.Entity.Parties.First(c => c.CharNo == client.Character.ID);
                foreach (Party party in Program.Entity.Parties.Where(c => c.PartyNo == PartyNo.PartyNo))
                {
                    Character Pcharacter = Program.Entity.Characters.First(c => c.ID == party.CharNo);
                    ZoneClient otherLiveInfo = ClientManager.Instance.GetClientByName(Pcharacter.Name);
                    if (otherLiveInfo != null)
                    {
                        if (otherLiveInfo.Character.MapID == client.Character.MapID)
                        {
                            using (var ppacket = new Packet(SH14Type.PartyInformationShort))
                            {
                                ppacket.WriteByte(1);
                                ppacket.WriteString(otherLiveInfo.Character.Name, 16);
                                ppacket.WriteUInt(otherLiveInfo.Character.HP);
                                ppacket.WriteUInt(otherLiveInfo.Character.SP);
                                ppacket.WriteUInt(otherLiveInfo.Character.LP);
                                client.SendPacket(ppacket);
                            }

                            using (var ppacket = new Packet(SH14Type.PartyInformation))
                            {
                                ppacket.WriteByte(1); //unk
                                ppacket.WriteString(otherLiveInfo.Character.Name, 16);
                                ppacket.WriteByte((byte)otherLiveInfo.Character.Job);
                                ppacket.WriteByte(otherLiveInfo.Character.Level);
                                ppacket.WriteUInt(otherLiveInfo.Character.HP);
                                ppacket.WriteUInt(otherLiveInfo.Character.SP);
                                ppacket.WriteUInt(otherLiveInfo.Character.LP);
                                ppacket.WriteByte(1); //unk
                                client.SendPacket(ppacket);
                            }

                            using (var ppacket = new Packet(SH14Type.PartyLoginCord))
                            {
                                ppacket.WriteByte(1); //unk
                                ppacket.WriteString(otherLiveInfo.Character.Name, 16);
                                ppacket.WriteInt(otherLiveInfo.Character.Position.X);
                                ppacket.WriteInt(otherLiveInfo.Character.Position.Y);
                                client.SendPacket(ppacket);
                            }
                        }
                    }
                }
            }
        }
Example #2
0
 public void WriteUpdateStats(Packet packet)
 {
     packet.WriteUInt(this.HP);
     packet.WriteUInt(BaseStats.MaxHP);
     packet.WriteUInt(this.SP);
     packet.WriteUInt(BaseStats.MaxSP);
     packet.WriteUInt(this.LP);
     packet.WriteUInt(this.MaxLP);
     packet.WriteByte(this.Level);
     packet.WriteUShort(this.UpdateCounter);
 }
Example #3
0
        public void WriteDetailedInfoExtra(Packet packet, bool levelUP = false)
        {
            if (!levelUP)
            {
                packet.WriteUShort(this.MapObjectID);
            }

            packet.WriteLong(this.Exp);
            packet.WriteULong(DataProvider.Instance.GetMaxExpForLevel(this.Level));

            packet.WriteInt(BaseStats.Strength);
            packet.WriteInt(BaseStats.Strength + GetExtraStr());
            packet.WriteInt(BaseStats.Endurance);
            packet.WriteInt(BaseStats.Endurance + GetExtraEnd());
            packet.WriteInt(BaseStats.Dexterity);
            packet.WriteInt(BaseStats.Dexterity + GetExtraDex());
            packet.WriteInt(BaseStats.Intelligence);
            packet.WriteInt(BaseStats.Intelligence + GetExtraInt());

            packet.WriteInt(0); // Wizdom. It isn't set in the server so it can contain shit from old buffers... :D
            packet.WriteInt(0); // I once had a name here :P

            packet.WriteInt(BaseStats.Spirit);
            packet.WriteInt(BaseStats.Spirit + GetExtraSpr());

            packet.WriteInt(GetWeaponDamage()); //base damage
            packet.WriteInt(GetWeaponDamage(true)); //increased damage (e.g. buffs)
            packet.WriteInt(GetMagicDamage()); //magic dmg
            packet.WriteInt(GetMagicDamage(true)); //inc magic dmg

            packet.WriteInt(GetWeaponDefense()); //todo equip stats loading (weapondef)
            packet.WriteInt(GetWeaponDefense(true)); //weapondef inc

            packet.WriteInt(GetAim()); //TODO: basestats aim + dex?
            packet.WriteInt(GetAim(true)); //aim inc (calcuate later based on dex)

            packet.WriteInt(GetEvasion()); //evasion
            packet.WriteInt(GetEvasion(true)); //evasion inc

            packet.WriteInt(GetWeaponDamage()); //damage block again
            packet.WriteInt(GetWeaponDamage(true));

            packet.WriteInt(GetMagicDamage()); //magic damage
            packet.WriteInt(GetMagicDamage(true));

            packet.WriteInt(GetMagicDefense()); //magic def
            packet.WriteInt(GetMagicDefense(true)); //magic def inc

            packet.WriteInt(1);
            packet.WriteInt(20);
            packet.WriteInt(2);
            packet.WriteInt(40);

            packet.WriteUInt(BaseStats.MaxHP); //max HP
            packet.WriteUInt(BaseStats.MaxSP); //max SP
            if (character.Job == (int)Job.Crusader)
                packet.WriteInt(100);   // max LP
            else
                packet.WriteInt(0);              // max LP
            packet.WriteInt(0);                   // UNK
            packet.WriteInt(BaseStats.MAXSoulHP);   // Max HP Stones
            packet.WriteInt(BaseStats.MAXSoulSP);   // Max SP Stones
            packet.Fill(64, 0);
            if (!levelUP)
            {
                packet.WriteInt(this.Position.X);
                packet.WriteInt(this.Position.Y);
            }
        }
Example #4
0
 public void WriteDetailedInfo(Packet pPacket)
 {
     pPacket.WriteInt(ID);
     pPacket.WriteString(this.Name, 16);
     pPacket.WriteByte(this.Slot);
     pPacket.WriteByte(this.Level);
     pPacket.WriteLong(this.Exp);
     pPacket.WriteInt(0);                // UNK
     pPacket.WriteShort(this.StonesHP);
     pPacket.WriteShort(this.StonesSP);
     pPacket.WriteUInt(this.HP);
     pPacket.WriteUInt(this.SP);
     pPacket.Fill(4, 0); //UNK
     pPacket.WriteInt(this.Fame);                // Fame
     pPacket.WriteLong(this.Money); //TODO: inventory class
     pPacket.WriteString(this.Map.MapInfo.ShortName, 12);
     pPacket.WriteInt(this.Position.X);
     pPacket.WriteInt(this.Position.Y);
     pPacket.WriteByte(this.Rotation);
     pPacket.WriteByte(this.Str);   // Str bonus
     pPacket.WriteByte(this.End);   // End bonus
     pPacket.WriteByte(this.Dex);   // Dex bonus
     pPacket.WriteByte(this.Int);   // Int bonus
     pPacket.WriteByte(this.Spr);   // Spr bonus
     pPacket.WriteShort(0);               // UNK
     pPacket.WriteUInt(0);               // Killpoints
     pPacket.Fill(7, 0);                 // UNK
 }
Example #5
0
 public static void SendUpdateLP(ZoneCharacter character)
 {
     using (var p = new Packet(SH9Type.HealLP))
     {
         p.WriteUInt(character.MaxLP);
         character.Client.SendPacket(p);
     }
 }
Example #6
0
        public static void GotIngame(WorldClient client, Packet packet)
        {
            /* using (var p1 = new Packet(SH4Type.CharacterGuildacademyinfo))
               {
               if(client.Character.GuildAcademy != null)
               {

               }
               else
               {
               p1.Fill(5, 0);
               }
               client.SendPacket(p1);
               }
              using (var p2 = new Packet(SH4Type.CharacterGuildinfo))
               {
                  if (client.Character.Guild != null)
                  {
                      client.Character.Guild.Details.WriteMessageAsGuildMember(p2, client.Character.Guild);

                  }
                  else
                  {
                      p2.WriteInt(0);
                  }
              client.SendPacket(p2);
               }*/
               // dafuq no op code..
               using (var p = new Packet(0x581C))
               {
             //p.WriteShort();
               p.WriteUInt(0x4d0bc167);   // 21h
               client.SendPacket(p);
               }
               // dafuq no op code..
               using (var p3 = new Packet(0x581D))
               {
               p3.WriteShort(0);           //zero kingdom quests!
               client.SendPacket(p3);
               }

               using (var p4 = new Packet(21, 7))
               {
               p4.WriteByte((byte)client.Character.Friends.Count);
               client.Character.WriteFriendData(p4);
               client.SendPacket(p4);
               }
               using (var p5 = new Packet(SH2Type.UnkTimePacket))
               {
               p5.WriteShort(256);
               client.SendPacket(p5);
               }
               if (!client.Character.IsIngame)
               {
               client.Character.IsIngame = true;

               client.Character.OneIngameLoginLoad();
               MasterManager.Instance.SendMasterList(client);
               //SendMasterList(pClient);
               }

               Managers.CharacterManager.InvokdeIngame(client.Character);
               client.Character.OnGotIngame();
        }
Example #7
0
 public static void SendUpdateSP(ZoneCharacter character)
 {
     using (var p = new Packet(SH9Type.HealSP))
     {
         p.WriteUInt(character.SP);
         p.WriteUShort(character.UpdateCounter);
         character.Client.SendPacket(p);
     }
 }
Example #8
0
 public static void SendSkill(MapObject user, ushort animid, List<SkillVictim> victims)
 {
     using (var packet = new Packet(SH9Type.SkillAnimationTarget))
     {
         packet.WriteUShort(animid);
         packet.WriteUShort(user.MapObjectID);
         packet.WriteByte((byte)(victims.Count > 255 ? 255 : victims.Count));
         for (byte i = 0; i < victims.Count && i != 255; i++)
         {
             var victim = victims[i];
             packet.WriteUShort(victim.MapObjectID);
             packet.WriteByte(victim.Stance1);
             packet.WriteByte(victim.Stance2);
             packet.WriteUInt(victim.Damage);
             packet.WriteUInt(victim.HPLeft);
             packet.WriteUShort(victim.HPCounter);
         }
         user.MapSector.Broadcast(packet);
     }
 }
Example #9
0
 public static void SendPremiumEmotions(ZoneCharacter character)
 {
     using (var packet = new Packet(SH4Type.CharacterItemList))
     {
         byte count = 0;
         packet.WriteByte(count);   // Count
         packet.WriteByte(0x0F);    // Inventory
         packet.WriteByte(0xCB);    // UNK    (In newest client it exists, in bit older, not)
         for (byte i = 0; i < count; i++)
         {
             packet.WriteByte(8);           // Item Data Length
             packet.WriteByte(i);           // Slot
             packet.WriteByte(0x3C);        // Inventory thing
             packet.WriteUShort((ushort)(31500 + (16 < i ? 1 : 0) + i * 2));  // Item ID
             packet.WriteUInt(1992027391);  // Expiring Time (1992027391 - Permanent)
         }
         character.Client.SendPacket(packet);
     }
 }
Example #10
0
 public static void SendHouseList(ZoneCharacter character)
 {
     //TODO: house loading
     using (var packet = new Packet(SH4Type.CharacterItemList))
     {
         byte count = 0;
         packet.WriteByte(count);   // Count
         packet.WriteByte(0x0C);    // Inventory
         packet.WriteByte(0x35);    // UNK    (In newest client it exists, in bit older, not)
         for (byte i = 0; i < count; i++)
         {
             packet.WriteByte(8);           // Item Data Length
             packet.WriteByte(i);           // Slot
             packet.WriteByte(0x30);        // UNK
             packet.WriteUShort((ushort)(31000 + i * 3));  // Item ID
             packet.WriteUInt(1992027391);  // Expiring Time (1992027391 - Permanent)
         }
         character.Client.SendPacket(packet);
     }
 }
Example #11
0
        //this is used by the smaller writer (e.g. additem, unequip, equip)
        public void WriteSmallInfo(Packet packet)
        {
            packet.WriteUShort(this.ItemID);
            switch (SlotType)
            {
                case ItemSlot.Helm:
                case ItemSlot.Armor:
                case ItemSlot.Pants:
                case ItemSlot.Boots:
                case ItemSlot.Weapon2:
                case ItemSlot.Weapon:
                    packet.WriteByte(Upgrades);
                    packet.Fill(6, 0);
                    packet.WriteUShort(ushort.MaxValue); //unk
                    packet.WriteUInt(GetExpiringTime());
                    packet.WriteUShort(ushort.MaxValue);
                    break;

                default:
                    packet.WriteUInt(GetExpiringTime());
                    packet.WriteInt(0); //unk
                    break;
            }
        }
Example #12
0
        public void WriteEquipStats(Packet packet)
        {
            byte StatCount = 0;
            if (Str > 0) StatCount++;
            if (End > 0) StatCount++;
            if (Dex > 0) StatCount++;
            if (Spr > 0) StatCount++;
            if (Int > 0) StatCount++;

            packet.WriteUShort(ItemID);
            switch (this.SlotType)
            {
                case ItemSlot.Helm:
                case ItemSlot.Armor:
                case ItemSlot.Pants:
                case ItemSlot.Boots:
                    packet.WriteByte(this.Upgrades);   // Refinement
                    packet.WriteByte(0);
                    packet.WriteShort(0); // Or int?
                    packet.WriteShort(0);
                    packet.WriteByte(0);
                    packet.WriteInt(0); //Temp
                    packet.WriteByte(0x01); //Temp
                    break;
                // case ItemSlot.Bow: // Shield = same
                case ItemSlot.Weapon2:
                case ItemSlot.Weapon:
                    packet.WriteByte(this.Upgrades);   // Refinement
                    packet.WriteByte(0);
                    packet.WriteShort(0); // Or int?
                    packet.WriteShort(0);
                    if (this.SlotType == ItemSlot.Weapon || (this.SlotType == ItemSlot.Weapon2 && Info.TwoHand))
                    {
                        packet.WriteByte(0);
                        // Licence data
                        packet.WriteUShort(0xFFFF);    // Nr.1 - Mob ID
                        packet.WriteUInt(0);           // Nr.1 - Kill count
                        packet.WriteUShort(0xFFFF);    // Nr.2 - Mob ID
                        packet.WriteUInt(0);           // Nr.2 - Kill count
                        packet.WriteUShort(0xFFFF);    // Nr.3 - Mob ID
                        packet.WriteUInt(0);           // Nr.3 - Kill count
                        packet.WriteUShort(0xFFFF);        // UNK
                        packet.WriteString("", 16);    // First licence adder name
                    }
                    packet.WriteByte(0);
                    packet.Fill(9, (byte)0xFF);
                    packet.Fill(7, 0x00);
                    //packet.WriteUInt(GetExpiringTime());               // Expiring time (1992027391 -  never expires)
                    break;
                case ItemSlot.Pet:
                    packet.WriteByte(this.Upgrades);   // Pet Refinement Lol
                    packet.Fill(2, 0);                     // UNK
                    packet.WriteUInt(GetExpiringTime());               // Expiring time (1992027391 -  never expires)
                    packet.WriteUInt(0);               // Time? (1992027391 -  never expires)
                    break;
                case ItemSlot.Earings:
                case ItemSlot.Necklace:
                case ItemSlot.Ring:
                    packet.WriteUInt(GetExpiringTime());               // Expiring time (1992027391 -  never expires)
                    packet.WriteUInt(0);               // Time? (1992027391 -  never expires)
                    packet.WriteByte(this.Upgrades);   // Refinement
                    // Stats added while refining
                    packet.WriteUShort(0);             // it may be byte + byte too (some kind of counter when item downgrades)
                    packet.WriteUShort(0);             // STR
                    packet.WriteUShort(0);             // END
                    packet.WriteUShort(0);             // DEX
                    packet.WriteUShort(0);             // INT
                    packet.WriteUShort(0);             // SPR
                    break;
                case ItemSlot.CostumeWeapon:
                case ItemSlot.CostumeShield:
                    packet.WriteUInt(25000);           // Skin Durability
                    break;
                default:
                    //packet.WriteUInt(GetExpiringTime());      // Expiring time (1992027391 -  never expires)
                    //packet.WriteUInt(0);                        // Time? (1992027391 -  never expires)
                    break;
            }

            //// Random stats data (Not those what were added in refinement)
            //switch (this.SlotType)
            //{                       // Stat count (StatCount << 1 | Visible(0 or 1 are stats shown or not))
            //    case ItemSlot.Earings:
            //        packet.WriteByte((byte)(StatCount << 1 | 1));
            //        break;
            //    case ItemSlot.Necklace:
            //    case ItemSlot.Ring:
            //        packet.WriteByte((byte)(StatCount << 1 | 1));
            //        break;
            //    case ItemSlot.Helm:
            //    case ItemSlot.Armor:
            //    case ItemSlot.Pants:
            //    case ItemSlot.Boots:
            //    case ItemSlot.Weapon2:
            //    case ItemSlot.Weapon:
            //        packet.WriteByte((byte)(StatCount << 1 | 1));
            //        break;
            //    case ItemSlot.Pet:          // Yes!! Its possible to give stats to pet also (It overrides default one(s)).
            //        packet.WriteByte((byte)(StatCount << 1 | 1));
            //        break;
            //}
            //// foreach stat
            ////pPacket.WriteByte(type);              // Stat type ( 0 = STR, 1 = END, 2 = DEX, 3 = INT, 4 = SPR )
            ////pPacket.WriteUShort(amount);          // Amount
            //// end foreach
            //if (Str > 0) { packet.WriteByte(0); packet.WriteUShort(Str); }
            //if (End > 0) { packet.WriteByte(1); packet.WriteUShort(End); }
            //if (Dex > 0) { packet.WriteByte(2); packet.WriteUShort(Dex); }
            //if (Spr > 0) { packet.WriteByte(3); packet.WriteUShort(Spr); }
            //if (Int > 0) { packet.WriteByte(4); packet.WriteUShort(Int); }
        }
Example #13
0
        public void WriteStats(Packet Packet)
        {
            Packet.WriteUShort(ItemInfo.ItemID);

            switch (ItemInfo.Class)
            {
                case ItemClass.Mount:
                    Packet.WriteUShort(100); // food ?
                    Packet.WriteUInt(0); // use time?
                    Packet.WriteUInt(1992027391); // expire time?
                    Packet.WriteUShort(0); // unk ?
                    break;
                case ItemClass.QuestItem:
                    Packet.WriteByte(0); // unk ?
                    break;
                case ItemClass.PremiumItem:
                    Packet.WriteUInt(0); // use time
                    Packet.WriteUInt(1992027391); // expire time
                    break;

                case ItemClass.CollectCard:
                    Packet.WriteUInt(1000); // serial
                    Packet.WriteByte(5); // stars
                    break;
            }
        }
Example #14
0
        public void WriteEquipStats(Packet Packet)
        {
            var length = GetEquipLength(this);
            var statCount = GetInfoStatCount(this);

            length += (byte)(statCount * 3);

            Packet.WriteUShort(ItemInfo.ItemID);

            switch (ItemInfo.Slot)
            {
                case ItemSlot.Weapon:
                case ItemSlot.Weapon2:
                case ItemSlot.Armor:
                case ItemSlot.Pants:
                case ItemSlot.Boots:
                case ItemSlot.Helm:
                case ItemSlot.Pet:
                    Packet.WriteByte(0);//upgrades
                    Packet.WriteByte(0); // unk
                    Packet.WriteUInt(0); // unk2
                    Packet.WriteByte(0); // unk3

                    if ((ItemInfo.Slot == ItemSlot.Weapon
                        || ItemInfo.Slot == ItemSlot.Weapon2)
                        && ItemInfo.Class != ItemClass.Shield)
                    {
                        Packet.WriteUShort(0xFFFF); // title mob 1
                        Packet.WriteUInt(0);      // title mob 1 kill count
                        Packet.WriteUShort(0xFFFF); // title mob 2
                        Packet.WriteUInt(0);      // title mob 2 kill count
                        Packet.WriteUShort(0xFFFF); // title mob 3
                        Packet.WriteUInt(0);      // title mob 3 kill count

                        Packet.WriteUShort(0xFFFF); // unk
                        Packet.WriteString("", 16); // license adder name
                        Packet.WriteByte(0);
                    }

                    Packet.WriteUInt(1992027391); // unk4
                    break;

                case ItemSlot.Necklace:
                case ItemSlot.Earings:
                case ItemSlot.Ring:
                case ItemSlot.Ring2:
                    Packet.WriteUInt(1992027391); // expire time?
                    Packet.WriteUInt(0); // time ?
                    Packet.WriteByte(0);//upgrades

                    Packet.WriteUShort(0); // refinement stats?
                    Packet.WriteUShort((ushort)UpgradeStats.Str);
                    Packet.WriteUShort((ushort)UpgradeStats.End);
                    Packet.WriteUShort((ushort)UpgradeStats.Dex);
                    Packet.WriteUShort((ushort)UpgradeStats.Int);
                    Packet.WriteUShort((ushort)UpgradeStats.Spr);

                    break;

                default:
                    Packet.WriteUInt(0);
                    Packet.WriteUInt(1992027391); // expire time?
                    break;
            }

            switch (ItemInfo.Slot)
            {
                case ItemSlot.Weapon:
                case ItemSlot.Weapon2:
                case ItemSlot.Armor:
                case ItemSlot.Pants:
                case ItemSlot.Boots:
                case ItemSlot.Helm:
                case ItemSlot.Pet:
                case ItemSlot.Necklace:
                case ItemSlot.Earings:
                case ItemSlot.Ring:
                case ItemSlot.Ring2:
                    Packet.WriteByte((byte)(statCount << 1 | 1));

                    if (ItemInfo.Stats.Str > 0) { Packet.WriteByte(0); Packet.WriteUShort((ushort)ItemInfo.Stats.Str); }
                    if (ItemInfo.Stats.End > 0) { Packet.WriteByte(1); Packet.WriteUShort((ushort)ItemInfo.Stats.End); }
                    if (ItemInfo.Stats.Dex > 0) { Packet.WriteByte(2); Packet.WriteUShort((ushort)ItemInfo.Stats.Dex); }
                    if (ItemInfo.Stats.Spr > 0) { Packet.WriteByte(3); Packet.WriteUShort((ushort)ItemInfo.Stats.Spr); }
                    if (ItemInfo.Stats.Int > 0) { Packet.WriteByte(4); Packet.WriteUShort((ushort)ItemInfo.Stats.Int); }
                    break;
            }
        }
Example #15
0
 public static void SendGainExp(ZoneCharacter who, uint amount, ushort mobid = (ushort) 0xFFFF)
 {
     using (var packet = new Packet(SH9Type.GainExp))
     {
         packet.WriteUInt(amount);
         packet.WriteUShort(mobid);
         who.Client.SendPacket(packet);
     }
 }
Example #16
0
 public static void SendSkill(MapObject user, ushort animid, ushort victimid, uint damage, uint newhp, ushort counter, byte special1 = (byte) 0x10, byte special2 = (byte) 0x00)
 {
     // 9 82 | [E5 3F] [8A 27] [01] [8A 27] [10 00] [09 00 00 00] [5E 00 00 00] [A7 4C]
     // 9 82 | [9A 35] [8A 27] [01] [C2 05] [10 00] [0A 00 00 00] [1D 01 00 00] [73 37]
     // 9 82 | [43 3C] [42 15] [01] [AC 4C] [01 01] [7A 02 00 00] [00 00 00 00] [35 09]
     // 9 82 | [0E 39] [42 15] [01] [00 4A] [21 01] [1C 03 00 00] [00 00 00 00] [8C 0E]
     using (var packet = new Packet(SH9Type.SkillAnimationTarget))
     {
         packet.WriteUShort(animid);
         packet.WriteUShort(user.MapObjectID);
         packet.WriteBool(true);
         packet.WriteUShort(victimid);
         packet.WriteByte(special1);
         packet.WriteByte(special2);
         packet.WriteUInt(damage);
         packet.WriteUInt(newhp);
         packet.WriteUShort(counter);
         user.MapSector.Broadcast(packet);
     }
 }
Example #17
0
 public static void SendPremiumItemList(ZoneCharacter character)
 {
     using (var packet = new Packet(SH4Type.CharacterItemList))
     {
         ushort count = 0;
         packet.WriteUShort(count);   // Count
         for (ushort i = 0; i < count; i++)
         {
             packet.WriteUShort(0x0010);    // Inventory
             packet.WriteUShort(0x0000);    // Slot
             packet.WriteUShort(0x033B);    // Item Handle      // (Iron Case, to add 4 extra inventories :P)
             packet.WriteUInt(1992027391);  // Activation Time (1992027391 - Permanent)
             packet.WriteUInt(1992027391);  // Expiring Time (1992027391 - Permanent)
         }
         character.Client.SendPacket(packet);
     }
 }
Example #18
0
 public static void SendSkillPosition(MapObject user, ushort animid, ushort skillid, uint x, uint y)
 {
     // 9 81 | [32 29] [B8 10] [56 0A 00 00] [3A 27 00 00] [75 70]
     using (var packet = new Packet(SH9Type.SkillAnimationPosition))
     {
         packet.WriteUShort(user.MapObjectID);
         packet.WriteUShort(skillid);
         packet.WriteUInt(x);
         packet.WriteUInt(y);
         packet.WriteUShort(animid);
         user.MapSector.Broadcast(packet);
     }
 }
Example #19
0
 public static void SendPartyMemberHPSPLP(ZoneCharacter character)
 {
     if (Program.Entity.Parties.Where(c => c.CharNo == character.Client.Character.ID).Count() == 1)
     {
         Party PartyNo = Program.Entity.Parties.First(c => c.CharNo == character.Client.Character.ID);
         foreach (Party party in Program.Entity.Parties.Where(c => c.PartyNo == PartyNo.PartyNo))
         {
             Character Pcharacter = Program.Entity.Characters.First(c => c.ID == party.CharNo);
             ZoneClient otherLiveInfo = ClientManager.Instance.GetClientByName(Pcharacter.Name);
             if (otherLiveInfo != null)
             {
                 if (otherLiveInfo.Character.MapID == character.Client.Character.MapID)
                 {
                     using (var ppacket = new Packet(SH14Type.PartyInformationShort))
                     {
                         ppacket.WriteByte(1);
                         ppacket.WriteString(character.Client.Character.Name, 16);
                         ppacket.WriteUInt(character.Client.Character.HP);
                         ppacket.WriteUInt(character.Client.Character.SP);
                         ppacket.WriteUInt(character.Client.Character.LP);
                         otherLiveInfo.SendPacket(ppacket);
                     }
                 }
             }
         }
     }
 }
Example #20
0
        public static void SendAttackDamage(MapObject from, ushort objectID, ushort damage, bool crit, uint hpleft, ushort counter)
        {
            using (var packet = new Packet(SH9Type.AttackDamage))
            {
                packet.WriteUShort(from.MapObjectID);
                packet.WriteUShort(objectID);
                packet.WriteBool(crit);
                packet.WriteUShort(damage);
                packet.WriteUInt(hpleft);
                packet.WriteUShort(counter);
                packet.WriteByte(4);
                packet.WriteByte(100);

                from.MapSector.Broadcast(packet);
            }
        }
Example #21
0
        private void Test99(ZoneCharacter character, params string[] param)
        {
            using (var packet = new Packet(SH14Type.UpdatePartyMemberStats))
            {
                packet.WriteByte(1);//unk
                packet.WriteString("Stan", 16);
                packet.WriteUInt(character.HP);
                packet.WriteUInt(character.SP);
                character.Client.SendPacket(packet);
            }
            using (var ppacket = new Packet(SH14Type.SetMemberStats))//when character has levelup in group
            {
                ppacket.WriteByte(1);
                ppacket.WriteString("Stan", 16);
                ppacket.WriteByte((byte)character.Job);
                ppacket.WriteByte(character.Level);
                ppacket.WriteUInt(character.MaxHP);//maxhp
                ppacket.WriteUInt(character.MaxSP);//MaxSP
                ppacket.WriteByte(1);
                character.Client.SendPacket(ppacket);

            }
        }
Example #22
0
 public void WriteUpdateStats(Packet packet)
 {
     packet.WriteUInt(HP);
     packet.WriteUInt(MaxHP); // Max HP
     packet.WriteUInt(SP);
     packet.WriteUInt(MaxSP); // Max SP
     packet.Fill(8, 0); //unk
     packet.WriteByte(Level);
     packet.WriteUShort(this.UpdateCounter);
 }
Example #23
0
 public void WriteDetailedInfo(Packet pPacket)
 {
     pPacket.WriteInt(ID);
     pPacket.WriteString(this.Name, 16);
     pPacket.WriteByte(this.Slot);
     pPacket.WriteByte(this.Level);
     pPacket.WriteLong(this.Exp);
     pPacket.WriteInt(12345678);                // UNK
     pPacket.WriteShort(this.StonesHP);
     pPacket.WriteShort(this.StonesSP);
     pPacket.WriteUInt(this.HP);
     pPacket.WriteUInt(this.SP);
     pPacket.WriteInt(this.Fame);
     pPacket.WriteLong(this.Inventory.Money);
     pPacket.WriteString(this.Map.MapInfo.ShortName, 12);
     pPacket.WriteInt(this.Position.X);
     pPacket.WriteInt(this.Position.Y);
     pPacket.WriteByte(this.Rotation);
     pPacket.WriteByte(this.Str);//  -.
     pPacket.WriteByte(this.End);//   |
     pPacket.WriteByte(this.Dex);//   |  Boni
     pPacket.WriteByte(this.Int);//   |
     pPacket.WriteByte(this.Spr);//  -'
     pPacket.WriteShort(0);               // UNK
     pPacket.WriteUInt(0);               // Killpoints (TODO)
     pPacket.Fill(7, 0);                 // UNK
 }