From f93a7b68db97a3fe41eda6c1eddefba1fa104907 Mon Sep 17 00:00:00 2001 From: Seefo Date: Mon, 31 Mar 2014 22:03:39 -0400 Subject: [PATCH] Added action skill mod --- scripts/skillMods/action.py | 12 ++++++++++++ src/services/BuffService.java | 2 ++ src/services/object/ObjectService.java | 6 ++++-- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 scripts/skillMods/action.py diff --git a/scripts/skillMods/action.py b/scripts/skillMods/action.py new file mode 100644 index 00000000..5d92ea61 --- /dev/null +++ b/scripts/skillMods/action.py @@ -0,0 +1,12 @@ +import sys + +def add(core, actor, name, base): + actor.addSkillMod(name, base) + actor.setMaxAction(actor.getMaxAction() + base) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + actor.setMaxAction(actor.getMaxAction() - base) + return + \ No newline at end of file diff --git a/src/services/BuffService.java b/src/services/BuffService.java index 917f07e6..4a41803d 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -100,6 +100,8 @@ public class BuffService implements INetworkDispatch { return null; } + if(target.hasBuff(buffName)) return null; + final Buff buff = new Buff(buffName, target.getObjectID()); if(target.getSlottedObject("ghost") != null) buff.setTotalPlayTime(((PlayerObject) target.getSlottedObject("ghost")).getTotalPlayTime()); diff --git a/src/services/object/ObjectService.java b/src/services/object/ObjectService.java index e117483c..76a680a1 100644 --- a/src/services/object/ObjectService.java +++ b/src/services/object/ObjectService.java @@ -534,11 +534,13 @@ public class ObjectService implements INetworkDispatch { { if(object.getAttachment("tempUseCount") != null) { - int useCount = (int)object.getAttachment("tempUseCount"); // Placeholder until delta for stack count/use count + int useCount = (int)object.getAttachment("tempUseCount"); // Seefo: Placeholder until delta for stack count/use count - if(useCount - 1 == 0) destroyObject(object); + if((useCount - 1) == 0) destroyObject(object); else object.setAttachment("tempUseCount", useCount--); } + + // Seefo: We need to add cool downs for buff items core.buffService.addBuffToCreature(creature, object.getStringAttribute("proc_name").replace("@ui_buff:", ""), creature); }