diff --git a/src/intents/FlourishIntent.java b/src/intents/FlourishIntent.java
new file mode 100644
index 000000000..f83e30b69
--- /dev/null
+++ b/src/intents/FlourishIntent.java
@@ -0,0 +1,58 @@
+/***********************************************************************************
+* Copyright (c) 2015 /// Project SWG /// www.projectswg.com *
+* *
+* ProjectSWG is the first NGE emulator for Star Wars Galaxies founded on *
+* July 7th, 2011 after SOE announced the official shutdown of Star Wars Galaxies. *
+* Our goal is to create an emulator which will provide a server for players to *
+* continue playing a game similar to the one they used to play. We are basing *
+* it on the final publish of the game prior to end-game events. *
+* *
+* This file is part of Holocore. *
+* *
+* -------------------------------------------------------------------------------- *
+* *
+* Holocore is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Affero General Public License as *
+* published by the Free Software Foundation, either version 3 of the *
+* License, or (at your option) any later version. *
+* *
+* Holocore is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Affero General Public License for more details. *
+* *
+* You should have received a copy of the GNU Affero General Public License *
+* along with Holocore. If not, see . *
+* *
+***********************************************************************************/
+package intents;
+
+import resources.control.Intent;
+import resources.player.Player;
+
+/**
+ *
+ * @author Mads
+ */
+public class FlourishIntent extends Intent {
+
+ public static final String TYPE = "FlourishIntent";
+
+ private final Player performer;
+ private final String flourishName;
+
+ public FlourishIntent(Player performer, String flourishName) {
+ super(TYPE);
+ this.performer = performer;
+ this.flourishName = flourishName;
+ }
+
+ public Player getPerformer() {
+ return performer;
+ }
+
+ public String getFlourishName() {
+ return flourishName;
+ }
+
+}
diff --git a/src/resources/commands/callbacks/FlourishCmdCallback.java b/src/resources/commands/callbacks/FlourishCmdCallback.java
new file mode 100644
index 000000000..592067971
--- /dev/null
+++ b/src/resources/commands/callbacks/FlourishCmdCallback.java
@@ -0,0 +1,68 @@
+/************************************************************************************
+ * Copyright (c) 2015 /// Project SWG /// www.projectswg.com *
+ * *
+ * ProjectSWG is the first NGE emulator for Star Wars Galaxies founded on *
+ * July 7th, 2011 after SOE announced the official shutdown of Star Wars Galaxies. *
+ * Our goal is to create an emulator which will provide a server for players to *
+ * continue playing a game similar to the one they used to play. We are basing *
+ * it on the final publish of the game prior to end-game events. *
+ * *
+ * This file is part of Holocore. *
+ * *
+ * -------------------------------------------------------------------------------- *
+ * *
+ * Holocore is free software: you can redistribute it and/or modify *
+ * it under the terms of the GNU Affero General Public License as *
+ * published by the Free Software Foundation, either version 3 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * Holocore is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU Affero General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Affero General Public License *
+ * along with Holocore. If not, see . *
+ * *
+ ***********************************************************************************/
+package resources.commands.callbacks;
+
+import intents.FlourishIntent;
+import intents.chat.ChatBroadcastIntent;
+import resources.commands.ICmdCallback;
+import resources.objects.SWGObject;
+import resources.player.Player;
+import services.galaxy.GalacticManager;
+
+/**
+ *
+ * @author Mads
+ */
+public class FlourishCmdCallback implements ICmdCallback {
+
+ @Override
+ public void execute(GalacticManager galacticManager, Player player, SWGObject target, String args) {
+ // No performance, no flourish!
+ if (!player.getCreatureObject().isPerforming()) {
+ new ChatBroadcastIntent(player, "@performance:flourish_not_performing").broadcast();
+ return;
+ }
+
+ try {
+ int flourishNumber = Integer.parseInt(args);
+
+ if(flourishNumber < 1 || flourishNumber > 9) {
+ new ChatBroadcastIntent(player, "@performance:flourish_not_valid").broadcast();
+ } else if(flourishNumber == 9) {
+ new FlourishIntent(player, "mistake").broadcast();
+ } else {
+ new FlourishIntent(player, "skill_action_" + flourishNumber).broadcast();
+ }
+ } catch (NumberFormatException e) {
+ new ChatBroadcastIntent(player, "@performance:flourish_not_valid").broadcast();
+ }
+
+
+ }
+
+}
diff --git a/src/services/commands/CommandService.java b/src/services/commands/CommandService.java
index 71adee345..6c4cf0555 100644
--- a/src/services/commands/CommandService.java
+++ b/src/services/commands/CommandService.java
@@ -313,6 +313,7 @@ public class CommandService extends Service {
registerCallback("goto", GotoCmdCallback.class);
registerCallback("startDance", StartDanceCallback.class);
registerCallback("requestBiography", RequestBiographyCmdCallback.class);
+ registerCallback("flourish", FlourishCmdCallback.class);
}
private void clearCommands() {
diff --git a/src/services/commands/EntertainmentService.java b/src/services/commands/EntertainmentService.java
index d21519433..30910c922 100644
--- a/src/services/commands/EntertainmentService.java
+++ b/src/services/commands/EntertainmentService.java
@@ -28,6 +28,7 @@
package services.commands;
import intents.DanceIntent;
+import intents.FlourishIntent;
import intents.PlayerEventIntent;
import intents.chat.ChatBroadcastIntent;
import intents.experience.ExperienceIntent;
@@ -37,12 +38,14 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
+import network.packets.swg.zone.object_controller.Animation;
import resources.Posture;
import resources.client_info.ClientFactory;
import resources.client_info.visitors.DatatableData;
import resources.control.Intent;
import resources.control.Service;
import resources.objects.creature.CreatureObject;
+import resources.player.Player;
import resources.server_info.Log;
/**
@@ -64,6 +67,7 @@ public class EntertainmentService extends Service {
executorService = Executors.newSingleThreadScheduledExecutor();
registerForIntent(DanceIntent.TYPE);
registerForIntent(PlayerEventIntent.TYPE);
+ registerForIntent(FlourishIntent.TYPE);
}
@Override
@@ -97,6 +101,9 @@ public class EntertainmentService extends Service {
case PlayerEventIntent.TYPE:
handlePlayerEventIntent((PlayerEventIntent) i);
break;
+ case FlourishIntent.TYPE:
+ handleFlourishIntent((FlourishIntent) i);
+ break;
}
}
@@ -151,6 +158,14 @@ public class EntertainmentService extends Service {
}
}
+ private void handleFlourishIntent(FlourishIntent i) {
+ Player performer = i.getPerformer();
+ CreatureObject performerObject = performer.getCreatureObject();
+
+ // Send the flourish animation to the owner of the creature and owners of creatures observing
+ performerObject.sendObserversAndSelf(new Animation(performerObject.getObjectId(), i.getFlourishName()));
+ new ChatBroadcastIntent(performer, "@performance:flourish_perform").broadcast();
+ }
/**
* Checks if the {@code CreatureObject} is a Novice Entertainer.