void JustDied(Unit* /*killer*/) override { _JustDied(); me->CastSpell(me, SPELL_DIES, true); CheckPlayersFrostResist(); }
void EnterCombat(Unit * /*who*/) { _EnterCombat(); me->CastSpell(me, SPELL_FROST_AURA, true); events.ScheduleEvent(EVENT_BERSERK, 15 * 60000); EnterPhaseGround(); CheckPlayersFrostResist(); }
void EnterCombat(Unit* /*who*/) override { _EnterCombat(); me->CastSpell(me, SPELL_FROST_AURA, true); events.ScheduleEvent(EVENT_BERSERK, 15 * MINUTE * IN_MILLISECONDS); EnterPhaseGround(); CheckPlayersFrostResist(); }
void JustDied(Unit* /*who*/) { _JustDied(); me->CastSpell(me, SPELL_DIES, true); CheckPlayersFrostResist(); if (CanTheHundredClub) { AchievementEntry const* AchievTheHundredClub = sAchievementStore.LookupEntry(ACHIEVEMENT_THE_HUNDRED_CLUB); if (AchievTheHundredClub) { if (map && map->IsDungeon()) { Map::PlayerList const &players = map->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) itr->getSource()->CompletedAchievement(AchievTheHundredClub); } } } }
void UpdateAI(const uint32 diff) { if (!phase) return; events.Update(diff); if ((phase != PHASE_BIRTH && !UpdateVictim()) || !CheckInRoom()) return; if (CanTheHundredClub) { if (CheckFrostResistTimer <= diff) { CheckPlayersFrostResist(); CheckFrostResistTimer = (rand() % 5 + 5) * 1000; } else CheckFrostResistTimer -= diff; } if (phase == PHASE_GROUND) { while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_BERSERK: DoScriptText(EMOTE_ENRAGE, me); DoCast(me, SPELL_BERSERK); return; case EVENT_CLEAVE: DoCast(me->getVictim(), SPELL_CLEAVE); events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); return; case EVENT_TAIL: DoCastAOE(SPELL_TAIL_SWEEP); events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); return; case EVENT_DRAIN: DoCastAOE(SPELL_LIFE_DRAIN); events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); return; case EVENT_BLIZZARD: { //DoCastAOE(SPELL_SUMMON_BLIZZARD); if (Creature* summon = DoSummon(MOB_BLIZZARD, me, 0.0f, urand(25000, 30000), TEMPSUMMON_TIMED_DESPAWN)) summon->GetMotionMaster()->MoveRandom(40); events.ScheduleEvent(EVENT_BLIZZARD, RAID_MODE(20000, 7000), 0, PHASE_GROUND); break; } case EVENT_FLIGHT: if (HealthAbovePct(10)) { phase = PHASE_FLIGHT; events.SetPhase(PHASE_FLIGHT); me->SetReactState(REACT_PASSIVE); me->AttackStop(); float x, y, z, o; me->GetHomePosition(x, y, z, o); me->GetMotionMaster()->MovePoint(1, x, y, z); return; } break; } } DoMeleeAttackIfReady(); } else { if (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_LIFTOFF: me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); me->SetLevitate(true); me->SendMovementFlagUpdate(); events.ScheduleEvent(EVENT_ICEBOLT, 1500); iceboltCount = RAID_MODE(2, 3); return; case EVENT_ICEBOLT: { std::vector<Unit*> targets; std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (; i != me->getThreatManager().getThreatList().end(); ++i) if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT)) targets.push_back((*i)->getTarget()); if (targets.empty()) iceboltCount = 0; else { std::vector<Unit*>::const_iterator itr = targets.begin(); advance(itr, rand()%targets.size()); iceblocks.insert(std::make_pair((*itr)->GetGUID(), 0)); DoCast(*itr, SPELL_ICEBOLT); --iceboltCount; } if (iceboltCount) events.ScheduleEvent(EVENT_ICEBOLT, 1000); else events.ScheduleEvent(EVENT_BREATH, 1000); return; } case EVENT_BREATH: { DoScriptText(EMOTE_BREATH, me); DoCastAOE(SPELL_FROST_MISSILE); events.ScheduleEvent(EVENT_EXPLOSION, 8000); return; } case EVENT_EXPLOSION: CastExplosion(); ClearIceBlock(); events.ScheduleEvent(EVENT_LAND, 3000); return; case EVENT_LAND: me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); me->SetLevitate(false); me->SendMovementFlagUpdate(); events.ScheduleEvent(EVENT_GROUND, 1500); return; case EVENT_GROUND: EnterPhaseGround(); return; case EVENT_BIRTH: me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetReactState(REACT_AGGRESSIVE); return; } }//if (uint32 eventId = events.ExecuteEvent()) }//if (phase == PHASE_GROUND) }