bool CanStartEvent(Player* player) { if (!isEvent) { Creature* ardonis = me->FindNearestCreature(CreatureEntry[0], 10.0f); if (!ardonis) return false; ardonisGUID = ardonis->GetGUID(); PlayerGUID = player->GetGUID(); isEvent = true; Turn_to_eachother(); return true; } TC_LOG_DEBUG("scripts", "npc_commander_dawnforge event already in progress, need to wait."); return false; }
bool CanStartEvent(Player* player) { if (!isEvent) { Creature* ardonis = me->FindNearestCreature(CreatureEntry[0], 10.0f); if (!ardonis) return false; ardonisGUID = ardonis->GetGUID(); PlayerGUID = player->GetGUID(); isEvent = true; Turn_to_eachother(); return true; } sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_commander_dawnforge event already in progress, need to wait."); return false; }
bool CanStartEvent(Player *player) { if (!isEvent) { Creature *ardonis = SelectCreatureInGrid(CreatureEntry[0][0], 10.0f); if (!ardonis) return false; ardonisGUID = ardonis->GetGUID(); playerGUID = player->GetGUID(); isEvent = true; Turn_to_eachother(); return true; } debug_log("OSCR: npc_commander_dawnforge event already in progress, need to wait."); return false; }
void UpdateAI(const uint32 diff) { //Is event even running? if (!isEvent) return; //Phase timing if (Phase_Timer >= diff) { Phase_Timer -= diff; return; } Unit* ardonis = Unit::GetUnit(*me, ardonisGUID); Unit* pathaleon = Unit::GetUnit(*me, pathaleonGUID); Player* player = Unit::GetPlayer(*me, PlayerGUID); if (!ardonis || !player) { Reset(); return; } if (Phase > 4 && !pathaleon) { Reset(); return; } //Phase 1 Dawnforge say switch (Phase) { case 1: DoScriptText(SAY_COMMANDER_DAWNFORGE_1, me); ++Phase; Phase_Timer = 16000; break; //Phase 2 Ardonis say case 2: DoScriptText(SAY_ARCANIST_ARDONIS_1, ardonis); ++Phase; Phase_Timer = 16000; break; //Phase 3 Dawnforge say case 3: DoScriptText(SAY_COMMANDER_DAWNFORGE_2, me); ++Phase; Phase_Timer = 16000; break; //Phase 4 Pathaleon spawns up to phase 9 case 4: //spawn pathaleon's image me->SummonCreature(CreatureEntry[2], 2325.851563f, 2799.534668f, 133.084229f, 6.038996f, TEMPSUMMON_TIMED_DESPAWN, 90000); ++Phase; Phase_Timer = 500; break; //Phase 5 Pathaleon say case 5: DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_1, pathaleon); ++Phase; Phase_Timer = 6000; break; //Phase 6 case 6: switch (PhaseSubphase) { //Subphase 1: Turn Dawnforge and Ardonis case 0: Turn_to_Pathaleons_Image(); ++PhaseSubphase; Phase_Timer = 8000; break; //Subphase 2 Dawnforge say case 1: DoScriptText(SAY_COMMANDER_DAWNFORGE_3, me); PhaseSubphase = 0; ++Phase; Phase_Timer = 8000; break; } break; //Phase 7 Pathaleons say 3 Sentence, every sentence need a subphase case 7: switch (PhaseSubphase) { //Subphase 1 case 0: DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2, pathaleon); ++PhaseSubphase; Phase_Timer = 12000; break; //Subphase 2 case 1: DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_1, pathaleon); ++PhaseSubphase; Phase_Timer = 16000; break; //Subphase 3 case 2: DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_2, pathaleon); PhaseSubphase = 0; ++Phase; Phase_Timer = 10000; break; } break; //Phase 8 Dawnforge & Ardonis say case 8: DoScriptText(SAY_COMMANDER_DAWNFORGE_4, me); DoScriptText(SAY_ARCANIST_ARDONIS_2, ardonis); ++Phase; Phase_Timer = 4000; break; //Phase 9 Pathaleons Despawn, Reset Dawnforge & Ardonis angle case 9: Turn_to_eachother(); //hide pathaleon, unit will despawn shortly pathaleon->SetVisible(false); PhaseSubphase = 0; ++Phase; Phase_Timer = 3000; break; //Phase 10 Dawnforge say case 10: DoScriptText(SAY_COMMANDER_DAWNFORGE_5, me); player->AreaExploredOrEventHappens(QUEST_INFO_GATHERING); Reset(); break; } }