Code:
OVERLOAD(11730, 11731, 11732, 11733) {
@Override
public void onEffect(Player player) {
for (int i = Skill.ATTACK.ordinal(); i <= Skill.MAGIC.ordinal(); i++) {
if (i == Skill.HITPOINTS.ordinal())
continue;
PotionConsumable.onBasicEffect(player, Skill.forId(i), BoostType.OVERLOAD);
}
}
}
In the #consume method (Obviously, PotionConsumable class);
Code:
if (potion.get().equals(OVERLOAD) && player.hasOverloadEvent())
return false;
In the statement block;
Code:
if(player.getPotionTimer().elapsed(1200)) {
under the single line statement;
Code:
potion.get().onEffect(player);
Add the following;
Code:
if (potion.get().equals(OVERLOAD)) {
player.overloadTimer.start(240);
player.setOverloadEvent(true);
TaskManager.submit(new Task(2, player, true) {
@Override
public void execute() {
if (player.getOverloadDamage() >= 50 || !player.hasOverloadEvent()) {
stop();
return;
}
if (player.getOverloadDamage() < 50 && player.hasOverloadEvent()) {
player.setOverloadDamage(player.getOverloadDamage() + 10);
player.getCombat().getHitQueue().addPendingDamage(new HitDamage(10, HitMask.RED));
player.performAnimation(new Animation(3170));
}
}
@Override
public void stop() {
setEventRunning(false);
player.setOverloadDamage(0);
player.setOverloadEvent(false);
player.performAnimation(Animation.DEFAULT_RESET_ANIMATION);
}
});
}
In the Player class;
Code:
private boolean overloadEvent;
private int overloadDamage = 0;
public SecondsTimer overloadTimer = new SecondsTimer();
Code:
public boolean hasOverloadEvent() {
return overloadEvent;
}
public int getOverloadDamage() {
return overloadDamage;
}
public void setOverloadEvent(final boolean input) {
overloadEvent = input;
}
public void setOverloadDamage(final int damage) {
overloadDamage = damage;
}
Then in the #onTick method, still in the Player class;
Code:
if (!this.overloadTimer.finished()) {
PotionConsumable.OVERLOAD.onEffect(this);
}
Enjoy.