diff --git a/scripts/skillMods/actionPercent.py b/scripts/skillMods/actionPercent.py new file mode 100644 index 00000000..97166ab2 --- /dev/null +++ b/scripts/skillMods/actionPercent.py @@ -0,0 +1,12 @@ +import sys + +def add(core, actor, name, base): + actor.addSkillMod(name, base) + actor.setMaxAction(actor.getMaxAction() + int((float(actor.getMaxAction()) * (float(base) / float(100))))) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + actor.setMaxAction(actor.getMaxAction() - int((float(actor.getMaxAction()) * (float(base) / float(100))))) + return + \ No newline at end of file diff --git a/scripts/skillMods/health.py b/scripts/skillMods/health.py new file mode 100644 index 00000000..b4a86dd4 --- /dev/null +++ b/scripts/skillMods/health.py @@ -0,0 +1,12 @@ +import sys + +def add(core, actor, name, base): + actor.addSkillMod(name, base) + actor.setMaxHealth(actor.getMaxHealth() + base) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + actor.setMaxHealth(actor.getMaxHealth() - base) + return + \ No newline at end of file diff --git a/scripts/skillMods/healthPercent.py b/scripts/skillMods/healthPercent.py new file mode 100644 index 00000000..ed9b3e37 --- /dev/null +++ b/scripts/skillMods/healthPercent.py @@ -0,0 +1,12 @@ +import sys + +def add(core, actor, name, base): + actor.addSkillMod(name, base) + actor.setMaxHealth(actor.getMaxHealth() + int((float(actor.getMaxHealth()) * (float(base) / float(100))))) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + actor.setMaxHealth(actor.getMaxHealth() - int((actor.getMaxHealth() * (float(base) / float(100))))) + return + \ No newline at end of file diff --git a/src/services/BuffService.java b/src/services/BuffService.java index 4a41803d..ca7812c7 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -252,38 +252,14 @@ public class BuffService implements INetworkDispatch { removeBuffFromCreature(creature, creature.getBuffByName(buffName)); } - public void clearBuffs(final CreatureObject creature) { - - // copy to array for thread safety - - for(final Buff buff : creature.getBuffList().get().toArray(new Buff[] { })) { - - if (buff.getGroup1().startsWith("setBonus")) { continue; } - - if(buff.isGroupBuff() && buff.getGroupBufferId() != creature.getObjectID()) { - removeBuffFromCreature(creature, buff); - continue; - } - - if(buff.getRemainingDuration() > 0 && buff.getDuration() > 0) { - ScheduledFuture task = scheduler.schedule(new Runnable() { - - @Override - public void run() { - - removeBuffFromCreature(creature, buff); - - } - - }, (long) buff.getRemainingDuration(), TimeUnit.SECONDS); - buff.setRemovalTask(task); - continue; - } else { - removeBuffFromCreature(creature, buff); - } - - } - + public void clearBuffs(final CreatureObject creature) + { + // This method sucks ass, someone please fix me + for(Buff buff : creature.getBuffList().get()) + { + if(buff.getRemainingDuration() > 0 && buff.getDuration() > 0) buff.setRemovalTask(null); + removeBuffFromCreature(creature, buff); + } } public void addGroupBuff(CreatureObject buffer, String buffName) {