L2JMobius

Homunculus CpHealPercent effect fix

LLiuKe · 6 · 2764

Offline LLiuKe

  • Heir
  • **
    • Posts: 16
Code: [Select]
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java
index 0ce2905..9cf6c5e 100644
--- a/Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java
+++ b/Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/CpHealPercent.java
@@ -70,19 +70,17 @@
  effected.setCurrentCp(newCp, false);
  effected.broadcastStatusUpdate(effector);
  }
-
- if ((effector != null) && (effector != effected))
+ SystemMessage sm;
+ if (effector.getObjectId() != effected.getObjectId())
  {
- final SystemMessage sm = new SystemMessage(SystemMessageId.S2_CP_HAS_BEEN_RESTORED_BY_C1);
+ sm = new SystemMessage(SystemMessageId.S2_CP_HAS_BEEN_RESTORED_BY_C1);
  sm.addString(effector.getName());
- sm.addInt((int) amount);
- effected.sendPacket(sm);
  }
  else
  {
- final SystemMessage sm = new SystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED);
- sm.addInt((int) amount);
- effected.sendPacket(sm);
+ sm = new SystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED);
  }
+ sm.addInt((int) amount);
+ effected.sendPacket(sm);
  }
 }


Also you must change all skills that have CpHealPercent effect values from "1.15" to "15" for example !
 
P.S : I hope someone who is better then me in java could check the code and assure it had no bugs :D


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16135
Both this and code before the patch seem to do the same thing.


Offline LLiuKe

  • Heir
  • **
    • Posts: 16
First code wasn't working , try to use any item/skill that gives cphealpercent and you will see it's not working . Strange , i know


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16135
The only change I see is.
if (effector.getObjectId() != effected.getObjectId())
Can you try only that?


Offline nasseka

  • Distinguished King
  • *****
    • Posts: 1729
    • L2Unknown
but it works probably...did u check if it's defined properly? Give me skill ID


Offline LLiuKe

  • Heir
  • **
    • Posts: 16
but it works probably...did u check if it's defined properly? Give me skill ID

<skill id="2289" toLevel="7" name="No-grade Elixir of CP">
<skill id="28147" toLevel="3" name="Sayha's Support">
<skill id="30793" toLevel="5" name="Pa'agrio's Fist">