diff --git a/src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/world_eastern_kingdoms.cpp b/src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/world_eastern_kingdoms.cpp index d333294b87..436cfa8260 100644 --- a/src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/world_eastern_kingdoms.cpp +++ b/src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/world_eastern_kingdoms.cpp @@ -157,6 +157,21 @@ struct world_map_eastern_kingdoms : public ScriptedMap, public TimerManager void Initialize() override { m_shadeData.Reset(); + instance->GetVariableManager().SetVariable(WORLD_STATE_CUSTOM_STV_GRP_01, urand(0, 1)); + instance->GetVariableManager().SetVariable(WORLD_STATE_CUSTOM_STV_GRP_02, urand(0, 1)); + } + + void OnCreatureGroupDespawn(CreatureGroup* creatureGroup, Creature* /*creature*/) override + { + switch (creatureGroup->GetGroupEntry().WorldStateCondition) + { + case 9900: case 9901: // TODO: Propagate respawn info so they do not instant respawn + instance->GetVariableManager().SetVariable(WORLD_STATE_CUSTOM_STV_GRP_01, urand(0, 1)); + break; + case 9902: case 9903: + instance->GetVariableManager().SetVariable(WORLD_STATE_CUSTOM_STV_GRP_02, urand(0, 1)); + break; + } } bool CheckConditionCriteriaMeet(Player const* player, uint32 instanceConditionId, WorldObject const* conditionSource, uint32 conditionSourceType) const override diff --git a/src/game/World/WorldStateDefines.h b/src/game/World/WorldStateDefines.h index 72187e51b3..bd77279102 100644 --- a/src/game/World/WorldStateDefines.h +++ b/src/game/World/WorldStateDefines.h @@ -340,6 +340,9 @@ enum WorldStateID : int32 // Vanilla WORLD_STATE_CUSTOM_SPAWN_ANNORA = 700001, + WORLD_STATE_CUSTOM_STV_GRP_01 = 330001, + WORLD_STATE_CUSTOM_STV_GRP_02 = 330002, + // Tbc WORLD_STATE_CUSTOM_SPAWN_MALACRASS = 5680001,