Beispiel #1
0
        public static void SendItemUsed(ZoneCharacter character, Item item, ushort error = 1792)
        {
            if (error == 1792)
            {
                SendItemUseOK(character);
            }

            using (var packet = new Packet(SH12Type.ItemUseEffect))
            {
                packet.WriteUShort(error); //when not ok, it'll tell you there will be no effect
                packet.WriteUShort(item.ItemID);
                character.Client.SendPacket(packet);
            }
        }
Beispiel #2
0
 public static void ModifyInventorySlot(ZoneCharacter character, byte inventory, byte newslot, byte oldslot, Item item)
 {
     using (var packet = new Packet(SH12Type.ModifyItemSlot))
     {
         packet.WriteByte(oldslot);
         packet.WriteByte(inventory); //aka 'unequipped' bool
         packet.WriteByte(newslot);
         packet.WriteByte(0x24);
         if (item == null)
         {
             packet.WriteUShort(0xffff);
         }
         else
         {
             if (item is Equip)
             {
                 ((Equip)item).WriteEquipStats(packet);
             }
             else
             {
                 item.WriteItemStats(packet);
             }
         }
         character.Client.SendPacket(packet);
     }
 }