Core/Commands: added .debug areatriggers
-if turned on it will print the trigger id to chat if you get near it --HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `command` WHERE `name` IN ('debug areatriggers');
|
||||
INSERT INTO `command` (`name`,`security`,`help`) VALUES
|
||||
('debug areatriggers',1,'Syntax: .debug areatriggers\nToggle debug mode for areatriggers. In debug mode GM will be notified if reaching an areatrigger');
|
||||
@@ -0,0 +1,5 @@
|
||||
DELETE FROM `trinity_string` WHERE `entry` IN (1202,1203,1204);
|
||||
INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
|
||||
(1202, 'Areatrigger debugging turned on.'),
|
||||
(1203, 'Areatrigger debugging turned off.'),
|
||||
(1204, 'You have reached areatrigger %u.');
|
||||
@@ -205,6 +205,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "uws", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateWorldStateCommand, "", NULL },
|
||||
{ "update", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateCommand, "", NULL },
|
||||
{ "itemexpire", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugItemExpireCommand, "", NULL },
|
||||
{ "areatriggers", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugAreaTriggers, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
|
||||
@@ -171,6 +171,7 @@ class ChatHandler
|
||||
bool HandleDebugSpellCheckCommand(const char* args);
|
||||
bool HandleDebugUpdateCommand(const char* args);
|
||||
bool HandleDebugUpdateWorldStateCommand(const char* args);
|
||||
bool HandleDebugAreaTriggers(const char* args);
|
||||
|
||||
bool HandleDebugSet32Bit(const char* args);
|
||||
bool HandleDebugThreatList(const char * args);
|
||||
|
||||
@@ -271,6 +271,20 @@ bool ChatHandler::HandleDebugUpdateWorldStateCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleDebugAreaTriggers(const char* args)
|
||||
{
|
||||
Player* plr = m_session->GetPlayer();
|
||||
if (!plr->isDebugAreaTriggers)
|
||||
{
|
||||
PSendSysMessage(LANG_DEBUG_AREATRIGGER_ON);
|
||||
plr->isDebugAreaTriggers = true;
|
||||
} else {
|
||||
PSendSysMessage(LANG_DEBUG_AREATRIGGER_OFF);
|
||||
plr->isDebugAreaTriggers = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleDebugPlayCinematicCommand(const char* args)
|
||||
{
|
||||
// USAGE: .debug play cinematic #cinematicid
|
||||
|
||||
@@ -615,6 +615,8 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
||||
m_globalCooldowns.clear();
|
||||
|
||||
m_ConditionErrorMsgId = 0;
|
||||
|
||||
isDebugAreaTriggers = false;
|
||||
}
|
||||
|
||||
Player::~Player ()
|
||||
|
||||
@@ -2381,6 +2381,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
Spell * m_spellModTakingSpell;
|
||||
|
||||
float GetAverageItemLevel();
|
||||
bool isDebugAreaTriggers;
|
||||
|
||||
protected:
|
||||
uint32 m_AreaID;
|
||||
|
||||
@@ -802,7 +802,10 @@ enum TrinityStrings
|
||||
// Debug commands
|
||||
LANG_CINEMATIC_NOT_EXIST = 1200,
|
||||
LANG_MOVIE_NOT_EXIST = 1201,
|
||||
// Room for more debug 1202-1299 not used
|
||||
LANG_DEBUG_AREATRIGGER_ON = 1202,
|
||||
LANG_DEBUG_AREATRIGGER_OFF = 1203,
|
||||
LANG_DEBUG_AREATRIGGER_REACHED = 1204,
|
||||
// Room for more debug 1205-1299 not used
|
||||
|
||||
// FREE IDS 1300-9999
|
||||
|
||||
|
||||
@@ -882,6 +882,9 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
}
|
||||
|
||||
if (GetPlayer()->isDebugAreaTriggers)
|
||||
ChatHandler(GetPlayer()).PSendSysMessage(LANG_DEBUG_AREATRIGGER_REACHED, Trigger_ID);
|
||||
|
||||
if (sScriptMgr.OnAreaTrigger(GetPlayer(), atEntry))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user