* 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
This commit is contained in:
Brian
2010-05-07 19:17:51 -06:00
parent 608855f0a0
commit 7957d06654
2 changed files with 17 additions and 0 deletions
+16
View File
@@ -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)
+1
View File
@@ -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