L2JMobius

Battle Chronicle VampiricAttack.java no work skill

bim · 8 · 2865

Offline bim

  • Heir
  • **
    • Posts: 12
in assembly 338, the vampiric on skills does not work, game\data\scripts\handlers\effecthandlers VampiricAttack.java I tried to fix it but I don't understand what's wrong, can you fix it?these options don't work       
<effect name="VampiricAttack" fromLevel="3" toLevel="6">
                <amount>8</amount>
                <chance>100</chance>
   </effect>


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16035
See Creature.java Config.VAMPIRIC_ATTACK_AFFECTS_PVP


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16035
Should I assume this is for all non Classic clients? (Essence only?)

Try this.
Code: [Select]
Index: java/org/l2jmobius/gameserver/model/actor/Creature.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/Creature.java (revision 9980)
+++ java/org/l2jmobius/gameserver/model/actor/Creature.java (working copy)
@@ -4642,17 +4642,14 @@
  final boolean isPvP = isPlayable() && target.isPlayable();
  if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
  {
- if (skill == null) // Classic: Skills counted with the Vampiric Rage effect was introduced on GoD chronicles.
+ final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
+ if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
  {
- final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
- if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
+ int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
+ absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
+ if (absorbDamage > 0)
  {
- int absorbDamage = (int) Math.min(absorbHpPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
- absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
- if (absorbDamage > 0)
- {
- setCurrentHp(_status.getCurrentHp() + absorbDamage);
- }
+ setCurrentHp(_status.getCurrentHp() + absorbDamage);
  }
  }
  }
@@ -4660,20 +4657,14 @@
  // Absorb MP from the damage inflicted.
  if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
  {
- if (skill != null) // Classic: Used to reduce skill MP consumption. See Orfen's Earring.
+ final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
+ if (absorbMpPercent > 0)
  {
- if (Rnd.get(10) < 3) // Classic: Static 30% change.
+ int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
+ absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
+ if (absorbDamage > 0)
  {
- final double absorbMpPercent = _stat.getValue(Stat.ABSORB_MANA_DAMAGE_PERCENT, 0);
- if (absorbMpPercent > 0)
- {
- int absorbDamage = (int) Math.min((absorbMpPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
- absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
- if (absorbDamage > 0)
- {
- setCurrentMp(_status.getCurrentMp() + absorbDamage);
- }
- }
+ setCurrentMp(_status.getCurrentMp() + absorbDamage);
  }
  }
  }


Offline Index

  • Black Sheep
  • Marquis
  • *****
    • Posts: 536
It for all verisons after GOD
Essence and Classic going after GOD


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16035
Related post.
https://l2jmobius.org/forum/index.php?topic=2705

Made a configuration for it.
Code: [Select]
Index: dist/game/config/Character.ini
===================================================================
--- dist/game/config/Character.ini (revision 9974)
+++ dist/game/config/Character.ini (working copy)
@@ -144,7 +144,13 @@
 # Stand when fake death is active and taking damage.
 FakeDeathDamageStand = True
 
+# Vampiric attack work with skills.
+VampiricAttackWorkWithSkills = True
 
+# MP vampiric attacks work with melee.
+MpVampiricAttackWorkWithMelee = False
+
+
 # ---------------------------------------------------------------------------
 # Class, Sub-class and skill learning options
 # ---------------------------------------------------------------------------
Index: java/org/l2jmobius/Config.java
===================================================================
--- java/org/l2jmobius/Config.java (revision 9974)
+++ java/org/l2jmobius/Config.java (working copy)
@@ -198,6 +198,8 @@
  public static long EFFECT_TICK_RATIO;
  public static boolean FAKE_DEATH_UNTARGET;
  public static boolean FAKE_DEATH_DAMAGE_STAND;
+ public static boolean VAMPIRIC_ATTACK_WORKS_WITH_SKILLS;
+ public static boolean MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE;
  public static boolean LIFE_CRYSTAL_NEEDED;
  public static boolean DIVINE_SP_BOOK_NEEDED;
  public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
@@ -1763,6 +1765,8 @@
  EFFECT_TICK_RATIO = characterConfig.getLong("EffectTickRatio", 666);
  FAKE_DEATH_UNTARGET = characterConfig.getBoolean("FakeDeathUntarget", true);
  FAKE_DEATH_DAMAGE_STAND = characterConfig.getBoolean("FakeDeathDamageStand", false);
+ VAMPIRIC_ATTACK_WORKS_WITH_SKILLS = characterConfig.getBoolean("VampiricAttackWorkWithSkills", true);
+ MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE = characterConfig.getBoolean("MpVampiricAttackWorkWithMelee", false);
  LIFE_CRYSTAL_NEEDED = characterConfig.getBoolean("LifeCrystalNeeded", true);
  DIVINE_SP_BOOK_NEEDED = characterConfig.getBoolean("DivineInspirationSpBookNeeded", true);
  ALT_GAME_SUBCLASS_WITHOUT_QUESTS = characterConfig.getBoolean("AltSubClassWithoutQuests", false);
Index: java/org/l2jmobius/gameserver/model/actor/Creature.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/Creature.java (revision 9980)
+++ java/org/l2jmobius/gameserver/model/actor/Creature.java (working copy)
@@ -4642,7 +4642,7 @@
  final boolean isPvP = isPlayable() && target.isPlayable();
  if (!isPvP || Config.VAMPIRIC_ATTACK_AFFECTS_PVP)
  {
- if (skill == null) // Classic: Skills counted with the Vampiric Rage effect was introduced on GoD chronicles.
+ if ((skill == null) || Config.VAMPIRIC_ATTACK_WORKS_WITH_SKILLS)
  {
  final double absorbHpPercent = getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stat.ABSORB_DAMAGE_DEFENCE, 1);
  if ((absorbHpPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stat.ABSORB_DAMAGE_CHANCE)))
@@ -4660,7 +4660,7 @@
  // Absorb MP from the damage inflicted.
  if (!isPvP || Config.MP_VAMPIRIC_ATTACK_AFFECTS_PVP)
  {
- if (skill != null) // Classic: Used to reduce skill MP consumption. See Orfen's Earring.
+ if ((skill != null) || Config.MP_VAMPIRIC_ATTACK_WORKS_WITH_MELEE)
  {
  if (Rnd.get(10) < 3) // Classic: Static 30% change.
  {



Offline Iris

  • Distinguished King
  • *****
    • Posts: 1239
Some clarifications about Vampiric Atack on official Classic servers as of Innova (EU).

  • HP Vampiric Attack on Classic is only for melee basic attacks, just like pre-GoD chronicles
  • It's true that post-GoD chronicles make Vampiric Attack work on everything, but it never worked that way in any chronicle from Innova (EU)
  • Even on the NA port (Talking Island), they had at first Vampiric Attack working on everything, and then a month later they patched it and removed it, bringing it back to only work with melee basic attacks
  • MP vampiric attack however, does work with skills