Azjol Nerub, Azjol Nerub: Cleanup

--HG--
branch : trunk
This commit is contained in:
Tartalo
2010-03-24 00:13:00 +01:00
parent 29201cf687
commit c7f5d95a1d
5 changed files with 389 additions and 432 deletions
@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/> * Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -1,28 +1,20 @@
/* /*
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/> * Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/* ScriptData
SDName: boss_anubarak
SD%Complete: 90 %
SDComment: Says are not implemented.
SDCategory: Azjol Nerub
EndScriptData */
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "azjol_nerub.h" #include "azjol_nerub.h"
@@ -32,13 +24,10 @@ enum Spells
SPELL_CARRION_BEETLES = 53520, SPELL_CARRION_BEETLES = 53520,
SPELL_SUMMON_CARRION_BEETLES = 53521, SPELL_SUMMON_CARRION_BEETLES = 53521,
SPELL_LEECHING_SWARM = 53467, SPELL_LEECHING_SWARM = 53467,
SPELL_IMPALE = 53454, SPELL_IMPALE = 53454,
H_SPELL_IMPALE = 59446, H_SPELL_IMPALE = 59446,
SPELL_POUND = 53472, SPELL_POUND = 53472,
H_SPELL_POUND = 59433, H_SPELL_POUND = 59433,
SPELL_SUBMERGE = 53421, SPELL_SUBMERGE = 53421,
}; };
@@ -64,12 +53,11 @@ enum Yells
SAY_SUBMERGE_2 = -1601009, SAY_SUBMERGE_2 = -1601009,
SAY_DEATH = -1601004 SAY_DEATH = -1601004
}; };
#define SPAWNPOINT_Z 224.3
float SpawnPoint[2][2] = const Position SpawnPoint[2] =
{ {
{550.7, 282.8}, { 550.7, 282.8, 224.3 },
{551.1, 229.4}, { 551.1, 229.4, 224.3 },
}; };
struct boss_anub_arakAI : public ScriptedAI struct boss_anub_arakAI : public ScriptedAI
@@ -81,36 +69,35 @@ struct boss_anub_arakAI : public ScriptedAI
ScriptedInstance *pInstance; ScriptedInstance *pInstance;
bool Channeling; bool bChanneling;
bool HeroicMode; bool bGuardianSummoned;
bool Summoned_Guardian; bool bVenomancerSummoned;
bool Summoned_Venomancer; bool bDatterSummoned;
bool Summoned_Datter; uint8 uiPhase;
uint32 Phase; uint32 uiPhaseTimer;
uint32 Phase_Time;
uint32 SPELL_CARRION_BEETLES_Timer; uint32 uiCarrionBeetlesTimer;
uint32 SPELL_LEECHING_SWARM_Timer; uint32 uiLeechingSwarmTimer;
uint32 SPELL_IMPALE_Timer; uint32 uiImpaleTimer;
uint32 SPELL_POUND_Timer; uint32 uiPoundTimer;
uint32 SPELL_SUBMERGE_Timer; uint32 uiSubmergeTimer;
uint32 UNDERGROUND_Timer; uint32 uiUndergroundTimer;
uint32 VENOMANCER_Timer; uint32 uiVenomancerTimer;
uint32 DATTER_Timer; uint32 uiDatterTimer;
SummonList lSummons; SummonList lSummons;
void Reset() void Reset()
{ {
SPELL_CARRION_BEETLES_Timer = 8000; uiCarrionBeetlesTimer = 8*IN_MILISECONDS;
SPELL_LEECHING_SWARM_Timer = 20000; uiLeechingSwarmTimer = 20*IN_MILISECONDS;
SPELL_IMPALE_Timer = 9000; uiImpaleTimer = 9*IN_MILISECONDS;
SPELL_POUND_Timer = 15000; uiPoundTimer = 15*IN_MILISECONDS;
Phase = 0; uiPhase = 0;
Phase_Time = 0; uiPhaseTimer = 0;
Channeling = false; bChanneling = false;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveAura(SPELL_SUBMERGE); m_creature->RemoveAura(SPELL_SUBMERGE);
@@ -137,126 +124,125 @@ struct boss_anub_arakAI : public ScriptedAI
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (Channeling == true) if (bChanneling == true)
{ {
for (uint8 i = 0; i < 4; ++i) for (uint8 i = 0; i < 4; ++i)
DoCast(m_creature->getVictim(), SPELL_SUMMON_CARRION_BEETLES, true); DoCast(m_creature->getVictim(), SPELL_SUMMON_CARRION_BEETLES, true);
Channeling = false; bChanneling = false;
} }
if (Phase == 1) if (uiPhase == 1)
{ {
if (SPELL_IMPALE_Timer <= diff) if (uiImpaleTimer <= diff)
{ {
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_IMPALE,H_SPELL_IMPALE), true); m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_IMPALE,H_SPELL_IMPALE), true);
uiImpaleTimer = 9*IN_MILISECONDS;
} else uiImpaleTimer -= diff;
SPELL_IMPALE_Timer = 9000; if (!bGuardianSummoned)
} else SPELL_IMPALE_Timer -= diff;
if (!Summoned_Guardian)
{ {
for (uint8 i = 0; i < 2; ++i) for (uint8 i = 0; i < 2; ++i)
{ {
if (Creature *Guardian = m_creature->SummonCreature(CREATURE_GUARDIAN,SpawnPoint[i][0],SpawnPoint[i][1],SPAWNPOINT_Z,0,TEMPSUMMON_CORPSE_DESPAWN,0)) if (Creature *Guardian = m_creature->SummonCreature(CREATURE_GUARDIAN,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{ {
Guardian->AddThreat(m_creature->getVictim(), 0.0f); Guardian->AddThreat(m_creature->getVictim(), 0.0f);
DoZoneInCombat(Guardian); DoZoneInCombat(Guardian);
} }
} }
Summoned_Guardian = true; bGuardianSummoned = true;
} }
if(!Summoned_Venomancer) if(!bVenomancerSummoned)
{ {
if (VENOMANCER_Timer <= diff) if (uiVenomancerTimer <= diff)
{ {
if (Phase_Time > 1) if (uiPhaseTimer > 1)
{ {
for (uint8 i = 0; i < 2; ++i) for (uint8 i = 0; i < 2; ++i)
{ {
if (Creature *Venomancer = m_creature->SummonCreature(CREATURE_VENOMANCER,SpawnPoint[i][0],SpawnPoint[i][1],SPAWNPOINT_Z,0,TEMPSUMMON_CORPSE_DESPAWN,0)) if (Creature *Venomancer = m_creature->SummonCreature(CREATURE_VENOMANCER,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{ {
Venomancer->AddThreat(m_creature->getVictim(), 0.0f); Venomancer->AddThreat(m_creature->getVictim(), 0.0f);
DoZoneInCombat(Venomancer); DoZoneInCombat(Venomancer);
} }
} }
Summoned_Venomancer = true; bVenomancerSummoned = true;
} }
} else VENOMANCER_Timer -= diff; } else uiVenomancerTimer -= diff;
} }
if(!Summoned_Datter) if(!bDatterSummoned)
{ {
if (DATTER_Timer <= diff) if (uiDatterTimer <= diff)
{ {
if (Phase_Time > 2) if (uiPhaseTimer > 2)
{ {
for (uint8 i = 0; i < 2; ++i) for (uint8 i = 0; i < 2; ++i)
{ {
if (Creature *Datter = m_creature->SummonCreature(CREATURE_DATTER,SpawnPoint[i][0],SpawnPoint[i][1],SPAWNPOINT_Z,0,TEMPSUMMON_CORPSE_DESPAWN,0)) if (Creature *Datter = m_creature->SummonCreature(CREATURE_DATTER,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{ {
Datter->AddThreat(m_creature->getVictim(), 0.0f); Datter->AddThreat(m_creature->getVictim(), 0.0f);
DoZoneInCombat(Datter); DoZoneInCombat(Datter);
} }
} }
Summoned_Datter = true; bDatterSummoned = true;
} }
} else DATTER_Timer -= diff; } else uiDatterTimer -= diff;
} }
if (UNDERGROUND_Timer <= diff) if (uiUndergroundTimer <= diff)
{ {
m_creature->RemoveAura(SPELL_SUBMERGE); m_creature->RemoveAura(SPELL_SUBMERGE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
Phase = 0; uiPhase = 0;
} else UNDERGROUND_Timer -= diff; } else uiUndergroundTimer -= diff;
} }
if (Phase == 0) if (uiPhase == 0)
{ {
if (SPELL_LEECHING_SWARM_Timer <= diff) if (uiLeechingSwarmTimer <= diff)
{ {
DoCast(m_creature, SPELL_LEECHING_SWARM, true); DoCast(m_creature, SPELL_LEECHING_SWARM, true);
SPELL_LEECHING_SWARM_Timer = 19000; uiLeechingSwarmTimer = 19*IN_MILISECONDS;
} else SPELL_LEECHING_SWARM_Timer -= diff; } else uiLeechingSwarmTimer -= diff;
if (SPELL_CARRION_BEETLES_Timer <= diff) if (uiCarrionBeetlesTimer <= diff)
{ {
Channeling = true; bChanneling = true;
DoCastVictim(SPELL_CARRION_BEETLES); DoCastVictim(SPELL_CARRION_BEETLES);
SPELL_CARRION_BEETLES_Timer = 25000; uiCarrionBeetlesTimer = 25*IN_MILISECONDS;
} else SPELL_CARRION_BEETLES_Timer -= diff; } else uiCarrionBeetlesTimer -= diff;
if (SPELL_POUND_Timer <= diff) if (uiPoundTimer <= diff)
{ {
DoCastVictim(DUNGEON_MODE(SPELL_POUND, H_SPELL_POUND)); DoCastVictim(DUNGEON_MODE(SPELL_POUND, H_SPELL_POUND));
SPELL_POUND_Timer = 16500; uiPoundTimer = 16.5*IN_MILISECONDS;
} else SPELL_POUND_Timer -= diff; } else uiPoundTimer -= diff;
} }
if ((Phase_Time == 0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 75) if ((uiPhaseTimer == 0 && HealthBelowPct(75))
|| (Phase_Time == 1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50) || (uiPhaseTimer == 1 && HealthBelowPct(50))
|| (Phase_Time == 2 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25)) || (uiPhaseTimer == 2 && HealthBelowPct(25)))
{ {
++Phase_Time; ++uiPhaseTimer;
Summoned_Guardian = false; bGuardianSummoned = false;
Summoned_Venomancer = false; bVenomancerSummoned = false;
Summoned_Datter = false; bDatterSummoned = false;
UNDERGROUND_Timer = 40000; uiUndergroundTimer = 40*IN_MILISECONDS;
VENOMANCER_Timer = 25000; uiVenomancerTimer = 25*IN_MILISECONDS;
DATTER_Timer = 32000; uiDatterTimer = 32*IN_MILISECONDS;
DoCast(m_creature, SPELL_SUBMERGE, false); DoCast(m_creature, SPELL_SUBMERGE, false);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
Phase = 1; uiPhase = 1;
} }
if (Phase != 1) if (uiPhase != 1)
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/> * Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -16,89 +16,83 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/* Script Data Start /*
SDName: Boss hadronox * Comment: No Waves atm and the doors spells are crazy...
SDAuthor: WarHead *
SD%Complete: 50 * When your group enters the main room (the one after the bridge), you will notice a group of 3 Nerubians.
SDComment: No Waves atm and the doors spells are crazy... * When you engage them, 2 more groups like this one spawn behind the first one - it is important to pull the first group back,
SDCategory: * so you don't aggro all 3. Hadronox will be under you, fighting Nerubians.
Script Data End */ *
* This is the timed gauntlet - waves of non-elite spiders
//Phase 0 => Gauntlet Event described below * will spawn from the 3 doors located a little above the main room, and will then head down to fight Hadronox. After clearing the
//Phase 1 => Boss Encounter * main room, it is recommended to just stay in it, kill the occasional non-elites that will attack you instead of the boss, and wait for
* Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.
/*When your group enters the main room (the one after the bridge), you will notice a group of 3 Nerubians. */
When you engage them, 2 more groups like this one spawn behind the first one - it is important to pull the first group back,
so you don't aggro all 3. Hadronox will be under you, fighting Nerubians.
This is the timed gauntlet - waves of non-elite spiders
will spawn from the 3 doors located a little above the main room, and will then head down to fight Hadronox. After clearing the
main room, it is recommended to just stay in it, kill the occasional non-elites that will attack you instead of the boss, and wait for
Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.*/
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "azjol_nerub.h" #include "azjol_nerub.h"
#define SPELL_ACID_CLOUD 53400 // Victim enum Spells
#define SPELL_LEECH_POISON 53030 // Victim {
#define SPELL_PIERCE_ARMOR 53418 // Victim SPELL_ACID_CLOUD = 53400, // Victim
#define SPELL_WEB_GRAB 57731 // Victim SPELL_LEECH_POISON = 53030, // Victim
#define SPELL_WEB_FRONT_DOORS 53177 // Self SPELL_PIERCE_ARMOR = 53418, // Victim
#define SPELL_WEB_SIDE_DOORS 53185 // Self SPELL_WEB_GRAB = 57731, // Victim
SPELL_WEB_FRONT_DOORS = 53177, // Self
#define SPELL_ACID_CLOUD_H 59419 SPELL_WEB_SIDE_DOORS = 53185, // Self
#define SPELL_LEECH_POISON_H 59417 H_SPELL_ACID_CLOUD = 59419,
#define SPELL_WEB_GRAB_H 59421 H_SPELL_LEECH_POISON = 59417,
H_SPELL_WEB_GRAB = 59421
};
struct boss_hadronoxAI : public ScriptedAI struct boss_hadronoxAI : public ScriptedAI
{ {
boss_hadronoxAI(Creature* c) : ScriptedAI(c) boss_hadronoxAI(Creature* c) : ScriptedAI(c)
{ {
pInstance = c->GetInstanceData(); pInstance = c->GetInstanceData();
MaxDistance = 50.0f; fMaxDistance = 50.0f;
FirstTime = true; bFirstTime = true;
} }
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
uint32 acidtimer, uint32 uiAcidTimer;
leechtimer, uint32 uiLeechTimer;
piercetimer, uint32 uiPierceTimer;
grabtimer, uint32 uiGrabTimer;
doorstimer, uint32 uiDoorsTimer;
CheckDistanceTimer; uint32 uiCheckDistanceTimer;
bool FirstTime; bool bFirstTime;
float MaxDistance; float fMaxDistance;
void Reset() void Reset()
{ {
m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 9.0f); m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 9.0f);
m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 9.0f); m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 9.0f);
acidtimer = urand(10000,14000); uiAcidTimer = urand(10*IN_MILISECONDS,14*IN_MILISECONDS);
leechtimer = urand(3000,9000); uiLeechTimer = urand(3*IN_MILISECONDS,9*IN_MILISECONDS);
piercetimer = urand(1000,3000); uiPierceTimer = urand(1*IN_MILISECONDS,3*IN_MILISECONDS);
grabtimer = urand(15000,19000); uiGrabTimer = urand(15*IN_MILISECONDS,19*IN_MILISECONDS);
doorstimer = urand(20000,30000); uiDoorsTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS);
uiCheckDistanceTimer = 2*IN_MILISECONDS;
CheckDistanceTimer = 2000; if (pInstance && (pInstance->GetData(DATA_HADRONOX_EVENT) != DONE && !bFirstTime))
if (pInstance && (pInstance->GetData(DATA_HADRONOX_EVENT) != DONE && !FirstTime))
pInstance->SetData(DATA_HADRONOX_EVENT, FAIL); pInstance->SetData(DATA_HADRONOX_EVENT, FAIL);
FirstTime = false; bFirstTime = false;
} }
//when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on //when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on
void KilledUnit(Unit* Victim) void KilledUnit(Unit* Victim)
{ {
// not sure if this aura check is correct, I think it is though // not sure if this aura check is correct, I think it is though
if (!Victim || !Victim->HasAura(DUNGEON_MODE(SPELL_LEECH_POISON, SPELL_LEECH_POISON_H)) || !m_creature->isAlive()) if (!Victim || !Victim->HasAura(DUNGEON_MODE(SPELL_LEECH_POISON, H_SPELL_LEECH_POISON)) || !m_creature->isAlive())
return; return;
uint32 health = (m_creature->GetMaxHealth()/100)*10; uint32 health = m_creature->GetMaxHealth()/10;
if ((m_creature->GetHealth()+health) >= m_creature->GetMaxHealth()) if ((m_creature->GetHealth()+health) >= m_creature->GetMaxHealth())
m_creature->SetHealth(m_creature->GetMaxHealth()); m_creature->SetHealth(m_creature->GetMaxHealth());
@@ -127,11 +121,11 @@ struct boss_hadronoxAI : public ScriptedAI
float x=0.0f, y=0.0f, z=0.0f; float x=0.0f, y=0.0f, z=0.0f;
m_creature->GetRespawnCoord(x,y,z); m_creature->GetRespawnCoord(x,y,z);
if (CheckDistanceTimer <= uiDiff) if (uiCheckDistanceTimer <= uiDiff)
CheckDistanceTimer = 5000; uiCheckDistanceTimer = 5*IN_MILISECONDS;
else else
{ {
CheckDistanceTimer -= uiDiff; uiCheckDistanceTimer -= uiDiff;
return; return;
} }
if (m_creature->IsInEvadeMode() || !m_creature->getVictim()) if (m_creature->IsInEvadeMode() || !m_creature->getVictim())
@@ -146,7 +140,7 @@ struct boss_hadronoxAI : public ScriptedAI
if (!UpdateVictim()) return; if (!UpdateVictim()) return;
// Without he comes up through the air to players on the bridge after krikthir if players crossing this bridge! // Without he comes up through the air to players on the bridge after krikthir if players crossing this bridge!
CheckDistance(MaxDistance, diff); CheckDistance(fMaxDistance, diff);
if (m_creature->HasAura(SPELL_WEB_FRONT_DOORS) || m_creature->HasAura(SPELL_WEB_SIDE_DOORS)) if (m_creature->HasAura(SPELL_WEB_FRONT_DOORS) || m_creature->HasAura(SPELL_WEB_SIDE_DOORS))
{ {
@@ -156,42 +150,41 @@ struct boss_hadronoxAI : public ScriptedAI
else if (!IsCombatMovement()) else if (!IsCombatMovement())
SetCombatMovement(true); SetCombatMovement(true);
if (piercetimer <= diff) if (uiPierceTimer <= diff)
{ {
DoCast(m_creature->getVictim(), SPELL_PIERCE_ARMOR); DoCast(m_creature->getVictim(), SPELL_PIERCE_ARMOR);
piercetimer = 8000; uiPierceTimer = 8*IN_MILISECONDS;
} else piercetimer -= diff; } else uiPierceTimer -= diff;
if (acidtimer <= diff) if (uiAcidTimer <= diff)
{ {
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, DUNGEON_MODE(SPELL_ACID_CLOUD, SPELL_ACID_CLOUD_H)); DoCast(pTarget, DUNGEON_MODE(SPELL_ACID_CLOUD, H_SPELL_ACID_CLOUD));
acidtimer = urand(20000,30000); uiAcidTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS);
} else acidtimer -= diff; } else uiAcidTimer -= diff;
if (leechtimer <= diff) if (uiLeechTimer <= diff)
{ {
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, DUNGEON_MODE(SPELL_LEECH_POISON, SPELL_LEECH_POISON_H)); DoCast(pTarget, DUNGEON_MODE(SPELL_LEECH_POISON, H_SPELL_LEECH_POISON));
leechtimer = urand(11000,14000); uiLeechTimer = urand(11*IN_MILISECONDS,14*IN_MILISECONDS);
} else leechtimer -= diff; } else uiLeechTimer -= diff;
if (grabtimer <= diff) if (uiGrabTimer <= diff)
{ {
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) // Draws all players (and attacking Mobs) to itself. if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) // Draws all players (and attacking Mobs) to itself.
DoCast(pTarget, DUNGEON_MODE(SPELL_WEB_GRAB, SPELL_WEB_GRAB_H)); DoCast(pTarget, DUNGEON_MODE(SPELL_WEB_GRAB, H_SPELL_WEB_GRAB));
grabtimer = urand(15000,30000); uiGrabTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS);
} else grabtimer -= diff; } else uiGrabTimer -= diff;
if (doorstimer <= diff) if (uiDoorsTimer <= diff)
{/* Debuff bleibt auf den Spielern bis zum Tod... {
DoCast(m_creature, RAND(SPELL_WEB_FRONT_DOORS, SPELL_WEB_SIDE_DOORS)); //DoCast(m_creature, RAND(SPELL_WEB_FRONT_DOORS, SPELL_WEB_SIDE_DOORS));
*/ uiDoorsTimer = urand(30*IN_MILISECONDS,60*IN_MILISECONDS);
doorstimer = urand(30000,60000); } else uiDoorsTimer -= diff;
} else doorstimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/> * Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -16,16 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/* ScriptData /*
SDName: boss_krikthir_the_gatewatcher * Comment: Find in the future best timers and the event is not implemented.
SD%Complete: 80 % */
SDComment: Find in the future best timers and the event is not implemented.
SDCategory: Azjol Nerub
EndScriptData */
/*** SQL START ***
update creature_template set scriptname = 'boss_krik_thir' where entry = '';
*** SQL END ***/
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "azjol_nerub.h" #include "azjol_nerub.h"
@@ -37,42 +30,33 @@ enum Spells
SPELL_CURSE_OF_FATIGUE = 52592, SPELL_CURSE_OF_FATIGUE = 52592,
H_SPELL_CURSE_OF_FATIGUE = 59368, H_SPELL_CURSE_OF_FATIGUE = 59368,
SPELL_FRENZY = 28747, //maybe 53361 SPELL_FRENZY = 28747, //maybe 53361
SPELL_SUMMON_SKITTERING_SWARMER = 52438, //AOE Effect 140, maybe 52439 SPELL_SUMMON_SKITTERING_SWARMER = 52438, //AOE Effect 140, maybe 52439
SPELL_SUMMON_SKITTERING_SWARMER_1 = 52439, //Summon 3x 28735 SPELL_SUMMON_SKITTERING_SWARMER_1 = 52439, //Summon 3x 28735
H_SPELL_ACID_SPLASH = 59363, H_SPELL_ACID_SPLASH = 59363,
SPELL_ACID_SPLASH = 52446, SPELL_ACID_SPLASH = 52446,
SPELL_CHARGE = 16979,//maybe is another spell SPELL_CHARGE = 16979,//maybe is another spell
SPELL_BACKSTAB = 52540, SPELL_BACKSTAB = 52540,
SPELL_SHADOW_BOLT = 52534, SPELL_SHADOW_BOLT = 52534,
H_SPELL_SHADOW_BOLT = 59357, H_SPELL_SHADOW_BOLT = 59357,
SPELL_SHADOW_NOVA = 52535, SPELL_SHADOW_NOVA = 52535,
H_SPELL_SHADOW_NOVA = 59358, H_SPELL_SHADOW_NOVA = 59358,
SPELL_STRIKE = 52532, SPELL_STRIKE = 52532,
SPELL_CLEAVE = 49806, SPELL_CLEAVE = 49806,
SPELL_ENRAGE = 52470, SPELL_ENRAGE = 52470,
SPELL_INFECTED_BITE = 52469, SPELL_INFECTED_BITE = 52469,
H_SPELL_INFECTED_BITE = 59364, H_SPELL_INFECTED_BITE = 59364,
SPELL_WEB_WRAP = 52086,//the spell is not working propperly SPELL_WEB_WRAP = 52086,//the spell is not working properly
SPELL_BLINDING_WEBS = 52524, SPELL_BLINDING_WEBS = 52524,
H_SPELL_BLINDING_WEBS = 59365, H_SPELL_BLINDING_WEBS = 59365,
SPELL_POSION_SPRAY = 52493, SPELL_POSION_SPRAY = 52493,
H_SPELL_POSION_SPRAY = 59366, H_SPELL_POSION_SPRAY = 59366
}; };
enum Mobs enum Mobs
{ {
MOB_SKITTERING_SWARMER = 28735, MOB_SKITTERING_SWARMER = 28735,
MOB_SKITTERING_SWARMER_CONTROLLER = 32593, MOB_SKITTERING_SWARMER_CONTROLLER = 32593,
MOB_SKITTERING_INFECTIOR = 28736, MOB_SKITTERING_INFECTIOR = 28736
}; };
enum Yells enum Yells
@@ -89,11 +73,24 @@ enum Yells
SAY_SWARM_2 = -1601008, SAY_SWARM_2 = -1601008,
SAY_PREFIGHT_1 = -1601009, SAY_PREFIGHT_1 = -1601009,
SAY_PREFIGHT_2 = -1601010, SAY_PREFIGHT_2 = -1601010,
SAY_PREFIGHT_3 = -1601011, SAY_PREFIGHT_3 = -1601011
}; };
enum Misc enum Misc
{ {
ACHIEVEMENT_WATCH_HIM_DIE = 1296 ACHIEV_WATH_HIM_DIE = 1296
};
const Position SpawnPoint[] =
{
{ 566.164, 682.087, 769.079, 2.21657 },
{ 529.042, 706.941, 777.298, 1.0821 },
{ 489.975, 671.239, 772.131, 0.261799 },
{ 488.556, 692.95, 771.764, 4.88692 },
{ 553.34, 640.387, 777.419, 1.20428 },
{ 517.486, 706.398, 777.335, 5.35816 },
{ 504.01, 637.693, 777.479, 0.506145 },
{ 552.625, 706.408, 777.177, 3.4383 }
}; };
struct boss_krik_thirAI : public ScriptedAI struct boss_krik_thirAI : public ScriptedAI
{ {
@@ -104,14 +101,14 @@ struct boss_krik_thirAI : public ScriptedAI
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
uint32 MindFlayTimer; uint32 uiMindFlayTimer;
uint32 CurseFatigueTimer; uint32 uiCurseFatigueTimer;
uint32 SummonTimer; uint32 uiSummonTimer;
void Reset() void Reset()
{ {
MindFlayTimer = 15000; uiMindFlayTimer = 15*IN_MILISECONDS;
CurseFatigueTimer = 12000; uiCurseFatigueTimer = 12*IN_MILISECONDS;
if (pInstance) if (pInstance)
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, NOT_STARTED); pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, NOT_STARTED);
@@ -121,7 +118,7 @@ struct boss_krik_thirAI : public ScriptedAI
{ {
DoScriptText(SAY_AGGRO, m_creature); DoScriptText(SAY_AGGRO, m_creature);
Summon(); Summon();
SummonTimer = 15000; uiSummonTimer = 15*IN_MILISECONDS;
if (pInstance) if (pInstance)
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS); pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS);
@@ -129,22 +126,22 @@ struct boss_krik_thirAI : public ScriptedAI
void Summon() void Summon()
{ {
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,566.164,682.087,769.079,2.21657,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,566.164,682.087,769.079,2.21657,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,529.042,706.941,777.298,1.0821,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,529.042,706.941,777.298,1.0821,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,489.975,671.239,772.131,0.261799,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,489.975,671.239,772.131,0.261799,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,488.556,692.95,771.764,4.88692,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,488.556,692.95,771.764,4.88692,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,553.34,640.387,777.419,1.20428,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,553.34,640.387,777.419,1.20428,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,517.486,706.398,777.335,5.35816,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,517.486,706.398,777.335,5.35816,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,504.01,637.693,777.479,0.506145,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,504.01,637.693,777.479,0.506145,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,552.625,706.408,777.177,3.4383,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,552.625,706.408,777.177,3.4383,TEMPSUMMON_TIMED_DESPAWN,25000); m_creature->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS);
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -152,19 +149,19 @@ struct boss_krik_thirAI : public ScriptedAI
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (SummonTimer <= diff) if (uiSummonTimer <= diff)
{ {
Summon(); Summon();
SummonTimer = 15000; uiSummonTimer = 15*IN_MILISECONDS;
} else SummonTimer -= diff; } else uiSummonTimer -= diff;
if (MindFlayTimer <= diff) if (uiMindFlayTimer <= diff)
{ {
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_MIND_FLAY, H_SPELL_MIND_FLAY)); DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_MIND_FLAY, H_SPELL_MIND_FLAY));
MindFlayTimer = 15000; uiMindFlayTimer = 15*IN_MILISECONDS;
} else MindFlayTimer -= diff; } else uiMindFlayTimer -= diff;
if (CurseFatigueTimer <= diff) if (uiCurseFatigueTimer <= diff)
{ {
//WowWiki say "Curse of Fatigue-Kirk'thir will cast Curse of Fatigue on 2-3 targets periodically." //WowWiki say "Curse of Fatigue-Kirk'thir will cast Curse of Fatigue on 2-3 targets periodically."
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
@@ -173,10 +170,10 @@ struct boss_krik_thirAI : public ScriptedAI
DoCast(pTarget, DUNGEON_MODE(SPELL_CURSE_OF_FATIGUE, H_SPELL_CURSE_OF_FATIGUE)); DoCast(pTarget, DUNGEON_MODE(SPELL_CURSE_OF_FATIGUE, H_SPELL_CURSE_OF_FATIGUE));
DoCast(pTarget_1, DUNGEON_MODE(SPELL_CURSE_OF_FATIGUE, H_SPELL_CURSE_OF_FATIGUE)); DoCast(pTarget_1, DUNGEON_MODE(SPELL_CURSE_OF_FATIGUE, H_SPELL_CURSE_OF_FATIGUE));
CurseFatigueTimer = 10000; uiCurseFatigueTimer = 10*IN_MILISECONDS;
} else CurseFatigueTimer -= diff; } else uiCurseFatigueTimer -= diff;
if (!m_creature->HasAura(SPELL_FRENZY) && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10) if (!m_creature->HasAura(SPELL_FRENZY) && HealthBelowPct(10))
DoCast(m_creature, SPELL_FRENZY, true); DoCast(m_creature, SPELL_FRENZY, true);
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
@@ -189,19 +186,12 @@ struct boss_krik_thirAI : public ScriptedAI
{ {
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DONE); pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DONE);
//Achievement: Watch him die //Achievement: Watch him die
AchievementEntry const *AchievWatchHimDie = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WATCH_HIM_DIE);
Map* pMap = m_creature->GetMap();
Creature *pAdd1, *pAdd2, *pAdd3; Creature *pAdd1, *pAdd2, *pAdd3;
if ((pAdd1 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_GASHRA))) && pAdd1->isAlive() && if ((pAdd1 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_GASHRA))) && pAdd1->isAlive() &&
(pAdd2 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_SILTHIK))) && pAdd2->isAlive() && (pAdd2 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_SILTHIK))) && pAdd2->isAlive() &&
(pAdd3 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_NARJIL))) && pAdd3->isAlive() && (pAdd3 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_NARJIL))) && pAdd3->isAlive() &&
IsHeroic() && pMap && pMap->IsDungeon() && AchievWatchHimDie) IsHeroic())
{ pInstance->DoCompleteAchievement(ACHIEV_WATH_HIM_DIE);
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (itr->getSource())
itr->getSource()->CompletedAchievement(AchievWatchHimDie);
}
} }
} }
void KilledUnit(Unit *victim) void KilledUnit(Unit *victim)
@@ -214,7 +204,7 @@ struct boss_krik_thirAI : public ScriptedAI
void JustSummoned(Creature* summoned) void JustSummoned(Creature* summoned)
{ {
summoned->GetMotionMaster()->MovePoint(m_creature->GetEntry(),m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ()); summoned->GetMotionMaster()->MovePoint(0,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
} }
}; };
@@ -234,13 +224,13 @@ struct npc_anub_ar_skirmisherAI : public ScriptedAI
{ {
npc_anub_ar_skirmisherAI(Creature *c) : ScriptedAI(c) {} npc_anub_ar_skirmisherAI(Creature *c) : ScriptedAI(c) {}
uint32 ChargeTimer; uint32 uiChargeTimer;
uint32 BackstabTimer; uint32 uiBackstabTimer;
void Reset() void Reset()
{ {
ChargeTimer = 11000; uiChargeTimer = 11*IN_MILISECONDS;
BackstabTimer = 7000; uiBackstabTimer = 7*IN_MILISECONDS;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -248,7 +238,7 @@ struct npc_anub_ar_skirmisherAI : public ScriptedAI
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (ChargeTimer <= diff) if (uiChargeTimer <= diff)
{ {
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{ {
@@ -256,15 +246,14 @@ struct npc_anub_ar_skirmisherAI : public ScriptedAI
m_creature->AddThreat(pTarget,1.0f); m_creature->AddThreat(pTarget,1.0f);
DoCast(pTarget, SPELL_CHARGE, true); DoCast(pTarget, SPELL_CHARGE, true);
} }
uiChargeTimer = 15*IN_MILISECONDS;
} else uiChargeTimer -= diff;
ChargeTimer = 15000; if (uiBackstabTimer <= diff)
} else ChargeTimer -= diff;
if (BackstabTimer <= diff)
{ {
DoCast(m_creature->getVictim(), SPELL_BACKSTAB); DoCast(m_creature->getVictim(), SPELL_BACKSTAB);
BackstabTimer = 12000; uiBackstabTimer = 12*IN_MILISECONDS;
} else BackstabTimer -= diff; } else uiBackstabTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
@@ -275,13 +264,13 @@ struct npc_anub_ar_shadowcasterAI : public ScriptedAI
{ {
npc_anub_ar_shadowcasterAI(Creature *c) : ScriptedAI(c) {} npc_anub_ar_shadowcasterAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowBoltTimer; uint32 uiShadowBoltTimer;
uint32 ShadowNovaTimer; uint32 uiShadowNovaTimer;
void Reset() void Reset()
{ {
ShadowBoltTimer = 6000; uiShadowBoltTimer = 6*IN_MILISECONDS;
ShadowNovaTimer = 15000; uiShadowNovaTimer = 15*IN_MILISECONDS;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -289,18 +278,18 @@ struct npc_anub_ar_shadowcasterAI : public ScriptedAI
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (ShadowBoltTimer <= diff) if (uiShadowBoltTimer <= diff)
{ {
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, DUNGEON_MODE(SPELL_SHADOW_BOLT, H_SPELL_SHADOW_BOLT), true); DoCast(pTarget, DUNGEON_MODE(SPELL_SHADOW_BOLT, H_SPELL_SHADOW_BOLT), true);
ShadowBoltTimer = 15000; uiShadowBoltTimer = 15*IN_MILISECONDS;
} else ShadowBoltTimer -= diff; } else uiShadowBoltTimer -= diff;
if (ShadowNovaTimer <= diff) if (uiShadowNovaTimer <= diff)
{ {
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SHADOW_NOVA, H_SPELL_SHADOW_NOVA), true); DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SHADOW_NOVA, H_SPELL_SHADOW_NOVA), true);
ShadowNovaTimer = 17000; uiShadowNovaTimer = 17*IN_MILISECONDS;
} else ShadowNovaTimer -= diff; } else uiShadowNovaTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -310,13 +299,13 @@ struct npc_anub_ar_warriorAI : public ScriptedAI
{ {
npc_anub_ar_warriorAI(Creature *c) : ScriptedAI(c){} npc_anub_ar_warriorAI(Creature *c) : ScriptedAI(c){}
uint32 CleaveTimer; uint32 uiCleaveTimer;
uint32 StrikeTimer; uint32 uiStrikeTimer;
void Reset() void Reset()
{ {
CleaveTimer = 11000; uiCleaveTimer = 11*IN_MILISECONDS;
StrikeTimer = 6000; uiStrikeTimer = 6*IN_MILISECONDS;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -324,17 +313,17 @@ struct npc_anub_ar_warriorAI : public ScriptedAI
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (StrikeTimer <= diff) if (uiStrikeTimer <= diff)
{ {
DoCast(m_creature->getVictim(), SPELL_STRIKE, true); DoCast(m_creature->getVictim(), SPELL_STRIKE, true);
StrikeTimer = 15000; uiStrikeTimer = 15*IN_MILISECONDS;
} else StrikeTimer -= diff; } else uiStrikeTimer -= diff;
if (CleaveTimer <= diff) if (uiCleaveTimer <= diff)
{ {
DoCast(m_creature->getVictim(), SPELL_CLEAVE, true); DoCast(m_creature->getVictim(), SPELL_CLEAVE, true);
CleaveTimer = 17000; uiCleaveTimer = 17*IN_MILISECONDS;
} else CleaveTimer -= diff; } else uiCleaveTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
@@ -346,13 +335,13 @@ struct npc_watcher_gashraAI : public ScriptedAI
{ {
npc_watcher_gashraAI(Creature *c) : ScriptedAI(c) {} npc_watcher_gashraAI(Creature *c) : ScriptedAI(c) {}
uint32 WebWrapTimer; uint32 uiWebWrapTimer;
uint32 InfectedBiteTimer; uint32 uiInfectedBiteTimer;
void Reset() void Reset()
{ {
WebWrapTimer = 11000; uiWebWrapTimer = 11*IN_MILISECONDS;
InfectedBiteTimer = 4000; uiInfectedBiteTimer = 4*IN_MILISECONDS;
} }
void EnterCombat(Unit* who) void EnterCombat(Unit* who)
@@ -365,18 +354,18 @@ struct npc_watcher_gashraAI : public ScriptedAI
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (WebWrapTimer <= diff) if (uiWebWrapTimer <= diff)
{ {
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true); DoCast(pTarget, SPELL_WEB_WRAP, true);
WebWrapTimer = 17000; uiWebWrapTimer = 17*IN_MILISECONDS;
} else WebWrapTimer -= diff; } else uiWebWrapTimer -= diff;
if (InfectedBiteTimer <= diff) if (uiInfectedBiteTimer <= diff)
{ {
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_INFECTED_BITE, H_SPELL_INFECTED_BITE), true); DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_INFECTED_BITE, H_SPELL_INFECTED_BITE), true);
InfectedBiteTimer = 15000; uiInfectedBiteTimer = 15*IN_MILISECONDS;
} else InfectedBiteTimer -= diff; } else uiInfectedBiteTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -386,15 +375,15 @@ struct npc_watcher_narjilAI : public ScriptedAI
{ {
npc_watcher_narjilAI(Creature *c) : ScriptedAI(c) {} npc_watcher_narjilAI(Creature *c) : ScriptedAI(c) {}
uint32 WebWrapTimer; uint32 uiWebWrapTimer;
uint32 InfectedBiteTimer; uint32 uiInfectedBiteTimer;
uint32 BlindingWebsTimer; uint32 uiBindingWebsTimer;
void Reset() void Reset()
{ {
WebWrapTimer = 11000; uiWebWrapTimer = 11*IN_MILISECONDS;
InfectedBiteTimer = 4000; uiInfectedBiteTimer = 4*IN_MILISECONDS;
BlindingWebsTimer = 17000; uiBindingWebsTimer = 17*IN_MILISECONDS;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -402,24 +391,24 @@ struct npc_watcher_narjilAI : public ScriptedAI
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (WebWrapTimer <= diff) if (uiWebWrapTimer <= diff)
{ {
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true); DoCast(pTarget, SPELL_WEB_WRAP, true);
WebWrapTimer = 15000; uiWebWrapTimer = 15*IN_MILISECONDS;
} else WebWrapTimer -= diff; } else uiWebWrapTimer -= diff;
if (InfectedBiteTimer <= diff) if (uiInfectedBiteTimer <= diff)
{ {
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_INFECTED_BITE, H_SPELL_INFECTED_BITE), true); DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_INFECTED_BITE, H_SPELL_INFECTED_BITE), true);
InfectedBiteTimer = 11000; uiInfectedBiteTimer = 11*IN_MILISECONDS;
} else InfectedBiteTimer -= diff; } else uiInfectedBiteTimer -= diff;
if (BlindingWebsTimer <= diff) if (uiBindingWebsTimer <= diff)
{ {
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_BLINDING_WEBS, H_SPELL_BLINDING_WEBS), true); DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_BLINDING_WEBS, H_SPELL_BLINDING_WEBS), true);
BlindingWebsTimer = 17000; uiBindingWebsTimer = 17*IN_MILISECONDS;
} else BlindingWebsTimer -= diff; } else uiBindingWebsTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -429,15 +418,15 @@ struct npc_watcher_silthikAI : public ScriptedAI
{ {
npc_watcher_silthikAI(Creature *c) : ScriptedAI(c) {} npc_watcher_silthikAI(Creature *c) : ScriptedAI(c) {}
uint32 WebWrapTimer; uint32 uiWebWrapTimer;
uint32 InfectedBiteTimer; uint32 uiInfectedBiteTimer;
uint32 PosionSprayTimer; uint32 uiPoisonSprayTimer;
void Reset() void Reset()
{ {
WebWrapTimer = 11000; uiWebWrapTimer = 11*IN_MILISECONDS;
InfectedBiteTimer = 4000; uiInfectedBiteTimer = 4*IN_MILISECONDS;
PosionSprayTimer = 15000; uiPoisonSprayTimer = 15*IN_MILISECONDS;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -445,25 +434,25 @@ struct npc_watcher_silthikAI : public ScriptedAI
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (WebWrapTimer <= diff) if (uiWebWrapTimer <= diff)
{ {
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true); DoCast(pTarget, SPELL_WEB_WRAP, true);
WebWrapTimer = 15000; uiWebWrapTimer = 15*IN_MILISECONDS;
} else WebWrapTimer -= diff; } else uiWebWrapTimer -= diff;
if (InfectedBiteTimer <= diff) if (uiInfectedBiteTimer <= diff)
{ {
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_INFECTED_BITE, H_SPELL_INFECTED_BITE), true); DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_INFECTED_BITE, H_SPELL_INFECTED_BITE), true);
InfectedBiteTimer = 15000; uiInfectedBiteTimer = 15*IN_MILISECONDS;
} else InfectedBiteTimer -= diff; } else uiInfectedBiteTimer -= diff;
if (PosionSprayTimer <= diff) if (uiPoisonSprayTimer <= diff)
{ {
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_POSION_SPRAY, H_SPELL_POSION_SPRAY), true); DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_POSION_SPRAY, H_SPELL_POSION_SPRAY), true);
PosionSprayTimer = 17000; uiPoisonSprayTimer = 17*IN_MILISECONDS;
} else PosionSprayTimer -= diff; } else uiPoisonSprayTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/> * Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -16,13 +16,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/* ScriptData
SDName: Instance_Azjol_Nerub
SD%Complete: 0
SDComment: Placeholder
SDCategory: Azjol Nerub
EndScriptData */
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "azjol_nerub.h" #include "azjol_nerub.h"
@@ -38,34 +31,34 @@ struct instance_azjol_nerub : public ScriptedInstance
{ {
instance_azjol_nerub(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; instance_azjol_nerub(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
uint64 m_uiKrikthir; uint64 uiKrikthir;
uint64 m_uiHadronox; uint64 uiHadronox;
uint64 m_uiAnubarak; uint64 uiAnubarak;
uint64 m_uiWatcherGashra; uint64 uiWatcherGashra;
uint64 m_uiWatcherSilthik; uint64 uiWatcherSilthik;
uint64 m_uiWatcherNarjil; uint64 uiWatcherNarjil;
uint64 m_uiKrikthirDoor; uint64 uiKrikthirDoor;
uint32 m_auiEncounter[MAX_ENCOUNTER]; uint32 auiEncounter[MAX_ENCOUNTER];
void Initialize() void Initialize()
{ {
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); memset(&auiEncounter, 0, sizeof(auiEncounter));
m_uiKrikthir = 0; uiKrikthir = 0;
m_uiHadronox = 0; uiHadronox = 0;
m_uiAnubarak = 0; uiAnubarak = 0;
m_uiWatcherGashra = 0; uiWatcherGashra = 0;
m_uiWatcherSilthik = 0; uiWatcherSilthik = 0;
m_uiWatcherNarjil = 0; uiWatcherNarjil = 0;
m_uiKrikthirDoor = 0; uiKrikthirDoor = 0;
} }
bool IsEncounterInProgress() const bool IsEncounterInProgress() const
{ {
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true; if (auiEncounter[i] == IN_PROGRESS) return true;
return false; return false;
} }
@@ -74,12 +67,12 @@ struct instance_azjol_nerub : public ScriptedInstance
{ {
switch(pCreature->GetEntry()) switch(pCreature->GetEntry())
{ {
case 28684: m_uiKrikthir = pCreature->GetGUID(); break; case 28684: uiKrikthir = pCreature->GetGUID(); break;
case 28921: m_uiHadronox = pCreature->GetGUID(); break; case 28921: uiHadronox = pCreature->GetGUID(); break;
case 29120: m_uiAnubarak = pCreature->GetGUID(); break; case 29120: uiAnubarak = pCreature->GetGUID(); break;
case 28730: m_uiWatcherGashra = pCreature->GetGUID(); break; case 28730: uiWatcherGashra = pCreature->GetGUID(); break;
case 28731: m_uiWatcherSilthik = pCreature->GetGUID(); break; case 28731: uiWatcherSilthik = pCreature->GetGUID(); break;
case 28729: m_uiWatcherNarjil = pCreature->GetGUID(); break; case 28729: uiWatcherNarjil = pCreature->GetGUID(); break;
} }
} }
@@ -88,8 +81,8 @@ struct instance_azjol_nerub : public ScriptedInstance
switch (pGo->GetEntry()) switch (pGo->GetEntry())
{ {
case 192395: case 192395:
m_uiKrikthirDoor = pGo->GetGUID(); uiKrikthirDoor = pGo->GetGUID();
if (m_auiEncounter[0] == DONE) if (auiEncounter[0] == DONE)
HandleGameObject(NULL,true,pGo); HandleGameObject(NULL,true,pGo);
break; break;
} }
@@ -99,12 +92,12 @@ struct instance_azjol_nerub : public ScriptedInstance
{ {
switch(identifier) switch(identifier)
{ {
case DATA_KRIKTHIR_THE_GATEWATCHER: return m_uiKrikthir; case DATA_KRIKTHIR_THE_GATEWATCHER: return uiKrikthir;
case DATA_HADRONOX: return m_uiHadronox; case DATA_HADRONOX: return uiHadronox;
case DATA_ANUBARAK: return m_uiAnubarak; case DATA_ANUBARAK: return uiAnubarak;
case DATA_WATCHER_GASHRA: return m_uiWatcherGashra; case DATA_WATCHER_GASHRA: return uiWatcherGashra;
case DATA_WATCHER_SILTHIK: return m_uiWatcherSilthik; case DATA_WATCHER_SILTHIK: return uiWatcherSilthik;
case DATA_WATCHER_NARJIL: return m_uiWatcherNarjil; case DATA_WATCHER_NARJIL: return uiWatcherNarjil;
} }
return 0; return 0;
@@ -115,14 +108,14 @@ struct instance_azjol_nerub : public ScriptedInstance
switch(type) switch(type)
{ {
case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT:
m_auiEncounter[0] = data; auiEncounter[0] = data;
if (data == DONE) if (data == DONE)
HandleGameObject(m_uiKrikthirDoor,true); HandleGameObject(uiKrikthirDoor,true);
break; break;
case DATA_HADRONOX_EVENT: case DATA_HADRONOX_EVENT:
m_auiEncounter[1] = data; break; auiEncounter[1] = data; break;
case DATA_ANUBARAK_EVENT: case DATA_ANUBARAK_EVENT:
m_auiEncounter[2] = data; break; auiEncounter[2] = data; break;
} }
if (data == DONE) if (data == DONE)
@@ -135,9 +128,9 @@ struct instance_azjol_nerub : public ScriptedInstance
{ {
switch(type) switch(type)
{ {
case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return m_auiEncounter[0]; case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return auiEncounter[0];
case DATA_HADRONOX_EVENT: return m_auiEncounter[1]; case DATA_HADRONOX_EVENT: return auiEncounter[1];
case DATA_ANUBARAK_EVENT: return m_auiEncounter[2]; case DATA_ANUBARAK_EVENT: return auiEncounter[2];
} }
return 0; return 0;
@@ -147,16 +140,12 @@ struct instance_azjol_nerub : public ScriptedInstance
{ {
OUT_SAVE_INST_DATA; OUT_SAVE_INST_DATA;
std::string str_data;
std::ostringstream saveStream; std::ostringstream saveStream;
saveStream << "A N " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " saveStream << "A N " << auiEncounter[0] << " " << auiEncounter[1] << " "
<< m_auiEncounter[2]; << auiEncounter[2];
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE; OUT_SAVE_INST_DATA_COMPLETE;
return str_data; return saveStream.str();
} }
void Load(const char* in) void Load(const char* in)
@@ -177,13 +166,13 @@ struct instance_azjol_nerub : public ScriptedInstance
if (dataHead1 == 'A' && dataHead2 == 'N') if (dataHead1 == 'A' && dataHead2 == 'N')
{ {
m_auiEncounter[0] = data0; auiEncounter[0] = data0;
m_auiEncounter[1] = data1; auiEncounter[1] = data1;
m_auiEncounter[2] = data2; auiEncounter[2] = data2;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) if (auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED; auiEncounter[i] = NOT_STARTED;
} else OUT_LOAD_INST_DATA_FAIL; } else OUT_LOAD_INST_DATA_FAIL;