Permalink
Browse files

[2029] Cleanup and improve Zul'Gurub Hakkar

Note that some spells need proper core support

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
  • Loading branch information...
1 parent 15d2007 commit 099b0d124becd7726afaaab188e840a02d175b8c @xfurry xfurry committed with Schmoozerd Apr 15, 2011
Showing with 154 additions and 157 deletions.
  1. +153 −156 scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp
  2. +1 −1 sd2_revision_nr.h
View
309 scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp
@@ -24,21 +24,24 @@ EndScriptData */
#include "precompiled.h"
#include "zulgurub.h"
-#define SAY_AGGRO -1309020
-#define SAY_FLEEING -1309021
-
-#define SPELL_BLOODSIPHON 24322
-#define SPELL_CORRUPTEDBLOOD 24328
-#define SPELL_CAUSEINSANITY 24327 //Not working disabled.
-#define SPELL_WILLOFHAKKAR 24178
-#define SPELL_ENRAGE 24318
-
-// The Aspects of all High Priests
-#define SPELL_ASPECT_OF_JEKLIK 24687
-#define SPELL_ASPECT_OF_VENOXIS 24688
-#define SPELL_ASPECT_OF_MARLI 24686
-#define SPELL_ASPECT_OF_THEKAL 24689
-#define SPELL_ASPECT_OF_ARLOKK 24690
+enum
+{
+ SAY_AGGRO = -1309020,
+ SAY_FLEEING = -1309021,
+
+ SPELL_BLOOD_SIPHON = 24324, // Related Spells 24322, 24323, 24324, likely starting spell is 24324 (disabled until proper fixed)
+ SPELL_CORRUPTED_BLOOD = 24328,
+ SPELL_CAUSE_INSANITY = 24327,
+ SPELL_WILL_OF_HAKKAR = 24178,
+ SPELL_ENRAGE = 24318,
+
+ // The Aspects of all High Priests
+ SPELL_ASPECT_OF_JEKLIK = 24687,
+ SPELL_ASPECT_OF_VENOXIS = 24688,
+ SPELL_ASPECT_OF_MARLI = 24686,
+ SPELL_ASPECT_OF_THEKAL = 24689,
+ SPELL_ASPECT_OF_ARLOKK = 24690
+};
struct MANGOS_DLL_DECL boss_hakkarAI : public ScriptedAI
{
@@ -50,185 +53,178 @@ struct MANGOS_DLL_DECL boss_hakkarAI : public ScriptedAI
ScriptedInstance* m_pInstance;
- uint32 BloodSiphon_Timer;
- uint32 CorruptedBlood_Timer;
- uint32 CauseInsanity_Timer;
- uint32 WillOfHakkar_Timer;
- uint32 Enrage_Timer;
-
- uint32 CheckJeklik_Timer;
- uint32 CheckVenoxis_Timer;
- uint32 CheckMarli_Timer;
- uint32 CheckThekal_Timer;
- uint32 CheckArlokk_Timer;
-
- uint32 AspectOfJeklik_Timer;
- uint32 AspectOfVenoxis_Timer;
- uint32 AspectOfMarli_Timer;
- uint32 AspectOfThekal_Timer;
- uint32 AspectOfArlokk_Timer;
+ uint32 m_uiBloodSiphonTimer;
+ uint32 m_uiCorruptedBloodTimer;
+ uint32 m_uiCauseInsanityTimer;
+ uint32 m_uiWillOfHakkarTimer;
+ uint32 m_uiEnrageTimer;
- bool Enraged;
+ uint32 m_uiAspectOfJeklikTimer;
+ uint32 m_uiAspectOfVenoxisTimer;
+ uint32 m_uiAspectOfMarliTimer;
+ uint32 m_uiAspectOfThekalTimer;
+ uint32 m_uiAspectOfArlokkTimer;
void Reset()
{
- BloodSiphon_Timer = 90000;
- CorruptedBlood_Timer = 25000;
- CauseInsanity_Timer = 17000;
- WillOfHakkar_Timer = 17000;
- Enrage_Timer = 600000;
-
- CheckJeklik_Timer = 1000;
- CheckVenoxis_Timer = 2000;
- CheckMarli_Timer = 3000;
- CheckThekal_Timer = 4000;
- CheckArlokk_Timer = 5000;
-
- AspectOfJeklik_Timer = 4000;
- AspectOfVenoxis_Timer = 7000;
- AspectOfMarli_Timer = 12000;
- AspectOfThekal_Timer = 8000;
- AspectOfArlokk_Timer = 18000;
-
- Enraged = false;
+ m_uiBloodSiphonTimer = 90000;
+ m_uiCorruptedBloodTimer = 25000;
+ m_uiCauseInsanityTimer = 17000;
+ m_uiWillOfHakkarTimer = 17000;
+ m_uiEnrageTimer = 10*MINUTE*IN_MILLISECONDS;
+
+ m_uiAspectOfJeklikTimer = 4000;
+ m_uiAspectOfVenoxisTimer = 7000;
+ m_uiAspectOfMarliTimer = 12000;
+ m_uiAspectOfThekalTimer = 8000;
+ m_uiAspectOfArlokkTimer = 18000;
}
void Aggro(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
+
+ // check if the priest encounters are done
+ if (m_pInstance)
+ {
+ if (m_pInstance->GetData(TYPE_JEKLIK) == DONE)
+ m_uiAspectOfJeklikTimer = 0;
+ if (m_pInstance->GetData(TYPE_VENOXIS) == DONE)
+ m_uiAspectOfVenoxisTimer = 0;
+ if (m_pInstance->GetData(TYPE_MARLI) == DONE)
+ m_uiAspectOfMarliTimer = 0;
+ if (m_pInstance->GetData(TYPE_THEKAL) == DONE)
+ m_uiAspectOfThekalTimer = 0;
+ if (m_pInstance->GetData(TYPE_ARLOKK) == DONE)
+ m_uiAspectOfArlokkTimer = 0;
+ }
}
- void UpdateAI(const uint32 diff)
+ void UpdateAI(const uint32 uiDiff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
- //BloodSiphon_Timer
- if (BloodSiphon_Timer < diff)
+ /* Disabled as needs core fix// Blood Siphon Timer
+ * This also will requre spells 24320 24321 to be implemented (and used by the "Son of Hakkar" npcs)
+ if (m_uiBloodSiphonTimer < uiDiff)
{
- DoCastSpellIfCan(m_creature->getVictim(),SPELL_BLOODSIPHON);
- BloodSiphon_Timer = 90000;
- }else BloodSiphon_Timer -= diff;
-
- //CorruptedBlood_Timer
- if (CorruptedBlood_Timer < diff)
+ if (DoCastSpellIfCan(m_creature, SPELL_BLOOD_SIPHON) == CAST_OK)
+ m_uiBloodSiphonTimer = 90000;
+ }
+ else
+ m_uiBloodSiphonTimer -= uiDiff; */
+
+ // Corrupted Blood Timer
+ if (m_uiCorruptedBloodTimer < uiDiff)
{
- DoCastSpellIfCan(m_creature->getVictim(),SPELL_CORRUPTEDBLOOD);
- CorruptedBlood_Timer = urand(30000, 45000);
- }else CorruptedBlood_Timer -= diff;
+ if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
+ {
+ if (DoCastSpellIfCan(pTarget, SPELL_CORRUPTED_BLOOD) == CAST_OK)
+ m_uiCorruptedBloodTimer = urand(30000, 45000);
+ }
+ }
+ else
+ m_uiCorruptedBloodTimer -= uiDiff;
- //CauseInsanity_Timer
- /*if (CauseInsanity_Timer < diff)
+ // Cause Insanity Timer
+ if (m_uiCauseInsanityTimer < uiDiff)
{
- if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
- DoCastSpellIfCan(target,SPELL_CAUSEINSANITY);
-
- CauseInsanity_Timer = urand(35000, 43000);
- }else CauseInsanity_Timer -= diff;*/
-
- //WillOfHakkar_Timer
- if (WillOfHakkar_Timer < diff)
+ if (m_creature->getThreatManager().getThreatList().size() > 1)
+ {
+ if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CAUSE_INSANITY) == CAST_OK)
+ m_uiCauseInsanityTimer = urand(10000, 15000);
+ }
+ else // Solo case, check again later
+ m_uiCauseInsanityTimer = urand(35000, 43000);
+ }
+ else
+ m_uiCauseInsanityTimer -= uiDiff;
+
+ // Will Of Hakkar Timer
+ if (m_uiWillOfHakkarTimer < uiDiff)
{
+ if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1))
+ {
+ if (DoCastSpellIfCan(pTarget, SPELL_WILL_OF_HAKKAR) == CAST_OK)
+ m_uiWillOfHakkarTimer = urand(25000, 35000);
+ }
+ else // solo attempt, try again later
+ m_uiWillOfHakkarTimer = 25000;
+ }
+ else
+ m_uiWillOfHakkarTimer -= uiDiff;
- if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
- DoCastSpellIfCan(target,SPELL_WILLOFHAKKAR);
-
- WillOfHakkar_Timer = urand(25000, 35000);
- }else WillOfHakkar_Timer -= diff;
-
- if (!Enraged && Enrage_Timer < diff)
+ if (m_uiEnrageTimer < uiDiff)
{
- DoCastSpellIfCan(m_creature, SPELL_ENRAGE);
- Enraged = true;
- }else Enrage_Timer -= diff;
-
- //Checking if Jeklik is dead. If not we cast her Aspect
- if (CheckJeklik_Timer < diff)
+ if (DoCastSpellIfCan(m_creature, SPELL_ENRAGE) == CAST_OK)
+ m_uiEnrageTimer = 10*MINUTE*IN_MILLISECONDS;
+ }
+ else
+ m_uiEnrageTimer -= uiDiff;
+
+ // Checking if Jeklik is dead. If not we cast her Aspect
+ if (m_uiAspectOfJeklikTimer)
{
- if (m_pInstance)
+ if (m_uiAspectOfJeklikTimer <= uiDiff)
{
- if (m_pInstance->GetData(TYPE_JEKLIK) != DONE)
- {
- if (AspectOfJeklik_Timer < diff)
- {
- DoCastSpellIfCan(m_creature->getVictim(),SPELL_ASPECT_OF_JEKLIK);
- AspectOfJeklik_Timer = urand(10000, 14000);
- }else AspectOfJeklik_Timer -= diff;
- }
+ if (DoCastSpellIfCan(m_creature, SPELL_ASPECT_OF_JEKLIK) == CAST_OK)
+ m_uiAspectOfJeklikTimer = urand(10000, 14000);
}
- CheckJeklik_Timer = 1000;
- }else CheckJeklik_Timer -= diff;
+ else
+ m_uiAspectOfJeklikTimer -= uiDiff;
+ }
- //Checking if Venoxis is dead. If not we cast his Aspect
- if (CheckVenoxis_Timer < diff)
+ // Checking if Venoxis is dead. If not we cast his Aspect
+ if (m_uiAspectOfVenoxisTimer)
{
- if (m_pInstance)
+ if (m_uiAspectOfVenoxisTimer <= uiDiff)
{
- if (m_pInstance->GetData(TYPE_VENOXIS) != DONE)
- {
- if (AspectOfVenoxis_Timer < diff)
- {
- DoCastSpellIfCan(m_creature->getVictim(),SPELL_ASPECT_OF_VENOXIS);
- AspectOfVenoxis_Timer = 8000;
- }else AspectOfVenoxis_Timer -= diff;
- }
+ if (DoCastSpellIfCan(m_creature, SPELL_ASPECT_OF_VENOXIS) == CAST_OK)
+ m_uiAspectOfVenoxisTimer = 8000;
}
- CheckVenoxis_Timer = 1000;
- }else CheckVenoxis_Timer -= diff;
+ else
+ m_uiAspectOfVenoxisTimer -= uiDiff;
+ }
- //Checking if Marli is dead. If not we cast her Aspect
- if (CheckMarli_Timer < diff)
+ // Checking if Marli is dead. If not we cast her Aspect
+ if (m_uiAspectOfMarliTimer)
{
- if (m_pInstance)
+ if (m_uiAspectOfMarliTimer <= uiDiff)
{
- if (m_pInstance->GetData(TYPE_MARLI) != DONE)
- {
- if (AspectOfMarli_Timer < diff)
- {
- DoCastSpellIfCan(m_creature->getVictim(),SPELL_ASPECT_OF_MARLI);
- AspectOfMarli_Timer = 10000;
- }else AspectOfMarli_Timer -= diff;
-
- }
+ if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_ASPECT_OF_MARLI) == CAST_OK)
+ m_uiAspectOfMarliTimer = 10000;
}
- CheckMarli_Timer = 1000;
- }else CheckMarli_Timer -= diff;
+ else
+ m_uiAspectOfMarliTimer -= uiDiff;
+ }
- //Checking if Thekal is dead. If not we cast his Aspect
- if (CheckThekal_Timer < diff)
+ // Checking if Thekal is dead. If not we cast his Aspect
+ if (m_uiAspectOfThekalTimer)
{
- if (m_pInstance)
+ if (m_uiAspectOfThekalTimer <= uiDiff)
{
- if (m_pInstance->GetData(TYPE_THEKAL) != DONE)
- {
- if (AspectOfThekal_Timer < diff)
- {
- DoCastSpellIfCan(m_creature,SPELL_ASPECT_OF_THEKAL);
- AspectOfThekal_Timer = 15000;
- }else AspectOfThekal_Timer -= diff;
- }
+ if (DoCastSpellIfCan(m_creature, SPELL_ASPECT_OF_THEKAL) == CAST_OK)
+ m_uiAspectOfThekalTimer = 15000;
}
- CheckThekal_Timer = 1000;
- }else CheckThekal_Timer -= diff;
+ else
+ m_uiAspectOfThekalTimer -= uiDiff;
+ }
- //Checking if Arlokk is dead. If yes we cast her Aspect
- if (CheckArlokk_Timer < diff)
+ // Checking if Arlokk is dead. If yes we cast her Aspect
+ if (m_uiAspectOfArlokkTimer)
{
- if (m_pInstance)
+ if (m_uiAspectOfArlokkTimer <= uiDiff)
{
- if (m_pInstance->GetData(TYPE_ARLOKK) != DONE)
+ if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_ASPECT_OF_ARLOKK) == CAST_OK)
{
- if (AspectOfArlokk_Timer < diff)
- {
- DoCastSpellIfCan(m_creature,SPELL_ASPECT_OF_ARLOKK);
- DoResetThreat();
-
- AspectOfArlokk_Timer = urand(10000, 15000);
- }else AspectOfArlokk_Timer -= diff;
+ DoResetThreat();
+ m_uiAspectOfArlokkTimer = urand(10000, 15000);
}
}
- CheckArlokk_Timer = 1000;
- }else CheckArlokk_Timer -= diff;
+ else
+ m_uiAspectOfArlokkTimer -= uiDiff;
+ }
DoMeleeAttackIfReady();
}
@@ -241,9 +237,10 @@ CreatureAI* GetAI_boss_hakkar(Creature* pCreature)
void AddSC_boss_hakkar()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_hakkar";
- newscript->GetAI = &GetAI_boss_hakkar;
- newscript->RegisterSelf();
+ Script* pNewScript;
+
+ pNewScript = new Script;
+ pNewScript->Name = "boss_hakkar";
+ pNewScript->GetAI = &GetAI_boss_hakkar;
+ pNewScript->RegisterSelf();
}
View
2 sd2_revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_NR_H__
#define __SD2_REVISION_NR_H__
- #define SD2_REVISION_NR "2028"
+ #define SD2_REVISION_NR "2029"
#endif // __SD2_REVISION_NR_H__

0 comments on commit 099b0d1

Please sign in to comment.