Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SL: Rework Murmur Intro RP #710

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ enum
enum MurmurActions
{
MURMUR_ACTION_MAX,
MURMUR_OOC_RP_ATTACK,
MURMUR_OOC_CASTER_ATTACK
MURMUR_OOC_RP_ATTACK
};

struct boss_murmurAI : public CombatAI
Expand All @@ -58,15 +57,11 @@ struct boss_murmurAI : public CombatAI
m_instance(static_cast<ScriptedInstance*>(creature->GetInstanceData())), m_bIsRegularMode(creature->GetMap()->IsRegularDifficulty())
{
AddCustomAction(MURMUR_OOC_RP_ATTACK, true, [&]() { HandleOocAttack(); }, TIMER_COMBAT_OOC);
AddCustomAction(MURMUR_OOC_CASTER_ATTACK, true, [&]() { HandleOocCasterAttack(); }, TIMER_COMBAT_OOC);
}

ScriptedInstance* m_instance;
bool m_bIsRegularMode;

GuidVector spellbindersVector;
GuidVector summonersVector;

uint32 m_uiResonanceTimer;
uint32 m_uiThunderingStormTimer;

Expand All @@ -83,10 +78,7 @@ struct boss_murmurAI : public CombatAI
{
if (eventType == AI_EVENT_CUSTOM_A)
{
ResetTimer(MURMUR_OOC_CASTER_ATTACK, urand(8000, 10000));
ResetTimer(MURMUR_OOC_RP_ATTACK, urand(8000, 10000));
m_instance->GetCreatureGuidVectorFromStorage(NPC_CABAL_SPELLBINDER, spellbindersVector);
m_instance->GetCreatureGuidVectorFromStorage(NPC_CABAL_SUMMONER, summonersVector);
}
}

Expand All @@ -98,30 +90,17 @@ struct boss_murmurAI : public CombatAI
// kill one that's moving
if (urand(0, 1))
{
GuidVector moversVector;
for (ObjectGuid& guid : spellbindersVector)
{
if (Creature* creature = m_creature->GetMap()->GetCreature(guid))
{
if (creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
moversVector.push_back(guid);
}
}
}
for (ObjectGuid& guid : summonersVector)
GuidVector m_WrathTargetGuid;
std::vector<Creature*> const* m_WrathTarget = m_creature->GetMap()->GetCreatures(MURMURS_WRATH_TARGETS_02);
if (m_WrathTarget)
{
if (Creature* creature = m_creature->GetMap()->GetCreature(guid))
{
if (creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
moversVector.push_back(guid);
}
}
for (Creature* creature : *m_WrathTarget)
m_WrathTargetGuid.push_back(creature->GetObjectGuid());
}
if (moversVector.size() > 0)

if (m_WrathTargetGuid.size() > 0)
{
if (ObjectGuid& guid = moversVector[urand(0, moversVector.size() - 1)])
if (ObjectGuid& guid = m_WrathTargetGuid[urand(0, m_WrathTargetGuid.size() - 1)])
{
if (Creature* creature = m_creature->GetMap()->GetCreature(guid))
{
Expand All @@ -137,29 +116,6 @@ struct boss_murmurAI : public CombatAI
ResetTimer(MURMUR_OOC_RP_ATTACK, 3000);
}

void HandleOocCasterAttack()
{
if (m_creature->IsInCombat())
return;

for (ObjectGuid& guid : spellbindersVector)
{
if (Creature* creature = m_creature->GetMap()->GetCreature(guid))
{
m_creature->AI()->SendAIEvent(AI_EVENT_CUSTOM_EVENTAI_A, m_creature, creature);
}
}
for (ObjectGuid& guid : summonersVector)
{
if (Creature* creature = m_creature->GetMap()->GetCreature(guid))
{
m_creature->AI()->SendAIEvent(AI_EVENT_CUSTOM_EVENTAI_A, m_creature, creature);
}
}

ResetTimer(MURMUR_OOC_CASTER_ATTACK, urand(3000, 8000));
}

void OnSpellCast(SpellEntry const* spellInfo, Unit* /*target*/) override
{
if (spellInfo->Id == SPELL_SONIC_BOOM || spellInfo->Id == SPELL_SONIC_BOOM_H)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,20 @@ void instance_shadow_labyrinth::OnCreatureRespawn(Creature* creature)
}
}

// The Screaming Hall
// All Worldstates get Activated via database when door opens
void instance_shadow_labyrinth::OnCreatureGroupDespawn(CreatureGroup* group, Creature* /*pCreature*/)
{
if (group->GetGroupId() == SL_SPAWN_GROUP_043)
instance->GetVariableManager().SetVariable(WORLD_STATE_SHADOW_LAB_GROUP_49, 1);

if (group->GetGroupId() == SL_SPAWN_GROUP_044)
instance->GetVariableManager().SetVariable(WORLD_STATE_SHADOW_LAB_GROUP_50, 1);

if (group->GetGroupId() == SL_SPAWN_GROUP_045)
instance->GetVariableManager().SetVariable(WORLD_STATE_SHADOW_LAB_GROUP_51, 1);
}

void instance_shadow_labyrinth::Load(const char* chrIn)
{
if (!chrIn)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ enum

SPELL_BANISH = 30231, // spell is handled in creature_template_addon;
SPELL_SHAPE_OF_BEAST = 33949,

SL_SPAWN_GROUP_043 = 5550064, // SpawnGroup that stops respawning of first runner
SL_SPAWN_GROUP_044 = 5550065, // SpawnGroup that stops respawning of 2nd runner
SL_SPAWN_GROUP_045 = 5550066, // SpawnGroup that stops respawning of third and fourth runner
};

const std::string MURMURS_WRATH_TARGETS_02 = "SL_MURMUR_WRATH_TARGET_02";

class instance_shadow_labyrinth : public ScriptedInstance
{
public:
Expand All @@ -47,6 +53,8 @@ class instance_shadow_labyrinth : public ScriptedInstance
void OnCreatureDeath(Creature* pCreature) override;
void OnCreatureRespawn(Creature* creature) override;

void OnCreatureGroupDespawn(CreatureGroup* pGroup, Creature* pCreature) override;

void SetData(uint32 uiType, uint32 uiData) override;
uint32 GetData(uint32 uiType) const override;

Expand Down
7 changes: 7 additions & 0 deletions src/game/World/WorldStateDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,13 @@ enum WorldStateID : int32
WORLD_STATE_SHADOW_LAB_GROUP_40 = 5550011, // 2 Possible group versions
WORLD_STATE_SHADOW_LAB_GROUP_41 = 5550012, // 2 Possible group versions
WORLD_STATE_SHADOW_LAB_GROUP_42 = 5550013, // 2 Possible group versions
// The Screaming Hall
// Worldstates that handle the respawn of runners between the groups in Murmur room
// Activated via database when door opens, deactivated when spawn_group died
WORLD_STATE_SHADOW_LAB_GROUP_48 = 5550014, // 2 Runners that instantly die after reaching last waypoint
WORLD_STATE_SHADOW_LAB_GROUP_49 = 5550015, // First runner
WORLD_STATE_SHADOW_LAB_GROUP_50 = 5550016, // 2nd runner
WORLD_STATE_SHADOW_LAB_GROUP_51 = 5550017, // 3rd and 4th runner

// Sethekk Halls
WORLD_STATE_SETHEKK_GROUP_12 = 5560001, // 2 Possible group versions
Expand Down