mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
Script/Commands: imported .instance get/setbossstate commands from TrinityCore
This commit is contained in:
@@ -446,3 +446,25 @@ void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= NULL*/, uint8
|
||||
|
||||
instance->SendToPlayers(&data);
|
||||
}
|
||||
|
||||
std::string InstanceScript::GetBossStateName(uint8 state)
|
||||
{
|
||||
// See enum EncounterState in InstanceScript.h
|
||||
switch (state)
|
||||
{
|
||||
case NOT_STARTED:
|
||||
return "NOT_STARTED";
|
||||
case IN_PROGRESS:
|
||||
return "IN_PROGRESS";
|
||||
case FAIL:
|
||||
return "FAIL";
|
||||
case DONE:
|
||||
return "DONE";
|
||||
case SPECIAL:
|
||||
return "SPECIAL";
|
||||
case TO_BE_DECIDED:
|
||||
return "TO_BE_DECIDED";
|
||||
default:
|
||||
return "INVALID";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,6 +197,7 @@ class InstanceScript : public ZoneScript
|
||||
|
||||
virtual bool SetBossState(uint32 id, EncounterState state);
|
||||
EncounterState GetBossState(uint32 id) const { return id < bosses.size() ? bosses[id].state : TO_BE_DECIDED; }
|
||||
static std::string GetBossStateName(uint8 state);
|
||||
BossBoundaryMap const* GetBossBoundary(uint32 id) const { return id < bosses.size() ? &bosses[id].boundary : NULL; }
|
||||
BossInfo const* GetBossInfo(uint32 id) const { return &bosses[id]; }
|
||||
|
||||
@@ -216,6 +217,8 @@ class InstanceScript : public ZoneScript
|
||||
|
||||
virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
|
||||
|
||||
uint32 GetEncounterCount() const { return bosses.size(); }
|
||||
|
||||
protected:
|
||||
void SetBossNumber(uint32 number) { bosses.resize(number); }
|
||||
void LoadDoorData(DoorData const* data);
|
||||
|
||||
Reference in New Issue
Block a user