L2JMobius

Free Users => Shares/Contributions => Topic started by: G-hamsteR on June 05, 2020, 12:26:35 AM

Title: Support for giveHp stat
Post by: G-hamsteR on June 05, 2020, 12:26:35 AM
Hello,

I wanted to create an item for healers, so that their healing powers would increase. So, I created giveHp stat, which increases the healing done to others.

You can use it like this:
Code: [Select]
<mul order="0x30" stat="giveHp" val="1.2" />
The above increases healing done to other players by 20%

At gameserver/model/skills/Stat.java, line 38:
Change this:
Code: [Select]
HEAL_EFFECTIVNESS("gainHp"),To this:
Code: [Select]
HEAL_EFFECTIVNESS("gainHp"),
HEAL_PROFICIENCY("giveHp"),

At gameserver/handler/skillhandlers/Heal.java, line 137:
Change this:
Code: [Select]
hp *= target.calcStat(Stat.HEAL_EFFECTIVNESS, 100, null, null) / 100;To this:
Code: [Select]
hp *= target.calcStat(Stat.HEAL_EFFECTIVNESS, 100, null, null) / 100;
if (player != null)
{
hp *= player.calcStat(Stat.HEAL_PROFICIENCY, 100, null, null) / 100;
}

Pastebin patch: https://pastebin.com/jPu0LRee (https://pastebin.com/jPu0LRee)