fix(Scripts/UBRS): Drakkisath's conflagrate should drop threat temporarily (#9299)

also adjust it's timer slightly
This commit is contained in:
Skjalf
2021-11-29 10:21:48 -03:00
committed by GitHub
parent 46987c9e3a
commit 228d7e4c70

View File

@@ -36,7 +36,8 @@ enum Events
EVENT_CONFLAGRATION,
EVENT_THUNDERCLAP,
EVENT_PIERCE_ARMOR,
EVENT_RAGE
EVENT_RAGE,
EVENT_CHECK_CONFLAGRATION_TARGET
};
class boss_drakkisath : public CreatureScript
@@ -46,7 +47,10 @@ public:
struct boss_drakkisathAI : public BossAI
{
boss_drakkisathAI(Creature* creature) : BossAI(creature, DATA_GENERAL_DRAKKISATH) { }
boss_drakkisathAI(Creature* creature) : BossAI(creature, DATA_GENERAL_DRAKKISATH)
{
_conflagrateThreat = 0.0f;
}
void EnterCombat(Unit* /*who*/) override
{
@@ -83,7 +87,15 @@ public:
break;
case EVENT_CONFLAGRATION:
DoCastVictim(SPELL_CONFLAGRATION);
events.ScheduleEvent(EVENT_CONFLAGRATION, 18000);
if (Unit* target = me->GetVictim())
{
_conflagrateTarget = me->GetVictim()->GetGUID();
_conflagrateThreat = me->getThreatMgr().getThreat(me->GetVictim());
me->getThreatMgr().modifyThreatPercent(target, -100);
}
events.ScheduleEvent(EVENT_CONFLAGRATION, urand(10000, 13000));
events.ScheduleEvent(EVENT_CHECK_CONFLAGRATION_TARGET, 10000);
break;
case EVENT_THUNDERCLAP:
DoCastVictim(SPELL_THUNDERCLAP);
@@ -97,10 +109,20 @@ public:
DoCastSelf(SPELL_RAGE);
events.ScheduleEvent(EVENT_RAGE, 35000);
break;
case EVENT_CHECK_CONFLAGRATION_TARGET:
if (Unit* target = ObjectAccessor::GetUnit(*me, _conflagrateTarget))
{
me->getThreatMgr().addThreat(target, _conflagrateThreat);
}
break;
}
}
DoMeleeAttackIfReady();
}
private:
float _conflagrateThreat;
ObjectGuid _conflagrateTarget;
};
CreatureAI* GetAI(Creature* creature) const override