From 93ba62cd4f5745acb52b4099cae99541c68cb8ef Mon Sep 17 00:00:00 2001 From: darkk1138 Date: Mon, 9 Dec 2013 10:31:41 +0100 Subject: [PATCH] fix note bubbles for dance (both for starting and stopping) --- scripts/commands/startdance.py | 6 ++++-- scripts/commands/stopdance.py | 2 +- src/resources/objects/creature/CreatureObject.java | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/commands/startdance.py b/scripts/commands/startdance.py index 18aa211c..29b263d5 100644 --- a/scripts/commands/startdance.py +++ b/scripts/commands/startdance.py @@ -69,7 +69,7 @@ def startDance(core, actor, danceName, visual): actor.sendSystemMessage('@performance:dance_lack_skill_self',0) return - if actor.getPerformanceId() > 0: + if actor.getPosture() == 0x09: actor.sendSystemMessage('@performance:already_performing_self',0) return @@ -89,8 +89,10 @@ def startDance(core, actor, danceName, visual): dance = entSvc.getDance(visual) + # performanceId > 0 seems to trigger the note bubble stuff, so use 0 here + # instead of dance.getLineNumber() # send CREO6 here # second param is some sort of counter or start tick - actor.startPerformance(dance.getLineNumber(), -842249156 , danceVisual, 1) + actor.startPerformance(0, -842249156 , danceVisual, 1) return diff --git a/scripts/commands/stopdance.py b/scripts/commands/stopdance.py index 0f2d4763..cf33fd33 100644 --- a/scripts/commands/stopdance.py +++ b/scripts/commands/stopdance.py @@ -6,7 +6,7 @@ def setup(): def run(core, actor, target, commandString): entSvc = core.entertainmentService - if (actor.getPerformanceId() <= 0): + if actor.getPosture() != 0x09 or actor.getPerformanceId() > 0: actor.sendSystemMessage('@performance:dance_not_performing', 0) return diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index df850ddf..27231eb0 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -1428,6 +1428,8 @@ public class CreatureObject extends TangibleObject implements IPersistent { sendSystemMessage("@performance:" + type + "_stop_self",(byte)0); notifyAudience("@performance:" + type + "_stop_other"); + getClient().getSession().write(messageBuilder.buildPerformanceId(performanceId)); + getClient().getSession().write(messageBuilder.buildPerformanceCounter(performanceCounter)); getClient().getSession().write(messageBuilder.buildStartPerformance(false)); }