mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
feat(Scripts/Commands): Update GetBossState to display all states (#21134)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
--
|
||||
UPDATE `command` SET `help` = 'Syntax: .instance getbossstate [$Name]\nDisplays the state for every available encounter.\nIf no character name is provided, the current map will be used as target.' WHERE `name` = 'instance getbossstate';
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleInstanceGetBossStateCommand(ChatHandler* handler, uint32 encounterId, Optional<PlayerIdentifier> player)
|
||||
static bool HandleInstanceGetBossStateCommand(ChatHandler* handler, Optional<PlayerIdentifier> player)
|
||||
{
|
||||
// Character name must be provided when using this from console.
|
||||
if (!player && !handler->GetSession())
|
||||
@@ -237,15 +237,13 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (encounterId > map->GetInstanceScript()->GetEncounterCount())
|
||||
for (uint8 i = 0; i < map->GetInstanceScript()->GetEncounterCount(); ++i)
|
||||
{
|
||||
handler->SendErrorMessage(LANG_BAD_VALUE);
|
||||
return false;
|
||||
uint32 state = map->GetInstanceScript()->GetBossState(i);
|
||||
std::string stateName = InstanceScript::GetBossStateName(state);
|
||||
handler->PSendSysMessage(LANG_COMMAND_INST_GET_BOSS_STATE, i, state, stateName);
|
||||
}
|
||||
|
||||
uint32 state = map->GetInstanceScript()->GetBossState(encounterId);
|
||||
std::string stateName = InstanceScript::GetBossStateName(state);
|
||||
handler->PSendSysMessage(LANG_COMMAND_INST_GET_BOSS_STATE, encounterId, state, stateName);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user