Support for additional potion bonuses.

This commit is contained in:
MobiusDevelopment
2019-03-15 18:06:37 +00:00
parent 50e26e6691
commit e02f179662
220 changed files with 2486 additions and 198 deletions

View File

@ -97,16 +97,35 @@ public abstract class AbstractEffect
}
public void onStart(L2Character effector, L2Character effected, Skill skill)
public void onStart(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
}
public void onStart(L2Character effector, L2Character effected, Skill skill)
{
onStart(effector, effected, skill, null);
}
public void onExit(L2Character effector, L2Character effected, Skill skill)
{
}
/**
* Called on each tick.<br>
* If the abnormal time is lesser than zero it will last forever.
* @param effector
* @param effected
* @param skill
* @param item
* @return if {@code true} this effect will continue forever, if {@code false} it will stop after abnormal time has passed
*/
public boolean onActionTime(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
return false;
}
/**
* Called on each tick.<br>
* If the abnormal time is lesser than zero it will last forever.
@ -117,7 +136,7 @@ public abstract class AbstractEffect
*/
public boolean onActionTime(L2Character effector, L2Character effected, Skill skill)
{
return false;
return onActionTime(effector, effected, skill, null);
}
/**

View File

@ -333,7 +333,7 @@ public final class BuffInfo
}
// Call on start.
effect.onStart(_effector, _effected, _skill);
effect.onStart(_effector, _effected, _skill, _item);
// If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it.
if (effect.getTicks() > 0)
@ -360,7 +360,7 @@ public final class BuffInfo
if (_isInUse)
{
// Callback for on action time event.
continueForever = effect.onActionTime(_effector, _effected, _skill);
continueForever = effect.onActionTime(_effector, _effected, _skill, _item);
}
if (!continueForever && _skill.isToggle())

View File

@ -68,6 +68,9 @@ public enum Stats
REGENERATE_HP_RATE("regHp", new RegenHPFinalizer()),
REGENERATE_CP_RATE("regCp", new RegenCPFinalizer()),
REGENERATE_MP_RATE("regMp", new RegenMPFinalizer()),
ADDITIONAL_POTION_HP("addPotionHp"),
ADDITIONAL_POTION_MP("addPotionMp"),
ADDITIONAL_POTION_CP("addPotionCp"),
MANA_CHARGE("manaCharge"),
HEAL_EFFECT("healEffect"),