mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8083] New debug command: .debug setaurastate for test target/caster aura states.
Also fix wrong (!args) checks in debug commands.
This commit is contained in:
parent
df064ebd9f
commit
97721109ff
4 changed files with 65 additions and 33 deletions
|
|
@ -154,6 +154,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||||
{ "Mod32Value", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugMod32Value, "", NULL },
|
{ "Mod32Value", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugMod32Value, "", NULL },
|
||||||
{ "play", SEC_MODERATOR, false, NULL, "", debugPlayCommandTable },
|
{ "play", SEC_MODERATOR, false, NULL, "", debugPlayCommandTable },
|
||||||
{ "send", SEC_ADMINISTRATOR, false, NULL, "", debugSendCommandTable },
|
{ "send", SEC_ADMINISTRATOR, false, NULL, "", debugSendCommandTable },
|
||||||
|
{ "setaurastate", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetAuraStateCommand, "", NULL },
|
||||||
{ "setitemflag", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetItemFlagCommand, "", NULL },
|
{ "setitemflag", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetItemFlagCommand, "", NULL },
|
||||||
{ "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetValue, "", NULL },
|
{ "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetValue, "", NULL },
|
||||||
{ "spawnvehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpawnVehicle, "", NULL },
|
{ "spawnvehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpawnVehicle, "", NULL },
|
||||||
|
|
|
||||||
|
|
@ -132,8 +132,9 @@ class ChatHandler
|
||||||
bool HandleDebugGetLootRecipient(const char * args);
|
bool HandleDebugGetLootRecipient(const char * args);
|
||||||
bool HandleDebugGetValue(const char* args);
|
bool HandleDebugGetValue(const char* args);
|
||||||
bool HandleDebugMod32Value(const char* args);
|
bool HandleDebugMod32Value(const char* args);
|
||||||
bool HandleDebugSetValue(const char* args);
|
bool HandleDebugSetAuraStateCommand(const char * args);
|
||||||
bool HandleDebugSetItemFlagCommand(const char * args);
|
bool HandleDebugSetItemFlagCommand(const char * args);
|
||||||
|
bool HandleDebugSetValue(const char* args);
|
||||||
bool HandleDebugSpawnVehicle(const char * args);
|
bool HandleDebugSpawnVehicle(const char * args);
|
||||||
bool HandleDebugUpdate(const char* args);
|
bool HandleDebugUpdate(const char* args);
|
||||||
bool HandleDebugUpdateWorldStateCommand(const char* args);
|
bool HandleDebugUpdateWorldStateCommand(const char* args);
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args)
|
bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args)
|
||||||
{
|
{
|
||||||
if(!args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char* px = strtok((char*)args, " ");
|
char* px = strtok((char*)args, " ");
|
||||||
|
|
@ -66,6 +66,9 @@ bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args)
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugSendPoiCommand(const char* args)
|
bool ChatHandler::HandleDebugSendPoiCommand(const char* args)
|
||||||
{
|
{
|
||||||
|
if (!*args)
|
||||||
|
return false;
|
||||||
|
|
||||||
Player *pPlayer = m_session->GetPlayer();
|
Player *pPlayer = m_session->GetPlayer();
|
||||||
Unit* target = getSelectedUnit();
|
Unit* target = getSelectedUnit();
|
||||||
if (!target)
|
if (!target)
|
||||||
|
|
@ -74,9 +77,6 @@ bool ChatHandler::HandleDebugSendPoiCommand(const char* args)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!args)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
char* icon_text = strtok((char*)args, " ");
|
char* icon_text = strtok((char*)args, " ");
|
||||||
char* flags_text = strtok(NULL, " ");
|
char* flags_text = strtok(NULL, " ");
|
||||||
if (!icon_text || !flags_text)
|
if (!icon_text || !flags_text)
|
||||||
|
|
@ -92,7 +92,7 @@ bool ChatHandler::HandleDebugSendPoiCommand(const char* args)
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugSendEquipErrorCommand(const char* args)
|
bool ChatHandler::HandleDebugSendEquipErrorCommand(const char* args)
|
||||||
{
|
{
|
||||||
if(!args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint8 msg = atoi(args);
|
uint8 msg = atoi(args);
|
||||||
|
|
@ -102,7 +102,7 @@ bool ChatHandler::HandleDebugSendEquipErrorCommand(const char* args)
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugSendSellErrorCommand(const char* args)
|
bool ChatHandler::HandleDebugSendSellErrorCommand(const char* args)
|
||||||
{
|
{
|
||||||
if(!args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint8 msg = atoi(args);
|
uint8 msg = atoi(args);
|
||||||
|
|
@ -112,7 +112,7 @@ bool ChatHandler::HandleDebugSendSellErrorCommand(const char* args)
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugSendBuyErrorCommand(const char* args)
|
bool ChatHandler::HandleDebugSendBuyErrorCommand(const char* args)
|
||||||
{
|
{
|
||||||
if(!args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint8 msg = atoi(args);
|
uint8 msg = atoi(args);
|
||||||
|
|
@ -300,7 +300,7 @@ bool ChatHandler::HandleDebugPlaySoundCommand(const char* args)
|
||||||
//Send notification in channel
|
//Send notification in channel
|
||||||
bool ChatHandler::HandleDebugSendChannelNotifyCommand(const char* args)
|
bool ChatHandler::HandleDebugSendChannelNotifyCommand(const char* args)
|
||||||
{
|
{
|
||||||
if(!args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const char *name = "test";
|
const char *name = "test";
|
||||||
|
|
@ -318,7 +318,7 @@ bool ChatHandler::HandleDebugSendChannelNotifyCommand(const char* args)
|
||||||
//Send notification in chat
|
//Send notification in chat
|
||||||
bool ChatHandler::HandleDebugSendChatMsgCommand(const char* args)
|
bool ChatHandler::HandleDebugSendChatMsgCommand(const char* args)
|
||||||
{
|
{
|
||||||
if(!args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const char *msg = "testtest";
|
const char *msg = "testtest";
|
||||||
|
|
@ -355,7 +355,7 @@ bool ChatHandler::HandleDebugSendQuestInvalidMsgCommand(const char* args)
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugGetItemState(const char* args)
|
bool ChatHandler::HandleDebugGetItemState(const char* args)
|
||||||
{
|
{
|
||||||
if (!args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::string state_str = args;
|
std::string state_str = args;
|
||||||
|
|
@ -601,7 +601,7 @@ bool ChatHandler::HandleDebugArenaCommand(const char * /*args*/)
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
|
bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
|
||||||
{
|
{
|
||||||
if(!args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char* e = strtok((char*)args, " ");
|
char* e = strtok((char*)args, " ");
|
||||||
|
|
@ -661,7 +661,7 @@ bool ChatHandler::HandleDebugSendLargePacketCommand(const char* /*args*/)
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugSendSetPhaseShiftCommand(const char* args)
|
bool ChatHandler::HandleDebugSendSetPhaseShiftCommand(const char* args)
|
||||||
{
|
{
|
||||||
if(!args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 PhaseShift = atoi(args);
|
uint32 PhaseShift = atoi(args);
|
||||||
|
|
@ -671,7 +671,7 @@ bool ChatHandler::HandleDebugSendSetPhaseShiftCommand(const char* args)
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugSetItemFlagCommand(const char* args)
|
bool ChatHandler::HandleDebugSetItemFlagCommand(const char* args)
|
||||||
{
|
{
|
||||||
if(!args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char* e = strtok((char*)args, " ");
|
char* e = strtok((char*)args, " ");
|
||||||
|
|
@ -703,3 +703,33 @@ bool ChatHandler::HandleDebugAnimCommand(const char* args)
|
||||||
m_session->GetPlayer()->HandleEmoteCommand(anim_id);
|
m_session->GetPlayer()->HandleEmoteCommand(anim_id);
|
||||||
return true;
|
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;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8082"
|
#define REVISION_NR "8083"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue