| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7ff510a commit aa67170
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,6 +23,7 @@ enum | |||
| 23 | 23 | ||
| 24 | 24 | NPC_EMPEROR = 9019, | |
| 25 | 25 | NPC_PRINCESS = 8929, | |
| 26 | + NPC_PRIESTESS = 10076, | ||
| 26 | 27 | NPC_PHALANX = 9502, | |
| 27 | 28 | NPC_HATEREL = 9034, | |
| 28 | 29 | NPC_ANGERREL = 9035, | |
@@ -80,6 +81,9 @@ enum | |||
| 80 | 81 | GO_DWARFRUNE_F01 = 170583, | |
| 81 | 82 | GO_DWARFRUNE_G01 = 170584, | |
| 82 | 83 | ||
| 84 | + QUEST_ROYAL_RESCUE = 4003, // horde quest | ||
| 85 | + QUEST_FATE_KINGDOM = 4362, // alliance quest | ||
| 86 | + | ||
| 83 | 87 | SPELL_STONED = 10255, // Aura of Warbringer Constructs in Relict Vault | |
| 84 | 88 | ||
| 85 | 89 | FACTION_DWARF_HOSTILE = 754, // Hostile faction for the Tomb of the Seven dwarfs | |
@@ -157,6 +161,7 @@ class instance_blackrock_depths : public ScriptedInstance | |||
| 157 | 161 | ||
| 158 | 162 | private: | |
| 159 | 163 | void DoCallNextDwarf(); | |
| 164 | + bool CanReplacePrincess(); | ||
| 160 | 165 | ||
| 161 | 166 | uint32 m_auiEncounter[MAX_ENCOUNTER]; | |
| 162 | 167 | std::string m_strInstData; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,15 +44,13 @@ struct boss_emperor_dagran_thaurissanAI : public ScriptedAI | |||
| 44 | 44 | ||
| 45 | 45 | ScriptedInstance* m_pInstance; | |
| 46 | 46 | ||
| 47 | - uint32 m_uiHandOfThaurissan_Timer; | ||
| 48 | - uint32 m_uiAvatarOfFlame_Timer; | ||
| 49 | - // uint32 m_uiCounter; | ||
| 47 | + uint32 m_uiHandOfThaurissanTimer; | ||
| 48 | + uint32 m_uiAvatarOfFlameTimer; | ||
| 50 | 49 | ||
| 51 | 50 | void Reset() override | |
| 52 | 51 | { | |
| 53 | - m_uiHandOfThaurissan_Timer = 4000; | ||
| 54 | - m_uiAvatarOfFlame_Timer = 25000; | ||
| 55 | - // m_uiCounter = 0; | ||
| 52 | + m_uiHandOfThaurissanTimer = 4000; | ||
| 53 | + m_uiAvatarOfFlameTimer = 25000; | ||
| 56 | 54 | } | |
| 57 | 55 | ||
| 58 | 56 | void Aggro(Unit* /*pWho*/) override | |
@@ -68,6 +66,10 @@ struct boss_emperor_dagran_thaurissanAI : public ScriptedAI | |||
| 68 | 66 | ||
| 69 | 67 | if (Creature* pPrincess = m_pInstance->GetSingleCreatureFromStorage(NPC_PRINCESS)) | |
| 70 | 68 | { | |
| 69 | + // check if we didn't update the entry | ||
| 70 | + if (pPrincess->GetEntry() != NPC_PRINCESS) | ||
| 71 | + return; | ||
| 72 | + | ||
| 71 | 73 | if (pPrincess->isAlive()) | |
| 72 | 74 | { | |
| 73 | 75 | pPrincess->SetFactionTemporary(FACTION_NEUTRAL, TEMPFACTION_NONE); | |
@@ -86,34 +88,25 @@ struct boss_emperor_dagran_thaurissanAI : public ScriptedAI | |||
| 86 | 88 | if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) | |
| 87 | 89 | return; | |
| 88 | 90 | ||
| 89 | - if (m_uiHandOfThaurissan_Timer < uiDiff) | ||
| 91 | + if (m_uiHandOfThaurissanTimer < uiDiff) | ||
| 90 | 92 | { | |
| 91 | 93 | if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) | |
| 92 | - DoCastSpellIfCan(pTarget, SPELL_HANDOFTHAURISSAN); | ||
| 93 | - | ||
| 94 | - // 3 Hands of Thaurissan will be casted | ||
| 95 | - // if (m_uiCounter < 3) | ||
| 96 | - //{ | ||
| 97 | - // m_uiHandOfThaurissan_Timer = 1000; | ||
| 98 | - // ++m_uiCounter; | ||
| 99 | - //} | ||
| 100 | - // else | ||
| 101 | - //{ | ||
| 102 | - m_uiHandOfThaurissan_Timer = 5000; | ||
| 103 | - // m_uiCounter = 0; | ||
| 104 | - //} | ||
| 94 | + { | ||
| 95 | + if (DoCastSpellIfCan(pTarget, SPELL_HANDOFTHAURISSAN) == CAST_OK) | ||
| 96 | + m_uiHandOfThaurissanTimer = 5000; | ||
| 97 | + } | ||
| 105 | 98 | } | |
| 106 | 99 | else | |
| 107 | - m_uiHandOfThaurissan_Timer -= uiDiff; | ||
| 100 | + m_uiHandOfThaurissanTimer -= uiDiff; | ||
| 108 | 101 | ||
| 109 | 102 | // AvatarOfFlame_Timer | |
| 110 | - if (m_uiAvatarOfFlame_Timer < uiDiff) | ||
| 103 | + if (m_uiAvatarOfFlameTimer < uiDiff) | ||
| 111 | 104 | { | |
| 112 | - DoCastSpellIfCan(m_creature->getVictim(), SPELL_AVATAROFFLAME); | ||
| 113 | - m_uiAvatarOfFlame_Timer = 18000; | ||
| 105 | + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_AVATAROFFLAME) == CAST_OK) | ||
| 106 | + m_uiAvatarOfFlameTimer = 18000; | ||
| 114 | 107 | } | |
| 115 | 108 | else | |
| 116 | - m_uiAvatarOfFlame_Timer -= uiDiff; | ||
| 109 | + m_uiAvatarOfFlameTimer -= uiDiff; | ||
| 117 | 110 | ||
| 118 | 111 | DoMeleeAttackIfReady(); | |
| 119 | 112 | } | |
@@ -150,17 +143,17 @@ struct boss_moira_bronzebeardAI : public ScriptedAI | |||
| 150 | 143 | ||
| 151 | 144 | ScriptedInstance* m_pInstance; | |
| 152 | 145 | ||
| 153 | - uint32 m_uiHeal_Timer; | ||
| 154 | - uint32 m_uiMindBlast_Timer; | ||
| 155 | - uint32 m_uiShadowWordPain_Timer; | ||
| 156 | - uint32 m_uiSmite_Timer; | ||
| 146 | + uint32 m_uiHealTimer; | ||
| 147 | + uint32 m_uiMindBlastTimer; | ||
| 148 | + uint32 m_uiShadowWordPainTimer; | ||
| 149 | + uint32 m_uiSmiteTimer; | ||
| 157 | 150 | ||
| 158 | 151 | void Reset() override | |
| 159 | 152 | { | |
| 160 | - m_uiHeal_Timer = 12000; // These times are probably wrong | ||
| 161 | - m_uiMindBlast_Timer = 16000; | ||
| 162 | - m_uiShadowWordPain_Timer = 2000; | ||
| 163 | - m_uiSmite_Timer = 8000; | ||
| 153 | + m_uiHealTimer = 12000; // These times are probably wrong | ||
| 154 | + m_uiMindBlastTimer = 16000; | ||
| 155 | + m_uiShadowWordPainTimer = 2000; | ||
| 156 | + m_uiSmiteTimer = 8000; | ||
| 164 | 157 | } | |
| 165 | 158 | ||
| 166 | 159 | void AttackStart(Unit* pWho) override | |
@@ -183,7 +176,7 @@ struct boss_moira_bronzebeardAI : public ScriptedAI | |||
| 183 | 176 | { | |
| 184 | 177 | // if evade, then check if he is alive. If not, start make portal | |
| 185 | 178 | if (!pEmperor->isAlive()) | |
| 186 | - m_creature->CastSpell(m_creature, SPELL_OPEN_PORTAL, false); | ||
| 179 | + DoCastSpellIfCan(m_creature, SPELL_OPEN_PORTAL); | ||
| 187 | 180 | } | |
| 188 | 181 | } | |
| 189 | 182 | } | |
@@ -195,45 +188,46 @@ struct boss_moira_bronzebeardAI : public ScriptedAI | |||
| 195 | 188 | return; | |
| 196 | 189 | ||
| 197 | 190 | // MindBlast_Timer | |
| 198 | - if (m_uiMindBlast_Timer < uiDiff) | ||
| 191 | + if (m_uiMindBlastTimer < uiDiff) | ||
| 199 | 192 | { | |
| 200 | - DoCastSpellIfCan(m_creature->getVictim(), SPELL_MINDBLAST); | ||
| 201 | - m_uiMindBlast_Timer = 14000; | ||
| 193 | + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_MINDBLAST) == CAST_OK) | ||
| 194 | + m_uiMindBlastTimer = 14000; | ||
| 202 | 195 | } | |
| 203 | 196 | else | |
| 204 | - m_uiMindBlast_Timer -= uiDiff; | ||
| 197 | + m_uiMindBlastTimer -= uiDiff; | ||
| 205 | 198 | ||
| 206 | 199 | // ShadowWordPain_Timer | |
| 207 | - if (m_uiShadowWordPain_Timer < uiDiff) | ||
| 200 | + if (m_uiShadowWordPainTimer < uiDiff) | ||
| 208 | 201 | { | |
| 209 | - DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOWWORDPAIN); | ||
| 210 | - m_uiShadowWordPain_Timer = 18000; | ||
| 202 | + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOWWORDPAIN) == CAST_OK) | ||
| 203 | + m_uiShadowWordPainTimer = 18000; | ||
| 211 | 204 | } | |
| 212 | 205 | else | |
| 213 | - m_uiShadowWordPain_Timer -= uiDiff; | ||
| 206 | + m_uiShadowWordPainTimer -= uiDiff; | ||
| 214 | 207 | ||
| 215 | 208 | // Smite_Timer | |
| 216 | - if (m_uiSmite_Timer < uiDiff) | ||
| 209 | + if (m_uiSmiteTimer < uiDiff) | ||
| 217 | 210 | { | |
| 218 | - DoCastSpellIfCan(m_creature->getVictim(), SPELL_SMITE); | ||
| 219 | - m_uiSmite_Timer = 10000; | ||
| 211 | + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_SMITE) == CAST_OK) | ||
| 212 | + m_uiSmiteTimer = 10000; | ||
| 220 | 213 | } | |
| 221 | 214 | else | |
| 222 | - m_uiSmite_Timer -= uiDiff; | ||
| 215 | + m_uiSmiteTimer -= uiDiff; | ||
| 223 | 216 | ||
| 224 | 217 | // Heal_Timer | |
| 225 | - if (m_uiHeal_Timer < uiDiff) | ||
| 218 | + if (m_uiHealTimer < uiDiff) | ||
| 226 | 219 | { | |
| 227 | 220 | if (Creature* pEmperor = m_pInstance->GetSingleCreatureFromStorage(NPC_EMPEROR)) | |
| 228 | 221 | { | |
| 229 | 222 | if (pEmperor->isAlive() && pEmperor->GetHealthPercent() != 100.0f) | |
| 230 | - DoCastSpellIfCan(pEmperor, SPELL_HEAL); | ||
| 223 | + { | ||
| 224 | + if (DoCastSpellIfCan(pEmperor, SPELL_HEAL) == CAST_OK) | ||
| 225 | + m_uiHealTimer = 10000; | ||
| 226 | + } | ||
| 231 | 227 | } | |
| 232 | - | ||
| 233 | - m_uiHeal_Timer = 10000; | ||
| 234 | 228 | } | |
| 235 | 229 | else | |
| 236 | - m_uiHeal_Timer -= uiDiff; | ||
| 230 | + m_uiHealTimer -= uiDiff; | ||
| 237 | 231 | ||
| 238 | 232 | // No meele? | |
| 239 | 233 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,8 +46,12 @@ void instance_blackrock_depths::OnCreatureCreate(Creature* pCreature) | |||
| 46 | 46 | { | |
| 47 | 47 | switch (pCreature->GetEntry()) | |
| 48 | 48 | { | |
| 49 | - case NPC_EMPEROR: | ||
| 50 | 49 | case NPC_PRINCESS: | |
| 50 | + // replace the princess if required | ||
| 51 | + if (CanReplacePrincess()) | ||
| 52 | + pCreature->UpdateEntry(NPC_PRIESTESS); | ||
| 53 | + // no break; | ||
| 54 | + case NPC_EMPEROR: | ||
| 51 | 55 | case NPC_PHALANX: | |
| 52 | 56 | case NPC_HATEREL: | |
| 53 | 57 | case NPC_ANGERREL: | |
@@ -400,6 +404,27 @@ void instance_blackrock_depths::DoCallNextDwarf() | |||
| 400 | 404 | ++m_uiDwarfRound; | |
| 401 | 405 | } | |
| 402 | 406 | ||
| 407 | + // function that replaces the princess if requirements are met | ||
| 408 | + bool instance_blackrock_depths::CanReplacePrincess() | ||
| 409 | + { | ||
| 410 | + Map::PlayerList const& players = instance->GetPlayers(); | ||
| 411 | + if (players.isEmpty()) | ||
| 412 | + return false; | ||
| 413 | + | ||
| 414 | + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) | ||
| 415 | + { | ||
| 416 | + if (Player* pPlayer = itr->getSource()) | ||
| 417 | + { | ||
| 418 | + // if at least one player didn't complete the quest, return false | ||
| 419 | + if ((pPlayer->GetTeam() == ALLIANCE && !pPlayer->GetQuestRewardStatus(QUEST_FATE_KINGDOM)) | ||
| 420 | + || (pPlayer->GetTeam() == HORDE && !pPlayer->GetQuestRewardStatus(QUEST_ROYAL_RESCUE))) | ||
| 421 | + return false; | ||
| 422 | + } | ||
| 423 | + } | ||
| 424 | + | ||
| 425 | + return true; | ||
| 426 | + } | ||
| 427 | + | ||
| 403 | 428 | void instance_blackrock_depths::Update(uint32 uiDiff) | |
| 404 | 429 | { | |
| 405 | 430 | if (m_uiDwarfFightTimer) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | 1 | #ifndef __SD2_REVISION_NR_H__ | |
| 2 | 2 | #define __SD2_REVISION_NR_H__ | |
| 3 | - #define SD2_REVISION_NR "s2839" | ||
| 3 | + #define SD2_REVISION_NR "s2840" | ||
| 4 | 4 | #endif // __SD2_REVISION_NR_H__ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments