Пример #1
0
 private static void LoseDura(ActorPC pc, SagaDB.Items.EQUIP_SLOT slot)
 {
     Packets.Server.ItemAdjust          p  = new SagaMap.Packets.Server.ItemAdjust();
     ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)pc.e;
     if (pc.inv.EquipList.ContainsKey(slot))
     {
         if (pc.inv.EquipList[slot].durability > 0)
         {
             pc.inv.EquipList[slot].durability--;
             p.SetContainer(1);
             p.SetFunction(SagaMap.Packets.Server.ItemAdjust.Function.Durability);
             p.SetSlot((byte)slot);
             p.SetValue(pc.inv.EquipList[slot].durability);
             eh.C.netIO.SendPacket(p, eh.C.SessionID);
             if (pc.inv.EquipList[slot].durability == 0)
             {
                 pc.inv.EquipList[slot].active = 0;
                 p = new SagaMap.Packets.Server.ItemAdjust();
                 p.SetContainer(1);
                 p.SetSlot((byte)slot);
                 p.SetFunction(SagaMap.Packets.Server.ItemAdjust.Function.Active);
                 p.SetValue(0);
                 eh.C.netIO.SendPacket(p, eh.C.SessionID);
                 Bonus.BonusHandler.Instance.EquiqItem(pc, pc.inv.EquipList[slot], true);
                 SkillHandler.CalcHPSP(ref pc);
                 eh.C.SendCharStatus(0);
                 eh.C.SendExtStats();
                 eh.C.SendBattleStatus();
                 MapServer.charDB.UpdateItem(pc, pc.inv.EquipList[slot]);
             }
         }
     }
 }
Пример #2
0
 public void MakeInactive(EQUIP_SLOT slot)
 {
     Item item;
     if (!this.Char.inv.EquipList.ContainsKey(slot)) return;
     item = this.Char.inv.EquipList[slot];
     if (item.active == 0) return;
     item.active = 0;
     Bonus.BonusHandler.Instance.EquiqItem(this.Char, item, true);
     Packets.Server.ItemAdjust p = new SagaMap.Packets.Server.ItemAdjust();
     p.SetContainer(1);
     p.SetSlot((byte)slot);
     p.SetFunction(SagaMap.Packets.Server.ItemAdjust.Function.Active);
     p.SetValue(0);
     this.client.netIO.SendPacket(p, client.SessionID);
 }
Пример #3
0
        public void MakeInactive(EQUIP_SLOT slot)
        {
            Item item;

            if (!this.Char.inv.EquipList.ContainsKey(slot))
            {
                return;
            }
            item = this.Char.inv.EquipList[slot];
            if (item.active == 0)
            {
                return;
            }
            item.active = 0;
            Bonus.BonusHandler.Instance.EquiqItem(this.Char, item, true);
            Packets.Server.ItemAdjust p = new SagaMap.Packets.Server.ItemAdjust();
            p.SetContainer(1);
            p.SetSlot((byte)slot);
            p.SetFunction(SagaMap.Packets.Server.ItemAdjust.Function.Active);
            p.SetValue(0);
            this.client.netIO.SendPacket(p, client.SessionID);
        }
Пример #4
0
 private static void LoseDura(ActorPC pc, SagaDB.Items.EQUIP_SLOT slot)
 {
     Packets.Server.ItemAdjust p = new SagaMap.Packets.Server.ItemAdjust();
     ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)pc.e;
     if (pc.inv.EquipList.ContainsKey(slot))
         if (pc.inv.EquipList[slot].durability > 0)
         {
             pc.inv.EquipList[slot].durability--;
             p.SetContainer(1);
             p.SetFunction(SagaMap.Packets.Server.ItemAdjust.Function.Durability);
             p.SetSlot((byte)slot);
             p.SetValue(pc.inv.EquipList[slot].durability);
             eh.C.netIO.SendPacket(p, eh.C.SessionID);
             if (pc.inv.EquipList[slot].durability == 0)
             {
                 pc.inv.EquipList[slot].active = 0;
                 p = new SagaMap.Packets.Server.ItemAdjust();
                 p.SetContainer(1);
                 p.SetSlot((byte)slot);
                 p.SetFunction(SagaMap.Packets.Server.ItemAdjust.Function.Active);
                 p.SetValue(0);
                 eh.C.netIO.SendPacket(p, eh.C.SessionID);
                 Bonus.BonusHandler.Instance.EquiqItem(pc, pc.inv.EquipList[slot], true);
                 SkillHandler.CalcHPSP(ref pc);
                 eh.C.SendCharStatus(0);
                 eh.C.SendExtStats();
                 eh.C.SendBattleStatus();
                 MapServer.charDB.UpdateItem(pc, pc.inv.EquipList[slot]);
             }
         }
 }