void UpdateAI(const uint32 uiDiff) { //Return since we have no target if (!UpdateVictim()) return; //exploit fix, remove later if (m_uiCheckZ <= uiDiff) { if (me->GetPositionZ() < 50.0f) { EnterEvadeMode(); return; } m_uiCheckZ = 1000; } else m_uiCheckZ -= uiDiff; if (m_bIsStriking && !m_bMove) { if (m_uiPause_Timer <= uiDiff) { if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) { if (me->getVictim()) me->GetMotionMaster()->MoveChase(me->getVictim()); } m_bHasTemper = false; m_bIsStriking = false; m_uiPause_Timer = 1500; } else m_uiPause_Timer -= uiDiff; return; } // ShatteringStomp all the Time, if (!m_bHasTemper && !m_bMove) { if (m_uiShatteringStomp_Timer <= uiDiff) { DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2), me); DoCast(me, DUNGEON_MODE(SPELL_SHATTERING_STOMP_N,SPELL_SHATTERING_STOMP_H)); if (Creature* temp = me->FindNearestCreature(NPC_BRITTLE_GOLEM,99)) { DoScriptText(EMOTE_SHATTER, me); m_bCanShatterGolem = true; } m_uiShatteringStomp_Timer = 30000; } else m_uiShatteringStomp_Timer -= uiDiff; } // Shatter Golems 3 seconds after Shattering Stomp if (m_bCanShatterGolem) { if (m_uiShatter_Timer <= uiDiff) { ShatterGolem(); m_uiShatter_Timer = 3000; m_bCanShatterGolem = false; } else m_uiShatter_Timer -= uiDiff; } Creature* pAnvil = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_VOLKHAN_ANVIL)); float fX, fY, fZ; me->GetContactPoint(pAnvil, fX, fY, fZ, INTERACTION_DISTANCE); // Health check if (!m_bCanShatterGolem && me->HealthBelowPct(100 - 20 * m_uiHealthAmountModifier) && !m_bMove) { ++m_uiHealthAmountModifier; if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); DoScriptText(RAND(SAY_FORGE_1,SAY_FORGE_2), me); if (me->GetDistance(pAnvil) > 5) { me->GetMotionMaster()->Clear(); me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->MovePoint(5,fX,fY,fZ); } DoScriptText(EMOTE_TO_ANVIL, me); m_bMove=true; } if (me->IsWithinMeleeRange(pAnvil,5) && m_bMove) { me->GetMotionMaster()->Clear(); me->SetReactState(REACT_AGGRESSIVE); m_bHasTemper = true; m_bMove=false; for (uint8 i = 0; i < MAX_GOLEM; ++i) { DoCast(SPELL_SUMMON_MOLTEN_GOLEM); } DoCast(SPELL_TEMPER); m_bIsStriking = true; } if (me->GetMotionMaster()->GetCurrentMovementGeneratorType()!=POINT_MOTION_TYPE && m_bMove) //if (m_uiCheckTimer<=uiDiff) { me->GetMotionMaster()->MovePoint(5,fX,fY,fZ); m_uiCheckTimer=1100; } //else //m_uiCheckTimer-=uiDiff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (SpawnCount == 0 && Phase == PHASE_SUMMONS) { me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false); SpawnCount = 10; SetCombatMovement(true); Phase = PHASE_NORMAL; Phased = false; CurseBloodTimer = urand(8000,13000); ForceGripTimer = 22000; SummonGravityWellTimer = urand(11000,16000); SummonDevoutTimer = urand(19000,27000); me->RemoveAurasDueToSpell(DUNGEON_MODE(SPELL_ENERGY_SHIELD_N,SPELL_ENERGY_SHIELD_H)); } if (me->HealthBelowPct(67) && Phase == PHASE_NORMAL && PhaseCount == 0) { me->MonsterYell(SAY_P2, LANG_UNIVERSAL, NULL); me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, true); PhaseCount++; SetCombatMovement(false); Phase = PHASE_SUMMONS; DoTeleportTo(1337.89f, 963.287f, 214.184f, 1.8407); DoCast(me, DUNGEON_MODE(SPELL_ENERGY_SHIELD_N,SPELL_ENERGY_SHIELD_H)); DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true), SPELL_SEISMIC_SHARD); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); Phase2EndTimer = 60000; } if (me->HealthBelowPct(34) && Phase == PHASE_NORMAL && PhaseCount == 1) { me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, true); me->MonsterYell(SAY_P2, LANG_UNIVERSAL, NULL); PhaseCount++; SetCombatMovement(false); Phase = PHASE_SUMMONS; DoTeleportTo(1337.89f, 963.287f, 214.184f, 1.8407); DoCast(me, DUNGEON_MODE(SPELL_ENERGY_SHIELD_N,SPELL_ENERGY_SHIELD_H)); DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true), SPELL_SEISMIC_SHARD); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); Phase2EndTimer = 60000; } if (CurseBloodTimer <= diff && Phase == PHASE_NORMAL) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(target, DUNGEON_MODE(SPELL_CURSE_OF_BLOOD_N,SPELL_CURSE_OF_BLOOD_H)); CurseBloodTimer = urand(5000,7000); } else CurseBloodTimer -= diff; if (ForceGripTimer <= diff && Phase == PHASE_NORMAL) { me->InterruptNonMeleeSpells(true); DoCastVictim(SPELL_FORCE_GRIP); ForceGripTimer = urand(12000,15000); } else ForceGripTimer -= diff; if (SummonGravityWellTimer <= diff && Phase == PHASE_NORMAL) { me->MonsterYell(SAY_EARTH, LANG_UNIVERSAL, NULL); if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) DoCast(target, SPELL_SUMMON_GRAVITY_WELL); SummonGravityWellTimer = urand(13000,16000); } else SummonGravityWellTimer -= diff; if (SummonDevoutTimer <= diff && Phase == PHASE_NORMAL) { me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); SummonDevoutTimer = urand(19000,27000); } else SummonDevoutTimer -= diff; if (Phase == PHASE_SUMMONS) { if (Phase2EndTimer <= diff) { SpawnCount = 10; SetCombatMovement(true); Phase = PHASE_NORMAL; Phased = false; CurseBloodTimer = urand(8000,13000); ForceGripTimer = 22000; SummonGravityWellTimer = urand(11000,16000); SummonDevoutTimer = urand(19000,27000); me->RemoveAurasDueToSpell(DUNGEON_MODE(SPELL_ENERGY_SHIELD_N,SPELL_ENERGY_SHIELD_H)); } else Phase2EndTimer -= diff; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (m_bIsWalking) { if (m_uiPause_Timer <= diff) { DoScriptText(ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].say, me); DoCast(me, SPELL_CHANNEL_YMIRON_TO_SPIRIT); // should be on spirit if (Creature* pTemp = me->SummonCreature(ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].npc, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnX, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnY, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnZ, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnO, TEMPSUMMON_CORPSE_DESPAWN, 0)) { m_uiActivedCreatureGUID = pTemp->GetGUID(); pTemp->CastSpell(me, SPELL_CHANNEL_SPIRIT_TO_YMIRON, true); pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); pTemp->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); switch(m_uiActiveOrder[m_uiActivedNumber]) { case 0: m_bIsActiveWithBJORN = true; break; case 1: m_bIsActiveWithHALDOR = true; break; case 2: m_bIsActiveWithRANULF = true; break; case 3: m_bIsActiveWithTORGYN = true; break; } } m_bIsPause = true; m_bIsWalking = false; m_uiPause_Timer = 3000; } else m_uiPause_Timer -= diff; return; } else if (m_bIsPause) { if (m_uiPause_Timer <= diff) { m_uiAbility_BJORN_Timer = 5000; m_uiAbility_HALDOR_Timer = 5000; m_uiAbility_RANULF_Timer = 5000; m_uiAbility_TORGYN_Timer = 5000; m_bIsPause = false; m_uiPause_Timer = 0; } else m_uiPause_Timer -= diff; return; } //Return since we have no target if (!UpdateVictim()) return; if (!m_bIsPause) { // Normal spells ------------------------------------------------------------------------ if (m_uiBane_Timer <= diff) { DoCast(me, SPELL_BANE); m_uiBane_Timer = urand(20000, 25000); } else m_uiBane_Timer -= diff; if (m_uiFetidRot_Timer <= diff) { DoCast(me->getVictim(), SPELL_FETID_ROT); m_uiFetidRot_Timer = urand(10000, 15000); } else m_uiFetidRot_Timer -= diff; if (m_uiDarkSlash_Timer <= diff) { DoCast(me->getVictim(), SPELL_DARK_SLASH); m_uiDarkSlash_Timer = urand(30000, 35000); } else m_uiDarkSlash_Timer -= diff; if (m_uiAncestors_Vengeance_Timer <= diff) { DoCast(me, SPELL_ANCESTORS_VENGEANCE); m_uiAncestors_Vengeance_Timer = DUNGEON_MODE(urand(60000, 65000), urand(45000, 50000)); } else m_uiAncestors_Vengeance_Timer -= diff; // Abilities ------------------------------------------------------------------------------ if (m_bIsActiveWithBJORN && m_uiAbility_BJORN_Timer <= diff) { //DoCast(me, SPELL_SUMMON_SPIRIT_FOUNT); // works fine, but using summon has better control if (Creature* pTemp = me->SummonCreature(CREATURE_SPIRIT_FOUNT, 385.0f + rand() % 10, -330.0f + rand() % 10, 104.756f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 180000)) { pTemp->SetSpeed(MOVE_RUN, 0.4f); pTemp->CastSpell(pTemp, DUNGEON_MODE(SPELL_SPIRIT_FOUNT, H_SPELL_SPIRIT_FOUNT), true); pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); pTemp->SetDisplayId(11686); m_uiOrbGUID = pTemp->GetGUID(); } m_bIsActiveWithBJORN = false; // only one orb } else m_uiAbility_BJORN_Timer -= diff; if (m_bIsActiveWithHALDOR && m_uiAbility_HALDOR_Timer <= diff) { DoCast(me->getVictim(), SPELL_SPIRIT_STRIKE); m_uiAbility_HALDOR_Timer = 5000; // overtime } else m_uiAbility_HALDOR_Timer -= diff; if (m_bIsActiveWithRANULF && m_uiAbility_RANULF_Timer <= diff) { DoCast(me, SPELL_SPIRIT_BURST); m_uiAbility_RANULF_Timer = 10000; // overtime } else m_uiAbility_RANULF_Timer -= diff; if (m_bIsActiveWithTORGYN && m_uiAbility_TORGYN_Timer <= diff) { float x, y, z; x = me->GetPositionX()-5; y = me->GetPositionY()-5; z = me->GetPositionZ(); for (uint8 i = 0; i < 4; ++i) { //DoCast(me, SPELL_SUMMON_AVENGING_SPIRIT); // works fine, but using summon has better control if (Creature* pTemp = me->SummonCreature(CREATURE_AVENGING_SPIRIT, x + rand() % 10, y + rand() % 10, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) { if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { pTemp->AddThreat(pTarget, 0.0f); pTemp->AI()->AttackStart(pTarget); } } } m_uiAbility_TORGYN_Timer = 15000; // overtime } else m_uiAbility_TORGYN_Timer -= diff; // Health check ----------------------------------------------------------------------------- if (me->HealthBelowPct(100 - m_uiHealthAmountMultipler * m_uiHealthAmountModifier)) { uint8 m_uiOrder = m_uiHealthAmountModifier - 1; ++m_uiHealthAmountModifier; me->InterruptNonMeleeSpells(true); DoCast(me, SPELL_SCREAMS_OF_THE_DEAD); me->GetMotionMaster()->Clear(); me->StopMoving(); me->AttackStop(); me->GetMotionMaster()->MovePoint(0, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveX, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveY, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveZ); DespawnBoatGhosts(m_uiActivedCreatureGUID); DespawnBoatGhosts(m_uiOrbGUID); m_bIsActiveWithBJORN = false; m_bIsActiveWithHALDOR = false; m_bIsActiveWithRANULF = false; m_bIsActiveWithTORGYN = false; m_uiBane_Timer += 8000; m_uiFetidRot_Timer += 8000; m_uiDarkSlash_Timer += 8000; m_uiAncestors_Vengeance_Timer += 8000; m_uiActivedNumber = m_uiOrder; m_bIsWalking = true; m_uiPause_Timer = 2000; return; } DoMeleeAttackIfReady(); } }
void JustSummoned(Creature* summon) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) summon->CastSpell(target, DUNGEON_MODE(SPELL_STAMPEDE_DMG, H_SPELL_STAMPEDE_DMG),true); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (uiPhaseTimer <= diff) { switch (Phase) { case CASTING_FLAME_SPHERES: { Creature* pSpheres[3]; //DoCast(me, SPELL_FLAME_SPHERE_SUMMON_1); pSpheres[0] = DoSpawnCreature(CREATURE_FLAME_SPHERE, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS); Unit* pSphereTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); if (pSphereTarget && pSpheres[0]) { float angle, x, y; angle = pSpheres[0]->GetAngle(pSphereTarget); x = pSpheres[0]->GetPositionX() + DATA_SPHERE_DISTANCE * std::cos(angle); y = pSpheres[0]->GetPositionY() + DATA_SPHERE_DISTANCE * std::sin(angle); pSpheres[0]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[0]->GetPositionZ()); } if (IsHeroic()) { //DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_1); pSpheres[1] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_1, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS); //DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_2); pSpheres[2] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_2, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS); if (pSphereTarget && pSpheres[1] && pSpheres[2]) { float angle, x, y; angle = pSpheres[1]->GetAngle(pSphereTarget) + DATA_SPHERE_ANGLE_OFFSET; x = pSpheres[1]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * std::cos(angle); y = pSpheres[1]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * std::sin(angle); pSpheres[1]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[1]->GetPositionZ()); angle = pSpheres[2]->GetAngle(pSphereTarget) - DATA_SPHERE_ANGLE_OFFSET; x = pSpheres[2]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * std::cos(angle); y = pSpheres[2]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * std::sin(angle); pSpheres[2]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[2]->GetPositionZ()); } } Phase = NORMAL; uiPhaseTimer = 0; break; } case JUST_VANISHED: if (Unit* pEmbraceTarget = GetEmbraceTarget()) { me->GetMotionMaster()->Clear(); me->SetSpeed(MOVE_WALK, 2.0f, true); me->GetMotionMaster()->MoveChase(pEmbraceTarget); } Phase = VANISHED; uiPhaseTimer = 1300; break; case VANISHED: if (Unit* pEmbraceTarget = GetEmbraceTarget()) DoCast(pEmbraceTarget, DUNGEON_MODE(SPELL_EMBRACE_OF_THE_VAMPYR, H_SPELL_EMBRACE_OF_THE_VAMPYR)); Talk(SAY_FEED); me->GetMotionMaster()->Clear(); me->SetSpeed(MOVE_WALK, 1.0f, true); me->GetMotionMaster()->MoveChase(me->getVictim()); Phase = FEEDING; uiPhaseTimer = 20*IN_MILLISECONDS; break; case FEEDING: Phase = NORMAL; uiPhaseTimer = 0; uiEmbraceTarget = 0; break; case NORMAL: if (uiBloodthirstTimer <= diff) { DoCast(me, SPELL_BLOODTHIRST); uiBloodthirstTimer = 10*IN_MILLISECONDS; } else uiBloodthirstTimer -= diff; if (uiFlamesphereTimer <= diff) { // because TARGET_UNIT_TARGET_ENEMY we need a target selected to cast DoCastVictim(SPELL_CONJURE_FLAME_SPHERE); Phase = CASTING_FLAME_SPHERES; uiPhaseTimer = 3*IN_MILLISECONDS + diff; uiFlamesphereTimer = 15*IN_MILLISECONDS; } else uiFlamesphereTimer -= diff; if (uiVanishTimer <= diff) { //Count alive players Unit* target = NULL; std::list<HostileReference*> t_list = me->getThreatManager().getThreatList(); std::vector<Unit*> target_list; for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { target = Unit::GetUnit(*me, (*itr)->getUnitGuid()); // exclude pets & totems if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) target_list.push_back(target); target = NULL; } //He only vanishes if there are 3 or more alive players if (target_list.size() > 2) { Talk(SAY_VANISH); DoCast(me, SPELL_VANISH); Phase = JUST_VANISHED; uiPhaseTimer = 500; if (Unit* pEmbraceTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) uiEmbraceTarget = pEmbraceTarget->GetGUID(); } uiVanishTimer = urand(25*IN_MILLISECONDS, 35*IN_MILLISECONDS); } else uiVanishTimer -= diff; DoMeleeAttackIfReady(); break; } } else uiPhaseTimer -= diff; }
void UpdateAI(const uint32 diff) { //Return since we have no target if (!UpdateVictim()) return; if (uiSpawnTimer <= diff) { uint32 spawnNumber = urand(2, DUNGEON_MODE(3, 5)); for (uint8 i = 0; i < spawnNumber; ++i) if (Creature* temp = DoSummon(RAND(NPC_DRAKKARI_INVADER_1, NPC_DRAKKARI_INVADER_2), AddSpawnPoint, 0, TEMPSUMMON_DEAD_DESPAWN)) { if (temp->GetAI()) { temp->GetAI()->AttackStart(me); temp->AddThreat(me, 5000000.0f); } } uiSpawnTimer = urand(30*IN_MILLISECONDS, 40*IN_MILLISECONDS); } else uiSpawnTimer -= diff; if (uiConsumeTimer <= diff) { std::list<HostileReference *> t_list = me->getThreatManager().getThreatList(); if (!t_list.empty()) { for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { if (Unit* target = Unit::GetUnit((*me), (*itr)->getUnitGuid())) { if (me->GetDistance(target) <= 50.0f && target->isAlive() && me->IsValidAttackTarget(target)) { // Apply aura for every target in 50yards ~ 45m DoCast(me, DUNGEON_MODE(SPELL_CONSUME_AURA, H_SPELL_CONSUME), true); } } } } DoScriptText(SAY_CONSUME, me); DoCast(SPELL_CONSUME); uiConsumeTimer = 15*IN_MILLISECONDS; } else uiConsumeTimer -= diff; if (consumptionJunction) { Aura* ConsumeAura = me->GetAura(DUNGEON_MODE(SPELL_CONSUME_AURA, H_SPELL_CONSUME_AURA)); if (ConsumeAura && ConsumeAura->GetStackAmount() > 9) consumptionJunction = false; } if (uiCrushTimer <= diff) { DoCastVictim(SPELL_CRUSH); uiCrushTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS); } else uiCrushTimer -= diff; if (uiInfectedWoundTimer <= diff) { DoCastVictim(SPELL_INFECTED_WOUND); uiInfectedWoundTimer = urand(25*IN_MILLISECONDS, 35*IN_MILLISECONDS); } else uiInfectedWoundTimer -= diff; if (uiExplodeCorpseTimer <= diff) { std::list<Creature*> addList; me->GetCreatureListWithEntryInGrid(addList,NPC_DRAKKARI_INVADER_1, 10.0f); me->GetCreatureListWithEntryInGrid(addList,NPC_DRAKKARI_INVADER_2, 10.0f); if(!addList.empty()) { DoCast(SPELL_CORPSE_EXPLODE); DoScriptText(SAY_EXPLODE, me); for(std::list<Creature*>::iterator i = addList.begin(); i != addList.end(); i++) { if ((*i)) { if(!(*i)->isAlive()) { DoCast((*i), DUNGEON_MODE(SPELL_CORPSE_EXPLODE_NH, SPELL_CORPSE_EXPLODE_HC), true); (*i)->DespawnOrUnsummon(); } } } } uiExplodeCorpseTimer = urand(15*IN_MILLISECONDS, 19*IN_MILLISECONDS); } else uiExplodeCorpseTimer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (Fireball_Timer <= diff) { if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(victim, DUNGEON_MODE(SPELL_FIREBALL, SPELL_FIREBALL_H), true); Fireball_Timer = urand(4000, 7000); } else Fireball_Timer -= diff; if (flight) // phase 1 - the flight { Creature* Vazruden = Unit::GetCreature(*me, VazrudenGUID); if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && Vazruden->HealthAbovePct(20))) { flight = false; BellowingRoar_Timer = 6000; ConeOfFire_Timer = 12000; me->SetLevitate(false); me->SetWalk(true); me->GetMotionMaster()->Clear(); if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0)) me->AI()->AttackStart(victim); DoStartMovement(me->getVictim()); DoScriptText(EMOTE, me); return; } else Fly_Timer -= diff; if (Turn_Timer <= diff) { uint32 waypoint = (Fly_Timer/10000)%2; if (!me->IsWithinDist3d(VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2], 5)) me->GetMotionMaster()->MovePoint(0, VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2]); Turn_Timer = 10000; } else Turn_Timer -= diff; } else // phase 2 - land fight { if (ConeOfFire_Timer <= diff) { DoCast(me, DUNGEON_MODE(SPELL_CONE_OF_FIRE, SPELL_CONE_OF_FIRE_H)); ConeOfFire_Timer = 12000; Fireball_Timer = 4000; } else ConeOfFire_Timer -= diff; if (IsHeroic()) { if (BellowingRoar_Timer <= diff) { DoCast(me, SPELL_BELLOWING_ROAR); BellowingRoar_Timer = 45000; } else BellowingRoar_Timer -= diff; } DoMeleeAttackIfReady(); } }
void UpdateAI(const uint32 uiDiff) { npc_escortAI::UpdateAI(uiDiff); if (!UpdateVictim()) return; switch (me->GetEntry()) { case NPC_ARGENT_LIGHWIELDER: { if (IsHeroic()) { if (uiCleaveTimer <= uiDiff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_STRIKE_H); uiCleaveTimer = 20000; } else uiCleaveTimer -= uiDiff; } if (uiStrikeTimer <= uiDiff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_CLEAVE); uiStrikeTimer = 25000; } else uiStrikeTimer -= uiDiff; if (uiLightTimer <= uiDiff) { DoCast(me, DUNGEON_MODE(SPELL_LIGHT, SPELL_LIGHT_H)); uiLightTimer = urand(15000, 17000); } else uiLightTimer -= uiDiff; break; } case NPC_ARGENT_MONK: { if (IsHeroic()) { if (uiDivineTimer <= uiDiff) { DoCast(me, SPELL_DIVINE_H); uiDivineTimer = 85000; } else uiDivineTimer -= uiDiff; if (uiFinalTimer <= uiDiff) { DoCast(me, SPELL_FINAL_H); uiFinalTimer = 70000; } else uiFinalTimer -= uiDiff; } if (uiPummelTimer <= uiDiff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_PUMMEL); uiPummelTimer = 35000; } else uiPummelTimer -= uiDiff; if (uiFlurryTimer <= uiDiff) { DoCast(me, SPELL_FLURRY); uiFlurryTimer = 22000; } else uiFlurryTimer -= uiDiff; break; } case NPC_PRIESTESS: { if (uiFontTimer <= uiDiff) { DoCast(me,SPELL_FONT); uiFontTimer = urand(15000, 17000); } else uiFontTimer -= uiDiff; if (uiPainTimer <= uiDiff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, DUNGEON_MODE(SPELL_PAIN, SPELL_PAIN_H)); uiPainTimer = 30000; } else uiPainTimer -= uiDiff; if (IsHeroic()) { if (uiMindTimer <= uiDiff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_MIND_H); uiMindTimer = 90000; } else uiMindTimer -= uiDiff; } if (uiSsmiteTimer <= uiDiff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, DUNGEON_MODE(SPELL_SMITE_ADD, SPELL_SMITE_ADD_H)); uiSsmiteTimer = 25000; } else uiSsmiteTimer -= uiDiff; break; } } DoMeleeAttackIfReady(); }
void Reset() { uidespawnTimer = DUNGEON_MODE(15000, 33000); events.ScheduleEvent(EVENT_ERUPTION, DUNGEON_MODE(5000, 3000)); DoCast(SPELL_LAVA_FISSURE_DUM); }
void UpdateAI(const uint32 diff) { //Return since we have no target if (!UpdateVictim()) return; if (!bGoToColossus && HealthBelowPct(50)) { if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0)) { if (!CAST_AI(boss_drakkari_colossus::boss_drakkari_colossusAI,pColossus->AI())->HealthBelowPct(6)) { me->InterruptNonMeleeSpells(true); DoCast(pColossus, SPELL_MERGE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); bGoToColossus = true; } } } if (bGoToColossus) { if (uiDisappearTimer <= diff) { if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0)) { CAST_AI(boss_drakkari_colossus::boss_drakkari_colossusAI, pColossus->AI())->CreatureState(pColossus, true); CAST_AI(boss_drakkari_colossus::boss_drakkari_colossusAI, pColossus->AI())->bHealth1 = false; } me->DisappearAndDie(); } else uiDisappearTimer -= diff; } if (uiSurgeTimer <= diff) { DoCast(me->getVictim(), SPELL_SURGE); uiSurgeTimer = urand(15000, 25000); } else uiSurgeTimer -= diff; if (uiMojoWaveTimer <= diff) { if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) { DoCast(pTarget, DUNGEON_MODE(SPELL_MOJO_WAVE, H_SPELL_MOJO_WAVE)); uiMojoWaveTimer = urand(10000, 20000); } } else uiMojoWaveTimer -= diff; // switch mojo volley max targets 1<->2 if (uiSwitchTimer <= diff) { uint32 maxtargets = urand(1,2); SpellEntry* TempSpell; TempSpell = GET_SPELL(DUNGEON_MODE(SPELL_MOJO_VOLLEY_TRIGGERED,H_SPELL_MOJO_VOLLEY_TRIGGERED)); if (TempSpell) TempSpell->MaxAffectedTargets = maxtargets; uiSwitchTimer = 2*IN_MILLISECONDS; } else uiSwitchTimer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (uiCheckIntenseColdTimer < diff /*&& !bMoreThanTwoIntenseCold*/) { /*std::list<HostileReference*> ThreatList = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr) { Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (!pTarget || pTarget->GetTypeId() != TYPEID_PLAYER) continue; Aura *AuraIntenseCold = pTarget->GetAura(SPELL_INTENSE_COLD_TRIGGERED); if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2) { bMoreThanTwoIntenseCold = true; break; } }*/ Map::PlayerList const &players = pInstance->instance->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) { Aura *AuraIntenseCold = itr->getSource()->GetAura(SPELL_INTENSE_COLD_TRIGGERED); if (AuraIntenseCold) if (AuraIntenseCold->GetStackAmount() > 2) lMoreThanTwoIntenseCold.insert(itr->getSource()->GetGUID()); } uiCheckIntenseColdTimer = 2*IN_MILLISECONDS; } else uiCheckIntenseColdTimer -= diff; if (!bEnrage && HealthBelowPct(25)) { DoScriptText(SAY_ENRAGE, me); DoCast(me, SPELL_ENRAGE); bEnrage = true; } if (uiCrystalfireBreathTimer <= diff) { DoCast(me->getVictim(), SPELL_CRYSTALFIRE_BREATH); uiCrystalfireBreathTimer = 14*IN_MILLISECONDS; } else uiCrystalfireBreathTimer -= diff; if (uiTailSweepTimer <= diff) { DoCast(me, SPELL_TAIL_SWEEP); uiTailSweepTimer = 5*IN_MILLISECONDS; } else uiTailSweepTimer -= diff; if (uiCrystalChainsCrystalizeTimer <= diff) { DoScriptText(SAY_CRYSTAL_NOVA, me); if (IsHeroic()) DoCast(me, SPELL_CRYSTALIZE); else if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_CRYSTAL_CHAINS); uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILLISECONDS,11*IN_MILLISECONDS); } else uiCrystalChainsCrystalizeTimer -= diff; DoMeleeAttackIfReady(); }
void EnterCombat(Unit* /*who*/) { DoCast(me, DUNGEON_MODE(SPELL_MOJO_VOLLEY,H_SPELL_MOJO_VOLLEY)); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (TargetTimer <= diff && Enslaved == false) { EnslaveTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); TargetTimer = 1000; } else TargetTimer -= diff; if (EnslaveEndTimer <= diff && Enslaved == true) { me->SetReactState(REACT_AGGRESSIVE); EnslaveTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); EnslaveTarget->RemoveAurasDueToSpell(SPELL_ENSLAVE); EnslaveTarget->RemoveAurasDueToSpell(SPELL_ENSLAVE_BUFF); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Enslaved = false; EnslaveTimer = 30000; AbsorbMagicTimer = 20000; MindFogTimer = urand(6000,12000); UnrelentingAgonyTimer = 10000; EnslaveEndTimer = 90000; } else EnslaveEndTimer -= diff; if (EnslaveTimer <= diff && Enslaved == false) { if (EnslaveTarget) { DoZoneInCombat(); me->SetReactState(REACT_PASSIVE); DoCast(EnslaveTarget, SPELL_ENSLAVE); DoCast(EnslaveTarget, SPELL_ENSLAVE_BUFF); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); DoScriptText(RAND(SAY_MIND_CONTROL_1,SAY_MIND_CONTROL_2,SAY_MIND_CONTROL_3), me); Enslaved = true; EnslaveTimer = 180000; AbsorbMagicTimer = 180000; MindFogTimer = 180000; UnrelentingAgonyTimer = 180000; EnslaveEndTimer = DUNGEON_MODE(60000,30000); CastTimer = 2000; } EnslaveTimer = 1000; } else EnslaveTimer -= diff; if (EnslaveTarget && Enslaved == true) if (EnslaveTarget->HealthBelowPct(50)) { me->SetReactState(REACT_AGGRESSIVE); EnslaveTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); EnslaveTarget->RemoveAurasDueToSpell(SPELL_ENSLAVE); EnslaveTarget->RemoveAurasDueToSpell(SPELL_ENSLAVE_BUFF); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Enslaved = false; EnslaveTimer = 30000; AbsorbMagicTimer = 20000; MindFogTimer = urand(6000,12000); UnrelentingAgonyTimer = 10000; } if (CastTimer <= diff && Enslaved == true) { if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, NotCharmedTargetSelector())) { switch(EnslaveTarget->getClass()) { case CLASS_DRUID: if (urand(0, 1)) EnslaveTarget->CastSpell(target, 8921, false); else EnslaveTarget->CastSpell(me, 774, false); break; case CLASS_HUNTER: EnslaveTarget->CastSpell(target, RAND(2643, 1978), false); break; case CLASS_MAGE: EnslaveTarget->CastSpell(target, RAND(44614, 30455), false); break; case CLASS_WARLOCK: EnslaveTarget->CastSpell(target, RAND(980, 686), true); break; case CLASS_WARRIOR: EnslaveTarget->CastSpell(target, RAND(46924, 845), false); break; case CLASS_PALADIN: if (urand(0, 1)) EnslaveTarget->CastSpell(target, 853, false); else EnslaveTarget->CastSpell(me, 20473, false); break; case CLASS_PRIEST: if (urand(0,1)) EnslaveTarget->CastSpell(target, 34914, false); else EnslaveTarget->CastSpell(me, 139, false); break; case CLASS_SHAMAN: if (urand(0,1)) EnslaveTarget->CastSpell(target, 421, false); else EnslaveTarget->CastSpell(me, 61295, false); break; case CLASS_ROGUE: EnslaveTarget->CastSpell(target, RAND(16511, 1329), false); break; case CLASS_DEATH_KNIGHT: if (urand(0,1)) EnslaveTarget->CastSpell(target, 45462, true); else EnslaveTarget->CastSpell(target, 49184, true); break; } } CastTimer = 3000; } else CastTimer -= diff; if (AbsorbMagicTimer <= diff && Enslaved == false) { DoCast(me, SPELL_ABSORB_MAGIC); AbsorbMagicTimer = urand(15000, 20000); } else AbsorbMagicTimer -= diff; if (MindFogTimer <= diff && Enslaved == false) { DoCast(me, SPELL_MIND_FOG_SUMMON); DoScriptText(SAY_MIND_FOG, me); MindFogTimer = 18000; } else MindFogTimer -= diff; if (UnrelentingAgonyTimer <= diff && Enslaved == false) { DoCastAOE(SPELL_UNRELENTING_AGONY); UnrelentingAgonyTimer = 20000; } else UnrelentingAgonyTimer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 uiDiff) { //Return since we have no target if (!UpdateVictim()) return; if (!bIsFrenzy && HealthBelowPct(25) && !bIsExploded) { DoScriptText(SAY_ENRAGE, me); DoCast(me, DUNGEON_MODE(SPELL_FRENZY,SPELL_FRENZY_H), true); bIsFrenzy = true; } if (!bIsFrenzy) { if (uiBubbleCheckerTimer <= uiDiff) { if (!bIsExploded) { if (!me->HasAura(SPELL_PROTECTIVE_BUBBLE, 0)) { DoScriptText(SAY_SHATTER, me); DoCast(me, SPELL_DRAINED); DoCast(me, SPELL_BURST, true); bIsExploded = true; me->AttackStop(); me->SetVisible(false); for (uint8 i = 0; i < 10; i++) { int tmp = urand(0, MAX_SPAWN_LOC-1); me->SummonCreature(NPC_ICHOR_GLOBULE, SpawnLoc[tmp], TEMPSUMMON_CORPSE_DESPAWN); } } } else { bool bIsWaterElementsAlive = false; if (!m_waterElements.empty()) { for (std::list<uint64>::const_iterator itr = m_waterElements.begin(); itr != m_waterElements.end(); ++itr) if (Creature* pTemp = Unit::GetCreature(*me, *itr)) if (pTemp->isAlive()) { bIsWaterElementsAlive = true; break; } } if (!bIsWaterElementsAlive) DoExplodeCompleted(); } uiBubbleCheckerTimer = 1000; } else uiBubbleCheckerTimer -= uiDiff; } if (!bIsExploded) { if (uiWaterBoltVolleyTimer <= uiDiff) { if(!me->IsNonMeleeSpellCasted(false)) { DoCast(me, DUNGEON_MODE(SPELL_WATER_BOLT_VOLLEY,SPELL_WATER_BOLT_VOLLEY_H)); uiWaterBoltVolleyTimer = urand(10000, 15000); } } else uiWaterBoltVolleyTimer -= uiDiff; if (uiWaterBlastTimer <= uiDiff) { if(!me->IsNonMeleeSpellCasted(false)) { DoCast(me->getVictim(), DUNGEON_MODE(SPELL_WATER_BLAST,SPELL_WATER_BLAST_H)); uiWaterBlastTimer = urand(10000, 15000); } } else uiWaterBlastTimer -= uiDiff; DoMeleeAttackIfReady(); } }
void EnterCombat(Unit* who) { DoCast(DUNGEON_MODE(SPELL_EMPOWERING_BLOWS, SPELL_EMPOWERING_BLOWS_H)); }
void UpdateAI(uint32 const diff) { if (me->IsVisible() && !_movementStarted) { _movementStarted = true; _wpReached = true; _events.ScheduleEvent(EVENT_CLOUD, urand(5, 10) *IN_MILLISECONDS); _events.ScheduleEvent(EVENT_LEECH, urand(7, 12) *IN_MILLISECONDS); _events.ScheduleEvent(EVENT_UNSTUCK, 3*IN_MILLISECONDS); _events.ScheduleEvent(EVENT_SPAWN, 1*IN_MILLISECONDS); } if (_wpReached) { _wpReached = false; if (me->isInCombat()) { me->SetReactState(REACT_AGGRESSIVE); _events.ScheduleEvent(EVENT_FORCEMOVE, urand(7, 10) *IN_MILLISECONDS); } else me->GetMotionMaster()->MovePoint(_wpCount, HadronoxWaypoints[_wpCount]); } if (!UpdateVictim() && _engaged) return; _events.Update(diff); if (me->HasUnitState(UNIT_STAT_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { case EVENT_CLOUD: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60, false)) DoCast(target, DUNGEON_MODE(SPELL_ACID_CLOUD, H_SPELL_ACID_CLOUD)); _events.ScheduleEvent(EVENT_CLOUD, urand(25, 35) *IN_MILLISECONDS); break; case EVENT_LEECH: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20, false)) DoCast(target, DUNGEON_MODE(SPELL_LEECH_POISON, H_SPELL_LEECH_POISON)); _events.ScheduleEvent(EVENT_LEECH, urand(10, 20) *IN_MILLISECONDS); break; case EVENT_PIECRE: DoCastVictim(SPELL_PIERCE_ARMOR); _events.ScheduleEvent(EVENT_PIECRE, urand(15, 20) *IN_MILLISECONDS); break; case EVENT_GRAB: DoCast(me, DUNGEON_MODE(SPELL_WEB_GRAB, H_SPELL_WEB_GRAB)); DoCast(me, DUNGEON_MODE(SPELL_ACID_CLOUD, H_SPELL_ACID_CLOUD)); _events.ScheduleEvent(EVENT_GRAB, urand(17, 23) *IN_MILLISECONDS); break; case EVENT_SPAWN: me->SummonCreature(RAND(NPC_ADD_CHAMPION, NPC_ADD_CRYPT_FIEND, NPC_ADD_NECROMANCER), AddWaypoints[0]); _events.ScheduleEvent(EVENT_SPAWN, urand(1500, 3000)); break; case EVENT_FORCEMOVE: me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->MovePoint(_wpCount, HadronoxWaypoints[_wpCount]); break; case EVENT_UNSTUCK: if (me->getVictim()) if (me->IsWithinCombatRange(me->getVictim(), 10.0f) && !me->IsWithinLOSInMap(me->getVictim())) me->GetMotionMaster()->MoveJump(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10.0f, 1.0f, 1.0f); if (_engaged) { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150.0f, true); if (!target) EnterEvadeMode(); } _events.ScheduleEvent(EVENT_UNSTUCK, 3*IN_MILLISECONDS); break; } } DoMeleeAttackIfReady(); }
void EnterCombat(Unit* who) { DoCast(DUNGEON_MODE(SPELL_CHARGED_SKIN, SPELL_CHARGED_SKIN_H)); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (bCrystalSpikes) { if (uiCrystalSpikesTimer2 <= diff) { fSpikeXY[0][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO)); fSpikeXY[0][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO)); fSpikeXY[1][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO)); fSpikeXY[1][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO)); fSpikeXY[2][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2))); fSpikeXY[2][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2))); fSpikeXY[3][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2))); fSpikeXY[3][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2))); for (uint8 i = 0; i < 4; ++i) me->SummonCreature(MOB_CRYSTAL_SPIKE, fSpikeXY[i][0], fSpikeXY[i][1], fBaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7*IN_MILLISECONDS); if (++uiCrystalSpikesCount >= 15) bCrystalSpikes = false; uiCrystalSpikesTimer2 = 200; } else uiCrystalSpikesTimer2 -= diff; } if (!bFrenzy && HealthBelowPct(25)) { DoCast(me, SPELL_FRENZY); bFrenzy = true; } if (uiTrampleTimer <= diff) { DoCast(me, DUNGEON_MODE(SPELL_TRAMPLE,H_SPELL_TRAMPLE)); uiTrampleTimer = 10*IN_MILLISECONDS; } else uiTrampleTimer -= diff; if (uiSpellReflectionTimer <= diff) { DoScriptText(SAY_REFLECT, me); DoCast(me, SPELL_SPELL_REFLECTION); uiSpellReflectionTimer = urand(25*IN_MILLISECONDS, 30*IN_MILLISECONDS); uiReflectCount=4; } else uiSpellReflectionTimer -= diff; if (breflect) if (uiReflect<=diff) { me->RemoveAura(SPELL_SPELL_REFLECTION,0,0,AURA_REMOVE_BY_EXPIRE); uiReflect=14500; } else uiReflect-=diff; if (uiCrystalSpikesTimer <= diff) { DoScriptText(SAY_CRYSTAL_SPIKES, me); bCrystalSpikes = true; uiCrystalSpikesCount = 1; uiCrystalSpikesTimer2 = 0; fBaseX = me->GetPositionX(); fBaseY = me->GetPositionY(); fBaseZ = me->GetPositionZ(); fBaseO = me->GetOrientation(); uiCrystalSpikesTimer = urand(15*IN_MILLISECONDS, 20*IN_MILLISECONDS); } else uiCrystalSpikesTimer -= diff; if (IsHeroic() && (uiSummonCrystallineTanglerTimer <= diff)) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { if (Creature *pTangler = me->SummonCreature(MOB_CRYSTALLINE_TANGLER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000)) { pTangler->CastSpell(pTangler, SPELL_TANGLE, true); pTangler->AI()->AttackStart(target); pTangler->getThreatManager().addThreat(target, 1.0f); } } uiSummonCrystallineTanglerTimer = urand(5*IN_MILLISECONDS, 15*IN_MILLISECONDS); } else uiSummonCrystallineTanglerTimer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) { return; } if (bCrystalSpikes) { if (uiCrystalSpikesTimer2 <= diff) { fSpikeXY[0][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO)); fSpikeXY[0][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO)); fSpikeXY[1][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO)); fSpikeXY[1][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO)); fSpikeXY[2][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2))); fSpikeXY[2][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2))); fSpikeXY[3][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2))); fSpikeXY[3][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2))); for (uint8 i = 0; i < 4; ++i) me->SummonCreature(MOB_CRYSTAL_SPIKE, fSpikeXY[i][0], fSpikeXY[i][1], fBaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7*IN_MILLISECONDS); if (++uiCrystalSpikesCount >= 15) bCrystalSpikes = false; uiCrystalSpikesTimer2 = 200; } else uiCrystalSpikesTimer2 -= diff; } if (!bFrenzy && HealthBelowPct(25)) { DoCast(me, SPELL_FRENZY); bFrenzy = true; } if (uiTrampleTimer <= diff) { DoCast(me, DUNGEON_MODE(SPELL_TRAMPLE,H_SPELL_TRAMPLE)); uiTrampleTimer = 10*IN_MILLISECONDS; } else uiTrampleTimer -= diff; if (uiSpellReflectionTimer <= diff) { DoScriptText(SAY_REFLECT, me); DoCast(me, SPELL_SPELL_REFLECTION); uiSpellReflectionTimer = 30*IN_MILLISECONDS; uiReflectCount=4; } else uiSpellReflectionTimer -= diff; if (breflect) if (uiReflect<=diff) { me->RemoveAura(SPELL_SPELL_REFLECTION,0,0,AURA_REMOVE_BY_EXPIRE); uiReflect=14500; } else uiReflect-=diff; if (uiCrystalSpikesTimer <= diff) { DoScriptText(SAY_CRYSTAL_SPIKES, me); bCrystalSpikes = true; uiCrystalSpikesCount = 1; uiCrystalSpikesTimer2 = 0; fBaseX = me->GetPositionX(); fBaseY = me->GetPositionY(); fBaseZ = me->GetPositionZ(); fBaseO = me->GetOrientation(); uiCrystalSpikesTimer = 20*IN_MILLISECONDS; } else uiCrystalSpikesTimer -= diff; if (IsHeroic() && (uiSummonCrystallineTanglerTimer <= diff)) { Creature* Crystalline_Tangler = me->SummonCreature(MOB_CRYSTALLINE_TANGLER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); if (Crystalline_Tangler) { Unit *pTarget = NULL; uint8 Healer = 0; for (uint8 j = 1; j <= 4; j++) { switch (j) { case 1: Healer = CLASS_PRIEST; break; case 2: Healer = CLASS_PALADIN; break; case 3: Healer = CLASS_DRUID; break; case 4: Healer = CLASS_SHAMAN; break; } std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (; i != me->getThreatManager().getThreatList().end(); ++i) { Unit* pTemp = Unit::GetUnit((*me),(*i)->getUnitGuid()); if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer) { pTarget = pTemp; break; } } if (pTarget) break; } if (!pTarget) pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); if (pTarget) { Crystalline_Tangler->AI()->AttackStart(pTarget); Crystalline_Tangler->getThreatManager().addThreat(pTarget, 1000000000.0f); } } uiSummonCrystallineTanglerTimer = 17*IN_MILLISECONDS; } else uiSummonCrystallineTanglerTimer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { //Return since we have no target if (!UpdateVictim()) return; if (bIsWaitingToAppear) { m_creature->StopMoving(); m_creature->AttackStop(); if (uiIsWaitingToAppearTimer <= diff) { m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); bIsWaitingToAppear = false; } else uiIsWaitingToAppearTimer -= diff; return; } if ((Phase == 1) ||(Phase == 3)) { if (bIsAchievementTimerRunning) uiAchievementTimer += diff; if (bFireMagusDead && bFrostMagusDead && bArcaneMagusDead) { if (uiAchievementTimer <= ACHIEV_TIMER) uiAchievementProgress +=1; m_creature->GetMotionMaster()->Clear(); m_creature->GetMap()->CreatureRelocation(m_creature, CenterOfRoom.GetPositionX(), CenterOfRoom.GetPositionY(), CenterOfRoom.GetPositionZ(), CenterOfRoom.GetOrientation()); DoCast(m_creature, SPELL_TELESTRA_BACK); m_creature->SetVisibility(VISIBILITY_ON); if (Phase == 1) Phase = 2; if (Phase == 3) Phase = 4; uiFireMagusGUID = 0; uiFrostMagusGUID = 0; uiArcaneMagusGUID = 0; bIsWaitingToAppear = true; uiIsWaitingToAppearTimer = 4*IN_MILISECONDS; DoScriptText(SAY_MERGE, m_creature); bIsAchievementTimerRunning = false; uiAchievementTimer = 0; } else return; } if ((Phase == 0) && HealthBelowPct(50)) { Phase = 1; m_creature->CastStop(); m_creature->RemoveAllAuras(); m_creature->SetVisibility(VISIBILITY_OFF); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); uiFireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); uiFrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); uiArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); bFireMagusDead = false; bFrostMagusDead = false; bArcaneMagusDead = false; DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature); return; } if (IsHeroic() && (Phase == 2) && HealthBelowPct(10)) { Phase = 3; m_creature->CastStop(); m_creature->RemoveAllAuras(); m_creature->SetVisibility(VISIBILITY_OFF); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); uiFireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); uiFrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); uiArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); bFireMagusDead = false; bFrostMagusDead = false; bArcaneMagusDead = false; DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature); return; } if (uiCooldown) { if (uiCooldown <= diff) uiCooldown = 0; else { uiCooldown -= diff; return; } } if (uiIceNovaTimer <= diff) { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, DUNGEON_MODE(SPELL_ICE_NOVA, H_SPELL_ICE_NOVA)); uiCooldown = 1.5*IN_MILISECONDS; } uiIceNovaTimer = 15*IN_MILISECONDS; } else uiIceNovaTimer -= diff; if (uiGravityWellTimer <= diff) { if (Unit *pTarget = m_creature->getVictim()) { DoCast(pTarget, SPELL_GRAVITY_WELL); uiCooldown = 6*IN_MILISECONDS; } uiGravityWellTimer = 15*IN_MILISECONDS; } else uiGravityWellTimer -= diff; if (uiFireBombTimer <= diff) { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, DUNGEON_MODE(SPELL_FIREBOMB, H_SPELL_FIREBOMB)); uiCooldown = 2*IN_MILISECONDS; } uiFireBombTimer = 2*IN_MILISECONDS; } else uiFireBombTimer -=diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (!bTransformated && HealthBelowPct(50)) //transform at least once at 50% health { bTransformated = true; uiPhaseCounter = 2; } switch (Phase) { case TROLL: if (uiPhaseCounter >= 2) { if (uiTransformationTimer <= diff) { me->SetDisplayId(DISPLAY_RHINO); Phase = RHINO; uiPhaseCounter = 0; DoScriptText(SAY_TRANSFORM_1, me); uiTransformationTimer = 5*IN_MILLISECONDS; bStartOfTransformation = true; bTransformated = true; me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); me->SetReactState(REACT_AGGRESSIVE); } else { uiTransformationTimer -= diff; if (bStartOfTransformation) { bStartOfTransformation = false; me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); me->SetReactState(REACT_PASSIVE); } } } else { if (uiStampedeTimer <= diff) { DoCast(me, SPELL_STAMPEDE); DoScriptText(RAND(SAY_SUMMON_1,SAY_SUMMON_2,SAY_SUMMON_3),me); uiStampedeTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS); } else uiStampedeTimer -= diff; if (uiWhirlingSlashTimer <= diff) { DoCast(me->getVictim(), DUNGEON_MODE(SPELL_WHIRLING_SLASH, H_SPELL_WHIRLING_SLASH)); uiWhirlingSlashTimer = urand(18*IN_MILLISECONDS,22*IN_MILLISECONDS);; ++uiPhaseCounter; } else uiWhirlingSlashTimer -= diff; } break; case RHINO: if (uiPhaseCounter >= 2) { if (uiTransformationTimer <= diff) { me->SetDisplayId(DISPLAY_TROLL); Phase = TROLL; uiPhaseCounter = 0; DoScriptText(SAY_TRANSFORM_2, me); uiTransformationTimer = 6*IN_MILLISECONDS; bStartOfTransformation = true; me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); me->SetReactState(REACT_AGGRESSIVE); } else { uiTransformationTimer -= diff; if (bStartOfTransformation) { bStartOfTransformation = false; me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); me->SetReactState(REACT_PASSIVE); } } } else { if (uiPunctureTimer <= diff) { DoCast(me->getVictim(), DUNGEON_MODE(SPELL_PUNCTURE, H_SPELL_PUNCTURE)); uiPunctureTimer = 15*IN_MILLISECONDS; } else uiPunctureTimer -= diff; if (uiEnrageTimer <= diff) { DoCast(me->getVictim(), DUNGEON_MODE(SPELL_ENRAGE, H_SPELL_ENRAGE)); uiEnrageTimer = 20*IN_MILLISECONDS; } else uiEnrageTimer -= diff; if (uiStompTimer <= diff) { DoCast(me->getVictim(), DUNGEON_MODE(SPELL_STOMP, H_SPELL_STOMP)); uiStompTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS); } else uiStompTimer -= diff; if (uiImpalingChargeTimer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) { DoCast(target, DUNGEON_MODE(SPELL_IMPALING_CHARGE, H_SPELL_IMPALING_CHARGE)); target->CastSpell(me, SPELL_IMPALING_CHARGE_VEHICLE, true); // needs vehicle id and take dmg while seated CheckAchievement(target->GetGUID()); } uiImpalingChargeTimer = 20*IN_MILLISECONDS; ++uiPhaseCounter; } else uiImpalingChargeTimer -= diff; } break; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if(!UpdateVictim()) return; switch(uiPhase) { case PHASE_UNDERGROUND: if(uiImpaleTimer <= diff) { switch(uiImpalePhase) { case IMPALE_PHASE_TARGET: if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) { if(Creature* pImpaleTarget = DoSummonImpaleTarget(target)) pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SHAKEGROUND, true); uiImpaleTimer = 3*IN_MILLISECONDS; uiImpalePhase = IMPALE_PHASE_ATTACK; } break; case IMPALE_PHASE_ATTACK: if(Creature* pImpaleTarget = Unit::GetCreature(*me, uiImpaleTarget)) { pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SPIKE, false); pImpaleTarget->RemoveAurasDueToSpell(SPELL_IMPALE_SHAKEGROUND); } uiImpalePhase = IMPALE_PHASE_DMG; uiImpaleTimer = 1*IN_MILLISECONDS; break; case IMPALE_PHASE_DMG: if(Creature* pImpaleTarget = Unit::GetCreature(*me, uiImpaleTarget)) me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_IMPALE_DMG, SPELL_IMPALE_DMG_H), true); uiImpalePhase = IMPALE_PHASE_TARGET; uiImpaleTimer = 9*IN_MILLISECONDS; break; } } else uiImpaleTimer -= diff; if(!bGuardianSummoned) { for(uint8 i = 0; i < 2; ++i) { if(Creature* Guardian = me->SummonCreature(CREATURE_GUARDIAN, SpawnPointGuardian[i], TEMPSUMMON_CORPSE_DESPAWN, 0)) { Guardian->AddThreat(me->getVictim(), 0.0f); DoZoneInCombat(Guardian); } } bGuardianSummoned = true; } if(!bVenomancerSummoned) { if(uiVenomancerTimer <= diff) { if(uiUndergroundPhase > 1) { for(uint8 i = 0; i < 2; ++i) { if(Creature* Venomancer = me->SummonCreature(CREATURE_VENOMANCER, SpawnPoint[i], TEMPSUMMON_CORPSE_DESPAWN, 0)) { Venomancer->AddThreat(me->getVictim(), 0.0f); DoZoneInCombat(Venomancer); } } bVenomancerSummoned = true; } } else uiVenomancerTimer -= diff; } if(!bDatterSummoned) { if(uiDatterTimer <= diff) { if(uiUndergroundPhase > 2) { for(uint8 i = 0; i < 2; ++i) { if(Creature* Datter = me->SummonCreature(CREATURE_DATTER, SpawnPoint[i], TEMPSUMMON_CORPSE_DESPAWN, 0)) { Datter->AddThreat(me->getVictim(), 0.0f); DoZoneInCombat(Datter); } } bDatterSummoned = true; } } else uiDatterTimer -= diff; } if(uiUndergroundTimer <= diff) { me->RemoveAura(SPELL_SUBMERGE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); uiPhase = PHASE_MELEE; } else uiUndergroundTimer -= diff; break; case PHASE_MELEE: if(((uiUndergroundPhase == 0 && HealthBelowPct(75)) || (uiUndergroundPhase == 1 && HealthBelowPct(50)) || (uiUndergroundPhase == 2 && HealthBelowPct(25))) && !me->HasUnitState(UNIT_STAT_CASTING)) { bGuardianSummoned = false; bVenomancerSummoned = false; bDatterSummoned = false; uiUndergroundTimer = 40*IN_MILLISECONDS; uiVenomancerTimer = 25*IN_MILLISECONDS; uiDatterTimer = 32*IN_MILLISECONDS; uiImpalePhase = 0; uiImpaleTimer = 9*IN_MILLISECONDS; DoCast(me, SPELL_SUBMERGE, false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); uiPhase = PHASE_UNDERGROUND; ++uiUndergroundPhase; } if(bChanneling == true) { for(uint8 i = 0; i < 8; ++i) DoCast(me->getVictim(), SPELL_SUMMON_CARRION_BEETLES, true); bChanneling = false; } else if(uiCarrionBeetlesTimer <= diff) { bChanneling = true; DoCastVictim(SPELL_CARRION_BEETLES); uiCarrionBeetlesTimer = 25*IN_MILLISECONDS; } else uiCarrionBeetlesTimer -= diff; if(uiLeechingSwarmTimer <= diff) { DoCast(me, SPELL_LEECHING_SWARM, true); uiLeechingSwarmTimer = 19*IN_MILLISECONDS; } else uiLeechingSwarmTimer -= diff; if(uiPoundTimer <= diff) { if(Unit* target = me->getVictim()) { if(Creature* pImpaleTarget = DoSummonImpaleTarget(target)) me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_POUND, SPELL_POUND_H), false); } uiPoundTimer = 16500; } else uiPoundTimer -= diff; DoMeleeAttackIfReady(); break; } }
void UpdateAI(const uint32 diff) { if (pInstance && pInstance->GetData(DATA_REMOVE_NPC) == 1) { me->DespawnOrUnsummon(); pInstance->SetData(DATA_REMOVE_NPC, 0); } //Return since we have no target if (!UpdateVictim()) return; if (uiArcaneVacuumTimer <= diff) { if(!me->IsNonMeleeSpellCasted(false)) { DoCast(SPELL_ARCANE_VACUUM); uiArcaneVacuumTimer = 30000; } } else uiArcaneVacuumTimer -= diff; if (uiBlizzardTimer <= diff) { if(!me->IsNonMeleeSpellCasted(false)) { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_BLIZZARD); uiBlizzardTimer = 15000; } } else uiBlizzardTimer -= diff; if (uiTailSweepTimer <= diff) { if(!me->IsNonMeleeSpellCasted(false)) { DoCast(DUNGEON_MODE(SPELL_TAIL_SWEEP,H_SPELL_TAIL_SWEEP)); uiTailSweepTimer = 5000; } } else uiTailSweepTimer -= diff; if (uiUncontrollableEnergyTimer <= diff) { DoCastVictim(SPELL_UNCONTROLLABLE_ENERGY); uiUncontrollableEnergyTimer = 25000; } else uiUncontrollableEnergyTimer -= diff; if (IsHeroic()) { if (uiManaDestructionTimer <= diff) { if(!me->IsNonMeleeSpellCasted(false)) { if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_MANA_DESTRUCTION); uiManaDestructionTimer = 30000; } } else uiManaDestructionTimer -= diff; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if(!UpdateVictim()) return; if(m_bIsAura) { if(m_uiPulsingShockwave_Timer <= diff) { Map* pMap = me->GetMap(); if(pMap->IsDungeon()) { Map::PlayerList const &PlayerList = pMap->GetPlayers(); if(PlayerList.isEmpty()) return; float fDist=0; for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if(i->getSource() && i->getSource()->isAlive() && i->getSource()->isTargetableForAttack()) { float fDistTemp = me->GetExactDist(i->getSource()->GetPositionX(), i->getSource()->GetPositionY(), i->getSource()->GetPositionZ()); if(fDistTemp>fDist) fDist=fDistTemp; } } int32 dmg= int32(DUNGEON_MODE(100, 150)*fDist); int32 range=200; me->CastCustomSpell(me->getVictim(), DUNGEON_MODE(52942, 59837), &dmg, &range, 0, false); } m_uiPulsingShockwave_Timer = 2000; } else m_uiPulsingShockwave_Timer -= diff; } else { if(m_uiResumePulsingShockwave_Timer <= diff) { DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true); DoCast(me, DUNGEON_MODE(SPELL_PULSING_SHOCKWAVE_N,SPELL_PULSING_SHOCKWAVE_H)); m_bIsAura = true; m_uiResumePulsingShockwave_Timer = 0; } else m_uiResumePulsingShockwave_Timer -= diff; } if(m_uiArcLightning_Timer <= diff) { if(Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_ARC_LIGHTNING); bHit=true; m_uiArcLightning_Timer = 15000 + rand()%1000; } else m_uiArcLightning_Timer -= diff; if(m_uiLightningNova_Timer <= diff) { DoScriptText(RAND(SAY_NOVA_1,SAY_NOVA_2,SAY_NOVA_3), me); DoScriptText(EMOTE_NOVA, me); DoCast(me, DUNGEON_MODE(SPELL_LIGHTNING_NOVA_N,SPELL_LIGHTNING_NOVA_H)); m_bIsAura = false; m_uiResumePulsingShockwave_Timer = DUNGEON_MODE(5000, 4000); m_uiLightningNova_Timer = 20000 + rand()%1000; } else m_uiLightningNova_Timer -= diff; if(HealthBelowPct(100 - 25 * m_uiHealthAmountModifier)) { switch(m_uiHealthAmountModifier) { case 1: DoScriptText(SAY_75HEALTH, me); break; case 2: DoScriptText(SAY_50HEALTH, me); break; case 3: DoScriptText(SAY_25HEALTH, me); break; } ++m_uiHealthAmountModifier; } DoMeleeAttackIfReady(); }
void Reset() { Apprentice_Timer = DUNGEON_MODE(20000, 10000); ArcaneBolt_Timer = 1000; Check_Timer = 1000; }
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) { if (spellInfo->Id == SPELL_FOCUS_CAST) target->CastSpell(target, DUNGEON_MODE(SPELL_FIERY_BLAST_N, SPELL_FIERY_BLAST_H), false); }
void UpdateAI(const uint32 uiDiff) { //Return since we have no target if (!UpdateVictim()) return; // Splitted if (!me->IsVisible()) { if (uiSplitTimer <= uiDiff) { uiSplitTimer = 2500; // Return sparks to where Ionar splitted if (bIsSplitPhase) { CallBackSparks(); bIsSplitPhase = false; } // Lightning effect and restore Ionar else if (lSparkList.empty()) { me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE); DoCast(me, SPELL_SPARK_DESPAWN, false); uiSplitTimer = 25*IN_MILLISECONDS; bIsSplitPhase = true; if (me->getVictim()) me->GetMotionMaster()->MoveChase(me->getVictim()); } } else uiSplitTimer -= uiDiff; return; } if (uiStaticOverloadTimer <= uiDiff) { if (!me->IsNonMeleeSpellCasted(false)) { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, DUNGEON_MODE(SPELL_STATIC_OVERLOAD,H_SPELL_STATIC_OVERLOAD)); uiStaticOverloadTimer = 11*IN_MILLISECONDS; } } else uiStaticOverloadTimer -= uiDiff; if (uiBallLightningTimer <= uiDiff) { if (!me->IsNonMeleeSpellCasted(false)) { if (Unit* pTemp = SelectTarget(SELECT_TARGET_RANDOM,1,100,true)) DoCast(pTemp, DUNGEON_MODE(SPELL_BALL_LIGHTNING,H_SPELL_BALL_LIGHTNING)); else DoCast(me->getVictim(), DUNGEON_MODE(SPELL_BALL_LIGHTNING,H_SPELL_BALL_LIGHTNING)); uiBallLightningTimer = 10*IN_MILLISECONDS; } } else uiBallLightningTimer -= uiDiff; // Health check if (me->HealthBelowPct(100 - 20 * uiHealthAmountModifier)) { ++uiHealthAmountModifier; DoScriptText(RAND(SAY_SPLIT_1, SAY_SPLIT_2), me); if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); DoCast(me, SPELL_DISPERSE, false); } DoMeleeAttackIfReady(); }
void UpdateAI(uint32 diff) { events.Update(diff); uint32 eventId = events.GetEvent(); if (eventId == EVENT_SPELL_INHIBIT_MAGIC) { Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers(); for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) if (Player* player = i->GetSource()) { float dist = me->GetDistance(player); if (player->IsAlive() && dist < 45.0f) { Aura* aura = player->GetAura(SPELL_INHIBIT_MAGIC); if (!aura) aura = me->AddAura(SPELL_INHIBIT_MAGIC, player); else aura->RefreshDuration(); if (aura) aura->SetStackAmount(getStackCount(dist)); } else player->RemoveAurasDueToSpell(SPELL_INHIBIT_MAGIC); } events.RepeatEvent(3000); return; } if (!UpdateVictim()) return; switch (eventId) { case EVENT_SPELL_ATTRACT_MAGIC: me->CastSpell(me, SPELL_ATTRACT_MAGIC, false); events.RepeatEvent(30000); events.RescheduleEvent(EVENT_SPELL_CARNIVOROUS, 1500); break; case EVENT_SPELL_CARNIVOROUS: me->CastSpell(me, DUNGEON_MODE(SPELL_CARNIVOROUS_BITE_N, SPELL_CARNIVOROUS_BITE_H), false); events.RepeatEvent(10000); break; case EVENT_SPELL_FOCUS_FIRE: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true)) { if (Creature* cr = me->SummonCreature(ENTRY_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 7000)) focusGUID = cr->GetGUID(); Talk(EMOTE_FOCUSED, target); } events.RepeatEvent(urand(15000, 20000)); events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_2, 3000); events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_2, 3500); events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_2, 4000); events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_3, 5000); me->SetControlled(true, UNIT_STATE_ROOT); break; case EVENT_SPELL_FOCUS_FIRE_2: if (Unit* flare = ObjectAccessor::GetCreature(*me, focusGUID)) me->CastSpell(flare, SPELL_FOCUS_CAST, true); events.PopEvent(); break; case EVENT_SPELL_FOCUS_FIRE_3: me->SetControlled(false, UNIT_STATE_ROOT); events.PopEvent(); break; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (Phase == NORMAL) { if (!bMove && uiMoveTimer > diff) { uiMoveTimer -= diff; return; } else if (!bMove) { DoStartMovement(me->getVictim()); pSacrificeTarget = NULL; bMove = true; } //Return since we have no target if (!UpdateVictim()) return; if (uiSinsterStrikeTimer <= diff) { DoCast(me->getVictim(), DUNGEON_MODE(SPELL_SINISTER_STRIKE, H_SPELL_SINISTER_STRIKE)); uiSinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS); } else uiSinsterStrikeTimer -= diff; if (uiCallFlamesTimer <= diff) //move to send event scripts? { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) { if (!bFlames) { DoCast(target, SPELL_CALL_FLAMES); bFlames = true; } if (uiFlamesCount < 3) { if (Creature* pBrazier = Creature::GetCreature(*me, RAND(uiFlameBrazier_1, uiFlameBrazier_2))) { if (IsHeroic()) // find correct spell { int dmg = 3825 + rand()%1350; pBrazier->CastCustomSpell(pBrazier, SPELL_BALL_OF_FLAME, &dmg, 0, 0, true); } else pBrazier->CastSpell(pBrazier, SPELL_BALL_OF_FLAME, true); } uiCallFlamesTimer = 1*IN_MILLISECONDS; ++uiFlamesCount; } else { bFlames = false; uiCallFlamesTimer = urand(8 * IN_MILLISECONDS, 12 * IN_MILLISECONDS); uiFlamesCount = 0; } } } else uiCallFlamesTimer -= diff; if ((me->GetHealth()*100 / me->GetMaxHealth()) < (100-(25*uiHealthAmountModifier))) { ++uiHealthAmountModifier; pSacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); if (pSacrificeTarget) { DoScriptText(RAND(SAY_SACRIFICE_PLAYER_1, SAY_SACRIFICE_PLAYER_2, SAY_SACRIFICE_PLAYER_3, SAY_SACRIFICE_PLAYER_4, SAY_SACRIFICE_PLAYER_5), me); me->GetMotionMaster()->Clear(); DoCast(pSacrificeTarget, SPELL_RITUAL_OF_THE_SWORD); DoTeleportPlayer(pSacrificeTarget, 296.632f, -346.075f, 90.63f, 4.6f); Phase = SACRIFICING; for (uint8 i = 0; i < 3; ++i) if (Creature* pRitualChanneler = me->SummonCreature(CREATURE_RITUAL_CHANNELER, RitualChannelerPos[i], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 100*HOUR)) if (pRitualChanneler->AI()) pRitualChanneler->AI()->SetGUID(pSacrificeTarget->GetGUID()); } } DoMeleeAttackIfReady(); } else //SACRIFICING { if (uiSacrificeTimer <= diff) { Creature* target = Creature::GetCreature(*me, uiRitualTarget); if (target) { DoCast(me, SPELL_RITUAL_STRIKE_TRIGGER, true); DoCast(me, SPELL_RITUAL_OF_THE_SWORD_DISARM, true); } bMove = false; Phase = NORMAL; uiMoveTimer = 23*IN_MILLISECONDS; uiSacrificeTimer = 2*IN_MILLISECONDS; uiSinsterStrikeTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS); uiCallFlamesTimer = urand(13*IN_MILLISECONDS, 18*IN_MILLISECONDS); } else uiSacrificeTimer -= diff; } }
npc_malignantAI(Creature *c) : ScriptedAI(c) { me->AddAura(DUNGEON_MODE(MODGUD_MALICE,MODGUD_MALICE_H), me); die = false; }