void JustDied(Unit* /*killer*/) override { InstanceScript* instance = me->GetInstanceScript(); if (Creature* Viscidus = instance->GetCreature(DATA_VISCIDUS)) { if (BossAI* ViscidusAI = dynamic_cast<BossAI*>(Viscidus->GetAI())) ViscidusAI->SummonedCreatureDespawn(me); if (Viscidus->IsAlive() && Viscidus->GetHealthPct() < 5.0f) { Viscidus->SetVisible(true); if (Viscidus->GetVictim()) Unit::Kill(Viscidus->EnsureVictim(), Viscidus); } else { Viscidus->SetHealth(Viscidus->GetHealth() - Viscidus->GetMaxHealth() / 20); Viscidus->CastSpell(Viscidus, SPELL_VISCIDUS_SHRINKS); } } }
void UpdateAI(uint32 diff) override { if (Repair_Timer <= diff) { if (instance->GetBossState(DATA_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) { if (Creature* mekgineer = instance->GetCreature(DATA_MEKGINEER_STEAMRIGGER)) { if (me->IsWithinDistInMap(mekgineer, MAX_REPAIR_RANGE)) { //are we already channeling? Doesn't work very well, find better check? if (!me->GetUInt32Value(UNIT_CHANNEL_SPELL)) { //me->GetMotionMaster()->MovementExpired(); //me->GetMotionMaster()->MoveIdle(); DoCast(me, SPELL_REPAIR, true); } Repair_Timer = 5000; } else { //me->GetMotionMaster()->MovementExpired(); //me->GetMotionMaster()->MoveFollow(pMekgineer, 0, 0); } } } else Repair_Timer = 5000; } else Repair_Timer -= diff; if (!UpdateVictim()) return; DoMeleeAttackIfReady(); }
bool GossipHello(Player* player) override { if (instance->GetData(DATA_EGG_EVENT) != DONE) { if (Creature* razorgore = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED)) { razorgore->Attack(player, true); player->CastSpell(razorgore, SPELL_MINDCONTROL); } } return true; }
bool GossipHello(Player* /*player*/) override { if (Creature* palehoof = instance->GetCreature(DATA_GORTOK_PALEHOOF)) { if (palehoof->IsAlive() && instance->GetBossState(DATA_GORTOK_PALEHOOF) != DONE) { me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); me->SetGoState(GO_STATE_ACTIVE); palehoof->AI()->DoAction(ACTION_START_ENCOUNTER); } } return true; }
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override { InstanceScript* instance = player->GetInstanceScript(); if (!instance || player->IsGameMaster()) return true; if (instance->GetBossState(DATA_SKADI_THE_RUTHLESS) == NOT_STARTED) if (Creature* skadi = instance->GetCreature(DATA_SKADI_THE_RUTHLESS)) { skadi->AI()->DoAction(ACTION_START_ENCOUNTER); return true; } return true; }
void IsSummonedBy(Unit* summoner) override { targetGUID = summoner->GetGUID(); me->SetInCombatWith(summoner); AddThreat(summoner, 250.0f); if (Unit* target = ObjectAccessor::GetUnit(*me, targetGUID)) { DoCast(target, SPELL_BLOCK_OF_ICE, true); // Prevents to have Ice Block on other place than target is me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation()); if (target->GetTypeId() == TYPEID_PLAYER) if (Creature* hodir = instance->GetCreature(BOSS_HODIR)) hodir->AI()->DoAction(ACTION_CHEESE_THE_FREEZE); } }
bool OnCheck(Player* /*player*/, Unit* target) override { if (!target) return false; InstanceScript* instance = target->GetInstanceScript(); if (!instance) return false; for (uint8 n = 0; n < 3; ++n) { if (Creature* watcher = instance->GetCreature(DATA_WATCHER_GASHRA + n)) if (!watcher->IsAlive()) return false; } return true; }
bool OnCheck(Player* /*player*/, Unit* target) override { if (!target) return false; InstanceScript* instance = target->GetInstanceScript(); if (!instance) return false; for (DataTypes watcherData : {DATA_WATCHER_GASHRA, DATA_WATCHER_NARJIL, DATA_WATCHER_SILTHIK}) { if (Creature* watcher = instance->GetCreature(watcherData)) if (watcher->IsAlive()) continue; return false; } return true; }
void DamageTaken(Unit* who, uint32& /*damage*/) override { if (Creature* helper = ObjectAccessor::GetCreature(*me, targetGUID)) { helper->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED); helper->SetControlled(false, UNIT_STATE_ROOT); if (Creature* hodir = instance->GetCreature(BOSS_HODIR)) { if (!hodir->IsInCombat()) { hodir->SetReactState(REACT_AGGRESSIVE); hodir->AI()->DoZoneInCombat(); hodir->AI()->AttackStart(who); } helper->AI()->AttackStart(hodir); } } }
bool GossipHello(Player* /*player*/) override { Creature* princeTaldaram = instance->GetCreature(DATA_PRINCE_TALDARAM); if (princeTaldaram && princeTaldaram->IsAlive()) { me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); me->SetGoState(GO_STATE_ACTIVE); switch (me->GetEntry()) { case GO_SPHERE_1: instance->SetData(DATA_SPHERE_1, IN_PROGRESS); princeTaldaram->AI()->Talk(SAY_1); break; case GO_SPHERE_2: instance->SetData(DATA_SPHERE_2, IN_PROGRESS); princeTaldaram->AI()->Talk(SAY_1); break; } ENSURE_AI(boss_prince_taldaram::boss_prince_taldaramAI, princeTaldaram->AI())->CheckSpheres(); } return true; }