mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-04 19:43:48 +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;
|
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.
|
// Character name must be provided when using this from console.
|
||||||
if (!player && !handler->GetSession())
|
if (!player && !handler->GetSession())
|
||||||
@@ -237,15 +237,13 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encounterId > map->GetInstanceScript()->GetEncounterCount())
|
for (uint8 i = 0; i < map->GetInstanceScript()->GetEncounterCount(); ++i)
|
||||||
{
|
{
|
||||||
handler->SendErrorMessage(LANG_BAD_VALUE);
|
uint32 state = map->GetInstanceScript()->GetBossState(i);
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user