Update Adena and LCoin count on add or destroy.

Contributed by Index.
This commit is contained in:
MobiusDevelopment
2022-07-05 08:29:03 +00:00
parent 389d514b3e
commit 19bf71f184
12 changed files with 114 additions and 84 deletions

View File

@@ -3581,12 +3581,6 @@ public class Player extends Playable
}
}
// Einhasad coin UI update.
if (destoyedItem.getId() == Inventory.EINHASAD_COIN_ID)
{
sendPacket(new ExBloodyCoinCount(this));
}
return true;
}
@@ -3703,12 +3697,6 @@ public class Player extends Playable
}
}
// Einhasad coin UI update.
if (item.getId() == Inventory.EINHASAD_COIN_ID)
{
sendPacket(new ExBloodyCoinCount(this));
}
return true;
}

View File

@@ -50,6 +50,7 @@ import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.skill.SkillConditionScope;
import org.l2jmobius.gameserver.model.variables.ItemVariables;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExAdenaInvenCount;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import org.l2jmobius.gameserver.network.serverpackets.limitshop.ExBloodyCoinCount;
@@ -505,8 +506,13 @@ public class PlayerInventory extends Inventory
actor.sendItemList();
}
// Adena UI update.
if (item.getId() == Inventory.ADENA_ID)
{
actor.sendPacket(new ExAdenaInvenCount(actor));
}
// Einhasad coin UI update.
if (item.getId() == Inventory.EINHASAD_COIN_ID)
else if (item.getId() == Inventory.EINHASAD_COIN_ID)
{
actor.sendPacket(new ExBloodyCoinCount(actor));
}
@@ -598,9 +604,20 @@ public class PlayerInventory extends Inventory
_ancientAdena = null;
}
// Notify to scripts
if (destroyedItem != null)
{
// Adena UI update.
if (destroyedItem.getId() == Inventory.ADENA_ID)
{
actor.sendPacket(new ExAdenaInvenCount(actor));
}
// Einhasad coin UI update.
else if (destroyedItem.getId() == Inventory.EINHASAD_COIN_ID)
{
actor.sendPacket(new ExBloodyCoinCount(actor));
}
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemDestroy(actor, destroyedItem), destroyedItem.getTemplate());
}