[8083] New debug command: .debug setaurastate for test target/caster aura states. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
@@ -160,6 +160,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "Mod32Value", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugMod32Value, "", NULL },
|
||||
{ "play", SEC_MODERATOR, false, NULL, "", debugPlayCommandTable },
|
||||
{ "send", SEC_ADMINISTRATOR, false, NULL, "", debugSendCommandTable },
|
||||
{ "setaurastate", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetAuraStateCommand, "", NULL },
|
||||
{ "setitemflag", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetItemFlagCommand, "", NULL },
|
||||
{ "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetValue, "", NULL },
|
||||
{ "spawnvehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpawnVehicle, "", NULL },
|
||||
|
||||
+2
-1
@@ -142,9 +142,10 @@ class ChatHandler
|
||||
bool HandleDebugGetLootRecipient(const char * args);
|
||||
bool HandleDebugGetValue(const char* args);
|
||||
bool HandleDebugMod32Value(const char* args);
|
||||
bool HandleDebugSetValue(const char* args);
|
||||
bool HandleDebugSetAuraStateCommand(const char * args);
|
||||
bool HandleDebugSetItemFlagCommand(const char * args);
|
||||
bool HandleDebugSetVehicleId(const char * args);
|
||||
bool HandleDebugSetValue(const char* args);
|
||||
bool HandleDebugSpawnVehicle(const char * args);
|
||||
bool HandleDebugEnterVehicle(const char * args);
|
||||
bool HandleDebugUpdate(const char* args);
|
||||
|
||||
+43
-13
@@ -39,7 +39,7 @@
|
||||
|
||||
bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args)
|
||||
{
|
||||
if(!args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char* px = strtok((char*)args, " ");
|
||||
@@ -72,6 +72,9 @@ bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleDebugSendPoiCommand(const char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player *pPlayer = m_session->GetPlayer();
|
||||
Unit* target = getSelectedUnit();
|
||||
if (!target)
|
||||
@@ -80,9 +83,6 @@ bool ChatHandler::HandleDebugSendPoiCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!args)
|
||||
return false;
|
||||
|
||||
char* icon_text = strtok((char*)args, " ");
|
||||
char* flags_text = strtok(NULL, " ");
|
||||
if (!icon_text || !flags_text)
|
||||
@@ -98,7 +98,7 @@ bool ChatHandler::HandleDebugSendPoiCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleDebugSendEquipErrorCommand(const char* args)
|
||||
{
|
||||
if(!args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint8 msg = atoi(args);
|
||||
@@ -108,7 +108,7 @@ bool ChatHandler::HandleDebugSendEquipErrorCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleDebugSendSellErrorCommand(const char* args)
|
||||
{
|
||||
if(!args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint8 msg = atoi(args);
|
||||
@@ -118,7 +118,7 @@ bool ChatHandler::HandleDebugSendSellErrorCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleDebugSendBuyErrorCommand(const char* args)
|
||||
{
|
||||
if(!args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint8 msg = atoi(args);
|
||||
@@ -358,7 +358,7 @@ bool ChatHandler::HandleDebugPlaySoundCommand(const char* args)
|
||||
//Send notification in channel
|
||||
bool ChatHandler::HandleDebugSendChannelNotifyCommand(const char* args)
|
||||
{
|
||||
if(!args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
const char *name = "test";
|
||||
@@ -376,7 +376,7 @@ bool ChatHandler::HandleDebugSendChannelNotifyCommand(const char* args)
|
||||
//Send notification in chat
|
||||
bool ChatHandler::HandleDebugSendChatMsgCommand(const char* args)
|
||||
{
|
||||
if(!args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
const char *msg = "testtest";
|
||||
@@ -413,7 +413,7 @@ bool ChatHandler::HandleDebugSendQuestInvalidMsgCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleDebugGetItemState(const char* args)
|
||||
{
|
||||
if (!args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
std::string state_str = args;
|
||||
@@ -757,7 +757,7 @@ bool ChatHandler::HandleDebugEnterVehicle(const char * args)
|
||||
|
||||
bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
|
||||
{
|
||||
if(!args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char* e = strtok((char*)args, " ");
|
||||
@@ -812,7 +812,7 @@ bool ChatHandler::HandleDebugSendLargePacketCommand(const char* /*args*/)
|
||||
|
||||
bool ChatHandler::HandleDebugSendSetPhaseShiftCommand(const char* args)
|
||||
{
|
||||
if(!args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 PhaseShift = atoi(args);
|
||||
@@ -822,7 +822,7 @@ bool ChatHandler::HandleDebugSendSetPhaseShiftCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleDebugSetItemFlagCommand(const char* args)
|
||||
{
|
||||
if(!args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char* e = strtok((char*)args, " ");
|
||||
@@ -854,3 +854,33 @@ bool ChatHandler::HandleDebugAnimCommand(const char* args)
|
||||
m_session->GetPlayer()->HandleEmoteCommand(anim_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleDebugSetAuraStateCommand(const char* args)
|
||||
{
|
||||
if (!*args)
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Unit* unit = getSelectedUnit();
|
||||
if (!unit)
|
||||
{
|
||||
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 state = atoi((char*)args);
|
||||
if (!state)
|
||||
{
|
||||
// reset all states
|
||||
for(int i = 1; i <= 32; ++i)
|
||||
unit->ModifyAuraState(AuraState(i),false);
|
||||
return true;
|
||||
}
|
||||
|
||||
unit->ModifyAuraState(AuraState(abs(state)),state > 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user