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

Fix(black temple) gathios the shatterer shouldnt use hammer of justice on random players #19653

28 changes: 7 additions & 21 deletions src/server/scripts/Outland/BlackTemple/illidari_council.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,6 @@ enum Misc
EVENT_KILL_TALK = 100
};

struct HammerOfJusticeSelector
{
public:
HammerOfJusticeSelector(Unit* me) : _me(me) { }

bool operator()(Unit const* target) const
{
return target && target->GetTypeId() == TYPEID_PLAYER && _me->IsInRange(target, 10.0f, 40.0f, true);
}

private:
Unit const* _me;
};

class VerasEnvenom : public BasicEvent
{
public:
Expand Down Expand Up @@ -337,12 +323,13 @@ class boss_gathios_the_shatterer : public CreatureScript
events.ScheduleEvent(EVENT_SPELL_AURA, 30000);
break;
case EVENT_SPELL_HAMMER_OF_JUSTICE:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, HammerOfJusticeSelector(me)))
{
me->CastSpell(target, SPELL_HAMMER_OF_JUSTICE, false);
events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 20000);
break;
}
if (Unit* target = me->GetVictim())
if (target->IsPlayer() && me->IsInRange(target, 10.0f, 40.0f, true))
{
me->CastSpell(target, SPELL_HAMMER_OF_JUSTICE);
events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 20s);
break;
}
events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 0);
break;
case EVENT_SPELL_SEAL:
Expand Down Expand Up @@ -710,4 +697,3 @@ void AddSC_boss_illidari_council()
RegisterSpellScript(spell_illidari_council_judgement);
RegisterSpellScript(spell_illidari_council_deadly_strike_aura);
}