Skip to content

Commit

Permalink
ShatteredHalls: add missing spell_script, fix typo and add db handlin…
Browse files Browse the repository at this point in the history
…g for legionnaire 6
  • Loading branch information
miraco authored and killerwife committed Jan 22, 2024
1 parent d9bf405 commit 41f79bb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(37431,'spell_lurker_spout_initial'),
(37429,'spell_lurker_spout_turning'),
(37430,'spell_lurker_spout_turning'),
(37437,'spell_clear_all_debuffs'),
(37851,'spell_tag_for_single_use'),
(37896,'spell_to_infinity_and_above'),
(38119,'spell_calling_rider'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void instance_shattered_halls::Initialize()
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
GauntletReset();
instance->GetVariableManager().SetVariable(WORLD_STATE_LEGIONNAIRE_002, 0);
instance->GetVariableManager().SetVariable(WORLD_STATE_LEGIONNAIRE_002, 0);
instance->GetVariableManager().SetVariable(WORLD_STATE_LEGIONNAIRE_003, 0);
}

void instance_shattered_halls::OnPlayerEnter(Player* pPlayer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ struct npc_shattered_hand_legionnaire : public CombatAI
{
DoBroadcastText(aRandomReinfSleeping[urand(0, 4)], m_creature);
closest->RemoveAurasDueToSpell(AURA_SLEEPING);
SendAIEvent(AI_EVENT_CUSTOM_EVENTAI_C, m_creature, closest);
}
}
else if (m_creature->HasStringId(SEVENTH_LEGIONNAIRE_STRING))
Expand Down Expand Up @@ -520,6 +521,23 @@ struct npc_shattered_hand_legionnaire : public CombatAI
}
};

// 37437 ClearAllDebuffs
struct ClearAllDebuffs : public SpellScript
{
void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override
{
Unit* target = spell->m_targets.getUnitTarget();
auto holderMap = target->GetSpellAuraHolderMap();
for (auto holderPair : holderMap)
{
if (!holderPair.second->IsPositive() && !holderPair.second->IsPassive())
{
target->RemoveAurasDueToSpell(holderPair.second->GetId());
}
}
return;
}
};

void AddSC_shattered_halls()
{
Expand All @@ -537,4 +555,6 @@ void AddSC_shattered_halls()
pNewScript->Name = "npc_shattered_hand_legionnaire";
pNewScript->GetAI = &GetNewAIInstance<npc_shattered_hand_legionnaire>;
pNewScript->RegisterSelf();

RegisterSpellScript<ClearAllDebuffs>("spell_clear_all_debuffs");
}

0 comments on commit 41f79bb

Please sign in to comment.