protected internal override void run()
        {
            bool flag = base.getClient() != null;

            if (flag)
            {
                try
                {
                    Account player = base.getClient().getPlayer();
                    foreach (ItemsModel current in player.getInventory().getItemsAll())
                    {
                        bool flag2 = current.object_id == this.obj_id;
                        if (flag2)
                        {
                            current.equip_type = 2;
                        }
                    }
                    bool flag3 = DAOM.getInstance().getItem(this.obj_id) != null;
                    if (flag3)
                    {
                        DAOM.getInstance().getItem(this.obj_id).equip_type = 2;
                    }
                    AccountManager.getInstance().updateStatusItem(this.obj_id);
                    player.sendPacket(new PROTOCOL_INVENTORY_EQUIP_NOTUSED_ACK(this.obj_id, 2, player));
                    player.sendPacket(new PROTOCOL_INVENTORY_ADD_ITEM_ACK(this.obj_id, 1, player.getPlayerId(), "", 86400, 2, player));
                }
                catch (Exception ex)
                {
                    CLogger.getInstance().info(ex.ToString());
                }
            }
        }
Exemplo n.º 2
0
        protected internal override void write()
        {
            base.writeH(535);
            bool flag = this._type == 2;

            if (flag)
            {
                this.item_id = 0;
                bool flag2 = DAOM.getInstance().getItem(this._objId) != null;
                if (flag2)
                {
                    this.item_id = DAOM.getInstance().getItem(this._objId).id;
                }
                base.writeD(1);
                base.writeD(Convert.ToInt32(DateTime.Now.ToString("yyMMddHHmm")));
                base.writeQ((long)this._objId);
                bool flag3 = this._objId < 32768 && this._objId > 16384 && this._objId > 32 && this._objId > 8;
                if (flag3)
                {
                    base.writeD(this._objId);
                    base.writeC(1);
                    base.writeD(1);
                }
                else
                {
                    base.writeD(this._objId);
                    base.writeC(2);
                    int  num   = AccountManager.getInstance().getCountForItemId(this.item_id, this._p.getPlayerId());
                    bool flag4 = DAOM.getInstance().getItem(this._objId) != null;
                    if (flag4)
                    {
                        num = DAOM.getInstance().getItem(this._objId).count;
                    }
                    DateTime now = DateTime.Now;
                    base.writeD(Convert.ToInt32(DateTime.Now.AddSeconds((double)num).ToString("yyMMddHHmm")));
                }
            }
            else
            {
                base.writeD(1);
                base.writeD(Convert.ToInt32(DateTime.Now.ToString("yyMMddHHmm")));
                base.writeD(1);
                base.writeD(0);
                base.writeD(0);
                base.writeC(1);
                base.writeD(0);
            }
        }