Skip to content

Commit

Permalink
STV: Add support for randomized spawn groups prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Jan 13, 2024
1 parent 696229d commit b9cd872
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/game/World/WorldStateDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,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,

Expand Down

0 comments on commit b9cd872

Please sign in to comment.