[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 },
|
{ "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 },
|
||||||
|
|||||||
+2
-1
@@ -142,9 +142,10 @@ 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 HandleDebugSetVehicleId(const char * args);
|
bool HandleDebugSetVehicleId(const char * args);
|
||||||
|
bool HandleDebugSetValue(const char* args);
|
||||||
bool HandleDebugSpawnVehicle(const char * args);
|
bool HandleDebugSpawnVehicle(const char * args);
|
||||||
bool HandleDebugEnterVehicle(const char * args);
|
bool HandleDebugEnterVehicle(const char * args);
|
||||||
bool HandleDebugUpdate(const char* args);
|
bool HandleDebugUpdate(const char* args);
|
||||||
|
|||||||
+59
-29
@@ -39,7 +39,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, " ");
|
||||||
@@ -47,7 +47,7 @@ bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint8 failnum = (uint8)atoi(px);
|
uint8 failnum = (uint8)atoi(px);
|
||||||
if(failnum==0 && *px!='0')
|
if (failnum==0 && *px!='0')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char* p1 = strtok(NULL, " ");
|
char* p1 = strtok(NULL, " ");
|
||||||
@@ -72,20 +72,20 @@ 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)
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||||
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)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 icon = atol(icon_text);
|
uint32 icon = atol(icon_text);
|
||||||
@@ -98,7 +98,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);
|
||||||
@@ -108,7 +108,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);
|
||||||
@@ -118,7 +118,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);
|
||||||
@@ -137,7 +137,7 @@ bool ChatHandler::HandleDebugSendOpcodeCommand(const char* /*args*/)
|
|||||||
if(!unit) unit = player;
|
if(!unit) unit = player;
|
||||||
|
|
||||||
std::ifstream ifs("opcode.txt");
|
std::ifstream ifs("opcode.txt");
|
||||||
if(ifs.bad())
|
if (ifs.bad())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 opcode;
|
uint32 opcode;
|
||||||
@@ -273,7 +273,7 @@ bool ChatHandler::HandleDebugPlayCinematicCommand(const char* args)
|
|||||||
{
|
{
|
||||||
// USAGE: .debug play cinematic #cinematicid
|
// USAGE: .debug play cinematic #cinematicid
|
||||||
// #cinematicid - ID decimal number from CinemaicSequences.dbc (1st column)
|
// #cinematicid - ID decimal number from CinemaicSequences.dbc (1st column)
|
||||||
if( !*args )
|
if (!*args)
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_BAD_VALUE);
|
SendSysMessage(LANG_BAD_VALUE);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
@@ -282,7 +282,7 @@ bool ChatHandler::HandleDebugPlayCinematicCommand(const char* args)
|
|||||||
|
|
||||||
uint32 dwId = atoi((char*)args);
|
uint32 dwId = atoi((char*)args);
|
||||||
|
|
||||||
if(!sCinematicSequencesStore.LookupEntry(dwId))
|
if (!sCinematicSequencesStore.LookupEntry(dwId))
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, dwId);
|
PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, dwId);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
@@ -297,7 +297,7 @@ bool ChatHandler::HandleDebugPlayMovieCommand(const char* args)
|
|||||||
{
|
{
|
||||||
// USAGE: .debug play movie #movieid
|
// USAGE: .debug play movie #movieid
|
||||||
// #movieid - ID decimal number from Movie.dbc (1st column)
|
// #movieid - ID decimal number from Movie.dbc (1st column)
|
||||||
if( !*args )
|
if (!*args)
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_BAD_VALUE);
|
SendSysMessage(LANG_BAD_VALUE);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
@@ -306,7 +306,7 @@ bool ChatHandler::HandleDebugPlayMovieCommand(const char* args)
|
|||||||
|
|
||||||
uint32 dwId = atoi((char*)args);
|
uint32 dwId = atoi((char*)args);
|
||||||
|
|
||||||
if(!sMovieStore.LookupEntry(dwId))
|
if (!sMovieStore.LookupEntry(dwId))
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_MOVIE_NOT_EXIST, dwId);
|
PSendSysMessage(LANG_MOVIE_NOT_EXIST, dwId);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
@@ -322,7 +322,7 @@ bool ChatHandler::HandleDebugPlaySoundCommand(const char* args)
|
|||||||
{
|
{
|
||||||
// USAGE: .debug playsound #soundid
|
// USAGE: .debug playsound #soundid
|
||||||
// #soundid - ID decimal number from SoundEntries.dbc (1st column)
|
// #soundid - ID decimal number from SoundEntries.dbc (1st column)
|
||||||
if( !*args )
|
if (!*args)
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_BAD_VALUE);
|
SendSysMessage(LANG_BAD_VALUE);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
@@ -331,7 +331,7 @@ bool ChatHandler::HandleDebugPlaySoundCommand(const char* args)
|
|||||||
|
|
||||||
uint32 dwSoundId = atoi((char*)args);
|
uint32 dwSoundId = atoi((char*)args);
|
||||||
|
|
||||||
if(!sSoundEntriesStore.LookupEntry(dwSoundId))
|
if (!sSoundEntriesStore.LookupEntry(dwSoundId))
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_SOUND_NOT_EXIST, dwSoundId);
|
PSendSysMessage(LANG_SOUND_NOT_EXIST, dwSoundId);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
@@ -339,14 +339,14 @@ bool ChatHandler::HandleDebugPlaySoundCommand(const char* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Unit* unit = getSelectedUnit();
|
Unit* unit = getSelectedUnit();
|
||||||
if(!unit)
|
if (!unit)
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_session->GetPlayer()->GetSelection())
|
if (m_session->GetPlayer()->GetSelection())
|
||||||
unit->PlayDistanceSound(dwSoundId,m_session->GetPlayer());
|
unit->PlayDistanceSound(dwSoundId,m_session->GetPlayer());
|
||||||
else
|
else
|
||||||
unit->PlayDirectSound(dwSoundId,m_session->GetPlayer());
|
unit->PlayDirectSound(dwSoundId,m_session->GetPlayer());
|
||||||
@@ -358,7 +358,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";
|
||||||
@@ -376,7 +376,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";
|
||||||
@@ -397,7 +397,7 @@ bool ChatHandler::HandleDebugSendQuestPartyMsgCommand(const char* args)
|
|||||||
bool ChatHandler::HandleDebugGetLootRecipient(const char* /*args*/)
|
bool ChatHandler::HandleDebugGetLootRecipient(const char* /*args*/)
|
||||||
{
|
{
|
||||||
Creature* target = getSelectedCreature();
|
Creature* target = getSelectedCreature();
|
||||||
if(!target)
|
if (!target)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PSendSysMessage("loot recipient: %s", target->hasLootRecipient()?(target->GetLootRecipient()?target->GetLootRecipient()->GetName():"offline"):"no loot recipient");
|
PSendSysMessage("loot recipient: %s", target->hasLootRecipient()?(target->GetLootRecipient()?target->GetLootRecipient()->GetName():"offline"):"no loot recipient");
|
||||||
@@ -413,7 +413,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;
|
||||||
@@ -757,7 +757,7 @@ bool ChatHandler::HandleDebugEnterVehicle(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, " ");
|
||||||
@@ -778,12 +778,12 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
|
|||||||
|
|
||||||
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
|
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
|
||||||
|
|
||||||
if(!ci)
|
if (!ci)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
VehicleEntry const *ve = sVehicleStore.LookupEntry(id);
|
VehicleEntry const *ve = sVehicleStore.LookupEntry(id);
|
||||||
|
|
||||||
if(!ve)
|
if (!ve)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Vehicle *v = new Vehicle;
|
Vehicle *v = new Vehicle;
|
||||||
@@ -812,7 +812,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);
|
||||||
@@ -822,7 +822,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, " ");
|
||||||
@@ -836,7 +836,7 @@ bool ChatHandler::HandleDebugSetItemFlagCommand(const char* args)
|
|||||||
|
|
||||||
Item *i = m_session->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM));
|
Item *i = m_session->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM));
|
||||||
|
|
||||||
if(!i)
|
if (!i)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
i->SetUInt32Value(ITEM_FIELD_FLAGS, flag);
|
i->SetUInt32Value(ITEM_FIELD_FLAGS, flag);
|
||||||
@@ -854,3 +854,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;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user