Instructions Jenkins Doxygen

[fixed] mantis 3836 pukes all over spice downers 59/859/3
authorKlivian <klivian@hotmail.com>
Sat, 5 Oct 2013 15:01:52 +0000 (15:01 +0000)
committerKlivian <klivian@hotmail.com>
Sat, 5 Oct 2013 15:01:52 +0000 (15:01 +0000)
Change-Id: Icb8afdba9dd6e64925bb4346aa5d46484f76c48e

MMOCoreORB/src/server/zone/objects/creature/buffs/SpiceBuffImplementation.cpp
MMOCoreORB/src/server/zone/objects/creature/events/SpiceDownerAnimationTask.h [new file with mode: 0644]

index 3d80a22..da732ef 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "SpiceBuff.h"
 #include "server/zone/objects/creature/CreatureObject.h"
+#include "server/zone/objects/creature/events/SpiceDownerAnimationTask.h"
 #include "SpiceDownerBuff.h"
 
 void SpiceBuffImplementation::deactivate(bool removeModifiers) {
@@ -18,8 +19,12 @@ void SpiceBuffImplementation::deactivate(bool removeModifiers) {
                uint32 crc = String("spice." + buffName + ".down").hashCode();
                ManagedReference<Buff*> downer = new SpiceDownerBuff(creature.get(), buffName, crc, 120);
                setDownerAttributes(creature.get(), downer);
-
                creature.get()->addBuff(downer);
+
+               // Puke now and every 15 seconds while debuff is active
+               creature.get()->doAnimation("heavy_cough_vomit");
+               Reference<Task*> downerAnimationTask = new SpiceDownerAnimationTask( creature.get(), crc);
+               creature.get()->addPendingTask("spice_downer_animation", downerAnimationTask, 15000);
        }
 }
 
diff --git a/MMOCoreORB/src/server/zone/objects/creature/events/SpiceDownerAnimationTask.h b/MMOCoreORB/src/server/zone/objects/creature/events/SpiceDownerAnimationTask.h
new file mode 100644 (file)
index 0000000..f5ba79a
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+Copyright (C) 2013 <SWGEmu>
+
+This File is part of Core3.
+
+This program is free software; you can redistribute
+it and/or modify it under the terms of the GNU Lesser
+General Public License as published by the Free Software
+Foundation; either version 2 of the License,
+or (at your option) any later version.
+
+This program 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 Lesser General Public License for
+more details.
+
+You should have received a copy of the GNU Lesser General
+Public License along with this program; if not, write to
+the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Linking Engine3 statically or dynamically with other modules
+is making a combined work based on Engine3.
+Thus, the terms and conditions of the GNU Lesser General Public License
+cover the whole combination.
+
+In addition, as a special exception, the copyright holders of Engine3
+give you permission to combine Engine3 program with free software
+programs or libraries that are released under the GNU LGPL and with
+code included in the standard release of Core3 under the GNU LGPL
+license (or modified versions of such code, with unchanged license).
+You may copy and distribute such a system following the terms of the
+GNU LGPL for Engine3 and the licenses of the other code concerned,
+provided that you include the source code of that other code when
+and as the GNU LGPL requires distribution of source code.
+
+Note that people who make modified versions of Engine3 are not obligated
+to grant this special exception for their modified versions;
+it is their choice whether to do so. The GNU Lesser General Public License
+gives permission to release a modified version without this exception;
+this exception also makes it possible to release a modified version
+which carries forward this exception.
+*/
+
+#ifndef SPICEDOWNERANIMATIONTASK_H_
+#define SPICEDOWNERANIMATIONTASK_H_
+
+#include "server/zone/objects/creature/CreatureObject.h"
+
+namespace server {
+namespace zone {
+namespace objects {
+namespace creature {
+namespace events {
+
+class SpiceDownerAnimationTask : public Task {
+
+       ManagedReference<CreatureObject*> player;
+       uint32 debuffCRC;
+
+public:
+       SpiceDownerAnimationTask(CreatureObject* player, uint32 debuffCRC) : Task() {
+               this->player = player;
+               this->debuffCRC = debuffCRC;
+
+       }
+
+       void run() {
+
+               if( player == NULL )
+                       return;
+
+               Locker locker(player);
+
+               // If debuff is still active, perform animation and reschedule
+               if ( player->hasBuff(debuffCRC) ) {
+
+                       player->doAnimation("heavy_cough_vomit");
+                       reschedule( 15000 );
+
+               }
+       }
+};
+
+} // events
+} // creature
+} // objects
+} // zone
+} // server
+
+using namespace server::zone::objects::creature::events;
+
+#endif /*SPICEDOWNERANIMATIONTASK_H_*/