aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <runningnak3d@gmail.com>2010-05-07 19:17:51 -0600
committerBrian <runningnak3d@gmail.com>2010-05-07 19:17:51 -0600
commit7957d066543a995e425834aa8760c7411b935f04 (patch)
tree8eb72dc7d8373ee33064b0ef8420e84097ce961c
parent608855f0a08a9b9ebc43314cc8850e182e9121d2 (diff)
* Add SCRIPT_COMMAND_CLOSE_GOSSIP that can be used in gossip_scripts to force
* the gossip window to close when a given menu option is chosen. * This is with all my love -- for Malcrom :P --HG-- branch : trunk
-rw-r--r--src/game/Map.cpp16
-rw-r--r--src/game/World.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 0409da43449..712ab099198 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -39,6 +39,7 @@
#include "WaypointManager.h"
#include "DBCEnums.h"
#include "ScriptMgr.h"
+#include "GossipDef.h"
#include "MapInstanced.h"
#include "InstanceSaveMgr.h"
@@ -3726,6 +3727,21 @@ void Map::ScriptsProcess()
break;
}
+ case SCRIPT_COMMAND_CLOSE_GOSSIP:
+ {
+/*
+ * need to find a good way to do idiot checking here
+ * No one should be using this script command in any scripts tables except
+ * gossip, but I guess someone could fat finger it.
+ if (!source->ToPlayer()->GetPlayer()->GetNPCIfCanInteractWith(target,UNIT_NPC_FLAG_GOSSIP));
+ {
+ sLog.outError("SCRIPT_COMMAND_CLOSE_GOSSIP attempted to be used in a non-gossip case -- IGNORED!");
+ break;
+ }
+*/
+ source->ToPlayer()->PlayerTalkClass->CloseGossip();
+ break;
+ }
case SCRIPT_COMMAND_PLAYMOVIE:
{
if (!source)
diff --git a/src/game/World.h b/src/game/World.h
index d56481f0161..4ff574b42a9 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -444,6 +444,7 @@ enum WorldStates
#define SCRIPT_COMMAND_ORIENTATION 30 // o = orientation
#define SCRIPT_COMMAND_EQUIP 31 // datalong = equipment id
#define SCRIPT_COMMAND_MODEL 32 // datalong = model id
+#define SCRIPT_COMMAND_CLOSE_GOSSIP 33 // close gossip window -- no values
#define SCRIPT_COMMAND_PLAYMOVIE 34 // datalong = movie id
/// Storage class for commands issued for delayed execution