Skip to content

Commit

Permalink
fix(Scripts/BlackTemple): Gathios the Shatterer shouldnt use Hammer o…
Browse files Browse the repository at this point in the history
…f Justice on random players (#19653)

* fix: SelectTargetMethod Random replaced with MaxThreat

* restore like origin

* fix: cast Hammer Of Justice on current target instead random target

* refactor: case EVENT_SPELL_HAMMER_OF_JUSTICE statement refactored

* refactor: if statement splitted

* refactor: last space removed

* Update src/server/scripts/Outland/BlackTemple/illidari_council.cpp

Co-authored-by: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com>

* fix redundant check and new line

---------

Co-authored-by: MattiaBallarini <ballarini.mattia1990@gmail.com>
Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com>
Co-authored-by: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com>
  • Loading branch information
4 people committed Aug 19, 2024
1 parent 79a653b commit 01c8344
Showing 1 changed file with 7 additions and 21 deletions.
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 @@ -711,4 +698,3 @@ void AddSC_boss_illidari_council()
RegisterSpellScript(spell_illidari_council_judgement);
RegisterSpellScript(spell_illidari_council_deadly_strike_aura);
}

0 comments on commit 01c8344

Please sign in to comment.