From b641e874d4eae38fa68730681ab75af42f552e98 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 24 Nov 2018 00:45:10 +0000 Subject: [PATCH] Addition of chargeConsume skill parameter. --- .../l2jmobius/gameserver/model/skills/Skill.java | 7 +++++++ .../gameserver/model/skills/SkillCaster.java | 15 ++++++++++++--- .../l2jmobius/gameserver/model/skills/Skill.java | 7 +++++++ .../gameserver/model/skills/SkillCaster.java | 15 ++++++++++++--- .../l2jmobius/gameserver/model/skills/Skill.java | 7 +++++++ .../gameserver/model/skills/SkillCaster.java | 15 ++++++++++++--- .../l2jmobius/gameserver/model/skills/Skill.java | 7 +++++++ .../gameserver/model/skills/SkillCaster.java | 15 ++++++++++++--- .../l2jmobius/gameserver/model/skills/Skill.java | 7 +++++++ .../gameserver/model/skills/SkillCaster.java | 15 ++++++++++++--- .../l2jmobius/gameserver/model/skills/Skill.java | 7 +++++++ .../gameserver/model/skills/SkillCaster.java | 15 ++++++++++++--- .../l2jmobius/gameserver/model/skills/Skill.java | 7 +++++++ .../gameserver/model/skills/SkillCaster.java | 15 ++++++++++++--- .../l2jmobius/gameserver/model/skills/Skill.java | 7 +++++++ .../gameserver/model/skills/SkillCaster.java | 15 ++++++++++++--- .../l2jmobius/gameserver/model/skills/Skill.java | 7 +++++++ .../gameserver/model/skills/SkillCaster.java | 15 ++++++++++++--- .../l2jmobius/gameserver/model/skills/Skill.java | 7 +++++++ .../gameserver/model/skills/SkillCaster.java | 15 ++++++++++++--- 20 files changed, 190 insertions(+), 30 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/Skill.java index b314894e2e..fa7116049f 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/Skill.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/Skill.java @@ -163,6 +163,7 @@ public final class Skill implements IIdentifiable private final int _minPledgeClass; private final int _soulMaxConsume; + private final int _chargeConsume; private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot private final int _effectPoint; @@ -380,6 +381,7 @@ public final class Skill implements IIdentifiable _minPledgeClass = set.getInt("minPledgeClass", 0); _soulMaxConsume = set.getInt("soulMaxConsumeCount", 0); + _chargeConsume = set.getInt("chargeConsume", 0); _isTriggeredSkill = set.getBoolean("isTriggeredSkill", false); _effectPoint = set.getInt("effectPoint", 0); @@ -1063,6 +1065,11 @@ public final class Skill implements IIdentifiable return _soulMaxConsume; } + public int getChargeConsumeCount() + { + return _chargeConsume; + } + public boolean isStayAfterDeath() { return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle; diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 6f1d988619..6cdd30f74b 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -484,10 +484,19 @@ public class SkillCaster implements Runnable caster.sendPacket(su); } - // Consume Souls if necessary - if (caster.isPlayer() && (_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + if (caster.isPlayer()) { - return false; + // Consume Souls if necessary. + if ((_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + { + return false; + } + + // Consume charges if necessary. + if ((_skill.getChargeConsumeCount() > 0) && !caster.getActingPlayer().decreaseCharges(_skill.getChargeConsumeCount())) + { + return false; + } } // Consume skill reduced item on success. diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/Skill.java index b314894e2e..fa7116049f 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/Skill.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/Skill.java @@ -163,6 +163,7 @@ public final class Skill implements IIdentifiable private final int _minPledgeClass; private final int _soulMaxConsume; + private final int _chargeConsume; private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot private final int _effectPoint; @@ -380,6 +381,7 @@ public final class Skill implements IIdentifiable _minPledgeClass = set.getInt("minPledgeClass", 0); _soulMaxConsume = set.getInt("soulMaxConsumeCount", 0); + _chargeConsume = set.getInt("chargeConsume", 0); _isTriggeredSkill = set.getBoolean("isTriggeredSkill", false); _effectPoint = set.getInt("effectPoint", 0); @@ -1063,6 +1065,11 @@ public final class Skill implements IIdentifiable return _soulMaxConsume; } + public int getChargeConsumeCount() + { + return _chargeConsume; + } + public boolean isStayAfterDeath() { return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle; diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 6f1d988619..6cdd30f74b 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -484,10 +484,19 @@ public class SkillCaster implements Runnable caster.sendPacket(su); } - // Consume Souls if necessary - if (caster.isPlayer() && (_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + if (caster.isPlayer()) { - return false; + // Consume Souls if necessary. + if ((_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + { + return false; + } + + // Consume charges if necessary. + if ((_skill.getChargeConsumeCount() > 0) && !caster.getActingPlayer().decreaseCharges(_skill.getChargeConsumeCount())) + { + return false; + } } // Consume skill reduced item on success. diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/Skill.java index b314894e2e..fa7116049f 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/Skill.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/Skill.java @@ -163,6 +163,7 @@ public final class Skill implements IIdentifiable private final int _minPledgeClass; private final int _soulMaxConsume; + private final int _chargeConsume; private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot private final int _effectPoint; @@ -380,6 +381,7 @@ public final class Skill implements IIdentifiable _minPledgeClass = set.getInt("minPledgeClass", 0); _soulMaxConsume = set.getInt("soulMaxConsumeCount", 0); + _chargeConsume = set.getInt("chargeConsume", 0); _isTriggeredSkill = set.getBoolean("isTriggeredSkill", false); _effectPoint = set.getInt("effectPoint", 0); @@ -1063,6 +1065,11 @@ public final class Skill implements IIdentifiable return _soulMaxConsume; } + public int getChargeConsumeCount() + { + return _chargeConsume; + } + public boolean isStayAfterDeath() { return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle; diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 6f1d988619..6cdd30f74b 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -484,10 +484,19 @@ public class SkillCaster implements Runnable caster.sendPacket(su); } - // Consume Souls if necessary - if (caster.isPlayer() && (_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + if (caster.isPlayer()) { - return false; + // Consume Souls if necessary. + if ((_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + { + return false; + } + + // Consume charges if necessary. + if ((_skill.getChargeConsumeCount() > 0) && !caster.getActingPlayer().decreaseCharges(_skill.getChargeConsumeCount())) + { + return false; + } } // Consume skill reduced item on success. diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/Skill.java index b314894e2e..fa7116049f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/Skill.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/Skill.java @@ -163,6 +163,7 @@ public final class Skill implements IIdentifiable private final int _minPledgeClass; private final int _soulMaxConsume; + private final int _chargeConsume; private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot private final int _effectPoint; @@ -380,6 +381,7 @@ public final class Skill implements IIdentifiable _minPledgeClass = set.getInt("minPledgeClass", 0); _soulMaxConsume = set.getInt("soulMaxConsumeCount", 0); + _chargeConsume = set.getInt("chargeConsume", 0); _isTriggeredSkill = set.getBoolean("isTriggeredSkill", false); _effectPoint = set.getInt("effectPoint", 0); @@ -1063,6 +1065,11 @@ public final class Skill implements IIdentifiable return _soulMaxConsume; } + public int getChargeConsumeCount() + { + return _chargeConsume; + } + public boolean isStayAfterDeath() { return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 6f1d988619..6cdd30f74b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -484,10 +484,19 @@ public class SkillCaster implements Runnable caster.sendPacket(su); } - // Consume Souls if necessary - if (caster.isPlayer() && (_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + if (caster.isPlayer()) { - return false; + // Consume Souls if necessary. + if ((_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + { + return false; + } + + // Consume charges if necessary. + if ((_skill.getChargeConsumeCount() > 0) && !caster.getActingPlayer().decreaseCharges(_skill.getChargeConsumeCount())) + { + return false; + } } // Consume skill reduced item on success. diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/Skill.java index b314894e2e..fa7116049f 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/Skill.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/Skill.java @@ -163,6 +163,7 @@ public final class Skill implements IIdentifiable private final int _minPledgeClass; private final int _soulMaxConsume; + private final int _chargeConsume; private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot private final int _effectPoint; @@ -380,6 +381,7 @@ public final class Skill implements IIdentifiable _minPledgeClass = set.getInt("minPledgeClass", 0); _soulMaxConsume = set.getInt("soulMaxConsumeCount", 0); + _chargeConsume = set.getInt("chargeConsume", 0); _isTriggeredSkill = set.getBoolean("isTriggeredSkill", false); _effectPoint = set.getInt("effectPoint", 0); @@ -1063,6 +1065,11 @@ public final class Skill implements IIdentifiable return _soulMaxConsume; } + public int getChargeConsumeCount() + { + return _chargeConsume; + } + public boolean isStayAfterDeath() { return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle; diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 63698518dd..835370f217 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -484,10 +484,19 @@ public class SkillCaster implements Runnable caster.sendPacket(su); } - // Consume Souls if necessary - if (caster.isPlayer() && (_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + if (caster.isPlayer()) { - return false; + // Consume Souls if necessary. + if ((_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + { + return false; + } + + // Consume charges if necessary. + if ((_skill.getChargeConsumeCount() > 0) && !caster.getActingPlayer().decreaseCharges(_skill.getChargeConsumeCount())) + { + return false; + } } // Consume skill reduced item on success. diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/Skill.java index b314894e2e..fa7116049f 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/Skill.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/Skill.java @@ -163,6 +163,7 @@ public final class Skill implements IIdentifiable private final int _minPledgeClass; private final int _soulMaxConsume; + private final int _chargeConsume; private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot private final int _effectPoint; @@ -380,6 +381,7 @@ public final class Skill implements IIdentifiable _minPledgeClass = set.getInt("minPledgeClass", 0); _soulMaxConsume = set.getInt("soulMaxConsumeCount", 0); + _chargeConsume = set.getInt("chargeConsume", 0); _isTriggeredSkill = set.getBoolean("isTriggeredSkill", false); _effectPoint = set.getInt("effectPoint", 0); @@ -1063,6 +1065,11 @@ public final class Skill implements IIdentifiable return _soulMaxConsume; } + public int getChargeConsumeCount() + { + return _chargeConsume; + } + public boolean isStayAfterDeath() { return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle; diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 63698518dd..835370f217 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -484,10 +484,19 @@ public class SkillCaster implements Runnable caster.sendPacket(su); } - // Consume Souls if necessary - if (caster.isPlayer() && (_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + if (caster.isPlayer()) { - return false; + // Consume Souls if necessary. + if ((_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + { + return false; + } + + // Consume charges if necessary. + if ((_skill.getChargeConsumeCount() > 0) && !caster.getActingPlayer().decreaseCharges(_skill.getChargeConsumeCount())) + { + return false; + } } // Consume skill reduced item on success. diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/Skill.java index b314894e2e..fa7116049f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/Skill.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/Skill.java @@ -163,6 +163,7 @@ public final class Skill implements IIdentifiable private final int _minPledgeClass; private final int _soulMaxConsume; + private final int _chargeConsume; private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot private final int _effectPoint; @@ -380,6 +381,7 @@ public final class Skill implements IIdentifiable _minPledgeClass = set.getInt("minPledgeClass", 0); _soulMaxConsume = set.getInt("soulMaxConsumeCount", 0); + _chargeConsume = set.getInt("chargeConsume", 0); _isTriggeredSkill = set.getBoolean("isTriggeredSkill", false); _effectPoint = set.getInt("effectPoint", 0); @@ -1063,6 +1065,11 @@ public final class Skill implements IIdentifiable return _soulMaxConsume; } + public int getChargeConsumeCount() + { + return _chargeConsume; + } + public boolean isStayAfterDeath() { return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 51fb9f3b59..b64ec7772d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -484,10 +484,19 @@ public class SkillCaster implements Runnable caster.sendPacket(su); } - // Consume Souls if necessary - if (caster.isPlayer() && (_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + if (caster.isPlayer()) { - return false; + // Consume Souls if necessary. + if ((_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + { + return false; + } + + // Consume charges if necessary. + if ((_skill.getChargeConsumeCount() > 0) && !caster.getActingPlayer().decreaseCharges(_skill.getChargeConsumeCount())) + { + return false; + } } // Consume skill reduced item on success. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/Skill.java index b314894e2e..fa7116049f 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/Skill.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/Skill.java @@ -163,6 +163,7 @@ public final class Skill implements IIdentifiable private final int _minPledgeClass; private final int _soulMaxConsume; + private final int _chargeConsume; private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot private final int _effectPoint; @@ -380,6 +381,7 @@ public final class Skill implements IIdentifiable _minPledgeClass = set.getInt("minPledgeClass", 0); _soulMaxConsume = set.getInt("soulMaxConsumeCount", 0); + _chargeConsume = set.getInt("chargeConsume", 0); _isTriggeredSkill = set.getBoolean("isTriggeredSkill", false); _effectPoint = set.getInt("effectPoint", 0); @@ -1063,6 +1065,11 @@ public final class Skill implements IIdentifiable return _soulMaxConsume; } + public int getChargeConsumeCount() + { + return _chargeConsume; + } + public boolean isStayAfterDeath() { return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 51fb9f3b59..b64ec7772d 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -484,10 +484,19 @@ public class SkillCaster implements Runnable caster.sendPacket(su); } - // Consume Souls if necessary - if (caster.isPlayer() && (_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + if (caster.isPlayer()) { - return false; + // Consume Souls if necessary. + if ((_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + { + return false; + } + + // Consume charges if necessary. + if ((_skill.getChargeConsumeCount() > 0) && !caster.getActingPlayer().decreaseCharges(_skill.getChargeConsumeCount())) + { + return false; + } } // Consume skill reduced item on success. diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/Skill.java index b314894e2e..fa7116049f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/Skill.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/Skill.java @@ -163,6 +163,7 @@ public final class Skill implements IIdentifiable private final int _minPledgeClass; private final int _soulMaxConsume; + private final int _chargeConsume; private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot private final int _effectPoint; @@ -380,6 +381,7 @@ public final class Skill implements IIdentifiable _minPledgeClass = set.getInt("minPledgeClass", 0); _soulMaxConsume = set.getInt("soulMaxConsumeCount", 0); + _chargeConsume = set.getInt("chargeConsume", 0); _isTriggeredSkill = set.getBoolean("isTriggeredSkill", false); _effectPoint = set.getInt("effectPoint", 0); @@ -1063,6 +1065,11 @@ public final class Skill implements IIdentifiable return _soulMaxConsume; } + public int getChargeConsumeCount() + { + return _chargeConsume; + } + public boolean isStayAfterDeath() { return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 51fb9f3b59..b64ec7772d 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -484,10 +484,19 @@ public class SkillCaster implements Runnable caster.sendPacket(su); } - // Consume Souls if necessary - if (caster.isPlayer() && (_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + if (caster.isPlayer()) { - return false; + // Consume Souls if necessary. + if ((_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + { + return false; + } + + // Consume charges if necessary. + if ((_skill.getChargeConsumeCount() > 0) && !caster.getActingPlayer().decreaseCharges(_skill.getChargeConsumeCount())) + { + return false; + } } // Consume skill reduced item on success. diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/Skill.java index b314894e2e..fa7116049f 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/Skill.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/Skill.java @@ -163,6 +163,7 @@ public final class Skill implements IIdentifiable private final int _minPledgeClass; private final int _soulMaxConsume; + private final int _chargeConsume; private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot private final int _effectPoint; @@ -380,6 +381,7 @@ public final class Skill implements IIdentifiable _minPledgeClass = set.getInt("minPledgeClass", 0); _soulMaxConsume = set.getInt("soulMaxConsumeCount", 0); + _chargeConsume = set.getInt("chargeConsume", 0); _isTriggeredSkill = set.getBoolean("isTriggeredSkill", false); _effectPoint = set.getInt("effectPoint", 0); @@ -1063,6 +1065,11 @@ public final class Skill implements IIdentifiable return _soulMaxConsume; } + public int getChargeConsumeCount() + { + return _chargeConsume; + } + public boolean isStayAfterDeath() { return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 51fb9f3b59..b64ec7772d 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -484,10 +484,19 @@ public class SkillCaster implements Runnable caster.sendPacket(su); } - // Consume Souls if necessary - if (caster.isPlayer() && (_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + if (caster.isPlayer()) { - return false; + // Consume Souls if necessary. + if ((_skill.getMaxSoulConsumeCount() > 0) && !caster.getActingPlayer().decreaseSouls(_skill.getMaxSoulConsumeCount(), _skill)) + { + return false; + } + + // Consume charges if necessary. + if ((_skill.getChargeConsumeCount() > 0) && !caster.getActingPlayer().decreaseCharges(_skill.getChargeConsumeCount())) + { + return false; + } } // Consume skill reduced item on success.