void SetData(uint32 uiType, uint32 uiData) { switch(uiType) { case DATA_BALTHARUS_EVENT: m_auiEncounter[0] = uiData; if(uiData == DONE) m_uiBossCounter++; if(m_uiBossCounter == 3) { Creature *pCreature = instance->GetCreature(GetData64(DATA_HALION)); pCreature->SetReactState(REACT_AGGRESSIVE); pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pCreature->SetVisibility(VISIBILITY_ON); } break; case DATA_ZARITHRIAN_EVENT: m_auiEncounter[1] = uiData; if(uiData == DONE) m_uiBossCounter++; if(m_uiBossCounter == 3) { Creature *pCreature = instance->GetCreature(GetData64(DATA_HALION)); pCreature->SetReactState(REACT_AGGRESSIVE); pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pCreature->SetVisibility(VISIBILITY_ON); } break; case DATA_RAGEFIRE_EVENT: m_auiEncounter[2] = uiData; if(uiData == DONE) m_uiBossCounter++; if(m_uiBossCounter == 3) { Creature *pCreature = instance->GetCreature(GetData64(DATA_HALION)); pCreature->SetReactState(REACT_AGGRESSIVE); pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pCreature->SetVisibility(VISIBILITY_ON); } break; case DATA_HALION_EVENT: m_auiEncounter[3] = uiData; if(uiData == DONE) { switch(instance->GetDifficulty()) { case RAID_DIFFICULTY_10MAN_NORMAL: DoCompleteAchievement(4817); case RAID_DIFFICULTY_10MAN_HEROIC: DoCompleteAchievement(4818); case RAID_DIFFICULTY_25MAN_NORMAL: DoCompleteAchievement(4815); case RAID_DIFFICULTY_25MAN_HEROIC: DoCompleteAchievement(4816); } } case DATA_XERESTRASZA_EVENT: m_uiXerestrasza = uiData; } }
void instance_naxxramas::Update(uint32 uiDiff) { // Down they fall together achiev if (BlaumeuxDead || RivendareDead || ZeliekDead || KorthazzDead) { if (DeadTimer < 15000 && UpdateCheck) { if (BlaumeuxDead && RivendareDead && ZeliekDead && KorthazzDead) { if(this) DoCompleteAchievement(instance->IsRegularDifficulty() ? ACHIEVEMENT_TOGETHER : H_ACHIEVEMENT_TOGETHER); UpdateCheck = false; } else DeadTimer += uiDiff; } } // Arachnofobia achiev if(m_bIsArachnofobia) m_uiArachnofobiaTimer += uiDiff; // Immortal check if (m_uiImmortaCheck < uiDiff) { IsRaidWiped(); m_uiImmortaCheck = 1000; }else m_uiImmortaCheck -= uiDiff; }
// Hacky way of completing some achievs // PLEASE REMOVE FOR REVISION! void CheckIronCouncil() { // check if the other bosses in the antechamber are dead // hacky way to complete achievements; use only if you have this function if(m_auiEncounter[4] == DONE && m_auiEncounter[5] == DONE && m_auiEncounter[6] == DONE) DoCompleteAchievement(instance->IsRegularDifficulty() ? ACHIEV_IRON_COUNCIL : ACHIEV_IRON_COUNCIL_H); }
void CheckKeepers() { // check if the other bosses in the antechamber are dead // hacky way to complete achievements; use only if you have this function if(m_auiEncounter[7] == DONE && m_auiEncounter[8] == DONE && m_auiEncounter[9] == DONE && m_auiEncounter[10] == DONE) DoCompleteAchievement(instance->IsRegularDifficulty() ? ACHIEV_KEEPERS : ACHIEV_KEEPERS_H); }
void instance_naxxramas::Immortal() { if(m_auiEncounter[15] != FAIL) { if(m_auiEncounter[14] == DONE && m_auiEncounter[12] == DONE && m_auiEncounter[2] == DONE && m_auiEncounter[5] == DONE && m_auiEncounter[8] == DONE) { if(this) DoCompleteAchievement(instance->IsRegularDifficulty() ? ACHIEV_THE_UNDYING : ACHIEV_THE_IMMORTAL); } } }
void instance_naxxramas::Horseman() { // check the 4 horseman and also check the other bosses in Military quaters if (BlaumeuxDead && RivendareDead && ZeliekDead && KorthazzDead) { SetData(TYPE_FOUR_HORSEMEN, DONE); // check if the other bosses in military are dead if(m_auiEncounter[7] == DONE && m_auiEncounter[6] == DONE && this) DoCompleteAchievement(instance->IsRegularDifficulty() ? ACHIEVEMENT_HORSEMEN : H_ACHIEVEMENT_HORSEMEN); } }
void SetData(uint32 type, uint32 data) { switch(type) { case DATA_ELDER_NADOX_EVENT: m_auiEncounter[0] = data; break; case DATA_PRINCE_TALDARAM_EVENT: if (data == DONE) HandleGameObject(Prince_TaldaramGate, true); m_auiEncounter[1] = data; break; case DATA_JEDOGA_SHADOWSEEKER_EVENT: m_auiEncounter[2] = data; if (data == DONE) { for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr) { Creature* cr = instance->GetCreature(*itr); if (cr && cr->isAlive()) { cr->SetVisible(false); cr->setDeathState(JUST_DIED); cr->RemoveCorpse(); } } if (!initiandkilled && instance->IsHeroic()) DoCompleteAchievement(ACHIEV_VOLUNTEER_WORK); } break; case DATA_HERALD_VOLAZJ_EVENT: m_auiEncounter[3] = data; break; case DATA_AMANITAR_EVENT: m_auiEncounter[4] = data; break; case DATA_SPHERE1_EVENT: spheres[0] = data; break; case DATA_SPHERE2_EVENT: spheres[1] = data; break; case DATA_JEDOGA_TRIGGER_SWITCH: switchtrigger = data; break; case DATA_INITIAND_KILLED: initiandkilled = data; break; case DATA_JEDOGA_RESET_INITIANDS: for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr) { Creature* cr = instance->GetCreature(*itr); if (cr) { cr->Respawn(); if (!cr->IsInEvadeMode()) cr->AI()->EnterEvadeMode(); } } break; } if (data == DONE) SaveToDB(); }
void SetData(uint32 type, uint32 data) { switch (type) { case DATA_GOLDEN_ORB: { goldenOrbCount++; if (goldenOrbCount == 5) DoCompleteAchievement(5289); } break; default: break; } }
void SetData(uint32 type, uint32 data) { switch(type) { case EVENT_LEEEROY: if (data == DONE) DoCompleteAchievement(ACHIEVEMENT_LEROY_JENKINS); LeroyData = data; break; case WHELP_DEATH_COUNT: if (data == 1) SetData(EVENT_LEEEROY, IN_PROGRESS); WhelpCount = data; break; } }
void SetData(uint32 uiType, uint32 uiData) { switch(uiType) { case TYPE_DRAKOS: m_auiEncounter[0] = uiData; if(uiData == DONE) m_bMakeCount = true; break; case TYPE_VAROS: m_auiEncounter[1] = uiData; break; case TYPE_UROM: m_auiEncounter[2] = uiData; break; case TYPE_EREGOS: m_auiEncounter[3] = uiData; if(uiData == DONE) { DoRespawnGameObject(m_uiEregosCacheGUID); if(m_uiMakeCountTimer < 20*MINUTE && !instance->IsRegularDifficulty()) DoCompleteAchievement(ACHIEV_MAKE_IT_COUNT); } break; case TYPE_CENTRIFUGE_DEAD: m_uiCentrifugeDead += uiData; DoUpdateWorldState(UI_STATE_CONSTRUCT_COUNT, 10 - m_uiCentrifugeDead); m_bNeedSave = true; break; } if (uiData == DONE || m_bNeedSave) { OUT_SAVE_INST_DATA; std::ostringstream saveStream; saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_uiCentrifugeDead; strInstData = saveStream.str(); SaveToDB(); OUT_SAVE_INST_DATA_COMPLETE; m_bNeedSave = false; } }
void SetData(uint32 type, uint32 data) { switch(type) { case EVENT_LEEEROY: if (data == DONE) DoCompleteAchievement(ACHIEV_LEROY_JENKINS); uiLeroyData = data; break; case WHELP_DEATH_COUNT: if (data == 1) { SetData(EVENT_LEEEROY, IN_PROGRESS); //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Started"); } uiWhelpCount = data; break; } }
void SetData(uint32 type, uint32 data) { switch(type) { case DATA_1ST_BOSS_EVENT: m_auiEncounter[0] = data; if (data == DONE) SaveToDB(); break; case DATA_2ND_BOSS_EVENT: m_auiEncounter[1] = data; if (data == DONE) SaveToDB(); break; case DATA_CYANIGOSA_EVENT: m_auiEncounter[2] = data; if (data == DONE) { SaveToDB(); uiMainEventPhase = DONE; if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) pMainDoor->SetGoState(GO_STATE_ACTIVE); if (!bCrystalActivated && uiDoorIntegrity == 100) DoCompleteAchievement(ACHIEV_DEFENSELESS); } break; case DATA_WAVE_COUNT: uiWaveCount = data; bActive = true; break; case DATA_REMOVE_NPC: uiRemoveNpc = data; break; case DATA_PORTAL_LOCATION: uiLocation = (uint8)data; break; case DATA_DOOR_INTEGRITY: uiDoorIntegrity = data; DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, uiDoorIntegrity); break; case DATA_NPC_PRESENCE_AT_DOOR_ADD: NpcAtDoorCastingList.push_back(data); break; case DATA_NPC_PRESENCE_AT_DOOR_REMOVE: if(!NpcAtDoorCastingList.empty()) NpcAtDoorCastingList.pop_back(); break; case DATA_MAIN_DOOR: if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) { switch(data) { case GO_STATE_ACTIVE: pMainDoor->SetGoState(GO_STATE_ACTIVE); break; case GO_STATE_READY: pMainDoor->SetGoState(GO_STATE_READY); break; case GO_STATE_ACTIVE_ALTERNATIVE: pMainDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); break; } } break; case DATA_START_BOSS_ENCOUNTER: switch(uiWaveCount) { case 6: StartBossEncounter(uiFirstBoss); break; case 12: StartBossEncounter(uiSecondBoss); break; } break; case DATA_ACTIVATE_CRYSTAL: ActivateCrystal(); break; case DATA_MAIN_EVENT_PHASE: uiMainEventPhase = data; if (data == IN_PROGRESS) // Start event { if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) pMainDoor->SetGoState(GO_STATE_READY); uiWaveCount = 1; bActive = true; uiRemoveNpc = 0; // might not have been reset after a wipe on a boss. } break; } }
void instance_naxxramas::Arachnofobia() { if(this) DoCompleteAchievement(instance->IsRegularDifficulty() ? ACHIEV_ARACHNOFOBIA : ACHIEV_ARACHNOFOBIA_H); }
void SetData(uint32 idx, uint32 data) { if (idx == SCARAB_DEATH) { scarabsDeaths.push_back(time(NULL)); if (scarabsDeaths.size() >= 40) { for (int i=0; i<(int)scarabsDeaths.size(); ++i) { time_t scarab1 = scarabsDeaths[i]; uint32 count = 0; for (int j=0; j<(int)scarabsDeaths.size(); ++j) { if (i == j) continue; time_t scarab2 = scarabsDeaths[j]; if ((scarab2 > scarab1 ? scarab2 - scarab1 : scarab1 - scarab2) <= 30) ++count; if (count >= 40) { if (instance->GetSpawnMode() == 0 || instance->GetSpawnMode() == 2) DoCompleteAchievement(3800); if (instance->GetSpawnMode() == 1 || instance->GetSpawnMode() == 3) DoCompleteAchievement(3816); break; } } if (count >= 40) break; } } return; } if (idx == UPDATE_DEATHS_COUNT) { ++deathsCount; return; } if (idx == TIME_ACIDMAW_DEAD || idx == TIME_DREADSCALE_DEAD) { if (idx == TIME_ACIDMAW_DEAD) acidmawDead = time(NULL); if (idx == TIME_DREADSCALE_DEAD) dreadscaleDead = time(NULL); if (acidmawDead && dreadscaleDead) { time_t interval = acidmawDead >= dreadscaleDead ? acidmawDead - dreadscaleDead : dreadscaleDead - acidmawDead; if (interval <= 10) { //Not One, But Two Jormungars uint32 achi = 0; if (instance->GetSpawnMode() == 0 || instance->GetSpawnMode() == 2) //10 man normal/hero achi = 3936; else if (instance->GetSpawnMode() == 1 || instance->GetSpawnMode() == 3) //25 man normal/hero achi = 3937; if (achi) DoCompleteAchievement(achi); } } } if (idx != RESET_TO_FIGHT) return; else { //prevent for '--attempts' for multiple function calls (ie in case of wipe during champions fight, when function is called 6-10 times) if (GetBossState(data) != FAIL) { if (attempts) --attempts; } if (data == DATA_ANUBARAK) { scarabsDeaths.clear(); return; } } for (int i=BOSS_GORMOK; i<=BOSS_DARK_TWIN; ++i) { if (Creature* boss = instance->GetCreature(GetData64(i))) boss->DespawnOrUnsummon(); } if (Creature* gadajacy = instance->GetCreature(GetData64(GADAJACY))) { if (!gadajacy->isAlive()) gadajacy->Respawn(true); gadajacy->SetVisible(true); } if (data == DATA_TWIN_VALKYR) { SetBossState(DATA_ANUBARAK, NOT_STARTED); SetBossState(DATA_TWIN_VALKYR, FAIL); } if (data == DATA_FACTION_CHAMPIONS) { SetBossState(DATA_ANUBARAK, NOT_STARTED); SetBossState(DATA_TWIN_VALKYR, NOT_STARTED); SetBossState(DATA_FACTION_CHAMPIONS, FAIL); } if (data == DATA_LORD_JARAXXUS) { SetBossState(DATA_ANUBARAK, NOT_STARTED); SetBossState(DATA_TWIN_VALKYR, NOT_STARTED); SetBossState(DATA_FACTION_CHAMPIONS, NOT_STARTED); SetBossState(DATA_LORD_JARAXXUS, FAIL); } if (data == DATA_BEASTS) { uiSnoboldGuid_1 = 0; uiSnoboldGuid_2 = 0; uiSnoboldGuid_3 = 0; uiSnoboldGuid_4 = 0; acidmawDead = 0; dreadscaleDead = 0; SetBossState(DATA_ANUBARAK, NOT_STARTED); SetBossState(DATA_TWIN_VALKYR, NOT_STARTED); SetBossState(DATA_FACTION_CHAMPIONS, NOT_STARTED); SetBossState(DATA_LORD_JARAXXUS, NOT_STARTED); SetBossState(DATA_BEASTS, FAIL); } }
void SetData(uint32 type, uint32 data) { if (type == DATA_WAVE_COUNT && data == SPECIAL) { CloseDoor(uiFrontDoor); events.ScheduleEvent(EVENT_NEXT_WAVE, 10000); return; } if (uiWaveCount && data == NOT_STARTED) DoWipe(); switch (type) { case DATA_INTRO_EVENT: uiIntroDone = data; break; case DATA_FALRIC_EVENT: uiEncounter[0] = data; if (data == DONE) events.ScheduleEvent(EVENT_NEXT_WAVE, 60000); break; case DATA_MARWYN_EVENT: uiEncounter[1] = data; if (data == DONE) { OpenDoor(uiFrostwornDoor); OpenDoor(uiFrontDoor); } break; case DATA_FROSWORN_EVENT: uiEncounter[2] = data; if (data == DONE) { OpenDoor(uiArthasDoor); SetData(DATA_PHASE, 3); instance->SummonCreature(BOSS_LICH_KING, OutroSpawns[0]); instance->SummonCreature(NPC_JAINA_OUTRO, OutroSpawns[1]); } break; case DATA_LICHKING_EVENT: uiEncounter[3] = data; if(data == IN_PROGRESS) { OpenDoor(uiRunDoor); if(instance->IsHeroic()) DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT); } if(data == FAIL) { for(uint8 i = 0; i<4; i++) OpenDoor(uiWallID[i]); CloseDoor(uiRunDoor); if(Creature* pLichKing = instance->GetCreature(uiLichKing)) pLichKing->DespawnOrUnsummon(10000); if(Creature* pLider = instance->GetCreature(uiLider)) pLider->DespawnOrUnsummon(10000); DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT); DoCastSpellOnPlayers(5); // Kill all players SetData(DATA_PHASE, 3); instance->SummonCreature(BOSS_LICH_KING, OutroSpawns[0]); instance->SummonCreature(NPC_JAINA_OUTRO, OutroSpawns[1]); } if(data == DONE) { if(GameObject *pChest = instance->GetGameObject(uiChest)) pChest->SetPhaseMask(1, true); if(GameObject *pPortal = instance->GetGameObject(uiPortal)) pPortal->SetPhaseMask(1, true); DoCompleteAchievement(ACHIEV_HALLS_OF_REFLECTION_N); if(instance->IsHeroic()) { DoCompleteAchievement(ACHIEV_HALLS_OF_REFLECTION_H); DoCastSpellOnPlayers(SPELL_ACHIEV_CHECK); DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT); } } break; case DATA_SUMMONS: if (data == 3) uiSummons = 0; else if (data == 1) ++uiSummons; else if (data == 0) --uiSummons; data = NOT_STARTED; break; case DATA_ICE_WALL_1: uiWall[0] = data; break; case DATA_ICE_WALL_2: uiWall[1] = data; break; case DATA_ICE_WALL_3: uiWall[2] = data; break; case DATA_ICE_WALL_4: uiWall[3] = data; break; case DATA_PHASE: uiDataPhase = data; break; } if (data == DONE) SaveToDB(); }
bool SetBossState(uint32 id, EncounterState state) { if (loading) return InstanceScript::SetBossState(id, state); if (id == DATA_FACTION_CHAMPIONS && state == DONE) instance->GetCreature(uiTirionGuid)->SummonGameObject(GO_CACHE,563.800964f, 140.557205f, 393.957205f, 4.700161f, 0, 0, 0, 0, 0); if (id == DATA_LORD_JARAXXUS && (state == DONE || state == FAIL) && !misstressOfPain.empty()) { uint8 count = 0; for (std::vector<uint64>::const_iterator itr = misstressOfPain.begin(); itr != misstressOfPain.end(); ++itr) { Creature* c = instance->GetCreature(*itr); if (!c) continue; if (c->isAlive()) ++count; } if (state == DONE) DoCompleteAchievement(instance->GetSpawnMode() == 0 || instance->GetSpawnMode() == 2 ? 3996 : 3997); misstressOfPain.clear(); } if (id == DATA_TWIN_VALKYR && (state == DONE || state == FAIL)) { DoRemoveAurasDueToSpellOnPlayers(65686); DoRemoveAurasDueToSpellOnPlayers(65684); DoRemoveAurasDueToSpellOnPlayers(67604); } if (id == DATA_BEASTS && state == DONE) { uint8 count = 0; if (uiSnoboldGuid_1) { if (Creature* c = instance->GetCreature(uiSnoboldGuid_1)) if (c->isAlive()) ++count; } if (uiSnoboldGuid_2) { if (Creature* c = instance->GetCreature(uiSnoboldGuid_2)) if (c->isAlive()) ++count; } if (uiSnoboldGuid_3) { if (Creature* c = instance->GetCreature(uiSnoboldGuid_3)) if (c->isAlive()) ++count; } if (uiSnoboldGuid_4) { if (Creature* c = instance->GetCreature(uiSnoboldGuid_4)) if (c->isAlive()) ++count; } if (count >= 2) { //Upper Back Pain uint32 achi = 0; if (instance->GetSpawnMode() == 0 || instance->GetSpawnMode() == 2) //10 man normal/hero achi = 3797; else if (instance->GetSpawnMode() == 1 || instance->GetSpawnMode() == 3) //25 man normal/hero achi = 3813; if (achi) DoCompleteAchievement(achi); } } if (id == DATA_ANUBARAK && state == DONE) { if (instance->GetSpawnMode() == 2) //10 man { if (attempts >= 25) DoCompleteAchievement(3808); //A Tribute to Skill if (attempts >= 45) DoCompleteAchievement(3809); //A Tribute to Mad Skill if (attempts >= 50) DoCompleteAchievement(3810); //A Tribute to Insanity } if (instance->GetSpawnMode() == 3) //25 man { if (attempts >= 25) DoCompleteAchievement(3817); //A Tribute to Skill if (attempts >= 45) DoCompleteAchievement(3818); //A Tribute to Mad Skill if (attempts >= 50) { DoCompleteAchievement(3819); //A Tribute to Insanity if (deathsCount == 0) { //A Tribute to Immortality AchievementEntry const* horde = GetAchievementStore()->LookupEntry(4079); AchievementEntry const* ally = GetAchievementStore()->LookupEntry(4156); Map::PlayerList const &PlayerList = instance->GetPlayers(); if (!horde || !ally) { if (!horde) sLog->outError("TSCR: DoCompleteAchievement called for not existing achievement %u", horde); if (!ally) sLog->outError("TSCR: DoCompleteAchievement called for not existing achievement %u", ally); return InstanceScript::SetBossState(id, state); } if (!PlayerList.isEmpty()) for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) if (Player *pPlayer = i->getSource()) if (pPlayer->GetTeam() == HORDE) pPlayer->CompletedAchievement(horde); else if (pPlayer->GetTeam() == ALLIANCE) pPlayer->CompletedAchievement(ally); } //A Tribute to Dedicated Insanity bool ok = true; Map::PlayerList const& list = instance->GetPlayers(); if (!list.isEmpty()) { for (Map::PlayerList::const_iterator itr = list.begin(); itr != list.end(); ++itr) { Player* plr = itr->getSource(); if (!plr) continue; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) { if (Item *pItem = plr->GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { if (ItemPrototype const* proto = sObjectMgr->GetItemPrototype(pItem->GetEntry())) { uint32 lvl = proto->ItemLevel; uint32 id = proto->ItemId; //ids are 272 cloacks obtained from 25-man hero Tribute Chest if (lvl>258 && id!=47545 && id!=47547 && id!=47546 && id!=47549 && id!=47554 && id!=47552 && id!=47548 && id!=47550 && id!=47553 && id!=47551) { ok = false; break; } } } }//end for (eq slots) }//end for (players in map) }//end if (not empty) else ok = false; if (ok) DoCompleteAchievement(4080); }//end if (50 attempts) }//end if (25man) if (instance->GetSpawnMode() == 2) //10man hero { if (attempts >= 25 && attempts < 45) instance->GetCreature(uiTirionGuid)->SummonGameObject(195665, 686.117249f, 149.060455f, 142.147736f, 6.164101f, 0, 0, 0, 0, 0); else if (attempts >= 45 && attempts < 50) instance->GetCreature(uiTirionGuid)->SummonGameObject(195666, 686.117249f, 149.060455f, 142.147736f, 6.164101f, 0, 0, 0, 0, 0); else if (attempts >= 50) instance->GetCreature(uiTirionGuid)->SummonGameObject(195667, 686.117249f, 149.060455f, 142.147736f, 6.164101f, 0, 0, 0, 0, 0); else instance->GetCreature(uiTirionGuid)->SummonGameObject(195668, 686.117249f, 149.060455f, 142.147736f, 6.164101f, 0, 0, 0, 0, 0); } if (instance->GetSpawnMode() == 3) //25man hero { if (attempts >= 25 && attempts < 45) instance->GetCreature(uiTirionGuid)->SummonGameObject(195669, 686.117249f, 149.060455f, 142.147736f, 6.164101f, 0, 0, 0, 0, 0); else if (attempts >= 45 && attempts < 50) instance->GetCreature(uiTirionGuid)->SummonGameObject(195670, 686.117249f, 149.060455f, 142.147736f, 6.164101f, 0, 0, 0, 0, 0); else if (attempts >= 50) instance->GetCreature(uiTirionGuid)->SummonGameObject(195671, 686.117249f, 149.060455f, 142.147736f, 6.164101f, 0, 0, 0, 0, 0); else instance->GetCreature(uiTirionGuid)->SummonGameObject(195672, 686.117249f, 149.060455f, 142.147736f, 6.164101f, 0, 0, 0, 0, 0); } }//end if (DONE ANUBARAK) return InstanceScript::SetBossState(id, state); }
void SetData(uint32 type, uint32 data) { if (type == DATA_WIPE) { DoWipe(); return; } if (type == DATA_WAVES_STATE && data == IN_PROGRESS) { uiWaveState = data; HandleGameObject(uiFrontDoor, false); events.CancelEvent(EVENT_NEXT_WAVE); events.ScheduleEvent(EVENT_NEXT_WAVE, 10000); return; } switch (type) { case DATA_INTRO_EVENT: uiIntroDone = data; break; case DATA_FALRIC_EVENT: uiEncounter[0] = data; if (data == DONE) { events.CancelEvent(EVENT_NEXT_WAVE); events.ScheduleEvent(EVENT_NEXT_WAVE, WAVE_STD_SPAWNCYCLE); } break; case DATA_MARWYN_EVENT: uiEncounter[1] = data; if (data == DONE) { HandleGameObject(uiFrostwornDoor, true); HandleGameObject(uiFrontDoor, true); } break; case DATA_FROSWORN_EVENT: uiEncounter[2] = data; if (data == DONE) { HandleGameObject(uiArthasDoor, true); SetData(DATA_PHASE, 3); instance->SummonCreature(NPC_LICH_KING_BOSS, OutroSpawns[0]); instance->SummonCreature(uiTeamInInstance == HORDE ? NPC_SYLVANAS_PART2 : NPC_JAINA_PART2, OutroSpawns[1]); } break; case DATA_LICHKING_EVENT: uiEncounter[3] = data; if (data == IN_PROGRESS) { // Respawn all ice uiWalls on gossip select for (uint8 i = 0; i<4; i++) HandleGameObject(uiWallID[i], false); // Open door on gossip select HandleGameObject(uiRunDoor, true); if (instance->IsHeroic()) DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT); } if (data == FAIL) { // Open ice uiWalls on wipe (way back for alive players) for (uint8 i = 0; i<4; i++) HandleGameObject(uiWallID[i], true); // Open door on wipe (way back for alive players) HandleGameObject(uiRunDoor, true); if (Creature* pLichKing = instance->GetCreature(uiLichKingEvent)) pLichKing->DespawnOrUnsummon(10000); if (Creature* pLeader = instance->GetCreature(uiLeader)) pLeader->DespawnOrUnsummon(10000); DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT); DoCastSpellOnPlayers(5); // Kill all players SetData(DATA_PHASE, 3); instance->SummonCreature(NPC_LICH_KING_BOSS, OutroSpawns[0]); instance->SummonCreature(uiTeamInInstance == HORDE ? NPC_SYLVANAS_PART2 : NPC_JAINA_PART2, OutroSpawns[1]); } if (data == DONE) { // Open ice uiWalls on complete (way back for alive players) for (uint8 i = 0; i<4; i++) HandleGameObject(uiWallID[i], true); // Open door on complete (way back for alive players) HandleGameObject(uiRunDoor, true); if (GameObject* pChest = instance->GetGameObject(uiChest)) pChest->SetPhaseMask(1, true); if (GameObject* pPortal = instance->GetGameObject(uiPortal)) pPortal->SetPhaseMask(1, true); if (!instance->IsHeroic()) { DoCompleteAchievement(ACHIEV_HALLS_OF_REFLECTION_N); } else { DoCompleteAchievement(ACHIEV_HALLS_OF_REFLECTION_H); DoCastSpellOnPlayers(SPELL_ACHIEV_CHECK); DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT); } } break; case DATA_ICE_WALL_1: uiWall[0] = data; if (data == IN_PROGRESS) { uiCurrentWall = 1; } break; case DATA_ICE_WALL_2: uiWall[1] = data; if (data == IN_PROGRESS) { uiCurrentWall = 2; } break; case DATA_ICE_WALL_3: uiWall[2] = data; if (data == IN_PROGRESS) { uiCurrentWall = 3; } break; case DATA_ICE_WALL_4: uiWall[3] = data; if (data == IN_PROGRESS) { uiCurrentWall = 4; } break; case DATA_PHASE: uiDataPhase = data; break; case DATA_CURRENT_WALL: uiCurrentWall = data; break; case DATA_WAVES_STATE: uiWaveState = data; break; } if (data == DONE) SaveToDB(); }
void instance_culling_of_stratholme::Update(uint32 uiDiff) { // 25min Run - decrease time, update worldstate every ~20s // as the time is always saved by m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME], there is no need for an extra timer if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME]) { if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] <= uiDiff) SetData(TYPE_INFINITE_CORRUPTER, FAIL); else { m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] -= uiDiff; if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME]/IN_MILLISECONDS % 20 == 0) SetData(TYPE_INFINITE_CORRUPTER_TIME, m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME]); } // This part is needed for a small "hurry up guys" note, TODO, verify 20min if (m_auiEncounter[TYPE_INFINITE_CORRUPTER] == IN_PROGRESS && m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] <= 24*MINUTE*IN_MILLISECONDS) SetData(TYPE_INFINITE_CORRUPTER, SPECIAL); } // Small Timer, to remove Grain-Crate WorldState and Spawn Second Chromie if (m_uiRemoveCrateStateTimer) { if (m_uiRemoveCrateStateTimer <= uiDiff) { DoUpdateWorldState(WORLD_STATE_CRATES, 0); DoSpawnChromieIfNeeded(); m_uiRemoveCrateStateTimer = 0; } else m_uiRemoveCrateStateTimer -= uiDiff; } // Respawn Arthas after some time if (m_uiArthasRespawnTimer) { if (m_uiArthasRespawnTimer <= uiDiff) { DoSpawnArthasIfNeeded(); m_uiArthasRespawnTimer = 0; } else m_uiArthasRespawnTimer -= uiDiff; } // Check for Zombiefest if(m_auiEncounter[10] == IN_PROGRESS) { m_uiZombieTimer += uiDiff; if (m_uiZombieTimer > 60000) { m_uiZombieCount = 0; m_uiZombieTimer = 1500000; m_auiEncounter[12] = FAIL; } else if(m_uiZombieCount >= 100) { DoCompleteAchievement(ACHIEV_ZOMBIEFEST); m_uiZombieCount = 0; m_auiEncounter[12] = DONE; } } }
void SetData(uint32 type, uint32 data) { switch (type) { case DATA_MEATHOOK_EVENT: _encounterState[0] = data; break; case DATA_SALRAMM_EVENT: if(data == DONE) { DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, 0); if(ArthasNeedsTeleport()) if(Creature* arthas = instance->GetCreature(_arthasGUID)) arthas->AI()->SetData(1, 0); } _encounterState[1] = data; break; case DATA_EPOCH_EVENT: _encounterState[2] = data; break; case DATA_MAL_GANIS_EVENT: _encounterState[3] = data; switch (_encounterState[3]) { case NOT_STARTED: HandleGameObject(_malGanisGate2GUID, true); break; case IN_PROGRESS: HandleGameObject(_malGanisGate2GUID, false); break; case DONE: HandleGameObject(_exitGateGUID, true); if (GameObject* go = instance->GetGameObject(_malGanisChestGUID)) go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND); instance->SummonCreature(NPC_CHROMIE_3, ChromieExitSummonPos); Map::PlayerList const &players = instance->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) itr->getSource()->KilledMonsterCredit(31006, 0); break; } break; case DATA_INFINITE_EVENT: _encounterState[4] = data; switch (data) { case DONE: DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, 0); DoCompleteAchievement(ACHIEVEMENT_CULLING_TIME); break; case FAIL: DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, 0); if(Creature* infinite = instance->GetCreature(_infiniteGUID)) infinite->AI()->DoAction(0); break; case IN_PROGRESS: DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, 1); DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN, 25); instance->SummonCreature(NPC_INFINITE, InfiniteSummonPos); break; } break; case DATA_ARTHAS_EVENT: if (data == FAIL) { if (Creature* deadArthas = instance->GetCreature(_arthasGUID)) { deadArthas->DespawnOrUnsummon(10000); int index; if(_artasStepUi >= 83) // Before last run index = 2; else if (_artasStepUi >= 60) // Before the council index = 1; else // entrance of city index = 0; if(Creature* newArthas = instance->SummonCreature(NPC_ARTHAS, ArthasSpawnPositions[index])) newArthas->AI()->SetData(0, pow(2.0, index)); } } break; case DATA_CRATE_COUNT: _crateCount = data; DoUpdateWorldState(WORLDSTATE_CRATES_REVEALED, _crateCount); if (_crateCount == 5) { Map::PlayerList const &players = instance->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) itr->getSource()->KilledMonsterCredit(30996, 0); // Summon Chromie and global whisper if (Creature* chromie = instance->SummonCreature(NPC_CHROMIE_2, ChromieEntranceSummonPos)) if (!instance->GetPlayers().isEmpty()) if (Player* player = instance->GetPlayers().getFirst()->getSource()) sCreatureTextMgr->SendChat(chromie, SAY_CRATES_COMPLETED, player->GetGUID(), CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP); DoUpdateWorldState(WORLDSTATE_SHOW_CRATES, 0); } break; case DATA_TRANSFORM_CITIZENS: switch(data) { case SPECIAL: // Respawn Zombies while (!_zombiesList.empty()) { Creature *summon = instance->GetCreature(*_zombiesList.begin()); if (!summon) _zombiesList.erase(_zombiesList.begin()); else { _zombiesList.erase(_zombiesList.begin()); if (TempSummon* summ = summon->ToTempSummon()) { summon->DestroyForNearbyPlayers(); summ->UnSummon(); } else summon->DisappearAndDie(); } } case IN_PROGRESS: // Transform Citizens for (std::list<uint64>::iterator itr = _citizensList.begin(); itr != _citizensList.end(); ++itr) if(Creature* citizen = instance->GetCreature((*itr))) { if(Creature* arthas = instance->GetCreature(GetData64(DATA_ARTHAS))) if(Creature* risenZombie = arthas->SummonCreature(NPC_ZOMBIE, citizen->GetPositionX(), citizen->GetPositionY(), citizen->GetPositionZ(), citizen->GetOrientation())) //, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)) _zombiesList.push_back(risenZombie->GetGUID()); citizen->SetPhaseMask(2, true); } break; } break; case DATA_ZOMBIEFEST: if (!instance->IsHeroic() || GetData(DATA_ZOMBIEFEST) == DONE) break; switch(data) { case DONE: DoCompleteAchievement(ACHIEVEMENT_ZOMBIEFEST); DoSendNotifyToInstance(zombiefestWarnings[10]); _zombieFest = data; break; case IN_PROGRESS: DoSendNotifyToInstance(zombiefestWarnings[0]); _zombieFest = data; break; case FAIL: _killedZombieCount = 0; _zombieTimer = 60000; _zombieFest = data; DoSendNotifyToInstance(zombiefestWarnings[11]); break; case SPECIAL: _killedZombieCount++; if(_killedZombieCount == 1) SetData(DATA_ZOMBIEFEST, IN_PROGRESS); else if(_killedZombieCount >= 100 && GetData(DATA_ZOMBIEFEST) == IN_PROGRESS) SetData(DATA_ZOMBIEFEST, DONE); else { if(_killedZombieCount%10 == 0) DoSendNotifyToInstance(zombiefestWarnings[_killedZombieCount/10]); } break; } break; case DATA_ARTHAS_STEP: _artasStepUi = data; return; } if (data == DONE) SaveToDB(); }
void SetData(uint32 type, uint32 data) { switch (type) { case DATA_WAVE_COUNT: if (GetData(DATA_MARWYN_EVENT) == DONE) { WaveCnt = 0; DoUpdateWorldState(WORLD_STATE_HOR_WAVE_COUNT, 0); DoUpdateWorldState(WORLD_STATE_HOR, WaveCnt); events.CancelEvent(EVENT_NEXT_WAVE); break; } if (data == START_WAVES) // Start der Wellen { CloseDoor(FrontDoorGUID); events.ScheduleEvent(EVENT_NEXT_WAVE, 0); break; } if (data == START_NEXT_WAVE_INSTANT) // Nächste Welle sofort { events.RescheduleEvent(EVENT_NEXT_WAVE, 0); break; } if (data == START_NEXT_WAVE) // Nächste Welle starten { events.RescheduleEvent(EVENT_NEXT_WAVE, SEKUNDEN_60); break; } if (WaveCnt && data == START_RESET) // Wipe { DoWipe(); break; } break; case DATA_INTRO_EVENT: IntroDone = data; break; case DATA_FALRIC_EVENT: Encounter[0] = data; if (data == DONE) events.RescheduleEvent(EVENT_NEXT_WAVE, SEKUNDEN_60); break; case DATA_MARWYN_EVENT: Encounter[1] = data; if (data == DONE) { DoUpdateWorldState(WORLD_STATE_HOR, 0); OpenDoor(FrostwornDoorGUID); OpenDoor(FrontDoorGUID); } break; case DATA_FROSWORN_EVENT: Encounter[2] = data; if (data == DONE) { OpenDoor(ArthasDoorGUID); SetData(DATA_PHASE, 3); instance->SummonCreature(BOSS_LICH_KING, OutroSpawns[0]); instance->SummonCreature(NPC_JAINA_OUTRO, OutroSpawns[1]); } break; case DATA_LICHKING_EVENT: Encounter[3] = data; switch(data) { case IN_PROGRESS: OpenDoor(RunDoorGUID); if (instance->IsHeroic()) DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT); break; case FAIL: for (uint8 i=0; i<4; ++i) OpenDoor(WallGUID[i]); CloseDoor(RunDoorGUID); if (Creature * LichKing = instance->GetCreature(LichKingGUID)) LichKing->DespawnOrUnsummon(10000); if (Creature * Leader = instance->GetCreature(LeaderGUID)) Leader->DespawnOrUnsummon(10000); DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT); DoCastSpellOnPlayers(SPELL_SUICIDE); // Alle Spieler begehen Selbsmord! SetData(DATA_PHASE, 3); instance->SummonCreature(BOSS_LICH_KING, OutroSpawns[0]); instance->SummonCreature(NPC_JAINA_OUTRO, OutroSpawns[1]); break; case DONE: if (GameObject * Chest = instance->GetGameObject(ChestGUID)) Chest->SetPhaseMask(1, true); if (GameObject * Portal = instance->GetGameObject(PortalGUID)) Portal->SetPhaseMask(1, true); DoCompleteAchievement(ACHIEV_HALLS_OF_REFLECTION_N); if (instance->IsHeroic()) { DoCompleteAchievement(ACHIEV_HALLS_OF_REFLECTION_H); DoCastSpellOnPlayers(SPELL_ACHIEV_CHECK); DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT); } break; } break; case DATA_SUMMONS: if (data == 3) Summons = 0; else if (data == 1) ++Summons; else if (data == 0) --Summons; data = NOT_STARTED; break; case DATA_ICE_WALL_1: WallData[0] = data; break; case DATA_ICE_WALL_2: WallData[1] = data; break; case DATA_ICE_WALL_3: WallData[2] = data; break; case DATA_ICE_WALL_4: WallData[3] = data; break; case DATA_PHASE: PhaseData = data; break; } if (data == DONE) SaveToDB(); }