void JustDied(Unit* /*killer*/) { _JustDied(); Talk(SAY_DEATH); if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PROFESSOR_PUTRICIDE))) professor->AI()->DoAction(ACTION_FESTERGUT_DEATH); _RemoveBlight(); }
boss_festergutAI(Creature* creature) : BossAI(creature, DATA_FESTERGUT_EVENT) { maxInoculatedStack = 0; inhaleCounter = 0; gasDummyGUID = 0; //Prevent dummies to attack players or keep them in combat if (Creature* gasDummy = me->FindNearestCreature(NPC_ORANGE_GAS_STALKER, 100.0f, true)) { gasDummy->SetReactState(REACT_PASSIVE); gasDummyGUID = gasDummy->GetGUID(); _RemoveBlight(); } }
void JustDied(Unit* killer) { Talk(SAY_DEATH); instance->SetBossState(DATA_FESTERGUT_EVENT, DONE); instance->SetData(DATA_FESTERGUT_EVENT, DONE); if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetData64(GUID_PROFESSOR_PUTRICIDE))) professor->AI()->DoAction(ACTION_FESTERGUT_DEATH); //Prevent dummies to attack players or keep them in combat if (Creature* gasDummy = me->FindNearestCreature(NPC_ORANGE_GAS_STALKER, 100.0f, true)) { gasDummy->AI()->EnterEvadeMode(); gasDummy->SetReactState(REACT_PASSIVE); gasDummy->Kill(gasDummy); } _RemoveBlight(); _RemoveDebuffsFromRaid(); }
void Reset() { events.Reset(); events.ScheduleEvent(EVENT_BERSERK, 300000); events.ScheduleEvent(EVENT_INHALE_BLIGHT, 35000); //-- Every 40 seconds except after 3rd and 6th cast, then it's 50sec CD events.ScheduleEvent(EVENT_GAS_SPORE, 40000); //-- 10 to 14 seconds according to DBM events.ScheduleEvent(EVENT_GASTRIC_BLOAT, urand(10000, 14000)); events.ScheduleEvent(EVENT_GASEOUS_BLIGHT, 8000); events.ScheduleEvent(EVENT_VILE_GAS, urand(28000, 35000)); maxInoculatedStack = 0; inhaleCounter = 0; me->RemoveAurasDueToSpell(SPELL_BERSERK2); //Prevent dummies to attack players or keep them in combat if (Creature* gasDummy = me->FindNearestCreature(NPC_ORANGE_GAS_STALKER, 100.0f, true)) { gasDummy->SetReactState(REACT_PASSIVE); gasDummyGUID = gasDummy->GetGUID(); _RemoveBlight(); } }
void UpdateAI(const uint32 diff) { if (!UpdateVictim() || !CheckInRoom()) return; events.Update(diff); if (me->HasUnitState(UNIT_STAT_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_INHALE_BLIGHT: { _RemoveBlight(); if (inhaleCounter == 3) { Talk(EMOTE_WARN_PUNGENT_BLIGHT); Talk(SAY_PUNGENT_BLIGHT); DoCast(me, SPELL_PUNGENT_BLIGHT); inhaleCounter = 0; if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PROFESSOR_PUTRICIDE))) professor->AI()->DoAction(ACTION_FESTERGUT_GAS); events.RescheduleEvent(EVENT_GAS_SPORE, urand(20000, 25000)); } else { DoCast(me, SPELL_INHALE_BLIGHT); // just cast and dont bother with target, conditions will handle it ++inhaleCounter; if (inhaleCounter < 3) me->CastSpell(me, gaseousBlight[inhaleCounter], true, NULL, NULL, me->GetGUID()); } events.ScheduleEvent(EVENT_INHALE_BLIGHT, urand(33500, 35000)); break; } case EVENT_VILE_GAS: { std::list<Unit*> targets; uint32 minTargets = RAID_MODE<uint32>(3, 8, 3, 8); SelectTargetList(targets, minTargets, SELECT_TARGET_RANDOM, -5.0f, true); float minDist = 0.0f; if (targets.size() >= minTargets) minDist = -5.0f; if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, minDist, true)) DoCast(target, SPELL_VILE_GAS); events.ScheduleEvent(EVENT_VILE_GAS, urand(28000, 35000)); break; } case EVENT_GAS_SPORE: Talk(EMOTE_WARN_GAS_SPORE); Talk(EMOTE_GAS_SPORE); me->CastCustomSpell(SPELL_GAS_SPORE, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 3, 2, 3), me); events.ScheduleEvent(EVENT_GAS_SPORE, urand(40000, 45000)); events.RescheduleEvent(EVENT_VILE_GAS, urand(28000, 35000)); break; case EVENT_GASTRIC_BLOAT: DoCastVictim(SPELL_GASTRIC_BLOAT); events.ScheduleEvent(EVENT_GASTRIC_BLOAT, urand(15000, 17500)); break; case EVENT_BERSERK: DoCast(me, SPELL_BERSERK2); Talk(SAY_BERSERK); break; default: break; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!CheckInRoom()) EnterEvadeMode(); if (!UpdateVictim()) return; events.Update(diff); if (me->HasUnitState(UNIT_STAT_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_GASEOUS_BLIGHT: { _RemoveBlight(); if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetData64(GUID_PROFESSOR_PUTRICIDE))) professor->AI()->DoAction(ACTION_FESTERGUT_GAS); if (Creature* gasDummy = ObjectAccessor::GetCreature(*me, gasDummyGUID)) gasDummy->CastSpell(gasDummy, gaseousBlight[0], true, NULL, NULL, me->GetGUID()); break; } case EVENT_INHALE_BLIGHT: { _RemoveBlight(); if (inhaleCounter == 3) { Talk(EMOTE_WARN_PUNGENT_BLIGHT); Talk(SAY_PUNGENT_BLIGHT); me->RemoveAurasDueToSpell(SPELL_INHALE_BLIGHT); me->RemoveAurasDueToSpell(SPELL_INHALED_BLIGHT_1); me->RemoveAurasDueToSpell(SPELL_INHALED_BLIGHT_2); DoCast(me, PUNGENT_BLIGHT_HELPER, false); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_INOCULATED); inhaleCounter = 0; //Refill the room with gaseous blight at maximum power if (Creature* gasDummy = ObjectAccessor::GetCreature(*me, gasDummyGUID)) gasDummy->CastSpell(gasDummy, gaseousBlight[inhaleCounter], true, NULL, NULL, me->GetGUID()); } else { DoCast(me, SPELL_INHALE_BLIGHT); // just cast and dont bother with target, conditions will handle it ++inhaleCounter; if (inhaleCounter < 3) { if (Creature* gasDummy = ObjectAccessor::GetCreature(*me, gasDummyGUID)) gasDummy->CastSpell(gasDummy, gaseousBlight[inhaleCounter], true, NULL, NULL, me->GetGUID()); } else { //-- Every 40 seconds except after 3rd and 6th cast, then it's 50sec CD events.RescheduleEvent(EVENT_GAS_SPORE, 50000); } } events.ScheduleEvent(EVENT_INHALE_BLIGHT, urand(33500, 35000)); break; } case EVENT_VILE_GAS: { std::list<Unit*> targets; uint32 minTargets = RAID_MODE<uint32>(3, 8, 3, 8); SelectTargetList(targets, minTargets, SELECT_TARGET_RANDOM, -5.0f, true); float minDist = 0.0f; if (targets.size() >= minTargets) minDist = -5.0f; if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, minDist, true)) DoCast(target, SPELL_VILE_GAS); events.ScheduleEvent(EVENT_VILE_GAS, urand(28000, 35000)); break; } case EVENT_GAS_SPORE: Talk(EMOTE_WARN_GAS_SPORE); Talk(EMOTE_GAS_SPORE); me->CastCustomSpell(SPELL_GAS_SPORE, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 3, 2, 3), me); events.ScheduleEvent(EVENT_GAS_SPORE, urand(40000, 45000)); //events.RescheduleEvent(EVENT_VILE_GAS, urand(28000, 35000)); break; case EVENT_GASTRIC_BLOAT: DoCastVictim(SPELL_GASTRIC_BLOAT); //-- 10 to 14 seconds according to DeadlyBossMods events.ScheduleEvent(EVENT_GASTRIC_BLOAT, urand(10000, 14000)); break; case EVENT_BERSERK: DoCast(me, SPELL_BERSERK2); Talk(SAY_BERSERK); break; default: break; } } DoMeleeAttackIfReady(); }