From fd6fc0a64631b38f82529431c21bc648d0099125 Mon Sep 17 00:00:00 2001 From: Rumen Nikiforov <unafraid89@gmail.com> Date: Fri, 14 Sep 2012 01:20:23 +0000 Subject: [PATCH] BETA: DP-Part for [L5637] --- .../scripts/handlers/effecthandlers/Heal.java | 7 +-- .../handlers/effecthandlers/SignetMDam.java | 36 ++++++++------- .../handlers/itemhandlers/BeastSoulShot.java | 34 +++++--------- .../itemhandlers/BeastSpiritShot.java | 44 +++++-------------- .../itemhandlers/BlessedSpiritShot.java | 20 ++++++--- .../handlers/itemhandlers/FishShots.java | 15 +++++-- .../handlers/itemhandlers/SoulShots.java | 9 ++-- .../handlers/itemhandlers/SpiritShot.java | 17 +++++-- .../scripts/handlers/skillhandlers/Blow.java | 14 +++--- .../handlers/skillhandlers/Cancel.java | 12 ++--- .../handlers/skillhandlers/Continuous.java | 11 ++--- .../scripts/handlers/skillhandlers/CpDam.java | 12 +++-- .../handlers/skillhandlers/CpDamPercent.java | 10 +++-- .../handlers/skillhandlers/Disablers.java | 11 ++--- .../scripts/handlers/skillhandlers/Dummy.java | 3 +- .../handlers/skillhandlers/FishingSkill.java | 5 ++- .../scripts/handlers/skillhandlers/Heal.java | 7 +-- .../handlers/skillhandlers/ManaHeal.java | 3 +- .../handlers/skillhandlers/Manadam.java | 13 ++++-- .../scripts/handlers/skillhandlers/Mdam.java | 15 ++++--- .../scripts/handlers/skillhandlers/Pdam.java | 7 +-- .../handlers/skillhandlers/Resurrect.java | 3 +- .../handlers/skillhandlers/StealBuffs.java | 11 ++--- .../skillhandlers/StrSiegeAssault.java | 7 +-- 24 files changed, 169 insertions(+), 157 deletions(-) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/Heal.java index 7b4d4f3413..5c14dc6e89 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -14,6 +14,7 @@ */ package handlers.effecthandlers; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.effects.EffectTemplate; import com.l2jserver.gameserver.model.effects.L2Effect; @@ -54,8 +55,8 @@ public class Heal extends L2Effect double amount = calc(); double staticShotBonus = 0; int mAtkMul = 1; - boolean sps = activeChar.isSpiritshotCharged(getSkill()); - boolean bss = activeChar.isBlessedSpiritshotCharged(getSkill()); + boolean sps = getSkill().isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS); + boolean bss = getSkill().isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS); if ((sps || bss) && (activeChar.isPlayer() && activeChar.getActingPlayer().isMageClass()) || activeChar.isSummon()) { @@ -148,7 +149,7 @@ public class Heal extends L2Effect } } } - + activeChar.setChargedShot(bss ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); return true; } diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/SignetMDam.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/SignetMDam.java index 9b9bf2652d..80bdcc2453 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/SignetMDam.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/SignetMDam.java @@ -23,6 +23,7 @@ import javolution.util.FastList; import com.l2jserver.gameserver.ai.CtrlEvent; import com.l2jserver.gameserver.datatables.NpcTable; import com.l2jserver.gameserver.idfactory.IdFactory; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2EffectPointInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; @@ -97,16 +98,16 @@ public class SignetMDam extends L2Effect return true; // do nothing first 2 times int mpConsume = getSkill().getMpConsume(); - L2PcInstance caster = getEffector().getActingPlayer(); - - boolean sps = caster.isSpiritshotCharged(getSkill()); - boolean bss = caster.isBlessedSpiritshotCharged(getSkill()); + L2PcInstance activeChar = getEffector().getActingPlayer(); + boolean sps = getSkill().isMagic() && getEffector().isChargedShot(ShotType.SPIRITSHOTS); + boolean bss = getSkill().isMagic() && getEffector().isChargedShot(ShotType.BLESSED_SPIRITSHOTS); + FastList<L2Character> targets = new FastList<>(); for (L2Character cha : _actor.getKnownList().getKnownCharactersInRadius(getSkill().getSkillRadius())) { - if (cha == null || cha == caster) + if (cha == null || cha == activeChar) continue; if (cha.isL2Attackable() || cha.isPlayable()) @@ -114,19 +115,19 @@ public class SignetMDam extends L2Effect if (cha.isAlikeDead()) continue; - if (mpConsume > caster.getCurrentMp()) + if (mpConsume > activeChar.getCurrentMp()) { - caster.sendPacket(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP); + activeChar.sendPacket(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP); return false; } - caster.reduceCurrentMp(mpConsume); + activeChar.reduceCurrentMp(mpConsume); if (cha.isPlayable()) { - if (caster.canAttackCharacter(cha)) + if (activeChar.canAttackCharacter(cha)) { targets.add(cha); - caster.updatePvPStatus(cha); + activeChar.updatePvPStatus(cha); } } else @@ -136,12 +137,12 @@ public class SignetMDam extends L2Effect if (!targets.isEmpty()) { - caster.broadcastPacket(new MagicSkillLaunched(caster, getSkill().getId(), getSkill().getLevel(), targets.toArray(new L2Character[targets.size()]))); + activeChar.broadcastPacket(new MagicSkillLaunched(activeChar, getSkill().getId(), getSkill().getLevel(), targets.toArray(new L2Character[targets.size()]))); for (L2Character target : targets) { - boolean mcrit = Formulas.calcMCrit(caster.getMCriticalHit(target, getSkill())); - byte shld = Formulas.calcShldUse(caster, target, getSkill()); - int mdam = (int) Formulas.calcMagicDam(caster, target, getSkill(), shld, sps, bss, mcrit); + boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, getSkill())); + byte shld = Formulas.calcShldUse(activeChar, target, getSkill()); + int mdam = (int) Formulas.calcMagicDam(activeChar, target, getSkill(), shld, sps, bss, mcrit); if (target.isSummon()) target.broadcastStatusUpdate(); @@ -154,12 +155,13 @@ public class SignetMDam extends L2Effect target.breakAttack(); target.breakCast(); } - caster.sendDamageMessage(target, mdam, mcrit, false, false); - target.reduceCurrentHp(mdam, caster, getSkill()); + activeChar.sendDamageMessage(target, mdam, mcrit, false, false); + target.reduceCurrentHp(mdam, activeChar, getSkill()); } - target.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, caster); + target.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, activeChar); } } + activeChar.setChargedShot(bss ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); return true; } diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BeastSoulShot.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BeastSoulShot.java index 6b9177ec39..e43d6f8550 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BeastSoulShot.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BeastSoulShot.java @@ -17,6 +17,7 @@ package handlers.itemhandlers; import java.util.logging.Level; import com.l2jserver.gameserver.handler.IItemHandler; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.L2Summon; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; @@ -42,12 +43,6 @@ public class BeastSoulShot implements IItemHandler } L2PcInstance activeOwner = playable.getActingPlayer(); - if (!playable.isPlayer()) - { - playable.sendPacket(SystemMessageId.PET_CANNOT_USE_ITEM); - return false; - } - L2Summon activePet = activeOwner.getPet(); if (activePet == null) @@ -73,44 +68,35 @@ public class BeastSoulShot implements IItemHandler return false; } - if (!(shotCount > shotConsumption)) + if (shotCount < shotConsumption) { // Not enough Soulshots to use. if (!activeOwner.disableAutoShot(itemId)) + { activeOwner.sendPacket(SystemMessageId.NOT_ENOUGH_SOULSHOTS_FOR_PET); + } return false; } - L2ItemInstance weaponInst = activePet.getActiveWeaponInstance(); - - if (weaponInst == null) + if (activePet.isChargedShot(ShotType.SOULSHOTS)) { - if (activePet.getChargedSoulShot() != L2ItemInstance.CHARGED_NONE) // SoulShots are already active. - { - return false; - } - - activePet.setChargedSoulShot(L2ItemInstance.CHARGED_SOULSHOT); - } - else - { - if (weaponInst.getChargedSoulshot() != L2ItemInstance.CHARGED_NONE) // SoulShots are already active. - { - return false; - } - weaponInst.setChargedSoulshot(L2ItemInstance.CHARGED_SOULSHOT); + // SoulShots are already active. + return false; } // 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.disableAutoShot(itemId)) + { activeOwner.sendPacket(SystemMessageId.NOT_ENOUGH_SOULSHOTS_FOR_PET); + } return false; } // Pet uses the power of spirit. activeOwner.sendPacket(SystemMessageId.PET_USE_SPIRITSHOT); + activePet.setChargedShot(ShotType.SOULSHOTS, true); Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600); return true; diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BeastSpiritShot.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BeastSpiritShot.java index 422fb80ed0..9043f8bbc4 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BeastSpiritShot.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BeastSpiritShot.java @@ -17,6 +17,7 @@ package handlers.itemhandlers; import java.util.logging.Level; import com.l2jserver.gameserver.handler.IItemHandler; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.L2Summon; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; @@ -42,13 +43,6 @@ public class BeastSpiritShot implements IItemHandler } L2PcInstance activeOwner = playable.getActingPlayer(); - - if (!playable.isPlayer()) - { - activeOwner.sendPacket(SystemMessageId.PET_CANNOT_USE_ITEM); - return false; - } - L2Summon activePet = activeOwner.getPet(); if (activePet == null) @@ -64,7 +58,7 @@ public class BeastSpiritShot implements IItemHandler } final int itemId = item.getItemId(); - final boolean isBlessed = (itemId == 6647 || itemId == 20334); // TODO: Unhardcode these! + final boolean isBlessed = ((itemId == 6647) || (itemId == 20334)); // TODO: Unhardcode these! final short shotConsumption = activePet.getSpiritShotsPerHit(); final SkillHolder[] skills = item.getItem().getSkills(); @@ -75,49 +69,35 @@ public class BeastSpiritShot implements IItemHandler } long shotCount = item.getCount(); - if (!(shotCount > shotConsumption)) + if (shotCount < shotConsumption) { // Not enough SpiritShots to use. if (!activeOwner.disableAutoShot(itemId)) + { activeOwner.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITHOTS_FOR_PET); + } return false; } - L2ItemInstance weaponInst = activePet.getActiveWeaponInstance(); - - if (weaponInst == null) + if (activePet.isChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS)) { - if (activePet.getChargedSpiritShot() != L2ItemInstance.CHARGED_NONE) // SoulShots are already active. - return false; - - if (isBlessed) - activePet.setChargedSpiritShot(L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT); - else - activePet.setChargedSpiritShot(L2ItemInstance.CHARGED_SPIRITSHOT); - } - else - { - if (weaponInst.getChargedSpiritshot() != L2ItemInstance.CHARGED_NONE) // SoulShots are already active. - { - // SpiritShots are already active. - return false; - } - - if (isBlessed) - weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT); - else - weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_SPIRITSHOT); + // shots are already active. + return false; } if (!activeOwner.destroyItemWithoutTrace("Consume", item.getObjectId(), shotConsumption, null, false)) { if (!activeOwner.disableAutoShot(itemId)) + { activeOwner.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITHOTS_FOR_PET); + } return false; } // Pet uses the power of spirit. activeOwner.sendPacket(SystemMessageId.PET_USE_SPIRITSHOT); + activePet.setChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, true); + Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600); return true; } diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BlessedSpiritShot.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BlessedSpiritShot.java index a926ef48a9..da3e176ffc 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BlessedSpiritShot.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/BlessedSpiritShot.java @@ -17,6 +17,7 @@ package handlers.itemhandlers; import java.util.logging.Level; import com.l2jserver.gameserver.handler.IItemHandler; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.holders.SkillHolder; @@ -52,24 +53,30 @@ public class BlessedSpiritShot implements IItemHandler } // Check if Blessed SpiritShot can be used - if (weaponInst == null || weaponItem == null || weaponItem.getSpiritShotCount() == 0) + if ((weaponInst == null) || (weaponItem == null) || (weaponItem.getSpiritShotCount() == 0)) { if (!activeChar.getAutoSoulShot().contains(itemId)) + { activeChar.sendPacket(SystemMessageId.CANNOT_USE_SPIRITSHOTS); + } return false; } // Check if Blessed SpiritShot is already active (it can be charged over SpiritShot) - if (weaponInst.getChargedSpiritshot() != L2ItemInstance.CHARGED_NONE) // SoulShots are already active. + if (activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS)) + { return false; + } // Check for correct grade - boolean gradeCheck = item.isEtcItem() && item.getEtcItem().getDefaultAction() == L2ActionType.spiritshot && weaponInst.getItem().getItemGradeSPlus() == item.getItem().getItemGradeSPlus(); + boolean gradeCheck = item.isEtcItem() && (item.getEtcItem().getDefaultAction() == L2ActionType.spiritshot) && (weaponInst.getItem().getItemGradeSPlus() == item.getItem().getItemGradeSPlus()); if (!gradeCheck) { if (!activeChar.getAutoSoulShot().contains(itemId)) + { activeChar.sendPacket(SystemMessageId.SPIRITSHOTS_GRADE_MISMATCH); + } return false; } @@ -78,15 +85,16 @@ public class BlessedSpiritShot implements IItemHandler if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), null, false)) { if (!activeChar.disableAutoShot(itemId)) + { activeChar.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS); + } return false; } - // Charge Blessed SpiritShot - weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT); - // Send message to client activeChar.sendPacket(SystemMessageId.ENABLED_SPIRITSHOT); + activeChar.setChargedShot(ShotType.BLESSED_SPIRITSHOTS, true); + Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600); return true; } diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/FishShots.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/FishShots.java index 445a38b136..2dd3da3b4a 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/FishShots.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/FishShots.java @@ -18,6 +18,7 @@ import java.util.logging.Level; import com.l2jserver.gameserver.handler.IItemHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.holders.SkillHolder; @@ -47,11 +48,15 @@ public class FishShots implements IItemHandler final L2ItemInstance weaponInst = activeChar.getActiveWeaponInstance(); final L2Weapon weaponItem = activeChar.getActiveWeaponItem(); - if (weaponInst == null || weaponItem.getItemType() != L2WeaponType.FISHINGROD) + if ((weaponInst == null) || (weaponItem.getItemType() != L2WeaponType.FISHINGROD)) + { return false; + } - if (weaponInst.getChargedFishshot()) // spirit shot is already active + if (activeChar.isChargedShot(ShotType.FISH_SOULSHOTS)) + { return false; + } final long count = item.getCount(); final SkillHolder[] skills = item.getItem().getSkills(); @@ -62,7 +67,7 @@ public class FishShots implements IItemHandler return false; } - boolean gradeCheck = item.isEtcItem() && item.getEtcItem().getDefaultAction() == L2ActionType.fishingshot && weaponInst.getItem().getItemGradeSPlus() == item.getItem().getItemGradeSPlus(); + boolean gradeCheck = item.isEtcItem() && (item.getEtcItem().getDefaultAction() == L2ActionType.fishingshot) && (weaponInst.getItem().getItemGradeSPlus() == item.getItem().getItemGradeSPlus()); if (!gradeCheck) { @@ -71,9 +76,11 @@ public class FishShots implements IItemHandler } if (count < 1) + { return false; + } - weaponInst.setChargedFishshot(true); + activeChar.setChargedShot(ShotType.FISH_SOULSHOTS, true); activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), 1, null, false); L2Object oldTarget = activeChar.getTarget(); activeChar.setTarget(activeChar); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/SoulShots.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/SoulShots.java index 63237c9db9..26650524df 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/SoulShots.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/SoulShots.java @@ -17,6 +17,7 @@ package handlers.itemhandlers; import java.util.logging.Level; import com.l2jserver.gameserver.handler.IItemHandler; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.holders.SkillHolder; @@ -62,7 +63,7 @@ public class SoulShots implements IItemHandler return false; } - boolean gradeCheck = item.isEtcItem() && item.getEtcItem().getDefaultAction() == L2ActionType.soulshot && weaponInst.getItem().getItemGradeSPlus() == item.getItem().getItemGradeSPlus(); + boolean gradeCheck = item.isEtcItem() && (item.getEtcItem().getDefaultAction() == L2ActionType.soulshot) && (weaponInst.getItem().getItemGradeSPlus() == item.getItem().getItemGradeSPlus()); if (!gradeCheck) { @@ -77,14 +78,14 @@ public class SoulShots implements IItemHandler try { // Check if Soul shot is already active - if (weaponInst.getChargedSoulshot() != L2ItemInstance.CHARGED_NONE) + if (activeChar.isChargedShot(ShotType.SOULSHOTS)) { return false; } // Consume Soul shots if player has enough of them int SSCount = weaponItem.getSoulShotCount(); - if (weaponItem.getReducedSoulShot() > 0 && Rnd.get(100) < weaponItem.getReducedSoulShotChance()) + if ((weaponItem.getReducedSoulShot() > 0) && (Rnd.get(100) < weaponItem.getReducedSoulShotChance())) { SSCount = weaponItem.getReducedSoulShot(); } @@ -98,7 +99,7 @@ public class SoulShots implements IItemHandler return false; } // Charge soul shot - weaponInst.setChargedSoulshot(L2ItemInstance.CHARGED_SOULSHOT); + weaponInst.setChargedShot(ShotType.SOULSHOTS, true); } finally { diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/SpiritShot.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/SpiritShot.java index 74cd98ced2..0a42156eb0 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/SpiritShot.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/itemhandlers/SpiritShot.java @@ -17,6 +17,7 @@ package handlers.itemhandlers; import java.util.logging.Level; import com.l2jserver.gameserver.handler.IItemHandler; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.holders.SkillHolder; @@ -52,23 +53,29 @@ public class SpiritShot implements IItemHandler } // Check if Spirit shot can be used - if (weaponInst == null || weaponItem.getSpiritShotCount() == 0) + if ((weaponInst == null) || (weaponItem.getSpiritShotCount() == 0)) { if (!activeChar.getAutoSoulShot().contains(itemId)) + { activeChar.sendPacket(SystemMessageId.CANNOT_USE_SPIRITSHOTS); + } return false; } // Check if Spirit shot is already active - if (weaponInst.getChargedSpiritshot() != L2ItemInstance.CHARGED_NONE) + if (activeChar.isChargedShot(ShotType.SPIRITSHOTS)) + { return false; + } - boolean gradeCheck = item.isEtcItem() && item.getEtcItem().getDefaultAction() == L2ActionType.spiritshot && weaponInst.getItem().getItemGradeSPlus() == item.getItem().getItemGradeSPlus(); + boolean gradeCheck = item.isEtcItem() && (item.getEtcItem().getDefaultAction() == L2ActionType.spiritshot) && (weaponInst.getItem().getItemGradeSPlus() == item.getItem().getItemGradeSPlus()); if (!gradeCheck) { if (!activeChar.getAutoSoulShot().contains(itemId)) + { activeChar.sendPacket(SystemMessageId.SPIRITSHOTS_GRADE_MISMATCH); + } return false; } @@ -77,12 +84,14 @@ public class SpiritShot implements IItemHandler if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), null, false)) { if (!activeChar.disableAutoShot(itemId)) + { activeChar.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS); + } return false; } // Charge Spirit shot - weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_SPIRITSHOT); + activeChar.setChargedShot(ShotType.SPIRITSHOTS, true); // Send message to client activeChar.sendPacket(SystemMessageId.ENABLED_SPIRITSHOT); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Blow.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Blow.java index 8ab31fc80d..d9de9aafcd 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Blow.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Blow.java @@ -21,6 +21,7 @@ import java.util.logging.Logger; import com.l2jserver.Config; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.effects.L2Effect; @@ -51,6 +52,10 @@ public class Blow implements ISkillHandler if (activeChar.isAlikeDead()) return; + boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS); + boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS); + boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS); + for (L2Character target: (L2Character[]) targets) { if (target.isAlikeDead()) @@ -77,9 +82,9 @@ public class Blow implements ISkillHandler { final byte shld = Formulas.calcShldUse(activeChar, target, skill); target.stopSkillEffects(skill.getId()); - if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, false, false, true)) + if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss)) { - skill.getEffects(activeChar, target, new Env(shld, false, false, false)); + skill.getEffects(activeChar, target, new Env(shld, ss, sps, bss)); SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT); sm.addSkillName(skill); target.sendPacket(sm); @@ -94,10 +99,9 @@ public class Blow implements ISkillHandler } } - boolean soul = activeChar.isSoulshotCharged(skill); byte shld = Formulas.calcShldUse(activeChar, target, skill); - double damage = skill.isStaticDamage() ? skill.getPower() : (int) Formulas.calcBlowDamage(activeChar, target, skill, shld, soul); + double damage = skill.isStaticDamage() ? skill.getPower() : (int) Formulas.calcBlowDamage(activeChar, target, skill, shld, ss); if (!skill.isStaticDamage() && skill.getMaxSoulConsumeCount() > 0 && activeChar.isPlayer()) { switch (activeChar.getActingPlayer().getSouls()) @@ -203,7 +207,7 @@ public class Blow implements ISkillHandler skill.getEffectsSelf(activeChar); } - activeChar.ssUncharge(skill); + activeChar.setChargedShot(ShotType.SOULSHOTS, false); } } diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Cancel.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Cancel.java index 44686739b2..7e42b00342 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Cancel.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Cancel.java @@ -17,8 +17,8 @@ package handlers.skillhandlers; import com.l2jserver.Config; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; -import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.effects.L2Effect; import com.l2jserver.gameserver.model.skills.L2Skill; import com.l2jserver.gameserver.model.skills.L2SkillType; @@ -39,13 +39,7 @@ public class Cancel implements ISkillHandler @Override public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets) - { - if (activeChar.isNpc()) - { - ((L2Npc)activeChar)._soulshotcharged = false; - ((L2Npc)activeChar)._spiritshotcharged = false; - } - + { L2Character target; L2Effect effect; final int cancelLvl, minRate, maxRate; @@ -204,7 +198,7 @@ public class Cancel implements ISkillHandler skill.getEffectsSelf(activeChar); } - activeChar.spsUncharge(skill); + activeChar.setChargedShot(activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS) ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); } private boolean calcCancelSuccess(L2Effect effect, int cancelLvl, int baseRate, int minRate, int maxRate) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Continuous.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Continuous.java index 127ae43aa2..115914be5b 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Continuous.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Continuous.java @@ -20,6 +20,7 @@ import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.instancemanager.DuelManager; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Summon; import com.l2jserver.gameserver.model.actor.instance.L2ClanHallManagerInstance; @@ -71,10 +72,10 @@ public class Continuous implements ISkillHandler skill = sk; } - boolean ss = activeChar.isSoulshotCharged(skill); - boolean sps = activeChar.isSpiritshotCharged(skill); - boolean bss = activeChar.isBlessedSpiritshotCharged(skill); - + boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS); + boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS); + boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS); + for (L2Character target: (L2Character[]) targets) { byte shld = 0; @@ -194,7 +195,7 @@ public class Continuous implements ISkillHandler skill.getEffectsSelf(activeChar); } - activeChar.spsUncharge(skill); + activeChar.setChargedShot(bss ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); } @Override diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/CpDam.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/CpDam.java index f05557eae4..bd84078950 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/CpDam.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/CpDam.java @@ -16,6 +16,7 @@ package handlers.skillhandlers; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.skills.L2Skill; import com.l2jserver.gameserver.model.skills.L2SkillType; @@ -37,6 +38,10 @@ public class CpDam implements ISkillHandler return; } + boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS); + boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS); + boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS); + for (L2Character target : (L2Character[]) targets) { if (activeChar.isPlayer() && target.isPlayer() && target.getActingPlayer().isFakeDeath()) @@ -58,13 +63,12 @@ public class CpDam implements ISkillHandler target.breakAttack(); target.breakCast(); } - skill.getEffects(activeChar, target, new Env(shld, activeChar.isSoulshotCharged(skill), activeChar.isSpiritshotCharged(skill), activeChar.isBlessedSpiritshotCharged(skill))); + + skill.getEffects(activeChar, target, new Env(shld, ss, sps, bss)); activeChar.sendDamageMessage(target, damage, false, false, false); target.setCurrentCp(target.getCurrentCp() - damage); } - - activeChar.spsUncharge(skill); - + activeChar.setChargedShot(bss ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); } @Override diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/CpDamPercent.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/CpDamPercent.java index 7f5215b05a..07d862b8a0 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/CpDamPercent.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/CpDamPercent.java @@ -16,6 +16,7 @@ package handlers.skillhandlers; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.skills.L2Skill; import com.l2jserver.gameserver.model.skills.L2SkillType; @@ -35,9 +36,10 @@ public class CpDamPercent implements ISkillHandler if (activeChar.isAlikeDead()) return; - boolean ss = activeChar.isSoulshotCharged(skill); - boolean sps = activeChar.isSpiritshotCharged(skill); - boolean bss = activeChar.isBlessedSpiritshotCharged(skill); + boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS); + boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS); + boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS); + for (L2Character target: (L2Character[]) targets) { if (activeChar.isPlayer() && target.isPlayer() && target.getActingPlayer().isFakeDeath()) @@ -64,7 +66,7 @@ public class CpDamPercent implements ISkillHandler target.setCurrentCp(target.getCurrentCp() - damage); } - activeChar.spsUncharge(skill); + activeChar.setChargedShot(bss ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); } @Override diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Disablers.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Disablers.java index d88a609f0c..e15628d76e 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Disablers.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Disablers.java @@ -23,6 +23,7 @@ import com.l2jserver.gameserver.datatables.ExperienceTable; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.handler.SkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Attackable; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Summon; @@ -74,9 +75,9 @@ public class Disablers implements ISkillHandler L2SkillType type = skill.getSkillType(); byte shld = 0; - boolean ss = activeChar.isSoulshotCharged(skill); - boolean sps = activeChar.isSpiritshotCharged(skill); - boolean bss = activeChar.isBlessedSpiritshotCharged(skill); + boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS); + boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS); + boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS); for (L2Object obj: targets) { @@ -554,8 +555,8 @@ public class Disablers implements ISkillHandler skill.getEffectsSelf(activeChar); } - activeChar.spsUncharge(skill); - } //end void + activeChar.setChargedShot(bss ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); + } /** * diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Dummy.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Dummy.java index 9709c346cc..6ed068c397 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Dummy.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Dummy.java @@ -18,6 +18,7 @@ import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.instancemanager.HandysBlockCheckerManager; import com.l2jserver.gameserver.instancemanager.HandysBlockCheckerManager.ArenaParticipantsHolder; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2BlockInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; @@ -60,7 +61,7 @@ public class Dummy implements ISkillHandler } } - activeChar.spsUncharge(skill); + activeChar.setChargedShot(activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS) ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); } @Override diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/FishingSkill.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/FishingSkill.java index 6e265ad8ba..5656d000b4 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/FishingSkill.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/FishingSkill.java @@ -18,6 +18,7 @@ import com.l2jserver.gameserver.datatables.FishingRodsData; import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.fishing.L2Fishing; @@ -71,7 +72,7 @@ public class FishingSkill implements ISkillHandler } int SS = 1; int pen = 0; - if (weaponInst.getChargedFishshot()) + if (activeChar.isChargedShot(ShotType.FISH_SOULSHOTS)) { SS = 2; } @@ -88,7 +89,7 @@ public class FishingSkill implements ISkillHandler } if (SS > 1) { - weaponInst.setChargedFishshot(false); + weaponInst.setChargedShot(ShotType.FISH_SOULSHOTS, false); } if (skill.getSkillType() == L2SkillType.REELING) { diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Heal.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Heal.java index 3c16ade82f..b126fe48cd 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Heal.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Heal.java @@ -17,6 +17,7 @@ package handlers.skillhandlers; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.handler.SkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2SiegeFlagInstance; import com.l2jserver.gameserver.model.items.L2Item; @@ -47,8 +48,8 @@ public class Heal implements ISkillHandler handler.useSkill(activeChar, skill, targets); double power = skill.getPower(); - boolean sps = activeChar.isSpiritshotCharged(skill); - boolean bss = activeChar.isBlessedSpiritshotCharged(skill); + boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS); + boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS); switch (skill.getSkillType()) { @@ -99,7 +100,7 @@ public class Heal implements ISkillHandler } power += staticShotBonus + Math.sqrt(mAtkMul * activeChar.getMAtk(activeChar, null)); - activeChar.spsUncharge(skill); + activeChar.setChargedShot(bss ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); } double hp; diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/ManaHeal.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/ManaHeal.java index 83d7f96a45..22fd35140a 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/ManaHeal.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/ManaHeal.java @@ -16,6 +16,7 @@ package handlers.skillhandlers; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.effects.L2Effect; import com.l2jserver.gameserver.model.skills.L2Skill; @@ -134,7 +135,7 @@ public class ManaHeal implements ISkillHandler skill.getEffectsSelf(activeChar); } - activeChar.spsUncharge(skill); + activeChar.setChargedShot(activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS) ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); } @Override diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Manadam.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Manadam.java index 1db7b54766..08f8cb5f8c 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Manadam.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Manadam.java @@ -16,6 +16,7 @@ package handlers.skillhandlers; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.effects.L2Effect; import com.l2jserver.gameserver.model.skills.L2Skill; @@ -45,6 +46,10 @@ public class Manadam implements ISkillHandler return; } + boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS); + boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS); + boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS); + for (L2Character target : (L2Character[]) targets) { if (Formulas.calcSkillReflect(target, skill) == Formulas.SKILL_REFLECT_SUCCEED) @@ -63,9 +68,9 @@ public class Manadam implements ISkillHandler { byte shld = Formulas.calcShldUse(activeChar, target, skill); target.stopSkillEffects(skill.getId()); - if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, false, activeChar.isSpiritshotCharged(skill), activeChar.isBlessedSpiritshotCharged(skill))) + if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss)) { - skill.getEffects(activeChar, target, new Env(shld, activeChar.isSpiritshotCharged(skill), false, activeChar.isBlessedSpiritshotCharged(skill))); + skill.getEffects(activeChar, target, new Env(shld, ss, sps, bss)); } else { @@ -76,7 +81,7 @@ public class Manadam implements ISkillHandler } } - double damage = skill.isStaticDamage() ? skill.getPower() : Formulas.calcManaDam(activeChar, target, skill, activeChar.isSpiritshotCharged(skill), activeChar.isBlessedSpiritshotCharged(skill)); + double damage = skill.isStaticDamage() ? skill.getPower() : Formulas.calcManaDam(activeChar, target, skill, ss, bss); if (!skill.isStaticDamage() && Formulas.calcMCrit(activeChar.getMCriticalHit(target, skill))) { @@ -126,7 +131,7 @@ public class Manadam implements ISkillHandler skill.getEffectsSelf(activeChar); } - activeChar.spsUncharge(skill); + activeChar.setChargedShot(bss ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); } @Override diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Mdam.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Mdam.java index a856dc7a3a..63bb9d4ed8 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Mdam.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Mdam.java @@ -21,6 +21,7 @@ import java.util.logging.Logger; import com.l2jserver.Config; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.effects.L2Effect; import com.l2jserver.gameserver.model.skills.L2Skill; @@ -49,6 +50,10 @@ public class Mdam implements ISkillHandler return; } + boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS); + boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS); + boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS); + for (L2Character target : (L2Character[]) targets) { if (activeChar.isPlayer() && target.isPlayer() && target.getActingPlayer().isFakeDeath()) @@ -64,7 +69,7 @@ public class Mdam implements ISkillHandler final byte shld = Formulas.calcShldUse(activeChar, target, skill); final byte reflect = Formulas.calcSkillReflect(target, skill); - int damage = skill.isStaticDamage() ? (int) skill.getPower() : (int) Formulas.calcMagicDam(activeChar, target, skill, shld, activeChar.isSpiritshotCharged(skill), activeChar.isBlessedSpiritshotCharged(skill), mcrit); + int damage = skill.isStaticDamage() ? (int) skill.getPower() : (int) Formulas.calcMagicDam(activeChar, target, skill, shld, sps, bss, mcrit); if (!skill.isStaticDamage() && skill.getDependOnTargetBuff() != 0) { @@ -134,9 +139,9 @@ public class Mdam implements ISkillHandler { // activate attacked effects, if any target.stopSkillEffects(skill.getId()); - if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, false, activeChar.isSpiritshotCharged(skill), activeChar.isBlessedSpiritshotCharged(skill))) + if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss)) { - skill.getEffects(activeChar, target, new Env(shld, activeChar.isSpiritshotCharged(skill), false, activeChar.isBlessedSpiritshotCharged(skill))); + skill.getEffects(activeChar, target, new Env(shld, ss, sps, bss)); } else { @@ -179,12 +184,12 @@ public class Mdam implements ISkillHandler skill.getEffectsSelf(activeChar); } + activeChar.setChargedShot(bss ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); + if (skill.isSuicideAttack()) { activeChar.doDie(activeChar); } - - activeChar.spsUncharge(skill); } @Override diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Pdam.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Pdam.java index ec43e61269..cfed320d83 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Pdam.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Pdam.java @@ -22,6 +22,7 @@ import com.l2jserver.Config; import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.effects.L2Effect; import com.l2jserver.gameserver.model.skills.L2Skill; @@ -63,7 +64,7 @@ public class Pdam implements ISkillHandler _log.fine("Begin Skill processing in Pdam.java " + skill.getSkillType()); } - boolean soul = activeChar.isSoulshotCharged(skill); + boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS); for (L2Character target: (L2Character[]) targets) { @@ -86,7 +87,7 @@ public class Pdam implements ISkillHandler if (!crit && (skill.getCondition() & L2Skill.COND_CRIT) != 0) damage = 0; else - damage = skill.isStaticDamage() ? (int)skill.getPower() : (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, dual, soul); + damage = skill.isStaticDamage() ? (int)skill.getPower() : (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, dual, ss); if (!skill.isStaticDamage() && skill.getMaxSoulConsumeCount() > 0 && activeChar.isPlayer()) { switch (activeChar.getActingPlayer().getSouls()) @@ -249,7 +250,7 @@ public class Pdam implements ISkillHandler skill.getEffectsSelf(activeChar); } - activeChar.ssUncharge(skill); + activeChar.setChargedShot(ShotType.SOULSHOTS, false); if (skill.isSuicideAttack()) activeChar.doDie(activeChar); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Resurrect.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Resurrect.java index 54c310841b..ce79222014 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Resurrect.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Resurrect.java @@ -20,6 +20,7 @@ import javolution.util.FastList; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PetInstance; @@ -87,7 +88,7 @@ public class Resurrect implements ISkillHandler } } - activeChar.spsUncharge(skill); + activeChar.setChargedShot(activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS) ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); } @Override diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/StealBuffs.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/StealBuffs.java index b315663c3a..d7f5c6fc1c 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/StealBuffs.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/StealBuffs.java @@ -19,8 +19,8 @@ import java.util.logging.Level; import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; -import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.effects.L2Effect; import com.l2jserver.gameserver.model.skills.L2Skill; import com.l2jserver.gameserver.model.skills.L2SkillType; @@ -38,12 +38,7 @@ public class StealBuffs implements ISkillHandler @Override public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets) - { - if (activeChar.isNpc()) - { - ((L2Npc) activeChar)._spiritshotcharged = false; - } - + { L2Character target; L2Effect effect; @@ -193,7 +188,7 @@ public class StealBuffs implements ISkillHandler skill.getEffectsSelf(activeChar); } - activeChar.spsUncharge(skill); + activeChar.setChargedShot(activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS) ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false); } @Override diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/StrSiegeAssault.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/StrSiegeAssault.java index 4be5b7ef4f..a8748a5dae 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/StrSiegeAssault.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/StrSiegeAssault.java @@ -18,6 +18,7 @@ import com.l2jserver.gameserver.handler.ISkillHandler; import com.l2jserver.gameserver.instancemanager.CastleManager; import com.l2jserver.gameserver.instancemanager.FortManager; import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.ShotType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.Castle; @@ -71,7 +72,7 @@ public class StrSiegeAssault implements ISkillHandler { // damage calculation int damage = 0; - boolean soul = activeChar.isSoulshotCharged(skill); + boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS); for (L2Character target: (L2Character[]) targets) { @@ -89,7 +90,7 @@ public class StrSiegeAssault implements ISkillHandler if (!crit && (skill.getCondition() & L2Skill.COND_CRIT) != 0) damage = 0; else - damage = skill.isStaticDamage() ? (int)skill.getPower() : (int) Formulas.calcPhysDam(activeChar, target, skill, shld, crit, dual, soul); + damage = skill.isStaticDamage() ? (int)skill.getPower() : (int) Formulas.calcPhysDam(activeChar, target, skill, shld, crit, dual, ss); if (damage > 0) { @@ -102,7 +103,7 @@ public class StrSiegeAssault implements ISkillHandler activeChar.sendMessage(skill.getName() + " failed."); } - activeChar.ssUncharge(skill); + activeChar.setChargedShot(ShotType.SOULSHOTS, false); } catch (Exception e) { -- GitLab