void Update(uint32 diff) { if (BaronRun_Timer) { if (BaronRun_Timer <= diff) { if (GetData(TYPE_BARON_RUN) != DONE) SetData(TYPE_BARON_RUN, FAIL); BaronRun_Timer = 0; debug_log("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); }else BaronRun_Timer -= diff; } if (SlaugtherSquare_Timer) { if (SlaugtherSquare_Timer <= diff) { if (Player *p = GetPlayerInMap()) { for(uint8 i = 0; i < 4; i++) p->SummonCreature(C_BLACK_GUARD,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); UpdateGoState(ziggurat4GUID,0,false); UpdateGoState(ziggurat5GUID,0,false); debug_log("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); } SlaugtherSquare_Timer = 0; }else SlaugtherSquare_Timer -= diff; } }
bool StartSlaugtherSquare() { //change to DONE when crystals implemented if (m_auiEncounter[1] == IN_PROGRESS && m_auiEncounter[2] == IN_PROGRESS && m_auiEncounter[3] == IN_PROGRESS) { UpdateGoState(m_uiPortGauntletGUID,0,false); UpdateGoState(m_uiPortSlaugtherGUID,0,false); return true; } debug_log("SD2: Instance Stratholme: Cannot open slaugther square yet."); return false; }
void Update(uint32 diff) { if (m_uiBaronRun_Timer) { if (m_uiBaronRun_Timer <= diff) { if (GetData(TYPE_BARON_RUN) != DONE) SetData(TYPE_BARON_RUN, FAIL); m_uiBaronRun_Timer = 0; debug_log("SD2: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); } else m_uiBaronRun_Timer -= diff; } if (m_uiSlaugtherSquare_Timer) { if (m_uiSlaugtherSquare_Timer <= diff) { if (Creature* pBaron = instance->GetCreature(m_uiBaronGUID)) { for(uint8 i = 0; i < 4; ++i) pBaron->SummonCreature(NPC_BLACK_GUARD,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); UpdateGoState(m_uiZiggurat4GUID,GO_STATE_ACTIVE,false); UpdateGoState(m_uiZiggurat5GUID,GO_STATE_ACTIVE,false); debug_log("SD2: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); } m_uiSlaugtherSquare_Timer = 0; } else m_uiSlaugtherSquare_Timer -= diff; } }
void SetData(uint32 uiType, uint32 uiData) { switch(uiType) { case TYPE_BARON_RUN: switch(uiData) { case IN_PROGRESS: if (m_auiEncounter[0] == IN_PROGRESS || m_auiEncounter[0] == FAIL) break; m_uiBaronRun_Timer = 2700000; debug_log("SD2: Instance Stratholme: Baron run in progress."); break; case FAIL: //may add code to remove aura from players, but in theory the time should be up already and removed. break; case DONE: if (Creature* pYsidaT = instance->GetCreature(m_uiYsidaTriggerGUID)) pYsidaT->SummonCreature(NPC_YSIDA, pYsidaT->GetPositionX(),pYsidaT->GetPositionY(),pYsidaT->GetPositionZ(),pYsidaT->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN,1800000); m_uiBaronRun_Timer = 0; break; } m_auiEncounter[0] = uiData; break; case TYPE_BARONESS: m_auiEncounter[1] = uiData; if (uiData == IN_PROGRESS) UpdateGoState(m_uiZiggurat1GUID,GO_STATE_ACTIVE,false); if (uiData == IN_PROGRESS) //change to DONE when crystals implemented StartSlaugtherSquare(); break; case TYPE_NERUB: m_auiEncounter[2] = uiData; if (uiData == IN_PROGRESS) UpdateGoState(m_uiZiggurat2GUID,GO_STATE_ACTIVE,false); if (uiData == IN_PROGRESS) //change to DONE when crystals implemented StartSlaugtherSquare(); break; case TYPE_PALLID: m_auiEncounter[3] = uiData; if (uiData == IN_PROGRESS) UpdateGoState(m_uiZiggurat3GUID,GO_STATE_ACTIVE,false); if (uiData == IN_PROGRESS) //change to DONE when crystals implemented StartSlaugtherSquare(); break; case TYPE_RAMSTEIN: if (uiData == IN_PROGRESS) { if (m_auiEncounter[4] != IN_PROGRESS) UpdateGoState(m_uiPortGauntletGUID,GO_STATE_READY,false); uint32 uiCount = abomnationGUID.size(); for(std::set<uint64>::iterator i = abomnationGUID.begin(); i != abomnationGUID.end(); ++i) { if (Creature* pAbom = instance->GetCreature(*i)) { if (!pAbom->isAlive()) --uiCount; } } if (!uiCount) { //a bit itchy, it should close the door after 10 secs, but it doesn't. skipping it for now. //UpdateGoState(ziggurat4GUID,0,true); if (Creature* pBaron = instance->GetCreature(m_uiBaronGUID)) pBaron->SummonCreature(NPC_RAMSTEIN,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); debug_log("SD2: Instance Stratholme: Ramstein spawned."); } else debug_log("SD2: Instance Stratholme: %u Abomnation left to kill.", uiCount); } if (uiData == DONE) { m_uiSlaugtherSquare_Timer = 300000; debug_log("SD2: Instance Stratholme: Slaugther event will continue in 5 minutes."); } m_auiEncounter[4] = uiData; break; case TYPE_BARON: if (uiData == IN_PROGRESS) { if (GetData(TYPE_BARON_RUN) == IN_PROGRESS) { Map::PlayerList const& players = instance->GetPlayers(); if (!players.isEmpty()) { for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) { if (Player* pPlayer = itr->getSource()) { if (pPlayer->HasAura(SPELL_BARON_ULTIMATUM)) pPlayer->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); if (pPlayer->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE) pPlayer->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA); } } } SetData(TYPE_BARON_RUN,DONE); } } m_auiEncounter[5] = uiData; break; case TYPE_SH_AELMAR: IsSilverHandDead[0] = (uiData) ? true : false; break; case TYPE_SH_CATHELA: IsSilverHandDead[1] = (uiData) ? true : false; break; case TYPE_SH_GREGOR: IsSilverHandDead[2] = (uiData) ? true : false; break; case TYPE_SH_NEMAS: IsSilverHandDead[3] = (uiData) ? true : false; break; case TYPE_SH_VICAR: IsSilverHandDead[4] = (uiData) ? true : false; break; } }
void SetData(uint32 type, uint32 data) { Player *player = GetPlayerInMap(); if (!player) { debug_log("TSCR: Instance Stratholme: SetData (Type: %u Data %u) cannot find any player.", type, data); return; } switch(type) { case TYPE_BARON_RUN: switch(data) { case IN_PROGRESS: if (Encounter[0] == IN_PROGRESS || Encounter[0] == FAIL) break; BaronRun_Timer = 2700000; debug_log("TSCR: Instance Stratholme: Baron run in progress."); break; case FAIL: //may add code to remove aura from players, but in theory the time should be up already and removed. break; case DONE: BaronRun_Timer = 0; break; } Encounter[0] = data; break; case TYPE_BARONESS: Encounter[1] = data; if (data == SPECIAL) UpdateGoState(ziggurat1GUID,0,false); if (data == DONE) StartSlaugtherSquare(); break; case TYPE_NERUB: Encounter[2] = data; if (data == SPECIAL) UpdateGoState(ziggurat2GUID,0,false); if (data == DONE) StartSlaugtherSquare(); break; case TYPE_PALLID: Encounter[3] = data; if (data == SPECIAL) UpdateGoState(ziggurat3GUID,0,false); if (data == DONE) StartSlaugtherSquare(); break; case TYPE_RAMSTEIN: if (data == IN_PROGRESS) { if (Encounter[4] != IN_PROGRESS) UpdateGoState(portGauntletGUID,1,false); uint32 count = abomnationGUID.size(); for(std::set<uint64>::iterator i = abomnationGUID.begin(); i != abomnationGUID.end(); ++i) { if (Unit* abom = Unit::GetUnit(*player, *i)) { if (!abom->isAlive()) --count; } } if (!count) { //a bit itchy, it should close the door after 10 secs, but it doesn't. skipping it for now. //UpdateGoState(ziggurat4GUID,0,true); player->SummonCreature(C_RAMSTEIN,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); debug_log("TSCR: Instance Stratholme: Ramstein spawned."); } else debug_log("TSCR: Instance Stratholme: %u Abomnation left to kill.",count); } if (data == SPECIAL) { SlaugtherSquare_Timer = 300000; HandleGameObject(portGauntletGUID, true); debug_log("TSCR: Instance Stratholme: Slaugther event will continue in 5 minutes."); } if (data == DONE) { SlaugtherSquare_Timer = 10000; debug_log("TSCR: Instance Stratholme: Skeletons died, slaughter event will continue"); } if (data == FAIL) { HandleGameObject(portGauntletGUID, true); data = SPECIAL; } Encounter[4] = data; break; case TYPE_BARON: if (data == IN_PROGRESS) { if (GetData(TYPE_BARON_RUN) == IN_PROGRESS) { if (Unit *t = Unit::GetUnit(*player, ysidaTriggerGUID)) t->SummonCreature(C_YSIDA,t->GetPositionX(),t->GetPositionY(),t->GetPositionZ(),t->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1800000); if (Group *pGroup = player->GetGroup()) { for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* pGroupie = itr->getSource(); if (!pGroupie) continue; if (pGroupie->HasAura(SPELL_BARON_ULTIMATUM,0)) pGroupie->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); if (pGroupie->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE) { pGroupie->CastedCreatureOrGO(C_YSIDA, ysidaGUID,0); pGroupie->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA); } } } else if (player->HasAura(SPELL_BARON_ULTIMATUM,0)) player->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); if (Unit *temp = Unit::GetUnit(*player,GetData64(DATA_BARON))) { player->CastedCreatureOrGO(C_YSIDA, ysidaGUID,0); player->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA); } SetData(TYPE_BARON_RUN,DONE); } } if (data == DONE) { HandleGameObject(portGauntletGUID, true); } if (Encounter[5] != DONE) Encounter[5] = data; break; case TYPE_SH_AELMAR: IsSilverHandDead[0] = (data) ? true : false; break; case TYPE_SH_CATHELA: IsSilverHandDead[1] = (data) ? true : false; break; case TYPE_SH_GREGOR: IsSilverHandDead[2] = (data) ? true : false; break; case TYPE_SH_NEMAS: IsSilverHandDead[3] = (data) ? true : false; break; case TYPE_SH_VICAR: IsSilverHandDead[4] = (data) ? true : false; break; case TYPE_GAUNTLET_MOB: if (data != 1) break; if (GetData(TYPE_NERUB) != DONE && std::none_of(acolyte2GUID.begin(),acolyte2GUID.end(),[this](uint64 guid)-> bool {Creature *c = GetCreature(guid) ; return c ? c->isAlive():false;})) { Creature *c = GetCreature(CrystalsGUID[1]); if(c && c->isAlive()) c->Kill(c,false); SetData(TYPE_NERUB,DONE); } if (GetData(TYPE_BARONESS) != DONE && std::none_of(acolyte1GUID.begin(),acolyte1GUID.end(),[this](uint64 guid)-> bool {Creature *c = GetCreature(guid) ; return c ? c->isAlive():false;})) { Creature *c = GetCreature(CrystalsGUID[0]); if(c && c->isAlive()) c->Kill(c,false); SetData(TYPE_BARONESS,DONE); } if (GetData(TYPE_PALLID) != DONE && std::none_of(acolyte3GUID.begin(),acolyte3GUID.end(),[this](uint64 guid)-> bool {Creature *c = GetCreature(guid) ; return c ? c->isAlive():false;})) { Creature *c = GetCreature(CrystalsGUID[2]); if(c && c->isAlive()) c->Kill(c,false); SetData(TYPE_PALLID,DONE); } } }