fix(Scripts/BlackTemple) Gathios the Shatterer shouldnt use the same spell twice in a row (#19672)

* fix: SelectTargetMethod Random replaced with MaxThreat

* restore like origin

* fix: random spell casting replaced with alternating spells casting

* fix: alternating casting of aura, blessing and seal spells

* refactor: randomized toggle initialization refactored

---------

Co-authored-by: MattiaBallarini <ballarini.mattia1990@gmail.com>
This commit is contained in:
Carriola-wotlk
2024-08-25 15:01:37 +02:00
committed by GitHub
parent 643362d697
commit 4a14c61a90

View File

@@ -270,7 +270,12 @@ public:
struct boss_gathios_the_shattererAI : public boss_illidari_council_memberAI
{
boss_gathios_the_shattererAI(Creature* creature) : boss_illidari_council_memberAI(creature) { }
boss_gathios_the_shattererAI(Creature* creature) : boss_illidari_council_memberAI(creature)
{
_toggleBlessing = RAND(true, false);
_toggleAura = RAND(true, false);
_toggleSeal = RAND(true, false);
}
Creature* SelectCouncilMember()
{
@@ -309,11 +314,15 @@ public:
{
case EVENT_SPELL_BLESSING:
if (Unit* member = SelectCouncilMember())
me->CastSpell(member, RAND(SPELL_BLESSING_OF_SPELL_WARDING, SPELL_BLESSING_OF_PROTECTION), false);
{
me->CastSpell(member, _toggleBlessing ? SPELL_BLESSING_OF_PROTECTION : SPELL_BLESSING_OF_SPELL_WARDING);
_toggleBlessing = !_toggleBlessing;
}
events.ScheduleEvent(EVENT_SPELL_BLESSING, 15000);
break;
case EVENT_SPELL_AURA:
me->CastSpell(me, RAND(SPELL_DEVOTION_AURA, SPELL_CHROMATIC_RESISTANCE_AURA), false);
me->CastSpell(me, _toggleAura ? SPELL_DEVOTION_AURA : SPELL_CHROMATIC_RESISTANCE_AURA);
_toggleAura = !_toggleAura;
events.ScheduleEvent(EVENT_SPELL_AURA, 60000);
break;
case EVENT_SPELL_CONSECRATION:
@@ -333,7 +342,8 @@ public:
events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 0);
break;
case EVENT_SPELL_SEAL:
me->CastSpell(me, RAND(SPELL_SEAL_OF_COMMAND, SPELL_SEAL_OF_BLOOD), false);
me->CastSpell(me, _toggleSeal ? SPELL_SEAL_OF_COMMAND : SPELL_SEAL_OF_BLOOD);
_toggleSeal = !_toggleSeal;
events.ScheduleEvent(EVENT_SPELL_SEAL, 20000);
break;
case EVENT_SPELL_JUDGEMENT:
@@ -344,6 +354,10 @@ public:
DoMeleeAttackIfReady();
}
private:
bool _toggleBlessing;
bool _toggleAura;
bool _toggleSeal;
};
};