aboutsummaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
authorBrian <runningnak3d@gmail.com>2010-02-14 19:13:14 -0700
committerBrian <runningnak3d@gmail.com>2010-02-14 19:13:14 -0700
commit486c00891ba34884e5b2cdd8d44b4d8496f11283 (patch)
tree7df304b9020ed21b87bd66978d2dc6e6683edce7 /src/scripts
parent7799ade4da0da17034039439d692122e976c0138 (diff)
* Core switch to client 3.3.2 (11403)
* Credits (in no particular order) to: * n0n4m3, raczman, manuel, Spp, Malcrom, Teacher, QAston, Tartalo, * thenecromancer, Xanadu, Trazom, Zor, kiper * Additional credits to: * TOM_RUS and NoFantasy from MaNGOS * Thanks for testing Aokromes and XTElite1 * SoTA still needs some work, but is very playable (huge thanks to raczman and * kiper) * To upgrade, you need to apply all SQL from sql/updates/3.2.2a_old from the * last rev you are on * and then apply all SQL from sql/updates/3.3.2_old to char / realmd / world * DBs * Known problem with guild banks. --HG-- branch : trunk
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp433
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp2
-rw-r--r--src/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp7
-rw-r--r--src/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp17
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp342
-rw-r--r--src/scripts/outland/boss_doomlord_kazzak.cpp24
-rw-r--r--src/scripts/outland/boss_doomwalker.cpp18
7 files changed, 624 insertions, 219 deletions
diff --git a/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp b/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp
index b2d83a76ae2..23cb8f3289e 100644
--- a/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp
+++ b/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp
@@ -17,276 +17,344 @@
/* ScriptData
SDName: Boss_Onyxia
SD%Complete: 90
-SDComment: Spell Heated Ground is wrong, flying animation, visual for area effect
+SDComment: Phase 3 need additianal code. Phase 2 requires entries in spell_target_position with specific locations. See bottom of file.
SDCategory: Onyxia's Lair
EndScriptData */
#include "ScriptedPch.h"
-#define SAY_AGGRO -1249000
-#define SAY_KILL -1249001
-#define SAY_PHASE_2_TRANS -1249002
-#define SAY_PHASE_3_TRANS -1249003
-#define EMOTE_BREATH -1249004
-
-#define SPELL_WINGBUFFET 18500
-#define SPELL_FLAMEBREATH 18435
-#define SPELL_CLEAVE 19983
-#define SPELL_TAILSWEEP 15847
-#define SPELL_KNOCK_AWAY 19633
-
-#define SPELL_ENGULFINGFLAMES 20019
-#define SPELL_DEEPBREATH 23461
-#define SPELL_FIREBALL 18392
-
-#define SPELL_BELLOWINGROAR 18431
-#define SPELL_HEATED_GROUND 22191 //Wrong Spell
-
-#define SPELL_SUMMONWHELP 17646
+enum
+{
+ SAY_AGGRO = -1249000,
+ SAY_KILL = -1249001,
+ SAY_PHASE_2_TRANS = -1249002,
+ SAY_PHASE_3_TRANS = -1249003,
+ EMOTE_BREATH = -1249004,
+
+ SPELL_WINGBUFFET = 18500,
+ SPELL_FLAMEBREATH = 18435,
+ SPELL_CLEAVE = 19983,
+ SPELL_TAILSWEEP = 15847,
+ SPELL_KNOCK_AWAY = 19633,
+
+ SPELL_ENGULFINGFLAMES = 20019,
+ SPELL_DEEPBREATH = 23461,
+ SPELL_FIREBALL = 18392,
+
+ //Not much choise about these. We have to make own defintion on the direction/start-end point
+ //SPELL_BREATH_NORTH_TO_SOUTH = 17086, // 20x in "array"
+ //SPELL_BREATH_SOUTH_TO_NORTH = 18351, // 11x in "array"
+
+ SPELL_BREATH_EAST_TO_WEST = 18576, // 7x in "array"
+ SPELL_BREATH_WEST_TO_EAST = 18609, // 7x in "array"
+
+ SPELL_BREATH_SE_TO_NW = 18564, // 12x in "array"
+ SPELL_BREATH_NW_TO_SE = 18584, // 12x in "array"
+ SPELL_BREATH_SW_TO_NE = 18596, // 12x in "array"
+ SPELL_BREATH_NE_TO_SW = 18617, // 12x in "array"
+
+ //SPELL_BREATH = 21131, // 8x in "array", different initial cast than the other arrays
+
+ SPELL_BELLOWINGROAR = 18431,
+ SPELL_HEATED_GROUND = 22191,
+
+ SPELL_SUMMONWHELP = 17646,
+ NPC_WHELP = 11262,
+ MAX_WHELP = 16,
+
+ PHASE_START = 1,
+ PHASE_BREATH = 2,
+ PHASE_END = 3
+};
-#define CREATURE_WHELP 11262
+struct sOnyxMove
+{
+ uint32 uiLocId;
+ uint32 uiLocIdEnd;
+ uint32 uiSpellId;
+ float fX, fY, fZ;
+};
-static float MovementLocations[4][3]=
+static sOnyxMove aMoveData[]=
{
- {-64.0523, -213.0619, -68.2985},
- {12.4636, -220.01490, -68.0548},
- {-38.8391, -182.3220, -68.9457},
- {-37.0390, -244.8760, -68.1278}
+ {0, 1, SPELL_BREATH_WEST_TO_EAST, -33.5561f, -182.682f, -60.9457f},//west
+ {1, 0, SPELL_BREATH_EAST_TO_WEST, -31.4963f, -250.123f, -60.1278f},//east
+ {2, 4, SPELL_BREATH_NW_TO_SE, 6.8951f, -180.246f, -60.896f},//north-west
+ {3, 5, SPELL_BREATH_NE_TO_SW, 10.2191f, -247.912f, -60.896f},//north-east
+ {4, 2, SPELL_BREATH_SE_TO_NW, -63.5156f, -240.096f, -60.477f},//south-east
+ {5, 3, SPELL_BREATH_SW_TO_NE, -58.2509f, -189.020f, -60.790f},//south-west
+ //{6, 7, SPELL_BREATH_SOUTH_TO_NORTH, -65.8444f, -213.809f, -60.2985f},//south
+ //{7, 6, SPELL_BREATH_NORTH_TO_SOUTH, 22.8763f, -217.152f, -60.0548f},//north
};
-static float SpawnLocations[4][3]=
+static float afSpawnLocations[2][3]=
{
{-30.127, -254.463, -89.440},
- {-30.817, -177.106, -89.258},
- {14.480, -241.560, -85.6300},
- {17.372, -190.840, -85.2810},
+ {-30.817, -177.106, -89.258}
};
struct boss_onyxiaAI : public ScriptedAI
{
- boss_onyxiaAI(Creature* c) : ScriptedAI(c) {}
+ boss_onyxiaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();}
+
+ uint32 m_uiPhase;
- uint32 Phase;
+ uint32 m_uiFlameBreathTimer;
+ uint32 m_uiCleaveTimer;
+ uint32 m_uiTailSweepTimer;
+ uint32 m_uiWingBuffetTimer;
- uint32 FlameBreathTimer;
- uint32 CleaveTimer;
- uint32 TailSweepTimer;
- uint32 MovementTimer;
- uint32 EngulfingFlamesTimer;
- uint32 SummonWhelpsTimer;
- uint32 BellowingRoarTimer;
- uint32 WingBuffetTimer;
- uint32 KnockAwayTimer;
- uint32 FireballTimer;
+ uint32 m_uiMovePoint;
+ uint32 m_uiMovementTimer;
+ sOnyxMove* m_pPointData;
- bool InitialSpawn;
+ uint32 m_uiEngulfingFlamesTimer;
+ uint32 m_uiSummonWhelpsTimer;
+ uint32 m_uiBellowingRoarTimer;
+ uint32 m_uiWhelpTimer;
+
+ uint8 m_uiSummonCount;
+ bool m_bIsSummoningWhelps;
void Reset()
{
- Phase = 1;
-
- FlameBreathTimer = 20000;
- TailSweepTimer = 2000;
- CleaveTimer = 15000;
- MovementTimer = 3000;
- EngulfingFlamesTimer = 15000;
- SummonWhelpsTimer = 45000;
- BellowingRoarTimer = 30000;
- WingBuffetTimer = 17000;
- KnockAwayTimer = 15000;
- FireballTimer = 18000;
-
- InitialSpawn = true;
+ if (!IsCombatMovement())
+ SetCombatMovement(true);
+
+ m_uiPhase = PHASE_START;
+
+ m_uiFlameBreathTimer = urand(10000, 20000);
+ m_uiTailSweepTimer = urand(15000, 20000);
+ m_uiCleaveTimer = urand(2000, 5000);
+ m_uiWingBuffetTimer = urand(10000, 20000);
+
+ m_uiMovePoint = urand(0, 5);
+ m_uiMovementTimer = 20000;
+ m_pPointData = GetMoveData();
+
+ m_uiEngulfingFlamesTimer = 15000;
+ m_uiSummonWhelpsTimer = 45000;
+ m_uiBellowingRoarTimer = 30000;
+ m_uiWhelpTimer = 1000;
+
+ m_uiSummonCount = 0;
+ m_bIsSummoningWhelps = false;
}
- void EnterCombat(Unit* who)
+ void Aggro(Unit* pWho)
{
DoScriptText(SAY_AGGRO, m_creature);
- DoZoneInCombat();
+ m_creature->SetInCombatWithZone();
}
- void JustDied(Unit* Killer)
+ void JustSummoned(Creature *pSummoned)
{
+ if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ pSummoned->AI()->AttackStart(pTarget);
+
+ ++m_uiSummonCount;
}
- void KilledUnit(Unit *victim)
+ void KilledUnit(Unit* pVictim)
{
DoScriptText(SAY_KILL, m_creature);
}
- void UpdateAI(const uint32 diff)
+ void SpellHit(Unit *pCaster, const SpellEntry* pSpell)
{
- if (!UpdateVictim())
- return;
-
- if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1))
+ if (pSpell->Id == SPELL_BREATH_EAST_TO_WEST ||
+ pSpell->Id == SPELL_BREATH_WEST_TO_EAST ||
+ pSpell->Id == SPELL_BREATH_SE_TO_NW ||
+ pSpell->Id == SPELL_BREATH_NW_TO_SE ||
+ pSpell->Id == SPELL_BREATH_SW_TO_NE ||
+ pSpell->Id == SPELL_BREATH_NE_TO_SW)
{
- Phase = 2;
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->SetHover(true);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- DoScriptText(SAY_PHASE_2_TRANS, m_creature);
+ if (m_pPointData)
+ {
+ m_creature->GetMap()->CreatureRelocation(m_creature, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ, 0.0f);
+ m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344);
+
+ }
}
+ }
- if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) && (Phase == 2))
+ sOnyxMove* GetMoveData()
+ {
+ uint32 uiMaxCount = sizeof(aMoveData)/sizeof(sOnyxMove);
+
+ for (uint32 i = 0; i < uiMaxCount; ++i)
{
- Phase = 3;
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->SetHover(false);
- m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344);
- DoStartMovement(m_creature->getVictim());
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- DoScriptText(SAY_PHASE_3_TRANS, m_creature);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ if (aMoveData[i].uiLocId == m_uiMovePoint)
+ return &aMoveData[i];
}
- if (Phase == 1 || Phase == 3)
+ return NULL;
+ }
+
+ void SetNextRandomPoint()
+ {
+ uint32 uiMaxCount = sizeof(aMoveData)/sizeof(sOnyxMove);
+
+ int iTemp = rand()%(uiMaxCount-1);
+
+ if (iTemp >= m_uiMovePoint)
+ ++iTemp;
+
+ m_uiMovePoint = iTemp;
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (m_uiPhase == PHASE_START || m_uiPhase == PHASE_END)
{
- if (FlameBreathTimer <= diff)
+ if (m_uiFlameBreathTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH);
- FlameBreathTimer = 15000;
- } else FlameBreathTimer -= diff;
+ m_uiFlameBreathTimer = urand(10000, 20000);
+ }
+ else
+ m_uiFlameBreathTimer -= uiDiff;
- if (TailSweepTimer <= diff)
+ if (m_uiTailSweepTimer <= uiDiff)
{
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if (pTarget && !m_creature->HasInArc(M_PI, pTarget))
- DoCast(pTarget, SPELL_TAILSWEEP);
-
- TailSweepTimer = 10000;
- } else TailSweepTimer -= diff;
+ DoCast(m_creature, SPELL_TAILSWEEP);
+ m_uiTailSweepTimer = urand(15000, 20000);
+ }
+ else
+ m_uiTailSweepTimer -= uiDiff;
- if (CleaveTimer <= diff)
+ if (m_uiCleaveTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
- CleaveTimer = 10000;
- } else CleaveTimer -= diff;
+ m_uiCleaveTimer = urand(2000, 5000);
+ }
+ else
+ m_uiCleaveTimer -= uiDiff;
- if (WingBuffetTimer <= diff)
+ if (m_uiWingBuffetTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
- WingBuffetTimer = 7000 + ((rand()%8)*1000);
- } else WingBuffetTimer -= diff;
+ m_uiWingBuffetTimer = urand(15000, 30000);
+ }
+ else
+ m_uiWingBuffetTimer -= uiDiff;
- if (KnockAwayTimer <= diff)
+ if (m_uiPhase == PHASE_END)
{
- if (rand() <= 30)
+ if (m_uiBellowingRoarTimer <= uiDiff)
{
- DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY);
+ DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR);
+ m_uiBellowingRoarTimer = 30000;
}
- KnockAwayTimer = 15000;
- } else KnockAwayTimer -= diff;
-
- if (Phase == 3)
+ else
+ m_uiBellowingRoarTimer -= uiDiff;
+ }
+ else
{
- if (BellowingRoarTimer <= diff)
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60)
{
- DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR);
+ m_uiPhase = PHASE_BREATH;
- BellowingRoarTimer = 30000;
- } else BellowingRoarTimer -= diff;
+ SetCombatMovement(false);
- if (SummonWhelpsTimer <= diff)
- {
- SummonWhelps(Phase);
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
- SummonWhelpsTimer = 45000;
- } else SummonWhelpsTimer -= diff;
+ DoScriptText(SAY_PHASE_2_TRANS, m_creature);
+
+ if (m_pPointData)
+ m_creature->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
+
+ SetNextRandomPoint();
+ return;
+ }
}
DoMeleeAttackIfReady();
}
-
- if (Phase == 2)
+ else
{
- if (InitialSpawn)
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
{
- InitialSpawn = false;
+ m_uiPhase = PHASE_END;
+ DoScriptText(SAY_PHASE_3_TRANS, m_creature);
- for (uint32 i = 0; i < 10; ++i)
- {
- uint32 random = rand()%4;
- Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
- if (Whelp)
- Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
- }
+ SetCombatMovement(true);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+
+ return;
}
- if (EngulfingFlamesTimer <= diff)
+ if (m_uiMovementTimer <= uiDiff)
{
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ENGULFINGFLAMES);
- m_creature->HandleEmoteCommand(ANIM_FLY);
+ m_pPointData = GetMoveData();
- EngulfingFlamesTimer = 10000;
- }
- else EngulfingFlamesTimer -= diff;
+ SetNextRandomPoint();
- if (FireballTimer <= diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL);
+ m_uiMovementTimer = 25000;
- FireballTimer = 18000;
- }
- else FireballTimer -= diff;
+ if (!m_pPointData)
+ return;
- if (MovementTimer <= diff)
- {
- if (rand()%100 < 30)
+ if (m_uiMovePoint == m_pPointData->uiLocIdEnd)
{
+ if (m_creature->IsNonMeleeSpellCasted(false))
+ m_creature->InterruptNonMeleeSpells(false);
+
DoScriptText(EMOTE_BREATH, m_creature);
- DoCast(m_creature->getVictim(), SPELL_DEEPBREATH);
+ DoCast(m_creature, m_pPointData->uiSpellId);
+ }
+ else
+ {
+ m_creature->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
}
- else ChangePosition();
-
- MovementTimer = 25000;
- } else MovementTimer -= diff;
-
- if (SummonWhelpsTimer <= diff)
- {
- SummonWhelps(Phase);
-
- SummonWhelpsTimer = 45000;
}
- else SummonWhelpsTimer -= diff;
- }
- }
+ else
+ m_uiMovementTimer -= uiDiff;
- void ChangePosition()
- {
- uint32 random = rand() % 4;
- if (random<4){
- m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);}
- }
-
- void SummonWhelps(uint32 Phase)
- {
- if (Phase == 2)
- {
- uint32 max = rand()%10;
- for (uint32 i = 0; i < max; ++i)
+ if (m_uiEngulfingFlamesTimer <= uiDiff)
{
- uint32 random = rand()%3;
- Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
- if (Whelp)
- Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
+ if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
+ {
+ if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ DoCast(pTarget, SPELL_FIREBALL);
+
+ m_uiEngulfingFlamesTimer = 8000;
+ }
}
- }
+ else
+ m_uiEngulfingFlamesTimer -= uiDiff; //engulfingflames is supposed to be activated by a fireball but haven't come by
- if (Phase == 3)
- {
- uint32 max = rand() % 10 +1;
- if (max < 5)
+ if (m_bIsSummoningWhelps)
{
- for (uint32 i = 0; i < max; ++i)
+ if (m_uiSummonCount < MAX_WHELP)
{
- uint32 random = rand()%4;
- Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
- if (Whelp)
- Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
+ if (m_uiWhelpTimer <= uiDiff)
+ {
+ m_creature->SummonCreature(NPC_WHELP, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
+ m_creature->SummonCreature(NPC_WHELP, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
+ m_uiWhelpTimer = 1000;
+ }
+ else
+ m_uiWhelpTimer -= uiDiff;
+ }
+ else
+ {
+ m_bIsSummoningWhelps = false;
+ m_uiSummonCount = 0;
+ m_uiSummonWhelpsTimer = 30000;
}
}
+ else
+ {
+ if (m_uiSummonWhelpsTimer <= uiDiff)
+ m_bIsSummoningWhelps = true;
+ else
+ m_uiSummonWhelpsTimer -= uiDiff;
+ }
}
}
};
@@ -304,4 +372,3 @@ void AddSC_boss_onyxia()
newscript->GetAI = &GetAI_boss_onyxiaAI;
newscript->RegisterSelf();
}
-
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp
index 7e64259efad..11980a94b68 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp
@@ -233,7 +233,7 @@ struct boss_skeramAI : public ScriptedAI
for (uint8 ico = 0; ico < TARGETICONCOUNT; ++ico)
{
//if (grp->m_targetIcons[ico] == m_creature->GetGUID()) -- private member :(
- pGrp->SetTargetIcon(ico, 0);
+ pGrp->SetTargetIcon(ico, 0, 0);
}
break;
diff --git a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp
index f39ea93a11e..4451a190bf9 100644
--- a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp
+++ b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp
@@ -66,6 +66,8 @@ struct boss_elder_nadoxAI : public ScriptedAI
uint32 swarmer_spawn_Timer;
uint32 guard_spawn_Timer;
uint32 enrage_Timer;
+
+ bool GuardSpawned;
ScriptedInstance *pInstance;
@@ -80,6 +82,7 @@ struct boss_elder_nadoxAI : public ScriptedAI
enrage_Timer = 5000;
DeadAhnkaharGuardian = false;
+ GuardSpawned = false;
if (pInstance)
pInstance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED);
@@ -156,11 +159,11 @@ struct boss_elder_nadoxAI : public ScriptedAI
swarmer_spawn_Timer = 10000;
} else swarmer_spawn_Timer -= diff;
- if (guard_spawn_Timer <= diff)
+ if (!GuardSpawned && guard_spawn_Timer <= diff)
{
m_creature->MonsterTextEmote(EMOTE_HATCHES,m_creature->GetGUID(),true);
DoCast(m_creature, SPELL_SUMMON_SWARM_GUARD);
- guard_spawn_Timer = 25000;
+ GuardSpawned = true;
} else guard_spawn_Timer -= diff;
if (enrage_Timer <= diff)
diff --git a/src/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp b/src/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp
index 20f3b275d72..75f62af171a 100644
--- a/src/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp
+++ b/src/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp
@@ -104,12 +104,7 @@ enum Quests
#define GOSSIP_ITEM_START "Brann, it would be our honor!"
#define GOSSIP_ITEM_PROGRESS "Let's move Brann, enough of the history lessons!"
-struct Locations
-{
- float x, y, z;
-};
-
-static Locations SpawnLocations[]=
+static Position SpawnLocations[]=
{
{946.992, 397.016, 208.374},
{960.748, 382.944, 208.374},
@@ -295,7 +290,6 @@ struct npc_brann_hosAI : public npc_escortAI
case 13:
DoScriptText(SAY_EVENT_INTRO_1, m_creature);
SetEscortPaused(true);
- SetRun(true);
JumpToNextStep(20000);
break;
case 17:
@@ -320,16 +314,16 @@ struct npc_brann_hosAI : public npc_escortAI
{
uint32 uiSpawnNumber = DUNGEON_MODE(2,3);
for (uint8 i = 0; i < uiSpawnNumber; ++i)
- m_creature->SummonCreature(CREATURE_DARK_RUNE_PROTECTOR, SpawnLocations[0].x, SpawnLocations[0].y, SpawnLocations[0].z, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
- m_creature->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0].x, SpawnLocations[0].y, SpawnLocations[0].z, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
+ m_creature->SummonCreature(CREATURE_DARK_RUNE_PROTECTOR, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
+ m_creature->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
break;
}
case 2:
for (uint8 i = 0; i < 2; ++i)
- m_creature->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[1].x, SpawnLocations[1].y, SpawnLocations[1].z, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
+ m_creature->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
break;
case 3:
- m_creature->SummonCreature(CREATURE_IRON_GOLEM_CUSTODIAN, SpawnLocations[1].x, SpawnLocations[1].y, SpawnLocations[1].z, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
+ m_creature->SummonCreature(CREATURE_IRON_GOLEM_CUSTODIAN, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
break;
}
}
@@ -370,6 +364,7 @@ struct npc_brann_hosAI : public npc_escortAI
}
bIsBattle = false;
DoScriptText(SAY_ESCORT_START, m_creature);
+ SetRun(true);
JumpToNextStep(0);
break;
case 3:
diff --git a/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp b/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp
index a9f1be65f2d..32b5190ccf4 100644
--- a/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp
+++ b/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008 - 2010 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,3 +18,343 @@
#include "ScriptedPch.h"
#include "ulduar.h"
+
+#define GAMEOBJECT_GIVE_OF_THE_OBSERVER 194821
+
+enum Spells
+{
+ SPELL_ASCEND = 64487,
+ SPELL_BERSERK = 47008,
+ SPELL_BIG_BANG = 64443,
+ H_SPELL_BIG_BANG = 64584,
+ SPELL_COSMIC_SMASH = 62301,
+ H_SPELL_COSMIC_SMASH = 64598,
+ SPELL_PHASE_PUNCH = 64412,
+ SPELL_QUANTUM_STRIKE = 64395,
+ H_SPELL_QUANTUM_STRIKE = 64592,
+ SPELL_BLACK_HOLE_EXPLOSION = 64122,
+ SPELL_ARCANE_BARAGE = 64599,
+ H_SPELL_ARCANE_BARAGE = 64607
+};
+
+enum Creatures
+{
+ CREATURE_COLLAPSING_STAR = 32955,
+ CREATURE_BLACK_HOLE = 32953,
+ CREATURE_LIVING_CONSTELLATION = 33052,
+ CREATURE_DARK_MATTER = 33089
+};
+
+#define NORDRASSIL_X 1614.288574
+#define NORDRASSIL_Y -320.713287
+#define NORDRASSIL_Z 417.321167
+#define NORDRASSIL_X 1614.276245
+#define NORDRASSIL_Y -287.016632
+#define NORDRASSIL_Z 417.321106
+#define NORDRASSIL_X 1650.428467
+#define NORDRASSIL_Y -292.331390
+#define NORDRASSIL_Z 417.321167
+#define NORDRASSIL_X 1649.501831
+#define NORDRASSIL_Y -324.609222
+#define NORDRASSIL_Z 417.322174
+
+enum Texts
+{
+ SAY_AGGRO = -1620000,
+ SAY_KILL_1 = -1620005,
+ SAY_KILL_2 = -1620006,
+ SAY_BIG_BANG_1 = -1620002,
+ SAY_BIG_BANG_2 = -1620003,
+ SAY_PHASE_2 = -1620003,
+ SAY_BLACK_HOLE = -1620004,
+ SAY_BERSERK = -1620007,
+ SAY_SUMMON_COLLAPSING_STAR = -1620008,
+ SAY_ENGADED_FOR_FIRTS_TIME = -1620001,
+ SAY_SUMMON1 = -1620010,
+ SAY_SUMMON2 = -1620011,
+ SAY_SUMMON3 = -1620012,
+ SAY_DEATH_1 = -1620013,
+ SAY_DEATH_2 = -1620014,
+ SAY_DEATH_3 = -1620015,
+ SAY_DEATH_4 = -1620009,
+ SAY_DEFEAT_1 = -1620016,
+ SAY_DEFEAT_2 = -1620017,
+ SAY_DEFEAT_3 = -1620018
+};
+
+struct boss_algalonAI : public ScriptedAI
+{
+ boss_algalonAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceData();
+ }
+
+ ScriptedInstance* pInstance;
+
+ std::list<uint64> m_lCollapsingStarGUIDList;
+
+ uint32 Phase;
+ uint32 Ascend_Timer;
+ uint32 Berserk_Timer;
+ uint32 BigBang_Timer;
+ uint32 CosmicSmash_Timer;
+ uint32 PhasePunch_Timer;
+ uint32 QuantumStrike_Timer;
+ uint32 CollapsingStar_Timer;
+ uint32 uiPhase_timer;
+ uint32 uiStep;
+
+ uint64 BlackHoleGUID;
+
+ bool Enrage;
+ bool m_bIsHeroicMode;
+ bool Summon;
+
+ void EnterCombat(Unit* who)
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetReactState(REACT_PASSIVE);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
+ }
+
+ void Reset()
+ {
+ Phase = 1;
+
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoScriptText(SAY_DEFEAT_1, me);
+ DoScriptText(SAY_DEFEAT_2, me);
+ DoScriptText(SAY_DEFEAT_3, me);
+ if (pInstance)
+ pInstance->SetData(TYPE_ALGALON, NOT_STARTED);
+
+ BlackHoleGUID = 0;
+
+ Ascend_Timer = 480000; //8 minutes
+ QuantumStrike_Timer = 4000 + rand()%10000;
+ Berserk_Timer = 360000; //6 minutes
+ CollapsingStar_Timer = urand(15000, 20000); //Spawns between 15 to 20 seconds
+ BigBang_Timer = 90000;
+ PhasePunch_Timer = 8000;
+ CosmicSmash_Timer = urand(30000, 60000);
+ }
+
+ void JumpToNextStep(uint32 uiTimer)
+ {
+ uiPhase_timer = uiTimer;
+ ++uiStep;
+ }
+
+ void Aggro(Unit* pWho)
+ {
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ me->SetInCombatWithZone();
+ if (pInstance)
+ pInstance->SetData(TYPE_ALGALON, IN_PROGRESS);
+ }
+
+ void DespawnCollapsingStar()
+ {
+ if (m_lCollapsingStarGUIDList.empty())
+ return;
+ for(std::list<uint64>::iterator itr = m_lCollapsingStarGUIDList.begin(); itr != m_lCollapsingStarGUIDList.end(); ++itr)
+ {
+ if (Creature* pTemp = (Creature*)Unit::GetUnit(*me, *itr))
+ {
+ if (pTemp->isAlive())
+ pTemp->ForcedDespawn();
+ }
+ }
+ m_lCollapsingStarGUIDList.clear();
+ }
+
+ void JustSummoned(Creature* pSummoned)
+ {
+ if (pSummoned->GetEntry() == CREATURE_COLLAPSING_STAR)
+ {
+ Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (me->getVictim())
+ pSummoned->AI()->AttackStart(pTarget ? pTarget : me->getVictim());
+ m_lCollapsingStarGUIDList.push_back(pSummoned->GetGUID());
+ }
+ }
+
+ void SummonCollapsingStar(Unit* target)
+ {
+ DoScriptText(SAY_SUMMON_COLLAPSING_STAR, me);
+ me->SummonCreature(CREATURE_COLLAPSING_STAR,target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN, 100000);
+ DoScriptText(SAY_BLACK_HOLE, me);
+ me->SummonCreature(CREATURE_BLACK_HOLE,target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN, 27000);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 20 && Phase == 1)
+ {
+ Phase = 2;
+ DoScriptText(SAY_PHASE_2, me);
+ }
+
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 2)
+ {
+ me->SummonGameObject(GAMEOBJECT_GIVE_OF_THE_OBSERVER, 1634.258667, -295.101166,417.321381,0,0,0,0,0,-10);
+
+ DoScriptText(SAY_DEATH_1, me);
+ DoScriptText(SAY_DEATH_2, me);
+ DoScriptText(SAY_DEATH_3, me);
+ DoScriptText(SAY_DEATH_4, me);
+
+ me->DisappearAndDie();
+
+ if (pInstance)
+ pInstance->SetData(TYPE_ALGALON, DONE);
+ }
+
+ if (Phase == 1)
+ {
+ if (!Summon)
+ {
+ if (uiPhase_timer <= diff)
+ {
+ switch(uiStep)
+ {
+ case 1: DoScriptText(SAY_SUMMON1, m_creature); break; JumpToNextStep(3000);
+ case 2: DoScriptText(SAY_SUMMON2, m_creature); break; JumpToNextStep(3000);
+ case 3: DoScriptText(SAY_SUMMON3, m_creature); break; JumpToNextStep(3000);
+ case 4: DoScriptText(SAY_ENGADED_FOR_FIRTS_TIME, m_creature); break; JumpToNextStep(3000);
+ case 5: DoScriptText(SAY_AGGRO, m_creature); break;
+ case 6: m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); break;
+ case 7: m_creature->SetReactState(REACT_AGGRESSIVE); break;
+ }
+ }else uiPhase_timer -= diff;
+ }
+
+ if(QuantumStrike_Timer <= diff)
+ {
+ DoCast(me->getVictim(), m_bIsHeroicMode ? H_SPELL_QUANTUM_STRIKE : SPELL_QUANTUM_STRIKE, true);
+
+ QuantumStrike_Timer = 4000 + rand()%10000;
+ }else QuantumStrike_Timer -= diff;
+
+ if(BigBang_Timer <= diff)
+ {
+ DoScriptText(RAND(SAY_BIG_BANG_1,SAY_BIG_BANG_2), me);
+ DoCast(me->getVictim(), m_bIsHeroicMode ? H_SPELL_BIG_BANG : SPELL_BIG_BANG, true);
+
+ BigBang_Timer = 90000;
+ }else BigBang_Timer -= diff;
+
+ if(Ascend_Timer <= diff)
+ {
+ DoCast(me->getVictim(),SPELL_ASCEND, true);
+
+ Ascend_Timer = 480000;
+ }else Ascend_Timer -= diff;
+
+ if(PhasePunch_Timer <= diff)
+ {
+ DoCast(me->getVictim(),SPELL_PHASE_PUNCH, true);
+
+ PhasePunch_Timer = 8000;
+ }else PhasePunch_Timer -= diff;
+
+ if(CosmicSmash_Timer <= diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), m_bIsHeroicMode ? H_SPELL_COSMIC_SMASH : SPELL_COSMIC_SMASH, true);
+
+ CosmicSmash_Timer = urand(30000, 60000);
+ }else CosmicSmash_Timer -= diff;
+
+ if(Berserk_Timer <= diff)
+ {
+ DoScriptText(SAY_BERSERK, me);
+ DoCast(me->getVictim(),SPELL_BERSERK, true);
+
+ Berserk_Timer = 360000;
+ }else Berserk_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+
+ EnterEvadeIfOutOfCombatArea(diff);
+ }
+
+ if (Phase == 2)
+ {
+ if (Enrage)
+ {
+ if (Ascend_Timer <= diff)
+ {
+ DoCast(me, SPELL_ASCEND);
+ DoScriptText(SAY_BERSERK, me);
+ Ascend_Timer = 360000 + rand()%5000;
+ Enrage = false;
+ } else Ascend_Timer -= diff;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+//Collapsing Star
+struct mob_collapsing_starAI : public ScriptedAI
+{
+ mob_collapsing_starAI(Creature *pCreature) : ScriptedAI(pCreature)
+ {
+ pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 BlackHoleExplosion_Timer;
+
+ void Reset()
+ {
+ BlackHoleExplosion_Timer = 0;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if(BlackHoleExplosion_Timer <= diff)
+ {
+ me->CastSpell(me, SPELL_BLACK_HOLE_EXPLOSION, false);
+ BlackHoleExplosion_Timer = 0;
+ }else BlackHoleExplosion_Timer -= diff;
+ }
+};
+
+CreatureAI* GetAI_boss_algalon(Creature* pCreature)
+{
+ return new boss_algalonAI(pCreature);
+}
+
+CreatureAI* GetAI_mob_collapsing_star(Creature* pCreature)
+{
+ return new mob_collapsing_starAI(pCreature);
+}
+
+void AddSC_boss_Algalon()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "boss_algalon";
+ newscript->GetAI = &GetAI_boss_algalon;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "mob_collapsing_star";
+ newscript->GetAI = &GetAI_mob_collapsing_star;
+ newscript->RegisterSelf();
+}
diff --git a/src/scripts/outland/boss_doomlord_kazzak.cpp b/src/scripts/outland/boss_doomlord_kazzak.cpp
index 7b7d22a395a..2d2339d2c26 100644
--- a/src/scripts/outland/boss_doomlord_kazzak.cpp
+++ b/src/scripts/outland/boss_doomlord_kazzak.cpp
@@ -23,18 +23,18 @@ EndScriptData */
#include "ScriptedPch.h"
-#define SAY_INTRO -1000375 //signed for 3465
-#define SAY_AGGRO1 -1000376 //signed for 3465
-#define SAY_AGGRO2 -1000377 //signed for 3465
-#define SAY_SURPREME1 -1000378 //signed for 3465
-#define SAY_SURPREME2 -1000379 //signed for 3465
-#define SAY_KILL1 -1000380 //signed for 3465
-#define SAY_KILL2 -1000381 //signed for 21027
-#define SAY_KILL3 -1000382 //signed for 21027
-#define SAY_DEATH -1000383 //signed for 21027
-#define EMOTE_FRENZY -1000384 //signed for 21027
-#define SAY_RAND1 -1000385 //signed for 21027
-#define SAY_RAND2 -1000386 //signed for 21027
+#define SAY_INTRO -1000147
+#define SAY_AGGRO1 -1000148
+#define SAY_AGGRO2 -1000149
+#define SAY_SURPREME1 -1000154
+#define SAY_SURPREME2 -1000149
+#define SAY_KILL1 -1000150
+#define SAY_KILL2 -1000151
+#define SAY_KILL3 -1000152
+#define SAY_DEATH -1000155
+#define EMOTE_FRENZY -1000151
+#define SAY_RAND1 -1000158
+#define SAY_RAND2 -1000157
#define SPELL_SHADOWVOLLEY 32963
#define SPELL_CLEAVE 31779
diff --git a/src/scripts/outland/boss_doomwalker.cpp b/src/scripts/outland/boss_doomwalker.cpp
index e0db99ec196..761f9e22289 100644
--- a/src/scripts/outland/boss_doomwalker.cpp
+++ b/src/scripts/outland/boss_doomwalker.cpp
@@ -23,15 +23,15 @@ EndScriptData */
#include "ScriptedPch.h"
-#define SAY_AGGRO -1000387 //signed for 21027
-#define SAY_EARTHQUAKE_1 -1000388 //signed for 21027
-#define SAY_EARTHQUAKE_2 -1000389 //signed for 21027
-#define SAY_OVERRUN_1 -1000390 //signed for 21027
-#define SAY_OVERRUN_2 -1000391 //signed for 5955
-#define SAY_SLAY_1 -1000392 //signed for 5955
-#define SAY_SLAY_2 -1000393 //signed for 5955
-#define SAY_SLAY_3 -1000394 //signed for 5955
-#define SAY_DEATH -1000395 //signed for 5955
+#define SAY_AGGRO -1000159
+#define SAY_EARTHQUAKE_1 -1000160
+#define SAY_EARTHQUAKE_2 -1000161
+#define SAY_OVERRUN_1 -1000162
+#define SAY_OVERRUN_2 -1000163
+#define SAY_SLAY_1 -1000164
+#define SAY_SLAY_2 -1000165
+#define SAY_SLAY_3 -1000166
+#define SAY_DEATH -1000167
#define SPELL_EARTHQUAKE 32686
#define SPELL_SUNDER_ARMOR 33661