void UpdateAI(const uint32 diff) { //sLog->outString("DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer); if (!QuestInProgress) return; if (KillCount && Phase < 6) { if (!UpdateVictim()) //reset() on target Despawn... return; DoMeleeAttackIfReady(); return; } switch (Phase) { case 0: if (WaitTimer == WAIT_SECS) me->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike if (WaitTimer <= diff) { WaitTimer -= diff; return; } break; case 1: SummonCreatureWithRandomTarget(2060, 1); break; case 2: SummonCreatureWithRandomTarget(2061, 2); SummonCreatureWithRandomTarget(2062, 0); break; case 3: SummonCreatureWithRandomTarget(2063, 1); SummonCreatureWithRandomTarget(2064, 2); SummonCreatureWithRandomTarget(2065, 0); break; case 4: SummonCreatureWithRandomTarget(2066, 1); SummonCreatureWithRandomTarget(2067, 0); SummonCreatureWithRandomTarget(2068, 2); break; case 5: //end if (PlayerGUID) { if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) { me->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike player->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me); } } QuestInProgress = false; Reset(); break; } ++Phase; //prepare next phase }
void UpdateAI(const uint32 Diff) { if (!UpdateVictim()) return; if (LavaSpewTimer <= Diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) me->CastSpell(target, SPELL_LAVA_SPEW, true); LavaSpewTimer = urand(10*IN_MILLISECONDS, 12*IN_MILLISECONDS); } else LavaSpewTimer -= Diff; if (MagmaSpitTimer <= Diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) me->CastSpell(target, SPELL_MAGMA_SPIT , true); MagmaSpitTimer = urand(12*IN_MILLISECONDS, 14*IN_MILLISECONDS); } else MagmaSpitTimer -= Diff; if (LavaParasiteSummonTimer <= Diff) { for (int i = 0; i < 2; ++i) SummonCreatureWithRandomTarget(42321); LavaParasiteSummonTimer = 30*IN_MILLISECONDS; } else LavaParasiteSummonTimer -= Diff; DoMeleeAttackIfReady(); }
void SpawnMalignant() { if (!isMalignantSpawn && !enrage) { SummonCreatureWithRandomTarget(NPC_MALIGNANT_TROGG, SpawnPosition[1].x,SpawnPosition[1].y,SpawnPosition[1].z,SpawnPosition[1].o); isMalignantSpawn = true; } }
void UpdateAI(const uint32 diff) { //char buf[200]; //Return since we have no target if (!UpdateVictim()) return; if (!RootSelf) { //me->m_canMove = true; DoCast(me, 33356); RootSelf = true; } if (!bAggro && Line1Count == 0 && Line2Count == 0) { if (Aggro_Timer <= diff) { bAggro = true; // Visible now! me->SetDisplayId(9723); me->setFaction(14); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } else Aggro_Timer -= diff; } // Summon Dragon pack. 2 Dragons and 3 Whelps if (!bAggro && !SummonedRend && Line1Count > 0) { if (Dragons_Timer <= diff) { SummonCreatureWithRandomTarget(10372); SummonCreatureWithRandomTarget(10372); SummonCreatureWithRandomTarget(10442); SummonCreatureWithRandomTarget(10442); SummonCreatureWithRandomTarget(10442); Line1Count = Line1Count - 1; Dragons_Timer = 60000; } else Dragons_Timer -= diff; } //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0) { if (Orc_Timer <= diff) { SummonCreatureWithRandomTarget(10447); SummonCreatureWithRandomTarget(10317); SummonCreatureWithRandomTarget(10442); SummonCreatureWithRandomTarget(10442); SummonCreatureWithRandomTarget(10442); Line2Count = Line2Count - 1; Orc_Timer = 60000; } else Orc_Timer -= diff; } // we take part in the fight if (bAggro) { // CorrosiveAcid_Timer if (CorrosiveAcid_Timer <= diff) { DoCast(me->getVictim(), SPELL_CORROSIVEACID); CorrosiveAcid_Timer = 7000; } else CorrosiveAcid_Timer -= diff; // Freeze_Timer if (Freeze_Timer <= diff) { DoCast(me->getVictim(), SPELL_FREEZE); Freeze_Timer = 16000; } else Freeze_Timer -= diff; // Flamebreath_Timer if (Flamebreath_Timer <= diff) { DoCast(me->getVictim(), SPELL_FLAMEBREATH); Flamebreath_Timer = 10500; } else Flamebreath_Timer -= diff; //Summon Rend if (!SummonedRend && me->GetHealth()*100 / me->GetMaxHealth() < 11 && me->GetHealth() > 0) { //summon Rend and Change model to normal Gyth //Inturrupt any spell casting me->InterruptNonMeleeSpells(false); //Gyth model me->SetDisplayId(9806); me->SummonCreature(10429, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000); SummonedRend = true; } DoMeleeAttackIfReady(); } // end if Aggro }
void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; if (!SummonedRend && HealthBelowPct(11)) { events.ScheduleEvent(EVENT_SUMMON_REND, 8 * IN_MILLISECONDS); SummonedRend = true; } events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_SUMMON_REND: // Summon Rend and Change model to normal Gyth // Interrupt any spell casting me->InterruptNonMeleeSpells(false); // Gyth model me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); me->SummonCreature(NPC_WARCHIEF_REND_BLACKHAND, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_CORROSIVE_ACID, 8 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_FREEZE, 11 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_FLAME_BREATH, 4 * IN_MILLISECONDS); events.CancelEvent(EVENT_SUMMON_REND); break; case EVENT_AGGRO: me->SetVisible(true); me->SetDisplayId(MODEL_REND_ON_DRAKE); me->setFaction(14); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); events.CancelEvent(EVENT_AGGRO); break; // Summon Dragon pack. 2 Dragons and 3 Whelps case EVENT_SUMMON_DRAGON_PACK: for (uint8 i = 0; i < urand(0, 3) + 2; ++i) { SummonCreatureWithRandomTarget(NPC_RAGE_TALON_FIRE_TONG, 2); SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP, 3); } events.CancelEvent(EVENT_SUMMON_DRAGON_PACK); break; // Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps case EVENT_SUMMON_ORC_PACK: for (uint8 i = 0; i < urand (0, 5) + 2; ++i) { SummonCreatureWithRandomTarget(NPC_CHROMATIC_DRAGONSPAWN, 1); SummonCreatureWithRandomTarget(NPC_BLACKHAND_ELITE, 1); SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP, 3); } events.CancelEvent(EVENT_SUMMON_ORC_PACK); break; case EVENT_CORROSIVE_ACID: DoCastVictim(SPELL_CORROSIVE_ACID); events.ScheduleEvent(EVENT_CORROSIVE_ACID, 7 * IN_MILLISECONDS); break; case EVENT_FREEZE: DoCastVictim(SPELL_FREEZE); events.ScheduleEvent(EVENT_FREEZE, 16 * IN_MILLISECONDS); break; case EVENT_FLAME_BREATH: DoCastVictim(SPELL_FLAMEBREATH); events.ScheduleEvent(EVENT_FLAME_BREATH, 10500); break; } } DoMeleeAttackIfReady(); }
void SpawnAdd() { for(int i = 0; i < 3; i ++) SummonCreatureWithRandomTarget(NPC_TROGG_DWELLER, SpawnPosition[0].x,SpawnPosition[0].y,SpawnPosition[0].z,SpawnPosition[0].o); }
void UpdateAI(const uint32 uiDiff) { //Return since we have no target if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; if (!m_bRootSelf) { DoCastSpellIfCan(m_creature, SPELL_ROOT_SELF); m_bRootSelf = true; } if (!m_bAggro && uiLine1Count == 0 && uiLine2Count == 0) { if (uiAggroTimer < uiDiff) { m_bAggro = true; // Visible now! m_creature->SetDisplayId(MODEL_ID_GYTH_MOUNTED); m_creature->setFaction(14); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->RemoveAurasDueToSpell(SPELL_ROOT_SELF); if (m_pInstance) m_pInstance->DoUseDoorOrButton(m_uiCombatDoorGUID); } else uiAggroTimer -= uiDiff; } // Summon Dragon pack. 2 Dragons and 3 Whelps if (!m_bAggro && !m_bSummonedRend && uiLine1Count > 0) { if (uiDragonsTimer < uiDiff) { SummonCreatureWithRandomTarget(NPC_FIRE_TONGUE); SummonCreatureWithRandomTarget(NPC_FIRE_TONGUE); SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); --uiLine1Count; if (m_pInstance) m_pInstance->DoUseDoorOrButton(m_uiCombatDoorGUID); uiDragonsTimer = 60000; } else uiDragonsTimer -= uiDiff; } //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps if (!m_bAggro && !m_bSummonedRend && uiLine1Count == 0 && uiLine2Count > 0) { if (uiOrcTimer < uiDiff) { SummonCreatureWithRandomTarget(NPC_CHROMATIC_DRAGON); SummonCreatureWithRandomTarget(NPC_BLACKHAND_ELITE); SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); if (m_pInstance) m_pInstance->DoUseDoorOrButton(m_uiCombatDoorGUID); --uiLine2Count; uiOrcTimer = 60000; } else uiOrcTimer -= uiDiff; } // we take part in the fight if (m_bAggro) { // CorrosiveAcid_Timer if (uiCorrosiveAcidTimer < uiDiff) { DoCastSpellIfCan(m_creature, SPELL_CORROSIVEACID); uiCorrosiveAcidTimer = 7000; } else uiCorrosiveAcidTimer -= uiDiff; // Freeze_Timer if (uiFreezeTimer < uiDiff) { if (DoCastSpellIfCan(m_creature, SPELL_FREEZE) == CAST_OK) uiFreezeTimer = 16000; } else uiFreezeTimer -= uiDiff; // Flamebreath_Timer if (uiFlamebreathTimer < uiDiff) { DoCastSpellIfCan(m_creature, SPELL_FLAMEBREATH); uiFlamebreathTimer = 10500; } else uiFlamebreathTimer -= uiDiff; //Summon Rend if (!m_bSummonedRend && m_creature->GetHealthPercent() < 11.0f) { // summon Rend and Change model to normal Gyth // Inturrupt any spell casting m_creature->InterruptNonMeleeSpells(false); // Gyth model m_creature->SetDisplayId(MODEL_ID_GYTH); m_creature->SummonCreature(NPC_REND_BLACKHAND, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000); m_bSummonedRend = true; } DoMeleeAttackIfReady(); } // end if Aggro }
bool GOHello_go_fire_akumai(Player *player, GameObject* pGO) { uint32 candlesNumber; ScriptedInstance *pInstance = (player->GetInstanceData()) ? ((ScriptedInstance*)player->GetInstanceData()) : NULL; if(!pInstance) { player->GetSession()->SendNotification("Instance script not initialized."); return true; } candlesNumber = pInstance->GetData(DATA_CANDLES); candlesNumber++; switch(candlesNumber) { case 1: SummonCreatureWithRandomTarget(4977, 0, 0, player, pGO); SummonCreatureWithRandomTarget(4977, 0, 1, player, pGO); SummonCreatureWithRandomTarget(4977, 0, 2, player, pGO); SummonCreatureWithRandomTarget(4977, 0, 3, player, pGO); SummonCreatureWithRandomTarget(4977, 0, 4, player, pGO); SummonCreatureWithRandomTarget(4977, 1, 0, player, pGO); SummonCreatureWithRandomTarget(4977, 1, 1, player, pGO); SummonCreatureWithRandomTarget(4977, 1, 2, player, pGO); SummonCreatureWithRandomTarget(4977, 1, 3, player, pGO); SummonCreatureWithRandomTarget(4977, 1, 4, player, pGO); break; case 2: SummonCreatureWithRandomTarget(4823, 2, 0, player, pGO); SummonCreatureWithRandomTarget(4823, 2, 1, player, pGO); SummonCreatureWithRandomTarget(4823, 2, 2, player, pGO); SummonCreatureWithRandomTarget(4823, 2, 3, player, pGO); break; case 3: SummonCreatureWithRandomTarget(4825, 3, 0, player, pGO); SummonCreatureWithRandomTarget(4825, 3, 2, player, pGO); SummonCreatureWithRandomTarget(4825, 3, 4, player, pGO); break; case 4: SummonCreatureWithRandomTarget(4978, 4, 2, player, pGO); SummonCreatureWithRandomTarget(4978, 4, 4, player, pGO); break; } pInstance->SetData(DATA_CANDLES, candlesNumber); debug_log("Blackfathom Deeps - Instance Data: %i", (int) candlesNumber); return false; }
void UpdateAI(uint32 diff) override { //TC_LOG_INFO("scripts", "DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer); if (!QuestInProgress) return; if (KillCount && Phase < 6) { if (!UpdateVictim()) //reset() on target Despawn... return; DoMeleeAttackIfReady(); return; } switch (Phase) { case 0: if (WaitTimer == 6 * IN_MILLISECONDS) if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) Talk(SAY_PREPARE_TO_AMBUSH, player); if (WaitTimer <= diff) { WaitTimer -= diff; return; } break; case 1: SummonCreatureWithRandomTarget(COUNCILMAN_SMITHERS, 1); break; case 2: SummonCreatureWithRandomTarget(COUNCILMAN_THATCHER, 2); SummonCreatureWithRandomTarget(COUNCILMAN_HENDRICKS, 0); break; case 3: SummonCreatureWithRandomTarget(COUNCILMAN_WILHELM, 1); SummonCreatureWithRandomTarget(COUNCILMAN_HARTIN, 2); SummonCreatureWithRandomTarget(COUNCILMAN_COOPER, 0); break; case 4: SummonCreatureWithRandomTarget(COUNCILMAN_HIGARTH, 1); SummonCreatureWithRandomTarget(COUNCILMAN_BRUNSWICK, 0); SummonCreatureWithRandomTarget(LORD_MAYOR_MORRISON, 2); break; case 5: //end if (PlayerGUID) { if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) { Talk(SAY_A_BLOW_TO_ARUGAL); player->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me); } } QuestInProgress = false; Reset(); break; } ++Phase; //prepare next phase }