Fixed bug with same augmentation in two different weapons.

This commit is contained in:
MobiusDevelopment 2022-01-18 05:59:19 +00:00
parent 495fb6a45a
commit 2b34e5fb17
2 changed files with 15 additions and 10 deletions

View File

@ -449,7 +449,7 @@ public class UseItem implements IClientIncomingPacket
}
}
// unEquipItem will call also the remove boni for augument
// unEquipItem will call also the remove bonus for augment
items = player.getInventory().unEquipItemInBodySlotAndRecord(bodyPart);
}
else
@ -535,11 +535,13 @@ public class UseItem implements IClientIncomingPacket
}
items = player.getInventory().equipItemAndRecord(item);
// Charge Soulshot/Spiritshot like L2OFF
if (item.getItem() instanceof Weapon)
{
// Charge Soulshot/Spiritshot like L2OFF
player.rechargeAutoSoulShot(true, true, false);
}
// Consume mana - will start a task if required; returns if item is not a shadow item.
item.decreaseMana(false);
}

View File

@ -480,7 +480,7 @@ public class UseItem implements IClientIncomingPacket
}
}
// unEquipItem will call also the remove boni for augument
// unEquipItem will call also the remove bonus for augment
items = player.getInventory().unEquipItemInBodySlotAndRecord(bodyPart);
}
else
@ -567,12 +567,6 @@ public class UseItem implements IClientIncomingPacket
}
player.sendPacket(sm);
// Apply augementation boni on equip
if (item.isAugmented())
{
item.getAugmentation().applyBonus(player);
}
// Apply cupid's bow skills on equip
if (item.isCupidBow())
{
@ -589,11 +583,20 @@ public class UseItem implements IClientIncomingPacket
}
items = player.getInventory().equipItemAndRecord(item);
// Apply augementation bonus on equip
// This check must be done here after equipItemAndRecord() that will call the removebonus for old item
if (item.isAugmented())
{
item.getAugmentation().applyBonus(player);
}
// Charge Soulshot/Spiritshot like L2OFF
if (item.getItem() instanceof Weapon)
{
// Charge Soulshot/Spiritshot like L2OFF
player.rechargeAutoSoulShot(true, true, false);
}
// Consume mana - will start a task if required; returns if item is not a shadow item.
item.decreaseMana(false);
}