diff --git a/datapack_development/data/scripts/handlers/itemhandlers/BeastSoulShot.java b/datapack_development/data/scripts/handlers/itemhandlers/BeastSoulShot.java index 43def5e317ffc25aaf0c27ee0de944bdb8b63b74..fc783ebf1eff24b04cdbeec437f3bdf1f8fa66a2 100644 --- a/datapack_development/data/scripts/handlers/itemhandlers/BeastSoulShot.java +++ b/datapack_development/data/scripts/handlers/itemhandlers/BeastSoulShot.java @@ -21,7 +21,6 @@ import com.l2jserver.gameserver.model.actor.L2Summon; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PetInstance; import com.l2jserver.gameserver.network.SystemMessageId; -import com.l2jserver.gameserver.network.serverpackets.ExAutoSoulShot; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.util.Broadcast; @@ -75,7 +74,8 @@ public class BeastSoulShot implements IItemHandler if (!(shotCount > shotConsumption)) { // Not enough Soulshots to use. - activeOwner.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SOULSHOTS_FOR_PET)); + if (!activeOwner.disableAutoShot(itemId)) + activeOwner.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SOULSHOTS_FOR_PET)); return; } @@ -104,18 +104,8 @@ public class BeastSoulShot implements IItemHandler // If the player doesn't have enough beast soulshot remaining, remove any auto soulshot task. if (!activeOwner.destroyItemWithoutTrace("Consume", item.getObjectId(), shotConsumption, null, false)) { - if (activeOwner.getAutoSoulShot().containsKey(itemId)) - { - activeOwner.removeAutoSoulShot(itemId); - activeOwner.sendPacket(new ExAutoSoulShot(itemId, 0)); - - SystemMessage sm = new SystemMessage(SystemMessageId.AUTO_USE_OF_S1_CANCELLED); - sm.addString(item.getItem().getName()); - activeOwner.sendPacket(sm); - return; - } - - activeOwner.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SOULSHOTS)); + if (!activeOwner.disableAutoShot(itemId)) + activeOwner.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SOULSHOTS_FOR_PET)); return; } diff --git a/datapack_development/data/scripts/handlers/itemhandlers/BeastSpiritShot.java b/datapack_development/data/scripts/handlers/itemhandlers/BeastSpiritShot.java index cd30f83b62fc897c2b488e79db60c167c8dab6f3..97a79aae9c51de268141f8d5ceae74cbb80c83ca 100644 --- a/datapack_development/data/scripts/handlers/itemhandlers/BeastSpiritShot.java +++ b/datapack_development/data/scripts/handlers/itemhandlers/BeastSpiritShot.java @@ -21,7 +21,6 @@ import com.l2jserver.gameserver.model.actor.L2Summon; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PetInstance; import com.l2jserver.gameserver.network.SystemMessageId; -import com.l2jserver.gameserver.network.serverpackets.ExAutoSoulShot; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.util.Broadcast; @@ -72,7 +71,8 @@ public class BeastSpiritShot implements IItemHandler if (!(shotCount > shotConsumption)) { // Not enough SpiritShots to use. - activeOwner.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SPIRITHOTS_FOR_PET)); + if (!activeOwner.disableAutoShot(itemId)) + activeOwner.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SPIRITHOTS_FOR_PET)); return; } @@ -107,18 +107,8 @@ public class BeastSpiritShot implements IItemHandler if (!activeOwner.destroyItemWithoutTrace("Consume", item.getObjectId(), shotConsumption, null, false)) { - if (activeOwner.getAutoSoulShot().containsKey(itemId)) - { - activeOwner.removeAutoSoulShot(itemId); - activeOwner.sendPacket(new ExAutoSoulShot(itemId, 0)); - - SystemMessage sm = new SystemMessage(SystemMessageId.AUTO_USE_OF_S1_CANCELLED); - sm.addString(item.getItem().getName()); - activeOwner.sendPacket(sm); - return; - } - - activeOwner.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS)); + if (!activeOwner.disableAutoShot(itemId)) + activeOwner.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SPIRITHOTS_FOR_PET)); return; } diff --git a/datapack_development/data/scripts/handlers/itemhandlers/BlessedSpiritShot.java b/datapack_development/data/scripts/handlers/itemhandlers/BlessedSpiritShot.java index fcc7be282521a4bf9b09950839b536fe03d746d0..7202ef354a158b2fe7f738a8b5106d021833aeaa 100644 --- a/datapack_development/data/scripts/handlers/itemhandlers/BlessedSpiritShot.java +++ b/datapack_development/data/scripts/handlers/itemhandlers/BlessedSpiritShot.java @@ -19,7 +19,6 @@ import com.l2jserver.gameserver.model.L2ItemInstance; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.SystemMessageId; -import com.l2jserver.gameserver.network.serverpackets.ExAutoSoulShot; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.templates.item.L2Item; @@ -107,16 +106,7 @@ public class BlessedSpiritShot implements IItemHandler // Consume Blessed SpiritShot if player has enough of them if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), null, false)) { - if (activeChar.getAutoSoulShot().containsKey(itemId)) - { - activeChar.removeAutoSoulShot(itemId); - activeChar.sendPacket(new ExAutoSoulShot(itemId, 0)); - - SystemMessage sm = new SystemMessage(SystemMessageId.AUTO_USE_OF_S1_CANCELLED); - sm.addString(item.getItem().getName()); - activeChar.sendPacket(sm); - } - else + if (!activeChar.disableAutoShot(itemId)) activeChar.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS)); return; } diff --git a/datapack_development/data/scripts/handlers/itemhandlers/SoulShots.java b/datapack_development/data/scripts/handlers/itemhandlers/SoulShots.java index ec7f12c6f417bfa0f6c5f01e454dc51048a0a83f..639f8c05db56de4d41ff9ce41547f1434f181a9b 100644 --- a/datapack_development/data/scripts/handlers/itemhandlers/SoulShots.java +++ b/datapack_development/data/scripts/handlers/itemhandlers/SoulShots.java @@ -19,7 +19,6 @@ import com.l2jserver.gameserver.model.L2ItemInstance; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.SystemMessageId; -import com.l2jserver.gameserver.network.serverpackets.ExAutoSoulShot; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.skills.Stats; @@ -112,16 +111,7 @@ public class SoulShots implements IItemHandler if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), SSCount, null, false)) { - if (activeChar.getAutoSoulShot().containsKey(itemId)) - { - activeChar.removeAutoSoulShot(itemId); - activeChar.sendPacket(new ExAutoSoulShot(itemId, 0)); - - SystemMessage sm = new SystemMessage(SystemMessageId.AUTO_USE_OF_S1_CANCELLED); - sm.addString(item.getItem().getName()); - activeChar.sendPacket(sm); - } - else + if (!activeChar.disableAutoShot(itemId)) activeChar.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SOULSHOTS)); return; } diff --git a/datapack_development/data/scripts/handlers/itemhandlers/SpiritShot.java b/datapack_development/data/scripts/handlers/itemhandlers/SpiritShot.java index 96ff9f223bb0d62c82924a198b581d6eb07f5d7a..2f01f48173a9234b5da5410429ead058b63e4769 100644 --- a/datapack_development/data/scripts/handlers/itemhandlers/SpiritShot.java +++ b/datapack_development/data/scripts/handlers/itemhandlers/SpiritShot.java @@ -19,7 +19,6 @@ import com.l2jserver.gameserver.model.L2ItemInstance; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.SystemMessageId; -import com.l2jserver.gameserver.network.serverpackets.ExAutoSoulShot; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.templates.item.L2Item; @@ -105,16 +104,7 @@ public class SpiritShot implements IItemHandler // Consume Spirit shot if player has enough of them if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), null, false)) { - if (activeChar.getAutoSoulShot().containsKey(itemId)) - { - activeChar.removeAutoSoulShot(itemId); - activeChar.sendPacket(new ExAutoSoulShot(itemId, 0)); - - SystemMessage sm = new SystemMessage(SystemMessageId.AUTO_USE_OF_S1_CANCELLED); - sm.addString(item.getItem().getName()); - activeChar.sendPacket(sm); - } - else + if (!activeChar.disableAutoShot(itemId)) activeChar.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS)); return; }