void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (ArcingSmashTimer <= diff) { DoCastVictim(SPELL_ARCING_SMASH); ArcingSmashTimer = 10000; } else ArcingSmashTimer -= diff; if (FelAcidTimer <= diff) { DoCastVictim(SPELL_FEL_ACID); FelAcidTimer = 25000; } else FelAcidTimer -= diff; if (!me->HasAura(SPELL_BERSERK)) { if (EnrageTimer <= diff) { DoCast(me, SPELL_BERSERK); Talk(SAY_ENRAGE); } else EnrageTimer -= diff; } if (Phase1) { if (BewilderingStrikeTimer <= diff) { DoCastVictim(SPELL_BEWILDERING_STRIKE); float mt_threat = DoGetThreat(me->GetVictim()); if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1)) me->AddThreat(target, mt_threat); BewilderingStrikeTimer = 20000; } else BewilderingStrikeTimer -= diff; if (EjectTimer <= diff) { DoCastVictim(SPELL_EJECT1); DoModifyThreatPercent(me->GetVictim(), -40); EjectTimer = 15000; } else EjectTimer -= diff; if (AcidicWoundTimer <= diff) { DoCastVictim(SPELL_ACIDIC_WOUND); AcidicWoundTimer = 10000; } else AcidicWoundTimer -= diff; if (BloodboilTimer <= diff) { if (BloodboilCount < 5) // Only cast it five times. { //CastBloodboil(); // Causes issues on windows, so is commented out. DoCastVictim(SPELL_BLOODBOIL); ++BloodboilCount; BloodboilTimer = 10000*BloodboilCount; } } else BloodboilTimer -= diff; } if (!Phase1) { if (AcidGeyserTimer <= diff) { DoCastVictim(SPELL_ACID_GEYSER); AcidGeyserTimer = 30000; } else AcidGeyserTimer -= diff; if (EjectTimer <= diff) { DoCastVictim(SPELL_EJECT2); EjectTimer = 15000; } else EjectTimer -= diff; } if (PhaseChangeTimer <= diff) { if (Phase1) { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target && target->isAlive()) { Phase1 = false; TargetThreat = DoGetThreat(target); TargetGUID = target->GetGUID(); target->CastSpell(me, SPELL_TAUNT_GURTOGG, true); if (DoGetThreat(target)) DoModifyThreatPercent(target, -100); me->AddThreat(target, 50000000.0f); me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); // If VMaps are disabled, this spell can call the whole instance DoCast(me, SPELL_INSIGNIFIGANCE, true); DoCast(target, SPELL_FEL_RAGE_TARGET, true); DoCast(target, SPELL_FEL_RAGE_2, true); /* These spells do not work, comment them out for now. DoCast(target, SPELL_FEL_RAGE_2, true); DoCast(target, SPELL_FEL_RAGE_3, true);*/ //Cast this without triggered so that it appears in combat logs and shows visual. DoCast(me, SPELL_FEL_RAGE_SELF); Talk(SAY_SPECIAL); AcidGeyserTimer = 1000; PhaseChangeTimer = 30000; } } else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage { if (TargetGUID) RevertThreatOnTarget(TargetGUID); TargetGUID = 0; Phase1 = true; BloodboilTimer = 10000; BloodboilCount = 0; AcidicWoundTimer += 2000; ArcingSmashTimer += 2000; FelAcidTimer += 2000; EjectTimer += 2000; PhaseChangeTimer = 60000; me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false); } } else PhaseChangeTimer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; //ArcaneMissiles_Timer if (ArcaneMissiles_Timer <= diff) { DoCast(me->getVictim(), SPELL_ARCANEMISSILES); ArcaneMissiles_Timer = 8000; } else ArcaneMissiles_Timer -= diff; //ShadowShield_Timer if (ShadowShield_Timer <= diff) { DoCast(me, SPELL_SHADOWSHIELD); ShadowShield_Timer = 14000 + rand()%14000; } else ShadowShield_Timer -= diff; //Curse_Timer if (Curse_Timer <= diff) { DoCast(me->getVictim(), SPELL_CURSE); Curse_Timer = 15000 + rand()%12000; } else Curse_Timer -= diff; //Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer. //We will only telport if gandling has more than 3% of hp so teleported gamers can always loot. if (me->GetHealth()*100 / me->GetMaxHealth() > 3) { if (Teleport_Timer <= diff) { Unit* pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) { if (DoGetThreat(pTarget)) DoModifyThreatPercent(pTarget, -100); Creature* Summoned = NULL; switch(rand()%6) { case 0: DoTeleportPlayer(pTarget, 250.0696f,0.3921f,84.8408f,3.149f); Summoned = me->SummonCreature(16119,254.2325f,0.3417f,84.8407f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,257.7133f,4.0226f,84.8407f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,258.6702f,-2.60656f,84.8407f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); break; case 1: DoTeleportPlayer(pTarget, 181.4220f,-91.9481f,84.8410f,1.608f); Summoned = me->SummonCreature(16119,184.0519f,-73.5649f,84.8407f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,179.5951f,-73.7045f,84.8407f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,180.6452f,-78.2143f,84.8407f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,283.2274f,-78.1518f,84.8407f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); break; case 2: DoTeleportPlayer(pTarget, 95.1547f,-1.8173f,85.2289f,0.043f); Summoned = me->SummonCreature(16119,100.9404f,-1.8016f,85.2289f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,101.3729f,0.4882f,85.2289f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,101.4596f,-4.4740f,85.2289f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); break; case 3: DoTeleportPlayer(pTarget, 250.0696f,0.3921f,72.6722f,3.149f); Summoned = me->SummonCreature(16119,240.34481f,0.7368f,72.6722f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,240.3633f,-2.9520f,72.6722f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,240.6702f,3.34949f,72.6722f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); break; case 4: DoTeleportPlayer(pTarget, 181.4220f,-91.9481f,70.7734f,1.608f); Summoned = me->SummonCreature(16119,184.0519f,-73.5649f,70.7734f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,179.5951f,-73.7045f,70.7734f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,180.6452f,-78.2143f,70.7734f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,283.2274f,-78.1518f,70.7734f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); break; case 5: DoTeleportPlayer(pTarget, 106.1541f,-1.8994f,75.3663f,0.043f); Summoned = me->SummonCreature(16119,115.3945f,-1.5555f,75.3663f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,257.7133f,1.8066f,75.3663f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); Summoned = me->SummonCreature(16119,258.6702f,-5.1001f,75.3663f,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if (Summoned) Summoned->AI()->AttackStart(pTarget); break; } } Teleport_Timer = 20000 + rand()%15000; } else Teleport_Timer -= diff; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { //Return since we have no target if (!UpdateVictim()) return; //MortalWound_Timer if (MortalWound_Timer <= diff) { DoCastVictim(SPELL_MORTAL_WOUND); MortalWound_Timer = urand(10000, 20000); } else MortalWound_Timer -= diff; //Summon 1-3 Spawns of Fankriss at random time. if (SpawnSpawns_Timer <= diff) { switch (urand(0, 2)) { case 0: SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM, 0)); break; case 1: SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM, 0)); SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM, 0)); break; case 2: SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM, 0)); SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM, 0)); SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM, 0)); break; } SpawnSpawns_Timer = urand(30000, 60000); } else SpawnSpawns_Timer -= diff; // Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer. //We will only telport if fankriss has more than 3% of hp so teleported gamers can always loot. if (HealthAbovePct(3)) { if (SpawnHatchlings_Timer <= diff) { Unit* target = NULL; target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target && target->GetTypeId() == TYPEID_PLAYER) { DoCast(target, SPELL_ROOT); if (DoGetThreat(target)) DoModifyThreatPercent(target, -100); switch (urand(0, 2)) { case 0: DoTeleportPlayer(target, -8106.0142f, 1289.2900f, -74.419533f, 5.112f); Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); break; case 1: DoTeleportPlayer(target, -7990.135354f, 1155.1907f, -78.849319f, 2.608f); Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); break; case 2: DoTeleportPlayer(target, -8159.7753f, 1127.9064f, -76.868660f, 0.675f); Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); break; } } SpawnHatchlings_Timer = urand(45000, 60000); } else SpawnHatchlings_Timer -= diff; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; //BrainWashTotem_Timer if (BrainWashTotem_Timer <= diff) { DoCast(me, SPELL_BRAINWASHTOTEM); BrainWashTotem_Timer = 18000 + rand()%8000; } else BrainWashTotem_Timer -= diff; //HealingWard_Timer if (HealingWard_Timer <= diff) { //DoCast(me, SPELL_POWERFULLHEALINGWARD); me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); HealingWard_Timer = 14000 + rand()%6000; } else HealingWard_Timer -= diff; //Hex_Timer if (Hex_Timer <= diff) { DoCast(me->getVictim(), SPELL_HEX); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(), -80); Hex_Timer = 12000 + rand()%8000; } else Hex_Timer -= diff; //Casting the delusion curse with a shade. So shade will attack the same target with the curse. if (Delusions_Timer <= diff) { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_DELUSIONSOFJINDO); Creature *Shade = me->SummonCreature(14986, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Shade) Shade->AI()->AttackStart(pTarget); } Delusions_Timer = 4000 + rand()%8000; } else Delusions_Timer -= diff; //Teleporting a random gamer and spawning 9 skeletons that will attack this gamer if (Teleport_Timer <= diff) { Unit *pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) { DoTeleportPlayer(pTarget, -11583.7783f, -1249.4278f, 77.5471f, 4.745f); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(pTarget, -100); Creature *Skeletons; Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+3, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); } Teleport_Timer = 15000 + rand()%8000; } else Teleport_Timer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; // Pounding if (Pounding_Timer <= diff) { DoCast(me->getVictim(),SPELL_POUNDING); switch (rand()%2) { case 0: DoScriptText(SAY_POUNDING1, me); break; case 1: DoScriptText(SAY_POUNDING2, me); break; } Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) } else Pounding_Timer -= diff; // Arcane Orb if (ArcaneOrb_Timer <= diff) { if (me->IsNonMeleeSpellCasted(false)) { ArcaneOrb_Timer = 3000; return; } Unit* pTarget = NULL; std::list<HostileReference *> t_list = me->getThreatManager().getThreatList(); std::vector<Unit* > target_list; for (std::list<HostileReference *>::iterator itr = t_list.begin(); itr != t_list.end(); ++itr) { pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); //18 yard radius minimum if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive() && pTarget->GetDistance2d(me) >= 18) target_list.push_back(pTarget); pTarget = NULL; } if (target_list.size()) pTarget = *(target_list.begin()+rand()%target_list.size()); if (pTarget) me->CastSpell(pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(), SPELL_ARCANE_ORB, false); ArcaneOrb_Timer = 3000; } else ArcaneOrb_Timer -= diff; // Single Target knock back, reduces aggro if (KnockAway_Timer <= diff) { DoCast(me->getVictim(),SPELL_KNOCK_AWAY); //Drop 25% aggro if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(), -25); KnockAway_Timer = 30000; } else KnockAway_Timer -= diff; //Berserk if (Berserk_Timer <= diff && !Enraged) { DoCast(me,SPELL_BERSERK); Enraged = true; } else Berserk_Timer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI (const uint32 diff) { if (!UpdateVictim()) return; if (PhaseTwo) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->setDeathState(JUST_DIED); me->SetHealth(0); me->GetMotionMaster()->Clear(); me->clearUnitState(UNIT_STAT_ALL_STATE); me->LoadCreaturesAddon(true); return; } if (ZathDead) return; // Resurrect if (ThekalDead || LorkhanDead) { if (!IsResurrecting && (CheckDeath_Timer - 2000) <= diff) { if (LorkhanDead) if (Unit* pLorkhan = Unit::GetUnit(*me, LorkhanGUID)) pLorkhan->CastSpell(pLorkhan, SPELL_RESURRECT, false, 0, 0, pLorkhan->GetGUID()); if (ThekalDead) if (Unit* pThekal = Unit::GetUnit(*me, ThekalGUID)) pThekal->CastSpell(pThekal, SPELL_RESURRECT, false, 0, 0, pThekal->GetGUID()); IsResurrecting = true; } else if (LorkhanDead && ThekalDead) CheckDeath_Timer -= diff; } // Sweeping Strikes Timer if (SweepingStrikes_Timer <= diff) { DoCast(me->getVictim(), SPELL_SWEEPINGSTRIKES); SweepingStrikes_Timer = 22000 + rand()%4000; } else SweepingStrikes_Timer -= diff; // Sinister Strike Timer if (SinisterStrike_Timer <= diff) { DoCast(me->getVictim(), SPELL_SINISTERSTRIKE); SinisterStrike_Timer = 8000 + rand()%8000; } else SinisterStrike_Timer -= diff; // Gouge Timer if (Gouge_Timer <= diff) { DoCast(me->getVictim(), SPELL_GOUGE); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(), -100); Gouge_Timer = 17000 + rand()%10000; } else Gouge_Timer -= diff; // Kick Timer if (Kick_Timer <= diff) { DoCast(me->getVictim(), SPELL_KICK); Kick_Timer = 15000 + rand()%10000; } else Kick_Timer -= diff; // Blind Timer if (Blind_Timer <= diff) { DoCast(me->getVictim(), SPELL_BLIND); Blind_Timer = 10000 + rand()%10000; } else Blind_Timer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; //Invisible_Timer if (Invisible_Timer <= diff) { me->InterruptSpell(CURRENT_GENERIC_SPELL); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO , 218171138); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO + 1, 3); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686); Invisible = true; Invisible_Timer = 15000 + rand()%15000; } else Invisible_Timer -= diff; if (Invisible) { if (Ambush_Timer <= diff) { Unit *pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); if (pTarget) { DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); DoCast(pTarget,SPELL_AMBUSH); } Ambushed = true; Ambush_Timer = 3000; } else Ambush_Timer -= diff; } if (Ambushed) { if (Visible_Timer <= diff) { me->InterruptSpell(CURRENT_GENERIC_SPELL); me->SetUInt32Value(UNIT_FIELD_DISPLAYID,15268); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 31818); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO , 218171138); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO + 1, 3); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Invisible = false; Visible_Timer = 4000; } else Visible_Timer -= diff; } //Resetting some aggro so he attacks other gamers if (!Invisible) if (Aggro_Timer <= diff) { Unit *pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(),-50); if (pTarget) AttackStart(pTarget); Aggro_Timer = 7000 + rand()%13000; } else Aggro_Timer -= diff; if (!Invisible) if (ThousandBlades_Timer <= diff) { DoCast(me->getVictim(), SPELL_THOUSANDBLADES); ThousandBlades_Timer = 7000 + rand()%5000; } else ThousandBlades_Timer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; // Pounding if (Pounding_Timer <= diff) { DoCast(m_creature->getVictim(), SPELL_POUNDING); DoScriptText(RAND(SAY_POUNDING1,SAY_POUNDING2), m_creature); Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) } else Pounding_Timer -= diff; // Arcane Orb if (ArcaneOrb_Timer <= diff) { Unit *pTarget = NULL; std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList(); std::vector<Unit *> target_list; for (std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); if (!pTarget) continue; // exclude pets & totems if (pTarget->GetTypeId() != TYPEID_PLAYER) continue; //18 yard radius minimum if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive() && !pTarget->IsWithinDist(m_creature, 18, false)) target_list.push_back(pTarget); pTarget = NULL; } if (target_list.size()) pTarget = *(target_list.begin()+rand()%target_list.size()); else pTarget = m_creature->getVictim(); if (pTarget) m_creature->CastSpell(pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, pTarget); ArcaneOrb_Timer = 3000; } else ArcaneOrb_Timer -= diff; // Single Target knock back, reduces aggro if (KnockAway_Timer <= diff) { DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); //Drop 25% aggro if (DoGetThreat(m_creature->getVictim())) DoModifyThreatPercent(m_creature->getVictim(),-25); KnockAway_Timer = 30000; } else KnockAway_Timer -= diff; //Berserk if (Berserk_Timer < diff && !Enraged) { DoCast(m_creature, SPELL_BERSERK); Enraged = true; } else Berserk_Timer -= diff; DoMeleeAttackIfReady(); EnterEvadeIfOutOfCombatArea(diff); }
void UpdateAI(uint32 diff) { if (!UpdateVictim()) return; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_BRAINWASHTOTEM: DoCast(me, SPELL_BRAINWASHTOTEM); events.ScheduleEvent(EVENT_BRAINWASHTOTEM, urand(18000, 26000)); break; case EVENT_POWERFULLHEALINGWARD: // HACK //DoCast(me, SPELL_POWERFULLHEALINGWARD); me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); events.ScheduleEvent(EVENT_POWERFULLHEALINGWARD, urand(14000, 20000)); break; case EVENT_HEX: if (Unit* target = me->GetVictim()) { DoCast(target, SPELL_HEX, true); if (DoGetThreat(target)) DoModifyThreatPercent(target, -80); } events.ScheduleEvent(EVENT_HEX, urand(12000, 20000)); break; case EVENT_DELUSIONSOFJINDO: // HACK // Casting the delusion curse with a shade so shade will attack the same target with the curse. if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(target, SPELL_DELUSIONSOFJINDO); Creature* Shade = me->SummonCreature(NPC_SHADE_OF_JINDO, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Shade) Shade->AI()->AttackStart(target); } events.ScheduleEvent(EVENT_DELUSIONSOFJINDO, urand(4000, 12000)); break; case EVENT_TELEPORT: // Possible HACK // Teleports a random player and spawns 9 Sacrificed Trolls to attack player if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoTeleportPlayer(target, TeleportLoc.m_positionX, TeleportLoc.m_positionY, TeleportLoc.m_positionZ, TeleportLoc.m_orientation); if (DoGetThreat(me->GetVictim())) DoModifyThreatPercent(target, -100); Creature* SacrificedTroll; SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (SacrificedTroll) SacrificedTroll->AI()->AttackStart(target); SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (SacrificedTroll) SacrificedTroll->AI()->AttackStart(target); SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (SacrificedTroll) SacrificedTroll->AI()->AttackStart(target); SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (SacrificedTroll) SacrificedTroll->AI()->AttackStart(target); SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (SacrificedTroll) SacrificedTroll->AI()->AttackStart(target); SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (SacrificedTroll) SacrificedTroll->AI()->AttackStart(target); SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (SacrificedTroll) SacrificedTroll->AI()->AttackStart(target); SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (SacrificedTroll) SacrificedTroll->AI()->AttackStart(target); SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (SacrificedTroll) SacrificedTroll->AI()->AttackStart(target); } events.ScheduleEvent(EVENT_TELEPORT, urand(15000, 23000)); break; default: break; } } DoMeleeAttackIfReady(); }
void UpdateAI(uint32 diff) override { if (!UpdateVictim()) return; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_BRAIN_WASH_TOTEM: DoCast(me, SPELL_BRAIN_WASH_TOTEM); events.ScheduleEvent(EVENT_BRAIN_WASH_TOTEM, urand(18000, 26000)); break; case EVENT_POWERFULL_HEALING_WARD: DoCast(me, SPELL_POWERFULL_HEALING_WARD); events.ScheduleEvent(EVENT_POWERFULL_HEALING_WARD, urand(14000, 20000)); break; case EVENT_HEX: if (Unit* target = me->GetVictim()) { DoCast(target, SPELL_HEX, true); if (DoGetThreat(target)) DoModifyThreatPercent(target, -80); } events.ScheduleEvent(EVENT_HEX, urand(12000, 20000)); break; case EVENT_DELUSIONS_OF_JINDO: // Casting the delusion curse with a shade so shade will attack the same target with the curse. if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) { DoCast(target, SPELL_SHADE_OF_JINDO, true); DoCast(target, SPELL_DELUSIONS_OF_JINDO); } events.ScheduleEvent(EVENT_DELUSIONS_OF_JINDO, urand(4000, 12000)); break; case EVENT_TELEPORT: // Teleports a random player and spawns 9 Sacrificed Trolls to attack player if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) { DoTeleportPlayer(target, TeleportLoc.GetPositionX(), TeleportLoc.GetPositionY(), TeleportLoc.GetPositionZ(), TeleportLoc.GetOrientation()); if (DoGetThreat(me->GetVictim())) DoModifyThreatPercent(target, -100); // Summon a formation of trolls for (uint8 i = 0; i < 10; ++i) if (Creature* SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, Formation[i].GetPositionX(), Formation[i].GetPositionY(), Formation[i].GetPositionZ(), Formation[i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) SacrificedTroll->AI()->AttackStart(target); } events.ScheduleEvent(EVENT_TELEPORT, urand(15000, 23000)); break; default: break; } if (me->HasUnitState(UNIT_STATE_CASTING)) return; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if( m_creature->getVictim() && m_creature->isAlive()) { if (!PhaseTwo && ShadowWordPain_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN); ShadowWordPain_Timer = 15000; }else ShadowWordPain_Timer -= diff; if (!PhaseTwo && Mark_Timer < diff) { markedTarget = SelectUnit(SELECT_TARGET_RANDOM,0); DoCast(markedTarget,SPELL_MARK); Mark_Timer = 15000; }else Mark_Timer -= diff; if (Summon_Timer < diff && Counter < 31) { Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM,0); Panther = m_creature->SummonCreature(15101,-11532.79980,-1649.6734,41.4800,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(markedTarget && Panther ) { DoScriptText(SAY_FEAST_PANTHER, m_creature, markedTarget); Panther ->AI()->AttackStart(markedTarget); }else Panther ->AI()->AttackStart(target); Panther = m_creature->SummonCreature(15101,-11532.9970,-1606.4840,41.2979,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(markedTarget && Panther ) Panther ->AI()->AttackStart(markedTarget); else Panther ->AI()->AttackStart(target); Counter++; Summon_Timer = 5000; }else Summon_Timer -= diff; if (Vanish_Timer < diff) { //Invisble Model m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); //m_creature->CombatStop(); DoResetThreat(); VanishedOnce = true; Vanish_Timer = 45000; Visible_Timer = 6000; }else Vanish_Timer -= diff; if (VanishedOnce) { if(Visible_Timer < diff) { Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM,0); //The Panther Model m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15215); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); m_creature->UpdateDamagePhysical(BASE_ATTACK); AttackStart(target); //The Panther Model m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15215); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); PhaseTwo = true; }else Visible_Timer -= diff; } //Cleave_Timer if(PhaseTwo && Cleave_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_CLEAVE); Cleave_Timer = 16000; }Cleave_Timer -=diff; //Gouge_Timer if(PhaseTwo && Gouge_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_GOUGE); if(DoGetThreat(m_creature->getVictim())) DoModifyThreatPercent(m_creature->getVictim(),-80); Gouge_Timer = 17000+rand()%10000; }else Gouge_Timer -= diff; DoMeleeAttackIfReady(); } }
void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; if (!m_bIsPhaseTwo) { if (m_uiShadowWordPain_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); m_uiShadowWordPain_Timer = 15000; } else m_uiShadowWordPain_Timer -= uiDiff; if (m_uiMark_Timer <= uiDiff) { Unit* pMarkedTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); if (pMarkedTarget) { DoCast(pMarkedTarget, SPELL_MARK); MarkedTargetGUID = pMarkedTarget->GetGUID(); } else error_log("BSCR: boss_arlokk could not acquire pMarkedTarget."); m_uiMark_Timer = 15000; } else m_uiMark_Timer -= uiDiff; } else { // Thrash Timer if (m_uiThrash_Timer <= uiDiff) { DoCast(me, SPELL_THRASH); m_uiThrash_Timer = urand(5000, 9000); } else m_uiThrash_Timer -= uiDiff; // Ravage Timer if (m_uiRavage_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_RAVAGE); m_uiRavage_Timer = 16000; } else m_uiRavage_Timer -= uiDiff; // Whirlwind_Timer if (m_uiWhirlwind_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_WHIRLWIND); m_uiWhirlwind_Timer = 16000; } else m_uiWhirlwind_Timer -= uiDiff; // Gouge_Timer if (m_uiGouge_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_GOUGE); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(), -80); m_uiGouge_Timer = 17000 + rand()%10000; } else m_uiGouge_Timer -= uiDiff; } if (m_uiSummonCount <= 30) { if (m_uiSummon_Timer <= uiDiff) { DoSummonPhanters(); m_uiSummon_Timer = 5000; } else m_uiSummon_Timer -= uiDiff; } if (m_uiVanish_Timer <= uiDiff) { // Invisible Model me->SetDisplayId(MODEL_ID_BLANK); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->AttackStop(); DoResetThreat(); m_bIsVanished = true; m_uiVanish_Timer = 45000; m_uiVisible_Timer = 6000; } else m_uiVanish_Timer -= uiDiff; if (m_bIsVanished) { if (m_uiVisible_Timer <= uiDiff) { // The Panther Model me->SetDisplayId(MODEL_ID_PANTHER); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); const CreatureInfo *cinfo = me->GetCreatureInfo(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg / 100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg / 100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { AttackStart(pTarget); DoCast(pTarget,SPELL_BACKSTAB); } m_bIsPhaseTwo = true; m_bIsVanished = false; me->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.7f); } else m_uiVisible_Timer -= uiDiff; } else DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if( m_creature->getVictim() && m_creature->isAlive()) { if (PoisonVolley_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_POISONVOLLEY); PoisonVolley_Timer = 10000 + rand()%10000; }else PoisonVolley_Timer -= diff; if (!PhaseTwo && Aspect_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_ASPECT_OF_MARLI); Aspect_Timer = 13000 + rand()%5000; }else Aspect_Timer -= diff; if (!Spawned && SpawnStartSpiders_Timer < diff) { DoScriptText(SAY_SPIDER_SPAWN, m_creature); Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); if(!target) return; Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Spider) Spider->AI()->AttackStart(target); Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Spider) Spider->AI()->AttackStart(target); Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Spider) Spider->AI()->AttackStart(target); Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Spider) Spider->AI()->AttackStart(target); Spawned = true; }else SpawnStartSpiders_Timer -= diff; if (SpawnSpider_Timer < diff) { Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); if(!target) return; Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Spider) Spider->AI()->AttackStart(target); SpawnSpider_Timer = 12000 + rand()%5000; }else SpawnSpider_Timer -= diff; if(!PhaseTwo && Transform_Timer < diff) { DoScriptText(SAY_TRANSFORM, m_creature); DoCast(m_creature,SPELL_SPIDER_FORM); const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); m_creature->UpdateDamagePhysical(BASE_ATTACK); DoCast(m_creature->getVictim(),SPELL_ENVOLWINGWEB); if(DoGetThreat(m_creature->getVictim())) DoModifyThreatPercent(m_creature->getVictim(),-100); PhaseTwo = true; Transform_Timer = 35000 + rand()%25000; }else Transform_Timer -= diff; if (PhaseTwo) { if (Charge_Timer < diff) { Unit* target = NULL; int i = 0 ; while (i < 3) // max 3 tries to get a random target with power_mana { ++i; //not aggro leader target = SelectUnit(SELECT_TARGET_RANDOM,1); if (target) if (target->getPowerType() == POWER_MANA) i=3; } if (target) { DoCast(target, SPELL_CHARGE); //m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); //m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); AttackStart(target); } Charge_Timer = 8000; }else Charge_Timer -= diff; if (TransformBack_Timer < diff) { m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15220); const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); m_creature->UpdateDamagePhysical(BASE_ATTACK); PhaseTwo = false; TransformBack_Timer = 25000 + rand()%15000; }else TransformBack_Timer -= diff; } DoMeleeAttackIfReady(); } }
void UpdateAI(uint32 diff) override { if (!UpdateVictim()) return; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_POUNDING: DoCastVictim(SPELL_POUNDING); Talk(SAY_POUNDING); events.ScheduleEvent(EVENT_POUNDING, 15000); break; case EVENT_ARCANE_ORB: { 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 = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()); if (!target) continue; // exclude pets & totems, 18 yard radius minimum if (target->GetTypeId() == TYPEID_PLAYER && target->IsAlive() && !target->IsWithinDist(me, 18, false)) target_list.push_back(target); target = NULL; } if (!target_list.empty()) target = *(target_list.begin() + rand32() % target_list.size()); else target = me->GetVictim(); if (target) me->CastSpell(target, SPELL_ARCANE_ORB, false, NULL, NULL); events.ScheduleEvent(EVENT_ARCANE_ORB, 3000); break; } case EVENT_KNOCK_AWAY: DoCastVictim(SPELL_KNOCK_AWAY); // Drop 25% aggro if (DoGetThreat(me->GetVictim())) DoModifyThreatPercent(me->GetVictim(), -25); events.ScheduleEvent(EVENT_KNOCK_AWAY, 30000); break; case EVENT_BERSERK: if (!Enraged) { DoCast(me, SPELL_BERSERK); Enraged = true; } break; default: break; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; //Invisible_Timer if (Invisible_Timer <= diff) { me->InterruptSpell(CURRENT_GENERIC_SPELL); SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); me->SetDisplayId(11686); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Invisible = true; Invisible_Timer = 15000 + rand()%15000; } else Invisible_Timer -= diff; if (Invisible) { if (Ambush_Timer <= diff) { Unit *pTarget = NULL; pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) { DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); DoCast(pTarget, SPELL_AMBUSH); } Ambushed = true; Ambush_Timer = 3000; } else Ambush_Timer -= diff; } if (Ambushed) { if (Visible_Timer <= diff) { me->InterruptSpell(CURRENT_GENERIC_SPELL); me->SetDisplayId(15268); SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Invisible = false; Visible_Timer = 4000; } else Visible_Timer -= diff; } //Resetting some aggro so he attacks other gamers if (!Invisible) { if (Aggro_Timer <= diff) { Unit *pTarget = NULL; pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(),-50); if (pTarget) AttackStart(pTarget); Aggro_Timer = 7000 + rand()%13000; } else Aggro_Timer -= diff; } if (!Invisible) { if (ThousandBlades_Timer <= diff) { DoCast(me->getVictim(), SPELL_THOUSANDBLADES); ThousandBlades_Timer = 7000 + rand()%5000; } else ThousandBlades_Timer -= diff; } DoMeleeAttackIfReady(); }
void UpdateAI (const uint32 diff) { if (!UpdateVictim()) return; //SweepingStrikes_Timer if (SweepingStrikes_Timer <= diff) { DoCast(me->getVictim(), SPELL_SWEEPINGSTRIKES); SweepingStrikes_Timer = 22000+rand()%4000; } else SweepingStrikes_Timer -= diff; //SinisterStrike_Timer if (SinisterStrike_Timer <= diff) { DoCast(me->getVictim(), SPELL_SINISTERSTRIKE); SinisterStrike_Timer = 8000+rand()%8000; } else SinisterStrike_Timer -= diff; //Gouge_Timer if (Gouge_Timer <= diff) { DoCast(me->getVictim(), SPELL_GOUGE); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(), -100); Gouge_Timer = 17000+rand()%10000; } else Gouge_Timer -= diff; //Kick_Timer if (Kick_Timer <= diff) { DoCast(me->getVictim(), SPELL_KICK); Kick_Timer = 15000+rand()%10000; } else Kick_Timer -= diff; //Blind_Timer if (Blind_Timer <= diff) { DoCast(me->getVictim(), SPELL_BLIND); Blind_Timer = 10000+rand()%10000; } else Blind_Timer -= diff; //Check_Timer for the death of LorKhan and Zath. if (!FakeDeath && Check_Timer <= diff) { if (m_instance) { if (m_instance->GetData(DATA_LORKHAN) == SPECIAL) { //Resurrect LorKhan if (Unit* pLorKhan = Unit::GetUnit((*me), m_instance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pLorKhan->setFaction(14); pLorKhan->SetFullHealth(); } } if (m_instance->GetData(DATA_THEKAL) == SPECIAL) { //Resurrect Thekal if (Unit* pThekal = Unit::GetUnit((*me), m_instance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pThekal->setFaction(14); pThekal->SetFullHealth(); } } } Check_Timer = 5000; } else Check_Timer -= diff; if (!HealthAbovePct(5)) { me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_SLEEP); me->setFaction(35); me->AttackStop(); if (m_instance) m_instance->SetData(DATA_ZATH, SPECIAL); FakeDeath = true; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (me->getVictim() && me->isAlive()) { if (PoisonVolley_Timer <= diff) { DoCast(me->getVictim(), SPELL_POISONVOLLEY); PoisonVolley_Timer = urand(10000, 20000); } else PoisonVolley_Timer -= diff; if (!PhaseTwo && Aspect_Timer <= diff) { DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); Aspect_Timer = urand(13000, 18000); } else Aspect_Timer -= diff; if (!Spawned && SpawnStartSpiders_Timer <= diff) { Talk(SAY_SPIDER_SPAWN); Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!target) return; Creature* Spider = NULL; Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(target); Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(target); Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(target); Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(target); Spawned = true; } else SpawnStartSpiders_Timer -= diff; if (SpawnSpider_Timer <= diff) { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!target) return; Creature* Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(target); SpawnSpider_Timer = urand(12000, 17000); } else SpawnSpider_Timer -= diff; if (!PhaseTwo && Transform_Timer <= diff) { Talk(SAY_TRANSFORM); DoCast(me, SPELL_SPIDER_FORM); const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); DoCast(me->getVictim(), SPELL_ENVOLWINGWEB); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(), -100); PhaseTwo = true; Transform_Timer = urand(35000, 60000); } else Transform_Timer -= diff; if (PhaseTwo) { if (Charge_Timer <= diff) { Unit* target = NULL; int i = 0; while (i < 3) // max 3 tries to get a random target with power_mana { ++i; target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); // not aggro leader if (target && target->getPowerType() == POWER_MANA) i = 3; } if (target) { DoCast(target, SPELL_CHARGE); //me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); //me->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true, 1); AttackStart(target); } Charge_Timer = 8000; } else Charge_Timer -= diff; if (TransformBack_Timer <= diff) { me->SetDisplayId(15220); const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); me->UpdateDamagePhysical(BASE_ATTACK); PhaseTwo = false; TransformBack_Timer = urand(25000, 40000); } else TransformBack_Timer -= diff; } DoMeleeAttackIfReady(); } }
void UpdateAI(uint32 diff) override { if (!UpdateVictim()) return; // Pounding if (Pounding_Timer <= diff) { DoCastVictim(SPELL_POUNDING); Talk(SAY_POUNDING); Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) } else Pounding_Timer -= diff; // Arcane Orb if (ArcaneOrb_Timer <= diff) { 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 = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()); if (!target) continue; // exclude pets & totems, 18 yard radius minimum if (target->GetTypeId() == TYPEID_PLAYER && target->IsAlive() && !target->IsWithinDist(me, 18, false)) target_list.push_back(target); target = NULL; } if (!target_list.empty()) target = *(target_list.begin() + rand32() % target_list.size()); else target = me->GetVictim(); if (target) me->CastSpell(target, SPELL_ARCANE_ORB, false, NULL, NULL); ArcaneOrb_Timer = 3000; } else ArcaneOrb_Timer -= diff; // Single Target knock back, reduces aggro if (KnockAway_Timer <= diff) { DoCastVictim(SPELL_KNOCK_AWAY); //Drop 25% aggro if (DoGetThreat(me->GetVictim())) DoModifyThreatPercent(me->GetVictim(), -25); KnockAway_Timer = 30000; } else KnockAway_Timer -= diff; //Berserk if (Berserk_Timer < diff && !Enraged) { DoCast(me, SPELL_BERSERK); Enraged = true; } else Berserk_Timer -= diff; DoMeleeAttackIfReady(); }