Core/Commands: Added ".npc set phase" command error message for invalid phaseid

Closes #14927
This commit is contained in:
Vincent-Michael
2016-06-05 16:43:41 +02:00
parent 18aa8df320
commit 9d7a17d9f5
3 changed files with 13 additions and 4 deletions
@@ -0,0 +1,3 @@
DELETE FROM `trinity_string` WHERE `entry`=5007;
INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES
(5007,"Uses invalid phaseID.");
+1 -1
View File
@@ -1069,7 +1069,7 @@ enum TrinityStrings
LANG_COMMAND_NO_FROZEN_PLAYERS = 5004,
LANG_COMMAND_LIST_FREEZE = 5005,
LANG_COMMAND_PERMA_FROZEN_PLAYER = 5006,
// = 5007, unused
LANG_PHASE_NOTFOUND = 5007,
LANG_INSTANCE_CLOSED = 5008,
LANG_COMMAND_PLAYED_TO_ALL = 5009,
LANG_NPCINFO_LINKGUID = 5010,
+9 -3
View File
@@ -1106,7 +1106,13 @@ public:
if (!*args)
return false;
uint32 phase = (uint32) atoi((char*)args);
uint32 phaseID = uint32(atoi((char*)args));
if (!sPhaseStore.LookupEntry(phaseID))
{
handler->SendSysMessage(LANG_PHASE_NOTFOUND);
handler->SetSentErrorMessage(true);
return false;
}
Creature* creature = handler->getSelectedCreature();
if (!creature || creature->IsPet())
@@ -1117,8 +1123,8 @@ public:
}
creature->ClearPhases();
creature->SetInPhase(phase, true, true);
creature->SetDBPhase(phase);
creature->SetInPhase(phaseID, true, true);
creature->SetDBPhase(phaseID);
creature->SaveToDB();