aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Outland
diff options
context:
space:
mode:
authorazazel <none@none>2010-08-08 22:54:58 +0600
committerazazel <none@none>2010-08-08 22:54:58 +0600
commit590199d8e17405a0717eaf2e2d39f0d671b6f844 (patch)
tree36755767c89c4639c7cb0e2f31d8a99f53bb8cf5 /src/server/scripts/Outland
parent8a69e50d6aff8ea75100a1fb660deecf03b3ea07 (diff)
* Rename InstanceData to InstanceScript
* Rename *mgr to their new names in scripts project * Mass convert all the scripts (NEEDS THOROUGH TESTING, because it was done automatically) Please, report bugs on issue tracker. --HG-- branch : trunk rename : src/server/game/Instances/InstanceData.cpp => src/server/game/Instances/InstanceScript.cpp rename : src/server/game/Instances/InstanceData.h => src/server/game/Instances/InstanceScript.h
Diffstat (limited to 'src/server/scripts/Outland')
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp435
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp271
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp435
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp124
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp536
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp242
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp86
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp240
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp176
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp385
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp274
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp292
-rw-r--r--src/server/scripts/Outland/BlackTemple/black_temple.cpp48
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp448
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp2858
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp358
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp925
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp1187
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_supremus.cpp370
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp722
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp266
-rw-r--r--src/server/scripts/Outland/BlackTemple/illidari_council.cpp1030
-rw-r--r--src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp520
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp997
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp494
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp1409
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp1115
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp621
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp414
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp585
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp206
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp304
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp242
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp309
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp184
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp235
-rw-r--r--src/server/scripts/Outland/GruulsLair/boss_gruul.cpp298
-rw-r--r--src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp1025
-rw-r--r--src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp246
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp4
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp4
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp4
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp6
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp6
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp10
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp6
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp10
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp6
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp6
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp8
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp8
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp10
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp4
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp6
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp8
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp4
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp6
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp8
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp6
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp6
-rw-r--r--src/server/scripts/Outland/blades_edge_mountains.cpp639
-rw-r--r--src/server/scripts/Outland/boss_doomlord_kazzak.cpp198
-rw-r--r--src/server/scripts/Outland/boss_doomwalker.cpp200
-rw-r--r--src/server/scripts/Outland/hellfire_peninsula.cpp614
-rw-r--r--src/server/scripts/Outland/nagrand.cpp1170
-rw-r--r--src/server/scripts/Outland/netherstorm.cpp1276
-rw-r--r--src/server/scripts/Outland/shadowmoon_valley.cpp2394
-rw-r--r--src/server/scripts/Outland/shattrath_city.cpp852
-rw-r--r--src/server/scripts/Outland/terokkar_forest.cpp847
-rw-r--r--src/server/scripts/Outland/zangarmarsh.cpp24
70 files changed, 14801 insertions, 14461 deletions
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
index 353da092dba..6b5f02789dc 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
@@ -40,83 +40,90 @@ EndContentData */
#define SPELL_MORTAL_STRIKE 37335
#define SPELL_FREEZING_TRAP 37368
#define SPELL_HAMMER_OF_JUSTICE 37369
-
-struct mob_stolen_soulAI : public ScriptedAI
+ class mob_stolen_soul : public CreatureScript
{
- mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {}
-
- uint8 myClass;
- uint32 Class_Timer;
+public:
+ mob_stolen_soul() : CreatureScript("mob_stolen_soul") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Class_Timer = 1000;
+ return new mob_stolen_soulAI (pCreature);
}
- void EnterCombat(Unit * /*who*/)
- { }
-
- void SetMyClass(uint8 myclass)
+ struct mob_stolen_soulAI : public ScriptedAI
{
- myClass = myclass;
- }
+ mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {}
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ uint8 myClass;
+ uint32 Class_Timer;
+
+ void Reset()
+ {
+ Class_Timer = 1000;
+ }
+
+ void EnterCombat(Unit * /*who*/)
+ { }
+
+ void SetMyClass(uint8 myclass)
+ {
+ myClass = myclass;
+ }
- if (Class_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- switch (myClass)
+ if (!UpdateVictim())
+ return;
+
+ if (Class_Timer <= diff)
{
- case CLASS_WARRIOR:
- DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
- Class_Timer = 6000;
- break;
- case CLASS_PALADIN:
- DoCast(me->getVictim(), SPELL_HAMMER_OF_JUSTICE);
- Class_Timer = 6000;
- break;
- case CLASS_HUNTER:
- DoCast(me->getVictim(), SPELL_FREEZING_TRAP);
- Class_Timer = 20000;
- break;
- case CLASS_ROGUE:
- DoCast(me->getVictim(), SPELL_HEMORRHAGE);
- Class_Timer = 10000;
- break;
- case CLASS_PRIEST:
- DoCast(me->getVictim(), SPELL_MIND_FLAY);
- Class_Timer = 5000;
- break;
- case CLASS_SHAMAN:
- DoCast(me->getVictim(), SPELL_FROSTSHOCK);
- Class_Timer = 8000;
- break;
- case CLASS_MAGE:
- DoCast(me->getVictim(), SPELL_FIREBALL);
- Class_Timer = 5000;
- break;
- case CLASS_WARLOCK:
- DoCast(me->getVictim(), SPELL_CURSE_OF_AGONY);
- Class_Timer = 20000;
- break;
- case CLASS_DRUID:
- DoCast(me->getVictim(), SPELL_MOONFIRE);
- Class_Timer = 10000;
- break;
- }
- } else Class_Timer -= diff;
+ switch (myClass)
+ {
+ case CLASS_WARRIOR:
+ DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
+ Class_Timer = 6000;
+ break;
+ case CLASS_PALADIN:
+ DoCast(me->getVictim(), SPELL_HAMMER_OF_JUSTICE);
+ Class_Timer = 6000;
+ break;
+ case CLASS_HUNTER:
+ DoCast(me->getVictim(), SPELL_FREEZING_TRAP);
+ Class_Timer = 20000;
+ break;
+ case CLASS_ROGUE:
+ DoCast(me->getVictim(), SPELL_HEMORRHAGE);
+ Class_Timer = 10000;
+ break;
+ case CLASS_PRIEST:
+ DoCast(me->getVictim(), SPELL_MIND_FLAY);
+ Class_Timer = 5000;
+ break;
+ case CLASS_SHAMAN:
+ DoCast(me->getVictim(), SPELL_FROSTSHOCK);
+ Class_Timer = 8000;
+ break;
+ case CLASS_MAGE:
+ DoCast(me->getVictim(), SPELL_FIREBALL);
+ Class_Timer = 5000;
+ break;
+ case CLASS_WARLOCK:
+ DoCast(me->getVictim(), SPELL_CURSE_OF_AGONY);
+ Class_Timer = 20000;
+ break;
+ case CLASS_DRUID:
+ DoCast(me->getVictim(), SPELL_MOONFIRE);
+ Class_Timer = 10000;
+ break;
+ }
+ } else Class_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature)
-{
- return new mob_stolen_soulAI (pCreature);
-}
#define SAY_INTRO -1558000
#define SAY_SUMMON -1558001
@@ -142,209 +149,209 @@ CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature)
#define SPELL_SUMMON_AVATAR 32424
#define ENTRY_STOLEN_SOUL 18441
-
-struct boss_exarch_maladaarAI : public ScriptedAI
+ class boss_exarch_maladaar : public CreatureScript
{
- boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c)
- {
- HasTaunted = false;
- }
+public:
+ boss_exarch_maladaar() : CreatureScript("boss_exarch_maladaar") { }
- uint32 soulmodel;
- uint64 soulholder;
- uint8 soulclass;
-
- uint32 Fear_timer;
- uint32 Ribbon_of_Souls_timer;
- uint32 StolenSoul_Timer;
-
- bool HasTaunted;
- bool Avatar_summoned;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- soulmodel = 0;
- soulholder = 0;
- soulclass = 0;
-
- Fear_timer = 15000 + rand()% 5000;
- Ribbon_of_Souls_timer = 5000;
- StolenSoul_Timer = 25000 + rand()% 10000;
-
- Avatar_summoned = false;
+ return new boss_exarch_maladaarAI (pCreature);
}
- void MoveInLineOfSight(Unit *who)
+ struct boss_exarch_maladaarAI : public ScriptedAI
{
- if (!HasTaunted && me->IsWithinDistInMap(who, 150.0))
+ boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c)
{
- DoScriptText(SAY_INTRO, me);
- HasTaunted = true;
+ HasTaunted = false;
}
- ScriptedAI::MoveInLineOfSight(who);
- }
+ uint32 soulmodel;
+ uint64 soulholder;
+ uint8 soulclass;
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
- }
+ uint32 Fear_timer;
+ uint32 Ribbon_of_Souls_timer;
+ uint32 StolenSoul_Timer;
- void JustSummoned(Creature *summoned)
- {
- if (summoned->GetEntry() == ENTRY_STOLEN_SOUL)
+ bool HasTaunted;
+ bool Avatar_summoned;
+
+ void Reset()
{
- //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell.
- summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false);
- summoned->SetDisplayId(soulmodel);
- summoned->setFaction(me->getFaction());
+ soulmodel = 0;
+ soulholder = 0;
+ soulclass = 0;
- if (Unit *pTarget = Unit::GetUnit(*me,soulholder))
- {
+ Fear_timer = 15000 + rand()% 5000;
+ Ribbon_of_Souls_timer = 5000;
+ StolenSoul_Timer = 25000 + rand()% 10000;
- CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass);
- summoned->AI()->AttackStart(pTarget);
+ Avatar_summoned = false;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!HasTaunted && me->IsWithinDistInMap(who, 150.0))
+ {
+ DoScriptText(SAY_INTRO, me);
+ HasTaunted = true;
}
+
+ ScriptedAI::MoveInLineOfSight(who);
}
- }
- void KilledUnit(Unit* /*victim*/)
- {
- if (rand()%2)
- return;
+ void EnterCombat(Unit * /*who*/)
+ {
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
+ }
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
- }
+ void JustSummoned(Creature *summoned)
+ {
+ if (summoned->GetEntry() == ENTRY_STOLEN_SOUL)
+ {
+ //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell.
+ summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false);
+ summoned->SetDisplayId(soulmodel);
+ summoned->setFaction(me->getFaction());
- void JustDied(Unit* /*Killer*/)
- {
- DoScriptText(SAY_DEATH, me);
- //When Exarch Maladar is defeated D'ore appear.
- me->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000);
- }
+ if (Unit *pTarget = Unit::GetUnit(*me,soulholder))
+ {
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ CAST_AI(mob_stolen_soul::mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass);
+ summoned->AI()->AttackStart(pTarget);
+ }
+ }
+ }
- if (!Avatar_summoned && ((me->GetHealth()*100) / me->GetMaxHealth() < 25))
+ void KilledUnit(Unit* /*victim*/)
{
- if (me->IsNonMeleeSpellCasted(false))
- me->InterruptNonMeleeSpells(true);
-
- DoScriptText(SAY_SUMMON, me);
+ if (rand()%2)
+ return;
- DoCast(me, SPELL_SUMMON_AVATAR);
- Avatar_summoned = true;
- StolenSoul_Timer = 15000 + rand()% 15000;
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
- if (StolenSoul_Timer <= diff)
+ void JustDied(Unit* /*Killer*/)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- {
- if (pTarget->GetTypeId() == TYPEID_PLAYER)
- {
- if (me->IsNonMeleeSpellCasted(false))
- me->InterruptNonMeleeSpells(true);
+ DoScriptText(SAY_DEATH, me);
+ //When Exarch Maladar is defeated D'ore appear.
+ me->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000);
+ }
- uint32 i = urand(1,2);
- if (i == 1)
- DoScriptText(SAY_ROAR, me);
- else
- DoScriptText(SAY_SOUL_CLEAVE, me);
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
- soulmodel = pTarget->GetDisplayId();
- soulholder = pTarget->GetGUID();
- soulclass = pTarget->getClass();
+ if (!Avatar_summoned && ((me->GetHealth()*100) / me->GetMaxHealth() < 25))
+ {
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
- DoCast(pTarget, SPELL_STOLEN_SOUL);
- me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
+ DoScriptText(SAY_SUMMON, me);
- StolenSoul_Timer = 20000 + rand()% 10000;
- } else StolenSoul_Timer = 1000;
+ DoCast(me, SPELL_SUMMON_AVATAR);
+ Avatar_summoned = true;
+ StolenSoul_Timer = 15000 + rand()% 15000;
}
- } else StolenSoul_Timer -= diff;
- if (Ribbon_of_Souls_timer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_RIBBON_OF_SOULS);
+ if (StolenSoul_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ {
+ if (pTarget->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
+
+ uint32 i = urand(1,2);
+ if (i == 1)
+ DoScriptText(SAY_ROAR, me);
+ else
+ DoScriptText(SAY_SOUL_CLEAVE, me);
+
+ soulmodel = pTarget->GetDisplayId();
+ soulholder = pTarget->GetGUID();
+ soulclass = pTarget->getClass();
+
+ DoCast(pTarget, SPELL_STOLEN_SOUL);
+ me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
+
+ StolenSoul_Timer = 20000 + rand()% 10000;
+ } else StolenSoul_Timer = 1000;
+ }
+ } else StolenSoul_Timer -= diff;
+
+ if (Ribbon_of_Souls_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_RIBBON_OF_SOULS);
- Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000);
- } else Ribbon_of_Souls_timer -= diff;
+ Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000);
+ } else Ribbon_of_Souls_timer -= diff;
- if (Fear_timer <= diff)
- {
- DoCast(me, SPELL_SOUL_SCREAM);
- Fear_timer = 15000 + rand()% 15000;
- } else Fear_timer -= diff;
+ if (Fear_timer <= diff)
+ {
+ DoCast(me, SPELL_SOUL_SCREAM);
+ Fear_timer = 15000 + rand()% 15000;
+ } else Fear_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature)
-{
- return new boss_exarch_maladaarAI (pCreature);
-}
#define SPELL_AV_MORTAL_STRIKE 16856
#define SPELL_AV_SUNDER_ARMOR 16145
-
-struct mob_avatar_of_martyredAI : public ScriptedAI
+ class mob_avatar_of_martyred : public CreatureScript
{
- mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {}
-
- uint32 Mortal_Strike_timer;
+public:
+ mob_avatar_of_martyred() : CreatureScript("mob_avatar_of_martyred") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Mortal_Strike_timer = 10000;
+ return new mob_avatar_of_martyredAI (pCreature);
}
- void EnterCombat(Unit * /*who*/)
+ struct mob_avatar_of_martyredAI : public ScriptedAI
{
- }
+ mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {}
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ uint32 Mortal_Strike_timer;
- if (Mortal_Strike_timer <= diff)
+ void Reset()
{
- DoCast(me->getVictim(), SPELL_AV_MORTAL_STRIKE);
- Mortal_Strike_timer = 10000 + rand()%20 * 1000;
- } else Mortal_Strike_timer -= diff;
+ Mortal_Strike_timer = 10000;
+ }
+
+ void EnterCombat(Unit * /*who*/)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (Mortal_Strike_timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_AV_MORTAL_STRIKE);
+ Mortal_Strike_timer = 10000 + rand()%20 * 1000;
+ } else Mortal_Strike_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature)
-{
- return new mob_avatar_of_martyredAI (pCreature);
-}
void AddSC_boss_exarch_maladaar()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "boss_exarch_maladaar";
- newscript->GetAI = &GetAI_boss_exarch_maladaar;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_avatar_of_martyred";
- newscript->GetAI = &GetAI_mob_avatar_of_martyred;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_stolen_soul";
- newscript->GetAI = &GetAI_mob_stolen_soul;
- newscript->RegisterSelf();
+ new boss_exarch_maladaar();
+ new mob_avatar_of_martyred();
+ new mob_stolen_soul();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
index 6c584e16744..572da08bfe1 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
@@ -39,175 +39,180 @@ EndScriptData */
#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual
#define EMOTE_FOCUSES_ON "focuses on "
-
-struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
+ class boss_shirrak_the_dead_watcher : public CreatureScript
{
- boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c)
- {
- }
+public:
+ boss_shirrak_the_dead_watcher() : CreatureScript("boss_shirrak_the_dead_watcher") { }
- uint32 Inhibitmagic_Timer;
- uint32 Attractmagic_Timer;
- uint32 Carnivorousbite_Timer;
- uint32 FocusFire_Timer;
-
- uint64 FocusedTargetGUID;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Inhibitmagic_Timer = 0;
- Attractmagic_Timer = 28000;
- Carnivorousbite_Timer = 10000;
- FocusFire_Timer = 17000;
- FocusedTargetGUID = 0;
+ return new boss_shirrak_the_dead_watcherAI (pCreature);
}
- void EnterCombat(Unit * /*who*/)
- { }
-
- void JustSummoned(Creature *summoned)
+ struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
{
- if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE)
+ boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c)
{
- summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false);
- summoned->setFaction(me->getFaction());
- summoned->SetLevel(me->getLevel());
- summoned->addUnitState(UNIT_STAT_ROOT);
-
- if (Unit *pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID))
- summoned->AI()->AttackStart(pFocusedTarget);
}
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Inhibitmagic_Timer
- if (Inhibitmagic_Timer <= diff)
- {
- float dist;
- Map* pMap = me->GetMap();
- Map::PlayerList const &PlayerList = pMap->GetPlayers();
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- if (Player* i_pl = i->getSource())
- if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(me, 45)))
- {
- i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC);
- me->AddAura(SPELL_INHIBITMAGIC, i_pl);
- if (dist < 35)
- me->AddAura(SPELL_INHIBITMAGIC, i_pl);
- if (dist < 25)
- me->AddAura(SPELL_INHIBITMAGIC, i_pl);
- if (dist < 15)
- me->AddAura(SPELL_INHIBITMAGIC, i_pl);
- }
- Inhibitmagic_Timer = 3000+(rand()%1000);
- } else Inhibitmagic_Timer -= diff;
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ uint32 Inhibitmagic_Timer;
+ uint32 Attractmagic_Timer;
+ uint32 Carnivorousbite_Timer;
+ uint32 FocusFire_Timer;
- //Attractmagic_Timer
- if (Attractmagic_Timer <= diff)
- {
- DoCast(me, SPELL_ATTRACTMAGIC);
- Attractmagic_Timer = 30000;
- Carnivorousbite_Timer = 1500;
- } else Attractmagic_Timer -= diff;
+ uint64 FocusedTargetGUID;
- //Carnivorousbite_Timer
- if (Carnivorousbite_Timer <= diff)
+ void Reset()
{
- DoCast(me, SPELL_CARNIVOROUSBITE);
+ Inhibitmagic_Timer = 0;
+ Attractmagic_Timer = 28000;
Carnivorousbite_Timer = 10000;
- } else Carnivorousbite_Timer -= diff;
+ FocusFire_Timer = 17000;
+ FocusedTargetGUID = 0;
+ }
+
+ void EnterCombat(Unit * /*who*/)
+ { }
- //FocusFire_Timer
- if (FocusFire_Timer <= diff)
+ void JustSummoned(Creature *summoned)
{
- // Summon Focus Fire & Emote
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
+ if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE)
{
- FocusedTargetGUID = pTarget->GetGUID();
- me->SummonCreature(ENTRY_FOCUS_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500);
-
- // TODO: Find better way to handle emote
- // Emote
- std::string *emote = new std::string(EMOTE_FOCUSES_ON);
- emote->append(pTarget->GetName());
- emote->append("!");
- const char* text = emote->c_str();
- me->MonsterTextEmote(text, 0, true);
- delete emote;
+ summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false);
+ summoned->setFaction(me->getFaction());
+ summoned->SetLevel(me->getLevel());
+ summoned->addUnitState(UNIT_STAT_ROOT);
+
+ if (Unit *pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID))
+ summoned->AI()->AttackStart(pFocusedTarget);
}
- FocusFire_Timer = 15000+(rand()%5000);
- } else FocusFire_Timer -= diff;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Inhibitmagic_Timer
+ if (Inhibitmagic_Timer <= diff)
+ {
+ float dist;
+ Map* pMap = me->GetMap();
+ Map::PlayerList const &PlayerList = pMap->GetPlayers();
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ if (Player* i_pl = i->getSource())
+ if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(me, 45)))
+ {
+ i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC);
+ me->AddAura(SPELL_INHIBITMAGIC, i_pl);
+ if (dist < 35)
+ me->AddAura(SPELL_INHIBITMAGIC, i_pl);
+ if (dist < 25)
+ me->AddAura(SPELL_INHIBITMAGIC, i_pl);
+ if (dist < 15)
+ me->AddAura(SPELL_INHIBITMAGIC, i_pl);
+ }
+ Inhibitmagic_Timer = 3000+(rand()%1000);
+ } else Inhibitmagic_Timer -= diff;
+
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ //Attractmagic_Timer
+ if (Attractmagic_Timer <= diff)
+ {
+ DoCast(me, SPELL_ATTRACTMAGIC);
+ Attractmagic_Timer = 30000;
+ Carnivorousbite_Timer = 1500;
+ } else Attractmagic_Timer -= diff;
+
+ //Carnivorousbite_Timer
+ if (Carnivorousbite_Timer <= diff)
+ {
+ DoCast(me, SPELL_CARNIVOROUSBITE);
+ Carnivorousbite_Timer = 10000;
+ } else Carnivorousbite_Timer -= diff;
+
+ //FocusFire_Timer
+ if (FocusFire_Timer <= diff)
+ {
+ // Summon Focus Fire & Emote
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
+ {
+ FocusedTargetGUID = pTarget->GetGUID();
+ me->SummonCreature(ENTRY_FOCUS_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500);
+
+ // TODO: Find better way to handle emote
+ // Emote
+ std::string *emote = new std::string(EMOTE_FOCUSES_ON);
+ emote->append(pTarget->GetName());
+ emote->append("!");
+ const char* text = emote->c_str();
+ me->MonsterTextEmote(text, 0, true);
+ delete emote;
+ }
+ FocusFire_Timer = 15000+(rand()%5000);
+ } else FocusFire_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature)
+ class mob_focus_fire : public CreatureScript
{
- return new boss_shirrak_the_dead_watcherAI (pCreature);
-}
+public:
+ mob_focus_fire() : CreatureScript("mob_focus_fire") { }
-struct mob_focus_fireAI : public ScriptedAI
-{
- mob_focus_fireAI(Creature *c) : ScriptedAI(c)
+ CreatureAI* GetAI(Creature* pCreature) const
{
+ return new mob_focus_fireAI (pCreature);
}
- uint32 FieryBlast_Timer;
- bool fiery1, fiery2;
-
- void Reset()
+ struct mob_focus_fireAI : public ScriptedAI
{
- FieryBlast_Timer = 3000+(rand()%1000);
- fiery1 = fiery2 = true;
- }
+ mob_focus_fireAI(Creature *c) : ScriptedAI(c)
+ {
+ }
- void EnterCombat(Unit * /*who*/)
- { }
+ uint32 FieryBlast_Timer;
+ bool fiery1, fiery2;
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ void Reset()
+ {
+ FieryBlast_Timer = 3000+(rand()%1000);
+ fiery1 = fiery2 = true;
+ }
- //FieryBlast_Timer
- if (fiery2 && FieryBlast_Timer <= diff)
+ void EnterCombat(Unit * /*who*/)
+ { }
+
+ void UpdateAI(const uint32 diff)
{
- DoCast(me, SPELL_FIERY_BLAST);
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- if (fiery1) fiery1 = false;
- else if (fiery2) fiery2 = false;
+ //FieryBlast_Timer
+ if (fiery2 && FieryBlast_Timer <= diff)
+ {
+ DoCast(me, SPELL_FIERY_BLAST);
- FieryBlast_Timer = 1000;
- } else FieryBlast_Timer -= diff;
+ if (fiery1) fiery1 = false;
+ else if (fiery2) fiery2 = false;
+
+ FieryBlast_Timer = 1000;
+ } else FieryBlast_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_focus_fire(Creature* pCreature)
-{
- return new mob_focus_fireAI (pCreature);
-}
void AddSC_boss_shirrak_the_dead_watcher()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_shirrak_the_dead_watcher";
- newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_focus_fire";
- newscript->GetAI = &GetAI_mob_focus_fire;
- newscript->RegisterSelf();
+ new boss_shirrak_the_dead_watcher();
+ new mob_focus_fire();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
index d38c6d03662..1c3f65082ff 100644
--- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
@@ -54,307 +54,314 @@ enum ePrince
NR_INITIAL_BEACONS = 3
};
-
-struct boss_nexusprince_shaffarAI : public ScriptedAI
+ class boss_nexusprince_shaffar : public CreatureScript
{
- boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; }
-
- uint32 Blink_Timer;
- uint32 Beacon_Timer;
- uint32 FireBall_Timer;
- uint32 Frostbolt_Timer;
- uint32 FrostNova_Timer;
-
- SummonList summons;
-
- bool HasTaunted;
- bool CanBlink;
+public:
+ boss_nexusprince_shaffar() : CreatureScript("boss_nexusprince_shaffar") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Blink_Timer = 1500;
- Beacon_Timer = 10000;
- FireBall_Timer = 8000;
- Frostbolt_Timer = 4000;
- FrostNova_Timer = 15000;
+ return new boss_nexusprince_shaffarAI (pCreature);
+ }
- CanBlink = false;
+ struct boss_nexusprince_shaffarAI : public ScriptedAI
+ {
+ boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; }
- float dist = 8.0f;
- float posX, posY, posZ, angle;
- me->GetHomePosition(posX, posY, posZ, angle);
+ uint32 Blink_Timer;
+ uint32 Beacon_Timer;
+ uint32 FireBall_Timer;
+ uint32 Frostbolt_Timer;
+ uint32 FrostNova_Timer;
- me->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
- me->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
- me->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
- }
+ SummonList summons;
- void EnterEvadeMode()
- {
- summons.DespawnAll();
- ScriptedAI::EnterEvadeMode();
- }
+ bool HasTaunted;
+ bool CanBlink;
- void MoveInLineOfSight(Unit *who)
- {
- if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 100.0f))
+ void Reset()
{
- DoScriptText(SAY_INTRO, me);
- HasTaunted = true;
- }
- }
+ Blink_Timer = 1500;
+ Beacon_Timer = 10000;
+ FireBall_Timer = 8000;
+ Frostbolt_Timer = 4000;
+ FrostNova_Timer = 15000;
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
+ CanBlink = false;
- DoZoneInCombat();
- summons.DoZoneInCombat();
- }
+ float dist = 8.0f;
+ float posX, posY, posZ, angle;
+ me->GetHomePosition(posX, posY, posZ, angle);
- void JustSummoned(Creature *summoned)
- {
- if (summoned->GetEntry() == NPC_BEACON)
+ me->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
+ me->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
+ me->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
+ }
+
+ void EnterEvadeMode()
{
- summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false);
+ summons.DespawnAll();
+ ScriptedAI::EnterEvadeMode();
+ }
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- summoned->AI()->AttackStart(pTarget);
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 100.0f))
+ {
+ DoScriptText(SAY_INTRO, me);
+ HasTaunted = true;
+ }
}
- summons.Summon(summoned);
- }
+ void EnterCombat(Unit * /*who*/)
+ {
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
- void SummonedCreatureDespawn(Creature *summon)
- {
- summons.Despawn(summon);
- }
+ DoZoneInCombat();
+ summons.DoZoneInCombat();
+ }
- void KilledUnit(Unit* /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
- }
+ void JustSummoned(Creature *summoned)
+ {
+ if (summoned->GetEntry() == NPC_BEACON)
+ {
+ summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false);
- void JustDied(Unit* /*Killer*/)
- {
- DoScriptText(SAY_DEAD, me);
- summons.DespawnAll();
- }
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ summoned->AI()->AttackStart(pTarget);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ summons.Summon(summoned);
+ }
- if (FrostNova_Timer <= diff)
+ void SummonedCreatureDespawn(Creature *summon)
{
- if (me->IsNonMeleeSpellCasted(false))
- me->InterruptNonMeleeSpells(true);
-
- DoCast(me, SPELL_FROSTNOVA);
- FrostNova_Timer = 17500 + rand()%7500;
- CanBlink = true;
- } else FrostNova_Timer -= diff;
+ summons.Despawn(summon);
+ }
- if (Frostbolt_Timer <= diff)
+ void KilledUnit(Unit* /*victim*/)
{
- DoCast(me->getVictim(), SPELL_FROSTBOLT);
- Frostbolt_Timer = 4500 + rand()%1500;
- } else Frostbolt_Timer -= diff;
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
+ }
- if (FireBall_Timer <= diff)
+ void JustDied(Unit* /*Killer*/)
{
- DoCast(me->getVictim(), SPELL_FIREBALL);
- FireBall_Timer = 4500 + rand()%1500;
- } else FireBall_Timer -= diff;
+ DoScriptText(SAY_DEAD, me);
+ summons.DespawnAll();
+ }
- if (CanBlink)
+ void UpdateAI(const uint32 diff)
{
- if (Blink_Timer <= diff)
+ if (!UpdateVictim())
+ return;
+
+ if (FrostNova_Timer <= diff)
{
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(true);
- //expire movement, will prevent from running right back to victim after cast
- //(but should MoveChase be used again at a certain time or should he not move?)
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
- me->GetMotionMaster()->MovementExpired();
+ DoCast(me, SPELL_FROSTNOVA);
+ FrostNova_Timer = 17500 + rand()%7500;
+ CanBlink = true;
+ } else FrostNova_Timer -= diff;
- DoCast(me, SPELL_BLINK);
- Blink_Timer = 1000 + rand()%1500;
- CanBlink = false;
- } else Blink_Timer -= diff;
- }
+ if (Frostbolt_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FROSTBOLT);
+ Frostbolt_Timer = 4500 + rand()%1500;
+ } else Frostbolt_Timer -= diff;
- if (Beacon_Timer <= diff)
- {
- if (me->IsNonMeleeSpellCasted(false))
- me->InterruptNonMeleeSpells(true);
+ if (FireBall_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FIREBALL);
+ FireBall_Timer = 4500 + rand()%1500;
+ } else FireBall_Timer -= diff;
+
+ if (CanBlink)
+ {
+ if (Blink_Timer <= diff)
+ {
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
+
+ //expire movement, will prevent from running right back to victim after cast
+ //(but should MoveChase be used again at a certain time or should he not move?)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ me->GetMotionMaster()->MovementExpired();
+
+ DoCast(me, SPELL_BLINK);
+ Blink_Timer = 1000 + rand()%1500;
+ CanBlink = false;
+ } else Blink_Timer -= diff;
+ }
- if (!urand(0,3))
- DoScriptText(SAY_SUMMON, me);
+ if (Beacon_Timer <= diff)
+ {
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
- DoCast(me, SPELL_ETHEREAL_BEACON, true);
+ if (!urand(0,3))
+ DoScriptText(SAY_SUMMON, me);
- Beacon_Timer = 10000;
- } else Beacon_Timer -= diff;
+ DoCast(me, SPELL_ETHEREAL_BEACON, true);
+
+ Beacon_Timer = 10000;
+ } else Beacon_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature)
-{
- return new boss_nexusprince_shaffarAI (pCreature);
-}
enum eEnums
{
SPELL_ARCANE_BOLT = 15254,
SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430
};
-
-struct mob_ethereal_beaconAI : public ScriptedAI
+ class mob_ethereal_beacon : public CreatureScript
{
- mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c)
- {
- }
-
- uint32 Apprentice_Timer;
- uint32 ArcaneBolt_Timer;
- uint32 Check_Timer;
+public:
+ mob_ethereal_beacon() : CreatureScript("mob_ethereal_beacon") { }
- void KillSelf()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- me->Kill(me);
+ return new mob_ethereal_beaconAI (pCreature);
}
- void Reset()
+ struct mob_ethereal_beaconAI : public ScriptedAI
{
- Apprentice_Timer = DUNGEON_MODE(20000, 10000);
- ArcaneBolt_Timer = 1000;
- Check_Timer = 1000;
- }
-
- void EnterCombat(Unit * who)
- {
- // Send Shaffar to fight
- Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100);
- if (!Shaffar || Shaffar->isDead())
+ mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c)
{
- KillSelf();
- return;
}
- if (!Shaffar->isInCombat())
- Shaffar->AI()->AttackStart(who);
- }
- void JustSummoned(Creature *summoned)
- {
- summoned->AI()->AttackStart(me->getVictim());
- }
+ uint32 Apprentice_Timer;
+ uint32 ArcaneBolt_Timer;
+ uint32 Check_Timer;
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void KillSelf()
+ {
+ me->Kill(me);
+ }
- if (Check_Timer <= diff)
+ void Reset()
{
- Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100);
- if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat())
+ Apprentice_Timer = DUNGEON_MODE(20000, 10000);
+ ArcaneBolt_Timer = 1000;
+ Check_Timer = 1000;
+ }
+
+ void EnterCombat(Unit * who)
+ {
+ // Send Shaffar to fight
+ Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100);
+ if (!Shaffar || Shaffar->isDead())
{
KillSelf();
return;
}
- Check_Timer = 1000;
- } else Check_Timer -= diff;
+ if (!Shaffar->isInCombat())
+ Shaffar->AI()->AttackStart(who);
+ }
- if (ArcaneBolt_Timer <= diff)
+ void JustSummoned(Creature *summoned)
{
- DoCast(me->getVictim(), SPELL_ARCANE_BOLT);
- ArcaneBolt_Timer = 2000 + rand()%2500;
- } else ArcaneBolt_Timer -= diff;
+ summoned->AI()->AttackStart(me->getVictim());
+ }
- if (Apprentice_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (me->IsNonMeleeSpellCasted(false))
- me->InterruptNonMeleeSpells(true);
+ if (!UpdateVictim())
+ return;
+
+ if (Check_Timer <= diff)
+ {
+ Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100);
+ if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat())
+ {
+ KillSelf();
+ return;
+ }
+ Check_Timer = 1000;
+ } else Check_Timer -= diff;
+
+ if (ArcaneBolt_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ARCANE_BOLT);
+ ArcaneBolt_Timer = 2000 + rand()%2500;
+ } else ArcaneBolt_Timer -= diff;
+
+ if (Apprentice_Timer <= diff)
+ {
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
+
+ DoCast(me, SPELL_ETHEREAL_APPRENTICE, true);
+ me->ForcedDespawn();
+ return;
+ } else Apprentice_Timer -= diff;
+ }
+ };
- DoCast(me, SPELL_ETHEREAL_APPRENTICE, true);
- me->ForcedDespawn();
- return;
- } else Apprentice_Timer -= diff;
- }
};
-CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature)
-{
- return new mob_ethereal_beaconAI (pCreature);
-}
enum eEthereal
{
SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369,
SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370
};
-
-struct mob_ethereal_apprenticeAI : public ScriptedAI
+ class mob_ethereal_apprentice : public CreatureScript
{
- mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {}
-
- uint32 Cast_Timer;
+public:
+ mob_ethereal_apprentice() : CreatureScript("mob_ethereal_apprentice") { }
- bool isFireboltTurn;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Cast_Timer = 3000;
- isFireboltTurn = true;
+ return new mob_ethereal_apprenticeAI (pCreature);
}
- void UpdateAI(const uint32 diff)
+ struct mob_ethereal_apprenticeAI : public ScriptedAI
{
- if (!UpdateVictim())
- return;
+ mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 Cast_Timer;
+
+ bool isFireboltTurn;
- if (Cast_Timer <= diff)
+ void Reset()
{
- if (isFireboltTurn)
- {
- DoCast(me->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true);
- isFireboltTurn = false;
- }else{
- DoCast(me->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true);
- isFireboltTurn = true;
- }
Cast_Timer = 3000;
- } else Cast_Timer -= diff;
- }
+ isFireboltTurn = true;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (Cast_Timer <= diff)
+ {
+ if (isFireboltTurn)
+ {
+ DoCast(me->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true);
+ isFireboltTurn = false;
+ }else{
+ DoCast(me->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true);
+ isFireboltTurn = true;
+ }
+ Cast_Timer = 3000;
+ } else Cast_Timer -= diff;
+ }
+ };
+
};
-CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature)
-{
- return new mob_ethereal_apprenticeAI (pCreature);
-}
void AddSC_boss_nexusprince_shaffar()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "boss_nexusprince_shaffar";
- newscript->GetAI = &GetAI_boss_nexusprince_shaffar;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_ethereal_beacon";
- newscript->GetAI = &GetAI_mob_ethereal_beacon;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_ethereal_apprentice";
- newscript->GetAI = &GetAI_mob_ethereal_apprentice;
- newscript->RegisterSelf();
+ new boss_nexusprince_shaffar();
+ new mob_ethereal_beacon();
+ new mob_ethereal_apprentice();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
index da9c0c4a520..b22a38049ef 100644
--- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
@@ -40,89 +40,91 @@ EndScriptData */
#define H_SPELL_VOID_BLAST 38760
#define SPELL_DARK_SHELL 32358
#define H_SPELL_DARK_SHELL 38759
-
-struct boss_pandemoniusAI : public ScriptedAI
+ class boss_pandemonius : public CreatureScript
{
- boss_pandemoniusAI(Creature *c) : ScriptedAI(c)
- {
- }
-
- uint32 VoidBlast_Timer;
- uint32 DarkShell_Timer;
- uint32 VoidBlast_Counter;
+public:
+ boss_pandemonius() : CreatureScript("boss_pandemonius") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- VoidBlast_Timer = 8000+rand()%15000;
- DarkShell_Timer = 20000;
- VoidBlast_Counter = 0;
+ return new boss_pandemoniusAI (pCreature);
}
- void JustDied(Unit* /*Killer*/)
+ struct boss_pandemoniusAI : public ScriptedAI
{
- DoScriptText(SAY_DEATH, me);
- }
+ boss_pandemoniusAI(Creature *c) : ScriptedAI(c)
+ {
+ }
- void KilledUnit(Unit* /*victim*/)
- {
- DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
- }
+ uint32 VoidBlast_Timer;
+ uint32 DarkShell_Timer;
+ uint32 VoidBlast_Counter;
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
- }
+ void Reset()
+ {
+ VoidBlast_Timer = 8000+rand()%15000;
+ DarkShell_Timer = 20000;
+ VoidBlast_Counter = 0;
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void JustDied(Unit* /*Killer*/)
+ {
+ DoScriptText(SAY_DEATH, me);
+ }
- if (VoidBlast_Timer <= diff)
+ void KilledUnit(Unit* /*victim*/)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(pTarget, SPELL_VOID_BLAST);
- VoidBlast_Timer = 500;
- ++VoidBlast_Counter;
- }
+ DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
+ }
- if (VoidBlast_Counter == 5)
- {
- VoidBlast_Timer = 15000+rand()%10000;
- VoidBlast_Counter = 0;
- }
- } else VoidBlast_Timer -= diff;
+ void EnterCombat(Unit * /*who*/)
+ {
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
+ }
- if (!VoidBlast_Counter)
+ void UpdateAI(const uint32 diff)
{
- if (DarkShell_Timer <= diff)
+ if (!UpdateVictim())
+ return;
+
+ if (VoidBlast_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
- me->InterruptNonMeleeSpells(true);
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(pTarget, SPELL_VOID_BLAST);
+ VoidBlast_Timer = 500;
+ ++VoidBlast_Counter;
+ }
+
+ if (VoidBlast_Counter == 5)
+ {
+ VoidBlast_Timer = 15000+rand()%10000;
+ VoidBlast_Counter = 0;
+ }
+ } else VoidBlast_Timer -= diff;
+
+ if (!VoidBlast_Counter)
+ {
+ if (DarkShell_Timer <= diff)
+ {
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(true);
+
+ DoScriptText(EMOTE_DARK_SHELL, me);
- DoScriptText(EMOTE_DARK_SHELL, me);
+ DoCast(me, SPELL_DARK_SHELL);
+ DarkShell_Timer = 20000;
+ } else DarkShell_Timer -= diff;
+ }
- DoCast(me, SPELL_DARK_SHELL);
- DarkShell_Timer = 20000;
- } else DarkShell_Timer -= diff;
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_pandemonius(Creature* pCreature)
-{
- return new boss_pandemoniusAI (pCreature);
-}
void AddSC_boss_pandemonius()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_pandemonius";
- newscript->GetAI = &GetAI_boss_pandemonius;
- newscript->RegisterSelf();
+ new boss_pandemonius();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
index 4a76d46904d..7b45add961a 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
@@ -52,365 +52,375 @@ EndScriptData */
#define SPELL_ARCANE_BUFFET DUNGEON_MODE(33527, 38138)
#define SPELL_FROST_BUFFET DUNGEON_MODE(33528, 38142)
#define SPELL_SHADOW_BUFFET DUNGEON_MODE(33529, 38143)
-
-struct boss_darkweaver_sythAI : public ScriptedAI
+ class boss_darkweaver_syth : public CreatureScript
{
- boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c)
- {
- }
-
- uint32 flameshock_timer;
- uint32 arcaneshock_timer;
- uint32 frostshock_timer;
- uint32 shadowshock_timer;
- uint32 chainlightning_timer;
-
- bool summon90;
- bool summon50;
- bool summon10;
-
- void Reset()
- {
- flameshock_timer = 2000;
- arcaneshock_timer = 4000;
- frostshock_timer = 6000;
- shadowshock_timer = 8000;
- chainlightning_timer = 15000;
-
- summon90 = false;
- summon50 = false;
- summon10 = false;
- }
-
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
- }
-
- void JustDied(Unit* /*Killer*/)
- {
- DoScriptText(SAY_DEATH, me);
- }
-
- void KilledUnit(Unit* /*victim*/)
- {
- if (rand()%2)
- return;
-
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
- }
+public:
+ boss_darkweaver_syth() : CreatureScript("boss_darkweaver_syth") { }
- void JustSummoned(Creature *summoned)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- summoned->AI()->AttackStart(pTarget);
+ return new boss_darkweaver_sythAI (pCreature);
}
- void SythSummoning()
+ struct boss_darkweaver_sythAI : public ScriptedAI
{
- DoScriptText(SAY_SUMMON, me);
-
- if (me->IsNonMeleeSpellCasted(false))
- me->InterruptNonMeleeSpells(false);
+ boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c)
+ {
+ }
- DoCast(me, SPELL_SUMMON_SYTH_ARCANE, true); //front
- DoCast(me, SPELL_SUMMON_SYTH_FIRE, true); //back
- DoCast(me, SPELL_SUMMON_SYTH_FROST, true); //left
- DoCast(me, SPELL_SUMMON_SYTH_SHADOW, true); //right
- }
+ uint32 flameshock_timer;
+ uint32 arcaneshock_timer;
+ uint32 frostshock_timer;
+ uint32 shadowshock_timer;
+ uint32 chainlightning_timer;
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ bool summon90;
+ bool summon50;
+ bool summon10;
- if (((me->GetHealth()*100) / me->GetMaxHealth() < 90) && !summon90)
+ void Reset()
{
- SythSummoning();
- summon90 = true;
+ flameshock_timer = 2000;
+ arcaneshock_timer = 4000;
+ frostshock_timer = 6000;
+ shadowshock_timer = 8000;
+ chainlightning_timer = 15000;
+
+ summon90 = false;
+ summon50 = false;
+ summon10 = false;
}
- if (((me->GetHealth()*100) / me->GetMaxHealth() < 50) && !summon50)
+ void EnterCombat(Unit * /*who*/)
{
- SythSummoning();
- summon50 = true;
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
}
- if (((me->GetHealth()*100) / me->GetMaxHealth() < 10) && !summon10)
+ void JustDied(Unit* /*Killer*/)
{
- SythSummoning();
- summon10 = true;
+ DoScriptText(SAY_DEATH, me);
}
- if (flameshock_timer <= diff)
+ void KilledUnit(Unit* /*victim*/)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_FLAME_SHOCK);
+ if (rand()%2)
+ return;
- flameshock_timer = 10000 + rand()%5000;
- } else flameshock_timer -= diff;
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
+ }
- if (arcaneshock_timer <= diff)
+ void JustSummoned(Creature *summoned)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_ARCANE_SHOCK);
-
- arcaneshock_timer = 10000 + rand()%5000;
- } else arcaneshock_timer -= diff;
+ summoned->AI()->AttackStart(pTarget);
+ }
- if (frostshock_timer <= diff)
+ void SythSummoning()
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_FROST_SHOCK);
+ DoScriptText(SAY_SUMMON, me);
- frostshock_timer = 10000 + rand()%5000;
- } else frostshock_timer -= diff;
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
- if (shadowshock_timer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_SHADOW_SHOCK);
-
- shadowshock_timer = 10000 + rand()%5000;
- } else shadowshock_timer -= diff;
+ DoCast(me, SPELL_SUMMON_SYTH_ARCANE, true); //front
+ DoCast(me, SPELL_SUMMON_SYTH_FIRE, true); //back
+ DoCast(me, SPELL_SUMMON_SYTH_FROST, true); //left
+ DoCast(me, SPELL_SUMMON_SYTH_SHADOW, true); //right
+ }
- if (chainlightning_timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
-
- chainlightning_timer = 25000;
- } else chainlightning_timer -= diff;
+ if (!UpdateVictim())
+ return;
+
+ if (((me->GetHealth()*100) / me->GetMaxHealth() < 90) && !summon90)
+ {
+ SythSummoning();
+ summon90 = true;
+ }
+
+ if (((me->GetHealth()*100) / me->GetMaxHealth() < 50) && !summon50)
+ {
+ SythSummoning();
+ summon50 = true;
+ }
+
+ if (((me->GetHealth()*100) / me->GetMaxHealth() < 10) && !summon10)
+ {
+ SythSummoning();
+ summon10 = true;
+ }
+
+ if (flameshock_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_FLAME_SHOCK);
+
+ flameshock_timer = 10000 + rand()%5000;
+ } else flameshock_timer -= diff;
+
+ if (arcaneshock_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_ARCANE_SHOCK);
+
+ arcaneshock_timer = 10000 + rand()%5000;
+ } else arcaneshock_timer -= diff;
+
+ if (frostshock_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_FROST_SHOCK);
+
+ frostshock_timer = 10000 + rand()%5000;
+ } else frostshock_timer -= diff;
+
+ if (shadowshock_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_SHADOW_SHOCK);
+
+ shadowshock_timer = 10000 + rand()%5000;
+ } else shadowshock_timer -= diff;
+
+ if (chainlightning_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
+
+ chainlightning_timer = 25000;
+ } else chainlightning_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature)
-{
- return new boss_darkweaver_sythAI (pCreature);
-}
/* ELEMENTALS */
-
-struct mob_syth_fireAI : public ScriptedAI
+class mob_syth_fire : public CreatureScript
{
- mob_syth_fireAI(Creature *c) : ScriptedAI(c)
- {
- }
-
- uint32 flameshock_timer;
- uint32 flamebuffet_timer;
+public:
+ mob_syth_fire() : CreatureScript("mob_syth_fire") { }
- void Reset()
+ struct mob_syth_fireAI : public ScriptedAI
{
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
- flameshock_timer = 2500;
- flamebuffet_timer = 5000;
- }
-
- void EnterCombat(Unit * /*who*/) { }
+ mob_syth_fireAI(Creature *c) : ScriptedAI(c)
+ {
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ uint32 flameshock_timer;
+ uint32 flamebuffet_timer;
- if (flameshock_timer <= diff)
+ void Reset()
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_FLAME_SHOCK);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ flameshock_timer = 2500;
+ flamebuffet_timer = 5000;
+ }
- flameshock_timer = 5000;
- } else flameshock_timer -= diff;
+ void EnterCombat(Unit * /*who*/) { }
- if (flamebuffet_timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_FLAME_BUFFET);
+ if (!UpdateVictim())
+ return;
- flamebuffet_timer = 5000;
- } else flamebuffet_timer -= diff;
+ if (flameshock_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_FLAME_SHOCK);
- DoMeleeAttackIfReady();
- }
-};
+ flameshock_timer = 5000;
+ } else flameshock_timer -= diff;
-CreatureAI* GetAI_mob_syth_fire(Creature* pCreature)
-{
- return new mob_syth_fireAI (pCreature);
-}
+ if (flamebuffet_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_FLAME_BUFFET);
-struct mob_syth_arcaneAI : public ScriptedAI
-{
- mob_syth_arcaneAI(Creature *c) : ScriptedAI(c)
- {
- }
+ flamebuffet_timer = 5000;
+ } else flamebuffet_timer -= diff;
- uint32 arcaneshock_timer;
- uint32 arcanebuffet_timer;
+ DoMeleeAttackIfReady();
+ }
+ };
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
- arcaneshock_timer = 2500;
- arcanebuffet_timer = 5000;
+ return new mob_syth_fireAI (pCreature);
}
+}; class mob_syth_arcane : public CreatureScript
+{
+public:
+ mob_syth_arcane() : CreatureScript("mob_syth_arcane") { }
- void EnterCombat(Unit * /*who*/) { }
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new mob_syth_arcaneAI (pCreature);
+ }
- void UpdateAI(const uint32 diff)
+ struct mob_syth_arcaneAI : public ScriptedAI
{
- if (!UpdateVictim())
- return;
+ mob_syth_arcaneAI(Creature *c) : ScriptedAI(c)
+ {
+ }
- if (arcaneshock_timer <= diff)
+ uint32 arcaneshock_timer;
+ uint32 arcanebuffet_timer;
+
+ void Reset()
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_ARCANE_SHOCK);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
+ arcaneshock_timer = 2500;
+ arcanebuffet_timer = 5000;
+ }
- arcaneshock_timer = 5000;
- } else arcaneshock_timer -= diff;
+ void EnterCombat(Unit * /*who*/) { }
- if (arcanebuffet_timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_ARCANE_BUFFET);
+ if (!UpdateVictim())
+ return;
- arcanebuffet_timer = 5000;
- } else arcanebuffet_timer -= diff;
+ if (arcaneshock_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_ARCANE_SHOCK);
- DoMeleeAttackIfReady();
- }
+ arcaneshock_timer = 5000;
+ } else arcaneshock_timer -= diff;
+
+ if (arcanebuffet_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_ARCANE_BUFFET);
+
+ arcanebuffet_timer = 5000;
+ } else arcanebuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
};
-CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature)
+ class mob_syth_frost : public CreatureScript
{
- return new mob_syth_arcaneAI (pCreature);
-}
+public:
+ mob_syth_frost() : CreatureScript("mob_syth_frost") { }
-struct mob_syth_frostAI : public ScriptedAI
-{
- mob_syth_frostAI(Creature *c) : ScriptedAI(c)
+ CreatureAI* GetAI(Creature* pCreature) const
{
+ return new mob_syth_frostAI (pCreature);
}
- uint32 frostshock_timer;
- uint32 frostbuffet_timer;
-
- void Reset()
+ struct mob_syth_frostAI : public ScriptedAI
{
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- frostshock_timer = 2500;
- frostbuffet_timer = 5000;
- }
-
- void EnterCombat(Unit * /*who*/) { }
+ mob_syth_frostAI(Creature *c) : ScriptedAI(c)
+ {
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ uint32 frostshock_timer;
+ uint32 frostbuffet_timer;
- if (frostshock_timer <= diff)
+ void Reset()
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_FROST_SHOCK);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ frostshock_timer = 2500;
+ frostbuffet_timer = 5000;
+ }
- frostshock_timer = 5000;
- } else frostshock_timer -= diff;
+ void EnterCombat(Unit * /*who*/) { }
- if (frostbuffet_timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_FROST_BUFFET);
+ if (!UpdateVictim())
+ return;
- frostbuffet_timer = 5000;
- } else frostbuffet_timer -= diff;
+ if (frostshock_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_FROST_SHOCK);
+
+ frostshock_timer = 5000;
+ } else frostshock_timer -= diff;
+
+ if (frostbuffet_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_FROST_BUFFET);
+
+ frostbuffet_timer = 5000;
+ } else frostbuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_syth_frost(Creature* pCreature)
+ class mob_syth_shadow : public CreatureScript
{
- return new mob_syth_frostAI (pCreature);
-}
+public:
+ mob_syth_shadow() : CreatureScript("mob_syth_shadow") { }
-struct mob_syth_shadowAI : public ScriptedAI
-{
- mob_syth_shadowAI(Creature *c) : ScriptedAI(c)
+ CreatureAI* GetAI(Creature* pCreature) const
{
+ return new mob_syth_shadowAI (pCreature);
}
- uint32 shadowshock_timer;
- uint32 shadowbuffet_timer;
-
- void Reset()
+ struct mob_syth_shadowAI : public ScriptedAI
{
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
- shadowshock_timer = 2500;
- shadowbuffet_timer = 5000;
- }
-
- void EnterCombat(Unit * /*who*/) { }
+ mob_syth_shadowAI(Creature *c) : ScriptedAI(c)
+ {
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ uint32 shadowshock_timer;
+ uint32 shadowbuffet_timer;
- if (shadowshock_timer <= diff)
+ void Reset()
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_SHADOW_SHOCK);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
+ shadowshock_timer = 2500;
+ shadowbuffet_timer = 5000;
+ }
- shadowshock_timer = 5000;
- } else shadowshock_timer -= diff;
+ void EnterCombat(Unit * /*who*/) { }
- if (shadowbuffet_timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_SHADOW_BUFFET);
+ if (!UpdateVictim())
+ return;
- shadowbuffet_timer = 5000;
- } else shadowbuffet_timer -= diff;
+ if (shadowshock_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_SHADOW_SHOCK);
+
+ shadowshock_timer = 5000;
+ } else shadowshock_timer -= diff;
+
+ if (shadowbuffet_timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_SHADOW_BUFFET);
+
+ shadowbuffet_timer = 5000;
+ } else shadowbuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature)
-{
- return new mob_syth_shadowAI (pCreature);
-}
void AddSC_boss_darkweaver_syth()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_darkweaver_syth";
- newscript->GetAI = &GetAI_boss_darkweaver_syth;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_syth_fire";
- newscript->GetAI = &GetAI_mob_syth_arcane;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_syth_arcane";
- newscript->GetAI = &GetAI_mob_syth_arcane;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_syth_frost";
- newscript->GetAI = &GetAI_mob_syth_frost;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_syth_shadow";
- newscript->GetAI = &GetAI_mob_syth_shadow;
- newscript->RegisterSelf();
+ new boss_darkweaver_syth();
+ new mob_syth_fire();
+ new mob_syth_arcane();
+ new mob_syth_frost();
+ new mob_syth_shadow();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp
index 83cf669824f..462c9373a9c 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp
@@ -51,165 +51,167 @@ EndScriptData */
#define SPELL_ARCANE_EXPLOSION 38197
#define H_SPELL_ARCANE_EXPLOSION 40425
-
-struct boss_talon_king_ikissAI : public ScriptedAI
+ class boss_talon_king_ikiss : public CreatureScript
{
- boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- }
-
- ScriptedInstance* pInstance;
+public:
+ boss_talon_king_ikiss() : CreatureScript("boss_talon_king_ikiss") { }
- uint32 ArcaneVolley_Timer;
- uint32 Sheep_Timer;
- uint32 Blink_Timer;
- uint32 Slow_Timer;
-
- bool ManaShield;
- bool Blink;
- bool Intro;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- ArcaneVolley_Timer = 5000;
- Sheep_Timer = 8000;
- Blink_Timer = 35000;
- Slow_Timer = 15000+rand()%15000;
- Blink = false;
- Intro = false;
- ManaShield = false;
+ return new boss_talon_king_ikissAI (pCreature);
}
- void MoveInLineOfSight(Unit *who)
+ struct boss_talon_king_ikissAI : public ScriptedAI
{
- if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
+ boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c)
{
- if (!Intro && me->IsWithinDistInMap(who, 100))
- {
- Intro = true;
- DoScriptText(SAY_INTRO, me);
- }
-
- if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = me->GetAttackDistance(who);
- if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
- {
- //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
- AttackStart(who);
- }
+ pInstance = c->GetInstanceScript();
}
- }
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
- }
+ InstanceScript* pInstance;
- void JustDied(Unit* /*Killer*/)
- {
- DoScriptText(SAY_DEATH, me);
+ uint32 ArcaneVolley_Timer;
+ uint32 Sheep_Timer;
+ uint32 Blink_Timer;
+ uint32 Slow_Timer;
- if (pInstance)
- pInstance->SetData(DATA_IKISSDOOREVENT, DONE);
- }
-
- void KilledUnit(Unit* /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
- }
+ bool ManaShield;
+ bool Blink;
+ bool Intro;
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- if (Blink)
+ void Reset()
{
- DoCast(me, SPELL_ARCANE_EXPLOSION);
- DoCast(me, SPELL_ARCANE_BUBBLE, true);
+ ArcaneVolley_Timer = 5000;
+ Sheep_Timer = 8000;
+ Blink_Timer = 35000;
+ Slow_Timer = 15000+rand()%15000;
Blink = false;
+ Intro = false;
+ ManaShield = false;
}
- if (ArcaneVolley_Timer <= diff)
+ void MoveInLineOfSight(Unit *who)
{
- DoCast(me, SPELL_ARCANE_VOLLEY);
- ArcaneVolley_Timer = 7000+rand()%5000;
- } else ArcaneVolley_Timer -= diff;
+ if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
+ {
+ if (!Intro && me->IsWithinDistInMap(who, 100))
+ {
+ Intro = true;
+ DoScriptText(SAY_INTRO, me);
+ }
+
+ if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
+ {
+ //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+ AttackStart(who);
+ }
+ }
+ }
- if (Sheep_Timer <= diff)
+ void EnterCombat(Unit * /*who*/)
{
- Unit *pTarget;
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
+ }
- //second top aggro target in normal, random target in heroic correct?
- if (IsHeroic())
- pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
- else
- pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+ void JustDied(Unit* /*Killer*/)
+ {
+ DoScriptText(SAY_DEATH, me);
- if (pTarget)
- DoCast(pTarget, SPELL_POLYMORPH);
- Sheep_Timer = 15000+rand()%2500;
- } else Sheep_Timer -= diff;
+ if (pInstance)
+ pInstance->SetData(DATA_IKISSDOOREVENT, DONE);
+ }
- //may not be correct time to cast
- if (!ManaShield && ((me->GetHealth()*100) / me->GetMaxHealth() < 20))
+ void KilledUnit(Unit* /*victim*/)
{
- DoCast(me, SPELL_MANA_SHIELD);
- ManaShield = true;
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
- if (IsHeroic())
+ void UpdateAI(const uint32 diff)
{
- if (Slow_Timer <= diff)
+ if (!UpdateVictim())
+ return;
+
+ if (Blink)
{
- DoCast(me, H_SPELL_SLOW);
- Slow_Timer = 15000+rand()%25000;
- } else Slow_Timer -= diff;
- }
+ DoCast(me, SPELL_ARCANE_EXPLOSION);
+ DoCast(me, SPELL_ARCANE_BUBBLE, true);
+ Blink = false;
+ }
- if (Blink_Timer <= diff)
- {
- DoScriptText(EMOTE_ARCANE_EXP, me);
+ if (ArcaneVolley_Timer <= diff)
+ {
+ DoCast(me, SPELL_ARCANE_VOLLEY);
+ ArcaneVolley_Timer = 7000+rand()%5000;
+ } else ArcaneVolley_Timer -= diff;
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ if (Sheep_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
- me->InterruptNonMeleeSpells(false);
+ Unit *pTarget;
- //Spell doesn't work, but we use for visual effect at least
- DoCast(pTarget, SPELL_BLINK);
+ //second top aggro target in normal, random target in heroic correct?
+ if (IsHeroic())
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
+ else
+ pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- float X = pTarget->GetPositionX();
- float Y = pTarget->GetPositionY();
- float Z = pTarget->GetPositionZ();
+ if (pTarget)
+ DoCast(pTarget, SPELL_POLYMORPH);
+ Sheep_Timer = 15000+rand()%2500;
+ } else Sheep_Timer -= diff;
- DoTeleportTo(X,Y,Z);
+ //may not be correct time to cast
+ if (!ManaShield && ((me->GetHealth()*100) / me->GetMaxHealth() < 20))
+ {
+ DoCast(me, SPELL_MANA_SHIELD);
+ ManaShield = true;
+ }
- DoCast(pTarget, SPELL_BLINK_TELEPORT);
- Blink = true;
+ if (IsHeroic())
+ {
+ if (Slow_Timer <= diff)
+ {
+ DoCast(me, H_SPELL_SLOW);
+ Slow_Timer = 15000+rand()%25000;
+ } else Slow_Timer -= diff;
}
- Blink_Timer = 35000+rand()%5000;
- } else Blink_Timer -= diff;
- if (!Blink)
- DoMeleeAttackIfReady();
- }
+ if (Blink_Timer <= diff)
+ {
+ DoScriptText(EMOTE_ARCANE_EXP, me);
+
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ {
+ if (me->IsNonMeleeSpellCasted(false))
+ me->InterruptNonMeleeSpells(false);
+
+ //Spell doesn't work, but we use for visual effect at least
+ DoCast(pTarget, SPELL_BLINK);
+
+ float X = pTarget->GetPositionX();
+ float Y = pTarget->GetPositionY();
+ float Z = pTarget->GetPositionZ();
+
+ DoTeleportTo(X,Y,Z);
+
+ DoCast(pTarget, SPELL_BLINK_TELEPORT);
+ Blink = true;
+ }
+ Blink_Timer = 35000+rand()%5000;
+ } else Blink_Timer -= diff;
+
+ if (!Blink)
+ DoMeleeAttackIfReady();
+ }
+ };
+
};
-CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature)
-{
- return new boss_talon_king_ikissAI (pCreature);
-}
void AddSC_boss_talon_king_ikiss()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_talon_king_ikiss";
- newscript->GetAI = &GetAI_boss_talon_king_ikiss;
- newscript->RegisterSelf();
+ new boss_talon_king_ikiss();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
index 61b891c7535..3b53b40869f 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
@@ -31,63 +31,65 @@ enum eEnums
NPC_ANZU = 23035,
IKISS_DOOR = 177203,
};
-
-struct instance_sethekk_halls : public ScriptedInstance
+ class instance_sethekk_halls : public InstanceMapScript
{
- instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
-
- uint32 AnzuEncounter;
- uint64 m_uiIkissDoorGUID;
+public:
+ instance_sethekk_halls() : InstanceMapScript("instance_sethekk_halls") { }
- void Initialize()
+ InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
{
- AnzuEncounter = NOT_STARTED;
- m_uiIkissDoorGUID = 0;
+ return new instance_sethekk_halls_InstanceMapScript(pMap);
}
- void OnCreatureCreate(Creature* pCreature, bool /*add*/)
+ struct instance_sethekk_halls_InstanceMapScript : public InstanceScript
{
- if (pCreature->GetEntry() == NPC_ANZU)
+ instance_sethekk_halls_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
+
+ uint32 AnzuEncounter;
+ uint64 m_uiIkissDoorGUID;
+
+ void Initialize()
{
- if (AnzuEncounter >= IN_PROGRESS)
- pCreature->DisappearAndDie();
- else
- AnzuEncounter = IN_PROGRESS;
+ AnzuEncounter = NOT_STARTED;
+ m_uiIkissDoorGUID = 0;
}
- }
- void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
- {
- if (pGo->GetEntry() == IKISS_DOOR)
- m_uiIkissDoorGUID = pGo->GetGUID();
- }
+ void OnCreatureCreate(Creature* pCreature, bool /*add*/)
+ {
+ if (pCreature->GetEntry() == NPC_ANZU)
+ {
+ if (AnzuEncounter >= IN_PROGRESS)
+ pCreature->DisappearAndDie();
+ else
+ AnzuEncounter = IN_PROGRESS;
+ }
+ }
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
+ void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
- case DATA_IKISSDOOREVENT:
- if (data == DONE)
- DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILLISECONDS);
- break;
- case TYPE_ANZU_ENCOUNTER:
- AnzuEncounter = data;
- break;
+ if (pGo->GetEntry() == IKISS_DOOR)
+ m_uiIkissDoorGUID = pGo->GetGUID();
}
- }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_IKISSDOOREVENT:
+ if (data == DONE)
+ DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILLISECONDS);
+ break;
+ case TYPE_ANZU_ENCOUNTER:
+ AnzuEncounter = data;
+ break;
+ }
+ }
+ };
+
};
-InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap)
-{
- return new instance_sethekk_halls(pMap);
-}
void AddSC_instance_sethekk_halls()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_sethekk_halls";
- newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls;
- newscript->RegisterSelf();
+ new instance_sethekk_halls();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
index f039b7c7fab..9d2b9598ae5 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
@@ -43,166 +43,168 @@ enum eEnums
SPELL_FEAR = 33547,
SPELL_ENRAGE = 34970
};
-
-struct boss_ambassador_hellmawAI : public npc_escortAI
+ class boss_ambassador_hellmaw : public CreatureScript
{
- boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature)
+public:
+ boss_ambassador_hellmaw() : CreatureScript("boss_ambassador_hellmaw") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- m_pInstance = pCreature->GetInstanceData();
+ return new boss_ambassador_hellmawAI(pCreature);
}
- ScriptedInstance* m_pInstance;
-
- uint32 EventCheck_Timer;
- uint32 CorrosiveAcid_Timer;
- uint32 Fear_Timer;
- uint32 Enrage_Timer;
- bool Intro;
- bool IsBanished;
- bool Enraged;
-
- void Reset()
+ struct boss_ambassador_hellmawAI : public npc_escortAI
{
- EventCheck_Timer = 5000;
- CorrosiveAcid_Timer = 5000 + rand()%5000;
- Fear_Timer = 25000 + rand()%5000;
- Enrage_Timer = 180000;
- Intro = false;
- IsBanished = true;
- Enraged = false;
-
- if (m_pInstance && me->isAlive())
+ boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature)
{
- if (m_pInstance->GetData(TYPE_OVERSEER) != DONE)
- DoCast(me, SPELL_BANISH, true);
+ m_pInstance = pCreature->GetInstanceScript();
}
- }
- void JustReachedHome()
- {
- if (m_pInstance)
- m_pInstance->SetData(TYPE_HELLMAW, FAIL);
- }
+ InstanceScript* m_pInstance;
- void MoveInLineOfSight(Unit* pWho)
- {
- if (me->HasAura(SPELL_BANISH))
- return;
+ uint32 EventCheck_Timer;
+ uint32 CorrosiveAcid_Timer;
+ uint32 Fear_Timer;
+ uint32 Enrage_Timer;
+ bool Intro;
+ bool IsBanished;
+ bool Enraged;
- npc_escortAI::MoveInLineOfSight(pWho);
- }
+ void Reset()
+ {
+ EventCheck_Timer = 5000;
+ CorrosiveAcid_Timer = 5000 + rand()%5000;
+ Fear_Timer = 25000 + rand()%5000;
+ Enrage_Timer = 180000;
+ Intro = false;
+ IsBanished = true;
+ Enraged = false;
+
+ if (m_pInstance && me->isAlive())
+ {
+ if (m_pInstance->GetData(TYPE_OVERSEER) != DONE)
+ DoCast(me, SPELL_BANISH, true);
+ }
+ }
- void WaypointReached(uint32 /*i*/)
- {
- }
+ void JustReachedHome()
+ {
+ if (m_pInstance)
+ m_pInstance->SetData(TYPE_HELLMAW, FAIL);
+ }
- void DoIntro()
- {
- if (me->HasAura(SPELL_BANISH))
- me->RemoveAurasDueToSpell(SPELL_BANISH);
+ void MoveInLineOfSight(Unit* pWho)
+ {
+ if (me->HasAura(SPELL_BANISH))
+ return;
- IsBanished = false;
- Intro = true;
+ npc_escortAI::MoveInLineOfSight(pWho);
+ }
- if (m_pInstance)
+ void WaypointReached(uint32 /*i*/)
{
- if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL)
+ }
+
+ void DoIntro()
+ {
+ if (me->HasAura(SPELL_BANISH))
+ me->RemoveAurasDueToSpell(SPELL_BANISH);
+
+ IsBanished = false;
+ Intro = true;
+
+ if (m_pInstance)
{
- DoScriptText(SAY_INTRO, me);
- Start(true, false, 0, NULL, false, true);
- }
+ if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL)
+ {
+ DoScriptText(SAY_INTRO, me);
+ Start(true, false, 0, NULL, false, true);
+ }
- m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS);
+ m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS);
+ }
}
- }
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
- }
+ void EnterCombat(Unit * /*who*/)
+ {
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
+ }
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
- }
+ void KilledUnit(Unit * /*victim*/)
+ {
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
+ }
- void JustDied(Unit * /*victim*/)
- {
- DoScriptText(SAY_DEATH, me);
+ void JustDied(Unit * /*victim*/)
+ {
+ DoScriptText(SAY_DEATH, me);
- if (m_pInstance)
- m_pInstance->SetData(TYPE_HELLMAW, DONE);
- }
+ if (m_pInstance)
+ m_pInstance->SetData(TYPE_HELLMAW, DONE);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!Intro && !HasEscortState(STATE_ESCORT_ESCORTING))
+ void UpdateAI(const uint32 diff)
{
- if (EventCheck_Timer <= diff)
+ if (!Intro && !HasEscortState(STATE_ESCORT_ESCORTING))
{
- if (m_pInstance)
+ if (EventCheck_Timer <= diff)
{
- if (m_pInstance->GetData(TYPE_OVERSEER) == DONE)
+ if (m_pInstance)
{
- DoIntro();
- return;
+ if (m_pInstance->GetData(TYPE_OVERSEER) == DONE)
+ {
+ DoIntro();
+ return;
+ }
}
+ EventCheck_Timer = 5000;
+ return;
+ }
+ else
+ {
+ EventCheck_Timer -= diff;
+ return;
}
- EventCheck_Timer = 5000;
- return;
- }
- else
- {
- EventCheck_Timer -= diff;
- return;
}
- }
- npc_escortAI::UpdateAI(diff);
+ npc_escortAI::UpdateAI(diff);
- if (!UpdateVictim())
- return;
+ if (!UpdateVictim())
+ return;
- if (me->HasAura(SPELL_BANISH, 0))
- {
- EnterEvadeMode();
- return;
- }
+ if (me->HasAura(SPELL_BANISH, 0))
+ {
+ EnterEvadeMode();
+ return;
+ }
- if (CorrosiveAcid_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_CORROSIVE_ACID);
- CorrosiveAcid_Timer = 15000 + rand()%10000;
- } else CorrosiveAcid_Timer -= diff;
+ if (CorrosiveAcid_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_CORROSIVE_ACID);
+ CorrosiveAcid_Timer = 15000 + rand()%10000;
+ } else CorrosiveAcid_Timer -= diff;
- if (Fear_Timer <= diff)
- {
- DoCast(me, SPELL_FEAR);
- Fear_Timer = 20000 + rand()%15000;
- } else Fear_Timer -= diff;
+ if (Fear_Timer <= diff)
+ {
+ DoCast(me, SPELL_FEAR);
+ Fear_Timer = 20000 + rand()%15000;
+ } else Fear_Timer -= diff;
- if (IsHeroic())
- {
- if (!Enraged && Enrage_Timer <= diff)
+ if (IsHeroic())
{
- DoCast(me, SPELL_ENRAGE);
- Enraged = true;
- } else Enrage_Timer -= diff;
+ if (!Enraged && Enrage_Timer <= diff)
+ {
+ DoCast(me, SPELL_ENRAGE);
+ Enraged = true;
+ } else Enrage_Timer -= diff;
+ }
}
- }
+ };
+
};
-CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature)
-{
- return new boss_ambassador_hellmawAI(pCreature);
-}
void AddSC_boss_ambassador_hellmaw()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_ambassador_hellmaw";
- newscript->GetAI = &GetAI_boss_ambassador_hellmaw;
- newscript->RegisterSelf();
+ new boss_ambassador_hellmaw();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
index 817b71200f0..1ee4035af1c 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
@@ -53,119 +53,121 @@ EndScriptData */
#define SAY2_SLAY2 -1555025
#define SAY2_HELP -1555026
#define SAY2_DEATH -1555027
-
-struct boss_blackheart_the_inciterAI : public ScriptedAI
+ class boss_blackheart_the_inciter : public CreatureScript
{
- boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- }
-
- ScriptedInstance *pInstance;
+public:
+ boss_blackheart_the_inciter() : CreatureScript("boss_blackheart_the_inciter") { }
- bool InciteChaos;
- uint32 InciteChaos_Timer;
- uint32 InciteChaosWait_Timer;
- uint32 Charge_Timer;
- uint32 Knockback_Timer;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- InciteChaos = false;
- InciteChaos_Timer = 20000;
- InciteChaosWait_Timer = 15000;
- Charge_Timer = 5000;
- Knockback_Timer = 15000;
-
- if (pInstance)
- pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED);
+ return new boss_blackheart_the_inciterAI (pCreature);
}
- void KilledUnit(Unit * /*victim*/)
+ struct boss_blackheart_the_inciterAI : public ScriptedAI
{
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
- }
+ boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- void JustDied(Unit * /*victim*/)
- {
- DoScriptText(SAY_DEATH, me);
+ InstanceScript *pInstance;
- if (pInstance)
- pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE);
- }
+ bool InciteChaos;
+ uint32 InciteChaos_Timer;
+ uint32 InciteChaosWait_Timer;
+ uint32 Charge_Timer;
+ uint32 Knockback_Timer;
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
+ void Reset()
+ {
+ InciteChaos = false;
+ InciteChaos_Timer = 20000;
+ InciteChaosWait_Timer = 15000;
+ Charge_Timer = 5000;
+ Knockback_Timer = 15000;
+
+ if (pInstance)
+ pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED);
+ }
- if (pInstance)
- pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS);
- }
+ void KilledUnit(Unit * /*victim*/)
+ {
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
+ }
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ void JustDied(Unit * /*victim*/)
+ {
+ DoScriptText(SAY_DEATH, me);
+
+ if (pInstance)
+ pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE);
+ }
- if (InciteChaos)
+ void EnterCombat(Unit * /*who*/)
{
- if (InciteChaosWait_Timer <= diff)
- {
- InciteChaos = false;
- InciteChaosWait_Timer = 15000;
- } else InciteChaosWait_Timer -= diff;
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
- return;
+ if (pInstance)
+ pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS);
}
- if (InciteChaos_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me, SPELL_INCITE_CHAOS);
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
- for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ if (InciteChaos)
{
- Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
- if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
- pTarget->CastSpell(pTarget,SPELL_INCITE_CHAOS_B,true);
+ if (InciteChaosWait_Timer <= diff)
+ {
+ InciteChaos = false;
+ InciteChaosWait_Timer = 15000;
+ } else InciteChaosWait_Timer -= diff;
+
+ return;
}
- DoResetThreat();
- InciteChaos = true;
- InciteChaos_Timer = 40000;
- return;
- } else InciteChaos_Timer -= diff;
+ if (InciteChaos_Timer <= diff)
+ {
+ DoCast(me, SPELL_INCITE_CHAOS);
+
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
+ for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ {
+ Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
+ if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
+ pTarget->CastSpell(pTarget,SPELL_INCITE_CHAOS_B,true);
+ }
+
+ DoResetThreat();
+ InciteChaos = true;
+ InciteChaos_Timer = 40000;
+ return;
+ } else InciteChaos_Timer -= diff;
+
+ //Charge_Timer
+ if (Charge_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ DoCast(pTarget, SPELL_CHARGE);
+ Charge_Timer = 15000 + rand()%10000;
+ } else Charge_Timer -= diff;
- //Charge_Timer
- if (Charge_Timer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
- DoCast(pTarget, SPELL_CHARGE);
- Charge_Timer = 15000 + rand()%10000;
- } else Charge_Timer -= diff;
+ //Knockback_Timer
+ if (Knockback_Timer <= diff)
+ {
+ DoCast(me, SPELL_WAR_STOMP);
+ Knockback_Timer = 18000 + rand()%6000;
+ } else Knockback_Timer -= diff;
- //Knockback_Timer
- if (Knockback_Timer <= diff)
- {
- DoCast(me, SPELL_WAR_STOMP);
- Knockback_Timer = 18000 + rand()%6000;
- } else Knockback_Timer -= diff;
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature)
-{
- return new boss_blackheart_the_inciterAI (pCreature);
-}
void AddSC_boss_blackheart_the_inciter()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_blackheart_the_inciter";
- newscript->GetAI = &GetAI_boss_blackheart_the_inciter;
- newscript->RegisterSelf();
+ new boss_blackheart_the_inciter();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
index 4234c0c1271..ea1b0ad41b7 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
@@ -61,255 +61,260 @@ float VoidPortalCoords[5][3] =
{-209.3401, -262.7564, 17.1},
{-261.4533, -297.3298, 17.1}
};
-
-struct mob_voidtravelerAI : public ScriptedAI
+ class mob_voidtraveler : public CreatureScript
{
- mob_voidtravelerAI(Creature *c) : ScriptedAI(c)
- {
- }
+public:
+ mob_voidtraveler() : CreatureScript("mob_voidtraveler") { }
- uint64 VorpilGUID;
- uint32 move;
- bool sacrificed;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- VorpilGUID = 0;
- move = 0;
- sacrificed = false;
+ return new mob_voidtravelerAI (pCreature);
}
- void EnterCombat(Unit * /*who*/){}
-
- void UpdateAI(const uint32 diff)
+ struct mob_voidtravelerAI : public ScriptedAI
{
- if (!VorpilGUID)
+ mob_voidtravelerAI(Creature *c) : ScriptedAI(c)
{
- me->Kill(me);
- return;
}
- if (move <= diff)
+
+ uint64 VorpilGUID;
+ uint32 move;
+ bool sacrificed;
+
+ void Reset()
{
- Creature *Vorpil = Unit::GetCreature(*me, VorpilGUID);
- if (!Vorpil)
- {
- VorpilGUID = 0;
- return;
- }
+ VorpilGUID = 0;
+ move = 0;
+ sacrificed = false;
+ }
+
+ void EnterCombat(Unit * /*who*/){}
- if (sacrificed)
+ void UpdateAI(const uint32 diff)
+ {
+ if (!VorpilGUID)
{
- me->AddAura(DUNGEON_MODE(SPELL_EMPOWERING_SHADOWS, H_SPELL_EMPOWERING_SHADOWS), Vorpil);
- Vorpil->SetHealth(Vorpil->GetHealth() + Vorpil->GetMaxHealth()/25);
- DoCast(me, SPELL_SHADOW_NOVA, true);
me->Kill(me);
return;
}
- me->GetMotionMaster()->MoveFollow(Vorpil,0,0);
- if (me->IsWithinDist(Vorpil, 3))
- {
- DoCast(me, SPELL_SACRIFICE, false);
- sacrificed = true;
- move = 500;
- return;
- }
- if (!Vorpil->isInCombat() || Vorpil->isDead())
+ if (move <= diff)
{
- me->Kill(me);
- return;
- }
- move = 1000;
- } else move -= diff;
- }
+ Creature *Vorpil = Unit::GetCreature(*me, VorpilGUID);
+ if (!Vorpil)
+ {
+ VorpilGUID = 0;
+ return;
+ }
+
+ if (sacrificed)
+ {
+ me->AddAura(DUNGEON_MODE(SPELL_EMPOWERING_SHADOWS, H_SPELL_EMPOWERING_SHADOWS), Vorpil);
+ Vorpil->SetHealth(Vorpil->GetHealth() + Vorpil->GetMaxHealth()/25);
+ DoCast(me, SPELL_SHADOW_NOVA, true);
+ me->Kill(me);
+ return;
+ }
+ me->GetMotionMaster()->MoveFollow(Vorpil,0,0);
+ if (me->IsWithinDist(Vorpil, 3))
+ {
+ DoCast(me, SPELL_SACRIFICE, false);
+ sacrificed = true;
+ move = 500;
+ return;
+ }
+ if (!Vorpil->isInCombat() || Vorpil->isDead())
+ {
+ me->Kill(me);
+ return;
+ }
+ move = 1000;
+ } else move -= diff;
+ }
+ };
+
};
-CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature)
+ class boss_grandmaster_vorpil : public CreatureScript
{
- return new mob_voidtravelerAI (pCreature);
-}
+public:
+ boss_grandmaster_vorpil() : CreatureScript("boss_grandmaster_vorpil") { }
-struct boss_grandmaster_vorpilAI : public ScriptedAI
-{
- boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
- Intro = false;
+ return new boss_grandmaster_vorpilAI (pCreature);
}
- ScriptedInstance *pInstance;
- bool Intro, HelpYell;
- bool sumportals;
+ struct boss_grandmaster_vorpilAI : public ScriptedAI
+ {
+ boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ Intro = false;
+ }
- uint32 ShadowBoltVolley_Timer;
- uint32 DrawShadows_Timer;
- uint32 summonTraveler_Timer;
- uint32 banish_Timer;
- uint64 PortalsGuid[5];
+ InstanceScript *pInstance;
+ bool Intro, HelpYell;
+ bool sumportals;
- void Reset()
- {
- ShadowBoltVolley_Timer = 7000 + rand()%7000;
- DrawShadows_Timer = 45000;
- summonTraveler_Timer = 90000;
- banish_Timer = 17000;
- HelpYell = false;
- destroyPortals();
-
- if (pInstance)
- pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED);
- }
+ uint32 ShadowBoltVolley_Timer;
+ uint32 DrawShadows_Timer;
+ uint32 summonTraveler_Timer;
+ uint32 banish_Timer;
+ uint64 PortalsGuid[5];
- void summonPortals()
- {
- if (!sumportals)
+ void Reset()
+ {
+ ShadowBoltVolley_Timer = 7000 + rand()%7000;
+ DrawShadows_Timer = 45000;
+ summonTraveler_Timer = 90000;
+ banish_Timer = 17000;
+ HelpYell = false;
+ destroyPortals();
+
+ if (pInstance)
+ pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED);
+ }
+
+ void summonPortals()
{
- for (uint8 i = 0; i < 5; ++i)
+ if (!sumportals)
{
- Creature *Portal = NULL;
- Portal = me->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000);
- if (Portal)
+ for (uint8 i = 0; i < 5; ++i)
{
- PortalsGuid[i] = Portal->GetGUID();
- Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false);
+ Creature *Portal = NULL;
+ Portal = me->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000);
+ if (Portal)
+ {
+ PortalsGuid[i] = Portal->GetGUID();
+ Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false);
+ }
}
+ sumportals = true;
+ summonTraveler_Timer = 5000;
}
- sumportals = true;
- summonTraveler_Timer = 5000;
}
- }
- void destroyPortals()
- {
- if (sumportals)
+ void destroyPortals()
{
- for (uint8 i = 0; i < 5; ++i)
+ if (sumportals)
{
- Unit *Portal = Unit::GetUnit((*me), PortalsGuid[i]);
- if (Portal && Portal->isAlive())
- Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- PortalsGuid[i] = 0;
+ for (uint8 i = 0; i < 5; ++i)
+ {
+ Unit *Portal = Unit::GetUnit((*me), PortalsGuid[i]);
+ if (Portal && Portal->isAlive())
+ Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ PortalsGuid[i] = 0;
+ }
+ sumportals = false;
}
- sumportals = false;
}
- }
- void spawnVoidTraveler()
- {
- int pos = urand(0,4);
- me->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000);
- if (!HelpYell)
+ void spawnVoidTraveler()
{
- DoScriptText(SAY_HELP, me);
- HelpYell = true;
+ int pos = urand(0,4);
+ me->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000);
+ if (!HelpYell)
+ {
+ DoScriptText(SAY_HELP, me);
+ HelpYell = true;
+ }
}
- }
-
- void JustSummoned(Creature *summoned)
- {
- if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER)
- CAST_AI(mob_voidtravelerAI, summoned->AI())->VorpilGUID = me->GetGUID();
- }
-
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
- }
- void JustDied(Unit * /*victim*/)
- {
- DoScriptText(SAY_DEATH, me);
- destroyPortals();
-
- if (pInstance)
- pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE);
- }
+ void JustSummoned(Creature *summoned)
+ {
+ if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER)
+ CAST_AI(mob_voidtraveler::mob_voidtravelerAI, summoned->AI())->VorpilGUID = me->GetGUID();
+ }
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
- summonPortals();
+ void KilledUnit(Unit * /*victim*/)
+ {
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
+ }
- if (pInstance)
- pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS);
- }
+ void JustDied(Unit * /*victim*/)
+ {
+ DoScriptText(SAY_DEATH, me);
+ destroyPortals();
- void MoveInLineOfSight(Unit *who)
- {
- ScriptedAI::MoveInLineOfSight(who);
+ if (pInstance)
+ pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE);
+ }
- if (!Intro && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 100) && me->IsHostileTo(who))
+ void EnterCombat(Unit * /*who*/)
{
- DoScriptText(SAY_INTRO, me);
- Intro = true;
- }
- }
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
+ summonPortals();
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ if (pInstance)
+ pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS);
+ }
- if (ShadowBoltVolley_Timer <= diff)
+ void MoveInLineOfSight(Unit *who)
{
- DoCast(me, SPELL_SHADOWBOLT_VOLLEY);
- ShadowBoltVolley_Timer = 15000 + rand()%15000;
- } else ShadowBoltVolley_Timer -= diff;
+ ScriptedAI::MoveInLineOfSight(who);
- if (IsHeroic() && banish_Timer <= diff)
- {
- Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,30,false);
- if (pTarget)
+ if (!Intro && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 100) && me->IsHostileTo(who))
{
- DoCast(pTarget, SPELL_BANISH);
- banish_Timer = 16000;
+ DoScriptText(SAY_INTRO, me);
+ Intro = true;
}
- } else banish_Timer -= diff;
+ }
- if (DrawShadows_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- Map* pMap = me->GetMap();
- Map::PlayerList const &PlayerList = pMap->GetPlayers();
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- if (Player* i_pl = i->getSource())
- if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH))
- i_pl->TeleportTo(me->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT);
+ if (!UpdateVictim())
+ return;
- me->GetMap()->CreatureRelocation(me, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f);
- DoCast(me, SPELL_DRAW_SHADOWS, true);
+ if (ShadowBoltVolley_Timer <= diff)
+ {
+ DoCast(me, SPELL_SHADOWBOLT_VOLLEY);
+ ShadowBoltVolley_Timer = 15000 + rand()%15000;
+ } else ShadowBoltVolley_Timer -= diff;
- DoCast(me, SPELL_RAIN_OF_FIRE);
+ if (IsHeroic() && banish_Timer <= diff)
+ {
+ Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,30,false);
+ if (pTarget)
+ {
+ DoCast(pTarget, SPELL_BANISH);
+ banish_Timer = 16000;
+ }
+ } else banish_Timer -= diff;
- ShadowBoltVolley_Timer = 6000;
- DrawShadows_Timer = 30000;
- } else DrawShadows_Timer -= diff;
+ if (DrawShadows_Timer <= diff)
+ {
+ Map* pMap = me->GetMap();
+ Map::PlayerList const &PlayerList = pMap->GetPlayers();
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ if (Player* i_pl = i->getSource())
+ if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH))
+ i_pl->TeleportTo(me->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT);
- if (summonTraveler_Timer <= diff)
- {
- spawnVoidTraveler();
- summonTraveler_Timer = 10000;
- //enrage at 20%
- if ((me->GetHealth()*5) < me->GetMaxHealth())
- summonTraveler_Timer = 5000;
- } else summonTraveler_Timer -=diff;
+ me->GetMap()->CreatureRelocation(me, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f);
+ DoCast(me, SPELL_DRAW_SHADOWS, true);
+
+ DoCast(me, SPELL_RAIN_OF_FIRE);
+
+ ShadowBoltVolley_Timer = 6000;
+ DrawShadows_Timer = 30000;
+ } else DrawShadows_Timer -= diff;
+
+ if (summonTraveler_Timer <= diff)
+ {
+ spawnVoidTraveler();
+ summonTraveler_Timer = 10000;
+ //enrage at 20%
+ if ((me->GetHealth()*5) < me->GetMaxHealth())
+ summonTraveler_Timer = 5000;
+ } else summonTraveler_Timer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature)
-{
- return new boss_grandmaster_vorpilAI (pCreature);
-}
void AddSC_boss_grandmaster_vorpil()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_grandmaster_vorpil";
- newscript->GetAI = &GetAI_boss_grandmaster_vorpil;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_voidtraveler";
- newscript->GetAI = &GetAI_mob_voidtraveler;
- newscript->RegisterSelf();
+ new boss_grandmaster_vorpil();
+ new mob_voidtraveler();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
index ef6565bb7cf..b37eccada5a 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
@@ -35,173 +35,175 @@ EndScriptData */
#define SPELL_MAGNETIC_PULL 33689
#define SPELL_SONIC_SHOCK 38797
#define SPELL_THUNDERING_STORM 39365
-
-struct boss_murmurAI : public ScriptedAI
+ class boss_murmur : public CreatureScript
{
- boss_murmurAI(Creature *c) : ScriptedAI(c)
- {
- SetCombatMovement(false);
- }
+public:
+ boss_murmur() : CreatureScript("boss_murmur") { }
- uint32 SonicBoom_Timer;
- uint32 MurmursTouch_Timer;
- uint32 Resonance_Timer;
- uint32 MagneticPull_Timer;
- uint32 SonicShock_Timer;
- uint32 ThunderingStorm_Timer;
- bool SonicBoom;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- SonicBoom_Timer = 30000;
- MurmursTouch_Timer = 8000 + rand()%12000;
- Resonance_Timer = 5000;
- MagneticPull_Timer = 15000 + rand()%15000;
- ThunderingStorm_Timer = 15000;
- SonicShock_Timer = 10000;
- SonicBoom = false;
-
- //database should have `RegenHealth`=0 to prevent regen
- uint32 hp = (me->GetMaxHealth()*40)/100;
- if (hp) me->SetHealth(hp);
- me->ResetPlayerDamageReq();
+ return new boss_murmurAI (pCreature);
}
- void SonicBoomEffect()
+ struct boss_murmurAI : public ScriptedAI
{
- std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
- for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ boss_murmurAI(Creature *c) : ScriptedAI(c)
{
- Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
- if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
- {
- //Not do anything without aura, spell can be resisted!
- if (pTarget->HasAura(SPELL_SONIC_BOOM_CAST) && me->IsWithinDistInMap(pTarget, 34.0f))
- {
- //This will be wrong calculation. Also, comments suggest it must deal damage
- pTarget->SetHealth(uint32(pTarget->GetMaxHealth() - pTarget->GetMaxHealth() * 0.8));
- }
- }
+ SetCombatMovement(false);
}
- }
-
- void EnterCombat(Unit * /*who*/) { }
-
- // Sonic Boom instant damage (needs core fix instead of this)
- void SpellHitTarget(Unit *pTarget, const SpellEntry *spell)
- {
- if (pTarget && pTarget->isAlive() && spell && spell->Id == uint32(SPELL_SONIC_BOOM_EFFECT))
- me->DealDamage(pTarget,(pTarget->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target or casting
- if (!UpdateVictim() || me->IsNonMeleeSpellCasted(false))
- return;
- // Sonic Boom
- if (SonicBoom)
- {
- DoCast(me, SPELL_SONIC_BOOM_EFFECT, true);
- SonicBoomEffect();
+ uint32 SonicBoom_Timer;
+ uint32 MurmursTouch_Timer;
+ uint32 Resonance_Timer;
+ uint32 MagneticPull_Timer;
+ uint32 SonicShock_Timer;
+ uint32 ThunderingStorm_Timer;
+ bool SonicBoom;
- SonicBoom = false;
- Resonance_Timer = 1500;
- }
- if (SonicBoom_Timer <= diff)
+ void Reset()
{
- DoScriptText(EMOTE_SONIC_BOOM, me);
- DoCast(me, SPELL_SONIC_BOOM_CAST);
SonicBoom_Timer = 30000;
- SonicBoom = true;
- return;
- } else SonicBoom_Timer -= diff;
+ MurmursTouch_Timer = 8000 + rand()%12000;
+ Resonance_Timer = 5000;
+ MagneticPull_Timer = 15000 + rand()%15000;
+ ThunderingStorm_Timer = 15000;
+ SonicShock_Timer = 10000;
+ SonicBoom = false;
- // Murmur's Touch
- if (MurmursTouch_Timer <= diff)
- {
- if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,80,true))
- DoCast(pTarget, SPELL_MURMURS_TOUCH);
- MurmursTouch_Timer = 25000 + rand()%10000;
- } else MurmursTouch_Timer -= diff;
+ //database should have `RegenHealth`=0 to prevent regen
+ uint32 hp = (me->GetMaxHealth()*40)/100;
+ if (hp) me->SetHealth(hp);
+ me->ResetPlayerDamageReq();
+ }
- // Resonance
- if (!SonicBoom && !(me->IsWithinMeleeRange(me->getVictim())))
+ void SonicBoomEffect()
{
- if (Resonance_Timer <= diff)
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
+ for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- DoCast(me, SPELL_RESONANCE);
- Resonance_Timer = 5000;
- } else Resonance_Timer -= diff;
+ Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
+ if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
+ {
+ //Not do anything without aura, spell can be resisted!
+ if (pTarget->HasAura(SPELL_SONIC_BOOM_CAST) && me->IsWithinDistInMap(pTarget, 34.0f))
+ {
+ //This will be wrong calculation. Also, comments suggest it must deal damage
+ pTarget->SetHealth(uint32(pTarget->GetMaxHealth() - pTarget->GetMaxHealth() * 0.8));
+ }
+ }
+ }
}
- // Magnetic Pull
- if (MagneticPull_Timer <= diff)
+ void EnterCombat(Unit * /*who*/) { }
+
+ // Sonic Boom instant damage (needs core fix instead of this)
+ void SpellHitTarget(Unit *pTarget, const SpellEntry *spell)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- if (pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
- {
- DoCast(pTarget, SPELL_MAGNETIC_PULL);
- MagneticPull_Timer = 15000+rand()%15000;
- return;
- }
- MagneticPull_Timer = 500;
- } else MagneticPull_Timer -= diff;
-
- if (IsHeroic())
+ if (pTarget && pTarget->isAlive() && spell && spell->Id == uint32(SPELL_SONIC_BOOM_EFFECT))
+ me->DealDamage(pTarget,(pTarget->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell);
+ }
+
+ void UpdateAI(const uint32 diff)
{
- // Thundering Storm
- if (ThunderingStorm_Timer <= diff)
+ //Return since we have no target or casting
+ if (!UpdateVictim() || me->IsNonMeleeSpellCasted(false))
+ return;
+
+ // Sonic Boom
+ if (SonicBoom)
{
- std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
- for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
- if (Unit *pTarget = Unit::GetUnit((*me),(*i)->getUnitGuid()))
- if (pTarget->isAlive() && !me->IsWithinDist(pTarget, 35, false))
- DoCast(pTarget, SPELL_THUNDERING_STORM, true);
- ThunderingStorm_Timer = 15000;
- } else ThunderingStorm_Timer -= diff;
+ DoCast(me, SPELL_SONIC_BOOM_EFFECT, true);
+ SonicBoomEffect();
- // Sonic Shock
- if (SonicShock_Timer <= diff)
+ SonicBoom = false;
+ Resonance_Timer = 1500;
+ }
+ if (SonicBoom_Timer <= diff)
{
- if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,20,false))
- if (pTarget->isAlive())
- DoCast(pTarget, SPELL_SONIC_SHOCK);
- SonicShock_Timer = 10000+rand()%10000;
- } else SonicShock_Timer -= diff;
- }
+ DoScriptText(EMOTE_SONIC_BOOM, me);
+ DoCast(me, SPELL_SONIC_BOOM_CAST);
+ SonicBoom_Timer = 30000;
+ SonicBoom = true;
+ return;
+ } else SonicBoom_Timer -= diff;
+
+ // Murmur's Touch
+ if (MurmursTouch_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,80,true))
+ DoCast(pTarget, SPELL_MURMURS_TOUCH);
+ MurmursTouch_Timer = 25000 + rand()%10000;
+ } else MurmursTouch_Timer -= diff;
- // Select nearest most aggro target if top aggro too far
- if (!me->isAttackReady())
- return;
- if (!me->IsWithinMeleeRange(me->getVictim()))
- {
- std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
- for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
- if (Unit *pTarget = Unit::GetUnit((*me),(*i)->getUnitGuid()))
- if (pTarget->isAlive() && me->IsWithinMeleeRange(pTarget))
+ // Resonance
+ if (!SonicBoom && !(me->IsWithinMeleeRange(me->getVictim())))
+ {
+ if (Resonance_Timer <= diff)
+ {
+ DoCast(me, SPELL_RESONANCE);
+ Resonance_Timer = 5000;
+ } else Resonance_Timer -= diff;
+ }
+
+ // Magnetic Pull
+ if (MagneticPull_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ if (pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
{
- me->TauntApply(pTarget);
- break;
+ DoCast(pTarget, SPELL_MAGNETIC_PULL);
+ MagneticPull_Timer = 15000+rand()%15000;
+ return;
}
+ MagneticPull_Timer = 500;
+ } else MagneticPull_Timer -= diff;
+
+ if (IsHeroic())
+ {
+ // Thundering Storm
+ if (ThunderingStorm_Timer <= diff)
+ {
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
+ for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
+ if (Unit *pTarget = Unit::GetUnit((*me),(*i)->getUnitGuid()))
+ if (pTarget->isAlive() && !me->IsWithinDist(pTarget, 35, false))
+ DoCast(pTarget, SPELL_THUNDERING_STORM, true);
+ ThunderingStorm_Timer = 15000;
+ } else ThunderingStorm_Timer -= diff;
+
+ // Sonic Shock
+ if (SonicShock_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,20,false))
+ if (pTarget->isAlive())
+ DoCast(pTarget, SPELL_SONIC_SHOCK);
+ SonicShock_Timer = 10000+rand()%10000;
+ } else SonicShock_Timer -= diff;
+ }
+
+ // Select nearest most aggro target if top aggro too far
+ if (!me->isAttackReady())
+ return;
+ if (!me->IsWithinMeleeRange(me->getVictim()))
+ {
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
+ for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
+ if (Unit *pTarget = Unit::GetUnit((*me),(*i)->getUnitGuid()))
+ if (pTarget->isAlive() && me->IsWithinMeleeRange(pTarget))
+ {
+ me->TauntApply(pTarget);
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_murmur(Creature* pCreature)
-{
- return new boss_murmurAI (pCreature);
-}
void AddSC_boss_murmur()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_murmur";
- newscript->GetAI = &GetAI_boss_murmur;
- newscript->RegisterSelf();
+ new boss_murmur();
}
-
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
index b5b917547a6..5ff41763644 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
@@ -37,193 +37,195 @@ EndScriptData */
3 - Grandmaster Vorpil event
4 - Murmur event
*/
-
-struct instance_shadow_labyrinth : public ScriptedInstance
+ class instance_shadow_labyrinth : public InstanceMapScript
{
- instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
+public:
+ instance_shadow_labyrinth() : InstanceMapScript("instance_shadow_labyrinth") { }
- uint32 m_auiEncounter[MAX_ENCOUNTER];
- std::string str_data;
+ InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
+ {
+ return new instance_shadow_labyrinth_InstanceMapScript(pMap);
+ }
- uint64 m_uiRefectoryDoorGUID;
- uint64 m_uiScreamingHallDoorGUID;
+ struct instance_shadow_labyrinth_InstanceMapScript : public InstanceScript
+ {
+ instance_shadow_labyrinth_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
- uint64 m_uiGrandmasterVorpil;
- uint32 m_uiFelOverseerCount;
+ uint32 m_auiEncounter[MAX_ENCOUNTER];
+ std::string str_data;
- void Initialize()
- {
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ uint64 m_uiRefectoryDoorGUID;
+ uint64 m_uiScreamingHallDoorGUID;
- m_uiRefectoryDoorGUID = 0;
- m_uiScreamingHallDoorGUID = 0;
+ uint64 m_uiGrandmasterVorpil;
+ uint32 m_uiFelOverseerCount;
- m_uiGrandmasterVorpil = 0;
- m_uiFelOverseerCount = 0;
- }
+ void Initialize()
+ {
+ memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
- bool IsEncounterInProgress() const
- {
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS) return true;
+ m_uiRefectoryDoorGUID = 0;
+ m_uiScreamingHallDoorGUID = 0;
- return false;
- }
+ m_uiGrandmasterVorpil = 0;
+ m_uiFelOverseerCount = 0;
+ }
- void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
- {
- switch(pGo->GetEntry())
+ bool IsEncounterInProgress() const
{
- case REFECTORY_DOOR:
- m_uiRefectoryDoorGUID = pGo->GetGUID();
- if (m_auiEncounter[2] == DONE)
- pGo->SetGoState(GO_STATE_ACTIVE);
- break;
- case SCREAMING_HALL_DOOR:
- m_uiScreamingHallDoorGUID = pGo->GetGUID();
- if (m_auiEncounter[3] == DONE)
- pGo->SetGoState(GO_STATE_ACTIVE);
- break;
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS) return true;
+
+ return false;
}
- }
- void OnCreatureCreate(Creature* pCreature, bool /*add*/)
- {
- switch(pCreature->GetEntry())
+ void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
- case 18732:
- m_uiGrandmasterVorpil = pCreature->GetGUID();
- break;
- case 18796:
- if (pCreature->isAlive())
- {
- ++m_uiFelOverseerCount;
- sLog.outDebug("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount);
- }
- break;
+ switch(pGo->GetEntry())
+ {
+ case REFECTORY_DOOR:
+ m_uiRefectoryDoorGUID = pGo->GetGUID();
+ if (m_auiEncounter[2] == DONE)
+ pGo->SetGoState(GO_STATE_ACTIVE);
+ break;
+ case SCREAMING_HALL_DOOR:
+ m_uiScreamingHallDoorGUID = pGo->GetGUID();
+ if (m_auiEncounter[3] == DONE)
+ pGo->SetGoState(GO_STATE_ACTIVE);
+ break;
+ }
}
- }
- void SetData(uint32 type, uint32 uiData)
- {
- switch(type)
+ void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
- case TYPE_HELLMAW:
- m_auiEncounter[0] = uiData;
- break;
-
- case TYPE_OVERSEER:
- if (uiData != DONE)
- {
- sLog.outError("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE");
- return;
- }
- if (m_uiFelOverseerCount)
- {
- --m_uiFelOverseerCount;
-
- if (m_uiFelOverseerCount)
- sLog.outDebug("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount);
- else
+ switch(pCreature->GetEntry())
+ {
+ case 18732:
+ m_uiGrandmasterVorpil = pCreature->GetGUID();
+ break;
+ case 18796:
+ if (pCreature->isAlive())
{
- m_auiEncounter[1] = DONE;
- sLog.outDebug("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE");
+ ++m_uiFelOverseerCount;
+ sLog.outDebug("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount);
}
- }
- break;
-
- case DATA_BLACKHEARTTHEINCITEREVENT:
- if (uiData == DONE)
- DoUseDoorOrButton(m_uiRefectoryDoorGUID);
- m_auiEncounter[2] = uiData;
- break;
-
- case DATA_GRANDMASTERVORPILEVENT:
- if (uiData == DONE)
- DoUseDoorOrButton(m_uiScreamingHallDoorGUID);
- m_auiEncounter[3] = uiData;
- break;
-
- case DATA_MURMUREVENT:
- m_auiEncounter[4] = uiData;
- break;
+ break;
+ }
}
- if (uiData == DONE)
+ void SetData(uint32 type, uint32 uiData)
{
- if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0)
- return;
+ switch(type)
+ {
+ case TYPE_HELLMAW:
+ m_auiEncounter[0] = uiData;
+ break;
+
+ case TYPE_OVERSEER:
+ if (uiData != DONE)
+ {
+ sLog.outError("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE");
+ return;
+ }
+ if (m_uiFelOverseerCount)
+ {
+ --m_uiFelOverseerCount;
+
+ if (m_uiFelOverseerCount)
+ sLog.outDebug("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount);
+ else
+ {
+ m_auiEncounter[1] = DONE;
+ sLog.outDebug("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE");
+ }
+ }
+ break;
+
+ case DATA_BLACKHEARTTHEINCITEREVENT:
+ if (uiData == DONE)
+ DoUseDoorOrButton(m_uiRefectoryDoorGUID);
+ m_auiEncounter[2] = uiData;
+ break;
+
+ case DATA_GRANDMASTERVORPILEVENT:
+ if (uiData == DONE)
+ DoUseDoorOrButton(m_uiScreamingHallDoorGUID);
+ m_auiEncounter[3] = uiData;
+ break;
+
+ case DATA_MURMUREVENT:
+ m_auiEncounter[4] = uiData;
+ break;
+ }
+
+ if (uiData == DONE)
+ {
+ if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0)
+ return;
- OUT_SAVE_INST_DATA;
+ OUT_SAVE_INST_DATA;
- std::ostringstream saveStream;
- saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
- << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4];
+ std::ostringstream saveStream;
+ saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
+ << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4];
- str_data = saveStream.str();
+ str_data = saveStream.str();
- SaveToDB();
- OUT_SAVE_INST_DATA_COMPLETE;
+ SaveToDB();
+ OUT_SAVE_INST_DATA_COMPLETE;
+ }
}
- }
- uint32 GetData(uint32 type)
- {
- switch(type)
+ uint32 GetData(uint32 type)
{
- case TYPE_HELLMAW: return m_auiEncounter[0];
- case TYPE_OVERSEER: return m_auiEncounter[1];
- case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3];
- case DATA_MURMUREVENT: return m_auiEncounter[4];
+ switch(type)
+ {
+ case TYPE_HELLMAW: return m_auiEncounter[0];
+ case TYPE_OVERSEER: return m_auiEncounter[1];
+ case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3];
+ case DATA_MURMUREVENT: return m_auiEncounter[4];
+ }
+ return false;
}
- return false;
- }
- uint64 GetData64(uint32 identifier)
- {
- if (identifier == DATA_GRANDMASTERVORPIL)
- return m_uiGrandmasterVorpil;
-
- return 0;
- }
+ uint64 GetData64(uint32 identifier)
+ {
+ if (identifier == DATA_GRANDMASTERVORPIL)
+ return m_uiGrandmasterVorpil;
- std::string GetSaveData()
- {
- return str_data;
- }
+ return 0;
+ }
- void Load(const char* in)
- {
- if (!in)
+ std::string GetSaveData()
{
- OUT_LOAD_INST_DATA_FAIL;
- return;
+ return str_data;
}
- OUT_LOAD_INST_DATA(in);
+ void Load(const char* in)
+ {
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
- std::istringstream loadStream(in);
- loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4];
+ std::istringstream loadStream(in);
+ loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4];
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS)
- m_auiEncounter[i] = NOT_STARTED;
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS)
+ m_auiEncounter[i] = NOT_STARTED;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+ };
- OUT_LOAD_INST_DATA_COMPLETE;
- }
};
-InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap)
-{
- return new instance_shadow_labyrinth(pMap);
-}
void AddSC_instance_shadow_labyrinth()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_shadow_labyrinth";
- newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth;
- newscript->RegisterSelf();
+ new instance_shadow_labyrinth();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
index bae84641086..d5020064ce8 100644
--- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
@@ -36,36 +36,36 @@ EndContentData */
#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's
#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn"
-
-bool GossipHello_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature)
+ class npc_spirit_of_olum : public CreatureScript
{
- ScriptedInstance* pInstance = pCreature->GetInstanceData();
+public:
+ npc_spirit_of_olum() : CreatureScript("npc_spirit_of_olum") { }
- if (pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE))
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ bool OnGossipSelect(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
+ pPlayer->CLOSE_GOSSIP_MENU();
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- return true;
-}
+ pPlayer->InterruptNonMeleeSpells(false);
+ pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, false);
+ return true;
+ }
-bool GossipSelect_npc_spirit_of_olum(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
- pPlayer->CLOSE_GOSSIP_MENU();
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ InstanceScript* pInstance = pCreature->GetInstanceScript();
+
+ if (pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE))
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
+ }
+
+};
- pPlayer->InterruptNonMeleeSpells(false);
- pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, false);
- return true;
-}
void AddSC_black_temple()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "npc_spirit_of_olum";
- newscript->pGossipHello = &GossipHello_npc_spirit_of_olum;
- newscript->pGossipSelect = &GossipSelect_npc_spirit_of_olum;
- newscript->RegisterSelf();
+ new npc_spirit_of_olum();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
index b7fee842206..ad52ca56a70 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
@@ -54,281 +54,283 @@ EndScriptData */
#define SPELL_BERSERK 45078
//This is used to sort the players by distance in preparation for the Bloodboil cast.
-
-struct boss_gurtogg_bloodboilAI : public ScriptedAI
+ class boss_gurtogg_bloodboil : public CreatureScript
{
- boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_gurtogg_bloodboil() : CreatureScript("boss_gurtogg_bloodboil") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new boss_gurtogg_bloodboilAI (pCreature);
}
- ScriptedInstance* pInstance;
-
- uint64 TargetGUID;
-
- float TargetThreat;
-
- uint32 BloodboilTimer;
- uint32 BloodboilCount;
- uint32 AcidGeyserTimer;
- uint32 AcidicWoundTimer;
- uint32 ArcingSmashTimer;
- uint32 EnrageTimer;
- uint32 FelAcidTimer;
- uint32 EjectTimer;
- uint32 BewilderingStrikeTimer;
- uint32 PhaseChangeTimer;
-
- bool Phase1;
-
- void Reset()
+ struct boss_gurtogg_bloodboilAI : public ScriptedAI
{
- if (pInstance)
- pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED);
+ boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- TargetGUID = 0;
+ InstanceScript* pInstance;
- TargetThreat = 0;
+ uint64 TargetGUID;
- BloodboilTimer = 10000;
- BloodboilCount = 0;
- AcidGeyserTimer = 1000;
- AcidicWoundTimer = 6000;
- ArcingSmashTimer = 19000;
- EnrageTimer = 600000;
- FelAcidTimer = 25000;
- EjectTimer = 10000;
- BewilderingStrikeTimer = 15000;
- PhaseChangeTimer = 60000;
+ float TargetThreat;
- Phase1 = true;
+ uint32 BloodboilTimer;
+ uint32 BloodboilCount;
+ uint32 AcidGeyserTimer;
+ uint32 AcidicWoundTimer;
+ uint32 ArcingSmashTimer;
+ uint32 EnrageTimer;
+ uint32 FelAcidTimer;
+ uint32 EjectTimer;
+ uint32 BewilderingStrikeTimer;
+ uint32 PhaseChangeTimer;
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
- me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
- }
+ bool Phase1;
- void EnterCombat(Unit * /*who*/)
- {
- DoZoneInCombat();
- DoScriptText(SAY_AGGRO, me);
- if (pInstance)
- pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS);
- }
+ void Reset()
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED);
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
- }
+ TargetGUID = 0;
- void JustDied(Unit * /*victim*/)
- {
- if (pInstance)
- pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE);
+ TargetThreat = 0;
- DoScriptText(SAY_DEATH, me);
- }
+ BloodboilTimer = 10000;
+ BloodboilCount = 0;
+ AcidGeyserTimer = 1000;
+ AcidicWoundTimer = 6000;
+ ArcingSmashTimer = 19000;
+ EnrageTimer = 600000;
+ FelAcidTimer = 25000;
+ EjectTimer = 10000;
+ BewilderingStrikeTimer = 15000;
+ PhaseChangeTimer = 60000;
- // Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited.
- void CastBloodboil()
- {
- // Get the Threat List
- std::list<HostileReference *> m_threatlist = me->getThreatManager().getThreatList();
+ Phase1 = true;
- if (!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue
- return;
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
+ }
- std::list<Unit *> targets;
- std::list<HostileReference *>::const_iterator itr = m_threatlist.begin();
- for (; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
+ void EnterCombat(Unit * /*who*/)
{
- Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
- //only on alive players
- if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
- targets.push_back(pTarget);
+ DoZoneInCombat();
+ DoScriptText(SAY_AGGRO, me);
+ if (pInstance)
+ pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS);
}
- //Sort the list of players
- targets.sort(Trinity::ObjectDistanceOrderPred(me, false));
- //Resize so we only get top 5
- targets.resize(5);
+ void KilledUnit(Unit * /*victim*/)
+ {
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
+ }
- //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp
- /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(SPELL_BLOODBOIL);
- if (spellInfo)
+ void JustDied(Unit * /*victim*/)
{
- for (std::list<Unit *>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
- {
- Unit *pTarget = *itr;
- if (!pTarget) return;
- for (uint32 i = 0; i<3; ++i)
- {
- uint8 eff = spellInfo->Effect[i];
- if (eff >= TOTAL_SPELL_EFFECTS)
- continue;
+ if (pInstance)
+ pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE);
- Aura *Aur = new Aura(spellInfo, i, pTarget, pTarget, pTarget);
- pTarget->AddAura(Aur);
- }
- }
- }*/
- }
+ DoScriptText(SAY_DEATH, me);
+ }
- void RevertThreatOnTarget(uint64 guid)
- {
- Unit* pUnit = NULL;
- pUnit = Unit::GetUnit((*me), guid);
- if (pUnit)
+ // Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited.
+ void CastBloodboil()
{
- if (DoGetThreat(pUnit))
- DoModifyThreatPercent(pUnit, -100);
- if (TargetThreat)
- me->AddThreat(pUnit, TargetThreat);
- }
- }
+ // Get the Threat List
+ std::list<HostileReference *> m_threatlist = me->getThreatManager().getThreatList();
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ if (!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue
+ return;
- if (ArcingSmashTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_ARCING_SMASH);
- ArcingSmashTimer = 10000;
- } else ArcingSmashTimer -= diff;
+ std::list<Unit *> targets;
+ std::list<HostileReference *>::const_iterator itr = m_threatlist.begin();
+ for (; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
+ {
+ Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
+ //only on alive players
+ if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
+ targets.push_back(pTarget);
+ }
- if (FelAcidTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_FEL_ACID);
- FelAcidTimer = 25000;
- } else FelAcidTimer -= diff;
+ //Sort the list of players
+ targets.sort(Trinity::ObjectDistanceOrderPred(me, false));
+ //Resize so we only get top 5
+ targets.resize(5);
- if (!me->HasAura(SPELL_BERSERK))
- {
- if (EnrageTimer <= diff)
+ //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp
+ /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(SPELL_BLOODBOIL);
+ if (spellInfo)
{
- DoCast(me, SPELL_BERSERK);
- DoScriptText(RAND(SAY_ENRAGE1,SAY_ENRAGE2), me);
- } else EnrageTimer -= diff;
+ for (std::list<Unit *>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
+ {
+ Unit *pTarget = *itr;
+ if (!pTarget) return;
+ for (uint32 i = 0; i<3; ++i)
+ {
+ uint8 eff = spellInfo->Effect[i];
+ if (eff >= TOTAL_SPELL_EFFECTS)
+ continue;
+
+ Aura *Aur = new Aura(spellInfo, i, pTarget, pTarget, pTarget);
+ pTarget->AddAura(Aur);
+ }
+ }
+ }*/
}
- if (Phase1)
+ void RevertThreatOnTarget(uint64 guid)
{
- if (BewilderingStrikeTimer <= diff)
+ Unit* pUnit = NULL;
+ pUnit = Unit::GetUnit((*me), guid);
+ if (pUnit)
{
- DoCast(me->getVictim(), SPELL_BEWILDERING_STRIKE);
- float mt_threat = DoGetThreat(me->getVictim());
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1))
- me->AddThreat(pTarget, mt_threat);
- BewilderingStrikeTimer = 20000;
- } else BewilderingStrikeTimer -= diff;
-
- if (EjectTimer <= diff)
+ if (DoGetThreat(pUnit))
+ DoModifyThreatPercent(pUnit, -100);
+ if (TargetThreat)
+ me->AddThreat(pUnit, TargetThreat);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (ArcingSmashTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_EJECT1);
- DoModifyThreatPercent(me->getVictim(), -40);
- EjectTimer = 15000;
- } else EjectTimer -= diff;
+ DoCast(me->getVictim(), SPELL_ARCING_SMASH);
+ ArcingSmashTimer = 10000;
+ } else ArcingSmashTimer -= diff;
- if (AcidicWoundTimer <= diff)
+ if (FelAcidTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_ACIDIC_WOUND);
- AcidicWoundTimer = 10000;
- } else AcidicWoundTimer -= diff;
+ DoCast(me->getVictim(), SPELL_FEL_ACID);
+ FelAcidTimer = 25000;
+ } else FelAcidTimer -= diff;
- if (BloodboilTimer <= diff)
+ if (!me->HasAura(SPELL_BERSERK))
{
- if (BloodboilCount < 5) // Only cast it five times.
+ if (EnrageTimer <= diff)
{
- //CastBloodboil(); // Causes issues on windows, so is commented out.
- DoCast(me->getVictim(), SPELL_BLOODBOIL);
- ++BloodboilCount;
- BloodboilTimer = 10000*BloodboilCount;
- }
- } else BloodboilTimer -= diff;
- }
+ DoCast(me, SPELL_BERSERK);
+ DoScriptText(RAND(SAY_ENRAGE1,SAY_ENRAGE2), me);
+ } else EnrageTimer -= diff;
+ }
- if (!Phase1)
- {
- if (AcidGeyserTimer <= diff)
+ if (Phase1)
{
- DoCast(me->getVictim(), SPELL_ACID_GEYSER);
- AcidGeyserTimer = 30000;
- } else AcidGeyserTimer -= diff;
+ if (BewilderingStrikeTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_BEWILDERING_STRIKE);
+ float mt_threat = DoGetThreat(me->getVictim());
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1))
+ me->AddThreat(pTarget, mt_threat);
+ BewilderingStrikeTimer = 20000;
+ } else BewilderingStrikeTimer -= diff;
+
+ if (EjectTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_EJECT1);
+ DoModifyThreatPercent(me->getVictim(), -40);
+ EjectTimer = 15000;
+ } else EjectTimer -= diff;
+
+ if (AcidicWoundTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ACIDIC_WOUND);
+ AcidicWoundTimer = 10000;
+ } else AcidicWoundTimer -= diff;
+
+ if (BloodboilTimer <= diff)
+ {
+ if (BloodboilCount < 5) // Only cast it five times.
+ {
+ //CastBloodboil(); // Causes issues on windows, so is commented out.
+ DoCast(me->getVictim(), SPELL_BLOODBOIL);
+ ++BloodboilCount;
+ BloodboilTimer = 10000*BloodboilCount;
+ }
+ } else BloodboilTimer -= diff;
+ }
- if (EjectTimer <= diff)
+ if (!Phase1)
{
- DoCast(me->getVictim(), SPELL_EJECT2);
- EjectTimer = 15000;
- } else EjectTimer -= diff;
- }
+ if (AcidGeyserTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ACID_GEYSER);
+ AcidGeyserTimer = 30000;
+ } else AcidGeyserTimer -= diff;
- if (PhaseChangeTimer <= diff)
- {
- if (Phase1)
+ if (EjectTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_EJECT2);
+ EjectTimer = 15000;
+ } else EjectTimer -= diff;
+ }
+
+ if (PhaseChangeTimer <= diff)
{
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget && pTarget->isAlive())
+ if (Phase1)
{
- Phase1 = false;
-
- TargetThreat = DoGetThreat(pTarget);
- TargetGUID = pTarget->GetGUID();
- pTarget->CastSpell(me, SPELL_TAUNT_GURTOGG, true);
- if (DoGetThreat(pTarget))
- DoModifyThreatPercent(pTarget, -100);
- me->AddThreat(pTarget, 50000000.0f);
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- // If VMaps are disabled, this spell can call the whole instance
- DoCast(me, SPELL_INSIGNIFIGANCE, true);
- DoCast(pTarget, SPELL_FEL_RAGE_TARGET, true);
- DoCast(pTarget, SPELL_FEL_RAGE_2, true);
- /* These spells do not work, comment them out for now.
- DoCast(pTarget, SPELL_FEL_RAGE_2, true);
- DoCast(pTarget, SPELL_FEL_RAGE_3, true);*/
-
- //Cast this without triggered so that it appears in combat logs and shows visual.
- DoCast(me, SPELL_FEL_RAGE_SELF);
-
- DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), me);
-
- AcidGeyserTimer = 1000;
- PhaseChangeTimer = 30000;
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget && pTarget->isAlive())
+ {
+ Phase1 = false;
+
+ TargetThreat = DoGetThreat(pTarget);
+ TargetGUID = pTarget->GetGUID();
+ pTarget->CastSpell(me, SPELL_TAUNT_GURTOGG, true);
+ if (DoGetThreat(pTarget))
+ DoModifyThreatPercent(pTarget, -100);
+ me->AddThreat(pTarget, 50000000.0f);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ // If VMaps are disabled, this spell can call the whole instance
+ DoCast(me, SPELL_INSIGNIFIGANCE, true);
+ DoCast(pTarget, SPELL_FEL_RAGE_TARGET, true);
+ DoCast(pTarget, SPELL_FEL_RAGE_2, true);
+ /* These spells do not work, comment them out for now.
+ DoCast(pTarget, SPELL_FEL_RAGE_2, true);
+ DoCast(pTarget, SPELL_FEL_RAGE_3, true);*/
+
+ //Cast this without triggered so that it appears in combat logs and shows visual.
+ DoCast(me, SPELL_FEL_RAGE_SELF);
+
+ DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), me);
+
+ AcidGeyserTimer = 1000;
+ PhaseChangeTimer = 30000;
+ }
+ } else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage
+ {
+ if (TargetGUID)
+ RevertThreatOnTarget(TargetGUID);
+ TargetGUID = 0;
+ Phase1 = true;
+ BloodboilTimer = 10000;
+ BloodboilCount = 0;
+ AcidicWoundTimer += 2000;
+ ArcingSmashTimer += 2000;
+ FelAcidTimer += 2000;
+ EjectTimer += 2000;
+ PhaseChangeTimer = 60000;
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
}
- } else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage
- {
- if (TargetGUID)
- RevertThreatOnTarget(TargetGUID);
- TargetGUID = 0;
- Phase1 = true;
- BloodboilTimer = 10000;
- BloodboilCount = 0;
- AcidicWoundTimer += 2000;
- ArcingSmashTimer += 2000;
- FelAcidTimer += 2000;
- EjectTimer += 2000;
- PhaseChangeTimer = 60000;
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
- me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
- }
- } else PhaseChangeTimer -= diff;
+ } else PhaseChangeTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature* pCreature)
-{
- return new boss_gurtogg_bloodboilAI (pCreature);
-}
void AddSC_boss_gurtogg_bloodboil()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_gurtogg_bloodboil";
- newscript->GetAI = &GetAI_boss_gurtogg_bloodboil;
- newscript->RegisterSelf();
+ new boss_gurtogg_bloodboil();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index 7b464639026..3ce2571de4d 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -363,1464 +363,1464 @@ static Animation DemonTransformation[]=
#define EMOTE_SETS_GAZE_ON "sets its gaze on $N!"
#define EMOTE_UNABLE_TO_SUMMON "is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter."
-
-/************************************** Illidan's AI ***************************************/
-struct boss_illidan_stormrageAI : public ScriptedAI
+ class mob_flame_of_azzinoth : public CreatureScript
{
- boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(me)
- {
- pInstance = c->GetInstanceData();
- DoCast(me, SPELL_DUAL_WIELD, true);
+public:
+ mob_flame_of_azzinoth() : CreatureScript("mob_flame_of_azzinoth") { }
- SpellEntry *TempSpell = GET_SPELL(SPELL_SHADOWFIEND_PASSIVE);
- if (TempSpell)
- TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new flame_of_azzinothAI (pCreature);
}
- ScriptedInstance* pInstance;
-
- PhaseIllidan Phase;
- EventIllidan Event;
- uint32 Timer[EVENT_ENRAGE + 1];
-
- uint32 TalkCount;
- uint32 TransformCount;
- uint32 FlightCount;
-
- uint32 HoverPoint;
-
- uint64 AkamaGUID;
- uint64 MaievGUID;
- uint64 FlameGUID[2];
- uint64 GlaiveGUID[2];
+ struct flame_of_azzinothAI : public ScriptedAI
+ {
+ flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {}
- SummonList Summons;
+ uint32 FlameBlastTimer;
+ uint32 CheckTimer;
+ uint64 GlaiveGUID;
- void Reset();
+ void Reset()
+ {
+ FlameBlastTimer = 15000;
+ CheckTimer = 5000;
+ GlaiveGUID = 0;
+ }
- void JustSummoned(Creature* summon);
+ void EnterCombat(Unit * /*who*/) {DoZoneInCombat();}
- void SummonedCreatureDespawn(Creature* summon)
- {
- if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH)
+ void ChargeCheck()
{
- for (uint8 i = 0; i < 2; ++i)
- if (summon->GetGUID() == FlameGUID[i])
- FlameGUID[i] = 0;
-
- if (!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_ILLIDAN_NULL)
+ Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false);
+ if (pTarget && (!me->IsWithinCombatRange(pTarget, FLAME_CHARGE_DISTANCE)))
{
- me->InterruptNonMeleeSpells(true);
- EnterPhase(PHASE_FLIGHT_SEQUENCE);
+ me->AddThreat(pTarget, 5000000.0f);
+ AttackStart(pTarget);
+ DoCast(pTarget, SPELL_CHARGE);
+ me->MonsterTextEmote(EMOTE_SETS_GAZE_ON, pTarget->GetGUID());
}
}
- Summons.Despawn(summon);
- }
- void MovementInform(uint32 /*MovementType*/, uint32 /*Data*/)
- {
- if (FlightCount == 7) //change hover point
+ void EnrageCheck()
{
- if (me->getVictim())
+ if (GETUNIT(Glaive, GlaiveGUID))
{
- me->SetInFront(me->getVictim());
- me->StopMoving();
+ if (!me->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE))
+ {
+ Glaive->InterruptNonMeleeSpells(true);
+ DoCast(me, SPELL_FLAME_ENRAGE, true);
+ DoResetThreat();
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget && pTarget->isAlive())
+ {
+ me->AddThreat(me->getVictim(), 5000000.0f);
+ AttackStart(me->getVictim());
+ }
+ }
+ else if (!me->HasAura(SPELL_AZZINOTH_CHANNEL))
+ {
+ Glaive->CastSpell(me, SPELL_AZZINOTH_CHANNEL, false);
+ me->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE);
+ }
}
- EnterPhase(PHASE_FLIGHT);
}
- else // handle flight sequence
- Timer[EVENT_FLIGHT_SEQUENCE] = 1000;
- }
- void EnterCombat(Unit * /*who*/)
- {
- me->setActive(true);
- DoZoneInCombat();
- }
-
- void AttackStart(Unit *who)
- {
- if (!who || Phase >= PHASE_TALK_SEQUENCE)
- return;
-
- if (Phase == PHASE_FLIGHT || Phase == PHASE_DEMON)
- AttackStartNoMove(who);
- else
- ScriptedAI::AttackStart(who);
- }
+ void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; }
- void MoveInLineOfSight(Unit *) {}
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
- void JustDied(Unit * /*killer*/)
- {
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ if (FlameBlastTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim
+ DoCast(me->getVictim(), SPELL_FLAME_BLAST);
+ FlameBlastTimer = 15000; //10000 is official-like?
+ DoZoneInCombat(); //in case someone is revived
+ } else FlameBlastTimer -= diff;
- if (!pInstance)
- return;
+ if (CheckTimer <= diff)
+ {
+ ChargeCheck();
+ EnrageCheck();
+ CheckTimer = 1000;
+ } else CheckTimer -= diff;
- pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, DONE); // Completed
+ DoMeleeAttackIfReady();
+ }
+ };
- for (uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i)
- pInstance->HandleGameObject(pInstance->GetData64(i), true);
- }
+};
- void KilledUnit(Unit * victim)
- {
- if (victim == me) return;
- // TODO: Find better way to handle emote
- switch (urand(0,1))
- {
- case 0:
- me->MonsterYell(SAY_KILL1, LANG_UNIVERSAL, victim->GetGUID());
- DoPlaySoundToSet(me, SOUND_KILL1);
- break;
- case 1:
- me->MonsterYell(SAY_KILL2, LANG_UNIVERSAL, victim->GetGUID());
- DoPlaySoundToSet(me, SOUND_KILL2);
- break;
- }
- }
+/************************************** Illidan's AI ***************************************/ class boss_illidan_stormrage : public CreatureScript
+{
+public:
+ boss_illidan_stormrage() : CreatureScript("boss_illidan_stormrage") { }
- void DamageTaken(Unit *done_by, uint32 &damage)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (damage >= me->GetHealth() && done_by != me)
- damage = 0;
- if (done_by->GetGUID() == MaievGUID)
- done_by->AddThreat(me, -(3*(float)damage)/4); // do not let maiev tank him
+ return new boss_illidan_stormrageAI (pCreature);
}
- void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
+ struct boss_illidan_stormrageAI : public ScriptedAI
{
- if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades!
+ boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(me)
{
- if (!me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID))
- SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
- else
- SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE);
- me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
- }
- }
+ pInstance = c->GetInstanceScript();
+ DoCast(me, SPELL_DUAL_WIELD, true);
- void DeleteFromThreatList(uint64 TargetGUID)
- {
- for (std::list<HostileReference*>::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr)
- {
- if ((*itr)->getUnitGuid() == TargetGUID)
- {
- (*itr)->removeReference();
- break;
- }
+ SpellEntry *TempSpell = GET_SPELL(SPELL_SHADOWFIEND_PASSIVE);
+ if (TempSpell)
+ TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends
}
- }
- void Talk(uint32 count)
- {
- Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer;
+ InstanceScript* pInstance;
- Creature* pCreature = NULL;
- if (Conversation[count].pCreature == ILLIDAN_STORMRAGE)
- pCreature = me;
- else if (Conversation[count].pCreature == AKAMA)
- pCreature = (Unit::GetCreature((*me), AkamaGUID));
- else if (Conversation[count].pCreature == MAIEV_SHADOWSONG)
- pCreature = (Unit::GetCreature((*me), MaievGUID));
+ PhaseIllidan Phase;
+ EventIllidan Event;
+ uint32 Timer[EVENT_ENRAGE + 1];
- if (pCreature)
- {
- if (Conversation[count].emote)
- pCreature->HandleEmoteCommand(Conversation[count].emote); // Make the Creature do some animation!
- if (Conversation[count].text)
- pCreature->MonsterYell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the Creature yell out some text
- if (Conversation[count].sound)
- DoPlaySoundToSet(pCreature, Conversation[count].sound); // Play some sound on the creature
- }
- }
+ uint32 TalkCount;
+ uint32 TransformCount;
+ uint32 FlightCount;
- void EnterPhase(PhaseIllidan NextPhase);
- void CastEyeBlast();
- void SummonFlamesOfAzzinoth();
- void SummonMaiev();
- void HandleTalkSequence();
- void HandleFlightSequence()
- {
- switch(FlightCount)
- {
- case 1://lift off
- me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- me->StopMoving();
- me->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(me, SOUND_TAKEOFF);
- Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
- break;
- case 2://move to center
- me->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 3://throw one glaive
- {
- uint8 i=1;
- Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (Glaive)
- {
- GlaiveGUID[i] = Glaive->GetGUID();
- Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Glaive->SetDisplayId(11686);
- Glaive->setFaction(me->getFaction());
- DoCast(Glaive, SPELL_THROW_GLAIVE2);
- }
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 700;
- break;
- case 4://throw another
- SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
- {
- uint8 i=0;
- Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (Glaive)
- {
- GlaiveGUID[i] = Glaive->GetGUID();
- Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Glaive->SetDisplayId(11686);
- Glaive->setFaction(me->getFaction());
- DoCast(Glaive, SPELL_THROW_GLAIVE, true);
- }
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 5000;
- break;
- case 5://summon flames
- SummonFlamesOfAzzinoth();
- Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
- break;
- case 6://fly to hover point
- me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 7://return to center
- me->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 8://glaive return
- for (uint8 i = 0; i < 2; ++i)
+ uint32 HoverPoint;
+
+ uint64 AkamaGUID;
+ uint64 MaievGUID;
+ uint64 FlameGUID[2];
+ uint64 GlaiveGUID[2];
+
+ SummonList Summons;
+
+ void Reset();
+
+ void JustSummoned(Creature* summon);
+
+ void SummonedCreatureDespawn(Creature* summon)
+ {
+ if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH)
{
- if (GlaiveGUID[i])
+ for (uint8 i = 0; i < 2; ++i)
+ if (summon->GetGUID() == FlameGUID[i])
+ FlameGUID[i] = 0;
+
+ if (!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_ILLIDAN_NULL)
{
- Unit* Glaive = Unit::GetUnit((*me), GlaiveGUID[i]);
- if (Glaive)
- {
- Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us
- Glaive->SetDisplayId(11686); // disappear but not die for now
- }
+ me->InterruptNonMeleeSpells(true);
+ EnterPhase(PHASE_FLIGHT_SEQUENCE);
}
}
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- break;
- case 9://land
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- me->StopMoving();
- me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
- for (uint8 i = 0; i < 2; ++i)
+ Summons.Despawn(summon);
+ }
+
+ void MovementInform(uint32 /*MovementType*/, uint32 /*Data*/)
+ {
+ if (FlightCount == 7) //change hover point
{
- if (GlaiveGUID[i])
+ if (me->getVictim())
{
- if (GETUNIT(Glaive, GlaiveGUID[i]))
- {
- Glaive->SetVisibility(VISIBILITY_OFF);
- Glaive->setDeathState(JUST_DIED); // Despawn the Glaive
- }
- GlaiveGUID[i] = 0;
+ me->SetInFront(me->getVictim());
+ me->StopMoving();
}
+ EnterPhase(PHASE_FLIGHT);
}
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- break;
- case 10://attack
- DoResetThreat();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
- EnterPhase(PHASE_NORMAL_2);
- break;
- default:
- break;
+ else // handle flight sequence
+ Timer[EVENT_FLIGHT_SEQUENCE] = 1000;
}
- ++FlightCount;
- }
- void HandleTransformSequence()
- {
- if (DemonTransformation[TransformCount].unaura)
- me->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura);
+ void EnterCombat(Unit * /*who*/)
+ {
+ me->setActive(true);
+ DoZoneInCombat();
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if (!who || Phase >= PHASE_TALK_SEQUENCE)
+ return;
- if (DemonTransformation[TransformCount].aura)
- DoCast(me, DemonTransformation[TransformCount].aura, true);
+ if (Phase == PHASE_FLIGHT || Phase == PHASE_DEMON)
+ AttackStartNoMove(who);
+ else
+ ScriptedAI::AttackStart(who);
+ }
- if (DemonTransformation[TransformCount].displayid)
- me->SetDisplayId(DemonTransformation[TransformCount].displayid); // It's morphin time!
+ void MoveInLineOfSight(Unit *) {}
- if (DemonTransformation[TransformCount].equip)
+ void JustDied(Unit * /*killer*/)
{
- // Requip warglaives if needed
- SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE);
- me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ if (!pInstance)
+ return;
+
+ pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, DONE); // Completed
+
+ for (uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i)
+ pInstance->HandleGameObject(pInstance->GetData64(i), true);
}
- else
+
+ void KilledUnit(Unit * victim)
{
- // Unequip warglaives if needed
- SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
+ if (victim == me) return;
+ // TODO: Find better way to handle emote
+ switch (urand(0,1))
+ {
+ case 0:
+ me->MonsterYell(SAY_KILL1, LANG_UNIVERSAL, victim->GetGUID());
+ DoPlaySoundToSet(me, SOUND_KILL1);
+ break;
+ case 1:
+ me->MonsterYell(SAY_KILL2, LANG_UNIVERSAL, victim->GetGUID());
+ DoPlaySoundToSet(me, SOUND_KILL2);
+ break;
+ }
}
- switch(TransformCount)
+ void DamageTaken(Unit *done_by, uint32 &damage)
{
- case 2:
- DoResetThreat();
- break;
- case 4:
- EnterPhase(PHASE_DEMON);
- break;
- case 7:
- DoResetThreat();
- break;
- case 9:
- if (MaievGUID)
- EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3
- else
- EnterPhase(PHASE_NORMAL_2);
- break;
- default:
- break;
+ if (damage >= me->GetHealth() && done_by != me)
+ damage = 0;
+ if (done_by->GetGUID() == MaievGUID)
+ done_by->AddThreat(me, -(3*(float)damage)/4); // do not let maiev tank him
}
- if (Phase == PHASE_TRANSFORM_SEQUENCE)
- Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer;
- ++TransformCount;
- }
- void UpdateAI(const uint32 diff)
- {
- if ((!UpdateVictim()) && Phase < PHASE_TALK_SEQUENCE)
- return;
+ void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
+ {
+ if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades!
+ {
+ if (!me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID))
+ SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
+ else
+ SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ }
+ }
- Event = EVENT_NULL;
- for (uint32 i = 1; i <= MaxTimer[Phase]; ++i)
+ void DeleteFromThreatList(uint64 TargetGUID)
{
- if (Timer[i]) // Event is enabled
- if (Timer[i] <= diff)
+ for (std::list<HostileReference*>::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr)
+ {
+ if ((*itr)->getUnitGuid() == TargetGUID)
{
- if (!Event) // No event with higher priority
- Event = (EventIllidan)i;
+ (*itr)->removeReference();
+ break;
}
- else Timer[i] -= diff;
+ }
}
- switch(Phase)
+ void Talk(uint32 count)
{
- case PHASE_NORMAL:
- if (HPPCT(me) < 65)
- EnterPhase(PHASE_FLIGHT_SEQUENCE);
- break;
+ Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer;
- case PHASE_NORMAL_2:
- if (HPPCT(me) < 30)
- EnterPhase(PHASE_TALK_SEQUENCE);
- break;
+ Creature* pCreature = NULL;
+ if (Conversation[count].pCreature == ILLIDAN_STORMRAGE)
+ pCreature = me;
+ else if (Conversation[count].pCreature == AKAMA)
+ pCreature = (Unit::GetCreature((*me), AkamaGUID));
+ else if (Conversation[count].pCreature == MAIEV_SHADOWSONG)
+ pCreature = (Unit::GetCreature((*me), MaievGUID));
- case PHASE_NORMAL_MAIEV:
- if (HPPCT(me) < 1)
- EnterPhase(PHASE_TALK_SEQUENCE);
- break;
-
- case PHASE_TALK_SEQUENCE:
- if (Event == EVENT_TALK_SEQUENCE)
- HandleTalkSequence();
- break;
-
- case PHASE_FLIGHT_SEQUENCE:
- if (Event == EVENT_FLIGHT_SEQUENCE)
- HandleFlightSequence();
- break;
-
- case PHASE_TRANSFORM_SEQUENCE:
- if (Event == EVENT_TRANSFORM_SEQUENCE)
- HandleTransformSequence();
- break;
+ if (pCreature)
+ {
+ if (Conversation[count].emote)
+ pCreature->HandleEmoteCommand(Conversation[count].emote); // Make the Creature do some animation!
+ if (Conversation[count].text)
+ pCreature->MonsterYell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the Creature yell out some text
+ if (Conversation[count].sound)
+ DoPlaySoundToSet(pCreature, Conversation[count].sound); // Play some sound on the creature
+ }
}
- if (me->IsNonMeleeSpellCasted(false))
- return;
-
- if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !me->HasAura(SPELL_CAGED))
+ void EnterPhase(PhaseIllidan NextPhase)
{
- switch(Event)
+ DoZoneInCombat();
+ switch(NextPhase)
{
- //PHASE_NORMAL
- case EVENT_BERSERK:
- me->MonsterYell(SAY_ENRAGE, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(me, SOUND_ENRAGE);
- DoCast(me, SPELL_BERSERK, true);
- Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever.
+ case PHASE_NORMAL:
+ case PHASE_NORMAL_2:
+ case PHASE_NORMAL_MAIEV:
+ AttackStart(me->getVictim());
+ Timer[EVENT_TAUNT] = 32000;
+ Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000;
+ Timer[EVENT_FLAME_CRASH] = 20000;
+ Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000;
+ Timer[EVENT_PARASITE_CHECK] = 0;
+ Timer[EVENT_DRAW_SOUL] = 30000;
+ if (NextPhase == PHASE_NORMAL)
+ break;
+ Timer[EVENT_AGONIZING_FLAMES] = 35000;
+ Timer[EVENT_TRANSFORM_NORMAL] = 60000;
+ if (NextPhase == PHASE_NORMAL_2)
+ break;
+ Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000;
break;
-
- case EVENT_TAUNT:
- {
- uint32 random = rand()%4;
- char* yell = RandomTaunts[random].text;
- uint32 soundid = RandomTaunts[random].sound;
- if (yell)
- me->MonsterYell(yell, LANG_UNIVERSAL, 0);
- if (soundid)
- DoPlaySoundToSet(me, soundid);
- }
- Timer[EVENT_TAUNT] = 25000 + rand()%10000;
+ case PHASE_FLIGHT:
+ Timer[EVENT_FIREBALL] = 1000;
+ if (!(rand()%4))
+ Timer[EVENT_DARK_BARRAGE] = 10000;
+ Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000;
+ Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000;
break;
-
- case EVENT_SHEAR:
- // no longer exists in 3.0.2
- //DoCast(me->getVictim(), SPELL_SHEAR);
- Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000);
+ case PHASE_DEMON:
+ Timer[EVENT_SHADOW_BLAST] = 1000;
+ Timer[EVENT_FLAME_BURST] = 10000;
+ Timer[EVENT_SHADOWDEMON] = 30000;
+ Timer[EVENT_TRANSFORM_DEMON] = 60000;
+ AttackStart(me->getVictim());
break;
-
- case EVENT_FLAME_CRASH:
- DoCast(me->getVictim(), SPELL_FLAME_CRASH);
- Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000;
+ case PHASE_TALK_SEQUENCE:
+ Timer[EVENT_TALK_SEQUENCE] = 100;
+ me->RemoveAllAuras();
+ me->InterruptNonMeleeSpells(false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ me->GetMotionMaster()->Clear(false);
+ me->AttackStop();
break;
-
- case EVENT_PARASITIC_SHADOWFIEND:
+ case PHASE_FLIGHT_SEQUENCE:
+ if (Phase == PHASE_NORMAL) //lift off
{
- if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true))
- DoCast(pTarget, SPELL_PARASITIC_SHADOWFIEND, true);
- Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000;
+ FlightCount = 1;
+ Timer[EVENT_FLIGHT_SEQUENCE] = 1;
+ me->RemoveAllAuras();
+ me->InterruptNonMeleeSpells(false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->GetMotionMaster()->Clear(false);
+ me->AttackStop();
}
+ else //land
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
break;
-
- case EVENT_PARASITE_CHECK:
- Timer[EVENT_PARASITE_CHECK] = 0;
- break;
-
- case EVENT_DRAW_SOUL:
- DoCast(me->getVictim(), SPELL_DRAW_SOUL);
- Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000;
- break;
-
- //PHASE_NORMAL_2
- case EVENT_AGONIZING_FLAMES:
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AGONIZING_FLAMES);
- Timer[EVENT_AGONIZING_FLAMES] = 0;
- break;
-
- case EVENT_TRANSFORM_NORMAL:
- EnterPhase(PHASE_TRANSFORM_SEQUENCE);
- break;
-
- //PHASE_NORMAL_MAIEV
- case EVENT_ENRAGE:
- DoCast(me, SPELL_ENRAGE);
- Timer[EVENT_ENRAGE] = 0;
+ case PHASE_TRANSFORM_SEQUENCE:
+ if (Phase == PHASE_DEMON)
+ Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
+ else
+ {
+ TransformCount = 0;
+ Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
+ me->MonsterYell(SAY_MORPH, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_MORPH);
+ }
+ me->GetMotionMaster()->Clear();
+ me->AttackStop();
break;
-
default:
break;
}
- DoMeleeAttackIfReady();
+ if (MaievGUID)
+ {
+ GETCRE(Maiev, MaievGUID);
+ if (Maiev && Maiev->isAlive())
+ Maiev->AI()->DoAction(NextPhase);
+ }
+ Phase = NextPhase;
+ Event = EVENT_NULL;
+ }
+ void CastEyeBlast()
+ {
+ me->InterruptNonMeleeSpells(false);
+
+ me->MonsterYell(SAY_EYE_BLAST, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_EYE_BLAST);
+
+ float distx, disty, dist[2];
+ for (uint8 i = 0; i < 2; ++i)
+ {
+ distx = EyeBlast[i].x - HoverPosition[HoverPoint].x;
+ disty = EyeBlast[i].y - HoverPosition[HoverPoint].y;
+ dist[i] = distx * distx + disty * disty;
+ }
+ Locations initial = EyeBlast[dist[0] < dist[1] ? 0 : 1];
+ for (uint8 i = 0; i < 2; ++i)
+ {
+ distx = GlaivePosition[i].x - HoverPosition[HoverPoint].x;
+ disty = GlaivePosition[i].y - HoverPosition[HoverPoint].y;
+ dist[i] = distx * distx + disty * disty;
+ }
+ Locations final = GlaivePosition[dist[0] < dist[1] ? 0 : 1];
+
+ final.x = 2 * final.x - initial.x;
+ final.y = 2 * final.y - initial.y;
+
+ Creature* Trigger = me->SummonCreature(23069, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000);
+ if (!Trigger) return;
+
+ Trigger->SetSpeed(MOVE_WALK, 3);
+ Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
+
+ //Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID());
+ DoCast(Trigger, SPELL_EYE_BLAST);
}
+ void SummonFlamesOfAzzinoth()
+ {
+ me->MonsterYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_SUMMONFLAMES);
+
+ for (uint8 i = 0; i < 2; ++i)
+ {
+ if (GETUNIT(Glaive, GlaiveGUID[i]))
+ {
+ Creature* Flame = me->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
+ if (Flame)
+ {
+ Flame->setFaction(me->getFaction()); // Just in case the database has it as a different faction
+ Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE);
+ FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase
+ CAST_AI(mob_flame_of_azzinoth::flame_of_azzinothAI, Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]);
+ Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it.
+ }
+ }
+ }
+ }
+ void SummonMaiev()
+ {
+ DoCast(me, SPELL_SHADOW_PRISON, true);
+ DoCast(me, 40403, true);
+ if (!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console.
+ {
+ EnterEvadeMode();
+ me->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, 0);
+ sLog.outError("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)");
+ }
+ }
+
+ void HandleTalkSequence();
- if (Phase == PHASE_FLIGHT)
+ void HandleFlightSequence()
{
- switch(Event)
+ switch(FlightCount)
{
- case EVENT_FIREBALL:
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL);
- Timer[EVENT_FIREBALL] = 3000;
+ case 1://lift off
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ me->StopMoving();
+ me->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_TAKEOFF);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
break;
-
- case EVENT_DARK_BARRAGE:
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE);
- Timer[EVENT_DARK_BARRAGE] = 0;
+ case 2://move to center
+ me->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
break;
-
- case EVENT_EYE_BLAST:
- CastEyeBlast();
- Timer[EVENT_EYE_BLAST] = 0;
+ case 3://throw one glaive
+ {
+ uint8 i=1;
+ Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (Glaive)
+ {
+ GlaiveGUID[i] = Glaive->GetGUID();
+ Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Glaive->SetDisplayId(11686);
+ Glaive->setFaction(me->getFaction());
+ DoCast(Glaive, SPELL_THROW_GLAIVE2);
+ }
+ }
+ Timer[EVENT_FLIGHT_SEQUENCE] = 700;
break;
-
- case EVENT_MOVE_POINT:
- Phase = PHASE_FLIGHT_SEQUENCE;
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;//do not start Event when changing hover point
- HoverPoint += (rand()%3 + 1);
- if (HoverPoint > 3)
- HoverPoint -= 4;
+ case 4://throw another
+ SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
+ {
+ uint8 i=0;
+ Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (Glaive)
+ {
+ GlaiveGUID[i] = Glaive->GetGUID();
+ Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Glaive->SetDisplayId(11686);
+ Glaive->setFaction(me->getFaction());
+ DoCast(Glaive, SPELL_THROW_GLAIVE, true);
+ }
+ }
+ Timer[EVENT_FLIGHT_SEQUENCE] = 5000;
+ break;
+ case 5://summon flames
+ SummonFlamesOfAzzinoth();
+ Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
+ break;
+ case 6://fly to hover point
me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 7://return to center
+ me->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 8://glaive return
+ for (uint8 i = 0; i < 2; ++i)
+ {
+ if (GlaiveGUID[i])
+ {
+ Unit* Glaive = Unit::GetUnit((*me), GlaiveGUID[i]);
+ if (Glaive)
+ {
+ Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us
+ Glaive->SetDisplayId(11686); // disappear but not die for now
+ }
+ }
+ }
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
+ break;
+ case 9://land
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->StopMoving();
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ for (uint8 i = 0; i < 2; ++i)
+ {
+ if (GlaiveGUID[i])
+ {
+ if (GETUNIT(Glaive, GlaiveGUID[i]))
+ {
+ Glaive->SetVisibility(VISIBILITY_OFF);
+ Glaive->setDeathState(JUST_DIED); // Despawn the Glaive
+ }
+ GlaiveGUID[i] = 0;
+ }
+ }
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
+ break;
+ case 10://attack
+ DoResetThreat();
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ EnterPhase(PHASE_NORMAL_2);
break;
-
default:
break;
}
+ ++FlightCount;
}
- if (Phase == PHASE_DEMON)
+ void HandleTransformSequence()
{
- switch(Event)
+ if (DemonTransformation[TransformCount].unaura)
+ me->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura);
+
+ if (DemonTransformation[TransformCount].aura)
+ DoCast(me, DemonTransformation[TransformCount].aura, true);
+
+ if (DemonTransformation[TransformCount].displayid)
+ me->SetDisplayId(DemonTransformation[TransformCount].displayid); // It's morphin time!
+
+ if (DemonTransformation[TransformCount].equip)
{
- case EVENT_SHADOW_BLAST:
- me->GetMotionMaster()->Clear(false);
- if (!me->IsWithinDistInMap(me->getVictim(), 50)||!me->IsWithinLOSInMap(me->getVictim()))
- me->GetMotionMaster()->MoveChase(me->getVictim(), 30);
- else
- me->GetMotionMaster()->MoveIdle();
- DoCast(me->getVictim(), SPELL_SHADOW_BLAST);
- Timer[EVENT_SHADOW_BLAST] = 4000;
+ // Requip warglaives if needed
+ SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ }
+ else
+ {
+ // Unequip warglaives if needed
+ SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
+ }
+
+ switch(TransformCount)
+ {
+ case 2:
+ DoResetThreat();
break;
- case EVENT_SHADOWDEMON:
- DoCast(me, SPELL_SUMMON_SHADOWDEMON);
- Timer[EVENT_SHADOWDEMON] = 0;
- Timer[EVENT_FLAME_BURST] += 10000;
+ case 4:
+ EnterPhase(PHASE_DEMON);
break;
- case EVENT_FLAME_BURST:
- DoCast(me, SPELL_FLAME_BURST);
- Timer[EVENT_FLAME_BURST] = 15000;
+ case 7:
+ DoResetThreat();
break;
- case EVENT_TRANSFORM_DEMON:
- EnterPhase(PHASE_TRANSFORM_SEQUENCE);
+ case 9:
+ if (MaievGUID)
+ EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3
+ else
+ EnterPhase(PHASE_NORMAL_2);
break;
default:
break;
}
+ if (Phase == PHASE_TRANSFORM_SEQUENCE)
+ Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer;
+ ++TransformCount;
}
- }
-};
-
-/********************************** End of Illidan AI ******************************************/
-
-struct flame_of_azzinothAI : public ScriptedAI
-{
- flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {}
-
- uint32 FlameBlastTimer;
- uint32 CheckTimer;
- uint64 GlaiveGUID;
-
- void Reset()
- {
- FlameBlastTimer = 15000;
- CheckTimer = 5000;
- GlaiveGUID = 0;
- }
- void EnterCombat(Unit * /*who*/) {DoZoneInCombat();}
-
- void ChargeCheck()
- {
- Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false);
- if (pTarget && (!me->IsWithinCombatRange(pTarget, FLAME_CHARGE_DISTANCE)))
+ void UpdateAI(const uint32 diff)
{
- me->AddThreat(pTarget, 5000000.0f);
- AttackStart(pTarget);
- DoCast(pTarget, SPELL_CHARGE);
- me->MonsterTextEmote(EMOTE_SETS_GAZE_ON, pTarget->GetGUID());
- }
- }
+ if ((!UpdateVictim()) && Phase < PHASE_TALK_SEQUENCE)
+ return;
- void EnrageCheck()
- {
- if (GETUNIT(Glaive, GlaiveGUID))
- {
- if (!me->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE))
- {
- Glaive->InterruptNonMeleeSpells(true);
- DoCast(me, SPELL_FLAME_ENRAGE, true);
- DoResetThreat();
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget && pTarget->isAlive())
- {
- me->AddThreat(me->getVictim(), 5000000.0f);
- AttackStart(me->getVictim());
- }
- }
- else if (!me->HasAura(SPELL_AZZINOTH_CHANNEL))
+ Event = EVENT_NULL;
+ for (uint32 i = 1; i <= MaxTimer[Phase]; ++i)
{
- Glaive->CastSpell(me, SPELL_AZZINOTH_CHANNEL, false);
- me->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE);
+ if (Timer[i]) // Event is enabled
+ if (Timer[i] <= diff)
+ {
+ if (!Event) // No event with higher priority
+ Event = (EventIllidan)i;
+ }
+ else Timer[i] -= diff;
}
- }
- }
- void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; }
+ switch(Phase)
+ {
+ case PHASE_NORMAL:
+ if (HPPCT(me) < 65)
+ EnterPhase(PHASE_FLIGHT_SEQUENCE);
+ break;
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ case PHASE_NORMAL_2:
+ if (HPPCT(me) < 30)
+ EnterPhase(PHASE_TALK_SEQUENCE);
+ break;
- if (FlameBlastTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim
- DoCast(me->getVictim(), SPELL_FLAME_BLAST);
- FlameBlastTimer = 15000; //10000 is official-like?
- DoZoneInCombat(); //in case someone is revived
- } else FlameBlastTimer -= diff;
+ case PHASE_NORMAL_MAIEV:
+ if (HPPCT(me) < 1)
+ EnterPhase(PHASE_TALK_SEQUENCE);
+ break;
- if (CheckTimer <= diff)
- {
- ChargeCheck();
- EnrageCheck();
- CheckTimer = 1000;
- } else CheckTimer -= diff;
+ case PHASE_TALK_SEQUENCE:
+ if (Event == EVENT_TALK_SEQUENCE)
+ HandleTalkSequence();
+ break;
- DoMeleeAttackIfReady();
- }
-};
+ case PHASE_FLIGHT_SEQUENCE:
+ if (Event == EVENT_FLIGHT_SEQUENCE)
+ HandleFlightSequence();
+ break;
-/******* Functions and vars for Akama's AI ******/
-struct npc_akama_illidanAI : public ScriptedAI
-{
- npc_akama_illidanAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- JustCreated = true;
- }
- bool JustCreated;
- ScriptedInstance* pInstance;
+ case PHASE_TRANSFORM_SEQUENCE:
+ if (Event == EVENT_TRANSFORM_SEQUENCE)
+ HandleTransformSequence();
+ break;
+ }
- PhaseAkama Phase;
- bool Event;
- uint32 Timer;
+ if (me->IsNonMeleeSpellCasted(false))
+ return;
- uint64 IllidanGUID;
- uint64 ChannelGUID;
- uint64 SpiritGUID[2];
- uint64 GateGUID;
- uint64 DoorGUID[2];
+ if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !me->HasAura(SPELL_CAGED))
+ {
+ switch(Event)
+ {
+ //PHASE_NORMAL
+ case EVENT_BERSERK:
+ me->MonsterYell(SAY_ENRAGE, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_ENRAGE);
+ DoCast(me, SPELL_BERSERK, true);
+ Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever.
+ break;
+
+ case EVENT_TAUNT:
+ {
+ uint32 random = rand()%4;
+ char* yell = RandomTaunts[random].text;
+ uint32 soundid = RandomTaunts[random].sound;
+ if (yell)
+ me->MonsterYell(yell, LANG_UNIVERSAL, 0);
+ if (soundid)
+ DoPlaySoundToSet(me, soundid);
+ }
+ Timer[EVENT_TAUNT] = 25000 + rand()%10000;
+ break;
- uint32 ChannelCount;
- uint32 WalkCount;
- uint32 TalkCount;
- uint32 Check_Timer;
+ case EVENT_SHEAR:
+ // no longer exists in 3.0.2
+ //DoCast(me->getVictim(), SPELL_SHEAR);
+ Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000);
+ break;
- void Reset()
- {
- WalkCount = 0;
- if (pInstance)
- {
- pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
+ case EVENT_FLAME_CRASH:
+ DoCast(me->getVictim(), SPELL_FLAME_CRASH);
+ Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000;
+ break;
- IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
- GateGUID = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE);
- DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R);
- DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L);
+ case EVENT_PARASITIC_SHADOWFIEND:
+ {
+ if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true))
+ DoCast(pTarget, SPELL_PARASITIC_SHADOWFIEND, true);
+ Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000;
+ }
+ break;
+
+ case EVENT_PARASITE_CHECK:
+ Timer[EVENT_PARASITE_CHECK] = 0;
+ break;
+
+ case EVENT_DRAW_SOUL:
+ DoCast(me->getVictim(), SPELL_DRAW_SOUL);
+ Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000;
+ break;
+
+ //PHASE_NORMAL_2
+ case EVENT_AGONIZING_FLAMES:
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AGONIZING_FLAMES);
+ Timer[EVENT_AGONIZING_FLAMES] = 0;
+ break;
+
+ case EVENT_TRANSFORM_NORMAL:
+ EnterPhase(PHASE_TRANSFORM_SEQUENCE);
+ break;
+
+ //PHASE_NORMAL_MAIEV
+ case EVENT_ENRAGE:
+ DoCast(me, SPELL_ENRAGE);
+ Timer[EVENT_ENRAGE] = 0;
+ break;
+
+ default:
+ break;
+ }
+ DoMeleeAttackIfReady();
+ }
- if (JustCreated)//close all doors at create
+ if (Phase == PHASE_FLIGHT)
{
- pInstance->HandleGameObject(GateGUID, false);
+ switch(Event)
+ {
+ case EVENT_FIREBALL:
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL);
+ Timer[EVENT_FIREBALL] = 3000;
+ break;
+
+ case EVENT_DARK_BARRAGE:
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE);
+ Timer[EVENT_DARK_BARRAGE] = 0;
+ break;
+
+ case EVENT_EYE_BLAST:
+ CastEyeBlast();
+ Timer[EVENT_EYE_BLAST] = 0;
+ break;
+
+ case EVENT_MOVE_POINT:
+ Phase = PHASE_FLIGHT_SEQUENCE;
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;//do not start Event when changing hover point
+ HoverPoint += (rand()%3 + 1);
+ if (HoverPoint > 3)
+ HoverPoint -= 4;
+ me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
+ break;
+
+ default:
+ break;
+ }
+ }
- for (uint8 i = 0; i < 2; ++i)
- pInstance->HandleGameObject(DoorGUID[i], false);
- //JustCreated = false;
- }else
- {//open all doors, raid wiped
- pInstance->HandleGameObject(GateGUID, true);
- WalkCount = 1;//skip first wp
- for (uint8 i = 0; i < 2; ++i)
- pInstance->HandleGameObject(DoorGUID[i], true);
+ if (Phase == PHASE_DEMON)
+ {
+ switch(Event)
+ {
+ case EVENT_SHADOW_BLAST:
+ me->GetMotionMaster()->Clear(false);
+ if (!me->IsWithinDistInMap(me->getVictim(), 50)||!me->IsWithinLOSInMap(me->getVictim()))
+ me->GetMotionMaster()->MoveChase(me->getVictim(), 30);
+ else
+ me->GetMotionMaster()->MoveIdle();
+ DoCast(me->getVictim(), SPELL_SHADOW_BLAST);
+ Timer[EVENT_SHADOW_BLAST] = 4000;
+ break;
+ case EVENT_SHADOWDEMON:
+ DoCast(me, SPELL_SUMMON_SHADOWDEMON);
+ Timer[EVENT_SHADOWDEMON] = 0;
+ Timer[EVENT_FLAME_BURST] += 10000;
+ break;
+ case EVENT_FLAME_BURST:
+ DoCast(me, SPELL_FLAME_BURST);
+ Timer[EVENT_FLAME_BURST] = 15000;
+ break;
+ case EVENT_TRANSFORM_DEMON:
+ EnterPhase(PHASE_TRANSFORM_SEQUENCE);
+ break;
+ default:
+ break;
+ }
}
}
- else
- {
- IllidanGUID = 0;
- GateGUID = 0;
- DoorGUID[0] = 0;
- DoorGUID[1] = 0;
- }
-
- ChannelGUID = 0;
- SpiritGUID[0] = 0;
- SpiritGUID[1] = 0;
-
- Phase = PHASE_AKAMA_NULL;
- Timer = 0;
+ };
- ChannelCount = 0;
- TalkCount = 0;
- Check_Timer = 5000;
+};
- KillAllElites();
+/********************************** End of Illidan AI ******************************************/
- me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values..
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- me->setActive(false);
- me->SetVisibility(VISIBILITY_OFF);
- }
+/******* Functions and vars for Akama's AI ******/
+class boss_maiev_shadowsong : public CreatureScript
+{
+public:
+ boss_maiev_shadowsong() : CreatureScript("boss_maiev_shadowsong") { }
- // Do not call reset in Akama's evade mode, as this will stop him from summoning minions after he kills the first bit
- void EnterEvadeMode()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- me->RemoveAllAuras();
- me->DeleteThreatList();
- me->CombatStop(true);
+ return new boss_maievAI (pCreature);
}
- void EnterCombat(Unit * /*who*/) {}
- void MoveInLineOfSight(Unit* /*who*/) {}
-
- void MovementInform(uint32 MovementType, uint32 /*Data*/)
+ struct boss_maievAI : public ScriptedAI
{
- if (MovementType == POINT_MOTION_TYPE)
- Timer = 1;
- }
+ boss_maievAI(Creature *c) : ScriptedAI(c) {};
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if (damage > me->GetHealth() || done_by->GetGUID() != IllidanGUID)
- damage = 0;
- }
+ uint64 IllidanGUID;
- void KillAllElites()
- {
- std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
- std::vector<Unit*> eliteList;
- for (std::list<HostileReference*>::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
- {
- Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
- if (pUnit && pUnit->GetEntry() == ILLIDARI_ELITE)
- eliteList.push_back(pUnit);
- }
- for (std::vector<Unit*>::const_iterator itr = eliteList.begin(); itr != eliteList.end(); ++itr)
- (*itr)->setDeathState(JUST_DIED);
- EnterEvadeMode();
- }
+ PhaseIllidan Phase;
+ EventMaiev Event;
+ uint32 Timer[5];
+ uint32 MaxTimer;
- void BeginTalk()
- {
- if (!pInstance)
- return;
-
- pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS);
- for (uint8 i = 0; i < 2; ++i)
- pInstance->HandleGameObject(DoorGUID[i], false);
- if (GETCRE(Illidan, IllidanGUID))
+ void Reset()
{
- Illidan->RemoveAurasDueToSpell(SPELL_KNEEL);
- me->SetInFront(Illidan);
- Illidan->SetInFront(me);
- me->GetMotionMaster()->MoveIdle();
- Illidan->GetMotionMaster()->MoveIdle();
- CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = me->GetGUID();
- CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
+ MaxTimer = 0;
+ Phase = PHASE_NORMAL_MAIEV;
+ IllidanGUID = 0;
+ Timer[EVENT_MAIEV_STEALTH] = 0;
+ Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
+ Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000;
+ SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738);
}
- }
- void BeginChannel()
- {
- me->setActive(true);
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- if (!JustCreated)
- return;
- float x, y, z;
- if (GETGO(Gate, GateGUID))
- Gate->GetPosition(x, y, z);
- else
- return;//if door not spawned, don't crash server
+ void EnterCombat(Unit * /*who*/) {}
+ void MoveInLineOfSight(Unit * /*who*/) {}
+ void EnterEvadeMode() {}
+ void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; }
- if (Creature* Channel = me->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
+ void DamageTaken(Unit *done_by, uint32 &damage)
{
- ChannelGUID = Channel->GetGUID();
- Channel->SetDisplayId(11686); // Invisible but spell visuals can still be seen.
- DoCast(Channel, SPELL_AKAMA_DOOR_FAIL);
- }
-
- for (uint8 i = 0; i < 2; ++i)
- if (Creature* Spirit = me->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000))
+ if (done_by->GetGUID() != IllidanGUID)
+ damage = 0;
+ else
{
- Spirit->SetVisibility(VISIBILITY_OFF);
- SpiritGUID[i] = Spirit->GetGUID();
+ GETUNIT(Illidan, IllidanGUID);
+ if (Illidan && Illidan->getVictim() == me)
+ damage = me->GetMaxHealth()/10;
+ if (damage >= me->GetHealth())
+ damage = 0;
}
- }
-
- void BeginWalk()
- {
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- me->SetSpeed(MOVE_RUN, 1.0f);
- me->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
- }
+ }
- void EnterPhase(PhaseAkama NextPhase)
- {
- if (!pInstance)
- return;
- switch(NextPhase)
+ void AttackStart(Unit *who)
{
- case PHASE_CHANNEL:
- BeginChannel();
- Timer = 5000;
- ChannelCount = 0;
- break;
- case PHASE_WALK:
- if (Phase == PHASE_CHANNEL)
- WalkCount = 0;
- else if (Phase == PHASE_TALK)
- {
- if (GETCRE(Illidan, IllidanGUID))
- CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(me->GetGUID());
- EnterEvadeMode();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- ++WalkCount;
- }
- JustCreated = false;
- BeginWalk();
- Timer = 0;
- break;
- case PHASE_TALK:
- if (Phase == PHASE_WALK)
- {
- BeginTalk();
- Timer = 0;
- }
- else if (Phase == PHASE_FIGHT_ILLIDAN)
- {
- Timer = 1;
- TalkCount = 0;
- }
- break;
- case PHASE_FIGHT_ILLIDAN:
- if (GETUNIT(Illidan, IllidanGUID))
- {
- me->AddThreat(Illidan, 10000000.0f);
- me->GetMotionMaster()->MoveChase(Illidan);
- }
- Timer = 30000; //chain lightning
- break;
- case PHASE_FIGHT_MINIONS:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Timer = 10000 + rand()%6000;//summon minion
- break;
- case PHASE_RETURN:
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- KillAllElites();
- WalkCount = 0;
- BeginWalk();
- Timer = 1;
- break;
- default:
- break;
- }
- Phase = NextPhase;
- Event = false;
- }
+ if (!who || Timer[EVENT_MAIEV_STEALTH])
+ return;
- void HandleTalkSequence()
- {
- switch(TalkCount)
- {
- case 0:
- if (GETCRE(Illidan, IllidanGUID))
+ if (Phase == PHASE_TALK_SEQUENCE)
+ AttackStartNoMove(who);
+ else if (Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE)
{
- CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->Timer[EVENT_TAUNT] += 30000;
- Illidan->MonsterYell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION);
+ GETUNIT(Illidan, IllidanGUID);
+ if (Illidan && me->IsWithinDistInMap(Illidan, 25))
+ BlinkToPlayer();//Do not let dread aura hurt her.
+ AttackStartNoMove(who);
}
- Timer = 8000;
- break;
- case 1:
- me->MonsterYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(me, SOUND_AKAMA_LEAVE);
- Timer = 3000;
- break;
- case 2:
- EnterPhase(PHASE_WALK);
- break;
- }
- ++TalkCount;
- }
+ else
+ ScriptedAI::AttackStart(who);
+ }
- void HandleChannelSequence()
- {
- Unit* Channel = NULL, *Spirit[2];
- if (ChannelCount <= 5)
+ void DoAction(const int32 param)
{
- Channel = Unit::GetUnit((*me), ChannelGUID);
- Spirit[0] = Unit::GetUnit((*me), SpiritGUID[0]);
- Spirit[1] = Unit::GetUnit((*me), SpiritGUID[1]);
- if (!Channel || !Spirit[0] || !Spirit[1])
- return;
+ if (param > PHASE_ILLIDAN_NULL && param < PHASE_ILLIDAN_MAX)
+ EnterPhase(PhaseIllidan(param));
}
- switch(ChannelCount)
- {
- case 0: // channel failed
- me->InterruptNonMeleeSpells(true);
- Timer = 2000;
- break;
- case 1: // spirit appear
- Spirit[0]->SetVisibility(VISIBILITY_ON);
- Spirit[1]->SetVisibility(VISIBILITY_ON);
- Timer = 2000;
- break;
- case 2: // spirit help
- DoCast(Channel, SPELL_AKAMA_DOOR_CHANNEL);
- Spirit[0]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false);
- Spirit[1]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false);
- Timer = 5000;
- break;
- case 3: //open the gate
- me->InterruptNonMeleeSpells(true);
- Spirit[0]->InterruptNonMeleeSpells(true);
- Spirit[1]->InterruptNonMeleeSpells(true);
- if (pInstance)
- pInstance->HandleGameObject(GateGUID, true);
- Timer = 2000;
- break;
- case 4:
- me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- Timer = 2000;
- break;
- case 5:
- me->MonsterYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(me, SOUND_AKAMA_BEWARE);
- Channel->setDeathState(JUST_DIED);
- Spirit[0]->SetVisibility(VISIBILITY_OFF);
- Spirit[1]->SetVisibility(VISIBILITY_OFF);
- Timer = 3000;
- break;
- case 6:
- EnterPhase(PHASE_WALK);
- break;
- default:
- break;
- }
- ++ChannelCount;
- }
-
- void HandleWalkSequence()
- {
- switch(WalkCount)
+ void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase.
{
- case 6:
- for (uint8 i = 0; i < 2; ++i)
- if (pInstance)
- pInstance->HandleGameObject(DoorGUID[i], true);
- break;
- case 8:
- if (Phase == PHASE_WALK)
- EnterPhase(PHASE_TALK);
- else
- EnterPhase(PHASE_FIGHT_ILLIDAN);
- break;
- case 12:
- EnterPhase(PHASE_FIGHT_MINIONS);
- break;
+ switch(NextPhase)
+ {
+ case PHASE_TALK_SEQUENCE:
+ if (Timer[EVENT_MAIEV_STEALTH])
+ {
+ me->SetHealth(me->GetMaxHealth());
+ me->SetVisibility(VISIBILITY_ON);
+ Timer[EVENT_MAIEV_STEALTH] = 0;
+ }
+ me->InterruptNonMeleeSpells(false);
+ me->GetMotionMaster()->Clear(false);
+ me->AttackStop();
+ me->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID);
+ MaxTimer = 0;
+ break;
+ case PHASE_TRANSFORM_SEQUENCE:
+ MaxTimer = 4;
+ Timer[EVENT_MAIEV_TAUNT] += 10000;
+ Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
+ break;
+ case PHASE_DEMON:
+ break;
+ case PHASE_NORMAL_MAIEV:
+ MaxTimer = 4;
+ Timer[EVENT_MAIEV_TAUNT] += 10000;
+ Timer[EVENT_MAIEV_TRAP] = 22000;
+ break;
+ default:
+ break;
+ }
+ if (Timer[EVENT_MAIEV_STEALTH])
+ MaxTimer = 1;
+ Phase = NextPhase;
}
- if (Phase == PHASE_WALK)
+ void BlinkTo(float x, float y, float z)
{
- Timer = 0;
- ++WalkCount;
- me->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
+ me->AttackStop();
+ me->InterruptNonMeleeSpells(false);
+ me->GetMotionMaster()->Clear(false);
+ DoTeleportTo(x, y, z);
+ DoCast(me, SPELL_TELEPORT_VISUAL, true);
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (me->GetVisibility() == VISIBILITY_OFF)
+ void BlinkToPlayer()
{
- if (Check_Timer <= diff)
+ if (GETCRE(Illidan, IllidanGUID))
{
- if (pInstance && pInstance->GetData(DATA_ILLIDARICOUNCILEVENT) == DONE)
- me->SetVisibility(VISIBILITY_ON);
+ Unit *pTarget = CAST_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0);
- Check_Timer = 5000;
- } else Check_Timer -= diff;
- }
- Event = false;
- if (Timer)
- {
- if (Timer <= diff)
- Event = true;
- else Timer -= diff;
+ if (!pTarget || !me->IsWithinDistInMap(pTarget, 80) || Illidan->IsWithinDistInMap(pTarget, 20))
+ {
+ uint8 pos = rand()%4;
+ BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z);
+ }
+ else
+ {
+ float x, y, z;
+ pTarget->GetPosition(x, y, z);
+ BlinkTo(x, y, z);
+ }
+ }
}
- if (Event)
+ void UpdateAI(const uint32 diff)
{
- switch(Phase)
- {
- case PHASE_CHANNEL:
- if (JustCreated)
- HandleChannelSequence();
- else{
- EnterPhase(PHASE_WALK);
+ if ((!UpdateVictim())
+ && !Timer[EVENT_MAIEV_STEALTH])
+ return;
+
+ Event = EVENT_MAIEV_NULL;
+ for (uint8 i = 1; i <= MaxTimer; ++i)
+ if (Timer[i])
+ {
+ if (Timer[i] <= diff)
+ Event = (EventMaiev)i;
+ else Timer[i] -= diff;
}
- break;
- case PHASE_TALK:
- HandleTalkSequence();
- break;
- case PHASE_WALK:
- case PHASE_RETURN:
- HandleWalkSequence();
- break;
- case PHASE_FIGHT_ILLIDAN:
+
+ switch(Event)
{
- GETUNIT(Illidan, IllidanGUID);
- if (Illidan && HPPCT(Illidan) < 90)
- EnterPhase(PHASE_TALK);
+ case EVENT_MAIEV_STEALTH:
+ {
+ me->SetHealth(me->GetMaxHealth());
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Timer[EVENT_MAIEV_STEALTH] = 0;
+ BlinkToPlayer();
+ EnterPhase(Phase);
+ }
+ break;
+ case EVENT_MAIEV_TAUNT:
+ {
+ uint32 random = rand()%4;
+ char* text = MaievTaunts[random].text;
+ uint32 sound = MaievTaunts[random].sound;
+ me->MonsterYell(text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, sound);
+ Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
+ }
+ break;
+ case EVENT_MAIEV_SHADOW_STRIKE:
+ DoCast(me->getVictim(), SPELL_SHADOW_STRIKE);
+ Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000;
+ break;
+ case EVENT_MAIEV_TRAP:
+ if (Phase == PHASE_NORMAL_MAIEV)
+ {
+ BlinkToPlayer();
+ DoCast(me, SPELL_CAGE_TRAP_SUMMON);
+ Timer[EVENT_MAIEV_TRAP] = 22000;
+ }
else
{
- DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
- Timer = 30000;
+ if (!me->IsWithinDistInMap(me->getVictim(), 40))
+ me->GetMotionMaster()->MoveChase(me->getVictim(), 30);
+ DoCast(me->getVictim(), SPELL_THROW_DAGGER);
+ Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
}
+ break;
+ default:
+ break;
}
- break;
- case PHASE_FIGHT_MINIONS:
+
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 50)
{
- float x, y, z;
- me->GetPosition(x, y, z);
- Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
- //Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
- if (Elite)
- {
- Elite->AI()->AttackStart(me);
- Elite->AddThreat(me, 1000000.0f);
- AttackStart(Elite);
- me->AddThreat(Elite, 1000000.0f);
- }
- Timer = 10000 + rand()%6000;
- GETUNIT(Illidan, IllidanGUID);
- if (Illidan && HPPCT(Illidan) < 10)
- EnterPhase(PHASE_RETURN);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if (GETCRE(Illidan, IllidanGUID))
+ CAST_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(me->GetGUID());
+ me->AttackStop();
+ Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute
+ MaxTimer = 1;
}
- break;
- default:
- break;
- }
+
+ if (Phase == PHASE_NORMAL_MAIEV)
+ DoMeleeAttackIfReady();
}
+ };
+
+};
+ class npc_akama_illidan : public CreatureScript
+{
+public:
+ npc_akama_illidan() : CreatureScript("npc_akama_illidan") { }
- if (!UpdateVictim())
- return;
+ struct npc_akama_illidanAI : public ScriptedAI
+ {
+ npc_akama_illidanAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ JustCreated = true;
+ }
+ bool JustCreated;
+ InstanceScript* pInstance;
- if (me->GetHealth()*100 / me->GetMaxHealth() < 20)
- DoCast(me, SPELL_HEALING_POTION);
+ PhaseAkama Phase;
+ bool Event;
+ uint32 Timer;
- DoMeleeAttackIfReady();
- }
-};
+ uint64 IllidanGUID;
+ uint64 ChannelGUID;
+ uint64 SpiritGUID[2];
+ uint64 GateGUID;
+ uint64 DoorGUID[2];
-struct boss_maievAI : public ScriptedAI
-{
- boss_maievAI(Creature *c) : ScriptedAI(c) {};
+ uint32 ChannelCount;
+ uint32 WalkCount;
+ uint32 TalkCount;
+ uint32 Check_Timer;
- uint64 IllidanGUID;
+ void Reset()
+ {
+ WalkCount = 0;
+ if (pInstance)
+ {
+ pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
- PhaseIllidan Phase;
- EventMaiev Event;
- uint32 Timer[5];
- uint32 MaxTimer;
+ IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
+ GateGUID = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE);
+ DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R);
+ DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L);
- void Reset()
- {
- MaxTimer = 0;
- Phase = PHASE_NORMAL_MAIEV;
- IllidanGUID = 0;
- Timer[EVENT_MAIEV_STEALTH] = 0;
- Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
- Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000;
- SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738);
- }
+ if (JustCreated)//close all doors at create
+ {
+ pInstance->HandleGameObject(GateGUID, false);
+
+ for (uint8 i = 0; i < 2; ++i)
+ pInstance->HandleGameObject(DoorGUID[i], false);
+ //JustCreated = false;
+ }else
+ {//open all doors, raid wiped
+ pInstance->HandleGameObject(GateGUID, true);
+ WalkCount = 1;//skip first wp
+ for (uint8 i = 0; i < 2; ++i)
+ pInstance->HandleGameObject(DoorGUID[i], true);
+ }
+ }
+ else
+ {
+ IllidanGUID = 0;
+ GateGUID = 0;
+ DoorGUID[0] = 0;
+ DoorGUID[1] = 0;
+ }
- void EnterCombat(Unit * /*who*/) {}
- void MoveInLineOfSight(Unit * /*who*/) {}
- void EnterEvadeMode() {}
- void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; }
+ ChannelGUID = 0;
+ SpiritGUID[0] = 0;
+ SpiritGUID[1] = 0;
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if (done_by->GetGUID() != IllidanGUID)
- damage = 0;
- else
- {
- GETUNIT(Illidan, IllidanGUID);
- if (Illidan && Illidan->getVictim() == me)
- damage = me->GetMaxHealth()/10;
- if (damage >= me->GetHealth())
- damage = 0;
+ Phase = PHASE_AKAMA_NULL;
+ Timer = 0;
+
+ ChannelCount = 0;
+ TalkCount = 0;
+ Check_Timer = 5000;
+
+ KillAllElites();
+
+ me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values..
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->setActive(false);
+ me->SetVisibility(VISIBILITY_OFF);
}
- }
- void AttackStart(Unit *who)
- {
- if (!who || Timer[EVENT_MAIEV_STEALTH])
- return;
+ // Do not call reset in Akama's evade mode, as this will stop him from summoning minions after he kills the first bit
+ void EnterEvadeMode()
+ {
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ }
- if (Phase == PHASE_TALK_SEQUENCE)
- AttackStartNoMove(who);
- else if (Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE)
+ void EnterCombat(Unit * /*who*/) {}
+ void MoveInLineOfSight(Unit* /*who*/) {}
+
+ void MovementInform(uint32 MovementType, uint32 /*Data*/)
{
- GETUNIT(Illidan, IllidanGUID);
- if (Illidan && me->IsWithinDistInMap(Illidan, 25))
- BlinkToPlayer();//Do not let dread aura hurt her.
- AttackStartNoMove(who);
+ if (MovementType == POINT_MOTION_TYPE)
+ Timer = 1;
}
- else
- ScriptedAI::AttackStart(who);
- }
- void DoAction(const int32 param)
- {
- if (param > PHASE_ILLIDAN_NULL && param < PHASE_ILLIDAN_MAX)
- EnterPhase(PhaseIllidan(param));
- }
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if (damage > me->GetHealth() || done_by->GetGUID() != IllidanGUID)
+ damage = 0;
+ }
- void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase.
- {
- switch(NextPhase)
+ void KillAllElites()
{
- case PHASE_TALK_SEQUENCE:
- if (Timer[EVENT_MAIEV_STEALTH])
+ std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
+ std::vector<Unit*> eliteList;
+ for (std::list<HostileReference*>::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
{
- me->SetHealth(me->GetMaxHealth());
- me->SetVisibility(VISIBILITY_ON);
- Timer[EVENT_MAIEV_STEALTH] = 0;
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
+ if (pUnit && pUnit->GetEntry() == ILLIDARI_ELITE)
+ eliteList.push_back(pUnit);
}
- me->InterruptNonMeleeSpells(false);
- me->GetMotionMaster()->Clear(false);
- me->AttackStop();
- me->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID);
- MaxTimer = 0;
- break;
- case PHASE_TRANSFORM_SEQUENCE:
- MaxTimer = 4;
- Timer[EVENT_MAIEV_TAUNT] += 10000;
- Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
- break;
- case PHASE_DEMON:
- break;
- case PHASE_NORMAL_MAIEV:
- MaxTimer = 4;
- Timer[EVENT_MAIEV_TAUNT] += 10000;
- Timer[EVENT_MAIEV_TRAP] = 22000;
- break;
- default:
- break;
- }
- if (Timer[EVENT_MAIEV_STEALTH])
- MaxTimer = 1;
- Phase = NextPhase;
- }
-
- void BlinkTo(float x, float y, float z)
- {
- me->AttackStop();
- me->InterruptNonMeleeSpells(false);
- me->GetMotionMaster()->Clear(false);
- DoTeleportTo(x, y, z);
- DoCast(me, SPELL_TELEPORT_VISUAL, true);
- }
+ for (std::vector<Unit*>::const_iterator itr = eliteList.begin(); itr != eliteList.end(); ++itr)
+ (*itr)->setDeathState(JUST_DIED);
+ EnterEvadeMode();
+ }
- void BlinkToPlayer()
- {
- if (GETCRE(Illidan, IllidanGUID))
+ void BeginTalk()
{
- Unit *pTarget = CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (!pInstance)
+ return;
- if (!pTarget || !me->IsWithinDistInMap(pTarget, 80) || Illidan->IsWithinDistInMap(pTarget, 20))
- {
- uint8 pos = rand()%4;
- BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z);
- }
- else
+ pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS);
+ for (uint8 i = 0; i < 2; ++i)
+ pInstance->HandleGameObject(DoorGUID[i], false);
+ if (GETCRE(Illidan, IllidanGUID))
{
- float x, y, z;
- pTarget->GetPosition(x, y, z);
- BlinkTo(x, y, z);
+ Illidan->RemoveAurasDueToSpell(SPELL_KNEEL);
+ me->SetInFront(Illidan);
+ Illidan->SetInFront(me);
+ me->GetMotionMaster()->MoveIdle();
+ Illidan->GetMotionMaster()->MoveIdle();
+ CAST_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = me->GetGUID();
+ CAST_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
}
}
- }
- void UpdateAI(const uint32 diff)
- {
- if ((!UpdateVictim())
- && !Timer[EVENT_MAIEV_STEALTH])
- return;
+ void BeginChannel()
+ {
+ me->setActive(true);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ if (!JustCreated)
+ return;
+ float x, y, z;
+ if (GETGO(Gate, GateGUID))
+ Gate->GetPosition(x, y, z);
+ else
+ return;//if door not spawned, don't crash server
- Event = EVENT_MAIEV_NULL;
- for (uint8 i = 1; i <= MaxTimer; ++i)
- if (Timer[i])
+ if (Creature* Channel = me->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
{
- if (Timer[i] <= diff)
- Event = (EventMaiev)i;
- else Timer[i] -= diff;
+ ChannelGUID = Channel->GetGUID();
+ Channel->SetDisplayId(11686); // Invisible but spell visuals can still be seen.
+ DoCast(Channel, SPELL_AKAMA_DOOR_FAIL);
}
- switch(Event)
- {
- case EVENT_MAIEV_STEALTH:
+ for (uint8 i = 0; i < 2; ++i)
+ if (Creature* Spirit = me->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000))
{
- me->SetHealth(me->GetMaxHealth());
- me->SetVisibility(VISIBILITY_ON);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Timer[EVENT_MAIEV_STEALTH] = 0;
- BlinkToPlayer();
- EnterPhase(Phase);
+ Spirit->SetVisibility(VISIBILITY_OFF);
+ SpiritGUID[i] = Spirit->GetGUID();
}
+ }
+
+ void BeginWalk()
+ {
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ me->SetSpeed(MOVE_RUN, 1.0f);
+ me->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
+ }
+
+ void EnterPhase(PhaseAkama NextPhase)
+ {
+ if (!pInstance)
+ return;
+ switch(NextPhase)
+ {
+ case PHASE_CHANNEL:
+ BeginChannel();
+ Timer = 5000;
+ ChannelCount = 0;
break;
- case EVENT_MAIEV_TAUNT:
+ case PHASE_WALK:
+ if (Phase == PHASE_CHANNEL)
+ WalkCount = 0;
+ else if (Phase == PHASE_TALK)
{
- uint32 random = rand()%4;
- char* text = MaievTaunts[random].text;
- uint32 sound = MaievTaunts[random].sound;
- me->MonsterYell(text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(me, sound);
- Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
+ if (GETCRE(Illidan, IllidanGUID))
+ CAST_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(me->GetGUID());
+ EnterEvadeMode();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ ++WalkCount;
}
+ JustCreated = false;
+ BeginWalk();
+ Timer = 0;
break;
- case EVENT_MAIEV_SHADOW_STRIKE:
- DoCast(me->getVictim(), SPELL_SHADOW_STRIKE);
- Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000;
- break;
- case EVENT_MAIEV_TRAP:
- if (Phase == PHASE_NORMAL_MAIEV)
+ case PHASE_TALK:
+ if (Phase == PHASE_WALK)
{
- BlinkToPlayer();
- DoCast(me, SPELL_CAGE_TRAP_SUMMON);
- Timer[EVENT_MAIEV_TRAP] = 22000;
+ BeginTalk();
+ Timer = 0;
}
- else
+ else if (Phase == PHASE_FIGHT_ILLIDAN)
{
- if (!me->IsWithinDistInMap(me->getVictim(), 40))
- me->GetMotionMaster()->MoveChase(me->getVictim(), 30);
- DoCast(me->getVictim(), SPELL_THROW_DAGGER);
- Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
+ Timer = 1;
+ TalkCount = 0;
+ }
+ break;
+ case PHASE_FIGHT_ILLIDAN:
+ if (GETUNIT(Illidan, IllidanGUID))
+ {
+ me->AddThreat(Illidan, 10000000.0f);
+ me->GetMotionMaster()->MoveChase(Illidan);
}
+ Timer = 30000; //chain lightning
+ break;
+ case PHASE_FIGHT_MINIONS:
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Timer = 10000 + rand()%6000;//summon minion
+ break;
+ case PHASE_RETURN:
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ KillAllElites();
+ WalkCount = 0;
+ BeginWalk();
+ Timer = 1;
break;
default:
break;
}
+ Phase = NextPhase;
+ Event = false;
+ }
- if (me->GetHealth()*100 / me->GetMaxHealth() < 50)
+ void HandleTalkSequence()
+ {
+ switch(TalkCount)
{
- me->SetVisibility(VISIBILITY_OFF);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ case 0:
if (GETCRE(Illidan, IllidanGUID))
- CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(me->GetGUID());
- me->AttackStop();
- Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute
- MaxTimer = 1;
+ {
+ CAST_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, Illidan->AI())->Timer[EVENT_TAUNT] += 30000;
+ Illidan->MonsterYell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION);
+ }
+ Timer = 8000;
+ break;
+ case 1:
+ me->MonsterYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_AKAMA_LEAVE);
+ Timer = 3000;
+ break;
+ case 2:
+ EnterPhase(PHASE_WALK);
+ break;
}
+ ++TalkCount;
+ }
- if (Phase == PHASE_NORMAL_MAIEV)
- DoMeleeAttackIfReady();
- }
-};
-
-bool GossipSelect_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event
- {
- pPlayer->CLOSE_GOSSIP_MENU();
- CAST_AI(npc_akama_illidanAI, pCreature->AI())->EnterPhase(PHASE_CHANNEL);
- }
- return true;
-}
-
-bool GossipHello_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature)
-{
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- pPlayer->SEND_GOSSIP_MENU(10465, pCreature->GetGUID());
-
- return true;
-}
-
-struct cage_trap_triggerAI : public ScriptedAI
-{
- cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {}
-
- uint64 IllidanGUID;
- uint32 DespawnTimer;
-
- bool Active;
- bool SummonedBeams;
-
- void Reset()
- {
- IllidanGUID = 0;
+ void HandleChannelSequence()
+ {
+ Unit* Channel = NULL, *Spirit[2];
+ if (ChannelCount <= 5)
+ {
+ Channel = Unit::GetUnit((*me), ChannelGUID);
+ Spirit[0] = Unit::GetUnit((*me), SpiritGUID[0]);
+ Spirit[1] = Unit::GetUnit((*me), SpiritGUID[1]);
+ if (!Channel || !Spirit[0] || !Spirit[1])
+ return;
+ }
- Active = false;
- SummonedBeams = false;
+ switch(ChannelCount)
+ {
+ case 0: // channel failed
+ me->InterruptNonMeleeSpells(true);
+ Timer = 2000;
+ break;
+ case 1: // spirit appear
+ Spirit[0]->SetVisibility(VISIBILITY_ON);
+ Spirit[1]->SetVisibility(VISIBILITY_ON);
+ Timer = 2000;
+ break;
+ case 2: // spirit help
+ DoCast(Channel, SPELL_AKAMA_DOOR_CHANNEL);
+ Spirit[0]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false);
+ Spirit[1]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false);
+ Timer = 5000;
+ break;
+ case 3: //open the gate
+ me->InterruptNonMeleeSpells(true);
+ Spirit[0]->InterruptNonMeleeSpells(true);
+ Spirit[1]->InterruptNonMeleeSpells(true);
+ if (pInstance)
+ pInstance->HandleGameObject(GateGUID, true);
+ Timer = 2000;
+ break;
+ case 4:
+ me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ Timer = 2000;
+ break;
+ case 5:
+ me->MonsterYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(me, SOUND_AKAMA_BEWARE);
+ Channel->setDeathState(JUST_DIED);
+ Spirit[0]->SetVisibility(VISIBILITY_OFF);
+ Spirit[1]->SetVisibility(VISIBILITY_OFF);
+ Timer = 3000;
+ break;
+ case 6:
+ EnterPhase(PHASE_WALK);
+ break;
+ default:
+ break;
+ }
+ ++ChannelCount;
+ }
- DespawnTimer = 0;
+ void HandleWalkSequence()
+ {
+ switch(WalkCount)
+ {
+ case 6:
+ for (uint8 i = 0; i < 2; ++i)
+ if (pInstance)
+ pInstance->HandleGameObject(DoorGUID[i], true);
+ break;
+ case 8:
+ if (Phase == PHASE_WALK)
+ EnterPhase(PHASE_TALK);
+ else
+ EnterPhase(PHASE_FIGHT_ILLIDAN);
+ break;
+ case 12:
+ EnterPhase(PHASE_FIGHT_MINIONS);
+ break;
+ }
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
+ if (Phase == PHASE_WALK)
+ {
+ Timer = 0;
+ ++WalkCount;
+ me->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
+ }
+ }
- void EnterCombat(Unit * /*who*/){}
+ void UpdateAI(const uint32 diff)
+ {
+ if (me->GetVisibility() == VISIBILITY_OFF)
+ {
+ if (Check_Timer <= diff)
+ {
+ if (pInstance && pInstance->GetData(DATA_ILLIDARICOUNCILEVENT) == DONE)
+ me->SetVisibility(VISIBILITY_ON);
- void MoveInLineOfSight(Unit *who)
- {
- if (!Active)
- return;
+ Check_Timer = 5000;
+ } else Check_Timer -= diff;
+ }
+ Event = false;
+ if (Timer)
+ {
+ if (Timer <= diff)
+ Event = true;
+ else Timer -= diff;
+ }
- if (who && (who->GetTypeId() != TYPEID_PLAYER))
- {
- if (who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan
+ if (Event)
{
- if (!IllidanGUID && me->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED)))
+ switch(Phase)
{
- IllidanGUID = who->GetGUID();
- who->CastSpell(who, SPELL_CAGED, true);
- DespawnTimer = 5000;
- if (who->HasAura(SPELL_ENRAGE))
- who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage
- //if (GameObject* CageTrap = pInstance->instance->GetGameObject(pInstance->GetData64(CageTrapGUID)))
- // CageTrap->SetLootState(GO_JUST_DEACTIVATED);
+ case PHASE_CHANNEL:
+ if (JustCreated)
+ HandleChannelSequence();
+ else{
+ EnterPhase(PHASE_WALK);
+ }
+ break;
+ case PHASE_TALK:
+ HandleTalkSequence();
+ break;
+ case PHASE_WALK:
+ case PHASE_RETURN:
+ HandleWalkSequence();
+ break;
+ case PHASE_FIGHT_ILLIDAN:
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if (Illidan && HPPCT(Illidan) < 90)
+ EnterPhase(PHASE_TALK);
+ else
+ {
+ DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
+ Timer = 30000;
+ }
+ }
+ break;
+ case PHASE_FIGHT_MINIONS:
+ {
+ float x, y, z;
+ me->GetPosition(x, y, z);
+ Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ //Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ if (Elite)
+ {
+ Elite->AI()->AttackStart(me);
+ Elite->AddThreat(me, 1000000.0f);
+ AttackStart(Elite);
+ me->AddThreat(Elite, 1000000.0f);
+ }
+ Timer = 10000 + rand()%6000;
+ GETUNIT(Illidan, IllidanGUID);
+ if (Illidan && HPPCT(Illidan) < 10)
+ EnterPhase(PHASE_RETURN);
+ }
+ break;
+ default:
+ break;
}
}
- }
- }
- void UpdateAI(const uint32 diff)
- {
- if (DespawnTimer)
- if (DespawnTimer <= diff)
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- else DespawnTimer -= diff;
-
- //if (IllidanGUID && !SummonedBeams)
- //{
- // if (Unit* Illidan = Unit::GetUnit(*me, IllidanGUID)
- // {
- // //TODO: Find proper spells and properly apply 'caged' Illidan effect
- // }
- //}
- }
-};
-
-bool GOHello_cage_trap(Player* pPlayer, GameObject* pGo)
-{
- float x, y, z;
- pPlayer->GetPosition(x, y, z);
-
- // Grid search for nearest live Creature of entry 23304 within 10 yards
- if (Creature* pTrigger = pGo->FindNearestCreature(23304, 10.0f))
- CAST_AI(cage_trap_triggerAI, pTrigger->AI())->Active = true;
- pGo->SetGoState(GO_STATE_ACTIVE);
- return true;
-}
-
-struct shadow_demonAI : public ScriptedAI
-{
- shadow_demonAI(Creature *c) : ScriptedAI(c) {}
-
- uint64 TargetGUID;
-
- void EnterCombat(Unit * /*who*/) {DoZoneInCombat();}
-
- void Reset()
- {
- TargetGUID = 0;
- DoCast(me, SPELL_SHADOW_DEMON_PASSIVE, true);
- }
-
- void JustDied(Unit * /*killer*/)
- {
- if (Unit *pTarget = Unit::GetUnit((*me), TargetGUID))
- pTarget->RemoveAurasDueToSpell(SPELL_PARALYZE);
- }
-
- void UpdateAI(const uint32 /*diff*/)
- {
- if (!UpdateVictim()) return;
+ if (!UpdateVictim())
+ return;
- if (me->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
+ if (me->GetHealth()*100 / me->GetMaxHealth() < 20)
+ DoCast(me, SPELL_HEALING_POTION);
- if (!me->getVictim()->HasAura(SPELL_PARALYZE))
- {
- TargetGUID = me->getVictim()->GetGUID();
- me->AddThreat(me->getVictim(), 10000000.0f);
- DoCast(me->getVictim(), SPELL_PURPLE_BEAM, true);
- DoCast(me->getVictim(), SPELL_PARALYZE, true);
+ DoMeleeAttackIfReady();
}
- // Kill our target if we're very close.
- if (me->IsWithinDistInMap(me->getVictim(), 3))
- DoCast(me->getVictim(), SPELL_CONSUME_SOUL);
- }
-};
-
-// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap
-struct mob_parasitic_shadowfiendAI : public ScriptedAI
-{
- mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- }
-
- ScriptedInstance* pInstance;
- uint64 IllidanGUID;
- uint32 CheckTimer;
+ };
- void Reset()
+ bool GossipSelect_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- if (pInstance)
- IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
- else
- IllidanGUID = 0;
-
- CheckTimer = 5000;
- DoCast(me, SPELL_SHADOWFIEND_PASSIVE, true);
- }
-
- void EnterCombat(Unit* /*who*/) { DoZoneInCombat(); }
-
- void DoMeleeAttackIfReady()
- {
- if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim()))
+ if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event
{
- if (!me->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND)
- && !me->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
- {
- if (Creature* illidan = Unit::GetCreature((*me),IllidanGUID))//summon only in 1. phase
- if (CAST_AI(boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL)
- me->CastSpell(me->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack
- }
- me->AttackerStateUpdate(me->getVictim());
- me->resetAttackTimer();
+ pPlayer->CLOSE_GOSSIP_MENU();
+ CAST_AI(npc_akama_illidan::npc_akama_illidanAI, pCreature->AI())->EnterPhase(PHASE_CHANNEL);
}
+ return true;
}
- void UpdateAI(const uint32 diff)
+ bool GossipHello_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature)
{
- if (!me->getVictim())
- {
- if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true))
- AttackStart(pTarget);
- else
- {
- me->SetVisibility(VISIBILITY_OFF);
- me->setDeathState(JUST_DIED);
- return;
- }
- }
-
- if (CheckTimer <= diff)
- {
- GETUNIT(Illidan, IllidanGUID);
- if (!Illidan || CAST_CRE(Illidan)->IsInEvadeMode())
- {
- me->SetVisibility(VISIBILITY_OFF);
- me->setDeathState(JUST_DIED);
- return;
- } else CheckTimer = 5000;
- } else CheckTimer -= diff;
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ pPlayer->SEND_GOSSIP_MENU(10465, pCreature->GetGUID());
- DoMeleeAttackIfReady();
+ return true;
}
-};
-
-struct blade_of_azzinothAI : public NullCreatureAI
-{
- blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {}
- void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE)
- me->SetDisplayId(21431);//appear when hit by Illidan's glaive
+ return new npc_akama_illidanAI(pCreature);
}
+
};
-void boss_illidan_stormrageAI::Reset()
+void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset()
{
if (pInstance)
pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
@@ -1833,9 +1833,9 @@ void boss_illidan_stormrageAI::Reset()
Akama->Respawn();
else
{
- CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterEvadeMode();
+ CAST_AI(npc_akama_illidan::npc_akama_illidanAI, Akama->AI())->EnterEvadeMode();
Akama->GetMotionMaster()->MoveTargetedHome();
- CAST_AI(npc_akama_illidanAI, Akama->AI())->Reset();
+ CAST_AI(npc_akama_illidan::npc_akama_illidanAI, Akama->AI())->Reset();
}
}
AkamaGUID = 0;
@@ -1867,7 +1867,7 @@ void boss_illidan_stormrageAI::Reset()
Summons.DespawnAll();
}
-void boss_illidan_stormrageAI::JustSummoned(Creature* summon)
+void boss_illidan_stormrage::boss_illidan_stormrageAI::JustSummoned(Creature* summon)
{
Summons.Summon(summon);
switch(summon->GetEntry())
@@ -1900,7 +1900,7 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon)
summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
MaievGUID = summon->GetGUID();
- CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(me->GetGUID());
+ CAST_AI(boss_maiev_shadowsong::boss_maievAI, summon->AI())->GetIllidanGUID(me->GetGUID());
summon->AI()->DoAction(PHASE_TALK_SEQUENCE);
}
break;
@@ -1914,7 +1914,7 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon)
}
}
-void boss_illidan_stormrageAI::HandleTalkSequence()
+void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence()
{
switch(TalkCount)
{
@@ -1932,7 +1932,7 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
me->AddThreat(Akama, 100.0f);
- CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN);
+ CAST_AI(npc_akama_illidan::npc_akama_illidanAI, Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN);
EnterPhase(PHASE_NORMAL);
}
break;
@@ -1997,254 +1997,262 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
if (Phase == PHASE_TALK_SEQUENCE)
Talk(TalkCount); // This function does most of the talking
++TalkCount;
-}
-
-void boss_illidan_stormrageAI::CastEyeBlast()
+} class mob_cage_trap_trigger : public CreatureScript
{
- me->InterruptNonMeleeSpells(false);
+public:
+ mob_cage_trap_trigger() : CreatureScript("mob_cage_trap_trigger") { }
- me->MonsterYell(SAY_EYE_BLAST, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(me, SOUND_EYE_BLAST);
-
- float distx, disty, dist[2];
- for (uint8 i = 0; i < 2; ++i)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- distx = EyeBlast[i].x - HoverPosition[HoverPoint].x;
- disty = EyeBlast[i].y - HoverPosition[HoverPoint].y;
- dist[i] = distx * distx + disty * disty;
+ return new cage_trap_triggerAI (pCreature);
}
- Locations initial = EyeBlast[dist[0] < dist[1] ? 0 : 1];
- for (uint8 i = 0; i < 2; ++i)
+
+ struct cage_trap_triggerAI : public ScriptedAI
{
- distx = GlaivePosition[i].x - HoverPosition[HoverPoint].x;
- disty = GlaivePosition[i].y - HoverPosition[HoverPoint].y;
- dist[i] = distx * distx + disty * disty;
- }
- Locations final = GlaivePosition[dist[0] < dist[1] ? 0 : 1];
+ cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {}
- final.x = 2 * final.x - initial.x;
- final.y = 2 * final.y - initial.y;
+ uint64 IllidanGUID;
+ uint32 DespawnTimer;
- Creature* Trigger = me->SummonCreature(23069, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000);
- if (!Trigger) return;
+ bool Active;
+ bool SummonedBeams;
- Trigger->SetSpeed(MOVE_WALK, 3);
- Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
- Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
+ void Reset()
+ {
+ IllidanGUID = 0;
- //Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID());
- DoCast(Trigger, SPELL_EYE_BLAST);
-}
+ Active = false;
+ SummonedBeams = false;
-void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth()
-{
- me->MonsterYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(me, SOUND_SUMMONFLAMES);
+ DespawnTimer = 0;
- for (uint8 i = 0; i < 2; ++i)
- {
- if (GETUNIT(Glaive, GlaiveGUID[i]))
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void EnterCombat(Unit * /*who*/){}
+
+ void MoveInLineOfSight(Unit *who)
{
- Creature* Flame = me->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
- if (Flame)
+ if (!Active)
+ return;
+
+ if (who && (who->GetTypeId() != TYPEID_PLAYER))
{
- Flame->setFaction(me->getFaction()); // Just in case the database has it as a different faction
- Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE);
- FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase
- CAST_AI(flame_of_azzinothAI, Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]);
- Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it.
+ if (who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan
+ {
+ if (!IllidanGUID && me->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED)))
+ {
+ IllidanGUID = who->GetGUID();
+ who->CastSpell(who, SPELL_CAGED, true);
+ DespawnTimer = 5000;
+ if (who->HasAura(SPELL_ENRAGE))
+ who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage
+ //if (GameObject* CageTrap = pInstance->instance->GetGameObject(pInstance->GetData64(CageTrapGUID)))
+ // CageTrap->SetLootState(GO_JUST_DEACTIVATED);
+ }
+ }
}
}
- }
-}
-void boss_illidan_stormrageAI::SummonMaiev()
+ void UpdateAI(const uint32 diff)
+ {
+ if (DespawnTimer)
+ if (DespawnTimer <= diff)
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ else DespawnTimer -= diff;
+
+ //if (IllidanGUID && !SummonedBeams)
+ //{
+ // if (Unit* Illidan = Unit::GetUnit(*me, IllidanGUID)
+ // {
+ // //TODO: Find proper spells and properly apply 'caged' Illidan effect
+ // }
+ //}
+ }
+ };
+
+};
+ class gameobject_cage_trap : public GameObjectScript
{
- DoCast(me, SPELL_SHADOW_PRISON, true);
- DoCast(me, 40403, true);
- if (!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console.
+public:
+ gameobject_cage_trap() : GameObjectScript("gameobject_cage_trap") { }
+
+ bool OnGossipHello(Player* pPlayer, GameObject* pGo)
{
- EnterEvadeMode();
- me->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, 0);
- sLog.outError("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)");
+ float x, y, z;
+ pPlayer->GetPosition(x, y, z);
+
+ // Grid search for nearest live Creature of entry 23304 within 10 yards
+ if (Creature* pTrigger = pGo->FindNearestCreature(23304, 10.0f))
+ CAST_AI(mob_cage_trap_trigger::cage_trap_triggerAI, pTrigger->AI())->Active = true;
+ pGo->SetGoState(GO_STATE_ACTIVE);
+ return true;
}
-}
-void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase)
+};
+ class mob_shadow_demon : public CreatureScript
{
- DoZoneInCombat();
- switch(NextPhase)
+public:
+ mob_shadow_demon() : CreatureScript("mob_shadow_demon") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- case PHASE_NORMAL:
- case PHASE_NORMAL_2:
- case PHASE_NORMAL_MAIEV:
- AttackStart(me->getVictim());
- Timer[EVENT_TAUNT] = 32000;
- Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000;
- Timer[EVENT_FLAME_CRASH] = 20000;
- Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000;
- Timer[EVENT_PARASITE_CHECK] = 0;
- Timer[EVENT_DRAW_SOUL] = 30000;
- if (NextPhase == PHASE_NORMAL)
- break;
- Timer[EVENT_AGONIZING_FLAMES] = 35000;
- Timer[EVENT_TRANSFORM_NORMAL] = 60000;
- if (NextPhase == PHASE_NORMAL_2)
- break;
- Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000;
- break;
- case PHASE_FLIGHT:
- Timer[EVENT_FIREBALL] = 1000;
- if (!(rand()%4))
- Timer[EVENT_DARK_BARRAGE] = 10000;
- Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000;
- Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000;
- break;
- case PHASE_DEMON:
- Timer[EVENT_SHADOW_BLAST] = 1000;
- Timer[EVENT_FLAME_BURST] = 10000;
- Timer[EVENT_SHADOWDEMON] = 30000;
- Timer[EVENT_TRANSFORM_DEMON] = 60000;
- AttackStart(me->getVictim());
- break;
- case PHASE_TALK_SEQUENCE:
- Timer[EVENT_TALK_SEQUENCE] = 100;
- me->RemoveAllAuras();
- me->InterruptNonMeleeSpells(false);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- me->GetMotionMaster()->Clear(false);
- me->AttackStop();
- break;
- case PHASE_FLIGHT_SEQUENCE:
- if (Phase == PHASE_NORMAL) //lift off
+ return new shadow_demonAI (pCreature);
+ }
+
+ struct shadow_demonAI : public ScriptedAI
+ {
+ shadow_demonAI(Creature *c) : ScriptedAI(c) {}
+
+ uint64 TargetGUID;
+
+ void EnterCombat(Unit * /*who*/) {DoZoneInCombat();}
+
+ void Reset()
{
- FlightCount = 1;
- Timer[EVENT_FLIGHT_SEQUENCE] = 1;
- me->RemoveAllAuras();
- me->InterruptNonMeleeSpells(false);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->GetMotionMaster()->Clear(false);
- me->AttackStop();
+ TargetGUID = 0;
+ DoCast(me, SPELL_SHADOW_DEMON_PASSIVE, true);
}
- else //land
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- break;
- case PHASE_TRANSFORM_SEQUENCE:
- if (Phase == PHASE_DEMON)
- Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
- else
- {
- TransformCount = 0;
- Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
- me->MonsterYell(SAY_MORPH, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(me, SOUND_MORPH);
- }
- me->GetMotionMaster()->Clear();
- me->AttackStop();
- break;
- default:
- break;
- }
- if (MaievGUID)
+
+ void JustDied(Unit * /*killer*/)
+ {
+ if (Unit *pTarget = Unit::GetUnit((*me), TargetGUID))
+ pTarget->RemoveAurasDueToSpell(SPELL_PARALYZE);
+ }
+
+ void UpdateAI(const uint32 /*diff*/)
+ {
+ if (!UpdateVictim()) return;
+
+ if (me->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
+
+ if (!me->getVictim()->HasAura(SPELL_PARALYZE))
+ {
+ TargetGUID = me->getVictim()->GetGUID();
+ me->AddThreat(me->getVictim(), 10000000.0f);
+ DoCast(me->getVictim(), SPELL_PURPLE_BEAM, true);
+ DoCast(me->getVictim(), SPELL_PARALYZE, true);
+ }
+ // Kill our target if we're very close.
+ if (me->IsWithinDistInMap(me->getVictim(), 3))
+ DoCast(me->getVictim(), SPELL_CONSUME_SOUL);
+ }
+ };
+
+};
+ class mob_blade_of_azzinoth : public CreatureScript
+{
+public:
+ mob_blade_of_azzinoth() : CreatureScript("mob_blade_of_azzinoth") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- GETCRE(Maiev, MaievGUID);
- if (Maiev && Maiev->isAlive())
- Maiev->AI()->DoAction(NextPhase);
+ return new blade_of_azzinothAI (pCreature);
}
- Phase = NextPhase;
- Event = EVENT_NULL;
-}
-CreatureAI* GetAI_boss_illidan_stormrage(Creature* pCreature)
-{
- return new boss_illidan_stormrageAI (pCreature);
-}
+ struct blade_of_azzinothAI : public NullCreatureAI
+ {
+ blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {}
-CreatureAI* GetAI_npc_akama_at_illidan(Creature* pCreature)
-{
- return new npc_akama_illidanAI(pCreature);
-}
+ void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
+ {
+ if (spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE)
+ me->SetDisplayId(21431);//appear when hit by Illidan's glaive
+ }
+ };
-CreatureAI* GetAI_boss_maiev(Creature* pCreature)
+};
+ class mob_parasitic_shadowfiend : public CreatureScript
{
- return new boss_maievAI (pCreature);
-}
+public:
+ mob_parasitic_shadowfiend() : CreatureScript("mob_parasitic_shadowfiend") { }
-CreatureAI* GetAI_mob_flame_of_azzinoth(Creature* pCreature)
-{
- return new flame_of_azzinothAI (pCreature);
-}
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new mob_parasitic_shadowfiendAI (pCreature);
+ }
-CreatureAI* GetAI_cage_trap_trigger(Creature* pCreature)
-{
- return new cage_trap_triggerAI (pCreature);
-}
+ // Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap
+ struct mob_parasitic_shadowfiendAI : public ScriptedAI
+ {
+ mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
-CreatureAI* GetAI_shadow_demon(Creature* pCreature)
-{
- return new shadow_demonAI (pCreature);
-}
+ InstanceScript* pInstance;
+ uint64 IllidanGUID;
+ uint32 CheckTimer;
-CreatureAI* GetAI_blade_of_azzinoth(Creature* pCreature)
-{
- return new blade_of_azzinothAI (pCreature);
-}
+ void Reset()
+ {
+ if (pInstance)
+ IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
+ else
+ IllidanGUID = 0;
-CreatureAI* GetAI_parasitic_shadowfiend(Creature* pCreature)
-{
- return new mob_parasitic_shadowfiendAI (pCreature);
-}
+ CheckTimer = 5000;
+ DoCast(me, SPELL_SHADOWFIEND_PASSIVE, true);
+ }
+
+ void EnterCombat(Unit* /*who*/) { DoZoneInCombat(); }
+
+ void DoMeleeAttackIfReady()
+ {
+ if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim()))
+ {
+ if (!me->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND)
+ && !me->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
+ {
+ if (Creature* illidan = Unit::GetCreature((*me),IllidanGUID))//summon only in 1. phase
+ if (CAST_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL)
+ me->CastSpell(me->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack
+ }
+ me->AttackerStateUpdate(me->getVictim());
+ me->resetAttackTimer();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!me->getVictim())
+ {
+ if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true))
+ AttackStart(pTarget);
+ else
+ {
+ me->SetVisibility(VISIBILITY_OFF);
+ me->setDeathState(JUST_DIED);
+ return;
+ }
+ }
+
+ if (CheckTimer <= diff)
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if (!Illidan || CAST_CRE(Illidan)->IsInEvadeMode())
+ {
+ me->SetVisibility(VISIBILITY_OFF);
+ me->setDeathState(JUST_DIED);
+ return;
+ } else CheckTimer = 5000;
+ } else CheckTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+};
void AddSC_boss_illidan()
{
- Script* newscript;
-
- newscript = new Script;
- newscript->Name = "boss_illidan_stormrage";
- newscript->GetAI = &GetAI_boss_illidan_stormrage;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_akama_illidan";
- newscript->GetAI = &GetAI_npc_akama_at_illidan;
- newscript->pGossipHello = &GossipHello_npc_akama_at_illidan;
- newscript->pGossipSelect = &GossipSelect_npc_akama_at_illidan;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_maiev_shadowsong";
- newscript->GetAI = &GetAI_boss_maiev;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_flame_of_azzinoth";
- newscript->GetAI = &GetAI_mob_flame_of_azzinoth;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_blade_of_azzinoth";
- newscript->GetAI = &GetAI_blade_of_azzinoth;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "gameobject_cage_trap";
- newscript->pGOHello = &GOHello_cage_trap;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_cage_trap_trigger";
- newscript->GetAI = &GetAI_cage_trap_trigger;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_shadow_demon";
- newscript->GetAI = &GetAI_shadow_demon;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_parasitic_shadowfiend";
- newscript->GetAI = &GetAI_parasitic_shadowfiend;
- newscript->RegisterSelf();
+ new boss_illidan_stormrage();
+ new npc_akama_illidan();
+ new boss_maiev_shadowsong();
+ new mob_flame_of_azzinoth();
+ new mob_blade_of_azzinoth();
+ new gameobject_cage_trap();
+ new mob_cage_trap_trigger();
+ new mob_shadow_demon();
+ new mob_parasitic_shadowfiend();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
index cb72486972b..71aa4e8a4bd 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
@@ -77,228 +77,230 @@ static Locations TeleportPoint[]=
{930.548, 284.888, 193.367},
{965.997, 278.398, 195.777}
};
-
-struct boss_shahrazAI : public ScriptedAI
+ class boss_mother_shahraz : public CreatureScript
{
- boss_shahrazAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_mother_shahraz() : CreatureScript("boss_mother_shahraz") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new boss_shahrazAI (pCreature);
}
- ScriptedInstance* pInstance;
-
- uint64 TargetGUID[3];
- uint32 BeamTimer;
- uint32 BeamCount;
- uint32 CurrentBeam;
- uint32 PrismaticShieldTimer;
- uint32 FatalAttractionTimer;
- uint32 FatalAttractionExplodeTimer;
- uint32 ShriekTimer;
- uint32 SaberTimer;
- uint32 RandomYellTimer;
- uint32 EnrageTimer;
- uint32 ExplosionCount;
+ struct boss_shahrazAI : public ScriptedAI
+ {
+ boss_shahrazAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- bool Enraged;
+ InstanceScript* pInstance;
- void Reset()
- {
- if (pInstance)
- pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, NOT_STARTED);
-
- for (uint8 i = 0; i<3; ++i)
- TargetGUID[i] = 0;
-
- BeamTimer = 20000; // Timers may be incorrect
- BeamCount = 0;
- CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful
- PrismaticShieldTimer = 0;
- FatalAttractionTimer = 60000;
- FatalAttractionExplodeTimer = 70000;
- ShriekTimer = 30000;
- SaberTimer = 35000;
- RandomYellTimer = 70000 + rand()%41 * 1000;
- EnrageTimer = 600000;
- ExplosionCount = 0;
-
- Enraged = false;
- }
+ uint64 TargetGUID[3];
+ uint32 BeamTimer;
+ uint32 BeamCount;
+ uint32 CurrentBeam;
+ uint32 PrismaticShieldTimer;
+ uint32 FatalAttractionTimer;
+ uint32 FatalAttractionExplodeTimer;
+ uint32 ShriekTimer;
+ uint32 SaberTimer;
+ uint32 RandomYellTimer;
+ uint32 EnrageTimer;
+ uint32 ExplosionCount;
- void EnterCombat(Unit * /*who*/)
- {
- if (pInstance)
- pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS);
+ bool Enraged;
- DoZoneInCombat();
- DoScriptText(SAY_AGGRO, me);
- }
+ void Reset()
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, NOT_STARTED);
+
+ for (uint8 i = 0; i<3; ++i)
+ TargetGUID[i] = 0;
+
+ BeamTimer = 20000; // Timers may be incorrect
+ BeamCount = 0;
+ CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful
+ PrismaticShieldTimer = 0;
+ FatalAttractionTimer = 60000;
+ FatalAttractionExplodeTimer = 70000;
+ ShriekTimer = 30000;
+ SaberTimer = 35000;
+ RandomYellTimer = 70000 + rand()%41 * 1000;
+ EnrageTimer = 600000;
+ ExplosionCount = 0;
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
- }
+ Enraged = false;
+ }
- void JustDied(Unit * /*victim*/)
- {
- if (pInstance)
- pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE);
+ void EnterCombat(Unit * /*who*/)
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS);
- DoScriptText(SAY_DEATH, me);
- }
+ DoZoneInCombat();
+ DoScriptText(SAY_AGGRO, me);
+ }
- void TeleportPlayers()
- {
- uint32 random = rand()%7;
- float X = TeleportPoint[random].x;
- float Y = TeleportPoint[random].y;
- float Z = TeleportPoint[random].z;
- for (uint8 i = 0; i < 3; ++i)
+ void KilledUnit(Unit * /*victim*/)
{
- Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER))
- {
- TargetGUID[i] = pUnit->GetGUID();
- pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true);
- DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation());
- }
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void JustDied(Unit * /*victim*/)
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE);
+
+ DoScriptText(SAY_DEATH, me);
+ }
- if (((me->GetHealth()*100 / me->GetMaxHealth()) < 10) && !Enraged)
+ void TeleportPlayers()
{
- Enraged = true;
- DoCast(me, SPELL_ENRAGE, true);
- DoScriptText(SAY_ENRAGE, me);
+ uint32 random = rand()%7;
+ float X = TeleportPoint[random].x;
+ float Y = TeleportPoint[random].y;
+ float Z = TeleportPoint[random].z;
+ for (uint8 i = 0; i < 3; ++i)
+ {
+ Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER))
+ {
+ TargetGUID[i] = pUnit->GetGUID();
+ pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true);
+ DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation());
+ }
+ }
}
- //Randomly cast one beam.
- if (BeamTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (!pTarget || !pTarget->isAlive())
+ if (!UpdateVictim())
return;
- BeamTimer = 9000;
-
- switch(CurrentBeam)
+ if (((me->GetHealth()*100 / me->GetMaxHealth()) < 10) && !Enraged)
{
- case 0:
- DoCast(pTarget, SPELL_BEAM_SINISTER);
- break;
- case 1:
- DoCast(pTarget, SPELL_BEAM_VILE);
- break;
- case 2:
- DoCast(pTarget, SPELL_BEAM_WICKED);
- break;
- case 3:
- DoCast(pTarget, SPELL_BEAM_SINFUL);
- break;
+ Enraged = true;
+ DoCast(me, SPELL_ENRAGE, true);
+ DoScriptText(SAY_ENRAGE, me);
}
- ++BeamCount;
- uint32 Beam = CurrentBeam;
- if (BeamCount > 3)
- while (CurrentBeam == Beam)
- CurrentBeam = rand()%3;
- } else BeamTimer -= diff;
+ //Randomly cast one beam.
+ if (BeamTimer <= diff)
+ {
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (!pTarget || !pTarget->isAlive())
+ return;
- // Random Prismatic Shield every 15 seconds.
- if (PrismaticShieldTimer <= diff)
- {
- uint32 random = rand()%6;
- if (PrismaticAuras[random])
- DoCast(me, PrismaticAuras[random]);
- PrismaticShieldTimer = 15000;
- } else PrismaticShieldTimer -= diff;
-
- // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other.
- if (FatalAttractionTimer <= diff)
- {
- ExplosionCount = 0;
+ BeamTimer = 9000;
- TeleportPlayers();
+ switch(CurrentBeam)
+ {
+ case 0:
+ DoCast(pTarget, SPELL_BEAM_SINISTER);
+ break;
+ case 1:
+ DoCast(pTarget, SPELL_BEAM_VILE);
+ break;
+ case 2:
+ DoCast(pTarget, SPELL_BEAM_WICKED);
+ break;
+ case 3:
+ DoCast(pTarget, SPELL_BEAM_SINFUL);
+ break;
+ }
+ ++BeamCount;
+ uint32 Beam = CurrentBeam;
+ if (BeamCount > 3)
+ while (CurrentBeam == Beam)
+ CurrentBeam = rand()%3;
- DoScriptText(RAND(SAY_SPELL2,SAY_SPELL3), me);
- FatalAttractionExplodeTimer = 2000;
- FatalAttractionTimer = 40000 + rand()%31 * 1000;
- } else FatalAttractionTimer -= diff;
+ } else BeamTimer -= diff;
- if (FatalAttractionExplodeTimer <= diff)
- {
- // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later.
- if (ExplosionCount < 3)
+ // Random Prismatic Shield every 15 seconds.
+ if (PrismaticShieldTimer <= diff)
+ {
+ uint32 random = rand()%6;
+ if (PrismaticAuras[random])
+ DoCast(me, PrismaticAuras[random]);
+ PrismaticShieldTimer = 15000;
+ } else PrismaticShieldTimer -= diff;
+
+ // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other.
+ if (FatalAttractionTimer <= diff)
{
- for (uint8 i = 0; i < 3; ++i)
+ ExplosionCount = 0;
+
+ TeleportPlayers();
+
+ DoScriptText(RAND(SAY_SPELL2,SAY_SPELL3), me);
+ FatalAttractionExplodeTimer = 2000;
+ FatalAttractionTimer = 40000 + rand()%31 * 1000;
+ } else FatalAttractionTimer -= diff;
+
+ if (FatalAttractionExplodeTimer <= diff)
+ {
+ // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later.
+ if (ExplosionCount < 3)
{
- Unit* pUnit = NULL;
- if (TargetGUID[i])
+ for (uint8 i = 0; i < 3; ++i)
{
- pUnit = Unit::GetUnit((*me), TargetGUID[i]);
- if (pUnit)
- pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true);
- TargetGUID[i] = 0;
+ Unit* pUnit = NULL;
+ if (TargetGUID[i])
+ {
+ pUnit = Unit::GetUnit((*me), TargetGUID[i]);
+ if (pUnit)
+ pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true);
+ TargetGUID[i] = 0;
+ }
}
+
+ ++ExplosionCount;
+ FatalAttractionExplodeTimer = 1000;
+ }
+ else
+ {
+ FatalAttractionExplodeTimer = FatalAttractionTimer + 2000;
+ ExplosionCount = 0;
}
+ } else FatalAttractionExplodeTimer -= diff;
- ++ExplosionCount;
- FatalAttractionExplodeTimer = 1000;
- }
- else
+ if (ShriekTimer <= diff)
{
- FatalAttractionExplodeTimer = FatalAttractionTimer + 2000;
- ExplosionCount = 0;
- }
- } else FatalAttractionExplodeTimer -= diff;
+ DoCast(me->getVictim(), SPELL_SILENCING_SHRIEK);
+ ShriekTimer = 25000+rand()%10 * 1000;
+ } else ShriekTimer -= diff;
- if (ShriekTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SILENCING_SHRIEK);
- ShriekTimer = 25000+rand()%10 * 1000;
- } else ShriekTimer -= diff;
+ if (SaberTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SABER_LASH);
+ SaberTimer = 25000+rand()%10 * 1000;
+ } else SaberTimer -= diff;
- if (SaberTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SABER_LASH);
- SaberTimer = 25000+rand()%10 * 1000;
- } else SaberTimer -= diff;
+ //Enrage
+ if (!me->HasAura(SPELL_BERSERK))
+ if (EnrageTimer <= diff)
+ {
+ DoCast(me, SPELL_BERSERK);
+ DoScriptText(SAY_ENRAGE, me);
+ } else EnrageTimer -= diff;
- //Enrage
- if (!me->HasAura(SPELL_BERSERK))
- if (EnrageTimer <= diff)
- {
- DoCast(me, SPELL_BERSERK);
- DoScriptText(SAY_ENRAGE, me);
- } else EnrageTimer -= diff;
+ //Random taunts
+ if (RandomYellTimer <= diff)
+ {
+ DoScriptText(RAND(SAY_TAUNT1,SAY_TAUNT2,SAY_TAUNT3), me);
+ RandomYellTimer = 60000 + rand()%91 * 1000;
+ } else RandomYellTimer -= diff;
- //Random taunts
- if (RandomYellTimer <= diff)
- {
- DoScriptText(RAND(SAY_TAUNT1,SAY_TAUNT2,SAY_TAUNT3), me);
- RandomYellTimer = 60000 + rand()%91 * 1000;
- } else RandomYellTimer -= diff;
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_shahraz(Creature* pCreature)
-{
- return new boss_shahrazAI (pCreature);
-}
void AddSC_boss_mother_shahraz()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_mother_shahraz";
- newscript->GetAI = &GetAI_boss_shahraz;
- newscript->RegisterSelf();
+ new boss_mother_shahraz();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
index 1482cb84bd2..2bde4116d38 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
@@ -100,593 +100,608 @@ static Position2d Coords[]=
{450.4, 137.4},
{450.4, 168.3}
};
-
-struct npc_enslaved_soulAI : public ScriptedAI
+ class npc_enslaved_soul : public CreatureScript
{
- npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {}
-
- uint64 ReliquaryGUID;
+public:
+ npc_enslaved_soul() : CreatureScript("npc_enslaved_soul") { }
- void Reset() {ReliquaryGUID = 0;}
-
- void EnterCombat(Unit* /*who*/)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- DoCast(me, ENSLAVED_SOUL_PASSIVE, true);
- DoZoneInCombat();
+ return new npc_enslaved_soulAI (pCreature);
}
- void JustDied(Unit *killer);
-};
+ struct npc_enslaved_soulAI : public ScriptedAI
+ {
+ npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {}
+
+ uint64 ReliquaryGUID;
-struct boss_reliquary_of_soulsAI : public ScriptedAI
+ void Reset() {ReliquaryGUID = 0;}
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ DoCast(me, ENSLAVED_SOUL_PASSIVE, true);
+ DoZoneInCombat();
+ }
+
+ void JustDied(Unit * /*killer*/);
+ };
+
+};
+ class boss_reliquary_of_souls : public CreatureScript
{
- boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_reliquary_of_souls() : CreatureScript("boss_reliquary_of_souls") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
- EssenceGUID = 0;
+ return new boss_reliquary_of_soulsAI (pCreature);
}
- ScriptedInstance* pInstance;
+ struct boss_reliquary_of_soulsAI : public ScriptedAI
+ {
+ boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ EssenceGUID = 0;
+ }
- uint64 EssenceGUID;
+ InstanceScript* pInstance;
- uint32 Phase;
- uint32 Counter;
- uint32 Timer;
+ uint64 EssenceGUID;
- uint32 SoulCount;
- uint32 SoulDeathCount;
+ uint32 Phase;
+ uint32 Counter;
+ uint32 Timer;
- void Reset()
- {
- if (pInstance)
- pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED);
+ uint32 SoulCount;
+ uint32 SoulDeathCount;
- if (EssenceGUID)
+ void Reset()
{
- if (Creature* Essence = Unit::GetCreature(*me, EssenceGUID))
+ if (pInstance)
+ pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED);
+
+ if (EssenceGUID)
{
- Essence->ForcedDespawn();
+ if (Creature* Essence = Unit::GetCreature(*me, EssenceGUID))
+ {
+ Essence->ForcedDespawn();
+ }
+ EssenceGUID = 0;
}
- EssenceGUID = 0;
- }
- Phase = 0;
+ Phase = 0;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
- me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
- }
-
- void EnterCombat(Unit* who)
- {
- me->AddThreat(who, 10000.0f);
- DoZoneInCombat();
- if (pInstance)
- pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS);
-
- Phase = 1;
- Counter = 0;
- Timer = 0;
- }
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
+ }
- bool SummonSoul()
- {
- uint32 random = rand()%6;
- float x = Coords[random].x;
- float y = Coords[random].y;
- Creature* Soul = me->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (!Soul) return false;
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ void EnterCombat(Unit* who)
{
- CAST_AI(npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = me->GetGUID();
- Soul->AI()->AttackStart(pTarget);
- } else EnterEvadeMode();
- return true;
- }
+ me->AddThreat(who, 10000.0f);
+ DoZoneInCombat();
+ if (pInstance)
+ pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS);
- void MergeThreatList(Creature *pTarget)
- {
- if (!pTarget)
- return;
+ Phase = 1;
+ Counter = 0;
+ Timer = 0;
+ }
- std::list<HostileReference*>& m_threatlist = pTarget->getThreatManager().getThreatList();
- std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
- for (; itr != m_threatlist.end(); ++itr)
+ bool SummonSoul()
{
- Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
- if (pUnit)
+ uint32 random = rand()%6;
+ float x = Coords[random].x;
+ float y = Coords[random].y;
+ Creature* Soul = me->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (!Soul) return false;
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
- DoModifyThreatPercent(pUnit, -100);
- float threat = pTarget->getThreatManager().getThreat(pUnit);
- me->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences).
- }
+ CAST_AI(npc_enslaved_soul::npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = me->GetGUID();
+ Soul->AI()->AttackStart(pTarget);
+ } else EnterEvadeMode();
+ return true;
}
- }
- void JustDied(Unit* /*killer*/)
- {
- if (pInstance)
- pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE);
- }
+ void MergeThreatList(Creature *pTarget)
+ {
+ if (!pTarget)
+ return;
- void UpdateAI(const uint32 diff)
- {
- if (!Phase)
- return;
+ std::list<HostileReference*>& m_threatlist = pTarget->getThreatManager().getThreatList();
+ std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
+ for (; itr != m_threatlist.end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
+ if (pUnit)
+ {
+ DoModifyThreatPercent(pUnit, -100);
+ float threat = pTarget->getThreatManager().getThreat(pUnit);
+ me->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences).
+ }
+ }
+ }
- if (me->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist
+ void JustDied(Unit* /*killer*/)
{
- EnterEvadeMode();
- return;
+ if (pInstance)
+ pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE);
}
- Creature* Essence = NULL;
- if (EssenceGUID)
+ void UpdateAI(const uint32 diff)
{
- Essence = Unit::GetCreature(*me, EssenceGUID);
- if (!Essence)
+ if (!Phase)
+ return;
+
+ if (me->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist
{
EnterEvadeMode();
return;
}
- }
- if (Timer <= diff)
- {
- switch(Counter)
+ Creature* Essence = NULL;
+ if (EssenceGUID)
{
- case 0:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); // I R ANNNGRRRY!
- DoStartNoMovement(me);
- Timer = 3000;
- break;
- case 1:
- Timer = 2800;
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); // Release the cube
- DoCast(me, SPELL_SUBMERGE);
- DoStartNoMovement(me);
- break;
- case 2:
- Timer = 5000;
- if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0))
- {
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open
- Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
- EssenceGUID = Summon->GetGUID();
- DoStartNoMovement(me);
- } else EnterEvadeMode();
- break;
- case 3:
- Timer = 1000;
- if (Phase == 3)
+ Essence = Unit::GetCreature(*me, EssenceGUID);
+ if (!Essence)
{
- if (!Essence->isAlive())
- DoCast(me, 7, true);
- else return;
+ EnterEvadeMode();
+ return;
}
- else
+ }
+
+ if (Timer <= diff)
+ {
+ switch(Counter)
{
- if (Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
+ case 0:
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); // I R ANNNGRRRY!
+ DoStartNoMovement(me);
+ Timer = 3000;
+ break;
+ case 1:
+ Timer = 2800;
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); // Release the cube
+ DoCast(me, SPELL_SUBMERGE);
+ DoStartNoMovement(me);
+ break;
+ case 2:
+ Timer = 5000;
+ if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0))
+ {
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open
+ Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
+ EssenceGUID = Summon->GetGUID();
+ DoStartNoMovement(me);
+ } else EnterEvadeMode();
+ break;
+ case 3:
+ Timer = 1000;
+ if (Phase == 3)
+ {
+ if (!Essence->isAlive())
+ DoCast(me, 7, true);
+ else return;
+ }
+ else
+ {
+ if (Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
+ {
+ MergeThreatList(Essence);
+ Essence->RemoveAllAuras();
+ Essence->DeleteThreatList();
+ Essence->GetMotionMaster()->MoveFollow(me,0.0f,0.0f);
+ } else return;
+ }
+ break;
+ case 4:
+ Timer = 1500;
+ if (Essence->IsWithinDistInMap(me, 10))
+ {
+ Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); //rotate and disappear
+ Timer = 2000;
+ me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
+ }
+ else
{
MergeThreatList(Essence);
Essence->RemoveAllAuras();
Essence->DeleteThreatList();
- Essence->GetMotionMaster()->MoveFollow(me,0.0f,0.0f);
- } else return;
- }
- break;
- case 4:
- Timer = 1500;
- if (Essence->IsWithinDistInMap(me, 10))
- {
- Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); //rotate and disappear
- Timer = 2000;
- me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
- }
- else
- {
- MergeThreatList(Essence);
- Essence->RemoveAllAuras();
- Essence->DeleteThreatList();
- Essence->GetMotionMaster()->MoveFollow(me, 0, 0);
- return;
- }
- break;
- case 5:
- if (Phase == 1)
- {
- DoScriptText(SUFF_SAY_AFTER, Essence);
- }
- else
- {
- DoScriptText(DESI_SAY_AFTER, Essence);
- }
- Essence->ForcedDespawn();
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
- EssenceGUID = 0;
- SoulCount = 0;
- SoulDeathCount = 0;
- Timer = 3000;
- break;
- case 6:
- if (SoulCount < NUMBER_ENSLAVED_SOUL)
- {
- if (SummonSoul())
- ++SoulCount;
- Timer = 500;
+ Essence->GetMotionMaster()->MoveFollow(me, 0, 0);
+ return;
+ }
+ break;
+ case 5:
+ if (Phase == 1)
+ {
+ DoScriptText(SUFF_SAY_AFTER, Essence);
+ }
+ else
+ {
+ DoScriptText(DESI_SAY_AFTER, Essence);
+ }
+ Essence->ForcedDespawn();
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
+ EssenceGUID = 0;
+ SoulCount = 0;
+ SoulDeathCount = 0;
+ Timer = 3000;
+ break;
+ case 6:
+ if (SoulCount < NUMBER_ENSLAVED_SOUL)
+ {
+ if (SummonSoul())
+ ++SoulCount;
+ Timer = 500;
+ return;
+ }
+ break;
+ case 7:
+ if (SoulDeathCount >= SoulCount)
+ {
+ Counter = 1;
+ ++Phase;
+ Timer = 5000;
+ }
return;
+ default:
+ break;
}
- break;
- case 7:
- if (SoulDeathCount >= SoulCount)
- {
- Counter = 1;
- ++Phase;
- Timer = 5000;
- }
- return;
- default:
- break;
- }
- ++Counter;
- } else Timer -= diff;
- }
-};
+ ++Counter;
+ } else Timer -= diff;
+ }
+ };
-struct boss_essence_of_sufferingAI : public ScriptedAI
+};
+ void npc_enslaved_soul::npc_enslaved_soulAI::JustDied(Unit * /*killer*/)
{
- boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {}
-
- uint64 StatAuraGUID;
+ if (ReliquaryGUID)
+ if (Creature *Reliquary = (Unit::GetCreature((*me), ReliquaryGUID)))
+ ++(CAST_AI(boss_reliquary_of_souls::boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount);
- uint32 AggroYellTimer;
- uint32 FixateTimer;
- uint32 EnrageTimer;
- uint32 SoulDrainTimer;
- uint32 AuraTimer;
+ DoCast(me, SPELL_SOUL_RELEASE, true);
+}
+ class boss_essence_of_suffering : public CreatureScript
+{
+public:
+ boss_essence_of_suffering() : CreatureScript("boss_essence_of_suffering") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- StatAuraGUID = 0;
-
- AggroYellTimer = 5000;
- FixateTimer = 8000;
- EnrageTimer = 30000;
- SoulDrainTimer = 45000;
- AuraTimer = 5000;
+ return new boss_essence_of_sufferingAI (pCreature);
}
- void DamageTaken(Unit * /*done_by*/, uint32 &damage)
+ struct boss_essence_of_sufferingAI : public ScriptedAI
{
- if (damage >= me->GetHealth())
- {
- damage = 0;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0);
- DoScriptText(SUFF_SAY_RECAP, me);
- }
- }
+ boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {}
- void EnterCombat(Unit * /*who*/)
- {
- if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
- {
- DoScriptText(SUFF_SAY_FREED, me);
- DoZoneInCombat();
- DoCast(me, AURA_OF_SUFFERING, true); // linked aura need core support
- DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE, true);
- DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE2, true);
- }
- else return;
- }
+ uint64 StatAuraGUID;
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(SUFF_SAY_SLAY1,SUFF_SAY_SLAY2,SUFF_SAY_SLAY3), me);
- }
+ uint32 AggroYellTimer;
+ uint32 FixateTimer;
+ uint32 EnrageTimer;
+ uint32 SoulDrainTimer;
+ uint32 AuraTimer;
- void CastFixate()
- {
- std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
- if (m_threatlist.empty())
- return; // No point continuing if empty threatlist.
- std::list<Unit*> targets;
- std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
- for (; itr != m_threatlist.end(); ++itr)
+ void Reset()
{
- Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
- if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players
- targets.push_back(pUnit);
+ StatAuraGUID = 0;
+
+ AggroYellTimer = 5000;
+ FixateTimer = 8000;
+ EnrageTimer = 30000;
+ SoulDrainTimer = 45000;
+ AuraTimer = 5000;
}
- if (targets.empty())
- return; // No targets added for some reason. No point continuing.
- targets.sort(Trinity::ObjectDistanceOrderPred(me)); // Sort players by distance.
- targets.resize(1); // Only need closest target.
- Unit *pTarget = targets.front(); // Get the first target.
- if (pTarget)
- pTarget->CastSpell(me, SPELL_FIXATE_TAUNT, true);
- DoResetThreat();
- me->AddThreat(pTarget,1000000);
- }
- void UpdateAI(const uint32 diff)
- {
- if (me->isInCombat())
+ void DamageTaken(Unit * /*done_by*/, uint32 &damage)
{
- //Supposed to be cast on nearest target
- if (FixateTimer <= diff)
+ if (damage >= me->GetHealth())
{
- CastFixate();
- FixateTimer = 5000;
- if (!(rand()%16))
+ damage = 0;
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0);
+ DoScriptText(SUFF_SAY_RECAP, me);
+ }
+ }
+
+ void EnterCombat(Unit * /*who*/)
+ {
+ if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
{
- DoScriptText(SUFF_SAY_AGGRO, me);
+ DoScriptText(SUFF_SAY_FREED, me);
+ DoZoneInCombat();
+ DoCast(me, AURA_OF_SUFFERING, true); // linked aura need core support
+ DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE, true);
+ DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE2, true);
}
- } else FixateTimer -= diff;
+ else return;
}
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ void KilledUnit(Unit * /*victim*/)
+ {
+ DoScriptText(RAND(SUFF_SAY_SLAY1,SUFF_SAY_SLAY2,SUFF_SAY_SLAY3), me);
+ }
- if (EnrageTimer <= diff)
+ void CastFixate()
{
- DoCast(me, SPELL_ENRAGE);
- EnrageTimer = 60000;
- DoScriptText(SUFF_EMOTE_ENRAGE, me);
- } else EnrageTimer -= diff;
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
+ if (m_threatlist.empty())
+ return; // No point continuing if empty threatlist.
+ std::list<Unit*> targets;
+ std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
+ for (; itr != m_threatlist.end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
+ if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players
+ targets.push_back(pUnit);
+ }
+ if (targets.empty())
+ return; // No targets added for some reason. No point continuing.
+ targets.sort(Trinity::ObjectDistanceOrderPred(me)); // Sort players by distance.
+ targets.resize(1); // Only need closest target.
+ Unit *pTarget = targets.front(); // Get the first target.
+ if (pTarget)
+ pTarget->CastSpell(me, SPELL_FIXATE_TAUNT, true);
+ DoResetThreat();
+ me->AddThreat(pTarget,1000000);
+ }
- if (SoulDrainTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SOUL_DRAIN);
- SoulDrainTimer = 60000;
- } else SoulDrainTimer -= diff;
+ if (me->isInCombat())
+ {
+ //Supposed to be cast on nearest target
+ if (FixateTimer <= diff)
+ {
+ CastFixate();
+ FixateTimer = 5000;
+ if (!(rand()%16))
+ {
+ DoScriptText(SUFF_SAY_AGGRO, me);
+ }
+ } else FixateTimer -= diff;
+ }
- DoMeleeAttackIfReady();
- }
-};
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
-struct boss_essence_of_desireAI : public ScriptedAI
-{
- boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {}
+ if (EnrageTimer <= diff)
+ {
+ DoCast(me, SPELL_ENRAGE);
+ EnrageTimer = 60000;
+ DoScriptText(SUFF_EMOTE_ENRAGE, me);
+ } else EnrageTimer -= diff;
- uint32 RuneShieldTimer;
- uint32 DeadenTimer;
- uint32 SoulShockTimer;
+ if (SoulDrainTimer <= diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SOUL_DRAIN);
+ SoulDrainTimer = 60000;
+ } else SoulDrainTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- void Reset()
+};
+ class boss_essence_of_desire : public CreatureScript
+{
+public:
+ boss_essence_of_desire() : CreatureScript("boss_essence_of_desire") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- RuneShieldTimer = 60000;
- DeadenTimer = 30000;
- SoulShockTimer = 5000;
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
+ return new boss_essence_of_desireAI (pCreature);
}
- void DamageTaken(Unit *done_by, uint32 &damage)
+ struct boss_essence_of_desireAI : public ScriptedAI
{
- if (done_by == me)
- return;
+ boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {}
- if (damage >= me->GetHealth())
- {
- damage = 0;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoScriptText(SUFF_SAY_RECAP, me);
- }
- else
+ uint32 RuneShieldTimer;
+ uint32 DeadenTimer;
+ uint32 SoulShockTimer;
+
+ void Reset()
{
- int32 bp0 = damage / 2;
- me->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true);
+ RuneShieldTimer = 60000;
+ DeadenTimer = 30000;
+ SoulShockTimer = 5000;
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
}
- }
- void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
- {
- if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL))
- for (uint8 i = 0; i < 3; ++i)
- if (spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST)
- if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_SOUL_SHOCK
- || me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_DEADEN)
- me->InterruptSpell(CURRENT_GENERIC_SPELL, false);
- }
-
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(DESI_SAY_FREED, me);
- DoZoneInCombat();
- DoCast(me, AURA_OF_DESIRE, true);
- }
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if (done_by == me)
+ return;
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(DESI_SAY_SLAY1,DESI_SAY_SLAY2,DESI_SAY_SLAY3), me);
- }
+ if (damage >= me->GetHealth())
+ {
+ damage = 0;
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoScriptText(SUFF_SAY_RECAP, me);
+ }
+ else
+ {
+ int32 bp0 = damage / 2;
+ me->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true);
+ }
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
+ {
+ if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL))
+ for (uint8 i = 0; i < 3; ++i)
+ if (spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST)
+ if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_SOUL_SHOCK
+ || me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_DEADEN)
+ me->InterruptSpell(CURRENT_GENERIC_SPELL, false);
+ }
- if (RuneShieldTimer <= diff)
+ void EnterCombat(Unit * /*who*/)
{
- me->InterruptNonMeleeSpells(false);
- DoCast(me, SPELL_RUNE_SHIELD, true);
- SoulShockTimer += 2000;
- DeadenTimer += 2000;
- RuneShieldTimer = 60000;
- } else RuneShieldTimer -= diff;
+ DoScriptText(DESI_SAY_FREED, me);
+ DoZoneInCombat();
+ DoCast(me, AURA_OF_DESIRE, true);
+ }
- if (SoulShockTimer <= diff)
+ void KilledUnit(Unit * /*victim*/)
{
- DoCast(me->getVictim(), SPELL_SOUL_SHOCK);
- SoulShockTimer = 5000;
- } else SoulShockTimer -= diff;
+ DoScriptText(RAND(DESI_SAY_SLAY1,DESI_SAY_SLAY2,DESI_SAY_SLAY3), me);
+ }
- if (DeadenTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- me->InterruptNonMeleeSpells(false);
- DoCast(me->getVictim(), SPELL_DEADEN);
- DeadenTimer = 25000 + rand()%10000;
- if (!(rand()%2))
+ if (!UpdateVictim())
+ return;
+
+ if (RuneShieldTimer <= diff)
{
- DoScriptText(DESI_SAY_SPEC, me);
- }
- } else DeadenTimer -= diff;
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_RUNE_SHIELD, true);
+ SoulShockTimer += 2000;
+ DeadenTimer += 2000;
+ RuneShieldTimer = 60000;
+ } else RuneShieldTimer -= diff;
+
+ if (SoulShockTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SOUL_SHOCK);
+ SoulShockTimer = 5000;
+ } else SoulShockTimer -= diff;
- DoMeleeAttackIfReady();
- }
-};
+ if (DeadenTimer <= diff)
+ {
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me->getVictim(), SPELL_DEADEN);
+ DeadenTimer = 25000 + rand()%10000;
+ if (!(rand()%2))
+ {
+ DoScriptText(DESI_SAY_SPEC, me);
+ }
+ } else DeadenTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
-struct boss_essence_of_angerAI : public ScriptedAI
+};
+ class boss_essence_of_anger : public CreatureScript
{
- boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {}
+public:
+ boss_essence_of_anger() : CreatureScript("boss_essence_of_anger") { }
- uint64 AggroTargetGUID;
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new boss_essence_of_angerAI (pCreature);
+ }
- uint32 CheckTankTimer;
- uint32 SoulScreamTimer;
- uint32 SpiteTimer;
+ struct boss_essence_of_angerAI : public ScriptedAI
+ {
+ boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {}
- std::list<uint64> SpiteTargetGUID;
+ uint64 AggroTargetGUID;
- bool CheckedAggro;
+ uint32 CheckTankTimer;
+ uint32 SoulScreamTimer;
+ uint32 SpiteTimer;
- void Reset()
- {
- AggroTargetGUID = 0;
+ std::list<uint64> SpiteTargetGUID;
- CheckTankTimer = 5000;
- SoulScreamTimer = 10000;
- SpiteTimer = 30000;
+ bool CheckedAggro;
- SpiteTargetGUID.clear();
+ void Reset()
+ {
+ AggroTargetGUID = 0;
- CheckedAggro = false;
- }
+ CheckTankTimer = 5000;
+ SoulScreamTimer = 10000;
+ SpiteTimer = 30000;
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(ANGER_SAY_FREED,ANGER_SAY_FREED2), me);
+ SpiteTargetGUID.clear();
- DoZoneInCombat();
- DoCast(me, AURA_OF_ANGER, true);
- }
+ CheckedAggro = false;
+ }
- void JustDied(Unit * /*victim*/)
- {
- DoScriptText(ANGER_SAY_DEATH, me);
- }
+ void EnterCombat(Unit * /*who*/)
+ {
+ DoScriptText(RAND(ANGER_SAY_FREED,ANGER_SAY_FREED2), me);
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(ANGER_SAY_SLAY1,ANGER_SAY_SLAY2), me);
- }
+ DoZoneInCombat();
+ DoCast(me, AURA_OF_ANGER, true);
+ }
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ void JustDied(Unit * /*victim*/)
+ {
+ DoScriptText(ANGER_SAY_DEATH, me);
+ }
- if (!CheckedAggro)
+ void KilledUnit(Unit * /*victim*/)
{
- AggroTargetGUID = me->getVictim()->GetGUID();
- CheckedAggro = true;
+ DoScriptText(RAND(ANGER_SAY_SLAY1,ANGER_SAY_SLAY2), me);
}
- if (CheckTankTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (me->getVictim()->GetGUID() != AggroTargetGUID)
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ if (!CheckedAggro)
{
- DoScriptText(ANGER_SAY_BEFORE, me);
- DoCast(me, SPELL_SELF_SEETHE, true);
AggroTargetGUID = me->getVictim()->GetGUID();
+ CheckedAggro = true;
}
- CheckTankTimer = 2000;
- } else CheckTankTimer -= diff;
- if (SoulScreamTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SOUL_SCREAM);
- SoulScreamTimer = 9000 + rand()%2000;
- if (!(rand()%3))
+ if (CheckTankTimer <= diff)
{
+ if (me->getVictim()->GetGUID() != AggroTargetGUID)
+ {
+ DoScriptText(ANGER_SAY_BEFORE, me);
+ DoCast(me, SPELL_SELF_SEETHE, true);
+ AggroTargetGUID = me->getVictim()->GetGUID();
+ }
+ CheckTankTimer = 2000;
+ } else CheckTankTimer -= diff;
+
+ if (SoulScreamTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SOUL_SCREAM);
+ SoulScreamTimer = 9000 + rand()%2000;
+ if (!(rand()%3))
+ {
+ DoScriptText(ANGER_SAY_SPEC, me);
+ }
+ } else SoulScreamTimer -= diff;
+
+ if (SpiteTimer <= diff)
+ {
+ DoCast(me, SPELL_SPITE_TARGET);
+ SpiteTimer = 30000;
DoScriptText(ANGER_SAY_SPEC, me);
- }
- } else SoulScreamTimer -= diff;
+ } else SpiteTimer -= diff;
- if (SpiteTimer <= diff)
- {
- DoCast(me, SPELL_SPITE_TARGET);
- SpiteTimer = 30000;
- DoScriptText(ANGER_SAY_SPEC, me);
- } else SpiteTimer -= diff;
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-void npc_enslaved_soulAI::JustDied(Unit * /*killer*/)
-{
- if (ReliquaryGUID)
- if (Creature *Reliquary = (Unit::GetCreature((*me), ReliquaryGUID)))
- ++(CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount);
- DoCast(me, SPELL_SOUL_RELEASE, true);
-}
-CreatureAI* GetAI_boss_reliquary_of_souls(Creature* pCreature)
-{
- return new boss_reliquary_of_soulsAI (pCreature);
-}
-CreatureAI* GetAI_boss_essence_of_suffering(Creature* pCreature)
-{
- return new boss_essence_of_sufferingAI (pCreature);
-}
-CreatureAI* GetAI_boss_essence_of_desire(Creature* pCreature)
-{
- return new boss_essence_of_desireAI (pCreature);
-}
-CreatureAI* GetAI_boss_essence_of_anger(Creature* pCreature)
-{
- return new boss_essence_of_angerAI (pCreature);
-}
-CreatureAI* GetAI_npc_enslaved_soul(Creature* pCreature)
-{
- return new npc_enslaved_soulAI (pCreature);
-}
void AddSC_boss_reliquary_of_souls()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_reliquary_of_souls";
- newscript->GetAI = &GetAI_boss_reliquary_of_souls;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_essence_of_suffering";
- newscript->GetAI = &GetAI_boss_essence_of_suffering;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_essence_of_desire";
- newscript->GetAI = &GetAI_boss_essence_of_desire;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_essence_of_anger";
- newscript->GetAI = &GetAI_boss_essence_of_anger;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_enslaved_soul";
- newscript->GetAI = &GetAI_npc_enslaved_soul;
- newscript->RegisterSelf();
+ new boss_reliquary_of_souls();
+ new boss_essence_of_suffering();
+ new boss_essence_of_desire();
+ new boss_essence_of_anger();
+ new npc_enslaved_soul();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
index 937f52542be..f03398c3838 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
@@ -106,768 +106,773 @@ static Location BrokenWP[]=
#define CREATURE_BROKEN 23319
const uint32 spawnEntries[4]= { 23523, 23318, 23524 };
-
-struct mob_ashtongue_channelerAI : public ScriptedAI
+ class mob_ashtongue_channeler : public CreatureScript
{
- mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;}
+public:
+ mob_ashtongue_channeler() : CreatureScript("mob_ashtongue_channeler") { }
- uint64 ShadeGUID;
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new mob_ashtongue_channelerAI (pCreature);
+ }
- void Reset() {}
- void JustDied(Unit* /*killer*/);
- void EnterCombat(Unit* /*who*/) {}
- void AttackStart(Unit* /*who*/) {}
- void MoveInLineOfSight(Unit* /*who*/) {}
- void UpdateAI(const uint32 /*diff*/) {}
-};
+ struct mob_ashtongue_channelerAI : public ScriptedAI
+ {
+ mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;}
-struct mob_ashtongue_sorcererAI : public ScriptedAI
-{
- mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;}
+ uint64 ShadeGUID;
+
+ void Reset() {}
+ void JustDied(Unit* /*killer*/);
+ void EnterCombat(Unit* /*who*/) {}
+ void AttackStart(Unit* /*who*/) {}
+ void MoveInLineOfSight(Unit* /*who*/) {}
+ void UpdateAI(const uint32 /*diff*/) {}
+ };
- uint64 ShadeGUID;
- uint32 CheckTimer;
- bool StartBanishing;
+};
+ class mob_ashtongue_sorcerer : public CreatureScript
+{
+public:
+ mob_ashtongue_sorcerer() : CreatureScript("mob_ashtongue_sorcerer") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- StartBanishing = false;
- CheckTimer = 5000;
+ return new mob_ashtongue_sorcererAI (pCreature);
}
- void JustDied(Unit* /*killer*/);
- void EnterCombat(Unit* /*who*/) {}
- void AttackStart(Unit* /*who*/) {}
- void MoveInLineOfSight(Unit* /*who*/) {}
- void UpdateAI(const uint32 diff)
+ struct mob_ashtongue_sorcererAI : public ScriptedAI
{
- if (StartBanishing)
- return;
+ mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;}
- if (CheckTimer <= diff)
+ uint64 ShadeGUID;
+ uint32 CheckTimer;
+ bool StartBanishing;
+
+ void Reset()
{
- Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
- if (Shade && Shade->isAlive() && me->isAlive())
+ StartBanishing = false;
+ CheckTimer = 5000;
+ }
+
+ void JustDied(Unit* /*killer*/);
+ void EnterCombat(Unit* /*who*/) {}
+ void AttackStart(Unit* /*who*/) {}
+ void MoveInLineOfSight(Unit* /*who*/) {}
+ void UpdateAI(const uint32 diff)
+ {
+ if (StartBanishing)
+ return;
+
+ if (CheckTimer <= diff)
{
- if (me->IsWithinDist(Shade, 20,false))
+ Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
+ if (Shade && Shade->isAlive() && me->isAlive())
{
- me->GetMotionMaster()->Clear(false);
- me->GetMotionMaster()->MoveIdle();
- DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true);
- DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true);
+ if (me->IsWithinDist(Shade, 20,false))
+ {
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveIdle();
+ DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true);
+ DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true);
- StartBanishing = true;
+ StartBanishing = true;
+ }
}
- }
- CheckTimer = 2000;
- } else CheckTimer -= diff;
- }
-};
+ CheckTimer = 2000;
+ } else CheckTimer -= diff;
+ }
+ };
-struct boss_shade_of_akamaAI : public ScriptedAI
+};
+ class boss_shade_of_akama : public CreatureScript
{
- boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(me)
+public:
+ boss_shade_of_akama() : CreatureScript("boss_shade_of_akama") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
- AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0;
- me->setActive(true);//if view distance is too low
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ return new boss_shade_of_akamaAI (pCreature);
}
- ScriptedInstance* pInstance;
+ struct boss_shade_of_akamaAI : public ScriptedAI
+ {
+ boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(me)
+ {
+ pInstance = c->GetInstanceScript();
+ AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0;
+ me->setActive(true);//if view distance is too low
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
- std::list<uint64> Channelers;
- std::list<uint64> Sorcerers;
- uint64 AkamaGUID;
+ InstanceScript* pInstance;
- uint32 SorcererCount;
- uint32 DeathCount;
+ std::list<uint64> Channelers;
+ std::list<uint64> Sorcerers;
+ uint64 AkamaGUID;
- uint32 ReduceHealthTimer;
- uint32 SummonTimer;
- uint32 ResetTimer;
- uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon Creature timer.
+ uint32 SorcererCount;
+ uint32 DeathCount;
- bool IsBanished;
- bool HasKilledAkama;
- bool reseting;
- bool GridSearcherSucceeded;
- bool HasKilledAkamaAndReseting;
- SummonList summons;
+ uint32 ReduceHealthTimer;
+ uint32 SummonTimer;
+ uint32 ResetTimer;
+ uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon Creature timer.
- void Reset()
- {
- reseting = true;
- HasKilledAkamaAndReseting = false;
+ bool IsBanished;
+ bool HasKilledAkama;
+ bool reseting;
+ bool GridSearcherSucceeded;
+ bool HasKilledAkamaAndReseting;
+ SummonList summons;
- GridSearcherSucceeded = false;
+ void Reset()
+ {
+ reseting = true;
+ HasKilledAkamaAndReseting = false;
- Sorcerers.clear();
- summons.DespawnAll();//despawn all adds
+ GridSearcherSucceeded = false;
- if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID))
- {
- Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event
- if (Akama->isDead())
+ Sorcerers.clear();
+ summons.DespawnAll();//despawn all adds
+
+ if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID))
{
- Akama->Respawn();//respawn akama if dead
- Akama->AI()->EnterEvadeMode();
+ Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event
+ if (Akama->isDead())
+ {
+ Akama->Respawn();//respawn akama if dead
+ Akama->AI()->EnterEvadeMode();
+ }
}
- }
- SorcererCount = 0;
- DeathCount = 0;
-
- SummonTimer = 10000;
- ReduceHealthTimer = 0;
- ResetTimer = 60000;
- DefenderTimer = 15000;
+ SorcererCount = 0;
+ DeathCount = 0;
- IsBanished = true;
- HasKilledAkama = false;
+ SummonTimer = 10000;
+ ReduceHealthTimer = 0;
+ ResetTimer = 60000;
+ DefenderTimer = 15000;
- me->SetVisibility(VISIBILITY_ON);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //me->GetMotionMaster()->Clear();
- //me->GetMotionMaster()->MoveIdle();
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
+ IsBanished = true;
+ HasKilledAkama = false;
- if (pInstance)
- pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //me->GetMotionMaster()->Clear();
+ //me->GetMotionMaster()->MoveIdle();
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
- reseting = false;
- }
- void JustDied(Unit* /*killer*/)
- {
- summons.DespawnAll();
- }
- void JustSummoned(Creature *summon)
- {
- if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524)
- summons.Summon(summon);
- }
- void SummonedCreatureDespawn(Creature *summon)
- {
- if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524)
- summons.Despawn(summon);
- }
+ if (pInstance)
+ pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
- void MoveInLineOfSight(Unit * /*who*/)
- {
- if (!GridSearcherSucceeded)
+ reseting = false;
+ }
+ void JustDied(Unit* /*killer*/)
{
- FindChannelers();
+ summons.DespawnAll();
+ }
+ void JustSummoned(Creature *summon)
+ {
+ if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524)
+ summons.Summon(summon);
+ }
+ void SummonedCreatureDespawn(Creature *summon)
+ {
+ if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524)
+ summons.Despawn(summon);
+ }
- if (!Channelers.empty())
+ void MoveInLineOfSight(Unit * /*who*/)
+ {
+ if (!GridSearcherSucceeded)
{
- for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
+ FindChannelers();
+
+ if (!Channelers.empty())
{
- Creature* Channeler = (Unit::GetCreature(*me, *itr));
- if (Channeler)
+ for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
{
- if (Channeler->isDead())
+ Creature* Channeler = (Unit::GetCreature(*me, *itr));
+ if (Channeler)
{
- Channeler->RemoveCorpse();
- Channeler->Respawn();
- }
+ if (Channeler->isDead())
+ {
+ Channeler->RemoveCorpse();
+ Channeler->Respawn();
+ }
- Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true);
- Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL_2, true);
- Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- GridSearcherSucceeded = true;
+ Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true);
+ Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL_2, true);
+ Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ GridSearcherSucceeded = true;
+ }
}
- }
- } else sLog.outError("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
+ } else sLog.outError("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
+ }
}
- }
-
- void AttackStart(Unit* who)
- {
- if (!who || IsBanished) return;
- if (who->isTargetableForAttack() && who != me)
- DoStartMovement(who);
- }
-
- void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer
- {
- if (reseting)
- return;
-
- sLog.outDebug("TSCR: Increasing Death Count for Shade of Akama encounter");
- ++DeathCount;
- me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2);
- if (guid)
+ void AttackStart(Unit* who)
{
- if (Sorcerers.empty())
- sLog.outError("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid);
- else Sorcerers.remove(guid);
+ if (!who || IsBanished) return;
+
+ if (who->isTargetableForAttack() && who != me)
+ DoStartMovement(who);
}
- }
- void SummonCreature()
- {
- uint32 random = rand()%2;
- float X = SpawnLocations[random].x;
- float Y = SpawnLocations[random].y;
- // max of 6 sorcerers can be summoned
- if ((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7))
+ void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer
{
- Creature* Sorcerer = me->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
- if (Sorcerer)
+ if (reseting)
+ return;
+
+ sLog.outDebug("TSCR: Increasing Death Count for Shade of Akama encounter");
+ ++DeathCount;
+ me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2);
+ if (guid)
{
- CAST_AI(mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID();
- Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
- Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
- Sorcerers.push_back(Sorcerer->GetGUID());
- --DeathCount;
- ++SorcererCount;
+ if (Sorcerers.empty())
+ sLog.outError("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid);
+ else Sorcerers.remove(guid);
}
}
- else
+
+ void SummonCreature()
{
- for (uint8 i = 0; i < 3; ++i)
+ uint32 random = rand()%2;
+ float X = SpawnLocations[random].x;
+ float Y = SpawnLocations[random].y;
+ // max of 6 sorcerers can be summoned
+ if ((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7))
+ {
+ Creature* Sorcerer = me->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
+ if (Sorcerer)
+ {
+ CAST_AI(mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID();
+ Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
+ Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
+ Sorcerers.push_back(Sorcerer->GetGUID());
+ --DeathCount;
+ ++SorcererCount;
+ }
+ }
+ else
{
- Creature* Spawn = me->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
- if (Spawn)
+ for (uint8 i = 0; i < 3; ++i)
{
- Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z);
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- Spawn->AI()->AttackStart(pTarget);
+ Creature* Spawn = me->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
+ if (Spawn)
+ {
+ Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z);
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ Spawn->AI()->AttackStart(pTarget);
+ }
}
}
}
- }
- void FindChannelers()
- {
- std::list<Creature*> ChannelerList;
- me->GetCreatureListWithEntryInGrid(ChannelerList,CREATURE_CHANNELER,50.0f);
-
- if (!ChannelerList.empty())
+ void FindChannelers()
{
- for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
+ std::list<Creature*> ChannelerList;
+ me->GetCreatureListWithEntryInGrid(ChannelerList,CREATURE_CHANNELER,50.0f);
+
+ if (!ChannelerList.empty())
{
- CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID();
- Channelers.push_back((*itr)->GetGUID());
- sLog.outDebug("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID());
+ for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
+ {
+ CAST_AI(mob_ashtongue_channeler::mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID();
+ Channelers.push_back((*itr)->GetGUID());
+ sLog.outDebug("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID());
+ }
}
+ else sLog.outError("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy");
}
- else sLog.outError("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy");
- }
- void SetSelectableChannelers()
- {
- if (Channelers.empty())
+ void SetSelectableChannelers()
{
- sLog.outError("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy");
- return;
- }
-
- for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- if (Creature* Channeler = (Unit::GetCreature(*me, *itr)))
- Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
+ if (Channelers.empty())
+ {
+ sLog.outError("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy");
+ return;
+ }
- void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; }
+ for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
+ if (Creature* Channeler = (Unit::GetCreature(*me, *itr)))
+ Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!me->isInCombat())
- return;
+ void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; }
- if (IsBanished)
+ void UpdateAI(const uint32 diff)
{
- // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check
- if (me->getThreatManager().getThreatList().size() < 2)
- {
- EnterEvadeMode();
+ if (!me->isInCombat())
return;
- }
- if (DefenderTimer <= diff)
+ if (IsBanished)
{
- uint32 ran = rand()%2;
- Creature* Defender = me->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
- if (Defender)
+ // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check
+ if (me->getThreatManager().getThreatList().size() < 2)
{
- Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- bool move = true;
- if (AkamaGUID)
+ EnterEvadeMode();
+ return;
+ }
+
+ if (DefenderTimer <= diff)
+ {
+ uint32 ran = rand()%2;
+ Creature* Defender = me->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
+ if (Defender)
{
- if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID))
+ Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ bool move = true;
+ if (AkamaGUID)
{
- float x, y, z;
- Akama->GetPosition(x,y,z);
- // They move towards AKama
- Defender->GetMotionMaster()->MovePoint(0, x, y, z);
- Defender->AI()->AttackStart(Akama);
+ if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID))
+ {
+ float x, y, z;
+ Akama->GetPosition(x,y,z);
+ // They move towards AKama
+ Defender->GetMotionMaster()->MovePoint(0, x, y, z);
+ Defender->AI()->AttackStart(Akama);
+ } else move = false;
} else move = false;
- } else move = false;
- if (!move)
- Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z);
- }
- DefenderTimer = 15000;
- } else DefenderTimer -= diff;
+ if (!move)
+ Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z);
+ }
+ DefenderTimer = 15000;
+ } else DefenderTimer -= diff;
- if (SummonTimer <= diff)
- {
- SummonCreature();
- SummonTimer = 35000;
- } else SummonTimer -= diff;
+ if (SummonTimer <= diff)
+ {
+ SummonCreature();
+ SummonTimer = 35000;
+ } else SummonTimer -= diff;
- if (DeathCount >= 6)
- {
- if (AkamaGUID)
+ if (DeathCount >= 6)
{
- Creature* Akama = Unit::GetCreature((*me), AkamaGUID);
- if (Akama && Akama->isAlive())
+ if (AkamaGUID)
{
- IsBanished = false;
- me->GetMotionMaster()->Clear(false);
- me->GetMotionMaster()->MoveChase(Akama);
- Akama->GetMotionMaster()->Clear();
- // Shade should move to Akama, not the other way around
- Akama->GetMotionMaster()->MoveIdle();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Crazy amount of threat
- me->AddThreat(Akama, 10000000.0f);
- Akama->AddThreat(me, 10000000.0f);
- me->Attack(Akama, true);
- Akama->Attack(me, true);
+ Creature* Akama = Unit::GetCreature((*me), AkamaGUID);
+ if (Akama && Akama->isAlive())
+ {
+ IsBanished = false;
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveChase(Akama);
+ Akama->GetMotionMaster()->Clear();
+ // Shade should move to Akama, not the other way around
+ Akama->GetMotionMaster()->MoveIdle();
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Crazy amount of threat
+ me->AddThreat(Akama, 10000000.0f);
+ Akama->AddThreat(me, 10000000.0f);
+ me->Attack(Akama, true);
+ Akama->Attack(me, true);
+ }
}
}
}
- }
- else // No longer banished, let's fight Akama now
- {
- if (ReduceHealthTimer <= diff)
+ else // No longer banished, let's fight Akama now
{
- if (AkamaGUID)
+ if (ReduceHealthTimer <= diff)
{
- Creature* Akama = Unit::GetCreature((*me), AkamaGUID);
- if (Akama && Akama->isAlive())
+ if (AkamaGUID)
{
- //10 % less health every few seconds.
- me->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- ReduceHealthTimer = 12000;
+ Creature* Akama = Unit::GetCreature((*me), AkamaGUID);
+ if (Akama && Akama->isAlive())
+ {
+ //10 % less health every few seconds.
+ me->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ ReduceHealthTimer = 12000;
+ }
}
- }
- } else ReduceHealthTimer -= diff;
+ } else ReduceHealthTimer -= diff;
- if (HasKilledAkama)
- {
- if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug
+ if (HasKilledAkama)
{
- HasKilledAkamaAndReseting = true;
- me->RemoveAllAuras();
- me->DeleteThreatList();
- me->CombatStop();
- //me->SetHealth(me->GetMaxHealth());
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->GetMotionMaster()->MoveTargetedHome();
+ if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug
+ {
+ HasKilledAkamaAndReseting = true;
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop();
+ //me->SetHealth(me->GetMaxHealth());
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->GetMotionMaster()->MoveTargetedHome();
+ }
+ if (ResetTimer <= diff)
+ {
+ EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama
+ return;
+ } else ResetTimer -= diff;
}
- if (ResetTimer <= diff)
- {
- EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama
- return;
- } else ResetTimer -= diff;
- }
- DoMeleeAttackIfReady();
+ DoMeleeAttackIfReady();
+ }
}
- }
-};
+ };
-void mob_ashtongue_channelerAI::JustDied(Unit* /*killer*/)
+};
+ void mob_ashtongue_channeler::mob_ashtongue_channelerAI::JustDied(Unit* /*killer*/)
{
Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
if (Shade && Shade->isAlive())
- CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount();
+ CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount();
else sLog.outError("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama.");
}
-void mob_ashtongue_sorcererAI::JustDied(Unit* /*killer*/)
+void mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI::JustDied(Unit* /*killer*/)
{
Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
if (Shade && Shade->isAlive())
- CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(me->GetGUID());
+ CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(me->GetGUID());
else sLog.outError("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama.");
-}
-
-struct npc_akamaAI : public ScriptedAI
+} class npc_akama_shade : public CreatureScript
{
- npc_akamaAI(Creature* c) : ScriptedAI(c), summons(me)
- {
- ShadeHasDied = false;
- StartCombat = false;
- pInstance = c->GetInstanceData();
- ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED;
- me->setActive(true);
- EventBegun = false;
- CastSoulRetrieveTimer = 0;
- SoulRetrieveTimer = 0;
- SummonBrokenTimer = 0;
- EndingTalkCount = 0;
- WayPointId = 0;
- BrokenSummonIndex = 0;
- BrokenList.clear();
- HasYelledOnce = false;
- }
-
- ScriptedInstance* pInstance;
-
- uint64 ShadeGUID;
-
- uint32 DestructivePoisonTimer;
- uint32 LightningBoltTimer;
- uint32 CheckTimer;
- uint32 CastSoulRetrieveTimer;
- uint32 SoulRetrieveTimer;
- uint32 SummonBrokenTimer;
- uint32 EndingTalkCount;
- uint32 WayPointId;
- uint32 BrokenSummonIndex;
+public:
+ npc_akama_shade() : CreatureScript("npc_akama_shade") { }
- std::list<uint64> BrokenList;
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
+ {
+ pPlayer->CLOSE_GOSSIP_MENU();
+ CAST_AI(npc_akama_shade::npc_akamaAI, pCreature->AI())->BeginEvent(pPlayer);
+ }
- bool EventBegun;
- bool ShadeHasDied;
- bool StartCombat;
- bool HasYelledOnce;
- SummonList summons;
+ return true;
+ }
- void Reset()
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- DestructivePoisonTimer = 15000;
- LightningBoltTimer = 10000;
- CheckTimer = 2000;
-
- if (!EventBegun)
+ if (pPlayer->isAlive())
{
- me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
}
- summons.DespawnAll();
+
+ return true;
}
- void JustSummoned(Creature *summon)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (summon->GetEntry() == CREATURE_BROKEN)
- summons.Summon(summon);
+ return new npc_akamaAI (pCreature);
}
- void SummonedCreatureDespawn(Creature *summon)
+
+ struct npc_akamaAI : public ScriptedAI
{
- if (summon->GetEntry() == CREATURE_BROKEN)
- summons.Despawn(summon);
- }
+ npc_akamaAI(Creature* c) : ScriptedAI(c), summons(me)
+ {
+ ShadeHasDied = false;
+ StartCombat = false;
+ pInstance = c->GetInstanceScript();
+ ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED;
+ me->setActive(true);
+ EventBegun = false;
+ CastSoulRetrieveTimer = 0;
+ SoulRetrieveTimer = 0;
+ SummonBrokenTimer = 0;
+ EndingTalkCount = 0;
+ WayPointId = 0;
+ BrokenSummonIndex = 0;
+ BrokenList.clear();
+ HasYelledOnce = false;
+ }
- void EnterCombat(Unit* /*who*/) {}
+ InstanceScript* pInstance;
- void BeginEvent(Player* pl)
- {
- if (!pInstance)
- return;
+ uint64 ShadeGUID;
- ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA);
- if (!ShadeGUID)
- return;
+ uint32 DestructivePoisonTimer;
+ uint32 LightningBoltTimer;
+ uint32 CheckTimer;
+ uint32 CastSoulRetrieveTimer;
+ uint32 SoulRetrieveTimer;
+ uint32 SummonBrokenTimer;
+ uint32 EndingTalkCount;
+ uint32 WayPointId;
+ uint32 BrokenSummonIndex;
- Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
- if (Shade)
- {
- pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS);
- // Prevent players from trying to restart event
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(me->GetGUID());
- CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers();
- Shade->AddThreat(me, 1000000.0f);
- me->CombatStart(Shade);
- Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
- Shade->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
- if (pl) Shade->AddThreat(pl, 1.0f);
- DoZoneInCombat(Shade);
- EventBegun = true;
- }
- }
+ std::list<uint64> BrokenList;
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
+ bool EventBegun;
+ bool ShadeHasDied;
+ bool StartCombat;
+ bool HasYelledOnce;
+ SummonList summons;
- switch(id)
+ void Reset()
{
- case 0: ++WayPointId; break;
+ DestructivePoisonTimer = 15000;
+ LightningBoltTimer = 10000;
+ CheckTimer = 2000;
- case 1:
- if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID))
+ if (!EventBegun)
{
- me->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID);
- DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE);
- EndingTalkCount = 0;
- SoulRetrieveTimer = 16000;
+ me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
- break;
+ summons.DespawnAll();
}
- }
- void JustDied(Unit* /*killer*/)
- {
- DoScriptText(SAY_DEATH, me);
- EventBegun = false;
- ShadeHasDied = false;
- StartCombat = false;
- CastSoulRetrieveTimer = 0;
- SoulRetrieveTimer = 0;
- SummonBrokenTimer = 0;
- EndingTalkCount = 0;
- WayPointId = 0;
- BrokenSummonIndex = 0;
- BrokenList.clear();
- HasYelledOnce = false;
- Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
- if (Shade && Shade->isAlive())
- CAST_AI(boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true;
- summons.DespawnAll();
- }
+ void JustSummoned(Creature *summon)
+ {
+ if (summon->GetEntry() == CREATURE_BROKEN)
+ summons.Summon(summon);
+ }
+ void SummonedCreatureDespawn(Creature *summon)
+ {
+ if (summon->GetEntry() == CREATURE_BROKEN)
+ summons.Despawn(summon);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!EventBegun)
- return;
+ void EnterCombat(Unit* /*who*/) {}
- if ((me->GetHealth()*100 / me->GetMaxHealth()) < 15 && !HasYelledOnce)
+ void BeginEvent(Player* pl)
{
- DoScriptText(SAY_LOW_HEALTH, me);
- HasYelledOnce = true;
+ if (!pInstance)
+ return;
+
+ ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA);
+ if (!ShadeGUID)
+ return;
+
+ Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
+ if (Shade)
+ {
+ pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS);
+ // Prevent players from trying to restart event
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(me->GetGUID());
+ CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers();
+ Shade->AddThreat(me, 1000000.0f);
+ me->CombatStart(Shade);
+ Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ Shade->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
+ if (pl) Shade->AddThreat(pl, 1.0f);
+ DoZoneInCombat(Shade);
+ EventBegun = true;
+ }
}
- if (ShadeGUID && !StartCombat)
+ void MovementInform(uint32 type, uint32 id)
{
- Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
- if (Shade && Shade->isAlive())
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ switch(id)
{
- if (CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IsBanished)
- {
- if (CastSoulRetrieveTimer <= diff)
- {
- DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL);
- CastSoulRetrieveTimer = 500;
- } else CastSoulRetrieveTimer -= diff;
- }
- else
+ case 0: ++WayPointId; break;
+
+ case 1:
+ if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID))
{
- me->InterruptNonMeleeSpells(false);
- StartCombat = true;
+ me->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID);
+ DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE);
+ EndingTalkCount = 0;
+ SoulRetrieveTimer = 16000;
}
+ break;
}
}
- if (ShadeHasDied && (WayPointId == 1))
+ void JustDied(Unit* /*killer*/)
{
- if (pInstance)
- pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE);
- me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z);
- ++WayPointId;
+ DoScriptText(SAY_DEATH, me);
+ EventBegun = false;
+ ShadeHasDied = false;
+ StartCombat = false;
+ CastSoulRetrieveTimer = 0;
+ SoulRetrieveTimer = 0;
+ SummonBrokenTimer = 0;
+ EndingTalkCount = 0;
+ WayPointId = 0;
+ BrokenSummonIndex = 0;
+ BrokenList.clear();
+ HasYelledOnce = false;
+ Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
+ if (Shade && Shade->isAlive())
+ CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true;
+ summons.DespawnAll();
}
- if (!ShadeHasDied && StartCombat)
+ void UpdateAI(const uint32 diff)
{
- if (CheckTimer <= diff)
+ if (!EventBegun)
+ return;
+
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 15 && !HasYelledOnce)
+ {
+ DoScriptText(SAY_LOW_HEALTH, me);
+ HasYelledOnce = true;
+ }
+
+ if (ShadeGUID && !StartCombat)
{
- if (ShadeGUID)
+ Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
+ if (Shade && Shade->isAlive())
{
- Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
- if (Shade && !Shade->isAlive())
+ if (CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->IsBanished)
{
- ShadeHasDied = true;
- WayPointId = 0;
- me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
- me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
+ if (CastSoulRetrieveTimer <= diff)
+ {
+ DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL);
+ CastSoulRetrieveTimer = 500;
+ } else CastSoulRetrieveTimer -= diff;
}
- if (Shade && Shade->isAlive())
+ else
{
- if (Shade->getThreatManager().getThreatList().size() < 2)
- Shade->AI()->EnterEvadeMode();
+ me->InterruptNonMeleeSpells(false);
+ StartCombat = true;
}
}
- CheckTimer = 5000;
- } else CheckTimer -= diff;
- }
+ }
- if (SummonBrokenTimer && BrokenSummonIndex < 4)
- {
- if (SummonBrokenTimer <= diff)
+ if (ShadeHasDied && (WayPointId == 1))
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE);
+ me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z);
+ ++WayPointId;
+ }
+
+ if (!ShadeHasDied && StartCombat)
{
- for (uint8 i = 0; i < 4; ++i)
+ if (CheckTimer <= diff)
{
- float x = BrokenCoords[BrokenSummonIndex].x + (i*5);
- float y = BrokenCoords[BrokenSummonIndex].y + (1*5);
- float z = BrokenCoords[BrokenSummonIndex].z;
- float o = BrokenCoords[BrokenSummonIndex].o;
- Creature* Broken = me->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000);
- if (Broken)
+ if (ShadeGUID)
{
- float wx = BrokenWP[BrokenSummonIndex].x + (i*5);
- float wy = BrokenWP[BrokenSummonIndex].y + (i*5);
- float wz = BrokenWP[BrokenSummonIndex].z;
- Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz);
- Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- BrokenList.push_back(Broken->GetGUID());
+ Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
+ if (Shade && !Shade->isAlive())
+ {
+ ShadeHasDied = true;
+ WayPointId = 0;
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
+ }
+ if (Shade && Shade->isAlive())
+ {
+ if (Shade->getThreatManager().getThreatList().size() < 2)
+ Shade->AI()->EnterEvadeMode();
+ }
}
- }
- ++BrokenSummonIndex;
- SummonBrokenTimer = 1000;
- } else SummonBrokenTimer -= diff;
- }
+ CheckTimer = 5000;
+ } else CheckTimer -= diff;
+ }
- if (SoulRetrieveTimer)
- if (SoulRetrieveTimer <= diff)
+ if (SummonBrokenTimer && BrokenSummonIndex < 4)
{
- switch(EndingTalkCount)
+ if (SummonBrokenTimer <= diff)
{
- case 0:
- me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
- ++EndingTalkCount;
- SoulRetrieveTimer = 2000;
- SummonBrokenTimer = 1;
- break;
- case 1:
- DoScriptText(SAY_FREE, me);
- ++EndingTalkCount;
- SoulRetrieveTimer = 25000;
- break;
- case 2:
- if (!BrokenList.empty())
+ for (uint8 i = 0; i < 4; ++i)
{
- bool Yelled = false;
- for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if (Creature* pUnit = Unit::GetCreature(*me, *itr))
- {
- if (!Yelled)
- {
- DoScriptText(SAY_BROKEN_FREE_01, pUnit);
- Yelled = true;
- }
- pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
- }
- }
- ++EndingTalkCount;
- SoulRetrieveTimer = 1500;
- break;
- case 3:
- if (!BrokenList.empty())
- {
- for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if (Creature* pUnit = Unit::GetCreature(*me, *itr))
- // This is the incorrect spell, but can't seem to find the right one.
- pUnit->CastSpell(pUnit, 39656, true);
+ float x = BrokenCoords[BrokenSummonIndex].x + (i*5);
+ float y = BrokenCoords[BrokenSummonIndex].y + (1*5);
+ float z = BrokenCoords[BrokenSummonIndex].z;
+ float o = BrokenCoords[BrokenSummonIndex].o;
+ Creature* Broken = me->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000);
+ if (Broken)
+ {
+ float wx = BrokenWP[BrokenSummonIndex].x + (i*5);
+ float wy = BrokenWP[BrokenSummonIndex].y + (i*5);
+ float wz = BrokenWP[BrokenSummonIndex].z;
+ Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz);
+ Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ BrokenList.push_back(Broken->GetGUID());
+ }
}
- ++EndingTalkCount;
- SoulRetrieveTimer = 5000;
- break;
- case 4:
- if (!BrokenList.empty())
+ ++BrokenSummonIndex;
+ SummonBrokenTimer = 1000;
+ } else SummonBrokenTimer -= diff;
+ }
+
+ if (SoulRetrieveTimer)
+ if (SoulRetrieveTimer <= diff)
+ {
+ switch(EndingTalkCount)
{
- for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if (Creature* pUnit = Unit::GetCreature((*me), *itr))
- pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0);
+ case 0:
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 2000;
+ SummonBrokenTimer = 1;
+ break;
+ case 1:
+ DoScriptText(SAY_FREE, me);
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 25000;
+ break;
+ case 2:
+ if (!BrokenList.empty())
+ {
+ bool Yelled = false;
+ for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
+ if (Creature* pUnit = Unit::GetCreature(*me, *itr))
+ {
+ if (!Yelled)
+ {
+ DoScriptText(SAY_BROKEN_FREE_01, pUnit);
+ Yelled = true;
+ }
+ pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
+ }
+ }
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 1500;
+ break;
+ case 3:
+ if (!BrokenList.empty())
+ {
+ for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
+ if (Creature* pUnit = Unit::GetCreature(*me, *itr))
+ // This is the incorrect spell, but can't seem to find the right one.
+ pUnit->CastSpell(pUnit, 39656, true);
+ }
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 5000;
+ break;
+ case 4:
+ if (!BrokenList.empty())
+ {
+ for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
+ if (Creature* pUnit = Unit::GetCreature((*me), *itr))
+ pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0);
+ }
+ SoulRetrieveTimer = 0;
+ break;
}
- SoulRetrieveTimer = 0;
- break;
- }
- } else SoulRetrieveTimer -= diff;
+ } else SoulRetrieveTimer -= diff;
- if (!UpdateVictim())
- return;
-
- if (DestructivePoisonTimer <= diff)
- {
- Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
- if (Shade && Shade->isAlive())
- DoCast(Shade, SPELL_DESTRUCTIVE_POISON);
- DestructivePoisonTimer = 15000;
- } else DestructivePoisonTimer -= diff;
-
- if (LightningBoltTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT);
- LightningBoltTimer = 10000;
- } else LightningBoltTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_shade_of_akama(Creature* pCreature)
-{
- return new boss_shade_of_akamaAI (pCreature);
-}
-
-CreatureAI* GetAI_mob_ashtongue_channeler(Creature* pCreature)
-{
- return new mob_ashtongue_channelerAI (pCreature);
-}
+ if (!UpdateVictim())
+ return;
-CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature* pCreature)
-{
- return new mob_ashtongue_sorcererAI (pCreature);
-}
+ if (DestructivePoisonTimer <= diff)
+ {
+ Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
+ if (Shade && Shade->isAlive())
+ DoCast(Shade, SPELL_DESTRUCTIVE_POISON);
+ DestructivePoisonTimer = 15000;
+ } else DestructivePoisonTimer -= diff;
-CreatureAI* GetAI_npc_akama_shade(Creature* pCreature)
-{
- return new npc_akamaAI (pCreature);
-}
+ if (LightningBoltTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT);
+ LightningBoltTimer = 10000;
+ } else LightningBoltTimer -= diff;
-bool GossipSelect_npc_akama(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
- {
- pPlayer->CLOSE_GOSSIP_MENU();
- CAST_AI(npc_akamaAI, pCreature->AI())->BeginEvent(pPlayer);
- }
+ DoMeleeAttackIfReady();
+ }
+ };
- return true;
-}
+};
-bool GossipHello_npc_akama(Player* pPlayer, Creature* pCreature)
-{
- if (pPlayer->isAlive())
- {
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
- }
- return true;
-}
void AddSC_boss_shade_of_akama()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_shade_of_akama";
- newscript->GetAI = &GetAI_boss_shade_of_akama;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_ashtongue_channeler";
- newscript->GetAI = &GetAI_mob_ashtongue_channeler;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_ashtongue_sorcerer";
- newscript->GetAI = &GetAI_mob_ashtongue_sorcerer;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_akama_shade";
- newscript->GetAI = &GetAI_npc_akama_shade;
- newscript->pGossipHello = &GossipHello_npc_akama;
- newscript->pGossipSelect = &GossipSelect_npc_akama;
- newscript->RegisterSelf();
+ new boss_shade_of_akama();
+ new mob_ashtongue_channeler();
+ new mob_ashtongue_sorcerer();
+ new npc_akama_shade();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
index 7dc197994fe..6a1b3c4d735 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
@@ -52,247 +52,255 @@ EndScriptData */
#define EVENT_HATEFUL_STRIKE 6
#define GCD_CAST 1
-
-struct molten_flameAI : public NullCreatureAI
+ class molten_flame : public CreatureScript
{
- molten_flameAI(Creature *c) : NullCreatureAI(c) {}
+public:
+ molten_flame() : CreatureScript("molten_flame") { }
- void InitializeAI()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- float x, y, z;
- me->GetNearPoint(me, x, y, z, 1, 100, M_PI*2*rand_norm());
- me->GetMotionMaster()->MovePoint(0, x, y, z);
- me->SetVisibility(VISIBILITY_OFF);
- me->CastSpell(me,SPELL_MOLTEN_FLAME,true);
+ return new molten_flameAI (pCreature);
}
-};
-struct boss_supremusAI : public ScriptedAI
-{
- boss_supremusAI(Creature *c) : ScriptedAI(c), summons(me)
+ struct molten_flameAI : public NullCreatureAI
{
- pInstance = c->GetInstanceData();
- }
-
- ScriptedInstance* pInstance;
- EventMap events;
- SummonList summons;
- uint32 phase;
+ molten_flameAI(Creature *c) : NullCreatureAI(c) {}
- void Reset()
- {
- if (pInstance)
+ void InitializeAI()
{
- if (me->isAlive())
- {
- pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED);
- //ToggleDoors(true);
- }
- //else ToggleDoors(false);
+ float x, y, z;
+ me->GetNearPoint(me, x, y, z, 1, 100, M_PI*2*rand_norm());
+ me->GetMotionMaster()->MovePoint(0, x, y, z);
+ me->SetVisibility(VISIBILITY_OFF);
+ me->CastSpell(me,SPELL_MOLTEN_FLAME,true);
}
+ };
- phase = 0;
+};
+ class boss_supremus : public CreatureScript
+{
+public:
+ boss_supremus() : CreatureScript("boss_supremus") { }
- events.Reset();
- summons.DespawnAll();
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new boss_supremusAI (pCreature);
}
- void EnterCombat(Unit * /*who*/)
+ struct boss_supremusAI : public ScriptedAI
{
- if (pInstance)
- pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS);
+ boss_supremusAI(Creature *c) : ScriptedAI(c), summons(me)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- ChangePhase();
- events.ScheduleEvent(EVENT_BERSERK, 900000, GCD_CAST);
- events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST);
- }
+ InstanceScript* pInstance;
+ EventMap events;
+ SummonList summons;
+ uint32 phase;
- void ChangePhase()
- {
- if (!phase || phase == PHASE_CHASE)
+ void Reset()
{
- phase = PHASE_STRIKE;
- summons.DoAction(EVENT_VOLCANO, 0);
- events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE);
- me->SetSpeed(MOVE_RUN, 1.2f);
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
- me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
+ if (pInstance)
+ {
+ if (me->isAlive())
+ {
+ pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED);
+ //ToggleDoors(true);
+ }
+ //else ToggleDoors(false);
+ }
+
+ phase = 0;
+
+ events.Reset();
+ summons.DespawnAll();
}
- else
+
+ void EnterCombat(Unit * /*who*/)
{
- phase = PHASE_CHASE;
- events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE);
- events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE);
- me->SetSpeed(MOVE_RUN, 0.9f);
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ if (pInstance)
+ pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS);
+
+ ChangePhase();
+ events.ScheduleEvent(EVENT_BERSERK, 900000, GCD_CAST);
+ events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST);
}
- DoResetThreat();
- DoZoneInCombat();
- events.SetPhase(phase);
- events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST);
- }
- void JustDied(Unit * /*killer*/)
- {
- if (pInstance)
+ void ChangePhase()
{
- pInstance->SetData(DATA_SUPREMUSEVENT, DONE);
- pInstance->HandleGameObject(pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS), true);
+ if (!phase || phase == PHASE_CHASE)
+ {
+ phase = PHASE_STRIKE;
+ summons.DoAction(EVENT_VOLCANO, 0);
+ events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE);
+ me->SetSpeed(MOVE_RUN, 1.2f);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
+ }
+ else
+ {
+ phase = PHASE_CHASE;
+ events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE);
+ events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE);
+ me->SetSpeed(MOVE_RUN, 0.9f);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+ DoResetThreat();
+ DoZoneInCombat();
+ events.SetPhase(phase);
+ events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST);
}
- summons.DespawnAll();
- }
- void JustSummoned(Creature *summon) {summons.Summon(summon);}
- void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);}
+ void JustDied(Unit * /*killer*/)
+ {
+ if (pInstance)
+ {
+ pInstance->SetData(DATA_SUPREMUSEVENT, DONE);
+ pInstance->HandleGameObject(pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS), true);
+ }
+ summons.DespawnAll();
+ }
- Unit* CalculateHatefulStrikeTarget()
- {
- uint32 health = 0;
- Unit *pTarget = NULL;
+ void JustSummoned(Creature *summon) {summons.Summon(summon);}
+ void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);}
- std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
- std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
- for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i)
+ Unit* CalculateHatefulStrikeTarget()
{
- Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
- if (pUnit && me->IsWithinMeleeRange(pUnit))
+ uint32 health = 0;
+ Unit *pTarget = NULL;
+
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
+ std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
+ for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i)
{
- if (pUnit->GetHealth() > health)
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
+ if (pUnit && me->IsWithinMeleeRange(pUnit))
{
- health = pUnit->GetHealth();
- pTarget = pUnit;
+ if (pUnit->GetHealth() > health)
+ {
+ health = pUnit->GetHealth();
+ pTarget = pUnit;
+ }
}
}
- }
- return pTarget;
- }
+ return pTarget;
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
- events.Update(diff);
+ events.Update(diff);
- while (uint32 eventId = events.ExecuteEvent())
- {
- switch(eventId)
+ while (uint32 eventId = events.ExecuteEvent())
{
- case EVENT_BERSERK:
- DoCast(me, SPELL_BERSERK, true);
- break;
- case EVENT_FLAME:
- DoCast(me, SPELL_MOLTEN_PUNCH);
- events.DelayEvents(1500, GCD_CAST);
- events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST);
- break;
- case EVENT_HATEFUL_STRIKE:
- if (Unit *pTarget = CalculateHatefulStrikeTarget())
- DoCast(pTarget, SPELL_HATEFUL_STRIKE);
- events.DelayEvents(1000, GCD_CAST);
- events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE);
- break;
- case EVENT_SWITCH_TARGET:
- if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
- {
- DoResetThreat();
- me->AddThreat(pTarget, 5000000.0f);
- DoScriptText(EMOTE_NEW_TARGET, me);
- }
- events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE);
- break;
- case EVENT_VOLCANO:
+ switch(eventId)
{
- Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true);
- if (!pTarget) pTarget = me->getVictim();
- if (pTarget)
- {
- //DoCast(pTarget, SPELL_VOLCANIC_SUMMON);//movement bugged
- me->SummonCreature(CREATURE_VOLCANO,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000);
- DoScriptText(EMOTE_GROUND_CRACK, me);
+ case EVENT_BERSERK:
+ DoCast(me, SPELL_BERSERK, true);
+ break;
+ case EVENT_FLAME:
+ DoCast(me, SPELL_MOLTEN_PUNCH);
events.DelayEvents(1500, GCD_CAST);
+ events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST);
+ break;
+ case EVENT_HATEFUL_STRIKE:
+ if (Unit *pTarget = CalculateHatefulStrikeTarget())
+ DoCast(pTarget, SPELL_HATEFUL_STRIKE);
+ events.DelayEvents(1000, GCD_CAST);
+ events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE);
+ break;
+ case EVENT_SWITCH_TARGET:
+ if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
+ {
+ DoResetThreat();
+ me->AddThreat(pTarget, 5000000.0f);
+ DoScriptText(EMOTE_NEW_TARGET, me);
+ }
+ events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE);
+ break;
+ case EVENT_VOLCANO:
+ {
+ Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true);
+ if (!pTarget) pTarget = me->getVictim();
+ if (pTarget)
+ {
+ //DoCast(pTarget, SPELL_VOLCANIC_SUMMON);//movement bugged
+ me->SummonCreature(CREATURE_VOLCANO,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000);
+ DoScriptText(EMOTE_GROUND_CRACK, me);
+ events.DelayEvents(1500, GCD_CAST);
+ }
+ events.ScheduleEvent(EVENT_VOLCANO, 10000, GCD_CAST, PHASE_CHASE);
+ return;
}
- events.ScheduleEvent(EVENT_VOLCANO, 10000, GCD_CAST, PHASE_CHASE);
- return;
+ case EVENT_SWITCH_PHASE:
+ ChangePhase();
+ break;
}
- case EVENT_SWITCH_PHASE:
- ChangePhase();
- break;
}
+
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
- }
};
-
-struct npc_volcanoAI : public Scripted_NoMovementAI
+ class npc_volcano : public CreatureScript
{
- npc_volcanoAI(Creature *c) : Scripted_NoMovementAI(c) {}
+public:
+ npc_volcano() : CreatureScript("npc_volcano") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //DoCast(me, SPELL_VOLCANIC_ERUPTION);
- me->SetReactState(REACT_PASSIVE);
- wait = 3000;
+ return new npc_volcanoAI (pCreature);
}
- uint32 wait;
- void EnterCombat(Unit * /*who*/) {}
+ struct npc_volcanoAI : public Scripted_NoMovementAI
+ {
+ npc_volcanoAI(Creature *c) : Scripted_NoMovementAI(c) {}
+
+ void Reset()
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //DoCast(me, SPELL_VOLCANIC_ERUPTION);
+ me->SetReactState(REACT_PASSIVE);
+ wait = 3000;
+ }
+ uint32 wait;
+
+ void EnterCombat(Unit * /*who*/) {}
- void MoveInLineOfSight(Unit * /*who*/) {}
+ void MoveInLineOfSight(Unit * /*who*/) {}
- void DoAction(const uint32 /*info*/)
- {
- me->RemoveAura(SPELL_VOLCANIC_ERUPTION);
- }
+ void DoAction(const uint32 /*info*/)
+ {
+ me->RemoveAura(SPELL_VOLCANIC_ERUPTION);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (wait <= diff)//wait 3secs before casting
+ void UpdateAI(const uint32 diff)
{
- DoCast(me, SPELL_VOLCANIC_ERUPTION);
- wait = 60000;
+ if (wait <= diff)//wait 3secs before casting
+ {
+ DoCast(me, SPELL_VOLCANIC_ERUPTION);
+ wait = 60000;
+ }
+ else wait -= diff;
}
- else wait -= diff;
- }
+
+ };
};
-CreatureAI* GetAI_boss_supremus(Creature* pCreature)
-{
- return new boss_supremusAI (pCreature);
-}
-CreatureAI* GetAI_molten_flame(Creature* pCreature)
-{
- return new molten_flameAI (pCreature);
-}
-CreatureAI* GetAI_npc_volcano(Creature* pCreature)
-{
- return new npc_volcanoAI (pCreature);
-}
void AddSC_boss_supremus()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_supremus";
- newscript->GetAI = &GetAI_boss_supremus;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "molten_flame";
- newscript->GetAI = &GetAI_molten_flame;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_volcano";
- newscript->GetAI = &GetAI_npc_volcano;
- newscript->RegisterSelf();
+ new boss_supremus();
+ new molten_flame();
+ new npc_volcano();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
index 92b5a0a6134..ca398c36564 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
@@ -50,461 +50,469 @@ EndScriptData */
#define CREATURE_DOOM_BLOSSOM 23123
#define CREATURE_SHADOWY_CONSTRUCT 23111
-
-struct mob_doom_blossomAI : public ScriptedAI
+ class mob_doom_blossom : public CreatureScript
{
- mob_doom_blossomAI(Creature *c) : ScriptedAI(c) {}
-
- uint32 CheckTeronTimer;
- uint32 ShadowBoltTimer;
- uint64 TeronGUID;
+public:
+ mob_doom_blossom() : CreatureScript("mob_doom_blossom") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- CheckTeronTimer = 5000;
- ShadowBoltTimer = 12000;
- TeronGUID = 0;
+ return new mob_doom_blossomAI(pCreature);
}
- void EnterCombat(Unit * /*who*/) { }
- void AttackStart(Unit* /*who*/) {}
- void MoveInLineOfSight(Unit* /*who*/) {}
-
- void Despawn()
+ struct mob_doom_blossomAI : public ScriptedAI
{
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- me->RemoveCorpse();
- }
+ mob_doom_blossomAI(Creature *c) : ScriptedAI(c) {}
- void UpdateAI(const uint32 diff)
- {
- if (CheckTeronTimer <= diff)
+ uint32 CheckTeronTimer;
+ uint32 ShadowBoltTimer;
+ uint64 TeronGUID;
+
+ void Reset()
+ {
+ CheckTeronTimer = 5000;
+ ShadowBoltTimer = 12000;
+ TeronGUID = 0;
+ }
+
+ void EnterCombat(Unit * /*who*/) { }
+ void AttackStart(Unit* /*who*/) {}
+ void MoveInLineOfSight(Unit* /*who*/) {}
+
+ void Despawn()
+ {
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveCorpse();
+ }
+
+ void UpdateAI(const uint32 diff)
{
- if (TeronGUID)
+ if (CheckTeronTimer <= diff)
{
- DoZoneInCombat();
+ if (TeronGUID)
+ {
+ DoZoneInCombat();
- Creature* Teron = (Unit::GetCreature((*me), TeronGUID));
- if ((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
+ Creature* Teron = (Unit::GetCreature((*me), TeronGUID));
+ if ((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
+ Despawn();
+ }
+ else
Despawn();
- }
- else
- Despawn();
- CheckTeronTimer = 5000;
- } else CheckTeronTimer -= diff;
+ CheckTeronTimer = 5000;
+ } else CheckTeronTimer -= diff;
- if (ShadowBoltTimer < diff && me->isInCombat())
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT);
- ShadowBoltTimer = 10000;
- } else ShadowBoltTimer -= diff;
- return;
- }
+ if (ShadowBoltTimer < diff && me->isInCombat())
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT);
+ ShadowBoltTimer = 10000;
+ } else ShadowBoltTimer -= diff;
+ return;
+ }
- void SetTeronGUID(uint64 guid){ TeronGUID = guid; }
-};
+ void SetTeronGUID(uint64 guid){ TeronGUID = guid; }
+ };
-struct mob_shadowy_constructAI : public ScriptedAI
+};
+ class mob_shadowy_construct : public CreatureScript
{
- mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {}
-
- uint64 GhostGUID;
- uint64 TeronGUID;
+public:
+ mob_shadowy_construct() : CreatureScript("mob_shadowy_construct") { }
- uint32 CheckPlayerTimer;
- uint32 CheckTeronTimer;
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new mob_shadowy_constructAI(pCreature);
+ }
- void Reset()
+ struct mob_shadowy_constructAI : public ScriptedAI
{
- GhostGUID = 0;
- TeronGUID = 0;
+ mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {}
- CheckPlayerTimer = 2000;
- CheckTeronTimer = 5000;
- }
+ uint64 GhostGUID;
+ uint64 TeronGUID;
- void EnterCombat(Unit* /*who*/) {}
+ uint32 CheckPlayerTimer;
+ uint32 CheckTeronTimer;
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID))
- return;
+ void Reset()
+ {
+ GhostGUID = 0;
+ TeronGUID = 0;
- ScriptedAI::MoveInLineOfSight(who);
- }
+ CheckPlayerTimer = 2000;
+ CheckTeronTimer = 5000;
+ }
-/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED
- void DamageTaken(Unit* done_by, uint32 &damage)
- {
- if (done_by->GetGUID() != GhostGUID)
- damage = 0; // Only the ghost can deal damage.
- }
- */
+ void EnterCombat(Unit* /*who*/) {}
- void CheckPlayers()
- {
- std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
- if (m_threatlist.empty())
- return; // No threat list. Don't continue.
- std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
- std::list<Unit*> targets;
- for (; itr != m_threatlist.end(); ++itr)
+ void MoveInLineOfSight(Unit *who)
{
- Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
- if (pUnit && pUnit->isAlive())
- targets.push_back(pUnit);
+ if (!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID))
+ return;
+
+ ScriptedAI::MoveInLineOfSight(who);
}
- targets.sort(Trinity::ObjectDistanceOrderPred(me));
- Unit *pTarget = targets.front();
- if (pTarget && me->IsWithinDistInMap(pTarget, me->GetAttackDistance(pTarget)))
+
+ /* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED
+ void DamageTaken(Unit* done_by, uint32 &damage)
{
- DoCast(pTarget, SPELL_ATROPHY);
- me->AI()->AttackStart(pTarget);
+ if (done_by->GetGUID() != GhostGUID)
+ damage = 0; // Only the ghost can deal damage.
}
- }
+ */
- void UpdateAI(const uint32 diff)
- {
- if (CheckPlayerTimer <= diff)
+ void CheckPlayers()
{
- CheckPlayers();
- CheckPlayerTimer = 3000;
- } else CheckPlayerTimer -= diff;
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
+ if (m_threatlist.empty())
+ return; // No threat list. Don't continue.
+ std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
+ std::list<Unit*> targets;
+ for (; itr != m_threatlist.end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
+ if (pUnit && pUnit->isAlive())
+ targets.push_back(pUnit);
+ }
+ targets.sort(Trinity::ObjectDistanceOrderPred(me));
+ Unit *pTarget = targets.front();
+ if (pTarget && me->IsWithinDistInMap(pTarget, me->GetAttackDistance(pTarget)))
+ {
+ DoCast(pTarget, SPELL_ATROPHY);
+ me->AI()->AttackStart(pTarget);
+ }
+ }
- if (CheckTeronTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- Creature* Teron = (Unit::GetCreature((*me), TeronGUID));
- if (!Teron || !Teron->isAlive() || Teron->IsInEvadeMode())
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ if (CheckPlayerTimer <= diff)
+ {
+ CheckPlayers();
+ CheckPlayerTimer = 3000;
+ } else CheckPlayerTimer -= diff;
- CheckTeronTimer = 5000;
- } else CheckTeronTimer -= diff;
- }
-};
+ if (CheckTeronTimer <= diff)
+ {
+ Creature* Teron = (Unit::GetCreature((*me), TeronGUID));
+ if (!Teron || !Teron->isAlive() || Teron->IsInEvadeMode())
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-struct boss_teron_gorefiendAI : public ScriptedAI
+ CheckTeronTimer = 5000;
+ } else CheckTeronTimer -= diff;
+ }
+ };
+
+};
+ class boss_teron_gorefiend : public CreatureScript
{
- boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_teron_gorefiend() : CreatureScript("boss_teron_gorefiend") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new boss_teron_gorefiendAI (pCreature);
}
- ScriptedInstance* pInstance;
+ struct boss_teron_gorefiendAI : public ScriptedAI
+ {
+ boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- uint32 IncinerateTimer;
- uint32 SummonDoomBlossomTimer;
- uint32 EnrageTimer;
- uint32 CrushingShadowsTimer;
- uint32 ShadowOfDeathTimer;
- uint32 SummonShadowsTimer;
- uint32 RandomYellTimer;
- uint32 AggroTimer;
+ InstanceScript* pInstance;
- uint64 AggroTargetGUID;
- uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost
+ uint32 IncinerateTimer;
+ uint32 SummonDoomBlossomTimer;
+ uint32 EnrageTimer;
+ uint32 CrushingShadowsTimer;
+ uint32 ShadowOfDeathTimer;
+ uint32 SummonShadowsTimer;
+ uint32 RandomYellTimer;
+ uint32 AggroTimer;
- bool Intro;
- bool Done;
+ uint64 AggroTargetGUID;
+ uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost
- void Reset()
- {
- if (pInstance)
- pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED);
-
- IncinerateTimer = 20000 + rand()%11000;
- SummonDoomBlossomTimer = 12000;
- EnrageTimer = 600000;
- CrushingShadowsTimer = 22000;
- SummonShadowsTimer = 60000;
- RandomYellTimer = 50000;
-
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Start off unattackable so that the intro is done properly
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- AggroTimer = 20000;
- AggroTargetGUID = 0;
- Intro = false;
- Done = false;
- }
+ bool Intro;
+ bool Done;
- void EnterCombat(Unit * /*who*/) {}
+ void Reset()
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED);
- void MoveInLineOfSight(Unit* pWho)
- {
- if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && me->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(me))
+ IncinerateTimer = 20000 + rand()%11000;
+ SummonDoomBlossomTimer = 12000;
+ EnrageTimer = 600000;
+ CrushingShadowsTimer = 22000;
+ SummonShadowsTimer = 60000;
+ RandomYellTimer = 50000;
+
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Start off unattackable so that the intro is done properly
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ AggroTimer = 20000;
+ AggroTargetGUID = 0;
+ Intro = false;
+ Done = false;
+ }
+
+ void EnterCombat(Unit * /*who*/) {}
+
+ void MoveInLineOfSight(Unit* pWho)
{
- if (me->IsWithinDistInMap(pWho, VISIBLE_RANGE) && me->IsWithinLOSInMap(pWho))
+ if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && me->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(me))
{
- if (pInstance)
- pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS);
-
- me->GetMotionMaster()->Clear(false);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoScriptText(SAY_INTRO, me);
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
- AggroTargetGUID = pWho->GetGUID();
- Intro = true;
+ if (me->IsWithinDistInMap(pWho, VISIBLE_RANGE) && me->IsWithinLOSInMap(pWho))
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS);
+
+ me->GetMotionMaster()->Clear(false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoScriptText(SAY_INTRO, me);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
+ AggroTargetGUID = pWho->GetGUID();
+ Intro = true;
+ }
}
+ if (Done)
+ ScriptedAI::MoveInLineOfSight(pWho);
}
- if (Done)
- ScriptedAI::MoveInLineOfSight(pWho);
- }
-
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
- }
-
- void JustDied(Unit * /*victim*/)
- {
- if (pInstance)
- pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE);
-
- DoScriptText(SAY_DEATH, me);
- }
- float CalculateRandomLocation(float Loc, uint32 radius)
- {
- float coord = Loc;
- switch (urand(0,1))
+ void KilledUnit(Unit * /*victim*/)
{
- case 0:
- coord += rand()%radius;
- break;
- case 1:
- coord -= rand()%radius;
- break;
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
- return coord;
- }
- void SetThreatList(Creature* Blossom)
- {
- if (!Blossom) return;
+ void JustDied(Unit * /*victim*/)
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE);
- std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
- std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
- for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
+ DoScriptText(SAY_DEATH, me);
+ }
+
+ float CalculateRandomLocation(float Loc, uint32 radius)
{
- Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
- if (pUnit && pUnit->isAlive())
+ float coord = Loc;
+ switch (urand(0,1))
{
- float threat = DoGetThreat(pUnit);
- Blossom->AddThreat(pUnit, threat);
+ case 0:
+ coord += rand()%radius;
+ break;
+ case 1:
+ coord -= rand()%radius;
+ break;
}
+ return coord;
}
- }
- void MindControlGhost()
- {
- /************************************************************************/
- /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/
- /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/
- /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/
- /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/
- /************************************************************************/
-
- Unit* Ghost = NULL;
- if (GhostGUID)
- Ghost = Unit::GetUnit((*me), GhostGUID);
- if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH))
+ void SetThreatList(Creature* Blossom)
{
- /*float x,y,z;
- Ghost->GetPosition(x,y,z);
- Creature* control = me->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
- if (control)
- {
- CAST_PLR(Ghost)->Possess(control);
- Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL,
- false);
- }*/
- for (uint8 i = 0; i < 4; ++i)
+ if (!Blossom) return;
+
+ std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
+ std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
+ for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
{
- Creature* Construct = NULL;
- float X = CalculateRandomLocation(Ghost->GetPositionX(), 10);
- float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10);
- Construct = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
- if (Construct)
+ Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
+ if (pUnit && pUnit->isAlive())
{
- Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true);
- SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List.
- CAST_AI(mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID;
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if (!pTarget) // someone's trying to solo.
- pTarget = me->getVictim();
-
- if (pTarget)
- Construct->GetMotionMaster()->MoveChase(pTarget);
+ float threat = DoGetThreat(pUnit);
+ Blossom->AddThreat(pUnit, threat);
}
}
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (Intro && !Done)
+ void MindControlGhost()
{
- if (AggroTimer <= diff)
+ /************************************************************************/
+ /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/
+ /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/
+ /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/
+ /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/
+ /************************************************************************/
+
+ Unit* Ghost = NULL;
+ if (GhostGUID)
+ Ghost = Unit::GetUnit((*me), GhostGUID);
+ if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH))
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- DoScriptText(SAY_AGGRO, me);
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
- Done = true;
- if (AggroTargetGUID)
+ /*float x,y,z;
+ Ghost->GetPosition(x,y,z);
+ Creature* control = me->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
+ if (control)
{
- Unit* pUnit = Unit::GetUnit((*me), AggroTargetGUID);
- if (pUnit)
- AttackStart(pUnit);
-
- DoZoneInCombat();
- }
- else
+ CAST_PLR(Ghost)->Possess(control);
+ Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL,
+ false);
+ }*/
+ for (uint8 i = 0; i < 4; ++i)
{
- EnterEvadeMode();
- return;
+ Creature* Construct = NULL;
+ float X = CalculateRandomLocation(Ghost->GetPositionX(), 10);
+ float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10);
+ Construct = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ if (Construct)
+ {
+ Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true);
+ SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List.
+ CAST_AI(mob_shadowy_construct::mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID;
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if (!pTarget) // someone's trying to solo.
+ pTarget = me->getVictim();
+
+ if (pTarget)
+ Construct->GetMotionMaster()->MoveChase(pTarget);
+ }
}
- } else AggroTimer -= diff;
+ }
}
- if (!UpdateVictim() || !Done)
- return;
-
- if (SummonShadowsTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- //MindControlGhost();
-
- for (uint8 i = 0; i < 2; ++i)
+ if (Intro && !Done)
{
- Creature* Shadow = NULL;
- float X = CalculateRandomLocation(me->GetPositionX(), 10);
- Shadow = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0);
- if (Shadow)
+ if (AggroTimer <= diff)
{
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if (!pTarget)
- pTarget = me->getVictim();
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoScriptText(SAY_AGGRO, me);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ Done = true;
+ if (AggroTargetGUID)
+ {
+ Unit* pUnit = Unit::GetUnit((*me), AggroTargetGUID);
+ if (pUnit)
+ AttackStart(pUnit);
+
+ DoZoneInCombat();
+ }
+ else
+ {
+ EnterEvadeMode();
+ return;
+ }
+ } else AggroTimer -= diff;
+ }
- if (pTarget)
- Shadow->AI()->AttackStart(pTarget);
+ if (!UpdateVictim() || !Done)
+ return;
+
+ if (SummonShadowsTimer <= diff)
+ {
+ //MindControlGhost();
+
+ for (uint8 i = 0; i < 2; ++i)
+ {
+ Creature* Shadow = NULL;
+ float X = CalculateRandomLocation(me->GetPositionX(), 10);
+ Shadow = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0);
+ if (Shadow)
+ {
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if (!pTarget)
+ pTarget = me->getVictim();
+
+ if (pTarget)
+ Shadow->AI()->AttackStart(pTarget);
+ }
}
- }
- SummonShadowsTimer = 60000;
- } else SummonShadowsTimer -= diff;
+ SummonShadowsTimer = 60000;
+ } else SummonShadowsTimer -= diff;
- if (SummonDoomBlossomTimer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ if (SummonDoomBlossomTimer <= diff)
{
- float X = CalculateRandomLocation(pTarget->GetPositionX(), 20);
- float Y = CalculateRandomLocation(pTarget->GetPositionY(), 20);
- float Z = pTarget->GetPositionZ();
- Z = me->GetMap()->GetHeight(X, Y, Z);
- Creature* DoomBlossom = me->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
- if (DoomBlossom)
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
- DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoomBlossom->setFaction(me->getFaction());
- DoomBlossom->AddThreat(pTarget, 1.0f);
- CAST_AI(mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(me->GetGUID());
- pTarget->CombatStart(DoomBlossom);
- SetThreatList(DoomBlossom);
- SummonDoomBlossomTimer = 35000;
+ float X = CalculateRandomLocation(pTarget->GetPositionX(), 20);
+ float Y = CalculateRandomLocation(pTarget->GetPositionY(), 20);
+ float Z = pTarget->GetPositionZ();
+ Z = me->GetMap()->GetHeight(X, Y, Z);
+ Creature* DoomBlossom = me->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
+ if (DoomBlossom)
+ {
+ DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoomBlossom->setFaction(me->getFaction());
+ DoomBlossom->AddThreat(pTarget, 1.0f);
+ CAST_AI(mob_doom_blossom::mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(me->GetGUID());
+ pTarget->CombatStart(DoomBlossom);
+ SetThreatList(DoomBlossom);
+ SummonDoomBlossomTimer = 35000;
+ }
}
- }
- } else SummonDoomBlossomTimer -= diff;
+ } else SummonDoomBlossomTimer -= diff;
- if (IncinerateTimer <= diff)
- {
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if (!pTarget)
- pTarget = me->getVictim();
+ if (IncinerateTimer <= diff)
+ {
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if (!pTarget)
+ pTarget = me->getVictim();
+
+ if (pTarget)
+ {
+ DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), me);
+ DoCast(pTarget, SPELL_INCINERATE);
+ IncinerateTimer = 20000 + rand()%31 * 1000;
+ }
+ } else IncinerateTimer -= diff;
- if (pTarget)
+ if (CrushingShadowsTimer <= diff)
{
- DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), me);
- DoCast(pTarget, SPELL_INCINERATE);
- IncinerateTimer = 20000 + rand()%31 * 1000;
- }
- } else IncinerateTimer -= diff;
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget && pTarget->isAlive())
+ DoCast(pTarget, SPELL_CRUSHING_SHADOWS);
+ CrushingShadowsTimer = 10000 + rand()%16 * 1000;
+ } else CrushingShadowsTimer -= diff;
+
+ /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/
+ /*if (ShadowOfDeathTimer <= diff)
+ {
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if (CrushingShadowsTimer <= diff)
- {
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget && pTarget->isAlive())
- DoCast(pTarget, SPELL_CRUSHING_SHADOWS);
- CrushingShadowsTimer = 10000 + rand()%16 * 1000;
- } else CrushingShadowsTimer -= diff;
-
- /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/
- /*if (ShadowOfDeathTimer <= diff)
- {
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if (!pTarget)
+ pTarget = me->getVictim();
- if (!pTarget)
- pTarget = me->getVictim();
+ if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoCast(pTarget, SPELL_SHADOW_OF_DEATH);
+ GhostGUID = pTarget->GetGUID();
+ ShadowOfDeathTimer = 30000;
+ SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player
+ }
+ } else ShadowOfDeathTimer -= diff;*/
- if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
+ if (RandomYellTimer <= diff)
{
- DoCast(pTarget, SPELL_SHADOW_OF_DEATH);
- GhostGUID = pTarget->GetGUID();
- ShadowOfDeathTimer = 30000;
- SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player
- }
- } else ShadowOfDeathTimer -= diff;*/
+ DoScriptText(RAND(SAY_SPELL1,SAY_SPELL2), me);
+ RandomYellTimer = 50000 + rand()%51 * 1000;
+ } else RandomYellTimer -= diff;
- if (RandomYellTimer <= diff)
- {
- DoScriptText(RAND(SAY_SPELL1,SAY_SPELL2), me);
- RandomYellTimer = 50000 + rand()%51 * 1000;
- } else RandomYellTimer -= diff;
+ if (!me->HasAura(SPELL_BERSERK))
+ {
+ if (EnrageTimer <= diff)
+ {
+ DoCast(me, SPELL_BERSERK);
+ DoScriptText(SAY_ENRAGE, me);
+ } else EnrageTimer -= diff;
+ }
- if (!me->HasAura(SPELL_BERSERK))
- {
- if (EnrageTimer <= diff)
- {
- DoCast(me, SPELL_BERSERK);
- DoScriptText(SAY_ENRAGE, me);
- } else EnrageTimer -= diff;
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_doom_blossom(Creature* pCreature)
-{
- return new mob_doom_blossomAI(pCreature);
-}
-CreatureAI* GetAI_mob_shadowy_construct(Creature* pCreature)
-{
- return new mob_shadowy_constructAI(pCreature);
-}
-CreatureAI* GetAI_boss_teron_gorefiend(Creature* pCreature)
-{
- return new boss_teron_gorefiendAI (pCreature);
-}
void AddSC_boss_teron_gorefiend()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "mob_doom_blossom";
- newscript->GetAI = &GetAI_mob_doom_blossom;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_shadowy_construct";
- newscript->GetAI = &GetAI_mob_shadowy_construct;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_teron_gorefiend";
- newscript->GetAI = &GetAI_boss_teron_gorefiend;
- newscript->RegisterSelf();
+ new mob_doom_blossom();
+ new mob_shadowy_construct();
+ new boss_teron_gorefiend();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
index 3f39cb0aea7..766f020291f 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
@@ -59,170 +59,174 @@ enum eEnums
GCD_CAST = 1,
GCD_YELL = 2
};
-
-struct boss_najentusAI : public ScriptedAI
+ class boss_najentus : public CreatureScript
{
- boss_najentusAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_najentus() : CreatureScript("boss_najentus") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new boss_najentusAI (pCreature);
}
- ScriptedInstance* pInstance;
- EventMap events;
-
- uint64 SpineTargetGUID;
-
- void Reset()
+ struct boss_najentusAI : public ScriptedAI
{
- events.Reset();
+ boss_najentusAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- SpineTargetGUID = 0;
+ InstanceScript* pInstance;
+ EventMap events;
- if (pInstance)
- pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED);
- }
+ uint64 SpineTargetGUID;
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, me);
- events.DelayEvents(5000, GCD_YELL);
- }
+ void Reset()
+ {
+ events.Reset();
- void JustDied(Unit * /*victim*/)
- {
- if (pInstance)
- pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE);
+ SpineTargetGUID = 0;
- DoScriptText(SAY_DEATH, me);
- }
+ if (pInstance)
+ pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED);
+ }
- void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
- {
- if (spell->Id == SPELL_HURL_SPINE && me->HasAura(SPELL_TIDAL_SHIELD))
+ void KilledUnit(Unit * /*victim*/)
{
- me->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
- DoCast(me, SPELL_TIDAL_BURST, true);
- ResetTimer();
+ DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, me);
+ events.DelayEvents(5000, GCD_YELL);
}
- }
- void EnterCombat(Unit * /*who*/)
- {
- if (pInstance)
- pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS);
-
- DoScriptText(SAY_AGGRO, me);
- DoZoneInCombat();
- events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST);
- events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL);
- ResetTimer();
- }
+ void JustDied(Unit * /*victim*/)
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE);
- bool RemoveImpalingSpine()
- {
- if (!SpineTargetGUID) return false;
- Unit *pTarget = Unit::GetUnit(*me, SpineTargetGUID);
- if (pTarget && pTarget->HasAura(SPELL_IMPALING_SPINE))
- pTarget->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
- SpineTargetGUID=0;
- return true;
- }
+ DoScriptText(SAY_DEATH, me);
+ }
- void ResetTimer(uint32 inc = 0)
- {
- events.RescheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST);
- events.RescheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST);
- events.RescheduleEvent(EVENT_SHIELD, 60000 + inc);
- }
+ void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
+ {
+ if (spell->Id == SPELL_HURL_SPINE && me->HasAura(SPELL_TIDAL_SHIELD))
+ {
+ me->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
+ DoCast(me, SPELL_TIDAL_BURST, true);
+ ResetTimer();
+ }
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void EnterCombat(Unit * /*who*/)
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS);
- events.Update(diff);
+ DoScriptText(SAY_AGGRO, me);
+ DoZoneInCombat();
+ events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST);
+ events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL);
+ ResetTimer();
+ }
- while (uint32 eventId = events.ExecuteEvent())
+ bool RemoveImpalingSpine()
{
- switch(eventId)
+ if (!SpineTargetGUID) return false;
+ Unit *pTarget = Unit::GetUnit(*me, SpineTargetGUID);
+ if (pTarget && pTarget->HasAura(SPELL_IMPALING_SPINE))
+ pTarget->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
+ SpineTargetGUID=0;
+ return true;
+ }
+
+ void ResetTimer(uint32 inc = 0)
+ {
+ events.RescheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST);
+ events.RescheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST);
+ events.RescheduleEvent(EVENT_SHIELD, 60000 + inc);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
{
- case EVENT_SHIELD:
- DoCast(me, SPELL_TIDAL_SHIELD, true);
- ResetTimer(45000);
- break;
- case EVENT_BERSERK:
- DoScriptText(SAY_ENRAGE2, me);
- DoCast(me, SPELL_BERSERK, true);
- events.DelayEvents(15000, GCD_YELL);
- break;
- case EVENT_SPINE:
+ switch(eventId)
{
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if (!pTarget) pTarget = me->getVictim();
- if (pTarget)
+ case EVENT_SHIELD:
+ DoCast(me, SPELL_TIDAL_SHIELD, true);
+ ResetTimer(45000);
+ break;
+ case EVENT_BERSERK:
+ DoScriptText(SAY_ENRAGE2, me);
+ DoCast(me, SPELL_BERSERK, true);
+ events.DelayEvents(15000, GCD_YELL);
+ break;
+ case EVENT_SPINE:
+ {
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if (!pTarget) pTarget = me->getVictim();
+ if (pTarget)
+ {
+ DoCast(pTarget, SPELL_IMPALING_SPINE, true);
+ SpineTargetGUID = pTarget->GetGUID();
+ //must let target summon, otherwise you cannot click the spine
+ pTarget->SummonGameObject(GOBJECT_SPINE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 30);
+ DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, me);
+ events.DelayEvents(1500, GCD_CAST);
+ events.DelayEvents(15000, GCD_YELL);
+ }
+ events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST);
+ return;
+ }
+ case EVENT_NEEDLE:
{
- DoCast(pTarget, SPELL_IMPALING_SPINE, true);
- SpineTargetGUID = pTarget->GetGUID();
- //must let target summon, otherwise you cannot click the spine
- pTarget->SummonGameObject(GOBJECT_SPINE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 30);
- DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, me);
+ //DoCast(me, SPELL_NEEDLE_SPINE, true);
+ std::list<Unit*> pTargets;
+ SelectTargetList(pTargets, 3, SELECT_TARGET_RANDOM, 80, true);
+ for (std::list<Unit*>::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i)
+ DoCast(*i, 39835, true);
+ events.ScheduleEvent(EVENT_NEEDLE, urand(15000,25000), GCD_CAST);
events.DelayEvents(1500, GCD_CAST);
- events.DelayEvents(15000, GCD_YELL);
+ return;
}
- events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST);
- return;
- }
- case EVENT_NEEDLE:
- {
- //DoCast(me, SPELL_NEEDLE_SPINE, true);
- std::list<Unit*> pTargets;
- SelectTargetList(pTargets, 3, SELECT_TARGET_RANDOM, 80, true);
- for (std::list<Unit*>::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i)
- DoCast(*i, 39835, true);
- events.ScheduleEvent(EVENT_NEEDLE, urand(15000,25000), GCD_CAST);
- events.DelayEvents(1500, GCD_CAST);
- return;
+ case EVENT_YELL:
+ DoScriptText(RAND(SAY_SPECIAL1, SAY_SPECIAL2), me);
+ events.ScheduleEvent(EVENT_YELL, urand(25000,100000), GCD_YELL);
+ events.DelayEvents(15000, GCD_YELL);
+ break;
}
- case EVENT_YELL:
- DoScriptText(RAND(SAY_SPECIAL1, SAY_SPECIAL2), me);
- events.ScheduleEvent(EVENT_YELL, urand(25000,100000), GCD_YELL);
- events.DelayEvents(15000, GCD_YELL);
- break;
}
+
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
- }
};
-
-bool GOHello_go_najentus_spine(Player* pPlayer, GameObject* pGo)
+ class go_najentus_spine : public GameObjectScript
{
- if (ScriptedInstance* pInstance = pGo->GetInstanceData())
- if (Creature* Najentus = Unit::GetCreature(*pGo, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS)))
- if (CAST_AI(boss_najentusAI, Najentus->AI())->RemoveImpalingSpine())
- {
- pPlayer->CastSpell(pPlayer, SPELL_CREATE_NAJENTUS_SPINE, true);
- pGo->Delete();
- }
- return true;
-}
+public:
+ go_najentus_spine() : GameObjectScript("go_najentus_spine") { }
+
+ bool OnGossipHello(Player* pPlayer, GameObject* pGo)
+ {
+ if (InstanceScript* pInstance = pGo->GetInstanceScript())
+ if (Creature* Najentus = Unit::GetCreature(*pGo, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS)))
+ if (CAST_AI(boss_najentus::boss_najentusAI, Najentus->AI())->RemoveImpalingSpine())
+ {
+ pPlayer->CastSpell(pPlayer, SPELL_CREATE_NAJENTUS_SPINE, true);
+ pGo->Delete();
+ }
+ return true;
+ }
+
+};
-CreatureAI* GetAI_boss_najentus(Creature* pCreature)
-{
- return new boss_najentusAI (pCreature);
-}
void AddSC_boss_najentus()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_najentus";
- newscript->GetAI = &GetAI_boss_najentus;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "go_najentus_spine";
- newscript->pGOHello = &GOHello_go_najentus_spine;
- newscript->RegisterSelf();
+ new boss_najentus();
+ new go_najentus_spine();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
index c5fb8159a41..cea84c928a8 100644
--- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
+++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
@@ -108,254 +108,276 @@ static CouncilYells CouncilEnrage[]=
#define SPELL_VANISH 41479
#define SPELL_BERSERK 45078
-
-struct mob_blood_elf_council_voice_triggerAI : public ScriptedAI
+ class mob_blood_elf_council_voice_trigger : public CreatureScript
{
- mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c)
+public:
+ mob_blood_elf_council_voice_trigger() : CreatureScript("mob_blood_elf_council_voice_trigger") { }
+
+ CreatureAI* GetAI(Creature* c)
{
- for (uint8 i = 0; i < 4; ++i)
- Council[i] = 0;
+ return new mob_blood_elf_council_voice_triggerAI(c);
}
- uint64 Council[4];
+ struct mob_blood_elf_council_voice_triggerAI : public ScriptedAI
+ {
+ mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c)
+ {
+ for (uint8 i = 0; i < 4; ++i)
+ Council[i] = 0;
+ }
- uint32 EnrageTimer;
- uint32 AggroYellTimer;
+ uint64 Council[4];
- uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells
+ uint32 EnrageTimer;
+ uint32 AggroYellTimer;
- bool EventStarted;
+ uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells
- void Reset()
- {
- EnrageTimer = 900000; // 15 minutes
- AggroYellTimer = 500;
+ bool EventStarted;
- YellCounter = 0;
+ void Reset()
+ {
+ EnrageTimer = 900000; // 15 minutes
+ AggroYellTimer = 500;
- EventStarted = false;
- }
+ YellCounter = 0;
- // finds and stores the GUIDs for each Council member using instance data system.
- void LoadCouncilGUIDs()
- {
- if (ScriptedInstance* pInstance = me->GetInstanceData())
+ EventStarted = false;
+ }
+
+ // finds and stores the GUIDs for each Council member using instance data system.
+ void LoadCouncilGUIDs()
{
- Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
- Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW);
- Council[2] = pInstance->GetData64(DATA_LADYMALANDE);
- Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
- } else sLog.outError(ERROR_INST_DATA);
- }
+ if (InstanceScript* pInstance = me->GetInstanceScript())
+ {
+ Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
+ Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW);
+ Council[2] = pInstance->GetData64(DATA_LADYMALANDE);
+ Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
+ } else sLog.outError(ERROR_INST_DATA);
+ }
- void EnterCombat(Unit* /*who*/) {}
+ void EnterCombat(Unit* /*who*/) {}
- void AttackStart(Unit* /*who*/) {}
- void MoveInLineOfSight(Unit* /*who*/) {}
+ void AttackStart(Unit* /*who*/) {}
+ void MoveInLineOfSight(Unit* /*who*/) {}
- void UpdateAI(const uint32 diff)
- {
- if (!EventStarted)
- return;
+ void UpdateAI(const uint32 diff)
+ {
+ if (!EventStarted)
+ return;
- if (YellCounter > 3)
- return;
+ if (YellCounter > 3)
+ return;
- if (AggroYellTimer)
- {
- if (AggroYellTimer <= diff)
- {
- if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter]))
+ if (AggroYellTimer)
{
- DoScriptText(CouncilAggro[YellCounter].entry, pMember);
- AggroYellTimer = CouncilAggro[YellCounter].timer;
+ if (AggroYellTimer <= diff)
+ {
+ if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter]))
+ {
+ DoScriptText(CouncilAggro[YellCounter].entry, pMember);
+ AggroYellTimer = CouncilAggro[YellCounter].timer;
+ }
+ ++YellCounter;
+ if (YellCounter > 3)
+ YellCounter = 0; // Reuse for Enrage Yells
+ } else AggroYellTimer -= diff;
}
- ++YellCounter;
- if (YellCounter > 3)
- YellCounter = 0; // Reuse for Enrage Yells
- } else AggroYellTimer -= diff;
- }
- if (EnrageTimer)
- {
- if (EnrageTimer <= diff)
- {
- if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter]))
+ if (EnrageTimer)
+ {
+ if (EnrageTimer <= diff)
{
- pMember->CastSpell(pMember, SPELL_BERSERK, true);
- DoScriptText(CouncilEnrage[YellCounter].entry, pMember);
- EnrageTimer = CouncilEnrage[YellCounter].timer;
+ if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter]))
+ {
+ pMember->CastSpell(pMember, SPELL_BERSERK, true);
+ DoScriptText(CouncilEnrage[YellCounter].entry, pMember);
+ EnrageTimer = CouncilEnrage[YellCounter].timer;
+ }
+ ++YellCounter;
+ } else EnrageTimer -= diff;
}
- ++YellCounter;
- } else EnrageTimer -= diff;
}
- }
-};
+ };
-struct mob_illidari_councilAI : public ScriptedAI
+};
+ class mob_illidari_council : public CreatureScript
{
- mob_illidari_councilAI(Creature *c) : ScriptedAI(c)
+public:
+ mob_illidari_council() : CreatureScript("mob_illidari_council") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
- for (uint8 i = 0; i < 4; ++i)
- Council[i] = 0;
+ return new mob_illidari_councilAI (pCreature);
}
- ScriptedInstance* pInstance;
-
- uint64 Council[4];
-
- uint32 CheckTimer;
- uint32 EndEventTimer;
-
- uint8 DeathCount;
-
- bool EventBegun;
-
- void Reset()
+ struct mob_illidari_councilAI : public ScriptedAI
{
- CheckTimer = 2000;
- EndEventTimer = 0;
-
- DeathCount = 0;
-
- Creature* pMember = NULL;
- for (uint8 i = 0; i < 4; ++i)
+ mob_illidari_councilAI(Creature *c) : ScriptedAI(c)
{
- pMember = Unit::GetCreature((*me), Council[i]);
- if (!pMember)
- continue;
-
- if (!pMember->isAlive())
- {
- pMember->RemoveCorpse();
- pMember->Respawn();
- }
- pMember->AI()->EnterEvadeMode();
+ pInstance = c->GetInstanceScript();
+ for (uint8 i = 0; i < 4; ++i)
+ Council[i] = 0;
}
- if (pInstance)
- {
- pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED);
- if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
- VoiceTrigger->AI()->EnterEvadeMode();
- }
+ InstanceScript* pInstance;
- EventBegun = false;
+ uint64 Council[4];
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetDisplayId(11686);
- }
+ uint32 CheckTimer;
+ uint32 EndEventTimer;
- void EnterCombat(Unit * /*who*/) {}
- void AttackStart(Unit* /*who*/) {}
- void MoveInLineOfSight(Unit* /*who*/) {}
+ uint8 DeathCount;
- void StartEvent(Unit *pTarget)
- {
- if (!pInstance)
- return;
+ bool EventBegun;
- if (pTarget && pTarget->isAlive())
+ void Reset()
{
- Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
- Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
- Council[2] = pInstance->GetData64(DATA_LADYMALANDE);
- Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
+ CheckTimer = 2000;
+ EndEventTimer = 0;
- // Start the event for the Voice Trigger
- if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
- {
- CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs();
- CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true;
- }
+ DeathCount = 0;
+ Creature* pMember = NULL;
for (uint8 i = 0; i < 4; ++i)
{
- Unit* Member = NULL;
- if (Council[i])
+ pMember = Unit::GetCreature((*me), Council[i]);
+ if (!pMember)
+ continue;
+
+ if (!pMember->isAlive())
{
- Member = Unit::GetUnit((*me), Council[i]);
- if (Member && Member->isAlive())
- CAST_CRE(Member)->AI()->AttackStart(pTarget);
+ pMember->RemoveCorpse();
+ pMember->Respawn();
}
+ pMember->AI()->EnterEvadeMode();
+ }
+
+ if (pInstance)
+ {
+ pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED);
+ if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ VoiceTrigger->AI()->EnterEvadeMode();
}
- pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS);
+ EventBegun = false;
- EventBegun = true;
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetDisplayId(11686);
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (!EventBegun) return;
+ void EnterCombat(Unit * /*who*/) {}
+ void AttackStart(Unit* /*who*/) {}
+ void MoveInLineOfSight(Unit* /*who*/) {}
- if (EndEventTimer)
+ void StartEvent(Unit *pTarget)
{
- if (EndEventTimer <= diff)
+ if (!pInstance)
+ return;
+
+ if (pTarget && pTarget->isAlive())
{
- if (DeathCount > 3)
+ Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
+ Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
+ Council[2] = pInstance->GetData64(DATA_LADYMALANDE);
+ Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
+
+ // Start the event for the Voice Trigger
+ if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ {
+ CAST_AI(mob_blood_elf_council_voice_trigger::mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs();
+ CAST_AI(mob_blood_elf_council_voice_trigger::mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true;
+ }
+
+ for (uint8 i = 0; i < 4; ++i)
{
- if (pInstance)
+ Unit* Member = NULL;
+ if (Council[i])
{
- if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
- VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE);
- //me->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0);
+ Member = Unit::GetUnit((*me), Council[i]);
+ if (Member && Member->isAlive())
+ CAST_CRE(Member)->AI()->AttackStart(pTarget);
}
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- return;
}
- Creature* pMember = (Unit::GetCreature(*me, Council[DeathCount]));
- if (pMember && pMember->isAlive())
- pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- ++DeathCount;
- EndEventTimer = 1500;
- } else EndEventTimer -= diff;
+ pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS);
+
+ EventBegun = true;
+ }
}
- if (CheckTimer)
+ void UpdateAI(const uint32 diff)
{
- if (CheckTimer <= diff)
+ if (!EventBegun) return;
+
+ if (EndEventTimer)
{
- uint8 EvadeCheck = 0;
- for (uint8 i = 0; i < 4; ++i)
+ if (EndEventTimer <= diff)
{
- if (Council[i])
+ if (DeathCount > 3)
{
- if (Creature* Member = (Unit::GetCreature((*me), Council[i])))
+ if (pInstance)
{
- // This is the evade/death check.
- if (Member->isAlive() && !Member->getVictim())
- ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event
- else if (!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self.
+ if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE);
+ //me->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0);
+ }
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ return;
+ }
+
+ Creature* pMember = (Unit::GetCreature(*me, Council[DeathCount]));
+ if (pMember && pMember->isAlive())
+ pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ ++DeathCount;
+ EndEventTimer = 1500;
+ } else EndEventTimer -= diff;
+ }
+
+ if (CheckTimer)
+ {
+ if (CheckTimer <= diff)
+ {
+ uint8 EvadeCheck = 0;
+ for (uint8 i = 0; i < 4; ++i)
+ {
+ if (Council[i])
+ {
+ if (Creature* Member = (Unit::GetCreature((*me), Council[i])))
{
- EndEventTimer = 1000;
- CheckTimer = 0;
- return;
+ // This is the evade/death check.
+ if (Member->isAlive() && !Member->getVictim())
+ ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event
+ else if (!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self.
+ {
+ EndEventTimer = 1000;
+ CheckTimer = 0;
+ return;
+ }
}
}
}
- }
- if (EvadeCheck > 3)
- Reset();
+ if (EvadeCheck > 3)
+ Reset();
+
+ CheckTimer = 2000;
+ } else CheckTimer -= diff;
+ }
- CheckTimer = 2000;
- } else CheckTimer -= diff;
}
+ };
- }
};
struct boss_illidari_councilAI : public ScriptedAI
{
boss_illidari_councilAI(Creature* c) : ScriptedAI(c)
{
- pInstance = c->GetInstanceData();
+ pInstance = c->GetInstanceScript();
for (uint8 i = 0; i < 4; ++i)
Council[i] = 0;
LoadedGUIDs = false;
@@ -363,7 +385,7 @@ struct boss_illidari_councilAI : public ScriptedAI
uint64 Council[4];
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
bool LoadedGUIDs;
@@ -373,7 +395,7 @@ struct boss_illidari_councilAI : public ScriptedAI
{
Creature* Controller = (Unit::GetCreature(*me, pInstance->GetData64(DATA_ILLIDARICOUNCIL)));
if (Controller)
- CAST_AI(mob_illidari_councilAI, Controller->AI())->StartEvent(who);
+ CAST_AI(mob_illidari_council::mob_illidari_councilAI, Controller->AI())->StartEvent(who);
}
else
{
@@ -437,440 +459,434 @@ struct boss_illidari_councilAI : public ScriptedAI
LoadedGUIDs = true;
}
};
-
-struct boss_gathios_the_shattererAI : public boss_illidari_councilAI
+ class boss_gathios_the_shatterer : public CreatureScript
{
- boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) {}
-
- uint32 ConsecrationTimer;
- uint32 HammerOfJusticeTimer;
- uint32 SealTimer;
- uint32 AuraTimer;
- uint32 BlessingTimer;
+public:
+ boss_gathios_the_shatterer() : CreatureScript("boss_gathios_the_shatterer") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- ConsecrationTimer = 40000;
- HammerOfJusticeTimer = 10000;
- SealTimer = 40000;
- AuraTimer = 90000;
- BlessingTimer = 60000;
+ return new boss_gathios_the_shattererAI (pCreature);
}
- void KilledUnit(Unit * /*victim*/)
+ struct boss_gathios_the_shattererAI : public boss_illidari_councilAI
{
- DoScriptText(SAY_GATH_SLAY, me);
- }
-
- void JustDied(Unit * /*victim*/)
- {
- DoScriptText(SAY_GATH_DEATH, me);
- }
+ boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) {}
- Unit* SelectCouncilMember()
- {
- Unit* pUnit = me;
- uint32 member = 0; // He chooses Lady Malande most often
-
- if (rand()%10 == 0) // But there is a chance he picks someone else.
- member = urand(1, 3);
+ uint32 ConsecrationTimer;
+ uint32 HammerOfJusticeTimer;
+ uint32 SealTimer;
+ uint32 AuraTimer;
+ uint32 BlessingTimer;
- if (member != 2) // No need to create another pointer to us using Unit::GetUnit
- pUnit = Unit::GetUnit((*me), Council[member]);
- return pUnit;
- }
+ void Reset()
+ {
+ ConsecrationTimer = 40000;
+ HammerOfJusticeTimer = 10000;
+ SealTimer = 40000;
+ AuraTimer = 90000;
+ BlessingTimer = 60000;
+ }
- void CastAuraOnCouncil()
- {
- uint32 spellid = 0;
- switch (urand(0,1))
+ void KilledUnit(Unit * /*victim*/)
{
- case 0: spellid = SPELL_DEVOTION_AURA; break;
- case 1: spellid = SPELL_CHROMATIC_AURA; break;
+ DoScriptText(SAY_GATH_SLAY, me);
}
- for (uint8 i = 0; i < 4; ++i)
+
+ void JustDied(Unit * /*victim*/)
{
- Unit* pUnit = Unit::GetUnit((*me), Council[i]);
- if (pUnit)
- pUnit->CastSpell(pUnit, spellid, true, 0, 0, me->GetGUID());
+ DoScriptText(SAY_GATH_DEATH, me);
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ Unit* SelectCouncilMember()
+ {
+ Unit* pUnit = me;
+ uint32 member = 0; // He chooses Lady Malande most often
- if (BlessingTimer <= diff)
+ if (rand()%10 == 0) // But there is a chance he picks someone else.
+ member = urand(1, 3);
+
+ if (member != 2) // No need to create another pointer to us using Unit::GetUnit
+ pUnit = Unit::GetUnit((*me), Council[member]);
+ return pUnit;
+ }
+
+ void CastAuraOnCouncil()
{
- if (Unit* pUnit = SelectCouncilMember())
+ uint32 spellid = 0;
+ switch (urand(0,1))
{
- switch (urand(0,1))
- {
- case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break;
- case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break;
- }
+ case 0: spellid = SPELL_DEVOTION_AURA; break;
+ case 1: spellid = SPELL_CHROMATIC_AURA; break;
}
- BlessingTimer = 60000;
- } else BlessingTimer -= diff;
+ for (uint8 i = 0; i < 4; ++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*me), Council[i]);
+ if (pUnit)
+ pUnit->CastSpell(pUnit, spellid, true, 0, 0, me->GetGUID());
+ }
+ }
- if (ConsecrationTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me, SPELL_CONSECRATION);
- ConsecrationTimer = 40000;
- } else ConsecrationTimer -= diff;
+ if (!UpdateVictim())
+ return;
- if (HammerOfJusticeTimer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ if (BlessingTimer <= diff)
{
- // is in ~10-40 yd range
- if (me->IsInRange(pTarget, 10.0f, 40.0f, false))
+ if (Unit* pUnit = SelectCouncilMember())
{
- DoCast(pTarget, SPELL_HAMMER_OF_JUSTICE);
- HammerOfJusticeTimer = 20000;
+ switch (urand(0,1))
+ {
+ case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break;
+ case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break;
+ }
}
- }
- } else HammerOfJusticeTimer -= diff;
+ BlessingTimer = 60000;
+ } else BlessingTimer -= diff;
- if (SealTimer <= diff)
- {
- switch (urand(0,1))
+ if (ConsecrationTimer <= diff)
{
- case 0: DoCast(me, SPELL_SEAL_OF_COMMAND); break;
- case 1: DoCast(me, SPELL_SEAL_OF_BLOOD); break;
- }
- SealTimer = 40000;
- } else SealTimer -= diff;
+ DoCast(me, SPELL_CONSECRATION);
+ ConsecrationTimer = 40000;
+ } else ConsecrationTimer -= diff;
- if (AuraTimer <= diff)
- {
- CastAuraOnCouncil();
- AuraTimer = 90000;
- } else AuraTimer -= diff;
+ if (HammerOfJusticeTimer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ // is in ~10-40 yd range
+ if (me->IsInRange(pTarget, 10.0f, 40.0f, false))
+ {
+ DoCast(pTarget, SPELL_HAMMER_OF_JUSTICE);
+ HammerOfJusticeTimer = 20000;
+ }
+ }
+ } else HammerOfJusticeTimer -= diff;
- DoMeleeAttackIfReady();
- }
-};
+ if (SealTimer <= diff)
+ {
+ switch (urand(0,1))
+ {
+ case 0: DoCast(me, SPELL_SEAL_OF_COMMAND); break;
+ case 1: DoCast(me, SPELL_SEAL_OF_BLOOD); break;
+ }
+ SealTimer = 40000;
+ } else SealTimer -= diff;
-struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI
-{
- boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) {}
+ if (AuraTimer <= diff)
+ {
+ CastAuraOnCouncil();
+ AuraTimer = 90000;
+ } else AuraTimer -= diff;
- uint32 BlizzardTimer;
- uint32 FlamestrikeTimer;
- uint32 ArcaneBoltTimer;
- uint32 DampenMagicTimer;
- uint32 Cooldown;
- uint32 ArcaneExplosionTimer;
+ DoMeleeAttackIfReady();
+ }
+ };
- void Reset()
- {
- BlizzardTimer = 30000 + rand()%61 * 1000;
- FlamestrikeTimer = 30000 + rand()%61 * 1000;
- ArcaneBoltTimer = 10000;
- DampenMagicTimer = 2000;
- ArcaneExplosionTimer = 14000;
- Cooldown = 0;
- }
+};
+ class boss_high_nethermancer_zerevor : public CreatureScript
+{
+public:
+ boss_high_nethermancer_zerevor() : CreatureScript("boss_high_nethermancer_zerevor") { }
- void KilledUnit(Unit * /*victim*/)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- DoScriptText(SAY_ZERE_SLAY, me);
+ return new boss_high_nethermancer_zerevorAI (pCreature);
}
- void JustDied(Unit * /*victim*/)
+ struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI
{
- DoScriptText(SAY_ZERE_DEATH, me);
- }
+ boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) {}
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ uint32 BlizzardTimer;
+ uint32 FlamestrikeTimer;
+ uint32 ArcaneBoltTimer;
+ uint32 DampenMagicTimer;
+ uint32 Cooldown;
+ uint32 ArcaneExplosionTimer;
- if (Cooldown)
+ void Reset()
{
- if (Cooldown <= diff) Cooldown = 0;
- else
- {
- Cooldown -= diff;
- return; // Don't cast any other spells if global cooldown is still ticking
- }
+ BlizzardTimer = 30000 + rand()%61 * 1000;
+ FlamestrikeTimer = 30000 + rand()%61 * 1000;
+ ArcaneBoltTimer = 10000;
+ DampenMagicTimer = 2000;
+ ArcaneExplosionTimer = 14000;
+ Cooldown = 0;
}
- if (DampenMagicTimer <= diff)
+ void KilledUnit(Unit * /*victim*/)
{
- DoCast(me, SPELL_DAMPEN_MAGIC);
- Cooldown = 1000;
- DampenMagicTimer = 67200; // almost 1,12 minutes
- ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen.
- } else DampenMagicTimer -= diff;
+ DoScriptText(SAY_ZERE_SLAY, me);
+ }
- if (ArcaneExplosionTimer <= diff)
+ void JustDied(Unit * /*victim*/)
{
- DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
- Cooldown = 1000;
- ArcaneExplosionTimer = 14000;
- } else ArcaneExplosionTimer -= diff;
+ DoScriptText(SAY_ZERE_DEATH, me);
+ }
- if (ArcaneBoltTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me->getVictim(), SPELL_ARCANE_BOLT);
- ArcaneBoltTimer = 3000;
- Cooldown = 2000;
- } else ArcaneBoltTimer -= diff;
+ if (!UpdateVictim())
+ return;
- if (BlizzardTimer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ if (Cooldown)
{
- DoCast(pTarget, SPELL_BLIZZARD);
- BlizzardTimer = 45000 + rand()%46 * 1000;
- FlamestrikeTimer += 10000;
- Cooldown = 1000;
+ if (Cooldown <= diff) Cooldown = 0;
+ else
+ {
+ Cooldown -= diff;
+ return; // Don't cast any other spells if global cooldown is still ticking
+ }
}
- } else BlizzardTimer -= diff;
- if (FlamestrikeTimer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ if (DampenMagicTimer <= diff)
{
- DoCast(pTarget, SPELL_FLAMESTRIKE);
- FlamestrikeTimer = 55000 + rand()%46 * 1000;
- BlizzardTimer += 10000;
+ DoCast(me, SPELL_DAMPEN_MAGIC);
+ Cooldown = 1000;
+ DampenMagicTimer = 67200; // almost 1,12 minutes
+ ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen.
+ } else DampenMagicTimer -= diff;
+
+ if (ArcaneExplosionTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
+ Cooldown = 1000;
+ ArcaneExplosionTimer = 14000;
+ } else ArcaneExplosionTimer -= diff;
+
+ if (ArcaneBoltTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ARCANE_BOLT);
+ ArcaneBoltTimer = 3000;
Cooldown = 2000;
- }
- } else FlamestrikeTimer -= diff;
- }
-};
+ } else ArcaneBoltTimer -= diff;
-struct boss_lady_malandeAI : public boss_illidari_councilAI
-{
- boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) {}
+ if (BlizzardTimer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(pTarget, SPELL_BLIZZARD);
+ BlizzardTimer = 45000 + rand()%46 * 1000;
+ FlamestrikeTimer += 10000;
+ Cooldown = 1000;
+ }
+ } else BlizzardTimer -= diff;
- uint32 EmpoweredSmiteTimer;
- uint32 CircleOfHealingTimer;
- uint32 DivineWrathTimer;
- uint32 ReflectiveShieldTimer;
+ if (FlamestrikeTimer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(pTarget, SPELL_FLAMESTRIKE);
+ FlamestrikeTimer = 55000 + rand()%46 * 1000;
+ BlizzardTimer += 10000;
+ Cooldown = 2000;
+ }
+ } else FlamestrikeTimer -= diff;
+ }
+ };
- void Reset()
- {
- EmpoweredSmiteTimer = 38000;
- CircleOfHealingTimer = 20000;
- DivineWrathTimer = 40000;
- ReflectiveShieldTimer = 0;
- }
+};
+ class boss_lady_malande : public CreatureScript
+{
+public:
+ boss_lady_malande() : CreatureScript("boss_lady_malande") { }
- void KilledUnit(Unit * /*victim*/)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- DoScriptText(SAY_MALA_SLAY, me);
+ return new boss_lady_malandeAI (pCreature);
}
- void JustDied(Unit * /*victim*/)
+ struct boss_lady_malandeAI : public boss_illidari_councilAI
{
- DoScriptText(SAY_MALA_DEATH, me);
- }
+ boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) {}
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ uint32 EmpoweredSmiteTimer;
+ uint32 CircleOfHealingTimer;
+ uint32 DivineWrathTimer;
+ uint32 ReflectiveShieldTimer;
- if (EmpoweredSmiteTimer <= diff)
+ void Reset()
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(pTarget, SPELL_EMPOWERED_SMITE);
- EmpoweredSmiteTimer = 38000;
- }
- } else EmpoweredSmiteTimer -= diff;
+ EmpoweredSmiteTimer = 38000;
+ CircleOfHealingTimer = 20000;
+ DivineWrathTimer = 40000;
+ ReflectiveShieldTimer = 0;
+ }
- if (CircleOfHealingTimer <= diff)
+ void KilledUnit(Unit * /*victim*/)
{
- DoCast(me, SPELL_CIRCLE_OF_HEALING);
- CircleOfHealingTimer = 60000;
- } else CircleOfHealingTimer -= diff;
+ DoScriptText(SAY_MALA_SLAY, me);
+ }
- if (DivineWrathTimer <= diff)
+ void JustDied(Unit * /*victim*/)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(pTarget, SPELL_DIVINE_WRATH);
- DivineWrathTimer = 40000 + rand()%41 * 1000;
- }
- } else DivineWrathTimer -= diff;
+ DoScriptText(SAY_MALA_DEATH, me);
+ }
- if (ReflectiveShieldTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me, SPELL_REFLECTIVE_SHIELD);
- ReflectiveShieldTimer = 65000;
- } else ReflectiveShieldTimer -= diff;
+ if (!UpdateVictim())
+ return;
- DoMeleeAttackIfReady();
- }
-};
-
-struct boss_veras_darkshadowAI : public boss_illidari_councilAI
-{
- boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) {}
-
- uint64 EnvenomTargetGUID;
+ if (EmpoweredSmiteTimer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(pTarget, SPELL_EMPOWERED_SMITE);
+ EmpoweredSmiteTimer = 38000;
+ }
+ } else EmpoweredSmiteTimer -= diff;
- uint32 DeadlyPoisonTimer;
- uint32 VanishTimer;
- uint32 AppearEnvenomTimer;
+ if (CircleOfHealingTimer <= diff)
+ {
+ DoCast(me, SPELL_CIRCLE_OF_HEALING);
+ CircleOfHealingTimer = 60000;
+ } else CircleOfHealingTimer -= diff;
- bool HasVanished;
+ if (DivineWrathTimer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(pTarget, SPELL_DIVINE_WRATH);
+ DivineWrathTimer = 40000 + rand()%41 * 1000;
+ }
+ } else DivineWrathTimer -= diff;
- void Reset()
- {
- EnvenomTargetGUID = 0;
+ if (ReflectiveShieldTimer <= diff)
+ {
+ DoCast(me, SPELL_REFLECTIVE_SHIELD);
+ ReflectiveShieldTimer = 65000;
+ } else ReflectiveShieldTimer -= diff;
- DeadlyPoisonTimer = 20000;
- VanishTimer = 60000 + rand()%61 * 1000;
- AppearEnvenomTimer = 150000;
+ DoMeleeAttackIfReady();
+ }
+ };
- HasVanished = false;
- me->SetVisibility(VISIBILITY_ON);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
+};
+ class boss_veras_darkshadow : public CreatureScript
+{
+public:
+ boss_veras_darkshadow() : CreatureScript("boss_veras_darkshadow") { }
- void KilledUnit(Unit * /*victim*/)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- DoScriptText(SAY_VERA_SLAY, me);
+ return new boss_veras_darkshadowAI (pCreature);
}
- void JustDied(Unit * /*victim*/)
+ struct boss_veras_darkshadowAI : public boss_illidari_councilAI
{
- DoScriptText(SAY_VERA_DEATH, me);
- }
+ boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) {}
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ uint64 EnvenomTargetGUID;
+
+ uint32 DeadlyPoisonTimer;
+ uint32 VanishTimer;
+ uint32 AppearEnvenomTimer;
- if (!HasVanished)
+ bool HasVanished;
+
+ void Reset()
{
- if (DeadlyPoisonTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_DEADLY_POISON);
- DeadlyPoisonTimer = 15000 + rand()%31 * 1000;
- } else DeadlyPoisonTimer -= diff;
+ EnvenomTargetGUID = 0;
- if (AppearEnvenomTimer <= diff) // Cast Envenom. This is cast 4 seconds after Vanish is over
- {
- DoCast(me->getVictim(), SPELL_ENVENOM);
- AppearEnvenomTimer = 90000;
- } else AppearEnvenomTimer -= diff;
+ DeadlyPoisonTimer = 20000;
+ VanishTimer = 60000 + rand()%61 * 1000;
+ AppearEnvenomTimer = 150000;
- if (VanishTimer <= diff) // Disappear and stop attacking, but follow a random unit
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- VanishTimer = 30000;
- AppearEnvenomTimer= 28000;
- HasVanished = true;
- me->SetVisibility(VISIBILITY_OFF);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoResetThreat();
- // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking
- me->AddThreat(pTarget, 500000.0f);
- me->GetMotionMaster()->MoveChase(pTarget);
- }
- } else VanishTimer -= diff;
+ HasVanished = false;
+ me->SetVisibility(VISIBILITY_ON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
- DoMeleeAttackIfReady();
+ void KilledUnit(Unit * /*victim*/)
+ {
+ DoScriptText(SAY_VERA_SLAY, me);
}
- else
+
+ void JustDied(Unit * /*victim*/)
{
- if (VanishTimer <= diff) // Become attackable and poison current target
+ DoScriptText(SAY_VERA_DEATH, me);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (!HasVanished)
{
- Unit *pTarget = me->getVictim();
- DoCast(pTarget, SPELL_DEADLY_POISON);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoResetThreat();
- me->AddThreat(pTarget, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after.
- DeadlyPoisonTimer += 6000;
- VanishTimer = 90000;
- AppearEnvenomTimer = 4000;
- HasVanished = false;
- } else VanishTimer -= diff;
-
- if (AppearEnvenomTimer <= diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish)
+ if (DeadlyPoisonTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_DEADLY_POISON);
+ DeadlyPoisonTimer = 15000 + rand()%31 * 1000;
+ } else DeadlyPoisonTimer -= diff;
+
+ if (AppearEnvenomTimer <= diff) // Cast Envenom. This is cast 4 seconds after Vanish is over
+ {
+ DoCast(me->getVictim(), SPELL_ENVENOM);
+ AppearEnvenomTimer = 90000;
+ } else AppearEnvenomTimer -= diff;
+
+ if (VanishTimer <= diff) // Disappear and stop attacking, but follow a random unit
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ VanishTimer = 30000;
+ AppearEnvenomTimer= 28000;
+ HasVanished = true;
+ me->SetVisibility(VISIBILITY_OFF);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoResetThreat();
+ // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking
+ me->AddThreat(pTarget, 500000.0f);
+ me->GetMotionMaster()->MoveChase(pTarget);
+ }
+ } else VanishTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ else
{
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MoveChase(me->getVictim());
- me->SetVisibility(VISIBILITY_ON);
- AppearEnvenomTimer = 6000;
- } else AppearEnvenomTimer -= diff;
+ if (VanishTimer <= diff) // Become attackable and poison current target
+ {
+ Unit *pTarget = me->getVictim();
+ DoCast(pTarget, SPELL_DEADLY_POISON);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoResetThreat();
+ me->AddThreat(pTarget, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after.
+ DeadlyPoisonTimer += 6000;
+ VanishTimer = 90000;
+ AppearEnvenomTimer = 4000;
+ HasVanished = false;
+ } else VanishTimer -= diff;
+
+ if (AppearEnvenomTimer <= diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish)
+ {
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveChase(me->getVictim());
+ me->SetVisibility(VISIBILITY_ON);
+ AppearEnvenomTimer = 6000;
+ } else AppearEnvenomTimer -= diff;
+ }
}
- }
+ };
+
};
-CreatureAI* GetAI_mob_blood_elf_council_voice_trigger(Creature* c)
-{
- return new mob_blood_elf_council_voice_triggerAI(c);
-}
-CreatureAI* GetAI_mob_illidari_council(Creature* pCreature)
-{
- return new mob_illidari_councilAI (pCreature);
-}
-CreatureAI* GetAI_boss_gathios_the_shatterer(Creature* pCreature)
-{
- return new boss_gathios_the_shattererAI (pCreature);
-}
-CreatureAI* GetAI_boss_lady_malande(Creature* pCreature)
-{
- return new boss_lady_malandeAI (pCreature);
-}
-CreatureAI* GetAI_boss_veras_darkshadow(Creature* pCreature)
-{
- return new boss_veras_darkshadowAI (pCreature);
-}
-CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature* pCreature)
-{
- return new boss_high_nethermancer_zerevorAI (pCreature);
-}
void AddSC_boss_illidari_council()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "mob_illidari_council";
- newscript->GetAI = &GetAI_mob_illidari_council;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_blood_elf_council_voice_trigger";
- newscript->GetAI = &GetAI_mob_blood_elf_council_voice_trigger;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_gathios_the_shatterer";
- newscript->GetAI = &GetAI_boss_gathios_the_shatterer;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_lady_malande";
- newscript->GetAI = &GetAI_boss_lady_malande;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_veras_darkshadow";
- newscript->GetAI = &GetAI_boss_veras_darkshadow;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_high_nethermancer_zerevor";
- newscript->GetAI = &GetAI_boss_high_nethermancer_zerevor;
- newscript->RegisterSelf();
+ new mob_illidari_council();
+ new mob_blood_elf_council_voice_trigger();
+ new boss_gathios_the_shatterer();
+ new boss_lady_malande();
+ new boss_veras_darkshadow();
+ new boss_high_nethermancer_zerevor();
}
-
diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
index 7d5c5a9a3af..dacf35c4c3a 100644
--- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
@@ -39,310 +39,312 @@ EndScriptData */
7 - Illidari Council Event
8 - Illidan Stormrage Event
*/
-
-struct instance_black_temple : public ScriptedInstance
+ class instance_black_temple : public InstanceMapScript
{
- instance_black_temple(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
-
- uint32 m_auiEncounter[MAX_ENCOUNTER];
- std::string str_data;
-
- uint64 Najentus;
- uint64 Akama; // This is the Akama that starts the Illidan encounter.
- uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter.
- uint64 ShadeOfAkama;
- uint64 Supremus;
- uint64 LadyMalande;
- uint64 GathiosTheShatterer;
- uint64 HighNethermancerZerevor;
- uint64 VerasDarkshadow;
- uint64 IllidariCouncil;
- uint64 BloodElfCouncilVoice;
- uint64 IllidanStormrage;
-
- uint64 NajentusGate;
- uint64 MainTempleDoors;
- uint64 ShadeOfAkamaDoor;
- uint64 CommonDoor;//Teron
- uint64 TeronDoor;
- uint64 GuurtogDoor;
- uint64 MotherDoor;
- uint64 TempleDoor;//Befor mother
- uint64 CouncilDoor;
- uint64 SimpleDoor;//council
- uint64 IllidanGate;
- uint64 IllidanDoor[2];
-
- void Initialize()
- {
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
-
- Najentus = 0;
- Akama = 0;
- Akama_Shade = 0;
- ShadeOfAkama = 0;
- Supremus = 0;
- LadyMalande = 0;
- GathiosTheShatterer = 0;
- HighNethermancerZerevor = 0;
- VerasDarkshadow = 0;
- IllidariCouncil = 0;
- BloodElfCouncilVoice = 0;
- IllidanStormrage = 0;
-
- NajentusGate = 0;
- MainTempleDoors = 0;
- ShadeOfAkamaDoor= 0;
- CommonDoor = 0;//teron
- TeronDoor = 0;
- GuurtogDoor = 0;
- MotherDoor = 0;
- TempleDoor = 0;
- SimpleDoor = 0;//Bycouncil
- CouncilDoor = 0;
- IllidanGate = 0;
- IllidanDoor[0] = 0;
- IllidanDoor[1] = 0;
- }
+public:
+ instance_black_temple() : InstanceMapScript("instance_black_temple") { }
- bool IsEncounterInProgress() const
+ InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
{
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS) return true;
-
- return false;
+ return new instance_black_temple_InstanceMapScript(pMap);
}
- Player* GetPlayerInMap()
+ struct instance_black_temple_InstanceMapScript : public InstanceScript
{
- Map::PlayerList const& players = instance->GetPlayers();
-
- if (!players.isEmpty())
+ instance_black_temple_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
+
+ uint32 m_auiEncounter[MAX_ENCOUNTER];
+ std::string str_data;
+
+ uint64 Najentus;
+ uint64 Akama; // This is the Akama that starts the Illidan encounter.
+ uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter.
+ uint64 ShadeOfAkama;
+ uint64 Supremus;
+ uint64 LadyMalande;
+ uint64 GathiosTheShatterer;
+ uint64 HighNethermancerZerevor;
+ uint64 VerasDarkshadow;
+ uint64 IllidariCouncil;
+ uint64 BloodElfCouncilVoice;
+ uint64 IllidanStormrage;
+
+ uint64 NajentusGate;
+ uint64 MainTempleDoors;
+ uint64 ShadeOfAkamaDoor;
+ uint64 CommonDoor;//Teron
+ uint64 TeronDoor;
+ uint64 GuurtogDoor;
+ uint64 MotherDoor;
+ uint64 TempleDoor;//Befor mother
+ uint64 CouncilDoor;
+ uint64 SimpleDoor;//council
+ uint64 IllidanGate;
+ uint64 IllidanDoor[2];
+
+ void Initialize()
{
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- {
- if (Player* plr = itr->getSource())
- return plr;
- }
+ memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+
+ Najentus = 0;
+ Akama = 0;
+ Akama_Shade = 0;
+ ShadeOfAkama = 0;
+ Supremus = 0;
+ LadyMalande = 0;
+ GathiosTheShatterer = 0;
+ HighNethermancerZerevor = 0;
+ VerasDarkshadow = 0;
+ IllidariCouncil = 0;
+ BloodElfCouncilVoice = 0;
+ IllidanStormrage = 0;
+
+ NajentusGate = 0;
+ MainTempleDoors = 0;
+ ShadeOfAkamaDoor= 0;
+ CommonDoor = 0;//teron
+ TeronDoor = 0;
+ GuurtogDoor = 0;
+ MotherDoor = 0;
+ TempleDoor = 0;
+ SimpleDoor = 0;//Bycouncil
+ CouncilDoor = 0;
+ IllidanGate = 0;
+ IllidanDoor[0] = 0;
+ IllidanDoor[1] = 0;
}
- sLog.outDebug("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!");
- return NULL;
- }
-
- void OnCreatureCreate(Creature* pCreature, bool /*add*/)
- {
- switch(pCreature->GetEntry())
+ bool IsEncounterInProgress() const
{
- case 22887: Najentus = pCreature->GetGUID(); break;
- case 23089: Akama = pCreature->GetGUID(); break;
- case 22990: Akama_Shade = pCreature->GetGUID(); break;
- case 22841: ShadeOfAkama = pCreature->GetGUID(); break;
- case 22898: Supremus = pCreature->GetGUID(); break;
- case 22917: IllidanStormrage = pCreature->GetGUID(); break;
- case 22949: GathiosTheShatterer = pCreature->GetGUID(); break;
- case 22950: HighNethermancerZerevor = pCreature->GetGUID(); break;
- case 22951: LadyMalande = pCreature->GetGUID(); break;
- case 22952: VerasDarkshadow = pCreature->GetGUID(); break;
- case 23426: IllidariCouncil = pCreature->GetGUID(); break;
- case 23499: BloodElfCouncilVoice = pCreature->GetGUID(); break;
- }
- }
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS) return true;
- void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
- {
- switch(pGo->GetEntry())
- {
- case 185483: NajentusGate = pGo->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards)
- if (m_auiEncounter[0] == DONE)HandleGameObject(NULL,true,pGo);break;
- case 185882: MainTempleDoors = pGo->GetGUID();// Main Temple Doors - right past Supermoose (Supremus)
- if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break;
- case 185478: ShadeOfAkamaDoor = pGo->GetGUID();break;
- case 185480: CommonDoor = pGo->GetGUID();
- if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);break;
- case 186153: TeronDoor = pGo->GetGUID();
- if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);break;
- case 185892: GuurtogDoor = pGo->GetGUID();
- if (m_auiEncounter[4] == DONE)HandleGameObject(NULL,true,pGo);break;
- case 185479: TempleDoor = pGo->GetGUID();
- if (m_auiEncounter[5] == DONE)HandleGameObject(NULL,true,pGo);break;
- case 185482: MotherDoor = pGo->GetGUID();
- if (m_auiEncounter[6] == DONE)HandleGameObject(NULL,true,pGo);break;
- case 185481: CouncilDoor = pGo->GetGUID();
- if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break;
- case 186152: SimpleDoor = pGo->GetGUID();
- if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break;
- case 185905: IllidanGate = pGo->GetGUID(); break; // Gate leading to Temple Summit
- case 186261: IllidanDoor[0] = pGo->GetGUID(); break; // Right door at Temple Summit
- case 186262: IllidanDoor[1] = pGo->GetGUID(); break; // Left door at Temple Summit
+ return false;
}
- }
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
+ Player* GetPlayerInMap()
{
- case DATA_HIGHWARLORDNAJENTUS: return Najentus;
- case DATA_AKAMA: return Akama;
- case DATA_AKAMA_SHADE: return Akama_Shade;
- case DATA_SHADEOFAKAMA: return ShadeOfAkama;
- case DATA_SUPREMUS: return Supremus;
- case DATA_ILLIDANSTORMRAGE: return IllidanStormrage;
- case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer;
- case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor;
- case DATA_LADYMALANDE: return LadyMalande;
- case DATA_VERASDARKSHADOW: return VerasDarkshadow;
- case DATA_ILLIDARICOUNCIL: return IllidariCouncil;
- case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate;
- case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate;
- case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0];
- case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1];
- case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors;
- case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice;
- }
+ Map::PlayerList const& players = instance->GetPlayers();
- return 0;
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_HIGHWARLORDNAJENTUSEVENT:
- if (data == DONE)
+ if (!players.isEmpty())
{
- HandleGameObject(NajentusGate, true);
+ for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
+ {
+ if (Player* plr = itr->getSource())
+ return plr;
+ }
}
- m_auiEncounter[0] = data;break;
- case DATA_SUPREMUSEVENT:
- if (data == DONE)
+
+ sLog.outDebug("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!");
+ return NULL;
+ }
+
+ void OnCreatureCreate(Creature* pCreature, bool /*add*/)
+ {
+ switch(pCreature->GetEntry())
{
- HandleGameObject(NajentusGate, true);
+ case 22887: Najentus = pCreature->GetGUID(); break;
+ case 23089: Akama = pCreature->GetGUID(); break;
+ case 22990: Akama_Shade = pCreature->GetGUID(); break;
+ case 22841: ShadeOfAkama = pCreature->GetGUID(); break;
+ case 22898: Supremus = pCreature->GetGUID(); break;
+ case 22917: IllidanStormrage = pCreature->GetGUID(); break;
+ case 22949: GathiosTheShatterer = pCreature->GetGUID(); break;
+ case 22950: HighNethermancerZerevor = pCreature->GetGUID(); break;
+ case 22951: LadyMalande = pCreature->GetGUID(); break;
+ case 22952: VerasDarkshadow = pCreature->GetGUID(); break;
+ case 23426: IllidariCouncil = pCreature->GetGUID(); break;
+ case 23499: BloodElfCouncilVoice = pCreature->GetGUID(); break;
}
- m_auiEncounter[1] = data; break;
- case DATA_SHADEOFAKAMAEVENT:
- if (data == IN_PROGRESS)
- {
- HandleGameObject(ShadeOfAkamaDoor, false);
- } else HandleGameObject(ShadeOfAkamaDoor, true);
- m_auiEncounter[2] = data; break;
- case DATA_TERONGOREFIENDEVENT:
- if (data == IN_PROGRESS)
- {
- HandleGameObject(TeronDoor, false);
- HandleGameObject(CommonDoor, false);
- }else
+ }
+
+ void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
+ {
+ switch(pGo->GetEntry())
{
- HandleGameObject(TeronDoor, true);
- HandleGameObject(CommonDoor, true);
+ case 185483: NajentusGate = pGo->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards)
+ if (m_auiEncounter[0] == DONE)HandleGameObject(NULL,true,pGo);break;
+ case 185882: MainTempleDoors = pGo->GetGUID();// Main Temple Doors - right past Supermoose (Supremus)
+ if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break;
+ case 185478: ShadeOfAkamaDoor = pGo->GetGUID();break;
+ case 185480: CommonDoor = pGo->GetGUID();
+ if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);break;
+ case 186153: TeronDoor = pGo->GetGUID();
+ if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);break;
+ case 185892: GuurtogDoor = pGo->GetGUID();
+ if (m_auiEncounter[4] == DONE)HandleGameObject(NULL,true,pGo);break;
+ case 185479: TempleDoor = pGo->GetGUID();
+ if (m_auiEncounter[5] == DONE)HandleGameObject(NULL,true,pGo);break;
+ case 185482: MotherDoor = pGo->GetGUID();
+ if (m_auiEncounter[6] == DONE)HandleGameObject(NULL,true,pGo);break;
+ case 185481: CouncilDoor = pGo->GetGUID();
+ if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break;
+ case 186152: SimpleDoor = pGo->GetGUID();
+ if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break;
+ case 185905: IllidanGate = pGo->GetGUID(); break; // Gate leading to Temple Summit
+ case 186261: IllidanDoor[0] = pGo->GetGUID(); break; // Right door at Temple Summit
+ case 186262: IllidanDoor[1] = pGo->GetGUID(); break; // Left door at Temple Summit
}
- m_auiEncounter[3] = data; break;
- case DATA_GURTOGGBLOODBOILEVENT:
- if (data == DONE)
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
{
- HandleGameObject(GuurtogDoor, true);
+ case DATA_HIGHWARLORDNAJENTUS: return Najentus;
+ case DATA_AKAMA: return Akama;
+ case DATA_AKAMA_SHADE: return Akama_Shade;
+ case DATA_SHADEOFAKAMA: return ShadeOfAkama;
+ case DATA_SUPREMUS: return Supremus;
+ case DATA_ILLIDANSTORMRAGE: return IllidanStormrage;
+ case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer;
+ case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor;
+ case DATA_LADYMALANDE: return LadyMalande;
+ case DATA_VERASDARKSHADOW: return VerasDarkshadow;
+ case DATA_ILLIDARICOUNCIL: return IllidariCouncil;
+ case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate;
+ case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate;
+ case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0];
+ case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1];
+ case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors;
+ case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice;
}
- m_auiEncounter[4] = data; break;
- case DATA_RELIQUARYOFSOULSEVENT:
- if (data == DONE)
+
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
{
- HandleGameObject(TempleDoor, true);
+ case DATA_HIGHWARLORDNAJENTUSEVENT:
+ if (data == DONE)
+ {
+ HandleGameObject(NajentusGate, true);
+ }
+ m_auiEncounter[0] = data;break;
+ case DATA_SUPREMUSEVENT:
+ if (data == DONE)
+ {
+ HandleGameObject(NajentusGate, true);
+ }
+ m_auiEncounter[1] = data; break;
+ case DATA_SHADEOFAKAMAEVENT:
+ if (data == IN_PROGRESS)
+ {
+ HandleGameObject(ShadeOfAkamaDoor, false);
+ } else HandleGameObject(ShadeOfAkamaDoor, true);
+ m_auiEncounter[2] = data; break;
+ case DATA_TERONGOREFIENDEVENT:
+ if (data == IN_PROGRESS)
+ {
+ HandleGameObject(TeronDoor, false);
+ HandleGameObject(CommonDoor, false);
+ }else
+ {
+ HandleGameObject(TeronDoor, true);
+ HandleGameObject(CommonDoor, true);
+ }
+ m_auiEncounter[3] = data; break;
+ case DATA_GURTOGGBLOODBOILEVENT:
+ if (data == DONE)
+ {
+ HandleGameObject(GuurtogDoor, true);
+ }
+ m_auiEncounter[4] = data; break;
+ case DATA_RELIQUARYOFSOULSEVENT:
+ if (data == DONE)
+ {
+ HandleGameObject(TempleDoor, true);
+ }
+ m_auiEncounter[5] = data; break;
+ case DATA_MOTHERSHAHRAZEVENT:
+ if (data == DONE)
+ {
+ HandleGameObject(MotherDoor, true);
+ }
+ m_auiEncounter[6] = data; break;
+ case DATA_ILLIDARICOUNCILEVENT:
+ if (data == IN_PROGRESS)
+ {
+ HandleGameObject(CouncilDoor, false);
+ HandleGameObject(SimpleDoor, false);
+ }else
+ {
+ HandleGameObject(CouncilDoor, true);
+ HandleGameObject(SimpleDoor, true);
+ }
+ m_auiEncounter[7] = data; break;
+ case DATA_ILLIDANSTORMRAGEEVENT: m_auiEncounter[8] = data; break;
}
- m_auiEncounter[5] = data; break;
- case DATA_MOTHERSHAHRAZEVENT:
+
if (data == DONE)
{
- HandleGameObject(MotherDoor, true);
- }
- m_auiEncounter[6] = data; break;
- case DATA_ILLIDARICOUNCILEVENT:
- if (data == IN_PROGRESS)
- {
- HandleGameObject(CouncilDoor, false);
- HandleGameObject(SimpleDoor, false);
- }else
- {
- HandleGameObject(CouncilDoor, true);
- HandleGameObject(SimpleDoor, true);
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+ saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
+ << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]
+ << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " << m_auiEncounter[7]
+ << " " << m_auiEncounter[8];
+
+ str_data = saveStream.str();
+
+ SaveToDB();
+ OUT_SAVE_INST_DATA_COMPLETE;
}
- m_auiEncounter[7] = data; break;
- case DATA_ILLIDANSTORMRAGEEVENT: m_auiEncounter[8] = data; break;
}
- if (data == DONE)
+ uint32 GetData(uint32 type)
{
- OUT_SAVE_INST_DATA;
-
- std::ostringstream saveStream;
- saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
- << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]
- << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " << m_auiEncounter[7]
- << " " << m_auiEncounter[8];
-
- str_data = saveStream.str();
+ switch(type)
+ {
+ case DATA_HIGHWARLORDNAJENTUSEVENT: return m_auiEncounter[0];
+ case DATA_SUPREMUSEVENT: return m_auiEncounter[1];
+ case DATA_SHADEOFAKAMAEVENT: return m_auiEncounter[2];
+ case DATA_TERONGOREFIENDEVENT: return m_auiEncounter[3];
+ case DATA_GURTOGGBLOODBOILEVENT: return m_auiEncounter[4];
+ case DATA_RELIQUARYOFSOULSEVENT: return m_auiEncounter[5];
+ case DATA_MOTHERSHAHRAZEVENT: return m_auiEncounter[6];
+ case DATA_ILLIDARICOUNCILEVENT: return m_auiEncounter[7];
+ case DATA_ILLIDANSTORMRAGEEVENT: return m_auiEncounter[8];
+ }
- SaveToDB();
- OUT_SAVE_INST_DATA_COMPLETE;
+ return 0;
}
- }
- uint32 GetData(uint32 type)
- {
- switch(type)
+ std::string GetSaveData()
{
- case DATA_HIGHWARLORDNAJENTUSEVENT: return m_auiEncounter[0];
- case DATA_SUPREMUSEVENT: return m_auiEncounter[1];
- case DATA_SHADEOFAKAMAEVENT: return m_auiEncounter[2];
- case DATA_TERONGOREFIENDEVENT: return m_auiEncounter[3];
- case DATA_GURTOGGBLOODBOILEVENT: return m_auiEncounter[4];
- case DATA_RELIQUARYOFSOULSEVENT: return m_auiEncounter[5];
- case DATA_MOTHERSHAHRAZEVENT: return m_auiEncounter[6];
- case DATA_ILLIDARICOUNCILEVENT: return m_auiEncounter[7];
- case DATA_ILLIDANSTORMRAGEEVENT: return m_auiEncounter[8];
+ return str_data;
}
- return 0;
- }
-
- std::string GetSaveData()
- {
- return str_data;
- }
-
- void Load(const char* in)
- {
- if (!in)
+ void Load(const char* in)
{
- OUT_LOAD_INST_DATA_FAIL;
- return;
- }
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
- OUT_LOAD_INST_DATA(in);
+ OUT_LOAD_INST_DATA(in);
- std::istringstream loadStream(in);
- loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]
- >> m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6]
- >> m_auiEncounter[7] >> m_auiEncounter[8];
+ std::istringstream loadStream(in);
+ loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]
+ >> m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6]
+ >> m_auiEncounter[7] >> m_auiEncounter[8];
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS)
- m_auiEncounter[i] = NOT_STARTED;
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS)
+ m_auiEncounter[i] = NOT_STARTED;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+ };
- OUT_LOAD_INST_DATA_COMPLETE;
- }
};
-InstanceData* GetInstanceData_instance_black_temple(Map* pMap)
-{
- return new instance_black_temple(pMap);
-}
void AddSC_instance_black_temple()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_black_temple";
- newscript->GetInstanceData = &GetInstanceData_instance_black_temple;
- newscript->RegisterSelf();
+ new instance_black_temple();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
index a99aa661c97..e7e3d46955f 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
@@ -93,656 +93,661 @@ EndScriptData */
#define OLUM_Z -7.54773f
#define OLUM_O 0.401581f
-//Fathom-Lord Karathress AI
-struct boss_fathomlord_karathressAI : public ScriptedAI
+//Fathom-Lord Karathress AI class boss_fathomlord_karathress : public CreatureScript
{
- boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_fathomlord_karathress() : CreatureScript("boss_fathomlord_karathress") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
- Advisors[0] = 0;
- Advisors[1] = 0;
- Advisors[2] = 0;
+ return new boss_fathomlord_karathressAI (pCreature);
}
- ScriptedInstance* pInstance;
-
- uint32 CataclysmicBolt_Timer;
- uint32 Enrage_Timer;
- uint32 SearNova_Timer;
+ struct boss_fathomlord_karathressAI : public ScriptedAI
+ {
+ boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ Advisors[0] = 0;
+ Advisors[1] = 0;
+ Advisors[2] = 0;
+ }
- bool BlessingOfTides;
+ InstanceScript* pInstance;
- uint64 Advisors[3];
+ uint32 CataclysmicBolt_Timer;
+ uint32 Enrage_Timer;
+ uint32 SearNova_Timer;
- void Reset()
- {
- CataclysmicBolt_Timer = 10000;
- Enrage_Timer = 600000; //10 minutes
- SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds
+ bool BlessingOfTides;
- BlessingOfTides = false;
+ uint64 Advisors[3];
- if (pInstance)
+ void Reset()
{
- uint64 RAdvisors[3];
- RAdvisors[0] = pInstance->GetData64(DATA_SHARKKIS);
- RAdvisors[1] = pInstance->GetData64(DATA_TIDALVESS);
- RAdvisors[2] = pInstance->GetData64(DATA_CARIBDIS);
- //Respawn of the 3 Advisors
- Creature* pAdvisor = NULL;
- for (int i=0; i<3; ++i)
-
- if (RAdvisors[i])
- {
- pAdvisor = (Unit::GetCreature((*me), RAdvisors[i]));
- if (pAdvisor && !pAdvisor->isAlive())
+ CataclysmicBolt_Timer = 10000;
+ Enrage_Timer = 600000; //10 minutes
+ SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds
+
+ BlessingOfTides = false;
+
+ if (pInstance)
+ {
+ uint64 RAdvisors[3];
+ RAdvisors[0] = pInstance->GetData64(DATA_SHARKKIS);
+ RAdvisors[1] = pInstance->GetData64(DATA_TIDALVESS);
+ RAdvisors[2] = pInstance->GetData64(DATA_CARIBDIS);
+ //Respawn of the 3 Advisors
+ Creature* pAdvisor = NULL;
+ for (int i=0; i<3; ++i)
+
+ if (RAdvisors[i])
{
- pAdvisor->Respawn();
- pAdvisor->AI()->EnterEvadeMode();
- pAdvisor->GetMotionMaster()->MoveTargetedHome();
+ pAdvisor = (Unit::GetCreature((*me), RAdvisors[i]));
+ if (pAdvisor && !pAdvisor->isAlive())
+ {
+ pAdvisor->Respawn();
+ pAdvisor->AI()->EnterEvadeMode();
+ pAdvisor->GetMotionMaster()->MoveTargetedHome();
+ }
}
+ pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
- pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
- }
-
- }
- void EventSharkkisDeath()
- {
- DoScriptText(SAY_GAIN_ABILITY1, me);
- DoCast(me, SPELL_POWER_OF_SHARKKIS);
- }
+ }
- void EventTidalvessDeath()
- {
- DoScriptText(SAY_GAIN_ABILITY2, me);
- DoCast(me, SPELL_POWER_OF_TIDALVESS);
- }
+ void EventSharkkisDeath()
+ {
+ DoScriptText(SAY_GAIN_ABILITY1, me);
+ DoCast(me, SPELL_POWER_OF_SHARKKIS);
+ }
- void EventCaribdisDeath()
- {
- DoScriptText(SAY_GAIN_ABILITY3, me);
- DoCast(me, SPELL_POWER_OF_CARIBDIS);
- }
+ void EventTidalvessDeath()
+ {
+ DoScriptText(SAY_GAIN_ABILITY2, me);
+ DoCast(me, SPELL_POWER_OF_TIDALVESS);
+ }
- void GetAdvisors()
- {
- if (!pInstance)
- return;
+ void EventCaribdisDeath()
+ {
+ DoScriptText(SAY_GAIN_ABILITY3, me);
+ DoCast(me, SPELL_POWER_OF_CARIBDIS);
+ }
- Advisors[0] = pInstance->GetData64(DATA_SHARKKIS);
- Advisors[1] = pInstance->GetData64(DATA_TIDALVESS);
- Advisors[2] = pInstance->GetData64(DATA_CARIBDIS);
- }
+ void GetAdvisors()
+ {
+ if (!pInstance)
+ return;
- void StartEvent(Unit *who)
- {
- if (!pInstance)
- return;
+ Advisors[0] = pInstance->GetData64(DATA_SHARKKIS);
+ Advisors[1] = pInstance->GetData64(DATA_TIDALVESS);
+ Advisors[2] = pInstance->GetData64(DATA_CARIBDIS);
+ }
- GetAdvisors();
+ void StartEvent(Unit *who)
+ {
+ if (!pInstance)
+ return;
- DoScriptText(SAY_AGGRO, me);
- DoZoneInCombat();
+ GetAdvisors();
- pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
- }
+ DoScriptText(SAY_AGGRO, me);
+ DoZoneInCombat();
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
- }
+ pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
+ }
- void JustDied(Unit * /*killer*/)
- {
- DoScriptText(SAY_DEATH, me);
+ void KilledUnit(Unit * /*victim*/)
+ {
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
+ }
- if (pInstance)
- pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE);
+ void JustDied(Unit * /*killer*/)
+ {
+ DoScriptText(SAY_DEATH, me);
- //support for quest 10944
- me->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000);
- }
+ if (pInstance)
+ pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE);
- void EnterCombat(Unit * who)
- {
- StartEvent(who);
- }
+ //support for quest 10944
+ me->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000);
+ }
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ void EnterCombat(Unit * who)
{
- Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+ StartEvent(who);
+ }
- if (pTarget)
+ void UpdateAI(const uint32 diff)
+ {
+ //Only if not incombat check if the event is started
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
{
- AttackStart(pTarget);
- GetAdvisors();
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+
+ if (pTarget)
+ {
+ AttackStart(pTarget);
+ GetAdvisors();
+ }
}
- }
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- //someone evaded!
- if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
- {
- EnterEvadeMode();
- return;
- }
+ //someone evaded!
+ if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
+ {
+ EnterEvadeMode();
+ return;
+ }
- //CataclysmicBolt_Timer
- if (CataclysmicBolt_Timer <= diff)
- {
- //select a random unit other than the main tank
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ //CataclysmicBolt_Timer
+ if (CataclysmicBolt_Timer <= diff)
+ {
+ //select a random unit other than the main tank
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
- //if there aren't other units, cast on the tank
- if (!pTarget)
- pTarget = me->getVictim();
+ //if there aren't other units, cast on the tank
+ if (!pTarget)
+ pTarget = me->getVictim();
- if (pTarget)
- DoCast(pTarget, SPELL_CATACLYSMIC_BOLT);
- CataclysmicBolt_Timer = 10000;
- } else CataclysmicBolt_Timer -= diff;
+ if (pTarget)
+ DoCast(pTarget, SPELL_CATACLYSMIC_BOLT);
+ CataclysmicBolt_Timer = 10000;
+ } else CataclysmicBolt_Timer -= diff;
- //SearNova_Timer
- if (SearNova_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SEAR_NOVA);
- SearNova_Timer = 20000+rand()%40000;
- } else SearNova_Timer -= diff;
+ //SearNova_Timer
+ if (SearNova_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SEAR_NOVA);
+ SearNova_Timer = 20000+rand()%40000;
+ } else SearNova_Timer -= diff;
- //Enrage_Timer
- if (Enrage_Timer <= diff)
- {
- DoCast(me, SPELL_ENRAGE);
- Enrage_Timer = 90000;
- } else Enrage_Timer -= diff;
+ //Enrage_Timer
+ if (Enrage_Timer <= diff)
+ {
+ DoCast(me, SPELL_ENRAGE);
+ Enrage_Timer = 90000;
+ } else Enrage_Timer -= diff;
- //Blessing of Tides Trigger
- if ((me->GetHealth()*100 / me->GetMaxHealth()) <= 75 && !BlessingOfTides)
- {
- BlessingOfTides = true;
- bool continueTriggering = false;
- Creature* Advisor;
- for (uint8 i = 0; i < 4; ++i)
- if (Advisors[i])
- {
- Advisor = (Unit::GetCreature(*me, Advisors[i]));
- if (Advisor && Advisor->isAlive())
+ //Blessing of Tides Trigger
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) <= 75 && !BlessingOfTides)
+ {
+ BlessingOfTides = true;
+ bool continueTriggering = false;
+ Creature* Advisor;
+ for (uint8 i = 0; i < 4; ++i)
+ if (Advisors[i])
{
- continueTriggering = true;
- break;
+ Advisor = (Unit::GetCreature(*me, Advisors[i]));
+ if (Advisor && Advisor->isAlive())
+ {
+ continueTriggering = true;
+ break;
+ }
}
+ if (continueTriggering)
+ {
+ DoCast(me, SPELL_BLESSING_OF_THE_TIDES);
+ me->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_GAIN_BLESSING_OF_TIDES);
}
- if (continueTriggering)
- {
- DoCast(me, SPELL_BLESSING_OF_THE_TIDES);
- me->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(me, SOUND_GAIN_BLESSING_OF_TIDES);
}
+
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
- }
};
-//Fathom-Guard Sharkkis AI
-struct boss_fathomguard_sharkkisAI : public ScriptedAI
+//Fathom-Guard Sharkkis AI class boss_fathomguard_sharkkis : public CreatureScript
{
- boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_fathomguard_sharkkis() : CreatureScript("boss_fathomguard_sharkkis") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new boss_fathomguard_sharkkisAI (pCreature);
}
- ScriptedInstance* pInstance;
-
- uint32 LeechingThrow_Timer;
- uint32 TheBeastWithin_Timer;
- uint32 Multishot_Timer;
- uint32 Pet_Timer;
-
- bool pet;
-
- uint64 SummonedPet;
-
- void Reset()
+ struct boss_fathomguard_sharkkisAI : public ScriptedAI
{
- LeechingThrow_Timer = 20000;
- TheBeastWithin_Timer = 30000;
- Multishot_Timer = 15000;
- Pet_Timer = 10000;
-
- pet = false;
-
- Creature *Pet = Unit::GetCreature(*me, SummonedPet);
- if (Pet && Pet->isAlive())
+ boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c)
{
- Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ pInstance = c->GetInstanceScript();
}
- SummonedPet = 0;
+ InstanceScript* pInstance;
- if (pInstance)
- pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
- }
+ uint32 LeechingThrow_Timer;
+ uint32 TheBeastWithin_Timer;
+ uint32 Multishot_Timer;
+ uint32 Pet_Timer;
- void JustDied(Unit * /*victim*/)
- {
- if (pInstance)
- {
- Creature *Karathress = NULL;
- Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS)));
+ bool pet;
- if (Karathress)
- CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath();
- CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath();
- }
- }
+ uint64 SummonedPet;
- void EnterCombat(Unit * who)
- {
- if (pInstance)
+ void Reset()
{
- pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
- }
- }
+ LeechingThrow_Timer = 20000;
+ TheBeastWithin_Timer = 30000;
+ Multishot_Timer = 15000;
+ Pet_Timer = 10000;
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
- {
- Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+ pet = false;
- if (pTarget)
+ Creature *Pet = Unit::GetCreature(*me, SummonedPet);
+ if (Pet && Pet->isAlive())
{
- AttackStart(pTarget);
+ Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
- }
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ SummonedPet = 0;
- //someone evaded!
- if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
- {
- EnterEvadeMode();
- return;
+ if (pInstance)
+ pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
- //LeechingThrow_Timer
- if (LeechingThrow_Timer <= diff)
+ void JustDied(Unit * /*victim*/)
{
- DoCast(me->getVictim(), SPELL_LEECHING_THROW);
- LeechingThrow_Timer = 20000;
- } else LeechingThrow_Timer -= diff;
+ if (pInstance)
+ {
+ Creature *Karathress = NULL;
+ Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS)));
- //Multishot_Timer
- if (Multishot_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_MULTISHOT);
- Multishot_Timer = 20000;
- } else Multishot_Timer -= diff;
+ if (Karathress)
+ if (!me->isAlive() && Karathress)
+ CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath();
+ }
+ }
- //TheBeastWithin_Timer
- if (TheBeastWithin_Timer <= diff)
+ void EnterCombat(Unit * who)
{
- DoCast(me, SPELL_THE_BEAST_WITHIN);
- Creature *Pet = Unit::GetCreature(*me, SummonedPet);
- if (Pet && Pet->isAlive())
+ if (pInstance)
{
- Pet->CastSpell(Pet, SPELL_PET_ENRAGE, true);
+ pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
}
- TheBeastWithin_Timer = 30000;
- } else TheBeastWithin_Timer -= diff;
+ }
- //Pet_Timer
- if (Pet_Timer < diff && pet == false)
+ void UpdateAI(const uint32 diff)
{
- pet = true;
- //uint32 spell_id;
- uint32 pet_id;
- if (!urand(0,1))
+ //Only if not incombat check if the event is started
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
{
- //spell_id = SPELL_SUMMON_FATHOM_LURKER;
- pet_id = CREATURE_FATHOM_LURKER;
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+
+ if (pTarget)
+ {
+ AttackStart(pTarget);
+ }
}
- else
+
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ //someone evaded!
+ if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
{
- //spell_id = SPELL_SUMMON_FATHOM_SPOREBAT;
- pet_id = CREATURE_FATHOM_SPOREBAT;
+ EnterEvadeMode();
+ return;
}
- //DoCast(me, spell_id, true);
- Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (Pet && pTarget)
+
+ //LeechingThrow_Timer
+ if (LeechingThrow_Timer <= diff)
{
- Pet->AI()->AttackStart(pTarget);
- SummonedPet = Pet->GetGUID();
- }
- } else Pet_Timer -= diff;
+ DoCast(me->getVictim(), SPELL_LEECHING_THROW);
+ LeechingThrow_Timer = 20000;
+ } else LeechingThrow_Timer -= diff;
- DoMeleeAttackIfReady();
- }
-};
+ //Multishot_Timer
+ if (Multishot_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_MULTISHOT);
+ Multishot_Timer = 20000;
+ } else Multishot_Timer -= diff;
-//Fathom-Guard Tidalvess AI
-struct boss_fathomguard_tidalvessAI : public ScriptedAI
-{
- boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- }
+ //TheBeastWithin_Timer
+ if (TheBeastWithin_Timer <= diff)
+ {
+ DoCast(me, SPELL_THE_BEAST_WITHIN);
+ Creature *Pet = Unit::GetCreature(*me, SummonedPet);
+ if (Pet && Pet->isAlive())
+ {
+ Pet->CastSpell(Pet, SPELL_PET_ENRAGE, true);
+ }
+ TheBeastWithin_Timer = 30000;
+ } else TheBeastWithin_Timer -= diff;
- ScriptedInstance* pInstance;
+ //Pet_Timer
+ if (Pet_Timer < diff && pet == false)
+ {
+ pet = true;
+ //uint32 spell_id;
+ uint32 pet_id;
+ if (!urand(0,1))
+ {
+ //spell_id = SPELL_SUMMON_FATHOM_LURKER;
+ pet_id = CREATURE_FATHOM_LURKER;
+ }
+ else
+ {
+ //spell_id = SPELL_SUMMON_FATHOM_SPOREBAT;
+ pet_id = CREATURE_FATHOM_SPOREBAT;
+ }
+ //DoCast(me, spell_id, true);
+ Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (Pet && pTarget)
+ {
+ Pet->AI()->AttackStart(pTarget);
+ SummonedPet = Pet->GetGUID();
+ }
+ } else Pet_Timer -= diff;
- uint32 FrostShock_Timer;
- uint32 Spitfire_Timer;
- uint32 PoisonCleansing_Timer;
- uint32 Earthbind_Timer;
+ DoMeleeAttackIfReady();
+ }
+ };
- void Reset()
- {
- FrostShock_Timer = 25000;
- Spitfire_Timer = 60000;
- PoisonCleansing_Timer = 30000;
- Earthbind_Timer = 45000;
+};
- if (pInstance)
- pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
- }
+//Fathom-Guard Tidalvess AI class boss_fathomguard_tidalvess : public CreatureScript
+{
+public:
+ boss_fathomguard_tidalvess() : CreatureScript("boss_fathomguard_tidalvess") { }
- void JustDied(Unit * /*victim*/)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (pInstance)
- {
- Creature *Karathress = NULL;
- Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS)));
-
- if (Karathress)
- if (!me->isAlive() && Karathress)
- CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath();
- }
+ return new boss_fathomguard_tidalvessAI (pCreature);
}
- void EnterCombat(Unit * who)
+ struct boss_fathomguard_tidalvessAI : public ScriptedAI
{
- if (pInstance)
+ boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c)
{
- pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
+ pInstance = c->GetInstanceScript();
}
- DoCast(me, SPELL_WINDFURY_WEAPON);
- }
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ InstanceScript* pInstance;
+
+ uint32 FrostShock_Timer;
+ uint32 Spitfire_Timer;
+ uint32 PoisonCleansing_Timer;
+ uint32 Earthbind_Timer;
+
+ void Reset()
{
- Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+ FrostShock_Timer = 25000;
+ Spitfire_Timer = 60000;
+ PoisonCleansing_Timer = 30000;
+ Earthbind_Timer = 45000;
- if (pTarget)
- {
- AttackStart(pTarget);
- }
+ if (pInstance)
+ pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //someone evaded!
- if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
+ void JustDied(Unit * /*victim*/)
{
- EnterEvadeMode();
- return;
+ if (pInstance)
+ {
+ Creature *Karathress = NULL;
+ Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS)));
+
+ if (Karathress)
+ if (!me->isAlive() && Karathress)
+ CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath();
+ }
}
- if (!me->HasAura(SPELL_WINDFURY_WEAPON))
+ void EnterCombat(Unit * who)
{
+ if (pInstance)
+ {
+ pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
+ }
DoCast(me, SPELL_WINDFURY_WEAPON);
}
- //FrostShock_Timer
- if (FrostShock_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me->getVictim(), SPELL_FROST_SHOCK);
- FrostShock_Timer = 25000+rand()%5000;
- } else FrostShock_Timer -= diff;
+ //Only if not incombat check if the event is started
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ {
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
- //Spitfire_Timer
- if (Spitfire_Timer <= diff)
- {
- DoCast(me, SPELL_SPITFIRE_TOTEM);
- Unit *SpitfireTotem = Unit::GetUnit(*me, CREATURE_SPITFIRE_TOTEM);
- if (SpitfireTotem)
+ if (pTarget)
+ {
+ AttackStart(pTarget);
+ }
+ }
+
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ //someone evaded!
+ if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
{
- CAST_CRE(SpitfireTotem)->AI()->AttackStart(me->getVictim());
+ EnterEvadeMode();
+ return;
}
- Spitfire_Timer = 60000;
- } else Spitfire_Timer -= diff;
- //PoisonCleansing_Timer
- if (PoisonCleansing_Timer <= diff)
- {
- DoCast(me, SPELL_POISON_CLEANSING_TOTEM);
- PoisonCleansing_Timer = 30000;
- } else PoisonCleansing_Timer -= diff;
+ if (!me->HasAura(SPELL_WINDFURY_WEAPON))
+ {
+ DoCast(me, SPELL_WINDFURY_WEAPON);
+ }
- //Earthbind_Timer
- if (Earthbind_Timer <= diff)
- {
- DoCast(me, SPELL_EARTHBIND_TOTEM);
- Earthbind_Timer = 45000;
- } else Earthbind_Timer -= diff;
+ //FrostShock_Timer
+ if (FrostShock_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FROST_SHOCK);
+ FrostShock_Timer = 25000+rand()%5000;
+ } else FrostShock_Timer -= diff;
- DoMeleeAttackIfReady();
- }
-};
+ //Spitfire_Timer
+ if (Spitfire_Timer <= diff)
+ {
+ DoCast(me, SPELL_SPITFIRE_TOTEM);
+ Unit *SpitfireTotem = Unit::GetUnit(*me, CREATURE_SPITFIRE_TOTEM);
+ if (SpitfireTotem)
+ {
+ CAST_CRE(SpitfireTotem)->AI()->AttackStart(me->getVictim());
+ }
+ Spitfire_Timer = 60000;
+ } else Spitfire_Timer -= diff;
-//Fathom-Guard Caribdis AI
-struct boss_fathomguard_caribdisAI : public ScriptedAI
-{
- boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- }
+ //PoisonCleansing_Timer
+ if (PoisonCleansing_Timer <= diff)
+ {
+ DoCast(me, SPELL_POISON_CLEANSING_TOTEM);
+ PoisonCleansing_Timer = 30000;
+ } else PoisonCleansing_Timer -= diff;
- ScriptedInstance* pInstance;
+ //Earthbind_Timer
+ if (Earthbind_Timer <= diff)
+ {
+ DoCast(me, SPELL_EARTHBIND_TOTEM);
+ Earthbind_Timer = 45000;
+ } else Earthbind_Timer -= diff;
- uint32 WaterBoltVolley_Timer;
- uint32 TidalSurge_Timer;
- uint32 Heal_Timer;
- uint32 Cyclone_Timer;
+ DoMeleeAttackIfReady();
+ }
+ };
- void Reset()
- {
- WaterBoltVolley_Timer = 35000;
- TidalSurge_Timer = 15000+rand()%5000;
- Heal_Timer = 55000;
- Cyclone_Timer = 30000+rand()%10000;
+};
- if (pInstance)
- pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
- }
+//Fathom-Guard Caribdis AI class boss_fathomguard_caribdis : public CreatureScript
+{
+public:
+ boss_fathomguard_caribdis() : CreatureScript("boss_fathomguard_caribdis") { }
- void JustDied(Unit * /*victim*/)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (pInstance)
- {
- Creature *Karathress = NULL;
- Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS)));
-
- if (Karathress)
- if (!me->isAlive() && Karathress)
- CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath();
- }
+ return new boss_fathomguard_caribdisAI (pCreature);
}
- void EnterCombat(Unit * who)
+ struct boss_fathomguard_caribdisAI : public ScriptedAI
{
- if (pInstance)
+ boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c)
{
- pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
+ pInstance = c->GetInstanceScript();
}
- }
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ InstanceScript* pInstance;
+
+ uint32 WaterBoltVolley_Timer;
+ uint32 TidalSurge_Timer;
+ uint32 Heal_Timer;
+ uint32 Cyclone_Timer;
+
+ void Reset()
{
- Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
+ WaterBoltVolley_Timer = 35000;
+ TidalSurge_Timer = 15000+rand()%5000;
+ Heal_Timer = 55000;
+ Cyclone_Timer = 30000+rand()%10000;
- if (pTarget)
- {
- AttackStart(pTarget);
- }
+ if (pInstance)
+ pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //someone evaded!
- if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
+ void JustDied(Unit * /*victim*/)
{
- EnterEvadeMode();
- return;
+ if (pInstance)
+ {
+ Creature *Karathress = NULL;
+ Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS)));
+
+ if (Karathress)
+ if (!me->isAlive() && Karathress)
+ CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath();
+ }
}
- //WaterBoltVolley_Timer
- if (WaterBoltVolley_Timer <= diff)
+ void EnterCombat(Unit * who)
{
- DoCast(me->getVictim(), SPELL_WATER_BOLT_VOLLEY);
- WaterBoltVolley_Timer = 30000;
- } else WaterBoltVolley_Timer -= diff;
+ if (pInstance)
+ {
+ pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
+ }
+ }
- //TidalSurge_Timer
- if (TidalSurge_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me->getVictim(), SPELL_TIDAL_SURGE);
- // Hacky way to do it - won't trigger elseways
- me->getVictim()->CastSpell(me->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true);
- TidalSurge_Timer = 15000+rand()%5000;
- } else TidalSurge_Timer -= diff;
+ //Only if not incombat check if the event is started
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
+ {
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
- //Cyclone_Timer
- if (Cyclone_Timer <= diff)
- {
- //DoCast(me, SPELL_SUMMON_CYCLONE); // Doesn't work
- Cyclone_Timer = 30000+rand()%10000;
- Creature *Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000);
- if (Cyclone)
- {
- CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f);
- Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Cyclone->setFaction(me->getFaction());
- Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true);
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
{
- Cyclone->AI()->AttackStart(pTarget);
+ AttackStart(pTarget);
}
}
- } else Cyclone_Timer -= diff;
- //Heal_Timer
- if (Heal_Timer <= diff)
- {
- // It can be cast on any of the mobs
- Unit *pUnit = NULL;
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- while (pUnit == NULL || !pUnit->isAlive())
+ //someone evaded!
+ if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT))
{
- pUnit = selectAdvisorUnit();
+ EnterEvadeMode();
+ return;
}
- if (pUnit && pUnit->isAlive())
- DoCast(pUnit, SPELL_HEAL);
- Heal_Timer = 60000;
- } else Heal_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
+ //WaterBoltVolley_Timer
+ if (WaterBoltVolley_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_WATER_BOLT_VOLLEY);
+ WaterBoltVolley_Timer = 30000;
+ } else WaterBoltVolley_Timer -= diff;
- Unit* selectAdvisorUnit()
- {
- Unit* pUnit = NULL;
- if (pInstance)
- {
- switch(rand()%4)
- {
- case 0:
- pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESS));
- break;
- case 1:
- pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_SHARKKIS));
- break;
- case 2:
- pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_TIDALVESS));
- break;
- case 3:
- pUnit = me;
- break;
- }
- } else pUnit = me;
+ //TidalSurge_Timer
+ if (TidalSurge_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_TIDAL_SURGE);
+ // Hacky way to do it - won't trigger elseways
+ me->getVictim()->CastSpell(me->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true);
+ TidalSurge_Timer = 15000+rand()%5000;
+ } else TidalSurge_Timer -= diff;
+
+ //Cyclone_Timer
+ if (Cyclone_Timer <= diff)
+ {
+ //DoCast(me, SPELL_SUMMON_CYCLONE); // Doesn't work
+ Cyclone_Timer = 30000+rand()%10000;
+ Creature *Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000);
+ if (Cyclone)
+ {
+ CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f);
+ Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Cyclone->setFaction(me->getFaction());
+ Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true);
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget)
+ {
+ Cyclone->AI()->AttackStart(pTarget);
+ }
+ }
+ } else Cyclone_Timer -= diff;
- return pUnit;
- }
-};
+ //Heal_Timer
+ if (Heal_Timer <= diff)
+ {
+ // It can be cast on any of the mobs
+ Unit *pUnit = NULL;
-CreatureAI* GetAI_boss_fathomlord_karathress(Creature* pCreature)
-{
- return new boss_fathomlord_karathressAI (pCreature);
-}
+ while (pUnit == NULL || !pUnit->isAlive())
+ {
+ pUnit = selectAdvisorUnit();
+ }
-CreatureAI* GetAI_boss_fathomguard_sharkkis(Creature* pCreature)
-{
- return new boss_fathomguard_sharkkisAI (pCreature);
-}
+ if (pUnit && pUnit->isAlive())
+ DoCast(pUnit, SPELL_HEAL);
+ Heal_Timer = 60000;
+ } else Heal_Timer -= diff;
-CreatureAI* GetAI_boss_fathomguard_tidalvess(Creature* pCreature)
-{
- return new boss_fathomguard_tidalvessAI (pCreature);
-}
+ DoMeleeAttackIfReady();
+ }
-CreatureAI* GetAI_boss_fathomguard_caribdis(Creature* pCreature)
-{
- return new boss_fathomguard_caribdisAI (pCreature);
-}
+ Unit* selectAdvisorUnit()
+ {
+ Unit* pUnit = NULL;
+ if (pInstance)
+ {
+ switch(rand()%4)
+ {
+ case 0:
+ pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESS));
+ break;
+ case 1:
+ pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_SHARKKIS));
+ break;
+ case 2:
+ pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_TIDALVESS));
+ break;
+ case 3:
+ pUnit = me;
+ break;
+ }
+ } else pUnit = me;
+ return pUnit;
+ }
+ };
+};
void AddSC_boss_fathomlord_karathress()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_fathomlord_karathress";
- newscript->GetAI = &GetAI_boss_fathomlord_karathress;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_fathomguard_sharkkis";
- newscript->GetAI = &GetAI_boss_fathomguard_sharkkis;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_fathomguard_tidalvess";
- newscript->GetAI = &GetAI_boss_fathomguard_tidalvess;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_fathomguard_caribdis";
- newscript->GetAI = &GetAI_boss_fathomguard_caribdis;
- newscript->RegisterSelf();
+ new boss_fathomlord_karathress();
+ new boss_fathomguard_sharkkis();
+ new boss_fathomguard_tidalvess();
+ new boss_fathomguard_caribdis();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
index 1e75a4e65fd..5c53176be0b 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
@@ -75,307 +75,309 @@ EndScriptData */
#define SPAWN_Y_DIFF3 -4.72702
#define SPAWN_X_DIFF4 12.577011
#define SPAWN_Y_DIFF4 4.72702
-
-struct boss_hydross_the_unstableAI : public ScriptedAI
+ class boss_hydross_the_unstable : public CreatureScript
{
- boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(me)
- {
- pInstance = c->GetInstanceData();
- }
+public:
+ boss_hydross_the_unstable() : CreatureScript("boss_hydross_the_unstable") { }
- ScriptedInstance* pInstance;
-
- uint64 beams[2];
- uint32 PosCheck_Timer;
- uint32 MarkOfHydross_Timer;
- uint32 MarkOfCorruption_Timer;
- uint32 WaterTomb_Timer;
- uint32 VileSludge_Timer;
- uint32 MarkOfHydross_Count;
- uint32 MarkOfCorruption_Count;
- uint32 EnrageTimer;
- bool CorruptedForm;
- bool beam;
- SummonList Summons;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- DeSummonBeams();
- beams[0] = 0;
- beams[1] = 0;
- PosCheck_Timer = 2500;
- MarkOfHydross_Timer = 15000;
- MarkOfCorruption_Timer = 15000;
- WaterTomb_Timer = 7000;
- VileSludge_Timer = 7000;
- MarkOfHydross_Count = 0;
- MarkOfCorruption_Count = 0;
- EnrageTimer = 600000;
-
- CorruptedForm = false;
- me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
-
- me->SetDisplayId(MODEL_CLEAN);
-
- if (pInstance)
- pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
- beam = false;
- Summons.DespawnAll();
+ return new boss_hydross_the_unstableAI (pCreature);
}
- void SummonBeams()
+ struct boss_hydross_the_unstableAI : public ScriptedAI
{
- Creature* beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0);
- if (beamer)
+ boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(me)
{
- beamer->CastSpell(me,SPELL_BLUE_BEAM,true);
- beamer->SetDisplayId(11686); //invisible
- beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- beams[0]=beamer->GetGUID();
+ pInstance = c->GetInstanceScript();
}
- beamer = beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0);
- if (beamer)
+
+ InstanceScript* pInstance;
+
+ uint64 beams[2];
+ uint32 PosCheck_Timer;
+ uint32 MarkOfHydross_Timer;
+ uint32 MarkOfCorruption_Timer;
+ uint32 WaterTomb_Timer;
+ uint32 VileSludge_Timer;
+ uint32 MarkOfHydross_Count;
+ uint32 MarkOfCorruption_Count;
+ uint32 EnrageTimer;
+ bool CorruptedForm;
+ bool beam;
+ SummonList Summons;
+
+ void Reset()
{
- beamer->CastSpell(me,SPELL_BLUE_BEAM,true);
- beamer->SetDisplayId(11686); //invisible
- beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- beams[1]=beamer->GetGUID();
+ DeSummonBeams();
+ beams[0] = 0;
+ beams[1] = 0;
+ PosCheck_Timer = 2500;
+ MarkOfHydross_Timer = 15000;
+ MarkOfCorruption_Timer = 15000;
+ WaterTomb_Timer = 7000;
+ VileSludge_Timer = 7000;
+ MarkOfHydross_Count = 0;
+ MarkOfCorruption_Count = 0;
+ EnrageTimer = 600000;
+
+ CorruptedForm = false;
+ me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+
+ me->SetDisplayId(MODEL_CLEAN);
+
+ if (pInstance)
+ pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
+ beam = false;
+ Summons.DespawnAll();
}
- }
- void DeSummonBeams()
- {
- for (uint8 i=0; i<2; ++i)
+
+ void SummonBeams()
{
- Creature* mob = Unit::GetCreature(*me,beams[i]);
- if (mob)
+ Creature* beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0);
+ if (beamer)
+ {
+ beamer->CastSpell(me,SPELL_BLUE_BEAM,true);
+ beamer->SetDisplayId(11686); //invisible
+ beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ beams[0]=beamer->GetGUID();
+ }
+ beamer = beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0);
+ if (beamer)
{
- mob->setDeathState(DEAD);
- mob->RemoveCorpse();
+ beamer->CastSpell(me,SPELL_BLUE_BEAM,true);
+ beamer->SetDisplayId(11686); //invisible
+ beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ beams[1]=beamer->GetGUID();
}
}
- }
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
-
- if (pInstance)
- pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS);
- }
-
- void KilledUnit(Unit * /*victim*/)
- {
- if (CorruptedForm)
+ void DeSummonBeams()
{
- DoScriptText(RAND(SAY_CORRUPT_SLAY1,SAY_CORRUPT_SLAY2), me);
+ for (uint8 i=0; i<2; ++i)
+ {
+ Creature* mob = Unit::GetCreature(*me,beams[i]);
+ if (mob)
+ {
+ mob->setDeathState(DEAD);
+ mob->RemoveCorpse();
+ }
+ }
}
- else
+ void EnterCombat(Unit * /*who*/)
{
- DoScriptText(RAND(SAY_CLEAN_SLAY1,SAY_CLEAN_SLAY2), me);
+ DoScriptText(SAY_AGGRO, me);
+
+ if (pInstance)
+ pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS);
}
- }
- void JustSummoned(Creature* summoned)
- {
- if (summoned->GetEntry() == ENTRY_PURE_SPAWN)
+ void KilledUnit(Unit * /*victim*/)
{
- summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true);
- Summons.Summon(summoned);
+ if (CorruptedForm)
+ {
+ DoScriptText(RAND(SAY_CORRUPT_SLAY1,SAY_CORRUPT_SLAY2), me);
+ }
+ else
+ {
+ DoScriptText(RAND(SAY_CLEAN_SLAY1,SAY_CLEAN_SLAY2), me);
+ }
}
- if (summoned->GetEntry() == ENTRY_TAINTED_SPAWN)
+
+ void JustSummoned(Creature* summoned)
{
- summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
- summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true);
- Summons.Summon(summoned);
+ if (summoned->GetEntry() == ENTRY_PURE_SPAWN)
+ {
+ summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true);
+ Summons.Summon(summoned);
+ }
+ if (summoned->GetEntry() == ENTRY_TAINTED_SPAWN)
+ {
+ summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true);
+ Summons.Summon(summoned);
+ }
}
- }
- void SummonedCreatureDespawn(Creature *summon)
- {
- Summons.Despawn(summon);
- }
-
- void JustDied(Unit * /*victim*/)
- {
- if (CorruptedForm)
- DoScriptText(SAY_CORRUPT_DEATH, me);
- else
- DoScriptText(SAY_CLEAN_DEATH, me);
-
- if (pInstance)
- pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE);
- Summons.DespawnAll();
- }
+ void SummonedCreatureDespawn(Creature *summon)
+ {
+ Summons.Despawn(summon);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!beam)
+ void JustDied(Unit * /*victim*/)
{
- SummonBeams();
- beam=true;
+ if (CorruptedForm)
+ DoScriptText(SAY_CORRUPT_DEATH, me);
+ else
+ DoScriptText(SAY_CLEAN_DEATH, me);
+
+ if (pInstance)
+ pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE);
+ Summons.DespawnAll();
}
- //Return since we have no target
- if (!UpdateVictim())
- return;
- // corrupted form
- if (CorruptedForm)
+ void UpdateAI(const uint32 diff)
{
- //MarkOfCorruption_Timer
- if (MarkOfCorruption_Timer <= diff)
+ if (!beam)
{
- if (MarkOfCorruption_Count <= 5)
- {
- uint32 mark_spell = 0;
+ SummonBeams();
+ beam=true;
+ }
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- switch (MarkOfCorruption_Count)
+ // corrupted form
+ if (CorruptedForm)
+ {
+ //MarkOfCorruption_Timer
+ if (MarkOfCorruption_Timer <= diff)
+ {
+ if (MarkOfCorruption_Count <= 5)
{
- case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break;
- case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break;
- case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break;
- case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break;
- case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break;
- case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break;
+ uint32 mark_spell = 0;
+
+ switch (MarkOfCorruption_Count)
+ {
+ case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break;
+ case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break;
+ case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break;
+ case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break;
+ case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break;
+ case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break;
+ }
+
+ DoCast(me->getVictim(), mark_spell);
+
+ if (MarkOfCorruption_Count < 5)
+ ++MarkOfCorruption_Count;
}
- DoCast(me->getVictim(), mark_spell);
-
- if (MarkOfCorruption_Count < 5)
- ++MarkOfCorruption_Count;
- }
-
- MarkOfCorruption_Timer = 15000;
- } else MarkOfCorruption_Timer -= diff;
+ MarkOfCorruption_Timer = 15000;
+ } else MarkOfCorruption_Timer -= diff;
- //VileSludge_Timer
- if (VileSludge_Timer <= diff)
- {
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget)
- DoCast(pTarget, SPELL_VILE_SLUDGE);
+ //VileSludge_Timer
+ if (VileSludge_Timer <= diff)
+ {
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget)
+ DoCast(pTarget, SPELL_VILE_SLUDGE);
- VileSludge_Timer = 15000;
- } else VileSludge_Timer -= diff;
+ VileSludge_Timer = 15000;
+ } else VileSludge_Timer -= diff;
- //PosCheck_Timer
- if (PosCheck_Timer <= diff)
- {
- if (me->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS))
+ //PosCheck_Timer
+ if (PosCheck_Timer <= diff)
{
- // switch to clean form
- me->SetDisplayId(MODEL_CLEAN);
- CorruptedForm = false;
- MarkOfHydross_Count = 0;
-
- DoScriptText(SAY_SWITCH_TO_CLEAN, me);
- DoResetThreat();
- SummonBeams();
-
- // spawn 4 adds
- DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
-
- me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
- }
+ if (me->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS))
+ {
+ // switch to clean form
+ me->SetDisplayId(MODEL_CLEAN);
+ CorruptedForm = false;
+ MarkOfHydross_Count = 0;
+
+ DoScriptText(SAY_SWITCH_TO_CLEAN, me);
+ DoResetThreat();
+ SummonBeams();
+
+ // spawn 4 adds
+ DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+
+ me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
+ }
- PosCheck_Timer = 2500;
- } else PosCheck_Timer -=diff;
- }
- // clean form
- else
- {
- //MarkOfHydross_Timer
- if (MarkOfHydross_Timer <= diff)
+ PosCheck_Timer = 2500;
+ } else PosCheck_Timer -=diff;
+ }
+ // clean form
+ else
{
- if (MarkOfHydross_Count <= 5)
+ //MarkOfHydross_Timer
+ if (MarkOfHydross_Timer <= diff)
{
- uint32 mark_spell = NULL;
-
- switch(MarkOfHydross_Count)
+ if (MarkOfHydross_Count <= 5)
{
- case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break;
- case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break;
- case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break;
- case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break;
- case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break;
- case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break;
+ uint32 mark_spell = NULL;
+
+ switch(MarkOfHydross_Count)
+ {
+ case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break;
+ case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break;
+ case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break;
+ case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break;
+ case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break;
+ case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break;
+ }
+
+ DoCast(me->getVictim(), mark_spell);
+
+ if (MarkOfHydross_Count < 5)
+ ++MarkOfHydross_Count;
}
- DoCast(me->getVictim(), mark_spell);
+ MarkOfHydross_Timer = 15000;
+ } else MarkOfHydross_Timer -= diff;
- if (MarkOfHydross_Count < 5)
- ++MarkOfHydross_Count;
- }
+ //WaterTomb_Timer
+ if (WaterTomb_Timer <= diff)
+ {
+ Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
+ if (pTarget)
+ DoCast(pTarget, SPELL_WATER_TOMB);
- MarkOfHydross_Timer = 15000;
- } else MarkOfHydross_Timer -= diff;
+ WaterTomb_Timer = 7000;
+ } else WaterTomb_Timer -= diff;
- //WaterTomb_Timer
- if (WaterTomb_Timer <= diff)
- {
- Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
- if (pTarget)
- DoCast(pTarget, SPELL_WATER_TOMB);
+ //PosCheck_Timer
+ if (PosCheck_Timer <= diff)
+ {
+ if (!me->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS))
+ {
+ // switch to corrupted form
+ me->SetDisplayId(MODEL_CORRUPT);
+ MarkOfCorruption_Count = 0;
+ CorruptedForm = true;
+
+ DoScriptText(SAY_SWITCH_TO_CORRUPT, me);
+ DoResetThreat();
+ DeSummonBeams();
+
+ // spawn 4 adds
+ DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+
+ me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
+ }
- WaterTomb_Timer = 7000;
- } else WaterTomb_Timer -= diff;
+ PosCheck_Timer = 2500;
+ } else PosCheck_Timer -=diff;
+ }
- //PosCheck_Timer
- if (PosCheck_Timer <= diff)
+ //EnrageTimer
+ if (EnrageTimer <= diff)
{
- if (!me->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS))
- {
- // switch to corrupted form
- me->SetDisplayId(MODEL_CORRUPT);
- MarkOfCorruption_Count = 0;
- CorruptedForm = true;
-
- DoScriptText(SAY_SWITCH_TO_CORRUPT, me);
- DoResetThreat();
- DeSummonBeams();
-
- // spawn 4 adds
- DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
-
- me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
- }
+ DoCast(me, SPELL_ENRAGE);
+ EnrageTimer = 60000;
+ } else EnrageTimer -= diff;
- PosCheck_Timer = 2500;
- } else PosCheck_Timer -=diff;
+ DoMeleeAttackIfReady();
}
+ };
- //EnrageTimer
- if (EnrageTimer <= diff)
- {
- DoCast(me, SPELL_ENRAGE);
- EnrageTimer = 60000;
- } else EnrageTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_hydross_the_unstable(Creature* pCreature)
-{
- return new boss_hydross_the_unstableAI (pCreature);
-}
void AddSC_boss_hydross_the_unstable()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_hydross_the_unstable";
- newscript->GetAI = &GetAI_boss_hydross_the_unstable;
- newscript->RegisterSelf();
+ new boss_hydross_the_unstable();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
index 4f037936873..96c3662631b 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
@@ -132,910 +132,925 @@ float ShieldGeneratorChannelPos[4][4] =
{49.3126, -943.398, 42.5501, 2.40174}
};
-//Lady Vashj AI
-struct boss_lady_vashjAI : public ScriptedAI
+//Lady Vashj AI class boss_lady_vashj : public CreatureScript
{
- boss_lady_vashjAI (Creature *c) : ScriptedAI(c)
+public:
+ boss_lady_vashj() : CreatureScript("boss_lady_vashj") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
- Intro = false;
- JustCreated = true;
- c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped)
+ return new boss_lady_vashjAI (pCreature);
}
- ScriptedInstance *pInstance;
-
- uint64 ShieldGeneratorChannel[4];
-
- uint32 AggroTimer;
- uint32 ShockBlast_Timer;
- uint32 Entangle_Timer;
- uint32 StaticCharge_Timer;
- uint32 ForkedLightning_Timer;
- uint32 Check_Timer;
- uint32 EnchantedElemental_Timer;
- uint32 TaintedElemental_Timer;
- uint32 CoilfangElite_Timer;
- uint32 CoilfangStrider_Timer;
- uint32 SummonSporebat_Timer;
- uint32 SummonSporebat_StaticTimer;
- uint8 EnchantedElemental_Pos;
- uint8 Phase;
-
- bool Entangle;
- bool Intro;
- bool CanAttack;
- bool JustCreated;
-
- void Reset()
+ struct boss_lady_vashjAI : public ScriptedAI
{
- AggroTimer = 19000;
- ShockBlast_Timer = 1+rand()%60000;
- Entangle_Timer = 30000;
- StaticCharge_Timer = 10000+rand()%15000;
- ForkedLightning_Timer = 2000;
- Check_Timer = 15000;
- EnchantedElemental_Timer = 5000;
- TaintedElemental_Timer = 50000;
- CoilfangElite_Timer = 45000+rand()%5000;
- CoilfangStrider_Timer = 60000+rand()%10000;
- SummonSporebat_Timer = 10000;
- SummonSporebat_StaticTimer = 30000;
- EnchantedElemental_Pos = 0;
- Phase = 0;
-
- Entangle = false;
- if (JustCreated)
+ boss_lady_vashjAI (Creature *c) : ScriptedAI(c)
{
- CanAttack = false;
- JustCreated = false;
- } else CanAttack = true;
+ pInstance = c->GetInstanceScript();
+ Intro = false;
+ JustCreated = true;
+ c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped)
+ }
- Unit *remo;
- for (uint8 i = 0; i < 4; ++i)
+ InstanceScript *pInstance;
+
+ uint64 ShieldGeneratorChannel[4];
+
+ uint32 AggroTimer;
+ uint32 ShockBlast_Timer;
+ uint32 Entangle_Timer;
+ uint32 StaticCharge_Timer;
+ uint32 ForkedLightning_Timer;
+ uint32 Check_Timer;
+ uint32 EnchantedElemental_Timer;
+ uint32 TaintedElemental_Timer;
+ uint32 CoilfangElite_Timer;
+ uint32 CoilfangStrider_Timer;
+ uint32 SummonSporebat_Timer;
+ uint32 SummonSporebat_StaticTimer;
+ uint8 EnchantedElemental_Pos;
+ uint8 Phase;
+
+ bool Entangle;
+ bool Intro;
+ bool CanAttack;
+ bool JustCreated;
+
+ void Reset()
{
- remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]);
- if (remo)
- remo->setDeathState(JUST_DIED);
- }
+ AggroTimer = 19000;
+ ShockBlast_Timer = 1+rand()%60000;
+ Entangle_Timer = 30000;
+ StaticCharge_Timer = 10000+rand()%15000;
+ ForkedLightning_Timer = 2000;
+ Check_Timer = 15000;
+ EnchantedElemental_Timer = 5000;
+ TaintedElemental_Timer = 50000;
+ CoilfangElite_Timer = 45000+rand()%5000;
+ CoilfangStrider_Timer = 60000+rand()%10000;
+ SummonSporebat_Timer = 10000;
+ SummonSporebat_StaticTimer = 30000;
+ EnchantedElemental_Pos = 0;
+ Phase = 0;
+
+ Entangle = false;
+ if (JustCreated)
+ {
+ CanAttack = false;
+ JustCreated = false;
+ } else CanAttack = true;
- if (pInstance)
- pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
- ShieldGeneratorChannel[0] = 0;
- ShieldGeneratorChannel[1] = 0;
- ShieldGeneratorChannel[2] = 0;
- ShieldGeneratorChannel[3] = 0;
+ Unit *remo;
+ for (uint8 i = 0; i < 4; ++i)
+ {
+ remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]);
+ if (remo)
+ remo->setDeathState(JUST_DIED);
+ }
- me->SetCorpseDelay(1000*60*60);
- }
+ if (pInstance)
+ pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
+ ShieldGeneratorChannel[0] = 0;
+ ShieldGeneratorChannel[1] = 0;
+ ShieldGeneratorChannel[2] = 0;
+ ShieldGeneratorChannel[3] = 0;
- //Called when a tainted elemental dies
- void EventTaintedElementalDeath()
- {
- //the next will spawn 50 seconds after the previous one's death
- if (TaintedElemental_Timer > 50000)
- TaintedElemental_Timer = 50000;
- }
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
- }
+ me->SetCorpseDelay(1000*60*60);
+ }
- void JustDied(Unit * /*victim*/)
- {
- DoScriptText(SAY_DEATH, me);
+ //Called when a tainted elemental dies
+ void EventTaintedElementalDeath()
+ {
+ //the next will spawn 50 seconds after the previous one's death
+ if (TaintedElemental_Timer > 50000)
+ TaintedElemental_Timer = 50000;
+ }
+ void KilledUnit(Unit * /*victim*/)
+ {
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
+ }
- if (pInstance)
- pInstance->SetData(DATA_LADYVASHJEVENT, DONE);
- }
+ void JustDied(Unit * /*victim*/)
+ {
+ DoScriptText(SAY_DEATH, me);
- void StartEvent()
- {
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3,SAY_AGGRO4), me);
+ if (pInstance)
+ pInstance->SetData(DATA_LADYVASHJEVENT, DONE);
+ }
- Phase = 1;
+ void StartEvent()
+ {
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3,SAY_AGGRO4), me);
- if (pInstance)
- pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS);
- }
+ Phase = 1;
- void EnterCombat(Unit * who)
- {
- if (pInstance)
+ if (pInstance)
+ pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS);
+ }
+
+ void EnterCombat(Unit * who)
{
- //remove old tainted cores to prevent cheating in phase 2
- Map* pMap = me->GetMap();
- Map::PlayerList const &PlayerList = pMap->GetPlayers();
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ if (pInstance)
{
- if (Player* i_pl = i->getSource())
+ //remove old tainted cores to prevent cheating in phase 2
+ Map* pMap = me->GetMap();
+ Map::PlayerList const &PlayerList = pMap->GetPlayers();
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
- i_pl->DestroyItemCount(31088, 1, true);
+ if (Player* i_pl = i->getSource())
+ {
+ i_pl->DestroyItemCount(31088, 1, true);
+ }
}
}
- }
- StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event
-
- if (Phase != 2)
- AttackStart(who);
- }
+ StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event
- void MoveInLineOfSight(Unit *who)
- {
- if (!Intro)
- {
- Intro = true;
- DoScriptText(SAY_INTRO, me);
+ if (Phase != 2)
+ AttackStart(who);
}
- if (!CanAttack)
- return;
- if (!who || me->getVictim())
- return;
- if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who))
+ void MoveInLineOfSight(Unit *who)
{
- float attackRadius = me->GetAttackDistance(who);
- if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who))
+ if (!Intro)
+ {
+ Intro = true;
+ DoScriptText(SAY_INTRO, me);
+ }
+ if (!CanAttack)
+ return;
+ if (!who || me->getVictim())
+ return;
+
+ if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who))
{
- //if (who->HasStealthAura())
- // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who))
+ {
+ //if (who->HasStealthAura())
+ // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
- if (!me->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking
- StartEvent();
+ if (!me->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking
+ StartEvent();
- if (Phase != 2)
- AttackStart(who);
+ if (Phase != 2)
+ AttackStart(who);
+ }
}
}
- }
- void CastShootOrMultishot()
- {
- switch (urand(0,1))
- {
- case 0:
- //Shoot
- //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage.
- DoCast(me->getVictim(), SPELL_SHOOT);
- break;
- case 1:
- //Multishot
- //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage.
- DoCast(me->getVictim(), SPELL_MULTI_SHOT);
- break;
- }
- if (rand()%3)
+ void CastShootOrMultishot()
{
- DoScriptText(RAND(SAY_BOWSHOT1,SAY_BOWSHOT2), me);
+ switch (urand(0,1))
+ {
+ case 0:
+ //Shoot
+ //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage.
+ DoCast(me->getVictim(), SPELL_SHOOT);
+ break;
+ case 1:
+ //Multishot
+ //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage.
+ DoCast(me->getVictim(), SPELL_MULTI_SHOT);
+ break;
+ }
+ if (rand()%3)
+ {
+ DoScriptText(RAND(SAY_BOWSHOT1,SAY_BOWSHOT2), me);
+ }
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (!CanAttack && Intro)
+ void UpdateAI(const uint32 diff)
{
- if (AggroTimer <= diff)
+ if (!CanAttack && Intro)
{
- CanAttack = true;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- AggroTimer=19000;
- }else
+ if (AggroTimer <= diff)
+ {
+ CanAttack = true;
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ AggroTimer=19000;
+ }else
+ {
+ AggroTimer-=diff;
+ return;
+ }
+ }
+ //to prevent abuses during phase 2
+ if (Phase == 2 && !me->getVictim() && me->isInCombat())
{
- AggroTimer-=diff;
+ EnterEvadeMode();
return;
}
- }
- //to prevent abuses during phase 2
- if (Phase == 2 && !me->getVictim() && me->isInCombat())
- {
- EnterEvadeMode();
- return;
- }
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- if (Phase == 1 || Phase == 3)
- {
- //ShockBlast_Timer
- if (ShockBlast_Timer <= diff)
+ if (Phase == 1 || Phase == 3)
{
- //Shock Burst
- //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list.
- DoCast(me->getVictim(), SPELL_SHOCK_BLAST);
- me->TauntApply(me->getVictim());
+ //ShockBlast_Timer
+ if (ShockBlast_Timer <= diff)
+ {
+ //Shock Burst
+ //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list.
+ DoCast(me->getVictim(), SPELL_SHOCK_BLAST);
+ me->TauntApply(me->getVictim());
- ShockBlast_Timer = 1000+rand()%14000; //random cooldown
- } else ShockBlast_Timer -= diff;
+ ShockBlast_Timer = 1000+rand()%14000; //random cooldown
+ } else ShockBlast_Timer -= diff;
- //StaticCharge_Timer
- if (StaticCharge_Timer <= diff)
- {
- //Static Charge
- //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic.
- Unit *pTarget = NULL;
- pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true);
+ //StaticCharge_Timer
+ if (StaticCharge_Timer <= diff)
+ {
+ //Static Charge
+ //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic.
+ Unit *pTarget = NULL;
+ pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true);
- if (pTarget && !pTarget->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
- //cast Static Charge every 2 seconds for 20 seconds
- DoCast(pTarget, SPELL_STATIC_CHARGE_TRIGGER);
+ if (pTarget && !pTarget->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
+ //cast Static Charge every 2 seconds for 20 seconds
+ DoCast(pTarget, SPELL_STATIC_CHARGE_TRIGGER);
- StaticCharge_Timer = 10000+rand()%20000; //blizzlike
- } else StaticCharge_Timer -= diff;
+ StaticCharge_Timer = 10000+rand()%20000; //blizzlike
+ } else StaticCharge_Timer -= diff;
- //Entangle_Timer
- if (Entangle_Timer <= diff)
- {
- if (!Entangle)
- {
- //Entangle
- //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom.
- DoCast(me->getVictim(), SPELL_ENTANGLE);
- Entangle = true;
- Entangle_Timer = 10000;
- }
- else
+ //Entangle_Timer
+ if (Entangle_Timer <= diff)
{
- CastShootOrMultishot();
- Entangle = false;
- Entangle_Timer = 20000+rand()%5000;
- }
- } else Entangle_Timer -= diff;
+ if (!Entangle)
+ {
+ //Entangle
+ //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom.
+ DoCast(me->getVictim(), SPELL_ENTANGLE);
+ Entangle = true;
+ Entangle_Timer = 10000;
+ }
+ else
+ {
+ CastShootOrMultishot();
+ Entangle = false;
+ Entangle_Timer = 20000+rand()%5000;
+ }
+ } else Entangle_Timer -= diff;
- //Phase 1
- if (Phase == 1)
- {
- //Start phase 2
- if ((me->GetHealth()*100 / me->GetMaxHealth()) < 70)
+ //Phase 1
+ if (Phase == 1)
{
- //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable.
- Phase = 2;
-
- me->GetMotionMaster()->Clear();
- DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
-
- Creature *pCreature;
- for (uint8 i = 0; i < 4; ++i)
+ //Start phase 2
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 70)
{
- pCreature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (pCreature)
- ShieldGeneratorChannel[i] = pCreature->GetGUID();
+ //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable.
+ Phase = 2;
+
+ me->GetMotionMaster()->Clear();
+ DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
+
+ Creature *pCreature;
+ for (uint8 i = 0; i < 4; ++i)
+ {
+ pCreature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (pCreature)
+ ShieldGeneratorChannel[i] = pCreature->GetGUID();
+ }
+ DoScriptText(SAY_PHASE2, me);
}
- DoScriptText(SAY_PHASE2, me);
}
- }
- //Phase 3
- else
- {
- //SummonSporebat_Timer
- if (SummonSporebat_Timer <= diff)
+ //Phase 3
+ else
{
- Creature *Sporebat = NULL;
- Sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
-
- if (Sporebat)
+ //SummonSporebat_Timer
+ if (SummonSporebat_Timer <= diff)
{
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget)
- Sporebat->AI()->AttackStart(pTarget);
- }
+ Creature *Sporebat = NULL;
+ Sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
- //summon sporebats faster and faster
- if (SummonSporebat_StaticTimer > 1000)
- SummonSporebat_StaticTimer -= 1000;
+ if (Sporebat)
+ {
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget)
+ Sporebat->AI()->AttackStart(pTarget);
+ }
- SummonSporebat_Timer = SummonSporebat_StaticTimer;
+ //summon sporebats faster and faster
+ if (SummonSporebat_StaticTimer > 1000)
+ SummonSporebat_StaticTimer -= 1000;
- if (SummonSporebat_Timer < 5000)
- SummonSporebat_Timer = 5000;
+ SummonSporebat_Timer = SummonSporebat_StaticTimer;
- } else SummonSporebat_Timer -= diff;
- }
+ if (SummonSporebat_Timer < 5000)
+ SummonSporebat_Timer = 5000;
- //Melee attack
- DoMeleeAttackIfReady();
+ } else SummonSporebat_Timer -= diff;
+ }
- //Check_Timer - used to check if somebody is in melee range
- if (Check_Timer <= diff)
- {
- bool InMeleeRange = false;
- Unit *pTarget;
- std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
- for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ //Melee attack
+ DoMeleeAttackIfReady();
+
+ //Check_Timer - used to check if somebody is in melee range
+ if (Check_Timer <= diff)
{
- pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
- //if in melee range
- if (pTarget && pTarget->IsWithinDistInMap(me, 5))
+ bool InMeleeRange = false;
+ Unit *pTarget;
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
+ for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- InMeleeRange = true;
- break;
+ pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
+ //if in melee range
+ if (pTarget && pTarget->IsWithinDistInMap(me, 5))
+ {
+ InMeleeRange = true;
+ break;
+ }
}
- }
- //if nobody is in melee range
- if (!InMeleeRange)
- CastShootOrMultishot();
+ //if nobody is in melee range
+ if (!InMeleeRange)
+ CastShootOrMultishot();
- Check_Timer = 5000;
- } else Check_Timer -= diff;
- }
- //Phase 2
- else
- {
- //ForkedLightning_Timer
- if (ForkedLightning_Timer <= diff)
+ Check_Timer = 5000;
+ } else Check_Timer -= diff;
+ }
+ //Phase 2
+ else
{
- //Forked Lightning
- //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage.
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ //ForkedLightning_Timer
+ if (ForkedLightning_Timer <= diff)
+ {
+ //Forked Lightning
+ //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage.
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (!pTarget)
- pTarget = me->getVictim();
+ if (!pTarget)
+ pTarget = me->getVictim();
- DoCast(pTarget, SPELL_FORKED_LIGHTNING);
+ DoCast(pTarget, SPELL_FORKED_LIGHTNING);
- ForkedLightning_Timer = 2000+rand()%6000; //blizzlike
- } else ForkedLightning_Timer -= diff;
+ ForkedLightning_Timer = 2000+rand()%6000; //blizzlike
+ } else ForkedLightning_Timer -= diff;
- //EnchantedElemental_Timer
- if (EnchantedElemental_Timer <= diff)
- {
- Creature *Elemental;
- Elemental = me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ //EnchantedElemental_Timer
+ if (EnchantedElemental_Timer <= diff)
+ {
+ Creature *Elemental;
+ Elemental = me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (EnchantedElemental_Pos == 7)
- EnchantedElemental_Pos = 0;
- else
- ++EnchantedElemental_Pos;
+ if (EnchantedElemental_Pos == 7)
+ EnchantedElemental_Pos = 0;
+ else
+ ++EnchantedElemental_Pos;
- EnchantedElemental_Timer = 10000+rand()%5000;
- } else EnchantedElemental_Timer -= diff;
+ EnchantedElemental_Timer = 10000+rand()%5000;
+ } else EnchantedElemental_Timer -= diff;
- //TaintedElemental_Timer
- if (TaintedElemental_Timer <= diff)
- {
- Creature *Tain_Elemental;
- uint32 pos = rand()%8;
- Tain_Elemental = me->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0);
+ //TaintedElemental_Timer
+ if (TaintedElemental_Timer <= diff)
+ {
+ Creature *Tain_Elemental;
+ uint32 pos = rand()%8;
+ Tain_Elemental = me->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0);
- TaintedElemental_Timer = 120000;
- } else TaintedElemental_Timer -= diff;
+ TaintedElemental_Timer = 120000;
+ } else TaintedElemental_Timer -= diff;
- //CoilfangElite_Timer
- if (CoilfangElite_Timer <= diff)
- {
- uint32 pos = rand()%3;
- Creature* CoilfangElite = NULL;
- CoilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if (CoilfangElite)
+ //CoilfangElite_Timer
+ if (CoilfangElite_Timer <= diff)
{
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget)
- CoilfangElite->AI()->AttackStart(pTarget);
- else if (me->getVictim())
- CoilfangElite->AI()->AttackStart(me->getVictim());
- }
- CoilfangElite_Timer = 45000+rand()%5000;
- } else CoilfangElite_Timer -= diff;
+ uint32 pos = rand()%3;
+ Creature* CoilfangElite = NULL;
+ CoilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ if (CoilfangElite)
+ {
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget)
+ CoilfangElite->AI()->AttackStart(pTarget);
+ else if (me->getVictim())
+ CoilfangElite->AI()->AttackStart(me->getVictim());
+ }
+ CoilfangElite_Timer = 45000+rand()%5000;
+ } else CoilfangElite_Timer -= diff;
- //CoilfangStrider_Timer
- if (CoilfangStrider_Timer <= diff)
- {
- uint32 pos = rand()%3;
- Creature* CoilfangStrider = NULL;
- CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if (CoilfangStrider)
+ //CoilfangStrider_Timer
+ if (CoilfangStrider_Timer <= diff)
{
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget)
- CoilfangStrider->AI()->AttackStart(pTarget);
- else if (me->getVictim())
- CoilfangStrider->AI()->AttackStart(me->getVictim());
- }
- CoilfangStrider_Timer = 60000+rand()%10000;
- } else CoilfangStrider_Timer -= diff;
+ uint32 pos = rand()%3;
+ Creature* CoilfangStrider = NULL;
+ CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ if (CoilfangStrider)
+ {
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget)
+ CoilfangStrider->AI()->AttackStart(pTarget);
+ else if (me->getVictim())
+ CoilfangStrider->AI()->AttackStart(me->getVictim());
+ }
+ CoilfangStrider_Timer = 60000+rand()%10000;
+ } else CoilfangStrider_Timer -= diff;
- //Check_Timer
- if (Check_Timer <= diff)
- {
- //Start Phase 3
- if (pInstance && pInstance->GetData(DATA_CANSTARTPHASE3))
+ //Check_Timer
+ if (Check_Timer <= diff)
{
- //set life 50%
- me->SetHealth(me->GetMaxHealth()/2);
+ //Start Phase 3
+ if (pInstance && pInstance->GetData(DATA_CANSTARTPHASE3))
+ {
+ //set life 50%
+ me->SetHealth(me->GetMaxHealth()/2);
- me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER);
+ me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER);
- DoScriptText(SAY_PHASE3, me);
+ DoScriptText(SAY_PHASE3, me);
- Phase = 3;
+ Phase = 3;
- //return to the tank
- me->GetMotionMaster()->MoveChase(me->getVictim());
- }
- Check_Timer = 1000;
- } else Check_Timer -= diff;
+ //return to the tank
+ me->GetMotionMaster()->MoveChase(me->getVictim());
+ }
+ Check_Timer = 1000;
+ } else Check_Timer -= diff;
+ }
}
- }
+ };
+
};
//Enchanted Elemental
-//If one of them reaches Vashj he will increase her damage done by 5%.
-struct mob_enchanted_elementalAI : public ScriptedAI
+//If one of them reaches Vashj he will increase her damage done by 5%. class mob_enchanted_elemental : public CreatureScript
{
- mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c)
+public:
+ mob_enchanted_elemental() : CreatureScript("mob_enchanted_elemental") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new mob_enchanted_elementalAI (pCreature);
}
- ScriptedInstance *pInstance;
- uint32 move;
- uint32 phase;
- float x, y, z;
-
- uint64 VashjGUID;
-
- void Reset()
+ struct mob_enchanted_elementalAI : public ScriptedAI
{
- me->SetSpeed(MOVE_WALK,0.6);//walk
- me->SetSpeed(MOVE_RUN,0.6);//run
- move = 0;
- phase = 1;
+ mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
+
+ InstanceScript *pInstance;
+ uint32 move;
+ uint32 phase;
+ float x, y, z;
- VashjGUID = 0;
+ uint64 VashjGUID;
- for (int i = 0; i<8; ++i)//search for nearest waypoint (up on stairs)
+ void Reset()
{
- if (!x || !y || !z)
- {
- x = ElementWPPos[i][0];
- y = ElementWPPos[i][1];
- z = ElementWPPos[i][2];
- }
- else
+ me->SetSpeed(MOVE_WALK,0.6);//walk
+ me->SetSpeed(MOVE_RUN,0.6);//run
+ move = 0;
+ phase = 1;
+
+ VashjGUID = 0;
+
+ for (int i = 0; i<8; ++i)//search for nearest waypoint (up on stairs)
{
- if (me->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < me->GetDistance(x,y,z))
+ if (!x || !y || !z)
{
x = ElementWPPos[i][0];
y = ElementWPPos[i][1];
z = ElementWPPos[i][2];
}
+ else
+ {
+ if (me->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < me->GetDistance(x,y,z))
+ {
+ x = ElementWPPos[i][0];
+ y = ElementWPPos[i][1];
+ z = ElementWPPos[i][2];
+ }
+ }
}
+ if (pInstance)
+ VashjGUID = pInstance->GetData64(DATA_LADYVASHJ);
}
- if (pInstance)
- VashjGUID = pInstance->GetData64(DATA_LADYVASHJ);
- }
- void EnterCombat(Unit * /*who*/) {}
+ void EnterCombat(Unit * /*who*/) {}
- void MoveInLineOfSight(Unit * /*who*/) {}
+ void MoveInLineOfSight(Unit * /*who*/) {}
- void UpdateAI(const uint32 diff)
- {
- if (!pInstance)
- return;
+ void UpdateAI(const uint32 diff)
+ {
+ if (!pInstance)
+ return;
- if (!VashjGUID)
- return;
+ if (!VashjGUID)
+ return;
- if (move <= diff)
- {
- me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
- if (phase == 1)
- me->GetMotionMaster()->MovePoint(0, x, y, z);
- if (phase == 1 && me->IsWithinDist3d(x,y,z, 0.1))
- phase = 2;
- if (phase == 2)
- {
- me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
- phase = 3;
- }
- if (phase == 3)
+ if (move <= diff)
{
- me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
- if (me->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3))
- DoCast(me, SPELL_SURGE);
- }
- if (Creature *Vashj = Unit::GetCreature(*me, VashjGUID))
- {
- if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead())
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ if (phase == 1)
+ me->GetMotionMaster()->MovePoint(0, x, y, z);
+ if (phase == 1 && me->IsWithinDist3d(x,y,z, 0.1))
+ phase = 2;
+ if (phase == 2)
{
- //call Unsummon()
- me->Kill(me);
+ me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
+ phase = 3;
}
- }
- move = 1000;
- } else move -= diff;
- }
+ if (phase == 3)
+ {
+ me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
+ if (me->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3))
+ DoCast(me, SPELL_SURGE);
+ }
+ if (Creature *Vashj = Unit::GetCreature(*me, VashjGUID))
+ {
+ if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead())
+ {
+ //call Unsummon()
+ me->Kill(me);
+ }
+ }
+ move = 1000;
+ } else move -= diff;
+ }
+ };
+
};
//Tainted Elemental
-//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental
-struct mob_tainted_elementalAI : public ScriptedAI
+//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental class mob_tainted_elemental : public CreatureScript
{
- mob_tainted_elementalAI(Creature *c) : ScriptedAI(c)
+public:
+ mob_tainted_elemental() : CreatureScript("mob_tainted_elemental") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new mob_tainted_elementalAI (pCreature);
}
- ScriptedInstance *pInstance;
+ struct mob_tainted_elementalAI : public ScriptedAI
+ {
+ mob_tainted_elementalAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
+
+ InstanceScript *pInstance;
- uint32 PoisonBolt_Timer;
- uint32 Despawn_Timer;
+ uint32 PoisonBolt_Timer;
+ uint32 Despawn_Timer;
- void Reset()
- {
- PoisonBolt_Timer = 5000+rand()%5000;
- Despawn_Timer = 30000;
- }
+ void Reset()
+ {
+ PoisonBolt_Timer = 5000+rand()%5000;
+ Despawn_Timer = 30000;
+ }
- void JustDied(Unit * /*killer*/)
- {
- if (pInstance)
+ void JustDied(Unit * /*killer*/)
{
- Creature *Vashj = NULL;
- Vashj = (Unit::GetCreature((*me), pInstance->GetData64(DATA_LADYVASHJ)));
+ if (pInstance)
+ {
+ Creature *Vashj = NULL;
+ Vashj = (Unit::GetCreature((*me), pInstance->GetData64(DATA_LADYVASHJ)));
- if (Vashj)
- CAST_AI(boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath();
+ if (Vashj)
+ CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath();
+ }
}
- }
- void EnterCombat(Unit * who)
- {
- me->AddThreat(who, 0.1f);
- }
+ void EnterCombat(Unit * who)
+ {
+ me->AddThreat(who, 0.1f);
+ }
- void UpdateAI(const uint32 diff)
- {
- //PoisonBolt_Timer
- if (PoisonBolt_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ //PoisonBolt_Timer
+ if (PoisonBolt_Timer <= diff)
+ {
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget && pTarget->IsWithinDistInMap(me, 30))
- DoCast(pTarget, SPELL_POISON_BOLT);
+ if (pTarget && pTarget->IsWithinDistInMap(me, 30))
+ DoCast(pTarget, SPELL_POISON_BOLT);
- PoisonBolt_Timer = 5000+rand()%5000;
- } else PoisonBolt_Timer -= diff;
+ PoisonBolt_Timer = 5000+rand()%5000;
+ } else PoisonBolt_Timer -= diff;
- //Despawn_Timer
- if (Despawn_Timer <= diff)
- {
- //call Unsummon()
- me->setDeathState(DEAD);
+ //Despawn_Timer
+ if (Despawn_Timer <= diff)
+ {
+ //call Unsummon()
+ me->setDeathState(DEAD);
+
+ //to prevent crashes
+ Despawn_Timer = 1000;
+ } else Despawn_Timer -= diff;
+ }
+ };
- //to prevent crashes
- Despawn_Timer = 1000;
- } else Despawn_Timer -= diff;
- }
};
//Toxic Sporebat
-//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it.
-struct mob_toxic_sporebatAI : public ScriptedAI
+//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. class mob_toxic_sporebat : public CreatureScript
{
- mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- EnterEvadeMode();
- }
-
- ScriptedInstance *pInstance;
-
- uint32 movement_timer;
- uint32 ToxicSpore_Timer;
- uint32 bolt_timer;
- uint32 Check_Timer;
+public:
+ mob_toxic_sporebat() : CreatureScript("mob_toxic_sporebat") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- me->setFaction(14);
- movement_timer = 0;
- ToxicSpore_Timer = 5000;
- bolt_timer = 5500;
- Check_Timer = 1000;
+ return new mob_toxic_sporebatAI (pCreature);
}
- void EnterCombat(Unit * /*who*/)
+ struct mob_toxic_sporebatAI : public ScriptedAI
{
+ mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ EnterEvadeMode();
+ }
- }
+ InstanceScript *pInstance;
- void MoveInLineOfSight(Unit * /*who*/)
- {
+ uint32 movement_timer;
+ uint32 ToxicSpore_Timer;
+ uint32 bolt_timer;
+ uint32 Check_Timer;
- }
+ void Reset()
+ {
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->setFaction(14);
+ movement_timer = 0;
+ ToxicSpore_Timer = 5000;
+ bolt_timer = 5500;
+ Check_Timer = 1000;
+ }
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
+ void EnterCombat(Unit * /*who*/)
+ {
- if (id == 1)
- movement_timer = 0;
- }
+ }
- void UpdateAI (const uint32 diff)
- {
- //Random movement
- if (movement_timer <= diff)
+ void MoveInLineOfSight(Unit * /*who*/)
{
- uint32 rndpos = rand()%8;
- me->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]);
- movement_timer = 6000;
- } else movement_timer -= diff;
- //toxic spores
- if (bolt_timer <= diff)
+ }
+
+ void MovementInform(uint32 type, uint32 id)
{
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget)
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (id == 1)
+ movement_timer = 0;
+ }
+
+ void UpdateAI (const uint32 diff)
+ {
+ //Random movement
+ if (movement_timer <= diff)
+ {
+ uint32 rndpos = rand()%8;
+ me->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]);
+ movement_timer = 6000;
+ } else movement_timer -= diff;
+
+ //toxic spores
+ if (bolt_timer <= diff)
{
- Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000);
- if (trig)
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget)
{
- trig->setFaction(14);
- trig->CastSpell(trig, SPELL_TOXIC_SPORES,true);
+ Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000);
+ if (trig)
+ {
+ trig->setFaction(14);
+ trig->CastSpell(trig, SPELL_TOXIC_SPORES,true);
+ }
}
+ bolt_timer = 10000+rand()%5000;
}
- bolt_timer = 10000+rand()%5000;
- }
- else bolt_timer -= diff;
+ else bolt_timer -= diff;
- //Check_Timer
- if (Check_Timer <= diff)
- {
- if (pInstance)
+ //Check_Timer
+ if (Check_Timer <= diff)
{
- //check if vashj is death
- Unit *Vashj = NULL;
- Vashj = Unit::GetUnit((*me), pInstance->GetData64(DATA_LADYVASHJ));
- if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3))
+ if (pInstance)
{
- //remove
- me->setDeathState(DEAD);
- me->RemoveCorpse();
- me->setFaction(35);
+ //check if vashj is death
+ Unit *Vashj = NULL;
+ Vashj = Unit::GetUnit((*me), pInstance->GetData64(DATA_LADYVASHJ));
+ if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashj::boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3))
+ {
+ //remove
+ me->setDeathState(DEAD);
+ me->RemoveCorpse();
+ me->setFaction(35);
+ }
}
- }
- Check_Timer = 1000;
- } else Check_Timer -= diff;
- }
+ Check_Timer = 1000;
+ } else Check_Timer -= diff;
+ }
+ };
+
};
//Coilfang Elite
-//It's an elite Naga mob with 170,000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage
-CreatureAI* GetAI_mob_coilfang_elite(Creature* pCreature)
+//It's an elite Naga mob with 170,000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage class mob_coilfang_elite : public CreatureScript
{
- SimpleAI* ai = new SimpleAI (pCreature);
+public:
+ mob_coilfang_elite() : CreatureScript("mob_coilfang_elite") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ SimpleAI* ai = new SimpleAI (pCreature);
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = 31345; //Cleave
- ai->Spell[0].Cooldown = 15000;
- ai->Spell[0].CooldownRandomAddition = 5000;
- ai->Spell[0].First_Cast = 5000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM;
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = 31345; //Cleave
+ ai->Spell[0].Cooldown = 15000;
+ ai->Spell[0].CooldownRandomAddition = 5000;
+ ai->Spell[0].First_Cast = 5000;
+ ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM;
- ai->EnterEvadeMode();
+ ai->EnterEvadeMode();
- return ai;
-}
+ return ai;
+ }
+
+};
//Coilfang Strider
-//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds , for 5 seconds and increasing their movement speed by 150% during the fear.
-CreatureAI* GetAI_mob_coilfang_strider(Creature* pCreature)
+//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds , for 5 seconds and increasing their movement speed by 150% during the fear. class mob_coilfang_strider : public CreatureScript
{
- SimpleAI* ai = new SimpleAI (pCreature);
+public:
+ mob_coilfang_strider() : CreatureScript("mob_coilfang_strider") { }
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = 41374; //Mind Blast
- ai->Spell[0].Cooldown = 30000;
- ai->Spell[0].CooldownRandomAddition = 10000;
- ai->Spell[0].First_Cast = 8000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ SimpleAI* ai = new SimpleAI (pCreature);
- //Scream aura not implemented
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = 41374; //Mind Blast
+ ai->Spell[0].Cooldown = 30000;
+ ai->Spell[0].CooldownRandomAddition = 10000;
+ ai->Spell[0].First_Cast = 8000;
+ ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
- ai->EnterEvadeMode();
+ //Scream aura not implemented
- return ai;
-}
+ ai->EnterEvadeMode();
+
+ return ai;
+ }
-struct mob_shield_generator_channelAI : public ScriptedAI
+};
+ class mob_shield_generator_channel : public CreatureScript
{
- mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c)
+public:
+ mob_shield_generator_channel() : CreatureScript("mob_shield_generator_channel") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new mob_shield_generator_channelAI (pCreature);
}
- ScriptedInstance *pInstance;
- uint32 Check_Timer;
- bool Casted;
- void Reset()
+ struct mob_shield_generator_channelAI : public ScriptedAI
{
- Check_Timer = 0;
- Casted = false;
- me->SetDisplayId(11686); //invisible
+ mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
+ InstanceScript *pInstance;
+ uint32 Check_Timer;
+ bool Casted;
+ void Reset()
+ {
+ Check_Timer = 0;
+ Casted = false;
+ me->SetDisplayId(11686); //invisible
- void EnterCombat(Unit * /*who*/) {}
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
- void MoveInLineOfSight(Unit * /*who*/) {}
+ void EnterCombat(Unit * /*who*/) {}
- void UpdateAI (const uint32 diff)
- {
- if (!pInstance)
- return;
+ void MoveInLineOfSight(Unit * /*who*/) {}
- if (Check_Timer <= diff)
+ void UpdateAI (const uint32 diff)
{
- Unit *Vashj = NULL;
- Vashj = Unit::GetUnit((*me), pInstance->GetData64(DATA_LADYVASHJ));
+ if (!pInstance)
+ return;
- if (Vashj && Vashj->isAlive())
+ if (Check_Timer <= diff)
{
- //start visual channel
- if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER))
+ Unit *Vashj = NULL;
+ Vashj = Unit::GetUnit((*me), pInstance->GetData64(DATA_LADYVASHJ));
+
+ if (Vashj && Vashj->isAlive())
{
- DoCast(Vashj, SPELL_MAGIC_BARRIER, true);
- Casted = true;
+ //start visual channel
+ if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER))
+ {
+ DoCast(Vashj, SPELL_MAGIC_BARRIER, true);
+ Casted = true;
+ }
}
- }
- Check_Timer = 1000;
- } else Check_Timer -= diff;
- }
-};
+ Check_Timer = 1000;
+ } else Check_Timer -= diff;
+ }
+ };
-bool ItemUse_item_tainted_core(Player* pPlayer, Item* /*_Item*/, SpellCastTargets const& targets)
+};
+ class item_tainted_core : public ItemScript
{
- ScriptedInstance *pInstance = pPlayer->GetInstanceData();
+public:
+ item_tainted_core() : ItemScript("item_tainted_core") { }
- if (!pInstance)
+ bool OnUse(Player* pPlayer, Item* /*_Item*/, SpellCastTargets const& targets)
{
- pPlayer->GetSession()->SendNotification(TEXT_NOT_INITIALIZED);
- return true;
- }
+ InstanceScript *pInstance = pPlayer->GetInstanceScript();
- Creature *Vashj = NULL;
- Vashj = (Unit::GetCreature((*pPlayer), pInstance->GetData64(DATA_LADYVASHJ)));
- if (Vashj && CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase == 2)
- {
- if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT)
+ if (!pInstance)
{
- uint32 identifier;
- uint8 channel_identifier;
- switch(targets.getGOTarget()->GetEntry())
+ pPlayer->GetSession()->SendNotification(TEXT_NOT_INITIALIZED);
+ return true;
+ }
+
+ Creature *Vashj = NULL;
+ Vashj = (Unit::GetCreature((*pPlayer), pInstance->GetData64(DATA_LADYVASHJ)));
+ if (Vashj && (CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->Phase == 2))
+ {
+ if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT)
{
- case 185052:
- identifier = DATA_SHIELDGENERATOR1;
- channel_identifier = 0;
- break;
- case 185053:
- identifier = DATA_SHIELDGENERATOR2;
- channel_identifier = 1;
- break;
- case 185051:
- identifier = DATA_SHIELDGENERATOR3;
- channel_identifier = 2;
- break;
- case 185054:
- identifier = DATA_SHIELDGENERATOR4;
- channel_identifier = 3;
- break;
- default:
+ uint32 identifier;
+ uint8 channel_identifier;
+ switch(targets.getGOTarget()->GetEntry())
+ {
+ case 185052:
+ identifier = DATA_SHIELDGENERATOR1;
+ channel_identifier = 0;
+ break;
+ case 185053:
+ identifier = DATA_SHIELDGENERATOR2;
+ channel_identifier = 1;
+ break;
+ case 185051:
+ identifier = DATA_SHIELDGENERATOR3;
+ channel_identifier = 2;
+ break;
+ case 185054:
+ identifier = DATA_SHIELDGENERATOR4;
+ channel_identifier = 3;
+ break;
+ default:
+ return true;
+ }
+
+ if (pInstance->GetData(identifier))
+ {
+ pPlayer->GetSession()->SendNotification(TEXT_ALREADY_DEACTIVATED);
return true;
- }
+ }
- if (pInstance->GetData(identifier))
- {
- pPlayer->GetSession()->SendNotification(TEXT_ALREADY_DEACTIVATED);
+ //get and remove channel
+ Unit *Channel = NULL;
+ Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]);
+ if (Channel)
+ {
+ //call Unsummon()
+ Channel->setDeathState(JUST_DIED);
+ }
+
+ pInstance->SetData(identifier, 1);
+
+ //remove this item
+ pPlayer->DestroyItemCount(31088, 1, true);
return true;
}
-
- //get and remove channel
- Unit *Channel = NULL;
- Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]);
- if (Channel)
+ else if (targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT)
+ return false;
+ else if (targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER)
{
- //call Unsummon()
- Channel->setDeathState(JUST_DIED);
+ pPlayer->DestroyItemCount(31088, 1, true);
+ pPlayer->CastSpell(targets.getUnitTarget(), 38134, true);
+ return true;
}
-
- pInstance->SetData(identifier, 1);
-
- //remove this item
- pPlayer->DestroyItemCount(31088, 1, true);
- return true;
- }
- else if (targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT)
- return false;
- else if (targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER)
- {
- pPlayer->DestroyItemCount(31088, 1, true);
- pPlayer->CastSpell(targets.getUnitTarget(), 38134, true);
- return true;
}
+ return true;
}
- return true;
-}
-
-CreatureAI* GetAI_boss_lady_vashj(Creature* pCreature)
-{
- return new boss_lady_vashjAI (pCreature);
-}
-
-CreatureAI* GetAI_mob_enchanted_elemental(Creature* pCreature)
-{
- return new mob_enchanted_elementalAI (pCreature);
-}
-
-CreatureAI* GetAI_mob_tainted_elemental(Creature* pCreature)
-{
- return new mob_tainted_elementalAI (pCreature);
-}
-CreatureAI* GetAI_mob_toxic_sporebat(Creature* pCreature)
-{
- return new mob_toxic_sporebatAI (pCreature);
-}
-
-CreatureAI* GetAI_mob_shield_generator_channel(Creature* pCreature)
-{
- return new mob_shield_generator_channelAI (pCreature);
-}
+};
void AddSC_boss_lady_vashj()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_lady_vashj";
- newscript->GetAI = &GetAI_boss_lady_vashj;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_enchanted_elemental";
- newscript->GetAI = &GetAI_mob_enchanted_elemental;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_tainted_elemental";
- newscript->GetAI = &GetAI_mob_tainted_elemental;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_toxic_sporebat";
- newscript->GetAI = &GetAI_mob_toxic_sporebat;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_coilfang_elite";
- newscript->GetAI = &GetAI_mob_coilfang_elite;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_coilfang_strider";
- newscript->GetAI = &GetAI_mob_coilfang_strider;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_shield_generator_channel";
- newscript->GetAI = &GetAI_mob_shield_generator_channel;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "item_tainted_core";
- newscript->pItemUse = &ItemUse_item_tainted_core;
- newscript->RegisterSelf();
+ new boss_lady_vashj();
+ new mob_enchanted_elemental();
+ new mob_tainted_elemental();
+ new mob_toxic_sporebat();
+ new mob_coilfang_elite();
+ new mob_coilfang_strider();
+ new mob_shield_generator_channel();
+ new item_tainted_core();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
index 0392ebaaad8..589127d3140 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
@@ -66,724 +66,733 @@ EndScriptData */
#define SAY_FINAL_FORM -1548018
#define SAY_FREE -1548019
#define SAY_DEATH -1548020
-
-struct mob_inner_demonAI : public ScriptedAI
+ class mob_inner_demon : public CreatureScript
{
- mob_inner_demonAI(Creature *c) : ScriptedAI(c)
- {
- victimGUID = 0;
- }
-
- uint32 ShadowBolt_Timer;
-
- uint32 Link_Timer;
- uint64 victimGUID;
+public:
+ mob_inner_demon() : CreatureScript("mob_inner_demon") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- ShadowBolt_Timer = 10000;
- Link_Timer = 1000;
- }
- void JustDied(Unit * /*victim*/)
- {
- Unit* pUnit = Unit::GetUnit((*me),victimGUID);
- if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER))
- pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER);
+ return new mob_inner_demonAI (pCreature);
}
- void DamageTaken(Unit *done_by, uint32 &damage)
+ struct mob_inner_demonAI : public ScriptedAI
{
- if (done_by->GetGUID() != victimGUID && done_by->GetGUID() != me->GetGUID())
+ mob_inner_demonAI(Creature *c) : ScriptedAI(c)
{
- damage = 0;
- DoModifyThreatPercent(done_by, -100);
+ victimGUID = 0;
}
- }
- void EnterCombat(Unit * /*who*/)
- {
- if (!victimGUID) return;
- }
+ uint32 ShadowBolt_Timer;
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ uint32 Link_Timer;
+ uint64 victimGUID;
- if (me->getVictim()->GetGUID() != victimGUID)
+ void Reset()
{
- DoModifyThreatPercent(me->getVictim(), -100);
- Unit* owner = Unit::GetUnit((*me),victimGUID);
- if (owner && owner->isAlive())
- {
- me->AddThreat(owner,999999);
- AttackStart(owner);
- } else if (owner && owner->isDead())
+ ShadowBolt_Timer = 10000;
+ Link_Timer = 1000;
+ }
+ void JustDied(Unit * /*victim*/)
+ {
+ Unit* pUnit = Unit::GetUnit((*me),victimGUID);
+ if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER))
+ pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if (done_by->GetGUID() != victimGUID && done_by->GetGUID() != me->GetGUID())
{
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- return;
+ damage = 0;
+ DoModifyThreatPercent(done_by, -100);
}
}
- if (Link_Timer <= diff)
+ void EnterCombat(Unit * /*who*/)
{
- DoCast(me->getVictim(), SPELL_SOUL_LINK, true);
- Link_Timer = 1000;
- } else Link_Timer -= diff;
-
- if (!me->HasAura(AURA_DEMONIC_ALIGNMENT))
- DoCast(me, AURA_DEMONIC_ALIGNMENT, true);
+ if (!victimGUID) return;
+ }
- if (ShadowBolt_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me->getVictim(), SPELL_SHADOWBOLT, false);
- ShadowBolt_Timer = 10000;
- } else ShadowBolt_Timer -= diff;
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ if (me->getVictim()->GetGUID() != victimGUID)
+ {
+ DoModifyThreatPercent(me->getVictim(), -100);
+ Unit* owner = Unit::GetUnit((*me),victimGUID);
+ if (owner && owner->isAlive())
+ {
+ me->AddThreat(owner,999999);
+ AttackStart(owner);
+ } else if (owner && owner->isDead())
+ {
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ return;
+ }
+ }
+
+ if (Link_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SOUL_LINK, true);
+ Link_Timer = 1000;
+ } else Link_Timer -= diff;
+
+ if (!me->HasAura(AURA_DEMONIC_ALIGNMENT))
+ DoCast(me, AURA_DEMONIC_ALIGNMENT, true);
+
+ if (ShadowBolt_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SHADOWBOLT, false);
+ ShadowBolt_Timer = 10000;
+ } else ShadowBolt_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-//Original Leotheras the Blind AI
-struct boss_leotheras_the_blindAI : public ScriptedAI
-{
- boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c)
- {
- c->GetPosition(x,y,z);
- pInstance = c->GetInstanceData();
- Demon = 0;
- for (uint8 i = 0; i < 3; ++i)//clear guids
- SpellBinderGUID[i] = 0;
- }
+//Original Leotheras the Blind AI class boss_leotheras_the_blind : public CreatureScript
+{
+public:
+ boss_leotheras_the_blind() : CreatureScript("boss_leotheras_the_blind") { }
- ScriptedInstance *pInstance;
-
- uint32 Whirlwind_Timer;
- uint32 ChaosBlast_Timer;
- uint32 SwitchToDemon_Timer;
- uint32 SwitchToHuman_Timer;
- uint32 Berserk_Timer;
- uint32 InnerDemons_Timer;
- uint32 BanishTimer;
-
- bool DealDamage;
- bool NeedThreatReset;
- bool DemonForm;
- bool IsFinalForm;
- bool EnrageUsed;
- float x,y,z;
-
- uint64 InnderDemon[5];
- uint32 InnerDemon_Count;
- uint64 Demon;
- uint64 SpellBinderGUID[3];
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- CheckChannelers();
- BanishTimer = 1000;
- Whirlwind_Timer = 15000;
- ChaosBlast_Timer = 1000;
- SwitchToDemon_Timer = 45000;
- SwitchToHuman_Timer = 60000;
- Berserk_Timer = 600000;
- InnerDemons_Timer = 30000;
- me->SetCanDualWield(true);
- DealDamage = true;
- DemonForm = false;
- IsFinalForm = false;
- NeedThreatReset = false;
- EnrageUsed = false;
- InnerDemon_Count = 0;
- me->SetSpeed(MOVE_RUN, 2.0f, true);
- me->SetDisplayId(MODEL_NIGHTELF);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
- DoCast(me, SPELL_DUAL_WIELD, true);
- me->SetCorpseDelay(1000*60*60);
- if (pInstance)
- pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED);
+ return new boss_leotheras_the_blindAI (pCreature);
}
- void CheckChannelers(/*bool DoEvade = true*/)
+ struct boss_leotheras_the_blindAI : public ScriptedAI
{
- for (uint8 i = 0; i < 3; ++i)
+ boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c)
{
- if (Creature *add = Unit::GetCreature(*me,SpellBinderGUID[i]))
- add->DisappearAndDie();
-
- float nx = x;
- float ny = y;
- float o = 2.4f;
- if (i == 0) {nx += 10; ny -= 5; o=2.5f;}
- if (i == 1) {nx -= 8; ny -= 7; o=0.9f;}
- if (i == 2) {nx -= 3; ny += 9; o=5.0f;}
- Creature* binder = me->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0);
- if (binder)
- SpellBinderGUID[i] = binder->GetGUID();
+ c->GetPosition(x,y,z);
+ pInstance = c->GetInstanceScript();
+ Demon = 0;
+ for (uint8 i = 0; i < 3; ++i)//clear guids
+ SpellBinderGUID[i] = 0;
}
- }
- void MoveInLineOfSight(Unit *who)
- {
- if (me->HasAura(AURA_BANISH))
- return;
- if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
+ InstanceScript *pInstance;
+
+ uint32 Whirlwind_Timer;
+ uint32 ChaosBlast_Timer;
+ uint32 SwitchToDemon_Timer;
+ uint32 SwitchToHuman_Timer;
+ uint32 Berserk_Timer;
+ uint32 InnerDemons_Timer;
+ uint32 BanishTimer;
+
+ bool DealDamage;
+ bool NeedThreatReset;
+ bool DemonForm;
+ bool IsFinalForm;
+ bool EnrageUsed;
+ float x,y,z;
+
+ uint64 InnderDemon[5];
+ uint32 InnerDemon_Count;
+ uint64 Demon;
+ uint64 SpellBinderGUID[3];
+
+ void Reset()
+ {
+ CheckChannelers();
+ BanishTimer = 1000;
+ Whirlwind_Timer = 15000;
+ ChaosBlast_Timer = 1000;
+ SwitchToDemon_Timer = 45000;
+ SwitchToHuman_Timer = 60000;
+ Berserk_Timer = 600000;
+ InnerDemons_Timer = 30000;
+ me->SetCanDualWield(true);
+ DealDamage = true;
+ DemonForm = false;
+ IsFinalForm = false;
+ NeedThreatReset = false;
+ EnrageUsed = false;
+ InnerDemon_Count = 0;
+ me->SetSpeed(MOVE_RUN, 2.0f, true);
+ me->SetDisplayId(MODEL_NIGHTELF);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ DoCast(me, SPELL_DUAL_WIELD, true);
+ me->SetCorpseDelay(1000*60*60);
+ if (pInstance)
+ pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED);
+ }
+
+ void CheckChannelers(/*bool DoEvade = true*/)
+ {
+ for (uint8 i = 0; i < 3; ++i)
+ {
+ if (Creature *add = Unit::GetCreature(*me,SpellBinderGUID[i]))
+ add->DisappearAndDie();
+
+ float nx = x;
+ float ny = y;
+ float o = 2.4f;
+ if (i == 0) {nx += 10; ny -= 5; o=2.5f;}
+ if (i == 1) {nx -= 8; ny -= 7; o=0.9f;}
+ if (i == 2) {nx -= 3; ny += 9; o=5.0f;}
+ Creature* binder = me->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0);
+ if (binder)
+ SpellBinderGUID[i] = binder->GetGUID();
+
+ }
+ }
+ void MoveInLineOfSight(Unit *who)
{
- if (me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ if (me->HasAura(AURA_BANISH))
return;
- float attackRadius = me->GetAttackDistance(who);
- if (me->IsWithinDistInMap(who, attackRadius))
+ if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
{
- // Check first that object is in an angle in front of this one before LoS check
- if (me->HasInArc(M_PI/2.0f, who) && me->IsWithinLOSInMap(who))
+ if (me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius))
{
- AttackStart(who);
+ // Check first that object is in an angle in front of this one before LoS check
+ if (me->HasInArc(M_PI/2.0f, who) && me->IsWithinLOSInMap(who))
+ {
+ AttackStart(who);
+ }
}
}
}
- }
-
- void StartEvent()
- {
- DoScriptText(SAY_AGGRO, me);
- if (pInstance)
- pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS);
- }
- void CheckBanish()
- {
- uint8 AliveChannelers = 0;
- for (uint8 i = 0; i < 3; ++i)
+ void StartEvent()
{
- Unit *add = Unit::GetUnit(*me,SpellBinderGUID[i]);
- if (add && add->isAlive())
- ++AliveChannelers;
+ DoScriptText(SAY_AGGRO, me);
+ if (pInstance)
+ pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS);
}
- // channelers == 0 remove banish aura
- if (AliveChannelers == 0 && me->HasAura(AURA_BANISH))
+ void CheckBanish()
{
- // removing banish aura
- me->RemoveAurasDueToSpell(AURA_BANISH);
+ uint8 AliveChannelers = 0;
+ for (uint8 i = 0; i < 3; ++i)
+ {
+ Unit *add = Unit::GetUnit(*me,SpellBinderGUID[i]);
+ if (add && add->isAlive())
+ ++AliveChannelers;
+ }
- // Leotheras is getting immune again
- me->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true);
+ // channelers == 0 remove banish aura
+ if (AliveChannelers == 0 && me->HasAura(AURA_BANISH))
+ {
+ // removing banish aura
+ me->RemoveAurasDueToSpell(AURA_BANISH);
- // changing model to bloodelf
- me->SetDisplayId(MODEL_NIGHTELF);
+ // Leotheras is getting immune again
+ me->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true);
- // and reseting equipment
- me->LoadEquipment(me->GetEquipmentId());
+ // changing model to bloodelf
+ me->SetDisplayId(MODEL_NIGHTELF);
- if (pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
- {
- Unit *victim = NULL;
- victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
- if (victim)
- me->getThreatManager().addThreat(victim, 1);
- StartEvent();
+ // and reseting equipment
+ me->LoadEquipment(me->GetEquipmentId());
+
+ if (pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
+ {
+ Unit *victim = NULL;
+ victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
+ if (victim)
+ me->getThreatManager().addThreat(victim, 1);
+ StartEvent();
+ }
}
- }
- else if (AliveChannelers != 0 && !me->HasAura(AURA_BANISH))
- {
- // channelers != 0 apply banish aura
- // removing Leotheras banish immune to apply AURA_BANISH
- me->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false);
- DoCast(me, AURA_BANISH);
+ else if (AliveChannelers != 0 && !me->HasAura(AURA_BANISH))
+ {
+ // channelers != 0 apply banish aura
+ // removing Leotheras banish immune to apply AURA_BANISH
+ me->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false);
+ DoCast(me, AURA_BANISH);
- // changing model
- me->SetDisplayId(MODEL_DEMON);
+ // changing model
+ me->SetDisplayId(MODEL_DEMON);
- // and removing weapons
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ // and removing weapons
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ }
}
- }
- //Despawn all Inner Demon summoned
- void DespawnDemon()
- {
- for (uint8 i=0; i<5; ++i)
+ //Despawn all Inner Demon summoned
+ void DespawnDemon()
{
- if (InnderDemon[i])
+ for (uint8 i=0; i<5; ++i)
{
- //delete creature
- Creature* pCreature = Unit::GetCreature((*me), InnderDemon[i]);
- if (pCreature && pCreature->isAlive())
- {
- pCreature->ForcedDespawn();
- }
- InnderDemon[i] = 0;
+ if (InnderDemon[i])
+ {
+ //delete creature
+ Creature* pCreature = Unit::GetCreature((*me), InnderDemon[i]);
+ if (pCreature && pCreature->isAlive())
+ {
+ pCreature->ForcedDespawn();
+ }
+ InnderDemon[i] = 0;
+ }
}
- }
- InnerDemon_Count = 0;
- }
+ InnerDemon_Count = 0;
+ }
- void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core
- {
- for (uint8 i=0; i<5; ++i)
+ void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core
{
- if (InnderDemon[i] > 0)
+ for (uint8 i=0; i<5; ++i)
{
- Creature* pUnit = Unit::GetCreature((*me), InnderDemon[i]);
- if (pUnit && pUnit->isAlive())
+ if (InnderDemon[i] > 0)
{
- Unit* pUnit_pTarget = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demonAI, pUnit->AI())->victimGUID);
- if (pUnit_pTarget && pUnit_pTarget->isAlive())
+ Creature* pUnit = Unit::GetCreature((*me), InnderDemon[i]);
+ if (pUnit && pUnit->isAlive())
{
- pUnit->CastSpell(pUnit_pTarget, SPELL_CONSUMING_MADNESS, true);
- DoModifyThreatPercent(pUnit_pTarget, -100);
+ Unit* pUnit_pTarget = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demon::mob_inner_demonAI, pUnit->AI())->victimGUID);
+ if (pUnit_pTarget && pUnit_pTarget->isAlive())
+ {
+ pUnit->CastSpell(pUnit_pTarget, SPELL_CONSUMING_MADNESS, true);
+ DoModifyThreatPercent(pUnit_pTarget, -100);
+ }
}
}
}
}
- }
- void KilledUnit(Unit * victim)
- {
- if (victim->GetTypeId() != TYPEID_PLAYER)
- return;
-
- if (DemonForm)
+ void KilledUnit(Unit * victim)
{
- DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), me);
- }
- else
- {
- DoScriptText(RAND(SAY_NIGHTELF_SLAY1,SAY_NIGHTELF_SLAY2,SAY_NIGHTELF_SLAY3), me);
- }
- }
-
- void JustDied(Unit * /*victim*/)
- {
- DoScriptText(SAY_DEATH, me);
+ if (victim->GetTypeId() != TYPEID_PLAYER)
+ return;
- //despawn copy
- if (Demon)
- {
- if (Creature* pDemon = Unit::GetCreature(*me, Demon))
- pDemon->ForcedDespawn();
+ if (DemonForm)
+ {
+ DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), me);
+ }
+ else
+ {
+ DoScriptText(RAND(SAY_NIGHTELF_SLAY1,SAY_NIGHTELF_SLAY2,SAY_NIGHTELF_SLAY3), me);
+ }
}
- if (pInstance)
- pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE);
- }
- void EnterCombat(Unit * /*who*/)
- {
- if (me->HasAura(AURA_BANISH))
- return;
-
- me->LoadEquipment(me->GetEquipmentId());
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (me->HasAura(AURA_BANISH) || !UpdateVictim())
+ void JustDied(Unit * /*victim*/)
{
- if (BanishTimer <= diff)
+ DoScriptText(SAY_DEATH, me);
+
+ //despawn copy
+ if (Demon)
{
- CheckBanish();//no need to check every update tick
- BanishTimer = 1000;
- } else BanishTimer -= diff;
- return;
+ if (Creature* pDemon = Unit::GetCreature(*me, Demon))
+ pDemon->ForcedDespawn();
+ }
+ if (pInstance)
+ pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE);
}
- if (me->HasAura(SPELL_WHIRLWIND))
- if (Whirlwind_Timer <= diff)
- {
- Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (newTarget)
- {
- DoResetThreat();
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ());
- }
- Whirlwind_Timer = 2000;
- } else Whirlwind_Timer -= diff;
- // reseting after changing forms and after ending whirlwind
- if (NeedThreatReset && !me->HasAura(SPELL_WHIRLWIND))
+ void EnterCombat(Unit * /*who*/)
{
- // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding)
- if (DemonForm)
- InnerDemons_Timer = 30000;
- else
- Whirlwind_Timer = 15000;
+ if (me->HasAura(AURA_BANISH))
+ return;
- NeedThreatReset = false;
- DoResetThreat();
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MoveChase(me->getVictim());
+ me->LoadEquipment(me->GetEquipmentId());
}
- //Enrage_Timer (10 min)
- if (Berserk_Timer < diff && !EnrageUsed)
- {
- me->InterruptNonMeleeSpells(false);
- DoCast(me, SPELL_BERSERK);
- EnrageUsed = true;
- } else Berserk_Timer -= diff;
-
- if (!DemonForm)
+ void UpdateAI(const uint32 diff)
{
- //Whirldind Timer
- if (!me->HasAura(SPELL_WHIRLWIND))
+ //Return since we have no target
+ if (me->HasAura(AURA_BANISH) || !UpdateVictim())
{
+ if (BanishTimer <= diff)
+ {
+ CheckBanish();//no need to check every update tick
+ BanishTimer = 1000;
+ } else BanishTimer -= diff;
+ return;
+ }
+ if (me->HasAura(SPELL_WHIRLWIND))
if (Whirlwind_Timer <= diff)
{
- DoCast(me, SPELL_WHIRLWIND);
- // while whirlwinding this variable is used to countdown target's change
+ Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (newTarget)
+ {
+ DoResetThreat();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ());
+ }
Whirlwind_Timer = 2000;
- NeedThreatReset = true;
} else Whirlwind_Timer -= diff;
+
+ // reseting after changing forms and after ending whirlwind
+ if (NeedThreatReset && !me->HasAura(SPELL_WHIRLWIND))
+ {
+ // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding)
+ if (DemonForm)
+ InnerDemons_Timer = 30000;
+ else
+ Whirlwind_Timer = 15000;
+
+ NeedThreatReset = false;
+ DoResetThreat();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveChase(me->getVictim());
}
- //Switch_Timer
- if (!IsFinalForm)
- if (SwitchToDemon_Timer <= diff)
- {
- //switch to demon form
- me->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0);
- me->SetDisplayId(MODEL_DEMON);
- DoScriptText(SAY_SWITCH_TO_DEMON, me);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
- DemonForm = true;
- NeedThreatReset = true;
- SwitchToDemon_Timer = 45000;
- } else SwitchToDemon_Timer -= diff;
- DoMeleeAttackIfReady();
- }
- else
- {
- //ChaosBlast_Timer
- if (!me->getVictim())
- return;
- if (me->IsWithinDist(me->getVictim(), 30))
- me->StopMoving();
- if (ChaosBlast_Timer <= diff)
+ //Enrage_Timer (10 min)
+ if (Berserk_Timer < diff && !EnrageUsed)
{
- // will cast only when in range of spell
- if (me->IsWithinDist(me->getVictim(), 30))
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_BERSERK);
+ EnrageUsed = true;
+ } else Berserk_Timer -= diff;
+
+ if (!DemonForm)
+ {
+ //Whirldind Timer
+ if (!me->HasAura(SPELL_WHIRLWIND))
{
- //DoCast(me->getVictim(), SPELL_CHAOS_BLAST, true);
- int damage = 100;
- me->CastCustomSpell(me->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID());
+ if (Whirlwind_Timer <= diff)
+ {
+ DoCast(me, SPELL_WHIRLWIND);
+ // while whirlwinding this variable is used to countdown target's change
+ Whirlwind_Timer = 2000;
+ NeedThreatReset = true;
+ } else Whirlwind_Timer -= diff;
}
- ChaosBlast_Timer = 3000;
- } else ChaosBlast_Timer -= diff;
- //Summon Inner Demon
- if (InnerDemons_Timer <= diff)
+ //Switch_Timer
+
+ if (!IsFinalForm)
+ if (SwitchToDemon_Timer <= diff)
+ {
+ //switch to demon form
+ me->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0);
+ me->SetDisplayId(MODEL_DEMON);
+ DoScriptText(SAY_SWITCH_TO_DEMON, me);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ DemonForm = true;
+ NeedThreatReset = true;
+ SwitchToDemon_Timer = 45000;
+ } else SwitchToDemon_Timer -= diff;
+ DoMeleeAttackIfReady();
+ }
+ else
{
- std::list<HostileReference *>& ThreatList = me->getThreatManager().getThreatList();
- std::vector<Unit *> TargetList;
- for (std::list<HostileReference *>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
+ //ChaosBlast_Timer
+ if (!me->getVictim())
+ return;
+ if (me->IsWithinDist(me->getVictim(), 30))
+ me->StopMoving();
+ if (ChaosBlast_Timer <= diff)
{
- Unit *tempTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
- if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->getVictim()->GetGUID() && TargetList.size()<5)
- TargetList.push_back(tempTarget);
- }
- //SpellEntry *spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER);
- for (std::vector<Unit *>::const_iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr)
+ // will cast only when in range of spell
+ if (me->IsWithinDist(me->getVictim(), 30))
+ {
+ //DoCast(me->getVictim(), SPELL_CHAOS_BLAST, true);
+ int damage = 100;
+ me->CastCustomSpell(me->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID());
+ }
+ ChaosBlast_Timer = 3000;
+ } else ChaosBlast_Timer -= diff;
+ //Summon Inner Demon
+ if (InnerDemons_Timer <= diff)
{
- if ((*itr) && (*itr)->isAlive())
+ std::list<HostileReference *>& ThreatList = me->getThreatManager().getThreatList();
+ std::vector<Unit *> TargetList;
+ for (std::list<HostileReference *>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
{
- Creature * demon = me->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if (demon)
+ Unit *tempTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
+ if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->getVictim()->GetGUID() && TargetList.size()<5)
+ TargetList.push_back(tempTarget);
+ }
+ //SpellEntry *spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER);
+ for (std::vector<Unit *>::const_iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr)
+ {
+ if ((*itr) && (*itr)->isAlive())
{
- demon->AI()->AttackStart((*itr));
- CAST_AI(mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID();
+ Creature * demon = me->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ if (demon)
+ {
+ demon->AI()->AttackStart((*itr));
+ CAST_AI(mob_inner_demon::mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID();
- (*itr)->AddAura(SPELL_INSIDIOUS_WHISPER, *itr);
+ (*itr)->AddAura(SPELL_INSIDIOUS_WHISPER, *itr);
- if (InnerDemon_Count > 4)
- InnerDemon_Count = 0;
+ if (InnerDemon_Count > 4)
+ InnerDemon_Count = 0;
- //Safe storing of creatures
- InnderDemon[InnerDemon_Count] = demon->GetGUID();
+ //Safe storing of creatures
+ InnderDemon[InnerDemon_Count] = demon->GetGUID();
- //Update demon count
- ++InnerDemon_Count;
+ //Update demon count
+ ++InnerDemon_Count;
+ }
}
}
- }
- DoScriptText(SAY_INNER_DEMONS, me);
+ DoScriptText(SAY_INNER_DEMONS, me);
- InnerDemons_Timer = 999999;
- } else InnerDemons_Timer -= diff;
+ InnerDemons_Timer = 999999;
+ } else InnerDemons_Timer -= diff;
- //Switch_Timer
- if (SwitchToHuman_Timer <= diff)
- {
- //switch to nightelf form
- me->SetDisplayId(MODEL_NIGHTELF);
- me->LoadEquipment(me->GetEquipmentId());
+ //Switch_Timer
+ if (SwitchToHuman_Timer <= diff)
+ {
+ //switch to nightelf form
+ me->SetDisplayId(MODEL_NIGHTELF);
+ me->LoadEquipment(me->GetEquipmentId());
+
+ CastConsumingMadness();
+ DespawnDemon();
+
+ DemonForm = false;
+ NeedThreatReset = true;
+ SwitchToHuman_Timer = 60000;
+ } else SwitchToHuman_Timer -= diff;
+ }
+
+ if (!IsFinalForm && (me->GetHealth()*100 / me->GetMaxHealth()) < 15)
+ {
+ //at this point he divides himself in two parts
CastConsumingMadness();
DespawnDemon();
-
+ Creature *Copy = NULL;
+ Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000);
+ if (Copy)
+ {
+ Demon = Copy->GetGUID();
+ if (me->getVictim())
+ Copy->AI()->AttackStart(me->getVictim());
+ }
+ //set nightelf final form
+ IsFinalForm = true;
DemonForm = false;
- NeedThreatReset = true;
- SwitchToHuman_Timer = 60000;
- } else SwitchToHuman_Timer -= diff;
- }
-
- if (!IsFinalForm && (me->GetHealth()*100 / me->GetMaxHealth()) < 15)
- {
- //at this point he divides himself in two parts
- CastConsumingMadness();
- DespawnDemon();
- Creature *Copy = NULL;
- Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000);
- if (Copy)
- {
- Demon = Copy->GetGUID();
- if (me->getVictim())
- Copy->AI()->AttackStart(me->getVictim());
+ DoScriptText(SAY_FINAL_FORM, me);
+ me->SetDisplayId(MODEL_NIGHTELF);
+ me->LoadEquipment(me->GetEquipmentId());
}
- //set nightelf final form
- IsFinalForm = true;
- DemonForm = false;
-
- DoScriptText(SAY_FINAL_FORM, me);
- me->SetDisplayId(MODEL_NIGHTELF);
- me->LoadEquipment(me->GetEquipmentId());
}
- }
+ };
+
};
-//Leotheras the Blind Demon Form AI
-struct boss_leotheras_the_blind_demonformAI : public ScriptedAI
+//Leotheras the Blind Demon Form AI class boss_leotheras_the_blind_demonform : public CreatureScript
{
- boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c) {}
+public:
+ boss_leotheras_the_blind_demonform() : CreatureScript("boss_leotheras_the_blind_demonform") { }
- uint32 ChaosBlast_Timer;
- bool DealDamage;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- ChaosBlast_Timer = 1000;
- DealDamage = true;
+ return new boss_leotheras_the_blind_demonformAI (pCreature);
}
- void StartEvent()
+ struct boss_leotheras_the_blind_demonformAI : public ScriptedAI
{
- DoScriptText(SAY_FREE, me);
- }
+ boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c) {}
- void KilledUnit(Unit * victim)
- {
- if (victim->GetTypeId() != TYPEID_PLAYER)
- return;
+ uint32 ChaosBlast_Timer;
+ bool DealDamage;
- DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), me);
- }
+ void Reset()
+ {
+ ChaosBlast_Timer = 1000;
+ DealDamage = true;
+ }
- void JustDied(Unit * /*victim*/)
- {
- //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears)
- DoCast(me, 8149, true);
- }
+ void StartEvent()
+ {
+ DoScriptText(SAY_FREE, me);
+ }
- void EnterCombat(Unit * /*who*/)
- {
- StartEvent();
- }
+ void KilledUnit(Unit * victim)
+ {
+ if (victim->GetTypeId() != TYPEID_PLAYER)
+ return;
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
- //ChaosBlast_Timer
- if (me->IsWithinDist(me->getVictim(), 30))
- me->StopMoving();
+ DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), me);
+ }
- if (ChaosBlast_Timer <= diff)
- {
- // will cast only when in range od spell
- if (me->IsWithinDist(me->getVictim(), 30))
- {
- //DoCast(me->getVictim(), SPELL_CHAOS_BLAST, true);
- int damage = 100;
- me->CastCustomSpell(me->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID());
- ChaosBlast_Timer = 3000;
- }
- } else ChaosBlast_Timer -= diff;
+ void JustDied(Unit * /*victim*/)
+ {
+ //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears)
+ DoCast(me, 8149, true);
+ }
- //Do NOT deal any melee damage to the target.
- }
-};
-struct mob_greyheart_spellbinderAI : public ScriptedAI
-{
- mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- leotherasGUID = 0;
- AddedBanish = false;
- }
+ void EnterCombat(Unit * /*who*/)
+ {
+ StartEvent();
+ }
- ScriptedInstance *pInstance;
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+ //ChaosBlast_Timer
+ if (me->IsWithinDist(me->getVictim(), 30))
+ me->StopMoving();
- uint64 leotherasGUID;
+ if (ChaosBlast_Timer <= diff)
+ {
+ // will cast only when in range od spell
+ if (me->IsWithinDist(me->getVictim(), 30))
+ {
+ //DoCast(me->getVictim(), SPELL_CHAOS_BLAST, true);
+ int damage = 100;
+ me->CastCustomSpell(me->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID());
+ ChaosBlast_Timer = 3000;
+ }
+ } else ChaosBlast_Timer -= diff;
- uint32 Mindblast_Timer;
- uint32 Earthshock_Timer;
+ //Do NOT deal any melee damage to the target.
+ }
+ }; class mob_greyheart_spellbinder : public CreatureScript
- bool AddedBanish;
+};
+{
+public:
+ mob_greyheart_spellbinder() : CreatureScript("mob_greyheart_spellbinder") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Mindblast_Timer = 3000 + rand()%5000;
- Earthshock_Timer = 5000 + rand()%5000;
+ return new mob_greyheart_spellbinderAI (pCreature);
+ }
- if (pInstance)
+ struct mob_greyheart_spellbinderAI : public ScriptedAI
+ {
+ mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c)
{
- pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0);
- Creature *leotheras = Unit::GetCreature(*me, leotherasGUID);
- if (leotheras && leotheras->isAlive())
- CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(/*false*/);
+ pInstance = c->GetInstanceScript();
+ leotherasGUID = 0;
+ AddedBanish = false;
}
- }
- void EnterCombat(Unit * who)
- {
- me->InterruptNonMeleeSpells(false);
- if (pInstance)
- pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID());
- }
+ InstanceScript *pInstance;
- void JustRespawned()
- {
- AddedBanish = false;
- Reset();
- }
+ uint64 leotherasGUID;
- void CastChanneling()
- {
- if (!me->isInCombat() && !me->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
+ uint32 Mindblast_Timer;
+ uint32 Earthshock_Timer;
+
+ bool AddedBanish;
+
+ void Reset()
{
- if (leotherasGUID)
+ Mindblast_Timer = 3000 + rand()%5000;
+ Earthshock_Timer = 5000 + rand()%5000;
+
+ if (pInstance)
{
+ pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0);
Creature *leotheras = Unit::GetCreature(*me, leotherasGUID);
if (leotheras && leotheras->isAlive())
- DoCast(leotheras, BANISH_BEAM);
+ CAST_AI(boss_leotheras_the_blind::boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(/*false*/);
}
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (pInstance)
+ void EnterCombat(Unit * who)
{
- if (!leotherasGUID)
- leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS);
-
- if (!me->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
- {
- Unit *victim = NULL;
- victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
- if (victim)
- AttackStart(victim);
- }
+ me->InterruptNonMeleeSpells(false);
+ if (pInstance)
+ pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID());
}
- if (!UpdateVictim())
+ void JustRespawned()
{
- CastChanneling();
- return;
+ AddedBanish = false;
+ Reset();
}
- if (pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
+ void CastChanneling()
{
- EnterEvadeMode();
- return;
+ if (!me->isInCombat() && !me->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
+ {
+ if (leotherasGUID)
+ {
+ Creature *leotheras = Unit::GetCreature(*me, leotherasGUID);
+ if (leotheras && leotheras->isAlive())
+ DoCast(leotheras, BANISH_BEAM);
+ }
+ }
}
- if (Mindblast_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (pInstance)
+ {
+ if (!leotherasGUID)
+ leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS);
- if (pTarget)DoCast(pTarget, SPELL_MINDBLAST);
+ if (!me->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
+ {
+ Unit *victim = NULL;
+ victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
+ if (victim)
+ AttackStart(victim);
+ }
+ }
- Mindblast_Timer = 10000 + rand()%5000;
- } else Mindblast_Timer -= diff;
+ if (!UpdateVictim())
+ {
+ CastChanneling();
+ return;
+ }
- if (Earthshock_Timer <= diff)
- {
- Map* pMap = me->GetMap();
- Map::PlayerList const &PlayerList = pMap->GetPlayers();
- for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
+ if (pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
{
- if (Player* i_pl = itr->getSource())
- {
- bool isCasting = false;
- for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i)
- if (i_pl->GetCurrentSpell(i))
- isCasting = true;
+ EnterEvadeMode();
+ return;
+ }
+
+ if (Mindblast_Timer <= diff)
+ {
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (isCasting)
+ if (pTarget)DoCast(pTarget, SPELL_MINDBLAST);
+
+ Mindblast_Timer = 10000 + rand()%5000;
+ } else Mindblast_Timer -= diff;
+
+ if (Earthshock_Timer <= diff)
+ {
+ Map* pMap = me->GetMap();
+ Map::PlayerList const &PlayerList = pMap->GetPlayers();
+ for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
+ {
+ if (Player* i_pl = itr->getSource())
{
- DoCast(i_pl, SPELL_EARTHSHOCK);
- break;
+ bool isCasting = false;
+ for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i)
+ if (i_pl->GetCurrentSpell(i))
+ isCasting = true;
+
+ if (isCasting)
+ {
+ DoCast(i_pl, SPELL_EARTHSHOCK);
+ break;
+ }
}
}
- }
- Earthshock_Timer = 8000 + rand()%7000;
- } else Earthshock_Timer -= diff;
- DoMeleeAttackIfReady();
- }
-
- void JustDied(Unit * /*killer*/) {}
-};
-CreatureAI* GetAI_boss_leotheras_the_blind(Creature* pCreature)
-{
- return new boss_leotheras_the_blindAI (pCreature);
-}
+ Earthshock_Timer = 8000 + rand()%7000;
+ } else Earthshock_Timer -= diff;
+ DoMeleeAttackIfReady();
+ }
-CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature* pCreature)
-{
- return new boss_leotheras_the_blind_demonformAI (pCreature);
-}
+ void JustDied(Unit * /*killer*/) {}
+ };
-CreatureAI* GetAI_mob_greyheart_spellbinder(Creature* pCreature)
-{
- return new mob_greyheart_spellbinderAI (pCreature);
-}
+};
-CreatureAI* GetAI_mob_inner_demon(Creature* pCreature)
-{
- return new mob_inner_demonAI (pCreature);
-}
void AddSC_boss_leotheras_the_blind()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "boss_leotheras_the_blind";
- newscript->GetAI = &GetAI_boss_leotheras_the_blind;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_leotheras_the_blind_demonform";
- newscript->GetAI = &GetAI_boss_leotheras_the_blind_demonform;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_greyheart_spellbinder";
- newscript->GetAI = &GetAI_mob_greyheart_spellbinder;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_inner_demon";
- newscript->GetAI = &GetAI_mob_inner_demon;
- newscript->RegisterSelf();
+ new boss_leotheras_the_blind();
+ new boss_leotheras_the_blind_demonform();
+ new mob_greyheart_spellbinder();
+ new mob_inner_demon();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
index 7bfd50407a6..1fdea194e71 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
@@ -65,396 +65,399 @@ float AddPos[9][3] =
{14.388216, -423.468018, -19.625271}, //MOVE_GUARDIAN_2 X, Y, Z
{42.471519, -445.115295, -19.769423} //MOVE_GUARDIAN_3 X, Y, Z
};
-
-struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
+ class boss_the_lurker_below : public CreatureScript
{
- boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me)
- {
- pInstance = c->GetInstanceData();
- SpellEntry *TempSpell = GET_SPELL(SPELL_SPOUT_ANIM);
- if (TempSpell)
- {
- TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed
- TempSpell->Effect[1] = 0;
- TempSpell->Effect[2] = 0;
- }
- }
+public:
+ boss_the_lurker_below() : CreatureScript("boss_the_lurker_below") { }
- ScriptedInstance* pInstance;
- SummonList Summons;
-
- bool Spawned;
- bool Submerged;
- bool InRange;
- bool CanStartEvent;
- uint32 RotTimer;
- uint32 SpoutAnimTimer;
- uint32 WaterboltTimer;
- uint32 SpoutTimer;
- uint32 WhirlTimer;
- uint32 PhaseTimer;
- uint32 GeyserTimer;
- uint32 CheckTimer;
- uint32 WaitTimer;
- uint32 WaitTimer2;
-
- bool CheckCanStart()//check if players fished
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (pInstance && pInstance->GetData(DATA_STRANGE_POOL) == NOT_STARTED)
- return false;
- return true;
+ return new boss_the_lurker_belowAI (pCreature);
}
- void Reset()
+
+ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
{
- me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
- SpoutAnimTimer = 1000;
- RotTimer = 0;
- WaterboltTimer = 15000;//give time to get in range when fight starts
- SpoutTimer = 45000;
- WhirlTimer = 18000;//after avery spout
- PhaseTimer = 120000;
- GeyserTimer = rand()%5000 + 15000;
- CheckTimer = 15000;//give time to get in range when fight starts
- WaitTimer = 60000;//never reached
- WaitTimer2 = 60000;//never reached
-
- Submerged = true;//will be false at combat start
- Spawned = false;
- InRange = false;
- CanStartEvent = false;
-
- Summons.DespawnAll();
-
- if (pInstance)
+ boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me)
{
- pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED);
- pInstance->SetData(DATA_STRANGE_POOL, NOT_STARTED);
+ pInstance = c->GetInstanceScript();
+ SpellEntry *TempSpell = GET_SPELL(SPELL_SPOUT_ANIM);
+ if (TempSpell)
+ {
+ TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed
+ TempSpell->Effect[1] = 0;
+ TempSpell->Effect[2] = 0;
+ }
}
- DoCast(me, SPELL_SUBMERGE);//submerge anim
- me->SetVisibility(VISIBILITY_OFF);//we start invis under water, submerged
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- }
-
- void JustDied(Unit* /*Killer*/)
- {
- if (pInstance)
- pInstance->SetData(DATA_THELURKERBELOWEVENT, DONE);
-
- Summons.DespawnAll();
- }
-
- void EnterCombat(Unit * who)
- {
- if (pInstance)
- pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS);
- Scripted_NoMovementAI::EnterCombat(who);
- }
- void MoveInLineOfSight(Unit *who)
- {
- if (!CanStartEvent)//boss is invisible, don't attack
- return;
- if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)))
+ InstanceScript* pInstance;
+ SummonList Summons;
+
+ bool Spawned;
+ bool Submerged;
+ bool InRange;
+ bool CanStartEvent;
+ uint32 RotTimer;
+ uint32 SpoutAnimTimer;
+ uint32 WaterboltTimer;
+ uint32 SpoutTimer;
+ uint32 WhirlTimer;
+ uint32 PhaseTimer;
+ uint32 GeyserTimer;
+ uint32 CheckTimer;
+ uint32 WaitTimer;
+ uint32 WaitTimer2;
+
+ bool CheckCanStart()//check if players fished
+ {
+ if (pInstance && pInstance->GetData(DATA_STRANGE_POOL) == NOT_STARTED)
+ return false;
+ return true;
+ }
+ void Reset()
{
- float attackRadius = me->GetAttackDistance(who);
- if (me->IsWithinDistInMap(who, attackRadius))
+ me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
+ SpoutAnimTimer = 1000;
+ RotTimer = 0;
+ WaterboltTimer = 15000;//give time to get in range when fight starts
+ SpoutTimer = 45000;
+ WhirlTimer = 18000;//after avery spout
+ PhaseTimer = 120000;
+ GeyserTimer = rand()%5000 + 15000;
+ CheckTimer = 15000;//give time to get in range when fight starts
+ WaitTimer = 60000;//never reached
+ WaitTimer2 = 60000;//never reached
+
+ Submerged = true;//will be false at combat start
+ Spawned = false;
+ InRange = false;
+ CanStartEvent = false;
+
+ Summons.DespawnAll();
+
+ if (pInstance)
{
- AttackStart(who);
+ pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED);
+ pInstance->SetData(DATA_STRANGE_POOL, NOT_STARTED);
}
+ DoCast(me, SPELL_SUBMERGE);//submerge anim
+ me->SetVisibility(VISIBILITY_OFF);//we start invis under water, submerged
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
- }
- void MovementInform(uint32 type, uint32 /*id*/)
- {
- if (type == ROTATE_MOTION_TYPE)
- me->SetReactState(REACT_AGGRESSIVE);
- }
+ void JustDied(Unit* /*Killer*/)
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_THELURKERBELOWEVENT, DONE);
- void UpdateAI(const uint32 diff)
- {
- if (!CanStartEvent)//boss is invisible, don't attack
+ Summons.DespawnAll();
+ }
+
+ void EnterCombat(Unit * who)
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS);
+ Scripted_NoMovementAI::EnterCombat(who);
+ }
+
+ void MoveInLineOfSight(Unit *who)
{
- if (CheckCanStart())
+ if (!CanStartEvent)//boss is invisible, don't attack
+ return;
+ if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)))
{
- if (Submerged)
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius))
{
- me->SetVisibility(VISIBILITY_ON);
- Submerged = false;
- WaitTimer2 = 500;
+ AttackStart(who);
}
- if (!Submerged && WaitTimer2 <= diff)//wait 500ms before emerge anim
- {
- me->RemoveAllAuras();
- me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED);
- DoCast(me, SPELL_EMERGE, false);
- WaitTimer2 = 60000;//never reached
- WaitTimer = 3000;
- } else WaitTimer2 -= diff;
-
- if (WaitTimer <= diff)//wait 3secs for emerge anim, then attack
- {
- WaitTimer = 3000;
- CanStartEvent=true;//fresh fished from pool
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- } else WaitTimer -= diff;
}
- return;
}
- if (me->getThreatManager().getThreatList().empty())//check if should evade
+ void MovementInform(uint32 type, uint32 /*id*/)
{
- if (me->isInCombat())
- EnterEvadeMode();
- return;
+ if (type == ROTATE_MOTION_TYPE)
+ me->SetReactState(REACT_AGGRESSIVE);
}
- if (!Submerged)
+
+ void UpdateAI(const uint32 diff)
{
- if (PhaseTimer <= diff)
+ if (!CanStartEvent)//boss is invisible, don't attack
{
- me->InterruptNonMeleeSpells(false);
- DoCast(me, SPELL_SUBMERGE);
- PhaseTimer = 60000;//60secs submerged
- Submerged = true;
- } else PhaseTimer-=diff;
+ if (CheckCanStart())
+ {
+ if (Submerged)
+ {
+ me->SetVisibility(VISIBILITY_ON);
+ Submerged = false;
+ WaitTimer2 = 500;
+ }
+ if (!Submerged && WaitTimer2 <= diff)//wait 500ms before emerge anim
+ {
+ me->RemoveAllAuras();
+ me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED);
+ DoCast(me, SPELL_EMERGE, false);
+ WaitTimer2 = 60000;//never reached
+ WaitTimer = 3000;
+ } else WaitTimer2 -= diff;
+
+ if (WaitTimer <= diff)//wait 3secs for emerge anim, then attack
+ {
+ WaitTimer = 3000;
+ CanStartEvent=true;//fresh fished from pool
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ } else WaitTimer -= diff;
+ }
+ return;
+ }
- if (SpoutTimer <= diff)
+ if (me->getThreatManager().getThreatList().empty())//check if should evade
{
- me->MonsterTextEmote(EMOTE_SPOUT,0,true);
- me->SetReactState(REACT_PASSIVE);
- me->GetMotionMaster()->MoveRotate(20000, rand()%2 ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT);
- SpoutTimer = 45000;
- WhirlTimer = 20000;//whirl directly after spout
- RotTimer = 20000;
+ if (me->isInCombat())
+ EnterEvadeMode();
return;
- } else SpoutTimer -= diff;
-
- //Whirl directly after a Spout and at random times
- if (WhirlTimer <= diff)
+ }
+ if (!Submerged)
{
- WhirlTimer = 18000;
- DoCast(me, SPELL_WHIRL);
- } else WhirlTimer -= diff;
+ if (PhaseTimer <= diff)
+ {
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me, SPELL_SUBMERGE);
+ PhaseTimer = 60000;//60secs submerged
+ Submerged = true;
+ } else PhaseTimer-=diff;
- if (CheckTimer <= diff)//check if there are players in melee range
- {
- InRange = false;
- Map* pMap = me->GetMap();
- Map::PlayerList const &PlayerList = pMap->GetPlayers();
- if (!PlayerList.isEmpty())
+ if (SpoutTimer <= diff)
{
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if (me->IsWithinMeleeRange(i->getSource()))
- InRange = true;
- }
- }
- CheckTimer = 2000;
- } else CheckTimer -= diff;
+ me->MonsterTextEmote(EMOTE_SPOUT,0,true);
+ me->SetReactState(REACT_PASSIVE);
+ me->GetMotionMaster()->MoveRotate(20000, rand()%2 ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT);
+ SpoutTimer = 45000;
+ WhirlTimer = 20000;//whirl directly after spout
+ RotTimer = 20000;
+ return;
+ } else SpoutTimer -= diff;
+
+ //Whirl directly after a Spout and at random times
+ if (WhirlTimer <= diff)
+ {
+ WhirlTimer = 18000;
+ DoCast(me, SPELL_WHIRL);
+ } else WhirlTimer -= diff;
- if (RotTimer)
- {
- Map* pMap = me->GetMap();
- if (pMap->IsDungeon())
+ if (CheckTimer <= diff)//check if there are players in melee range
{
+ InRange = false;
+ Map* pMap = me->GetMap();
Map::PlayerList const &PlayerList = pMap->GetPlayers();
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ if (!PlayerList.isEmpty())
{
- if (i->getSource() && i->getSource()->isAlive() && me->HasInArc((double)diff/20000*(double)M_PI*2,i->getSource()) && me->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater())
- DoCast(i->getSource(), SPELL_SPOUT, true);//only knock back palyers in arc, in 100yards, not in water
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ if (me->IsWithinMeleeRange(i->getSource()))
+ InRange = true;
+ }
}
- }
+ CheckTimer = 2000;
+ } else CheckTimer -= diff;
- if (SpoutAnimTimer <= diff)
+ if (RotTimer)
{
- DoCast(me, SPELL_SPOUT_ANIM, true);
- SpoutAnimTimer = 1000;
- } else SpoutAnimTimer -= diff;
+ Map* pMap = me->GetMap();
+ if (pMap->IsDungeon())
+ {
+ Map::PlayerList const &PlayerList = pMap->GetPlayers();
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ if (i->getSource() && i->getSource()->isAlive() && me->HasInArc((double)diff/20000*(double)M_PI*2,i->getSource()) && me->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater())
+ DoCast(i->getSource(), SPELL_SPOUT, true);//only knock back palyers in arc, in 100yards, not in water
+ }
+ }
- if (RotTimer <= diff)
- {
- RotTimer = 0;
- } else RotTimer -= diff;
- return;
- }
+ if (SpoutAnimTimer <= diff)
+ {
+ DoCast(me, SPELL_SPOUT_ANIM, true);
+ SpoutAnimTimer = 1000;
+ } else SpoutAnimTimer -= diff;
- if (GeyserTimer <= diff)
- {
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (!pTarget && me->getVictim())
- pTarget = me->getVictim();
- if (pTarget)
- DoCast(pTarget, SPELL_GEYSER, true);
- GeyserTimer = rand()%5000 + 15000;
- } else GeyserTimer -= diff;
+ if (RotTimer <= diff)
+ {
+ RotTimer = 0;
+ } else RotTimer -= diff;
+ return;
+ }
- if (!InRange)//if on players in melee range cast Waterbolt
- {
- if (WaterboltTimer <= diff)
+ if (GeyserTimer <= diff)
{
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (!pTarget && me->getVictim())
pTarget = me->getVictim();
if (pTarget)
- DoCast(pTarget, SPELL_WATERBOLT, true);
- WaterboltTimer = 3000;
- } else WaterboltTimer -= diff;
- }
+ DoCast(pTarget, SPELL_GEYSER, true);
+ GeyserTimer = rand()%5000 + 15000;
+ } else GeyserTimer -= diff;
- if (!UpdateCombatState())
- return;
+ if (!InRange)//if on players in melee range cast Waterbolt
+ {
+ if (WaterboltTimer <= diff)
+ {
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (!pTarget && me->getVictim())
+ pTarget = me->getVictim();
+ if (pTarget)
+ DoCast(pTarget, SPELL_WATERBOLT, true);
+ WaterboltTimer = 3000;
+ } else WaterboltTimer -= diff;
+ }
- DoMeleeAttackIfReady();
+ if (!UpdateCombatState())
+ return;
- }else//submerged
- {
- if (PhaseTimer <= diff)
- {
- Submerged = false;
- me->InterruptNonMeleeSpells(false);//shouldn't be any
- me->RemoveAllAuras();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED);
- DoCast(me, SPELL_EMERGE, true);
- Spawned = false;
- SpoutTimer = 3000; // directly cast Spout after emerging!
- PhaseTimer = 120000;
- return;
- } else PhaseTimer-=diff;
+ DoMeleeAttackIfReady();
- if (me->getThreatManager().getThreatList().empty())//check if should evade
+ }else//submerged
{
- EnterEvadeMode();
- return;
- }
- if (!me->isInCombat())
- DoZoneInCombat();
+ if (PhaseTimer <= diff)
+ {
+ Submerged = false;
+ me->InterruptNonMeleeSpells(false);//shouldn't be any
+ me->RemoveAllAuras();
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED);
+ DoCast(me, SPELL_EMERGE, true);
+ Spawned = false;
+ SpoutTimer = 3000; // directly cast Spout after emerging!
+ PhaseTimer = 120000;
+ return;
+ } else PhaseTimer-=diff;
+
+ if (me->getThreatManager().getThreatList().empty())//check if should evade
+ {
+ EnterEvadeMode();
+ return;
+ }
+ if (!me->isInCombat())
+ DoZoneInCombat();
- if (!Spawned)
- {
- me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- //spawn adds
- for (uint8 i = 0; i < 9; ++i)
+ if (!Spawned)
{
- Creature* Summoned;
- if (i < 6)
- Summoned = me->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- else Summoned = me->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ //spawn adds
+ for (uint8 i = 0; i < 9; ++i)
+ {
+ Creature* Summoned;
+ if (i < 6)
+ Summoned = me->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ else Summoned = me->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (Summoned)
- Summons.Summon(Summoned);
+ if (Summoned)
+ Summons.Summon(Summoned);
+ }
+ Spawned = true;
}
- Spawned = true;
}
}
- }
- };
-
-CreatureAI* GetAI_mob_coilfang_guardian(Creature* pCreature)
+ };
+};
+ class mob_coilfang_guardian : public CreatureScript
{
- SimpleAI* ai = new SimpleAI (pCreature);
+public:
+ mob_coilfang_guardian() : CreatureScript("mob_coilfang_guardian") { }
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH;
- ai->Spell[0].Cooldown = 15000;
- ai->Spell[0].First_Cast = 5000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ SimpleAI* ai = new SimpleAI (pCreature);
- ai->Spell[1].Enabled = true;
- ai->Spell[1].Spell_Id = SPELL_HAMSTRING;
- ai->Spell[1].Cooldown = 10000;
- ai->Spell[1].First_Cast = 2000;
- ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
+ ai->Spell[0].Enabled = true;
+ ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH;
+ ai->Spell[0].Cooldown = 15000;
+ ai->Spell[0].First_Cast = 5000;
+ ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
- return ai;
-}
+ ai->Spell[1].Enabled = true;
+ ai->Spell[1].Spell_Id = SPELL_HAMSTRING;
+ ai->Spell[1].Cooldown = 10000;
+ ai->Spell[1].First_Cast = 2000;
+ ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
-struct mob_coilfang_ambusherAI : public Scripted_NoMovementAI
-{
- mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c)
- {
- SpellEntry *TempSpell = GET_SPELL(SPELL_SHOOT);
- if (TempSpell)
- TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg
+ return ai;
}
- uint32 MultiShotTimer;
- uint32 ShootBowTimer;
+};
+ class mob_coilfang_ambusher : public CreatureScript
+{
+public:
+ mob_coilfang_ambusher() : CreatureScript("mob_coilfang_ambusher") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- MultiShotTimer = 10000;
- ShootBowTimer = 4000;
-
+ return new mob_coilfang_ambusherAI (pCreature);
}
- void EnterCombat(Unit * /*who*/)
+ struct mob_coilfang_ambusherAI : public Scripted_NoMovementAI
{
+ mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c)
+ {
+ SpellEntry *TempSpell = GET_SPELL(SPELL_SHOOT);
+ if (TempSpell)
+ TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg
+ }
- }
+ uint32 MultiShotTimer;
+ uint32 ShootBowTimer;
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || me->getVictim()) return;
+ void Reset()
+ {
+ MultiShotTimer = 10000;
+ ShootBowTimer = 4000;
+
+ }
- if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who) && me->IsWithinDistInMap(who, 45))
+ void EnterCombat(Unit * /*who*/)
{
- AttackStart(who);
+
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (MultiShotTimer <= diff)
+ void MoveInLineOfSight(Unit *who)
{
- if (me->getVictim())
- DoCast(me->getVictim(), SPELL_SPREAD_SHOT, true);
+ if (!who || me->getVictim()) return;
- MultiShotTimer = 10000+rand()%10000;
- ShootBowTimer += 1500;//add global cooldown
- } else MultiShotTimer -= diff;
+ if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who) && me->IsWithinDistInMap(who, 45))
+ {
+ AttackStart(who);
+ }
+ }
- if (ShootBowTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- int bp0 = 1100;
- if (pTarget)
- me->CastCustomSpell(pTarget,SPELL_SHOOT,&bp0,NULL,NULL,true);
- ShootBowTimer = 4000+rand()%5000;
- MultiShotTimer += 1500;//add global cooldown
- } else ShootBowTimer -= diff;
- }
-};
+ if (MultiShotTimer <= diff)
+ {
+ if (me->getVictim())
+ DoCast(me->getVictim(), SPELL_SPREAD_SHOT, true);
-CreatureAI* GetAI_mob_coilfang_ambusher(Creature* pCreature)
-{
- return new mob_coilfang_ambusherAI (pCreature);
-}
+ MultiShotTimer = 10000+rand()%10000;
+ ShootBowTimer += 1500;//add global cooldown
+ } else MultiShotTimer -= diff;
-CreatureAI* GetAI_boss_the_lurker_below(Creature* pCreature)
-{
- return new boss_the_lurker_belowAI (pCreature);
-}
+ if (ShootBowTimer <= diff)
+ {
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ int bp0 = 1100;
+ if (pTarget)
+ me->CastCustomSpell(pTarget,SPELL_SHOOT,&bp0,NULL,NULL,true);
+ ShootBowTimer = 4000+rand()%5000;
+ MultiShotTimer += 1500;//add global cooldown
+ } else ShootBowTimer -= diff;
+ }
+ };
+
+};
void AddSC_boss_the_lurker_below()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_the_lurker_below";
- newscript->GetAI = &GetAI_boss_the_lurker_below;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_coilfang_guardian";
- newscript->GetAI = &GetAI_mob_coilfang_guardian;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_coilfang_ambusher";
- newscript->GetAI = &GetAI_mob_coilfang_ambusher;
- newscript->RegisterSelf();
+ new boss_the_lurker_below();
+ new mob_coilfang_guardian();
+ new mob_coilfang_ambusher();
}
-
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
index b040730f1a2..a6807ca69e6 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
@@ -97,274 +97,278 @@ float MurlocCords[10][5] =
#define WATER_GLOBULE 21913
#define TIDEWALKER_LURKER 21920
-//Morogrim Tidewalker AI
-struct boss_morogrim_tidewalkerAI : public ScriptedAI
+//Morogrim Tidewalker AI class boss_morogrim_tidewalker : public CreatureScript
{
- boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_morogrim_tidewalker() : CreatureScript("boss_morogrim_tidewalker") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new boss_morogrim_tidewalkerAI (pCreature);
}
- ScriptedInstance* pInstance;
+ struct boss_morogrim_tidewalkerAI : public ScriptedAI
+ {
+ boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- Map::PlayerList const *PlayerList;
+ InstanceScript* pInstance;
- uint32 TidalWave_Timer;
- uint32 WateryGrave_Timer;
- uint32 Earthquake_Timer;
- uint32 WateryGlobules_Timer;
- uint32 globulespell[4];
- int8 Playercount;
- int8 counter;
+ Map::PlayerList const *PlayerList;
- bool Earthquake;
- bool Phase2;
+ uint32 TidalWave_Timer;
+ uint32 WateryGrave_Timer;
+ uint32 Earthquake_Timer;
+ uint32 WateryGlobules_Timer;
+ uint32 globulespell[4];
+ int8 Playercount;
+ int8 counter;
- void Reset()
- {
- TidalWave_Timer = 10000;
- WateryGrave_Timer = 30000;
- Earthquake_Timer = 40000;
- WateryGlobules_Timer = 0;
- globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1;
- globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2;
- globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3;
- globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4;
-
- Earthquake = false;
- Phase2 = false;
-
- if (pInstance)
- pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
- }
+ bool Earthquake;
+ bool Phase2;
- void StartEvent()
- {
- DoScriptText(SAY_AGGRO, me);
+ void Reset()
+ {
+ TidalWave_Timer = 10000;
+ WateryGrave_Timer = 30000;
+ Earthquake_Timer = 40000;
+ WateryGlobules_Timer = 0;
+ globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1;
+ globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2;
+ globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3;
+ globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4;
+
+ Earthquake = false;
+ Phase2 = false;
+
+ if (pInstance)
+ pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
+ }
- if (pInstance)
- pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
- }
+ void StartEvent()
+ {
+ DoScriptText(SAY_AGGRO, me);
- void KilledUnit(Unit * /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
- }
+ if (pInstance)
+ pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
+ }
- void JustDied(Unit * /*victim*/)
- {
- DoScriptText(SAY_DEATH, me);
+ void KilledUnit(Unit * /*victim*/)
+ {
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
+ }
- if (pInstance)
- pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE);
- }
+ void JustDied(Unit * /*victim*/)
+ {
+ DoScriptText(SAY_DEATH, me);
- void EnterCombat(Unit * /*who*/)
- {
- PlayerList = &me->GetMap()->GetPlayers();
- Playercount = PlayerList->getSize();
- StartEvent();
- }
+ if (pInstance)
+ pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE);
+ }
- void ApplyWateryGrave(Unit* pPlayer, uint8 i)
- {
- switch(i)
+ void EnterCombat(Unit * /*who*/)
{
- case 0: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_1, true); break;
- case 1: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_2, true); break;
- case 2: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_3, true); break;
- case 3: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_4, true); break;
+ PlayerList = &me->GetMap()->GetPlayers();
+ Playercount = PlayerList->getSize();
+ StartEvent();
}
- }
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //Earthquake_Timer
- if (Earthquake_Timer <= diff)
+ void ApplyWateryGrave(Unit* pPlayer, uint8 i)
{
- if (!Earthquake)
+ switch(i)
{
- DoCast(me->getVictim(), SPELL_EARTHQUAKE);
- Earthquake = true;
- Earthquake_Timer = 10000;
+ case 0: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_1, true); break;
+ case 1: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_2, true); break;
+ case 2: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_3, true); break;
+ case 3: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_4, true); break;
}
- else
- {
- DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- for (uint8 i = 0; i < 10; ++i)
+ //Earthquake_Timer
+ if (Earthquake_Timer <= diff)
+ {
+ if (!Earthquake)
{
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- Creature* Murloc = me->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
- if (pTarget && Murloc)
- Murloc->AI()->AttackStart(pTarget);
+ DoCast(me->getVictim(), SPELL_EARTHQUAKE);
+ Earthquake = true;
+ Earthquake_Timer = 10000;
}
- DoScriptText(EMOTE_EARTHQUAKE, me);
- Earthquake = false;
- Earthquake_Timer = 40000+rand()%5000;
- }
- } else Earthquake_Timer -= diff;
+ else
+ {
+ DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
- //TidalWave_Timer
- if (TidalWave_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_TIDAL_WAVE);
- TidalWave_Timer = 20000;
- } else TidalWave_Timer -= diff;
+ for (uint8 i = 0; i < 10; ++i)
+ {
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ Creature* Murloc = me->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
+ if (pTarget && Murloc)
+ Murloc->AI()->AttackStart(pTarget);
+ }
+ DoScriptText(EMOTE_EARTHQUAKE, me);
+ Earthquake = false;
+ Earthquake_Timer = 40000+rand()%5000;
+ }
+ } else Earthquake_Timer -= diff;
- if (!Phase2)
- {
- //WateryGrave_Timer
- if (WateryGrave_Timer <= diff)
+ //TidalWave_Timer
+ if (TidalWave_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_TIDAL_WAVE);
+ TidalWave_Timer = 20000;
+ } else TidalWave_Timer -= diff;
+
+ if (!Phase2)
{
- //Teleport 4 players under the waterfalls
- Unit *pTarget;
- std::set<uint64> list;
- std::set<uint64>::const_iterator itr;
- for (uint8 i = 0; i < 4; ++i)
+ //WateryGrave_Timer
+ if (WateryGrave_Timer <= diff)
{
- counter = 0;
- do
+ //Teleport 4 players under the waterfalls
+ Unit *pTarget;
+ std::set<uint64> list;
+ std::set<uint64>::const_iterator itr;
+ for (uint8 i = 0; i < 4; ++i)
{
- pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only
- if (counter < Playercount)
- break;
- if (pTarget)
- itr = list.find(pTarget->GetGUID());
- ++counter;
- } while (itr != list.end());
+ counter = 0;
+ do
+ {
+ pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only
+ if (counter < Playercount)
+ break;
+ if (pTarget)
+ itr = list.find(pTarget->GetGUID());
+ ++counter;
+ } while (itr != list.end());
- if (pTarget)
- {
- list.insert(pTarget->GetGUID());
- ApplyWateryGrave(pTarget, i);
+ if (pTarget)
+ {
+ list.insert(pTarget->GetGUID());
+ ApplyWateryGrave(pTarget, i);
+ }
}
- }
- DoScriptText(RAND(SAY_SUMMON_BUBL1,SAY_SUMMON_BUBL2), me);
+ DoScriptText(RAND(SAY_SUMMON_BUBL1,SAY_SUMMON_BUBL2), me);
- DoScriptText(EMOTE_WATERY_GRAVE, me);
- WateryGrave_Timer = 30000;
- } else WateryGrave_Timer -= diff;
+ DoScriptText(EMOTE_WATERY_GRAVE, me);
+ WateryGrave_Timer = 30000;
+ } else WateryGrave_Timer -= diff;
- //Start Phase2
- if (HealthBelowPct(25))
- Phase2 = true;
- }
- else
- {
- //WateryGlobules_Timer
- if (WateryGlobules_Timer <= diff)
+ //Start Phase2
+ if (HealthBelowPct(25))
+ Phase2 = true;
+ }
+ else
{
- Unit* pGlobuleTarget;
- std::set<uint64> globulelist;
- std::set<uint64>::const_iterator itr;
- for (uint8 g = 0; g < 4; g++) //one unit can't cast more than one spell per update, so some players have to cast for us XD
+ //WateryGlobules_Timer
+ if (WateryGlobules_Timer <= diff)
{
- counter = 0;
- do
+ Unit* pGlobuleTarget;
+ std::set<uint64> globulelist;
+ std::set<uint64>::const_iterator itr;
+ for (uint8 g = 0; g < 4; g++) //one unit can't cast more than one spell per update, so some players have to cast for us XD
{
- pGlobuleTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
+ counter = 0;
+ do
+ {
+ pGlobuleTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
+ if (pGlobuleTarget)
+ itr = globulelist.find(pGlobuleTarget->GetGUID());
+ if (counter > Playercount)
+ break;
+ ++counter;
+ } while (itr != globulelist.end());
if (pGlobuleTarget)
- itr = globulelist.find(pGlobuleTarget->GetGUID());
- if (counter > Playercount)
- break;
- ++counter;
- } while (itr != globulelist.end());
- if (pGlobuleTarget)
- globulelist.insert(pGlobuleTarget->GetGUID());
- pGlobuleTarget->CastSpell(pGlobuleTarget, globulespell[g], true);
- }
- DoScriptText(EMOTE_WATERY_GLOBULES, me);
- WateryGlobules_Timer = 25000;
- } else WateryGlobules_Timer -= diff;
+ globulelist.insert(pGlobuleTarget->GetGUID());
+ pGlobuleTarget->CastSpell(pGlobuleTarget, globulespell[g], true);
+ }
+ DoScriptText(EMOTE_WATERY_GLOBULES, me);
+ WateryGlobules_Timer = 25000;
+ } else WateryGlobules_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
- }
};
//Water Globule AI
#define SPELL_GLOBULE_EXPLOSION 37871
-
-struct mob_water_globuleAI : public ScriptedAI
+ class mob_water_globule : public CreatureScript
{
- mob_water_globuleAI(Creature *c) : ScriptedAI(c) {}
+public:
+ mob_water_globule() : CreatureScript("mob_water_globule") { }
- uint32 Check_Timer;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Check_Timer = 1000;
-
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->setFaction(14);
+ return new mob_water_globuleAI (pCreature);
}
- void EnterCombat(Unit * /*who*/) {}
-
- void MoveInLineOfSight(Unit *who)
+ struct mob_water_globuleAI : public ScriptedAI
{
- if (!who || me->getVictim())
- return;
+ mob_water_globuleAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 Check_Timer;
- if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who))
+ void Reset()
{
- //no attack radius check - it attacks the first target that moves in his los
- //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
- AttackStart(who);
+ Check_Timer = 1000;
+
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->setFaction(14);
}
- }
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ void EnterCombat(Unit * /*who*/) {}
- if (Check_Timer <= diff)
+ void MoveInLineOfSight(Unit *who)
{
- if (me->IsWithinDistInMap(me->getVictim(), 5))
+ if (!who || me->getVictim())
+ return;
+
+ if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who))
{
- DoCast(me->getVictim(), SPELL_GLOBULE_EXPLOSION);
+ //no attack radius check - it attacks the first target that moves in his los
+ //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+ AttackStart(who);
+ }
+ }
- //despawn
- me->ForcedDespawn();
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!UpdateVictim())
return;
- }
- Check_Timer = 500;
- } else Check_Timer -= diff;
- //do NOT deal any melee damage to the target.
- }
+ if (Check_Timer <= diff)
+ {
+ if (me->IsWithinDistInMap(me->getVictim(), 5))
+ {
+ DoCast(me->getVictim(), SPELL_GLOBULE_EXPLOSION);
+
+ //despawn
+ me->ForcedDespawn();
+ return;
+ }
+ Check_Timer = 500;
+ } else Check_Timer -= diff;
+
+ //do NOT deal any melee damage to the target.
+ }
+ };
+
};
-CreatureAI* GetAI_boss_morogrim_tidewalker(Creature* pCreature)
-{
- return new boss_morogrim_tidewalkerAI (pCreature);
-}
-CreatureAI* GetAI_mob_water_globule(Creature* pCreature)
-{
- return new mob_water_globuleAI (pCreature);
-}
void AddSC_boss_morogrim_tidewalker()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "boss_morogrim_tidewalker";
- newscript->GetAI = &GetAI_boss_morogrim_tidewalker;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_water_globule";
- newscript->GetAI = &GetAI_mob_water_globule;
- newscript->RegisterSelf();
+ new boss_morogrim_tidewalker();
+ new mob_water_globule();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
index 05944c1954e..ad52a76158c 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
@@ -46,355 +46,358 @@ EndScriptData */
4 - Morogrim Tidewalker Event
5 - Lady Vashj Event
*/
-
-bool GOHello_go_bridge_console(Player* /*pPlayer*/, GameObject* pGo)
+ class go_bridge_console : public GameObjectScript
{
- ScriptedInstance* pInstance = pGo->GetInstanceData();
+public:
+ go_bridge_console() : GameObjectScript("go_bridge_console") { }
- if (!pInstance)
- return false;
+ bool OnGossipHello(Player* /*pPlayer*/, GameObject* pGo)
+ {
+ InstanceScript* pInstance = pGo->GetInstanceScript();
- if (pInstance)
- pInstance->SetData(DATA_CONTROL_CONSOLE, DONE);
+ if (!pInstance)
+ return false;
- return true;
-}
-
-struct instance_serpentshrine_cavern : public ScriptedInstance
-{
- instance_serpentshrine_cavern(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
-
- uint64 LurkerBelow;
- uint64 Sharkkis;
- uint64 Tidalvess;
- uint64 Caribdis;
- uint64 LadyVashj;
- uint64 Karathress;
- uint64 KarathressEvent_Starter;
- uint64 LeotherasTheBlind;
- uint64 LeotherasEventStarter;
-
- uint64 ControlConsole;
- uint64 BridgePart[3];
- uint32 StrangePool;
- uint32 FishingTimer;
- uint32 LurkerSubEvent;
- uint32 WaterCheckTimer;
- uint32 FrenzySpawnTimer;
- uint32 Water;
- uint32 TrashCount;
-
- bool ShieldGeneratorDeactivated[4];
- uint32 m_auiEncounter[MAX_ENCOUNTER];
- bool DoSpawnFrenzy;
-
- void Initialize()
- {
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
-
- LurkerBelow = 0;
- Sharkkis = 0;
- Tidalvess = 0;
- Caribdis = 0;
- LadyVashj = 0;
- Karathress = 0;
- KarathressEvent_Starter = 0;
- LeotherasTheBlind = 0;
- LeotherasEventStarter = 0;
-
- ControlConsole = 0;
- BridgePart[0] = 0;
- BridgePart[1] = 0;
- BridgePart[2] = 0;
- StrangePool = 0;
- Water = WATERSTATE_FRENZY;
-
- ShieldGeneratorDeactivated[0] = false;
- ShieldGeneratorDeactivated[1] = false;
- ShieldGeneratorDeactivated[2] = false;
- ShieldGeneratorDeactivated[3] = false;
- FishingTimer = 1000;
- LurkerSubEvent = 0;
- WaterCheckTimer = 500;
- FrenzySpawnTimer = 2000;
- DoSpawnFrenzy = false;
- TrashCount = 0;
+ if (pInstance)
+ pInstance->SetData(DATA_CONTROL_CONSOLE, DONE);
+ return true;
}
- bool IsEncounterInProgress() const
- {
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS) return true;
+};
+ class instance_serpent_shrine : public InstanceMapScript
+{
+public:
+ instance_serpent_shrine() : InstanceMapScript("instance_serpent_shrine") { }
- return false;
+ InstanceScript* GetInstanceData_instance_serpentshrine_cavern_InstanceMapScript(Map* pMap)
+ {
+ return new instance_serpentshrine_cavern_InstanceMapScript(pMap);
}
- void Update (uint32 diff)
+ struct instance_serpentshrine_cavern_InstanceMapScript : public InstanceScript
{
- //Lurker Fishing event
- if (LurkerSubEvent == LURKER_FISHING)
+ instance_serpentshrine_cavern_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
+
+ uint64 LurkerBelow;
+ uint64 Sharkkis;
+ uint64 Tidalvess;
+ uint64 Caribdis;
+ uint64 LadyVashj;
+ uint64 Karathress;
+ uint64 KarathressEvent_Starter;
+ uint64 LeotherasTheBlind;
+ uint64 LeotherasEventStarter;
+
+ uint64 ControlConsole;
+ uint64 BridgePart[3];
+ uint32 StrangePool;
+ uint32 FishingTimer;
+ uint32 LurkerSubEvent;
+ uint32 WaterCheckTimer;
+ uint32 FrenzySpawnTimer;
+ uint32 Water;
+ uint32 TrashCount;
+
+ bool ShieldGeneratorDeactivated[4];
+ uint32 m_auiEncounter[MAX_ENCOUNTER];
+ bool DoSpawnFrenzy;
+
+ void Initialize()
{
- if (FishingTimer <= diff)
- {
- LurkerSubEvent = LURKER_HOOKED;
- SetData(DATA_STRANGE_POOL, IN_PROGRESS);//just fished, signal Lurker script to emerge and start fight, we use IN_PROGRESS so it won't get saved and lurker will be alway invis at start if server restarted
- } else FishingTimer -= diff;
+ memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+
+ LurkerBelow = 0;
+ Sharkkis = 0;
+ Tidalvess = 0;
+ Caribdis = 0;
+ LadyVashj = 0;
+ Karathress = 0;
+ KarathressEvent_Starter = 0;
+ LeotherasTheBlind = 0;
+ LeotherasEventStarter = 0;
+
+ ControlConsole = 0;
+ BridgePart[0] = 0;
+ BridgePart[1] = 0;
+ BridgePart[2] = 0;
+ StrangePool = 0;
+ Water = WATERSTATE_FRENZY;
+
+ ShieldGeneratorDeactivated[0] = false;
+ ShieldGeneratorDeactivated[1] = false;
+ ShieldGeneratorDeactivated[2] = false;
+ ShieldGeneratorDeactivated[3] = false;
+ FishingTimer = 1000;
+ LurkerSubEvent = 0;
+ WaterCheckTimer = 500;
+ FrenzySpawnTimer = 2000;
+ DoSpawnFrenzy = false;
+ TrashCount = 0;
+
}
- //Water checks
- if (WaterCheckTimer <= diff)
+
+ bool IsEncounterInProgress() const
{
- if (TrashCount >= MIN_KILLS)
- Water = WATERSTATE_SCALDING;
- else
- Water = WATERSTATE_FRENZY;
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS) return true;
- Map::PlayerList const &PlayerList = instance->GetPlayers();
- if (PlayerList.isEmpty())
- return;
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ return false;
+ }
+
+ void Update (uint32 diff)
+ {
+ //Lurker Fishing event
+ if (LurkerSubEvent == LURKER_FISHING)
+ {
+ if (FishingTimer <= diff)
+ {
+ LurkerSubEvent = LURKER_HOOKED;
+ SetData(DATA_STRANGE_POOL, IN_PROGRESS);//just fished, signal Lurker script to emerge and start fight, we use IN_PROGRESS so it won't get saved and lurker will be alway invis at start if server restarted
+ } else FishingTimer -= diff;
+ }
+ //Water checks
+ if (WaterCheckTimer <= diff)
{
- if (Player* pPlayer = i->getSource())
+ if (TrashCount >= MIN_KILLS)
+ Water = WATERSTATE_SCALDING;
+ else
+ Water = WATERSTATE_FRENZY;
+
+ Map::PlayerList const &PlayerList = instance->GetPlayers();
+ if (PlayerList.isEmpty())
+ return;
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
- if (pPlayer->isAlive() && /*i->getSource()->GetPositionZ() <= -21.434931f*/pPlayer->IsInWater())
+ if (Player* pPlayer = i->getSource())
{
- if (Water == WATERSTATE_SCALDING)
+ if (pPlayer->isAlive() && /*i->getSource()->GetPositionZ() <= -21.434931f*/pPlayer->IsInWater())
{
-
- if (!pPlayer->HasAura(SPELL_SCALDINGWATER))
+ if (Water == WATERSTATE_SCALDING)
{
- pPlayer->CastSpell(pPlayer, SPELL_SCALDINGWATER,true);
- }
- } else if (Water == WATERSTATE_FRENZY)
- {
- //spawn frenzy
- if (DoSpawnFrenzy)
+
+ if (!pPlayer->HasAura(SPELL_SCALDINGWATER))
+ {
+ pPlayer->CastSpell(pPlayer, SPELL_SCALDINGWATER,true);
+ }
+ } else if (Water == WATERSTATE_FRENZY)
{
- if (Creature* frenzy = pPlayer->SummonCreature(MOB_COILFANG_FRENZY,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ(),pPlayer->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,2000))
+ //spawn frenzy
+ if (DoSpawnFrenzy)
{
- frenzy->Attack(pPlayer,false);
- frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
+ if (Creature* frenzy = pPlayer->SummonCreature(MOB_COILFANG_FRENZY,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ(),pPlayer->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,2000))
+ {
+ frenzy->Attack(pPlayer,false);
+ frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
+ }
+ DoSpawnFrenzy = false;
}
- DoSpawnFrenzy = false;
}
}
+ if (!pPlayer->IsInWater())
+ pPlayer->RemoveAurasDueToSpell(SPELL_SCALDINGWATER);
}
- if (!pPlayer->IsInWater())
- pPlayer->RemoveAurasDueToSpell(SPELL_SCALDINGWATER);
+
}
+ WaterCheckTimer = 500;//remove stress from core
+ } else WaterCheckTimer -= diff;
+ if (FrenzySpawnTimer <= diff)
+ {
+ DoSpawnFrenzy = true;
+ FrenzySpawnTimer = 2000;
+ } else FrenzySpawnTimer -= diff;
+ }
- }
- WaterCheckTimer = 500;//remove stress from core
- } else WaterCheckTimer -= diff;
- if (FrenzySpawnTimer <= diff)
+ void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
- DoSpawnFrenzy = true;
- FrenzySpawnTimer = 2000;
- } else FrenzySpawnTimer -= diff;
- }
+ switch(pGo->GetEntry())
+ {
+ case 184568:
+ ControlConsole = pGo->GetGUID();
+ pGo->setActive(true);
+ break;
- void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
- {
- switch(pGo->GetEntry())
- {
- case 184568:
- ControlConsole = pGo->GetGUID();
- pGo->setActive(true);
- break;
-
- case 184203:
- BridgePart[0] = pGo->GetGUID();
- pGo->setActive(true);
- break;
-
- case 184204:
- BridgePart[1] = pGo->GetGUID();
- pGo->setActive(true);
- break;
-
- case 184205:
- BridgePart[2] = pGo->GetGUID();
- pGo->setActive(true);
- break;
- case GAMEOBJECT_FISHINGNODE_ENTRY://no way checking if fish is hooked, so we create a timed event
- if (LurkerSubEvent == LURKER_NOT_STARTED)
- {
- FishingTimer = 10000+rand()%30000;//random time before lurker emerges
- LurkerSubEvent = LURKER_FISHING;
- }
+ case 184203:
+ BridgePart[0] = pGo->GetGUID();
+ pGo->setActive(true);
+ break;
+
+ case 184204:
+ BridgePart[1] = pGo->GetGUID();
+ pGo->setActive(true);
break;
+
+ case 184205:
+ BridgePart[2] = pGo->GetGUID();
+ pGo->setActive(true);
+ break;
+ case GAMEOBJECT_FISHINGNODE_ENTRY://no way checking if fish is hooked, so we create a timed event
+ if (LurkerSubEvent == LURKER_NOT_STARTED)
+ {
+ FishingTimer = 10000+rand()%30000;//random time before lurker emerges
+ LurkerSubEvent = LURKER_FISHING;
+ }
+ break;
+ }
}
- }
- void OnCreatureCreate(Creature* pCreature, bool /*add*/)
- {
- switch(pCreature->GetEntry())
+ void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
- case 21212: LadyVashj = pCreature->GetGUID(); break;
- case 21214: Karathress = pCreature->GetGUID(); break;
- case 21966: Sharkkis = pCreature->GetGUID(); break;
- case 21217: LurkerBelow = pCreature->GetGUID(); break;
- case 21965: Tidalvess = pCreature->GetGUID(); break;
- case 21964: Caribdis = pCreature->GetGUID(); break;
- case 21215: LeotherasTheBlind = pCreature->GetGUID(); break;
- /*case TRASHMOB_COILFANG_PRIESTESS:
- case TRASHMOB_COILFANG_SHATTERER:
- if (pCreature->isAlive())
- ++TrashCount;
- break;*/
+ switch(pCreature->GetEntry())
+ {
+ case 21212: LadyVashj = pCreature->GetGUID(); break;
+ case 21214: Karathress = pCreature->GetGUID(); break;
+ case 21966: Sharkkis = pCreature->GetGUID(); break;
+ case 21217: LurkerBelow = pCreature->GetGUID(); break;
+ case 21965: Tidalvess = pCreature->GetGUID(); break;
+ case 21964: Caribdis = pCreature->GetGUID(); break;
+ case 21215: LeotherasTheBlind = pCreature->GetGUID(); break;
+ /*case TRASHMOB_COILFANG_PRIESTESS:
+ case TRASHMOB_COILFANG_SHATTERER:
+ if (pCreature->isAlive())
+ ++TrashCount;
+ break;*/
+ }
}
- }
- void SetData64(uint32 type, uint64 data)
- {
- if (type == DATA_KARATHRESSEVENT_STARTER)
- KarathressEvent_Starter = data;
- if (type == DATA_LEOTHERAS_EVENT_STARTER)
- LeotherasEventStarter = data;
- }
+ void SetData64(uint32 type, uint64 data)
+ {
+ if (type == DATA_KARATHRESSEVENT_STARTER)
+ KarathressEvent_Starter = data;
+ if (type == DATA_LEOTHERAS_EVENT_STARTER)
+ LeotherasEventStarter = data;
+ }
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
+ uint64 GetData64(uint32 identifier)
{
- case DATA_THELURKERBELOW: return LurkerBelow;
- case DATA_SHARKKIS: return Sharkkis;
- case DATA_TIDALVESS: return Tidalvess;
- case DATA_CARIBDIS: return Caribdis;
- case DATA_LADYVASHJ: return LadyVashj;
- case DATA_KARATHRESS: return Karathress;
- case DATA_KARATHRESSEVENT_STARTER: return KarathressEvent_Starter;
- case DATA_LEOTHERAS: return LeotherasTheBlind;
- case DATA_LEOTHERAS_EVENT_STARTER: return LeotherasEventStarter;
+ switch(identifier)
+ {
+ case DATA_THELURKERBELOW: return LurkerBelow;
+ case DATA_SHARKKIS: return Sharkkis;
+ case DATA_TIDALVESS: return Tidalvess;
+ case DATA_CARIBDIS: return Caribdis;
+ case DATA_LADYVASHJ: return LadyVashj;
+ case DATA_KARATHRESS: return Karathress;
+ case DATA_KARATHRESSEVENT_STARTER: return KarathressEvent_Starter;
+ case DATA_LEOTHERAS: return LeotherasTheBlind;
+ case DATA_LEOTHERAS_EVENT_STARTER: return LeotherasEventStarter;
+ }
+ return 0;
}
- return 0;
- }
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
+ void SetData(uint32 type, uint32 data)
{
- case DATA_STRANGE_POOL:
+ switch(type)
{
- StrangePool = data;
+ case DATA_STRANGE_POOL:
+ {
+ StrangePool = data;
+ if (data == NOT_STARTED)
+ LurkerSubEvent = LURKER_NOT_STARTED;
+ }
+ break;
+ case DATA_CONTROL_CONSOLE:
+ if (data == DONE)
+ {
+ HandleGameObject(BridgePart[0], true);
+ HandleGameObject(BridgePart[0], true);
+ HandleGameObject(BridgePart[0], true);
+ }
+ ControlConsole = data;break;
+ case DATA_TRASH :
+ {
+ if (data == 1 && TrashCount < MIN_KILLS)
+ ++TrashCount;//+1 died
+ SaveToDB();
+ break;
+ }
+ case DATA_WATER : Water = data;break;
+ case DATA_HYDROSSTHEUNSTABLEEVENT: m_auiEncounter[0] = data; break;
+ case DATA_LEOTHERASTHEBLINDEVENT: m_auiEncounter[1] = data; break;
+ case DATA_THELURKERBELOWEVENT: m_auiEncounter[2] = data; break;
+ case DATA_KARATHRESSEVENT: m_auiEncounter[3] = data; break;
+ case DATA_MOROGRIMTIDEWALKEREVENT: m_auiEncounter[4] = data; break;
+ //Lady Vashj
+ case DATA_LADYVASHJEVENT:
if (data == NOT_STARTED)
- LurkerSubEvent = LURKER_NOT_STARTED;
+ {
+ ShieldGeneratorDeactivated[0] = false;
+ ShieldGeneratorDeactivated[1] = false;
+ ShieldGeneratorDeactivated[2] = false;
+ ShieldGeneratorDeactivated[3] = false;
+ }
+ m_auiEncounter[5] = data; break;
+ case DATA_SHIELDGENERATOR1:ShieldGeneratorDeactivated[0] = (data) ? true : false; break;
+ case DATA_SHIELDGENERATOR2:ShieldGeneratorDeactivated[1] = (data) ? true : false; break;
+ case DATA_SHIELDGENERATOR3:ShieldGeneratorDeactivated[2] = (data) ? true : false; break;
+ case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break;
}
- break;
- case DATA_CONTROL_CONSOLE:
+
if (data == DONE)
- {
- HandleGameObject(BridgePart[0], true);
- HandleGameObject(BridgePart[0], true);
- HandleGameObject(BridgePart[0], true);
- }
- ControlConsole = data;break;
- case DATA_TRASH :
- {
- if (data == 1 && TrashCount < MIN_KILLS)
- ++TrashCount;//+1 died
SaveToDB();
- break;
- }
- case DATA_WATER : Water = data;break;
- case DATA_HYDROSSTHEUNSTABLEEVENT: m_auiEncounter[0] = data; break;
- case DATA_LEOTHERASTHEBLINDEVENT: m_auiEncounter[1] = data; break;
- case DATA_THELURKERBELOWEVENT: m_auiEncounter[2] = data; break;
- case DATA_KARATHRESSEVENT: m_auiEncounter[3] = data; break;
- case DATA_MOROGRIMTIDEWALKEREVENT: m_auiEncounter[4] = data; break;
- //Lady Vashj
- case DATA_LADYVASHJEVENT:
- if (data == NOT_STARTED)
- {
- ShieldGeneratorDeactivated[0] = false;
- ShieldGeneratorDeactivated[1] = false;
- ShieldGeneratorDeactivated[2] = false;
- ShieldGeneratorDeactivated[3] = false;
- }
- m_auiEncounter[5] = data; break;
- case DATA_SHIELDGENERATOR1:ShieldGeneratorDeactivated[0] = (data) ? true : false; break;
- case DATA_SHIELDGENERATOR2:ShieldGeneratorDeactivated[1] = (data) ? true : false; break;
- case DATA_SHIELDGENERATOR3:ShieldGeneratorDeactivated[2] = (data) ? true : false; break;
- case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break;
}
- if (data == DONE)
- SaveToDB();
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
+ uint32 GetData(uint32 type)
{
- case DATA_HYDROSSTHEUNSTABLEEVENT: return m_auiEncounter[0];
- case DATA_LEOTHERASTHEBLINDEVENT: return m_auiEncounter[1];
- case DATA_THELURKERBELOWEVENT: return m_auiEncounter[2];
- case DATA_KARATHRESSEVENT: return m_auiEncounter[3];
- case DATA_MOROGRIMTIDEWALKEREVENT: return m_auiEncounter[4];
- //Lady Vashj
- case DATA_LADYVASHJEVENT: return m_auiEncounter[5];
- case DATA_SHIELDGENERATOR1: return ShieldGeneratorDeactivated[0];
- case DATA_SHIELDGENERATOR2: return ShieldGeneratorDeactivated[1];
- case DATA_SHIELDGENERATOR3: return ShieldGeneratorDeactivated[2];
- case DATA_SHIELDGENERATOR4: return ShieldGeneratorDeactivated[3];
- case DATA_CANSTARTPHASE3:
- if (ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])return 1;break;
- case DATA_STRANGE_POOL: return StrangePool;
- case DATA_WATER: return Water;
+ switch(type)
+ {
+ case DATA_HYDROSSTHEUNSTABLEEVENT: return m_auiEncounter[0];
+ case DATA_LEOTHERASTHEBLINDEVENT: return m_auiEncounter[1];
+ case DATA_THELURKERBELOWEVENT: return m_auiEncounter[2];
+ case DATA_KARATHRESSEVENT: return m_auiEncounter[3];
+ case DATA_MOROGRIMTIDEWALKEREVENT: return m_auiEncounter[4];
+ //Lady Vashj
+ case DATA_LADYVASHJEVENT: return m_auiEncounter[5];
+ case DATA_SHIELDGENERATOR1: return ShieldGeneratorDeactivated[0];
+ case DATA_SHIELDGENERATOR2: return ShieldGeneratorDeactivated[1];
+ case DATA_SHIELDGENERATOR3: return ShieldGeneratorDeactivated[2];
+ case DATA_SHIELDGENERATOR4: return ShieldGeneratorDeactivated[3];
+ case DATA_CANSTARTPHASE3:
+ if (ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])return 1;break;
+ case DATA_STRANGE_POOL: return StrangePool;
+ case DATA_WATER: return Water;
+ }
+ return 0;
}
- return 0;
- }
- std::string GetSaveData()
- {
- OUT_SAVE_INST_DATA;
- std::ostringstream stream;
- stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
- << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << TrashCount;
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if (out)
+ std::string GetSaveData()
{
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
+ OUT_SAVE_INST_DATA;
+ std::ostringstream stream;
+ stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
+ << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << TrashCount;
+ char* out = new char[stream.str().length() + 1];
+ strcpy(out, stream.str().c_str());
+ if (out)
+ {
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return out;
+ }
+ return NULL;
}
- return NULL;
- }
- void Load(const char* in)
- {
- if (!in)
+ void Load(const char* in)
{
- OUT_LOAD_INST_DATA_FAIL;
- return;
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+ OUT_LOAD_INST_DATA(in);
+ std::istringstream stream(in);
+ stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]
+ >> m_auiEncounter[4] >> m_auiEncounter[5] >> TrashCount;
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
+ m_auiEncounter[i] = NOT_STARTED;
+ OUT_LOAD_INST_DATA_COMPLETE;
}
- OUT_LOAD_INST_DATA(in);
- std::istringstream stream(in);
- stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]
- >> m_auiEncounter[4] >> m_auiEncounter[5] >> TrashCount;
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
- m_auiEncounter[i] = NOT_STARTED;
- OUT_LOAD_INST_DATA_COMPLETE;
- }
+ };
+
};
-InstanceData* GetInstanceData_instance_serpentshrine_cavern(Map* pMap)
-{
- return new instance_serpentshrine_cavern(pMap);
-}
void AddSC_instance_serpentshrine_cavern()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "instance_serpent_shrine";
- newscript->GetInstanceData = &GetInstanceData_instance_serpentshrine_cavern;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "go_bridge_console";
- newscript->pGOHello = &GOHello_go_bridge_console;
- newscript->RegisterSelf();
+ new instance_serpent_shrine();
+ new go_bridge_console();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
index a8969d18b8b..17a77ec822e 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
@@ -43,147 +43,149 @@ EndContentData */
#define SPELL_LUNG_BURST 31481
#define SPELL_ENVELOPING_WINDS 31718
-struct boss_thespiaAI : public ScriptedAI
+#define SPELL_WATER_BOLT_VOLLEY 34449
+#define H_SPELL_WATER_BOLT_VOLLEY 37924
+ class boss_hydromancer_thespia : public CreatureScript
{
- boss_thespiaAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_hydromancer_thespia() : CreatureScript("boss_hydromancer_thespia") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new boss_thespiaAI (pCreature);
}
- ScriptedInstance *pInstance;
+ struct boss_thespiaAI : public ScriptedAI
+ {
+ boss_thespiaAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- uint32 LightningCloud_Timer;
- uint32 LungBurst_Timer;
- uint32 EnvelopingWinds_Timer;
+ InstanceScript *pInstance;
- void Reset()
- {
- LightningCloud_Timer = 15000;
- LungBurst_Timer = 7000;
- EnvelopingWinds_Timer = 9000;
+ uint32 LightningCloud_Timer;
+ uint32 LungBurst_Timer;
+ uint32 EnvelopingWinds_Timer;
- if (pInstance)
- pInstance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED);
- }
+ void Reset()
+ {
+ LightningCloud_Timer = 15000;
+ LungBurst_Timer = 7000;
+ EnvelopingWinds_Timer = 9000;
- void JustDied(Unit* /*Killer*/)
- {
- DoScriptText(SAY_DEAD, me);
+ if (pInstance)
+ pInstance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED);
+ }
- if (pInstance)
- pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE);
- }
+ void JustDied(Unit* /*Killer*/)
+ {
+ DoScriptText(SAY_DEAD, me);
- void KilledUnit(Unit* /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
- }
+ if (pInstance)
+ pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE);
+ }
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
+ void KilledUnit(Unit* /*victim*/)
+ {
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
+ }
- if (pInstance)
- pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS);
- }
+ void EnterCombat(Unit * /*who*/)
+ {
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ if (pInstance)
+ pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS);
+ }
- //LightningCloud_Timer
- if (LightningCloud_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_LIGHTNING_CLOUD);
+ if (!UpdateVictim())
+ return;
- //cast twice in Heroic mode
- if (IsHeroic())
+ //LightningCloud_Timer
+ if (LightningCloud_Timer <= diff)
+ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_LIGHTNING_CLOUD);
- LightningCloud_Timer = 15000+rand()%10000;
- } else LightningCloud_Timer -=diff;
+ //cast twice in Heroic mode
+ if (IsHeroic())
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_LIGHTNING_CLOUD);
- //LungBurst_Timer
- if (LungBurst_Timer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_LUNG_BURST);
- LungBurst_Timer = 7000+rand()%5000;
- } else LungBurst_Timer -=diff;
+ LightningCloud_Timer = 15000+rand()%10000;
+ } else LightningCloud_Timer -=diff;
- //EnvelopingWinds_Timer
- if (EnvelopingWinds_Timer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_ENVELOPING_WINDS);
+ //LungBurst_Timer
+ if (LungBurst_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_LUNG_BURST);
+ LungBurst_Timer = 7000+rand()%5000;
+ } else LungBurst_Timer -=diff;
- //cast twice in Heroic mode
- if (IsHeroic())
+ //EnvelopingWinds_Timer
+ if (EnvelopingWinds_Timer <= diff)
+ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_ENVELOPING_WINDS);
- EnvelopingWinds_Timer = 10000+rand()%5000;
- } else EnvelopingWinds_Timer -=diff;
- DoMeleeAttackIfReady();
- }
-};
+ //cast twice in Heroic mode
+ if (IsHeroic())
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_ENVELOPING_WINDS);
+ EnvelopingWinds_Timer = 10000+rand()%5000;
+ } else EnvelopingWinds_Timer -=diff;
-#define SPELL_WATER_BOLT_VOLLEY 34449
-#define H_SPELL_WATER_BOLT_VOLLEY 37924
+ DoMeleeAttackIfReady();
+ }
+ };
-struct mob_coilfang_waterelementalAI : public ScriptedAI
+};
+ class mob_coilfang_waterelemental : public CreatureScript
{
- mob_coilfang_waterelementalAI(Creature *c) : ScriptedAI(c) {}
-
- uint32 WaterBoltVolley_Timer;
+public:
+ mob_coilfang_waterelemental() : CreatureScript("mob_coilfang_waterelemental") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- WaterBoltVolley_Timer = 3000+rand()%3000;
+ return new mob_coilfang_waterelementalAI (pCreature);
}
- void EnterCombat(Unit * /*who*/) { }
-
- void UpdateAI(const uint32 diff)
+ struct mob_coilfang_waterelementalAI : public ScriptedAI
{
- if (!UpdateVictim())
- return;
+ mob_coilfang_waterelementalAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 WaterBoltVolley_Timer;
- if (WaterBoltVolley_Timer <= diff)
+ void Reset()
{
- DoCast(me, SPELL_WATER_BOLT_VOLLEY);
- WaterBoltVolley_Timer = 7000+rand()%5000;
- } else WaterBoltVolley_Timer -= diff;
+ WaterBoltVolley_Timer = 3000+rand()%3000;
+ }
- DoMeleeAttackIfReady();
- }
-};
+ void EnterCombat(Unit * /*who*/) { }
-CreatureAI* GetAI_boss_thespiaAI(Creature* pCreature)
-{
- return new boss_thespiaAI (pCreature);
-}
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
-CreatureAI* GetAI_mob_coilfang_waterelementalAI(Creature* pCreature)
-{
- return new mob_coilfang_waterelementalAI (pCreature);
-}
+ if (WaterBoltVolley_Timer <= diff)
+ {
+ DoCast(me, SPELL_WATER_BOLT_VOLLEY);
+ WaterBoltVolley_Timer = 7000+rand()%5000;
+ } else WaterBoltVolley_Timer -= diff;
-void AddSC_boss_hydromancer_thespia()
-{
- Script *newscript;
+ DoMeleeAttackIfReady();
+ }
+ };
- newscript = new Script;
- newscript->Name = "boss_hydromancer_thespia";
- newscript->GetAI = &GetAI_boss_thespiaAI;
- newscript->RegisterSelf();
+};
- newscript = new Script;
- newscript->Name = "mob_coilfang_waterelemental";
- newscript->GetAI = &GetAI_mob_coilfang_waterelementalAI;
- newscript->RegisterSelf();
+void AddSC_boss_hydromancer_thespia()
+{
+ new boss_hydromancer_thespia();
+ new mob_coilfang_waterelemental();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
index 1c25800e2e6..d18174e35f0 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
@@ -47,136 +47,143 @@ EndContentData */
#define H_SPELL_ENRAGE 1 //corrent enrage spell not known
#define ENTRY_STREAMRIGGER_MECHANIC 17951
-
-struct boss_mekgineer_steamriggerAI : public ScriptedAI
+ class boss_mekgineer_steamrigger : public CreatureScript
{
- boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- }
+public:
+ boss_mekgineer_steamrigger() : CreatureScript("boss_mekgineer_steamrigger") { }
- ScriptedInstance *pInstance;
-
- uint32 Shrink_Timer;
- uint32 Saw_Blade_Timer;
- uint32 Electrified_Net_Timer;
- bool Summon75;
- bool Summon50;
- bool Summon25;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Shrink_Timer = 20000;
- Saw_Blade_Timer = 15000;
- Electrified_Net_Timer = 10000;
-
- Summon75 = false;
- Summon50 = false;
- Summon25 = false;
-
- if (pInstance)
- pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED);
+ return new boss_mekgineer_steamriggerAI (pCreature);
}
- void JustDied(Unit* /*Killer*/)
+ struct boss_mekgineer_steamriggerAI : public ScriptedAI
{
- DoScriptText(SAY_DEATH, me);
+ boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- if (pInstance)
- pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE);
- }
+ InstanceScript *pInstance;
- void KilledUnit(Unit* /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
- }
-
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
+ uint32 Shrink_Timer;
+ uint32 Saw_Blade_Timer;
+ uint32 Electrified_Net_Timer;
+ bool Summon75;
+ bool Summon50;
+ bool Summon25;
- if (pInstance)
- pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS);
- }
+ void Reset()
+ {
+ Shrink_Timer = 20000;
+ Saw_Blade_Timer = 15000;
+ Electrified_Net_Timer = 10000;
- //no known summon spells exist
- void SummonMechanichs()
- {
- DoScriptText(SAY_MECHANICS, me);
+ Summon75 = false;
+ Summon50 = false;
+ Summon25 = false;
- DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
- DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
- DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
+ if (pInstance)
+ pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED);
+ }
- if (rand()%2)
- DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
- if (rand()%2)
- DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
- }
+ void JustDied(Unit* /*Killer*/)
+ {
+ DoScriptText(SAY_DEATH, me);
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ if (pInstance)
+ pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE);
+ }
- if (Shrink_Timer <= diff)
+ void KilledUnit(Unit* /*victim*/)
{
- DoCast(me->getVictim(), SPELL_SUPER_SHRINK_RAY);
- Shrink_Timer = 20000;
- } else Shrink_Timer -= diff;
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
+ }
- if (Saw_Blade_Timer <= diff)
+ void EnterCombat(Unit * /*who*/)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
- DoCast(pTarget, SPELL_SAW_BLADE);
- else
- DoCast(me->getVictim(), SPELL_SAW_BLADE);
+ DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
- Saw_Blade_Timer = 15000;
- } else Saw_Blade_Timer -= diff;
+ if (pInstance)
+ pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS);
+ }
- if (Electrified_Net_Timer <= diff)
+ //no known summon spells exist
+ void SummonMechanichs()
{
- DoCast(me->getVictim(), SPELL_ELECTRIFIED_NET);
- Electrified_Net_Timer = 10000;
+ DoScriptText(SAY_MECHANICS, me);
+
+ DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
+ DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
+ DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
+
+ if (rand()%2)
+ DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
+ if (rand()%2)
+ DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
}
- else Electrified_Net_Timer -= diff;
- if (!Summon75)
+ void UpdateAI(const uint32 diff)
{
- if ((me->GetHealth()*100 / me->GetMaxHealth()) < 75)
+ if (!UpdateVictim())
+ return;
+
+ if (Shrink_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SUPER_SHRINK_RAY);
+ Shrink_Timer = 20000;
+ } else Shrink_Timer -= diff;
+
+ if (Saw_Blade_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
+ DoCast(pTarget, SPELL_SAW_BLADE);
+ else
+ DoCast(me->getVictim(), SPELL_SAW_BLADE);
+
+ Saw_Blade_Timer = 15000;
+ } else Saw_Blade_Timer -= diff;
+
+ if (Electrified_Net_Timer <= diff)
{
- SummonMechanichs();
- Summon75 = true;
+ DoCast(me->getVictim(), SPELL_ELECTRIFIED_NET);
+ Electrified_Net_Timer = 10000;
}
- }
+ else Electrified_Net_Timer -= diff;
- if (!Summon50)
- {
- if ((me->GetHealth()*100 / me->GetMaxHealth()) < 50)
+ if (!Summon75)
+ {
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 75)
+ {
+ SummonMechanichs();
+ Summon75 = true;
+ }
+ }
+
+ if (!Summon50)
{
- SummonMechanichs();
- Summon50 = true;
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 50)
+ {
+ SummonMechanichs();
+ Summon50 = true;
+ }
}
- }
- if (!Summon25)
- {
- if ((me->GetHealth()*100 / me->GetMaxHealth()) < 25)
+ if (!Summon25)
{
- SummonMechanichs();
- Summon25 = true;
+ if ((me->GetHealth()*100 / me->GetMaxHealth()) < 25)
+ {
+ SummonMechanichs();
+ Summon25 = true;
+ }
}
+
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature* pCreature)
-{
- return new boss_mekgineer_steamriggerAI (pCreature);
-}
#define SPELL_DISPEL_MAGIC 17201
#define SPELL_REPAIR 31532
@@ -184,83 +191,80 @@ CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature* pCreature)
#define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair
#define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required
-
-struct mob_steamrigger_mechanicAI : public ScriptedAI
+ class mob_steamrigger_mechanic : public CreatureScript
{
- mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c)
+public:
+ mob_steamrigger_mechanic() : CreatureScript("mob_steamrigger_mechanic") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new mob_steamrigger_mechanicAI (pCreature);
}
- ScriptedInstance* pInstance;
+ struct mob_steamrigger_mechanicAI : public ScriptedAI
+ {
+ mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- uint32 Repair_Timer;
+ InstanceScript* pInstance;
- void Reset()
- {
- Repair_Timer = 2000;
- }
+ uint32 Repair_Timer;
- void MoveInLineOfSight(Unit* /*who*/)
- {
- //react only if attacked
- }
+ void Reset()
+ {
+ Repair_Timer = 2000;
+ }
- void EnterCombat(Unit * /*who*/) { }
+ void MoveInLineOfSight(Unit* /*who*/)
+ {
+ //react only if attacked
+ }
- void UpdateAI(const uint32 diff)
- {
- if (Repair_Timer <= diff)
+ void EnterCombat(Unit * /*who*/) { }
+
+ void UpdateAI(const uint32 diff)
{
- if (pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS)
+ if (Repair_Timer <= diff)
{
- if (Unit* pMekgineer = Unit::GetUnit((*me), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER)))
+ if (pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS)
{
- if (me->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE))
+ if (Unit* pMekgineer = Unit::GetUnit((*me), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER)))
{
- //are we already channeling? Doesn't work very well, find better check?
- if (!me->GetUInt32Value(UNIT_CHANNEL_SPELL))
+ if (me->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE))
+ {
+ //are we already channeling? Doesn't work very well, find better check?
+ if (!me->GetUInt32Value(UNIT_CHANNEL_SPELL))
+ {
+ //me->GetMotionMaster()->MovementExpired();
+ //me->GetMotionMaster()->MoveIdle();
+
+ DoCast(me, SPELL_REPAIR, true);
+ }
+ Repair_Timer = 5000;
+ }
+ else
{
//me->GetMotionMaster()->MovementExpired();
- //me->GetMotionMaster()->MoveIdle();
-
- DoCast(me, SPELL_REPAIR, true);
+ //me->GetMotionMaster()->MoveFollow(pMekgineer,0,0);
}
- Repair_Timer = 5000;
}
- else
- {
- //me->GetMotionMaster()->MovementExpired();
- //me->GetMotionMaster()->MoveFollow(pMekgineer,0,0);
- }
- }
- } else Repair_Timer = 5000;
- } else Repair_Timer -= diff;
+ } else Repair_Timer = 5000;
+ } else Repair_Timer -= diff;
- if (!UpdateVictim())
- return;
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_steamrigger_mechanic(Creature* pCreature)
-{
- return new mob_steamrigger_mechanicAI (pCreature);
-}
void AddSC_boss_mekgineer_steamrigger()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "boss_mekgineer_steamrigger";
- newscript->GetAI = &GetAI_boss_mekgineer_steamrigger;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_steamrigger_mechanic";
- newscript->GetAI = &GetAI_mob_steamrigger_mechanic;
- newscript->RegisterSelf();
+ new boss_mekgineer_steamrigger();
+ new mob_steamrigger_mechanic();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
index b6a9d628f06..b2981432c41 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
@@ -41,166 +41,170 @@ EndScriptData */
#define SPELL_WARLORDS_RAGE_NAGA 31543
#define SPELL_WARLORDS_RAGE_PROC 36453
-
-struct mob_naga_distillerAI : public ScriptedAI
+ class mob_naga_distiller : public CreatureScript
{
- mob_naga_distillerAI(Creature *c) : ScriptedAI(c)
+public:
+ mob_naga_distiller() : CreatureScript("mob_naga_distiller") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new mob_naga_distillerAI (pCreature);
}
- ScriptedInstance *pInstance;
-
- void Reset()
+ struct mob_naga_distillerAI : public ScriptedAI
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ mob_naga_distillerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- //hack, due to really weird spell behaviour :(
- if (pInstance)
+ InstanceScript *pInstance;
+
+ void Reset()
{
- if (pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS)
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ //hack, due to really weird spell behaviour :(
+ if (pInstance)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if (pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS)
+ {
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
}
}
- }
- void EnterCombat(Unit * /*who*/) { }
+ void EnterCombat(Unit * /*who*/) { }
- void StartRageGen(Unit * /*caster*/)
- {
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- DoCast(me, SPELL_WARLORDS_RAGE_NAGA, true);
+ void StartRageGen(Unit * /*caster*/)
+ {
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (pInstance)
- pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS);
- }
+ DoCast(me, SPELL_WARLORDS_RAGE_NAGA, true);
- void DamageTaken(Unit * /*done_by*/, uint32 &damage)
- {
- if (me->GetHealth() <= damage)
if (pInstance)
- pInstance->SetData(TYPE_DISTILLER,DONE);
- }
-};
-
-struct boss_warlord_kalithreshAI : public ScriptedAI
-{
- boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- }
+ pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS);
+ }
- ScriptedInstance *pInstance;
+ void DamageTaken(Unit * /*done_by*/, uint32 &damage)
+ {
+ if (me->GetHealth() <= damage)
+ if (pInstance)
+ pInstance->SetData(TYPE_DISTILLER,DONE);
+ }
+ };
- uint32 Reflection_Timer;
- uint32 Impale_Timer;
- uint32 Rage_Timer;
- bool CanRage;
+};
+ class boss_warlord_kalithresh : public CreatureScript
+{
+public:
+ boss_warlord_kalithresh() : CreatureScript("boss_warlord_kalithresh") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Reflection_Timer = 10000;
- Impale_Timer = 7000+rand()%7000;
- Rage_Timer = 45000;
- CanRage = false;
-
- if (pInstance)
- pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED);
+ return new boss_warlord_kalithreshAI (pCreature);
}
- void EnterCombat(Unit * /*who*/)
+ struct boss_warlord_kalithreshAI : public ScriptedAI
{
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
+ boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- if (pInstance)
- pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS);
- }
+ InstanceScript *pInstance;
- void KilledUnit(Unit* /*victim*/)
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
- }
+ uint32 Reflection_Timer;
+ uint32 Impale_Timer;
+ uint32 Rage_Timer;
+ bool CanRage;
+
+ void Reset()
+ {
+ Reflection_Timer = 10000;
+ Impale_Timer = 7000+rand()%7000;
+ Rage_Timer = 45000;
+ CanRage = false;
- void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
- {
- //hack :(
- if (spell->Id == SPELL_WARLORDS_RAGE_PROC)
if (pInstance)
- if (pInstance->GetData(TYPE_DISTILLER) == DONE)
- me->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC);
- }
+ pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED);
+ }
- void JustDied(Unit* /*Killer*/)
- {
- DoScriptText(SAY_DEATH, me);
+ void EnterCombat(Unit * /*who*/)
+ {
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
- if (pInstance)
- pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE);
- }
+ if (pInstance)
+ pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void KilledUnit(Unit* /*victim*/)
+ {
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
+ }
- if (Rage_Timer <= diff)
+ void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
{
- if (Creature* distiller = me->FindNearestCreature(17954, 100.0f))
- {
- DoScriptText(SAY_REGEN, me);
- DoCast(me, SPELL_WARLORDS_RAGE);
- CAST_AI(mob_naga_distillerAI, distiller->AI())->StartRageGen(me);
- }
- Rage_Timer = 3000+rand()%15000;
- } else Rage_Timer -= diff;
+ //hack :(
+ if (spell->Id == SPELL_WARLORDS_RAGE_PROC)
+ if (pInstance)
+ if (pInstance->GetData(TYPE_DISTILLER) == DONE)
+ me->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC);
+ }
- //Reflection_Timer
- if (Reflection_Timer <= diff)
+ void JustDied(Unit* /*Killer*/)
{
- DoCast(me, SPELL_SPELL_REFLECTION);
- Reflection_Timer = 15000+rand()%10000;
- } else Reflection_Timer -= diff;
+ DoScriptText(SAY_DEATH, me);
+
+ if (pInstance)
+ pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE);
+ }
- //Impale_Timer
- if (Impale_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_IMPALE);
+ if (!UpdateVictim())
+ return;
- Impale_Timer = 7500+rand()%5000;
- } else Impale_Timer -= diff;
+ if (Rage_Timer <= diff)
+ {
+ if (Creature* distiller = me->FindNearestCreature(17954, 100.0f))
+ {
+ DoScriptText(SAY_REGEN, me);
+ DoCast(me, SPELL_WARLORDS_RAGE);
+ CAST_AI(mob_naga_distiller::mob_naga_distillerAI, distiller->AI())->StartRageGen(me);
+ }
+ Rage_Timer = 3000+rand()%15000;
+ } else Rage_Timer -= diff;
+
+ //Reflection_Timer
+ if (Reflection_Timer <= diff)
+ {
+ DoCast(me, SPELL_SPELL_REFLECTION);
+ Reflection_Timer = 15000+rand()%10000;
+ } else Reflection_Timer -= diff;
+
+ //Impale_Timer
+ if (Impale_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_IMPALE);
+
+ Impale_Timer = 7500+rand()%5000;
+ } else Impale_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_naga_distiller(Creature* pCreature)
-{
- return new mob_naga_distillerAI (pCreature);
-}
-CreatureAI* GetAI_boss_warlord_kalithresh(Creature* pCreature)
-{
- return new boss_warlord_kalithreshAI (pCreature);
-}
void AddSC_boss_warlord_kalithresh()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "mob_naga_distiller";
- newscript->GetAI = &GetAI_mob_naga_distiller;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_warlord_kalithresh";
- newscript->GetAI = &GetAI_boss_warlord_kalithresh;
- newscript->RegisterSelf();
+ new mob_naga_distiller();
+ new boss_warlord_kalithresh();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
index 3d089a3ecda..1bac450c981 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
@@ -37,197 +37,200 @@ EndScriptData */
2 - Mekgineer Steamrigger Event
3 - Warlord Kalithresh Event
*/
-
-bool GOHello_go_main_chambers_access_panel(Player* /*pPlayer*/, GameObject* pGo)
+ class go_main_chambers_access_panel : public GameObjectScript
{
- ScriptedInstance* pInstance = pGo->GetInstanceData();
-
- if (!pInstance)
- return false;
-
- if (pGo->GetEntry() == ACCESS_PANEL_HYDRO && (pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE || pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL))
- pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL);
+public:
+ go_main_chambers_access_panel() : GameObjectScript("go_main_chambers_access_panel") { }
- if (pGo->GetEntry() == ACCESS_PANEL_MEK && (pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE || pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL))
- pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL);
+ bool OnGossipHello(Player* /*pPlayer*/, GameObject* pGo)
+ {
+ InstanceScript* pInstance = pGo->GetInstanceScript();
- return true;
-}
+ if (!pInstance)
+ return false;
-struct instance_steam_vault : public ScriptedInstance
-{
- instance_steam_vault(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
+ if (pGo->GetEntry() == ACCESS_PANEL_HYDRO && (pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE || pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL))
+ pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL);
- uint32 m_auiEncounter[MAX_ENCOUNTER];
+ if (pGo->GetEntry() == ACCESS_PANEL_MEK && (pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE || pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL))
+ pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL);
- uint64 ThespiaGUID;
- uint64 MekgineerGUID;
- uint64 KalithreshGUID;
+ return true;
+ }
- uint64 MainChambersDoor;
- uint64 AccessPanelHydro;
- uint64 AccessPanelMek;
+};
+ class instance_steam_vault : public InstanceMapScript
+{
+public:
+ instance_steam_vault() : InstanceMapScript("instance_steam_vault") { }
- void Initialize()
+ InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
{
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
-
- ThespiaGUID = 0;
- MekgineerGUID = 0;
- KalithreshGUID = 0;
- MainChambersDoor = 0;
- AccessPanelHydro = 0;
- AccessPanelMek = 0;
+ return new instance_steam_vault_InstanceMapScript(pMap);
}
- bool IsEncounterInProgress() const
+ struct instance_steam_vault_InstanceMapScript : public InstanceScript
{
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS)
- return true;
+ instance_steam_vault_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
- return false;
- }
+ uint32 m_auiEncounter[MAX_ENCOUNTER];
- void OnCreatureCreate(Creature* pCreature, bool /*add*/)
- {
- switch(pCreature->GetEntry())
+ uint64 ThespiaGUID;
+ uint64 MekgineerGUID;
+ uint64 KalithreshGUID;
+
+ uint64 MainChambersDoor;
+ uint64 AccessPanelHydro;
+ uint64 AccessPanelMek;
+
+ void Initialize()
{
- case 17797: ThespiaGUID = pCreature->GetGUID(); break;
- case 17796: MekgineerGUID = pCreature->GetGUID(); break;
- case 17798: KalithreshGUID = pCreature->GetGUID(); break;
+ memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+
+ ThespiaGUID = 0;
+ MekgineerGUID = 0;
+ KalithreshGUID = 0;
+ MainChambersDoor = 0;
+ AccessPanelHydro = 0;
+ AccessPanelMek = 0;
}
- }
- void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
- {
- switch(pGo->GetEntry())
+ bool IsEncounterInProgress() const
{
- case MAIN_CHAMBERS_DOOR: MainChambersDoor = pGo->GetGUID(); break;
- case ACCESS_PANEL_HYDRO: AccessPanelHydro = pGo->GetGUID(); break;
- case ACCESS_PANEL_MEK: AccessPanelMek = pGo->GetGUID(); break;
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS)
+ return true;
+
+ return false;
}
- }
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
+ void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
- case TYPE_HYDROMANCER_THESPIA:
- if (data == SPECIAL)
- {
- HandleGameObject(AccessPanelHydro, true);
-
- if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)
- HandleGameObject(MainChambersDoor, true);
-
- sLog.outDebug("TSCR: Instance Steamvault: Access panel used.");
- }
- m_auiEncounter[0] = data;
- break;
- case TYPE_MEKGINEER_STEAMRIGGER:
- if (data == SPECIAL)
- {
- HandleGameObject(AccessPanelMek, true);
-
- if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)
- HandleGameObject(MainChambersDoor, true);
-
- sLog.outDebug("TSCR: Instance Steamvault: Access panel used.");
- }
- m_auiEncounter[1] = data;
- break;
- case TYPE_WARLORD_KALITHRESH:
- m_auiEncounter[2] = data;
- break;
- case TYPE_DISTILLER:
- m_auiEncounter[3] = data;
- break;
+ switch(pCreature->GetEntry())
+ {
+ case 17797: ThespiaGUID = pCreature->GetGUID(); break;
+ case 17796: MekgineerGUID = pCreature->GetGUID(); break;
+ case 17798: KalithreshGUID = pCreature->GetGUID(); break;
+ }
}
- if (data == DONE || data == SPECIAL)
- SaveToDB();
- }
+ void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
+ {
+ switch(pGo->GetEntry())
+ {
+ case MAIN_CHAMBERS_DOOR: MainChambersDoor = pGo->GetGUID(); break;
+ case ACCESS_PANEL_HYDRO: AccessPanelHydro = pGo->GetGUID(); break;
+ case ACCESS_PANEL_MEK: AccessPanelMek = pGo->GetGUID(); break;
+ }
+ }
- uint32 GetData(uint32 type)
- {
- switch(type)
+ void SetData(uint32 type, uint32 data)
{
- case TYPE_HYDROMANCER_THESPIA:
- return m_auiEncounter[0];
- case TYPE_MEKGINEER_STEAMRIGGER:
- return m_auiEncounter[1];
- case TYPE_WARLORD_KALITHRESH:
- return m_auiEncounter[2];
- case TYPE_DISTILLER:
- return m_auiEncounter[3];
+ switch(type)
+ {
+ case TYPE_HYDROMANCER_THESPIA:
+ if (data == SPECIAL)
+ {
+ HandleGameObject(AccessPanelHydro, true);
+
+ if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)
+ HandleGameObject(MainChambersDoor, true);
+
+ sLog.outDebug("TSCR: Instance Steamvault: Access panel used.");
+ }
+ m_auiEncounter[0] = data;
+ break;
+ case TYPE_MEKGINEER_STEAMRIGGER:
+ if (data == SPECIAL)
+ {
+ HandleGameObject(AccessPanelMek, true);
+
+ if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)
+ HandleGameObject(MainChambersDoor, true);
+
+ sLog.outDebug("TSCR: Instance Steamvault: Access panel used.");
+ }
+ m_auiEncounter[1] = data;
+ break;
+ case TYPE_WARLORD_KALITHRESH:
+ m_auiEncounter[2] = data;
+ break;
+ case TYPE_DISTILLER:
+ m_auiEncounter[3] = data;
+ break;
+ }
+
+ if (data == DONE || data == SPECIAL)
+ SaveToDB();
}
- return 0;
- }
- uint64 GetData64(uint32 data)
- {
- switch(data)
+ uint32 GetData(uint32 type)
{
- case DATA_THESPIA:
- return ThespiaGUID;
- case DATA_MEKGINEERSTEAMRIGGER:
- return MekgineerGUID;
- case DATA_KALITRESH:
- return KalithreshGUID;
+ switch(type)
+ {
+ case TYPE_HYDROMANCER_THESPIA:
+ return m_auiEncounter[0];
+ case TYPE_MEKGINEER_STEAMRIGGER:
+ return m_auiEncounter[1];
+ case TYPE_WARLORD_KALITHRESH:
+ return m_auiEncounter[2];
+ case TYPE_DISTILLER:
+ return m_auiEncounter[3];
+ }
+ return 0;
}
- return 0;
- }
- std::string GetSaveData()
- {
- OUT_SAVE_INST_DATA;
- std::ostringstream stream;
- stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if (out)
+ uint64 GetData64(uint32 data)
{
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
+ switch(data)
+ {
+ case DATA_THESPIA:
+ return ThespiaGUID;
+ case DATA_MEKGINEERSTEAMRIGGER:
+ return MekgineerGUID;
+ case DATA_KALITRESH:
+ return KalithreshGUID;
+ }
+ return 0;
}
- return NULL;
- }
- void Load(const char* in)
- {
- if (!in)
+ std::string GetSaveData()
{
- OUT_LOAD_INST_DATA_FAIL;
- return;
+ OUT_SAVE_INST_DATA;
+ std::ostringstream stream;
+ stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
+ char* out = new char[stream.str().length() + 1];
+ strcpy(out, stream.str().c_str());
+ if (out)
+ {
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return out;
+ }
+ return NULL;
}
- OUT_LOAD_INST_DATA(in);
- std::istringstream stream(in);
- stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3];
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS)
- m_auiEncounter[i] = NOT_STARTED;
- OUT_LOAD_INST_DATA_COMPLETE;
- }
+
+ void Load(const char* in)
+ {
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+ OUT_LOAD_INST_DATA(in);
+ std::istringstream stream(in);
+ stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3];
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS)
+ m_auiEncounter[i] = NOT_STARTED;
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+ };
+
};
-InstanceData* GetInstanceData_instance_steam_vault(Map* pMap)
-{
- return new instance_steam_vault(pMap);
-}
void AddSC_instance_steam_vault()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "go_main_chambers_access_panel";
- newscript->pGOHello = &GOHello_go_main_chambers_access_panel;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "instance_steam_vault";
- newscript->GetInstanceData = &GetInstanceData_instance_steam_vault;
- newscript->RegisterSelf();
+ new go_main_chambers_access_panel();
+ new instance_steam_vault();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
index 2fd078bc5ba..f5227158b92 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
@@ -27,130 +27,134 @@ EndScriptData */
#define SPELL_FOUL_SPORES 31673
#define SPELL_ACID_GEYSER 38739
-
-struct boss_hungarfenAI : public ScriptedAI
+ class boss_hungarfen : public CreatureScript
{
- boss_hungarfenAI(Creature *c) : ScriptedAI(c)
- {
- }
+public:
+ boss_hungarfen() : CreatureScript("boss_hungarfen") { }
- bool Root;
- uint32 Mushroom_Timer;
- uint32 AcidGeyser_Timer;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Root = false;
- Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode
- AcidGeyser_Timer = 10000;
+ return new boss_hungarfenAI (pCreature);
}
- void EnterCombat(Unit * /*who*/)
+ struct boss_hungarfenAI : public ScriptedAI
{
- }
+ boss_hungarfenAI(Creature *c) : ScriptedAI(c)
+ {
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ bool Root;
+ uint32 Mushroom_Timer;
+ uint32 AcidGeyser_Timer;
- if ((me->GetHealth()*100) / me->GetMaxHealth() <= 20)
+ void Reset()
{
- if (!Root)
- {
- DoCast(me, SPELL_FOUL_SPORES);
- Root = true;
- }
+ Root = false;
+ Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode
+ AcidGeyser_Timer = 10000;
}
- if (Mushroom_Timer <= diff)
+ void EnterCombat(Unit * /*who*/)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- me->SummonCreature(17990, pTarget->GetPositionX()+(rand()%8), pTarget->GetPositionY()+(rand()%8), pTarget->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
- else
- me->SummonCreature(17990, me->GetPositionX()+(rand()%8), me->GetPositionY()+(rand()%8), me->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
-
- Mushroom_Timer = 10000;
- } else Mushroom_Timer -= diff;
+ }
- if (AcidGeyser_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_ACID_GEYSER);
- AcidGeyser_Timer = 10000+rand()%7500;
- } else AcidGeyser_Timer -= diff;
+ if (!UpdateVictim())
+ return;
+
+ if ((me->GetHealth()*100) / me->GetMaxHealth() <= 20)
+ {
+ if (!Root)
+ {
+ DoCast(me, SPELL_FOUL_SPORES);
+ Root = true;
+ }
+ }
+
+ if (Mushroom_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ me->SummonCreature(17990, pTarget->GetPositionX()+(rand()%8), pTarget->GetPositionY()+(rand()%8), pTarget->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
+ else
+ me->SummonCreature(17990, me->GetPositionX()+(rand()%8), me->GetPositionY()+(rand()%8), me->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
+
+ Mushroom_Timer = 10000;
+ } else Mushroom_Timer -= diff;
+
+ if (AcidGeyser_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_ACID_GEYSER);
+ AcidGeyser_Timer = 10000+rand()%7500;
+ } else AcidGeyser_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_hungarfen(Creature* pCreature)
-{
- return new boss_hungarfenAI (pCreature);
-}
#define SPELL_SPORE_CLOUD 34168
#define SPELL_PUTRID_MUSHROOM 31690
#define SPELL_GROW 31698
-
-struct mob_underbog_mushroomAI : public ScriptedAI
+ class mob_underbog_mushroom : public CreatureScript
{
- mob_underbog_mushroomAI(Creature *c) : ScriptedAI(c) {}
+public:
+ mob_underbog_mushroom() : CreatureScript("mob_underbog_mushroom") { }
- bool Stop;
- uint32 Grow_Timer;
- uint32 Shrink_Timer;
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new mob_underbog_mushroomAI (pCreature);
+ }
- void Reset()
+ struct mob_underbog_mushroomAI : public ScriptedAI
{
- Stop = false;
- Grow_Timer = 0;
- Shrink_Timer = 20000;
+ mob_underbog_mushroomAI(Creature *c) : ScriptedAI(c) {}
- DoCast(me, SPELL_PUTRID_MUSHROOM, true);
- DoCast(me, SPELL_SPORE_CLOUD, true);
- }
+ bool Stop;
+ uint32 Grow_Timer;
+ uint32 Shrink_Timer;
- void MoveInLineOfSight(Unit * /*who*/) {}
+ void Reset()
+ {
+ Stop = false;
+ Grow_Timer = 0;
+ Shrink_Timer = 20000;
- void AttackStart(Unit* /*who*/) {}
+ DoCast(me, SPELL_PUTRID_MUSHROOM, true);
+ DoCast(me, SPELL_SPORE_CLOUD, true);
+ }
- void EnterCombat(Unit* /*who*/) {}
+ void MoveInLineOfSight(Unit * /*who*/) {}
- void UpdateAI(const uint32 diff)
- {
- if (Stop)
- return;
+ void AttackStart(Unit* /*who*/) {}
- if (Grow_Timer <= diff)
- {
- DoCast(me, SPELL_GROW);
- Grow_Timer = 3000;
- } else Grow_Timer -= diff;
+ void EnterCombat(Unit* /*who*/) {}
- if (Shrink_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- me->RemoveAurasDueToSpell(SPELL_GROW);
- Stop = true;
- } else Shrink_Timer -= diff;
- }
+ if (Stop)
+ return;
+
+ if (Grow_Timer <= diff)
+ {
+ DoCast(me, SPELL_GROW);
+ Grow_Timer = 3000;
+ } else Grow_Timer -= diff;
+
+ if (Shrink_Timer <= diff)
+ {
+ me->RemoveAurasDueToSpell(SPELL_GROW);
+ Stop = true;
+ } else Shrink_Timer -= diff;
+ }
+ };
+
};
-CreatureAI* GetAI_mob_underbog_mushroom(Creature* pCreature)
-{
- return new mob_underbog_mushroomAI (pCreature);
-}
void AddSC_boss_hungarfen()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "boss_hungarfen";
- newscript->GetAI = &GetAI_boss_hungarfen;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_underbog_mushroom";
- newscript->GetAI = &GetAI_mob_underbog_mushroom;
- newscript->RegisterSelf();
+ new boss_hungarfen();
+ new mob_underbog_mushroom();
}
-
diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
index a005d52cd84..cc300c639d1 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
@@ -34,154 +34,155 @@ EndScriptData */
#define SPELL_SUMMON_SPORE_STRIDER 38755
#define ENTRY_SPORE_STRIDER 22299
-
-struct boss_the_black_stalkerAI : public ScriptedAI
+ class boss_the_black_stalker : public CreatureScript
{
- boss_the_black_stalkerAI(Creature *c) : ScriptedAI(c)
- {
- }
+public:
+ boss_the_black_stalker() : CreatureScript("boss_the_black_stalker") { }
- uint32 SporeStriders_Timer;
- uint32 Levitate_Timer;
- uint32 ChainLightning_Timer;
- uint32 StaticCharge_Timer;
- uint64 LevitatedTarget;
- uint32 LevitatedTarget_Timer;
- bool InAir;
- uint32 check_Timer;
- std::list<uint64> Striders;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Levitate_Timer = 12000;
- ChainLightning_Timer = 6000;
- StaticCharge_Timer = 10000;
- SporeStriders_Timer = 10000+rand()%5000;
- check_Timer = 5000;
- LevitatedTarget = 0;
- LevitatedTarget_Timer = 0;
- Striders.clear();
+ return new boss_the_black_stalkerAI (pCreature);
}
- void EnterCombat(Unit * /*who*/) {}
-
- void JustSummoned(Creature *summon)
+ struct boss_the_black_stalkerAI : public ScriptedAI
{
- if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER)
+ boss_the_black_stalkerAI(Creature *c) : ScriptedAI(c)
{
- Striders.push_back(summon->GetGUID());
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
- summon->AI()->AttackStart(pTarget);
- else
- if (me->getVictim())
- summon->AI()->AttackStart(me->getVictim());
}
- }
- void JustDied(Unit * /*who*/)
- {
- for (std::list<uint64>::const_iterator i = Striders.begin(); i != Striders.end(); ++i)
- if (Creature *strider = Unit::GetCreature(*me, *i))
- strider->DisappearAndDie();
- }
+ uint32 SporeStriders_Timer;
+ uint32 Levitate_Timer;
+ uint32 ChainLightning_Timer;
+ uint32 StaticCharge_Timer;
+ uint64 LevitatedTarget;
+ uint32 LevitatedTarget_Timer;
+ bool InAir;
+ uint32 check_Timer;
+ std::list<uint64> Striders;
+
+ void Reset()
+ {
+ Levitate_Timer = 12000;
+ ChainLightning_Timer = 6000;
+ StaticCharge_Timer = 10000;
+ SporeStriders_Timer = 10000+rand()%5000;
+ check_Timer = 5000;
+ LevitatedTarget = 0;
+ LevitatedTarget_Timer = 0;
+ Striders.clear();
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void EnterCombat(Unit * /*who*/) {}
- // Evade if too far
- if (check_Timer <= diff)
+ void JustSummoned(Creature *summon)
{
- float x,y,z,o;
- me->GetHomePosition(x,y,z,o);
- if (!me->IsWithinDist3d(x,y,z, 60))
+ if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER)
{
- EnterEvadeMode();
- return;
+ Striders.push_back(summon->GetGUID());
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
+ summon->AI()->AttackStart(pTarget);
+ else
+ if (me->getVictim())
+ summon->AI()->AttackStart(me->getVictim());
}
- check_Timer = 1000;
- } else check_Timer -= diff;
+ }
- // Spore Striders
- if (IsHeroic() && SporeStriders_Timer <= diff)
+ void JustDied(Unit * /*who*/)
{
- DoCast(me, SPELL_SUMMON_SPORE_STRIDER);
- SporeStriders_Timer = 10000+rand()%5000;
- } else SporeStriders_Timer -= diff;
+ for (std::list<uint64>::const_iterator i = Striders.begin(); i != Striders.end(); ++i)
+ if (Creature *strider = Unit::GetCreature(*me, *i))
+ strider->DisappearAndDie();
+ }
- // Levitate
- if (LevitatedTarget)
+ void UpdateAI(const uint32 diff)
{
- if (LevitatedTarget_Timer <= diff)
+ if (!UpdateVictim())
+ return;
+
+ // Evade if too far
+ if (check_Timer <= diff)
{
- if (Unit *pTarget = Unit::GetUnit(*me, LevitatedTarget))
+ float x,y,z,o;
+ me->GetHomePosition(x,y,z,o);
+ if (!me->IsWithinDist3d(x,y,z, 60))
{
- if (!pTarget->HasAura(SPELL_LEVITATE))
- {
- LevitatedTarget = 0;
- return;
- }
- if (InAir)
+ EnterEvadeMode();
+ return;
+ }
+ check_Timer = 1000;
+ } else check_Timer -= diff;
+
+ // Spore Striders
+ if (IsHeroic() && SporeStriders_Timer <= diff)
+ {
+ DoCast(me, SPELL_SUMMON_SPORE_STRIDER);
+ SporeStriders_Timer = 10000+rand()%5000;
+ } else SporeStriders_Timer -= diff;
+
+ // Levitate
+ if (LevitatedTarget)
+ {
+ if (LevitatedTarget_Timer <= diff)
+ {
+ if (Unit *pTarget = Unit::GetUnit(*me, LevitatedTarget))
{
- pTarget->AddAura(SPELL_SUSPENSION, pTarget);
- LevitatedTarget = 0;
+ if (!pTarget->HasAura(SPELL_LEVITATE))
+ {
+ LevitatedTarget = 0;
+ return;
+ }
+ if (InAir)
+ {
+ pTarget->AddAura(SPELL_SUSPENSION, pTarget);
+ LevitatedTarget = 0;
+ }
+ else
+ {
+ pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true);
+ InAir = true;
+ LevitatedTarget_Timer = 1500;
+ }
}
else
- {
- pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true);
- InAir = true;
- LevitatedTarget_Timer = 1500;
- }
+ LevitatedTarget = 0;
+ } else LevitatedTarget_Timer -= diff;
+ }
+ if (Levitate_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
+ {
+ DoCast(pTarget, SPELL_LEVITATE);
+ LevitatedTarget = pTarget->GetGUID();
+ LevitatedTarget_Timer = 2000;
+ InAir = false;
}
- else
- LevitatedTarget = 0;
- } else LevitatedTarget_Timer -= diff;
- }
- if (Levitate_Timer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
+ Levitate_Timer = 12000+rand()%3000;
+ } else Levitate_Timer -= diff;
+
+ // Chain Lightning
+ if (ChainLightning_Timer <= diff)
{
- DoCast(pTarget, SPELL_LEVITATE);
- LevitatedTarget = pTarget->GetGUID();
- LevitatedTarget_Timer = 2000;
- InAir = false;
- }
- Levitate_Timer = 12000+rand()%3000;
- } else Levitate_Timer -= diff;
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
+ ChainLightning_Timer = 7000;
+ } else ChainLightning_Timer -= diff;
- // Chain Lightning
- if (ChainLightning_Timer <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
- ChainLightning_Timer = 7000;
- } else ChainLightning_Timer -= diff;
+ // Static Charge
+ if (StaticCharge_Timer <= diff)
+ {
+ if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,30,true))
+ DoCast(pTarget, SPELL_STATIC_CHARGE);
+ StaticCharge_Timer = 10000;
+ } else StaticCharge_Timer -= diff;
- // Static Charge
- if (StaticCharge_Timer <= diff)
- {
- if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,30,true))
- DoCast(pTarget, SPELL_STATIC_CHARGE);
- StaticCharge_Timer = 10000;
- } else StaticCharge_Timer -= diff;
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_the_black_stalker(Creature* pCreature)
-{
- return new boss_the_black_stalkerAI (pCreature);
-}
void AddSC_boss_the_black_stalker()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "boss_the_black_stalker";
- newscript->GetAI = &GetAI_boss_the_black_stalker;
- newscript->RegisterSelf();
+ new boss_the_black_stalker();
}
-
diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
index 8d25155f14a..aeaad60b885 100644
--- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
+++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
@@ -53,205 +53,207 @@ enum eEnums
SPELL_MAGNETIC_PULL = 28337,
SPELL_KNOCK_BACK = 24199, //Knockback spell until correct implementation is made
};
-
-struct boss_gruulAI : public ScriptedAI
+ class boss_gruul : public CreatureScript
{
- boss_gruulAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_gruul() : CreatureScript("boss_gruul") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new boss_gruulAI (pCreature);
}
- ScriptedInstance *pInstance;
-
- uint32 m_uiGrowth_Timer;
- uint32 m_uiCaveIn_Timer;
- uint32 m_uiCaveIn_StaticTimer;
- uint32 m_uiGroundSlamTimer;
- uint32 m_uiHurtfulStrike_Timer;
- uint32 m_uiReverberation_Timer;
+ struct boss_gruulAI : public ScriptedAI
+ {
+ boss_gruulAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- bool m_bPerformingGroundSlam;
+ InstanceScript *pInstance;
- void Reset()
- {
- m_uiGrowth_Timer= 30000;
- m_uiCaveIn_Timer= 27000;
- m_uiCaveIn_StaticTimer = 30000;
- m_uiGroundSlamTimer= 35000;
- m_bPerformingGroundSlam= false;
- m_uiHurtfulStrike_Timer= 8000;
- m_uiReverberation_Timer= 60000+45000;
-
- if (pInstance)
- pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED);
- }
+ uint32 m_uiGrowth_Timer;
+ uint32 m_uiCaveIn_Timer;
+ uint32 m_uiCaveIn_StaticTimer;
+ uint32 m_uiGroundSlamTimer;
+ uint32 m_uiHurtfulStrike_Timer;
+ uint32 m_uiReverberation_Timer;
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
+ bool m_bPerformingGroundSlam;
- if (pInstance)
- pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS);
- }
+ void Reset()
+ {
+ m_uiGrowth_Timer= 30000;
+ m_uiCaveIn_Timer= 27000;
+ m_uiCaveIn_StaticTimer = 30000;
+ m_uiGroundSlamTimer= 35000;
+ m_bPerformingGroundSlam= false;
+ m_uiHurtfulStrike_Timer= 8000;
+ m_uiReverberation_Timer= 60000+45000;
+
+ if (pInstance)
+ pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED);
+ }
- void KilledUnit()
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
- }
+ void EnterCombat(Unit * /*who*/)
+ {
+ DoScriptText(SAY_AGGRO, me);
- void JustDied(Unit* /*Killer*/)
- {
- DoScriptText(SAY_DEATH, me);
+ if (pInstance)
+ pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS);
+ }
- if (pInstance)
+ void KilledUnit()
{
- pInstance->SetData(DATA_GRUULEVENT, DONE);
- pInstance->HandleGameObject(pInstance->GetData64(DATA_GRUULDOOR), true); // Open the encounter door
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
- }
- void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell)
- {
- //This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction
- //It's initially wrong, since this will cause fall damage, which is by comments, not intended.
- if (pSpell->Id == SPELL_GROUND_SLAM)
+ void JustDied(Unit* /*Killer*/)
{
- if (pTarget->GetTypeId() == TYPEID_PLAYER)
+ DoScriptText(SAY_DEATH, me);
+
+ if (pInstance)
{
- switch (urand(0,1))
- {
- case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); break;
- case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); break;
- }
+ pInstance->SetData(DATA_GRUULEVENT, DONE);
+ pInstance->HandleGameObject(pInstance->GetData64(DATA_GRUULDOOR), true); // Open the encounter door
}
}
- //this part should be in the core
- if (pSpell->Id == SPELL_SHATTER)
+ void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell)
{
- //this spell must have custom handling in the core, dealing damage based on distance
- pTarget->CastSpell(pTarget, SPELL_SHATTER_EFFECT, true);
-
- if (pTarget->HasAura(SPELL_STONED))
- pTarget->RemoveAurasDueToSpell(SPELL_STONED);
+ //This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction
+ //It's initially wrong, since this will cause fall damage, which is by comments, not intended.
+ if (pSpell->Id == SPELL_GROUND_SLAM)
+ {
+ if (pTarget->GetTypeId() == TYPEID_PLAYER)
+ {
+ switch (urand(0,1))
+ {
+ case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); break;
+ case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); break;
+ }
+ }
+ }
- //clear this, if we are still performing
- if (m_bPerformingGroundSlam)
+ //this part should be in the core
+ if (pSpell->Id == SPELL_SHATTER)
{
- m_bPerformingGroundSlam = false;
+ //this spell must have custom handling in the core, dealing damage based on distance
+ pTarget->CastSpell(pTarget, SPELL_SHATTER_EFFECT, true);
+
+ if (pTarget->HasAura(SPELL_STONED))
+ pTarget->RemoveAurasDueToSpell(SPELL_STONED);
- //and correct movement, if not already
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ //clear this, if we are still performing
+ if (m_bPerformingGroundSlam)
{
- if (me->getVictim())
- me->GetMotionMaster()->MoveChase(me->getVictim());
+ m_bPerformingGroundSlam = false;
+
+ //and correct movement, if not already
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ {
+ if (me->getVictim())
+ me->GetMotionMaster()->MoveChase(me->getVictim());
+ }
}
}
}
- }
-
- void UpdateAI(const uint32 uiDiff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
- // Growth
- // Gruul can cast this spell up to 30 times
- if (m_uiGrowth_Timer <= uiDiff)
+ void UpdateAI(const uint32 uiDiff)
{
- DoScriptText(EMOTE_GROW, me);
- DoCast(me, SPELL_GROWTH);
- m_uiGrowth_Timer = 30000;
- }
- else
- m_uiGrowth_Timer -= uiDiff;
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- if (m_bPerformingGroundSlam)
- {
- if (m_uiGroundSlamTimer <= uiDiff)
+ // Growth
+ // Gruul can cast this spell up to 30 times
+ if (m_uiGrowth_Timer <= uiDiff)
+ {
+ DoScriptText(EMOTE_GROW, me);
+ DoCast(me, SPELL_GROWTH);
+ m_uiGrowth_Timer = 30000;
+ }
+ else
+ m_uiGrowth_Timer -= uiDiff;
+
+ if (m_bPerformingGroundSlam)
{
- m_uiGroundSlamTimer =120000;
- m_uiHurtfulStrike_Timer= 8000;
+ if (m_uiGroundSlamTimer <= uiDiff)
+ {
+ m_uiGroundSlamTimer =120000;
+ m_uiHurtfulStrike_Timer= 8000;
- if (m_uiReverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter
- m_uiReverberation_Timer += 10000;
+ if (m_uiReverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter
+ m_uiReverberation_Timer += 10000;
- DoCast(me, SPELL_SHATTER);
+ DoCast(me, SPELL_SHATTER);
+ }
+ else
+ m_uiGroundSlamTimer -= uiDiff;
}
else
- m_uiGroundSlamTimer -= uiDiff;
- }
- else
- {
- // Hurtful Strike
- if (m_uiHurtfulStrike_Timer <= uiDiff)
{
- Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+ // Hurtful Strike
+ if (m_uiHurtfulStrike_Timer <= uiDiff)
+ {
+ Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- if (pTarget && me->IsWithinMeleeRange(me->getVictim()))
- DoCast(pTarget, SPELL_HURTFUL_STRIKE);
+ if (pTarget && me->IsWithinMeleeRange(me->getVictim()))
+ DoCast(pTarget, SPELL_HURTFUL_STRIKE);
+ else
+ DoCast(me->getVictim(), SPELL_HURTFUL_STRIKE);
+
+ m_uiHurtfulStrike_Timer= 8000;
+ }
else
- DoCast(me->getVictim(), SPELL_HURTFUL_STRIKE);
+ m_uiHurtfulStrike_Timer -= uiDiff;
- m_uiHurtfulStrike_Timer= 8000;
- }
- else
- m_uiHurtfulStrike_Timer -= uiDiff;
+ // Reverberation
+ if (m_uiReverberation_Timer <= uiDiff)
+ {
+ DoCast(me->getVictim(), SPELL_REVERBERATION, true);
+ m_uiReverberation_Timer = 15000 + rand()%10000;
+ }
+ else
+ m_uiReverberation_Timer -= uiDiff;
- // Reverberation
- if (m_uiReverberation_Timer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_REVERBERATION, true);
- m_uiReverberation_Timer = 15000 + rand()%10000;
- }
- else
- m_uiReverberation_Timer -= uiDiff;
+ // Cave In
+ if (m_uiCaveIn_Timer <= uiDiff)
+ {
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(pTarget, SPELL_CAVE_IN);
- // Cave In
- if (m_uiCaveIn_Timer <= uiDiff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(pTarget, SPELL_CAVE_IN);
+ if (m_uiCaveIn_StaticTimer >= 4000)
+ m_uiCaveIn_StaticTimer -= 2000;
- if (m_uiCaveIn_StaticTimer >= 4000)
- m_uiCaveIn_StaticTimer -= 2000;
+ m_uiCaveIn_Timer = m_uiCaveIn_StaticTimer;
+ }
+ else
+ m_uiCaveIn_Timer -= uiDiff;
- m_uiCaveIn_Timer = m_uiCaveIn_StaticTimer;
- }
- else
- m_uiCaveIn_Timer -= uiDiff;
+ // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter
+ if (m_uiGroundSlamTimer <= uiDiff)
+ {
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveIdle();
- // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter
- if (m_uiGroundSlamTimer <= uiDiff)
- {
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MoveIdle();
+ m_bPerformingGroundSlam= true;
+ m_uiGroundSlamTimer = 10000;
- m_bPerformingGroundSlam= true;
- m_uiGroundSlamTimer = 10000;
+ DoCast(me, SPELL_GROUND_SLAM);
+ }
+ else
+ m_uiGroundSlamTimer -= uiDiff;
- DoCast(me, SPELL_GROUND_SLAM);
+ DoMeleeAttackIfReady();
}
- else
- m_uiGroundSlamTimer -= uiDiff;
-
- DoMeleeAttackIfReady();
}
- }
+ };
+
};
-CreatureAI* GetAI_boss_gruul(Creature* pCreature)
-{
- return new boss_gruulAI (pCreature);
-}
void AddSC_boss_gruul()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_gruul";
- newscript->GetAI = &GetAI_boss_gruul;
- newscript->RegisterSelf();
+ new boss_gruul();
}
-
diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp
index a2824a6fd16..a5a82e8cc86 100644
--- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp
+++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp
@@ -67,7 +67,7 @@ EndScriptData */
#define SPELL_SPELLSHIELD 33054
#define SPELL_BLAST_WAVE 33061
-bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* me)
+bool CheckAllBossDied(InstanceScript* pInstance, Creature* me)
{
if (!pInstance || !me)
return false;
@@ -105,681 +105,688 @@ bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* me)
return false;
}
-//High King Maulgar AI
-struct boss_high_king_maulgarAI : public ScriptedAI
+//High King Maulgar AI class boss_high_king_maulgar : public CreatureScript
{
- boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_high_king_maulgar() : CreatureScript("boss_high_king_maulgar") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
- for (uint8 i = 0; i < 4; ++i)
- Council[i] = 0;
+ return new boss_high_king_maulgarAI (pCreature);
}
- ScriptedInstance* pInstance;
+ struct boss_high_king_maulgarAI : public ScriptedAI
+ {
+ boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ for (uint8 i = 0; i < 4; ++i)
+ Council[i] = 0;
+ }
- uint32 ArcingSmash_Timer;
- uint32 MightyBlow_Timer;
- uint32 Whirlwind_Timer;
- uint32 Charging_Timer;
- uint32 Roar_Timer;
+ InstanceScript* pInstance;
- bool Phase2;
+ uint32 ArcingSmash_Timer;
+ uint32 MightyBlow_Timer;
+ uint32 Whirlwind_Timer;
+ uint32 Charging_Timer;
+ uint32 Roar_Timer;
- uint64 Council[4];
+ bool Phase2;
- void Reset()
- {
- ArcingSmash_Timer = 10000;
- MightyBlow_Timer = 40000;
- Whirlwind_Timer = 30000;
- Charging_Timer = 0;
- Roar_Timer = 0;
+ uint64 Council[4];
- DoCast(me, SPELL_DUAL_WIELD, false);
+ void Reset()
+ {
+ ArcingSmash_Timer = 10000;
+ MightyBlow_Timer = 40000;
+ Whirlwind_Timer = 30000;
+ Charging_Timer = 0;
+ Roar_Timer = 0;
- Phase2 = false;
+ DoCast(me, SPELL_DUAL_WIELD, false);
- Creature *pCreature = NULL;
- for (uint8 i = 0; i < 4; ++i)
- {
- if (Council[i])
+ Phase2 = false;
+
+ Creature *pCreature = NULL;
+ for (uint8 i = 0; i < 4; ++i)
{
- pCreature = (Unit::GetCreature((*me), Council[i]));
- if (pCreature && !pCreature->isAlive())
+ if (Council[i])
{
- pCreature->Respawn();
- pCreature->AI()->EnterEvadeMode();
+ pCreature = (Unit::GetCreature((*me), Council[i]));
+ if (pCreature && !pCreature->isAlive())
+ {
+ pCreature->Respawn();
+ pCreature->AI()->EnterEvadeMode();
+ }
}
}
- }
-
- //reset encounter
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
- }
-
- void KilledUnit()
- {
- DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
- }
-
- void JustDied(Unit* /*Killer*/)
- {
- DoScriptText(SAY_DEATH, me);
- if (CheckAllBossDied(pInstance, me))
- pInstance->SetData(DATA_MAULGAREVENT, DONE);
- }
-
- void AddDeath()
- {
- DoScriptText(RAND(SAY_OGRE_DEATH1,SAY_OGRE_DEATH2,SAY_OGRE_DEATH3,SAY_OGRE_DEATH4), me);
- }
-
- void EnterCombat(Unit *who)
- {
- StartEvent(who);
- }
+ //reset encounter
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
+ }
- void GetCouncil()
- {
- if (pInstance)
+ void KilledUnit()
{
- //get council member's guid to respawn them if needed
- Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED);
- Council[1] = pInstance->GetData64(DATA_BLINDEYETHESEER);
- Council[2] = pInstance->GetData64(DATA_OLMTHESUMMONER);
- Council[3] = pInstance->GetData64(DATA_KROSHFIREHAND);
+ DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
- }
- void StartEvent(Unit *who)
- {
- if (!pInstance)
- return;
-
- GetCouncil();
-
- DoScriptText(SAY_AGGRO, me);
+ void JustDied(Unit* /*Killer*/)
+ {
+ DoScriptText(SAY_DEATH, me);
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
+ if (CheckAllBossDied(pInstance, me))
+ pInstance->SetData(DATA_MAULGAREVENT, DONE);
+ }
- DoZoneInCombat();
- }
+ void AddDeath()
+ {
+ DoScriptText(RAND(SAY_OGRE_DEATH1,SAY_OGRE_DEATH2,SAY_OGRE_DEATH3,SAY_OGRE_DEATH4), me);
+ }
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ void EnterCombat(Unit *who)
{
- Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
-
- if (pTarget)
- {
- AttackStart(pTarget);
- GetCouncil();
- }
+ StartEvent(who);
}
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //someone evaded!
- if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ void GetCouncil()
{
- EnterEvadeMode();
- return;
+ if (pInstance)
+ {
+ //get council member's guid to respawn them if needed
+ Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED);
+ Council[1] = pInstance->GetData64(DATA_BLINDEYETHESEER);
+ Council[2] = pInstance->GetData64(DATA_OLMTHESUMMONER);
+ Council[3] = pInstance->GetData64(DATA_KROSHFIREHAND);
+ }
}
- //ArcingSmash_Timer
- if (ArcingSmash_Timer <= diff)
+ void StartEvent(Unit *who)
{
- DoCast(me->getVictim(), SPELL_ARCING_SMASH);
- ArcingSmash_Timer = 10000;
- } else ArcingSmash_Timer -= diff;
+ if (!pInstance)
+ return;
- //Whirlwind_Timer
- if (Whirlwind_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_WHIRLWIND);
- Whirlwind_Timer = 55000;
- } else Whirlwind_Timer -= diff;
+ GetCouncil();
- //MightyBlow_Timer
- if (MightyBlow_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_MIGHTY_BLOW);
- MightyBlow_Timer = 30000+rand()%10000;
- } else MightyBlow_Timer -= diff;
+ DoScriptText(SAY_AGGRO, me);
- //Entering Phase 2
- if (!Phase2 && (me->GetHealth()*100 / me->GetMaxHealth()) < 50)
- {
- Phase2 = true;
- DoScriptText(SAY_ENRAGE, me);
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
- DoCast(me, SPELL_DUAL_WIELD, true);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
- me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ DoZoneInCombat();
}
- if (Phase2)
+ void UpdateAI(const uint32 diff)
{
- //Charging_Timer
- if (Charging_Timer <= diff)
+ //Only if not incombat check if the event is started
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
{
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+
if (pTarget)
{
AttackStart(pTarget);
- DoCast(pTarget, SPELL_BERSERKER_C);
+ GetCouncil();
}
- Charging_Timer = 20000;
- } else Charging_Timer -= diff;
+ }
- //Intimidating Roar
- if (Roar_Timer <= diff)
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ //someone evaded!
+ if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ EnterEvadeMode();
+ return;
+ }
+
+ //ArcingSmash_Timer
+ if (ArcingSmash_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ARCING_SMASH);
+ ArcingSmash_Timer = 10000;
+ } else ArcingSmash_Timer -= diff;
+
+ //Whirlwind_Timer
+ if (Whirlwind_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_WHIRLWIND);
+ Whirlwind_Timer = 55000;
+ } else Whirlwind_Timer -= diff;
+
+ //MightyBlow_Timer
+ if (MightyBlow_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_MIGHTY_BLOW);
+ MightyBlow_Timer = 30000+rand()%10000;
+ } else MightyBlow_Timer -= diff;
+
+ //Entering Phase 2
+ if (!Phase2 && (me->GetHealth()*100 / me->GetMaxHealth()) < 50)
+ {
+ Phase2 = true;
+ DoScriptText(SAY_ENRAGE, me);
+
+ DoCast(me, SPELL_DUAL_WIELD, true);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ }
+
+ if (Phase2)
{
- DoCast(me, SPELL_ROAR);
- Roar_Timer = 40000+(rand()%10000);
- } else Roar_Timer -= diff;
+ //Charging_Timer
+ if (Charging_Timer <= diff)
+ {
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget)
+ {
+ AttackStart(pTarget);
+ DoCast(pTarget, SPELL_BERSERKER_C);
+ }
+ Charging_Timer = 20000;
+ } else Charging_Timer -= diff;
+
+ //Intimidating Roar
+ if (Roar_Timer <= diff)
+ {
+ DoCast(me, SPELL_ROAR);
+ Roar_Timer = 40000+(rand()%10000);
+ } else Roar_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
- }
};
-//Olm The Summoner AI
-struct boss_olm_the_summonerAI : public ScriptedAI
+//Olm The Summoner AI class boss_olm_the_summoner : public CreatureScript
{
- boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c)
+public:
+ boss_olm_the_summoner() : CreatureScript("boss_olm_the_summoner") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pInstance = c->GetInstanceData();
+ return new boss_olm_the_summonerAI (pCreature);
}
- uint32 DarkDecay_Timer;
- uint32 Summon_Timer;
- uint32 DeathCoil_Timer;
+ struct boss_olm_the_summonerAI : public ScriptedAI
+ {
+ boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceScript();
+ }
- ScriptedInstance* pInstance;
+ uint32 DarkDecay_Timer;
+ uint32 Summon_Timer;
+ uint32 DeathCoil_Timer;
- void Reset()
- {
- DarkDecay_Timer = 10000;
- Summon_Timer = 15000;
- DeathCoil_Timer = 20000;
+ InstanceScript* pInstance;
- //reset encounter
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
- }
+ void Reset()
+ {
+ DarkDecay_Timer = 10000;
+ Summon_Timer = 15000;
+ DeathCoil_Timer = 20000;
- void AttackStart(Unit* pWho)
- {
- if (!pWho)
- return;
+ //reset encounter
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
+ }
- if (me->Attack(pWho, true))
+ void AttackStart(Unit* pWho)
{
- me->AddThreat(pWho, 0.0f);
- me->SetInCombatWith(pWho);
- pWho->SetInCombatWith(me);
+ if (!pWho)
+ return;
+
+ if (me->Attack(pWho, true))
+ {
+ me->AddThreat(pWho, 0.0f);
+ me->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(me);
- me->GetMotionMaster()->MoveChase(pWho, 30.0f);
+ me->GetMotionMaster()->MoveChase(pWho, 30.0f);
+ }
}
- }
- void EnterCombat(Unit *who)
- {
- if (pInstance)
+ void EnterCombat(Unit *who)
{
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
+ if (pInstance)
+ {
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
+ }
}
- }
- void JustDied(Unit* /*Killer*/)
- {
- if (pInstance)
+ void JustDied(Unit* /*Killer*/)
{
- Creature *Maulgar = NULL;
- Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
+ if (pInstance)
+ {
+ Creature *Maulgar = NULL;
+ Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
- if (Maulgar)
- CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
+ if (Maulgar)
+ CAST_AI(boss_high_king_maulgar::boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
- if (CheckAllBossDied(pInstance, me))
- pInstance->SetData(DATA_MAULGAREVENT, DONE);
+ if (CheckAllBossDied(pInstance, me))
+ pInstance->SetData(DATA_MAULGAREVENT, DONE);
+ }
}
- }
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ void UpdateAI(const uint32 diff)
{
- Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
-
- if (pTarget)
+ //Only if not incombat check if the event is started
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
{
- AttackStart(pTarget);
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+
+ if (pTarget)
+ {
+ AttackStart(pTarget);
+ }
}
- }
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- //someone evaded!
- if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
- {
- EnterEvadeMode();
- return;
- }
+ //someone evaded!
+ if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ EnterEvadeMode();
+ return;
+ }
- //DarkDecay_Timer
- if (DarkDecay_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_DARK_DECAY);
- DarkDecay_Timer = 20000;
- } else DarkDecay_Timer -= diff;
+ //DarkDecay_Timer
+ if (DarkDecay_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_DARK_DECAY);
+ DarkDecay_Timer = 20000;
+ } else DarkDecay_Timer -= diff;
- //Summon_Timer
- if (Summon_Timer <= diff)
- {
- DoCast(me, SPELL_SUMMON_WFH);
- Summon_Timer = 30000;
- } else Summon_Timer -= diff;
+ //Summon_Timer
+ if (Summon_Timer <= diff)
+ {
+ DoCast(me, SPELL_SUMMON_WFH);
+ Summon_Timer = 30000;
+ } else Summon_Timer -= diff;
- //DeathCoil Timer /need correct timer
- if (DeathCoil_Timer <= diff)
- {
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget)
- DoCast(pTarget, SPELL_DEATH_COIL);
- DeathCoil_Timer = 20000;
- } else DeathCoil_Timer -= diff;
+ //DeathCoil Timer /need correct timer
+ if (DeathCoil_Timer <= diff)
+ {
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget)
+ DoCast(pTarget, SPELL_DEATH_COIL);
+ DeathCoil_Timer = 20000;
+ } else DeathCoil_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-//Kiggler The Crazed AI
-struct boss_kiggler_the_crazedAI : public ScriptedAI
+//Kiggler The Crazed AI class boss_kiggler_the_crazed : public CreatureScript
{
- boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- }
+public:
+ boss_kiggler_the_crazed() : CreatureScript("boss_kiggler_the_crazed") { }
- uint32 GreaterPolymorph_Timer;
- uint32 LightningBolt_Timer;
- uint32 ArcaneShock_Timer;
- uint32 ArcaneExplosion_Timer;
-
- ScriptedInstance* pInstance;
-
- void Reset()
+ CreatureAI *GetAI(Creature* pCreature)
{
- GreaterPolymorph_Timer = 5000;
- LightningBolt_Timer = 10000;
- ArcaneShock_Timer = 20000;
- ArcaneExplosion_Timer = 30000;
-
- //reset encounter
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
+ return new boss_kiggler_the_crazedAI (pCreature);
}
- void EnterCombat(Unit* who)
+ struct boss_kiggler_the_crazedAI : public ScriptedAI
{
- if (pInstance)
+ boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c)
{
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
+ pInstance = c->GetInstanceScript();
}
- }
- void JustDied(Unit* /*Killer*/)
- {
- if (pInstance)
- {
- Creature *Maulgar = NULL;
- Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
+ uint32 GreaterPolymorph_Timer;
+ uint32 LightningBolt_Timer;
+ uint32 ArcaneShock_Timer;
+ uint32 ArcaneExplosion_Timer;
- if (Maulgar)
- CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
+ InstanceScript* pInstance;
- if (CheckAllBossDied(pInstance, me))
- pInstance->SetData(DATA_MAULGAREVENT, DONE);
+ void Reset()
+ {
+ GreaterPolymorph_Timer = 5000;
+ LightningBolt_Timer = 10000;
+ ArcaneShock_Timer = 20000;
+ ArcaneExplosion_Timer = 30000;
+
+ //reset encounter
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
}
- }
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ void EnterCombat(Unit* who)
{
- Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
-
- if (pTarget)
+ if (pInstance)
{
- AttackStart(pTarget);
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
}
}
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //someone evaded!
- if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ void JustDied(Unit* /*Killer*/)
{
- EnterEvadeMode();
- return;
+ if (pInstance)
+ {
+ Creature *Maulgar = NULL;
+ Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
+
+ if (Maulgar)
+ CAST_AI(boss_high_king_maulgar::boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
+
+ if (CheckAllBossDied(pInstance, me))
+ pInstance->SetData(DATA_MAULGAREVENT, DONE);
+ }
}
- //GreaterPolymorph_Timer
- if (GreaterPolymorph_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (pTarget)
- DoCast(pTarget, SPELL_GREATER_POLYMORPH);
+ //Only if not incombat check if the event is started
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
- GreaterPolymorph_Timer = 15000 + rand()%5000;
- } else GreaterPolymorph_Timer -= diff;
+ if (pTarget)
+ {
+ AttackStart(pTarget);
+ }
+ }
- //LightningBolt_Timer
- if (LightningBolt_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT);
- LightningBolt_Timer = 15000;
- } else LightningBolt_Timer -= diff;
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- //ArcaneShock_Timer
- if (ArcaneShock_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_ARCANE_SHOCK);
- ArcaneShock_Timer = 20000;
- } else ArcaneShock_Timer -= diff;
+ //someone evaded!
+ if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ EnterEvadeMode();
+ return;
+ }
- //ArcaneExplosion_Timer
- if (ArcaneExplosion_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
- ArcaneExplosion_Timer = 30000;
- } else ArcaneExplosion_Timer -= diff;
+ //GreaterPolymorph_Timer
+ if (GreaterPolymorph_Timer <= diff)
+ {
+ Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (pTarget)
+ DoCast(pTarget, SPELL_GREATER_POLYMORPH);
- DoMeleeAttackIfReady();
- }
-};
+ GreaterPolymorph_Timer = 15000 + rand()%5000;
+ } else GreaterPolymorph_Timer -= diff;
-//Blindeye The Seer AI
-struct boss_blindeye_the_seerAI : public ScriptedAI
-{
- boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- }
+ //LightningBolt_Timer
+ if (LightningBolt_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT);
+ LightningBolt_Timer = 15000;
+ } else LightningBolt_Timer -= diff;
- uint32 GreaterPowerWordShield_Timer;
- uint32 Heal_Timer;
- uint32 PrayerofHealing_Timer;
+ //ArcaneShock_Timer
+ if (ArcaneShock_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ARCANE_SHOCK);
+ ArcaneShock_Timer = 20000;
+ } else ArcaneShock_Timer -= diff;
- ScriptedInstance* pInstance;
+ //ArcaneExplosion_Timer
+ if (ArcaneExplosion_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
+ ArcaneExplosion_Timer = 30000;
+ } else ArcaneExplosion_Timer -= diff;
- void Reset()
- {
- GreaterPowerWordShield_Timer = 5000;
- Heal_Timer = 25000 + rand()%15000;
- PrayerofHealing_Timer = 45000 + rand()%10000;
+ DoMeleeAttackIfReady();
+ }
+ };
- //reset encounter
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
- }
+};
+
+//Blindeye The Seer AI class boss_blindeye_the_seer : public CreatureScript
+{
+public:
+ boss_blindeye_the_seer() : CreatureScript("boss_blindeye_the_seer") { }
- void EnterCombat(Unit * who)
+ CreatureAI *GetAI(Creature* pCreature)
{
- if (pInstance)
- {
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
- }
+ return new boss_blindeye_the_seerAI (pCreature);
}
- void JustDied(Unit* /*Killer*/)
+ struct boss_blindeye_the_seerAI : public ScriptedAI
{
- if (pInstance)
+ boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c)
{
- Creature *Maulgar = NULL;
- Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
+ pInstance = c->GetInstanceScript();
+ }
- if (Maulgar)
- CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
+ uint32 GreaterPowerWordShield_Timer;
+ uint32 Heal_Timer;
+ uint32 PrayerofHealing_Timer;
- if (CheckAllBossDied(pInstance, me))
- pInstance->SetData(DATA_MAULGAREVENT, DONE);
- }
- }
+ InstanceScript* pInstance;
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ void Reset()
{
- Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+ GreaterPowerWordShield_Timer = 5000;
+ Heal_Timer = 25000 + rand()%15000;
+ PrayerofHealing_Timer = 45000 + rand()%10000;
+
+ //reset encounter
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
+ }
- if (pTarget)
+ void EnterCombat(Unit * who)
+ {
+ if (pInstance)
{
- AttackStart(pTarget);
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
}
}
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //someone evaded!
- if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ void JustDied(Unit* /*Killer*/)
{
- EnterEvadeMode();
- return;
+ if (pInstance)
+ {
+ Creature *Maulgar = NULL;
+ Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
+
+ if (Maulgar)
+ CAST_AI(boss_high_king_maulgar::boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
+
+ if (CheckAllBossDied(pInstance, me))
+ pInstance->SetData(DATA_MAULGAREVENT, DONE);
+ }
}
- //GreaterPowerWordShield_Timer
- if (GreaterPowerWordShield_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me, SPELL_GREATER_PW_SHIELD);
- GreaterPowerWordShield_Timer = 40000;
- } else GreaterPowerWordShield_Timer -= diff;
+ //Only if not incombat check if the event is started
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
- //Heal_Timer
- if (Heal_Timer <= diff)
- {
- DoCast(me, SPELL_HEAL);
- Heal_Timer = 15000 + rand()%25000;
- } else Heal_Timer -= diff;
+ if (pTarget)
+ {
+ AttackStart(pTarget);
+ }
+ }
- //PrayerofHealing_Timer
- if (PrayerofHealing_Timer <= diff)
- {
- DoCast(me, SPELL_PRAYER_OH);
- PrayerofHealing_Timer = 35000 + rand()%15000;
- } else PrayerofHealing_Timer -= diff;
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- DoMeleeAttackIfReady();
- }
-};
+ //someone evaded!
+ if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ EnterEvadeMode();
+ return;
+ }
-//Krosh Firehand AI
-struct boss_krosh_firehandAI : public ScriptedAI
-{
- boss_krosh_firehandAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceData();
- }
+ //GreaterPowerWordShield_Timer
+ if (GreaterPowerWordShield_Timer <= diff)
+ {
+ DoCast(me, SPELL_GREATER_PW_SHIELD);
+ GreaterPowerWordShield_Timer = 40000;
+ } else GreaterPowerWordShield_Timer -= diff;
+
+ //Heal_Timer
+ if (Heal_Timer <= diff)
+ {
+ DoCast(me, SPELL_HEAL);
+ Heal_Timer = 15000 + rand()%25000;
+ } else Heal_Timer -= diff;
- uint32 GreaterFireball_Timer;
- uint32 SpellShield_Timer;
- uint32 BlastWave_Timer;
+ //PrayerofHealing_Timer
+ if (PrayerofHealing_Timer <= diff)
+ {
+ DoCast(me, SPELL_PRAYER_OH);
+ PrayerofHealing_Timer = 35000 + rand()%15000;
+ } else PrayerofHealing_Timer -= diff;
- ScriptedInstance* pInstance;
+ DoMeleeAttackIfReady();
+ }
+ };
- void Reset()
- {
- GreaterFireball_Timer = 1000;
- SpellShield_Timer = 5000;
- BlastWave_Timer = 20000;
+};
- //reset encounter
- if (pInstance)
- pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
- }
+//Krosh Firehand AI class boss_krosh_firehand : public CreatureScript
+{
+public:
+ boss_krosh_firehand() : CreatureScript("boss_krosh_firehand") { }
- void EnterCombat(Unit * who)
+ CreatureAI *GetAI(Creature* pCreature)
{
- if (pInstance)
- {
- pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
- pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
- }
+ return new boss_krosh_firehandAI (pCreature);
}
- void JustDied(Unit* /*Killer*/)
+ struct boss_krosh_firehandAI : public ScriptedAI
{
- if (pInstance)
+ boss_krosh_firehandAI(Creature *c) : ScriptedAI(c)
{
- Creature *Maulgar = NULL;
- Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
+ pInstance = c->GetInstanceScript();
+ }
- if (Maulgar)
- CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
+ uint32 GreaterFireball_Timer;
+ uint32 SpellShield_Timer;
+ uint32 BlastWave_Timer;
- if (CheckAllBossDied(pInstance, me))
- pInstance->SetData(DATA_MAULGAREVENT, DONE);
- }
- }
+ InstanceScript* pInstance;
- void UpdateAI(const uint32 diff)
- {
- //Only if not incombat check if the event is started
- if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ void Reset()
{
- Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+ GreaterFireball_Timer = 1000;
+ SpellShield_Timer = 5000;
+ BlastWave_Timer = 20000;
- if (pTarget)
- {
- AttackStart(pTarget);
- }
+ //reset encounter
+ if (pInstance)
+ pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
}
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //someone evaded!
- if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ void EnterCombat(Unit * who)
{
- EnterEvadeMode();
- return;
+ if (pInstance)
+ {
+ pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
+ pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
+ }
}
- //GreaterFireball_Timer
- if (GreaterFireball_Timer < diff || me->IsWithinDist(me->getVictim(), 30))
+ void JustDied(Unit* /*Killer*/)
{
- DoCast(me->getVictim(), SPELL_GREATER_FIREBALL);
- GreaterFireball_Timer = 2000;
- } else GreaterFireball_Timer -= diff;
+ if (pInstance)
+ {
+ Creature *Maulgar = NULL;
+ Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR)));
- //SpellShield_Timer
- if (SpellShield_Timer <= diff)
- {
- me->InterruptNonMeleeSpells(false);
- DoCast(me->getVictim(), SPELL_SPELLSHIELD);
- SpellShield_Timer = 30000;
- } else SpellShield_Timer -= diff;
+ if (Maulgar)
+ CAST_AI(boss_high_king_maulgar::boss_high_king_maulgarAI, Maulgar->AI())->AddDeath();
- //BlastWave_Timer
- if (BlastWave_Timer <= diff)
+ if (CheckAllBossDied(pInstance, me))
+ pInstance->SetData(DATA_MAULGAREVENT, DONE);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
{
- Unit *pTarget = NULL;
- std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
- std::vector<Unit *> target_list;
- for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
- //15 yard radius minimum
- if (pTarget && pTarget->IsWithinDist(me, 15,false))
- target_list.push_back(pTarget);
- pTarget = NULL;
+ //Only if not incombat check if the event is started
+ if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
+
+ if (pTarget)
+ {
+ AttackStart(pTarget);
+ }
}
- if (target_list.size())
- pTarget = *(target_list.begin()+rand()%target_list.size());
- me->InterruptNonMeleeSpells(false);
- DoCast(pTarget, SPELL_BLAST_WAVE);
- BlastWave_Timer = 60000;
- } else BlastWave_Timer -= diff;
- }
-};
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
-CreatureAI* GetAI_boss_high_king_maulgar(Creature* pCreature)
-{
- return new boss_high_king_maulgarAI (pCreature);
-}
+ //someone evaded!
+ if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT))
+ {
+ EnterEvadeMode();
+ return;
+ }
-CreatureAI* GetAI_boss_olm_the_summoner(Creature* pCreature)
-{
- return new boss_olm_the_summonerAI (pCreature);
-}
+ //GreaterFireball_Timer
+ if (GreaterFireball_Timer < diff || me->IsWithinDist(me->getVictim(), 30))
+ {
+ DoCast(me->getVictim(), SPELL_GREATER_FIREBALL);
+ GreaterFireball_Timer = 2000;
+ } else GreaterFireball_Timer -= diff;
-CreatureAI *GetAI_boss_kiggler_the_crazed(Creature* pCreature)
-{
- return new boss_kiggler_the_crazedAI (pCreature);
-}
+ //SpellShield_Timer
+ if (SpellShield_Timer <= diff)
+ {
+ me->InterruptNonMeleeSpells(false);
+ DoCast(me->getVictim(), SPELL_SPELLSHIELD);
+ SpellShield_Timer = 30000;
+ } else SpellShield_Timer -= diff;
-CreatureAI *GetAI_boss_blindeye_the_seer(Creature* pCreature)
-{
- return new boss_blindeye_the_seerAI (pCreature);
-}
+ //BlastWave_Timer
+ if (BlastWave_Timer <= diff)
+ {
+ Unit *pTarget = NULL;
+ std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
+ std::vector<Unit *> target_list;
+ for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ {
+ pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
+ //15 yard radius minimum
+ if (pTarget && pTarget->IsWithinDist(me, 15,false))
+ target_list.push_back(pTarget);
+ pTarget = NULL;
+ }
+ if (target_list.size())
+ pTarget = *(target_list.begin()+rand()%target_list.size());
-CreatureAI *GetAI_boss_krosh_firehand(Creature* pCreature)
-{
- return new boss_krosh_firehandAI (pCreature);
-}
+ me->InterruptNonMeleeSpells(false);
+ DoCast(pTarget, SPELL_BLAST_WAVE);
+ BlastWave_Timer = 60000;
+ } else BlastWave_Timer -= diff;
+ }
+ };
+};
void AddSC_boss_high_king_maulgar()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "boss_high_king_maulgar";
- newscript->GetAI = &GetAI_boss_high_king_maulgar;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_kiggler_the_crazed";
- newscript->GetAI = &GetAI_boss_kiggler_the_crazed;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_blindeye_the_seer";
- newscript->GetAI = &GetAI_boss_blindeye_the_seer;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_olm_the_summoner";
- newscript->GetAI = &GetAI_boss_olm_the_summoner;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "boss_krosh_firehand";
- newscript->GetAI = &GetAI_boss_krosh_firehand;
- newscript->RegisterSelf();
+ new boss_high_king_maulgar();
+ new boss_kiggler_the_crazed();
+ new boss_blindeye_the_seer();
+ new boss_olm_the_summoner();
+ new boss_krosh_firehand();
}
-
diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
index 2df6ad896da..92e76e45510 100644
--- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
+++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
@@ -32,164 +32,166 @@ EndScriptData */
1 - High King Maulgar event
2 - Gruul event
*/
-
-struct instance_gruuls_lair : public ScriptedInstance
+ class instance_gruuls_lair : public InstanceMapScript
{
- instance_gruuls_lair(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
+public:
+ instance_gruuls_lair() : InstanceMapScript("instance_gruuls_lair") { }
- uint32 m_auiEncounter[MAX_ENCOUNTER];
+ InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
+ {
+ return new instance_gruuls_lair_InstanceMapScript(pMap);
+ }
- uint64 MaulgarEvent_Tank;
- uint64 KigglerTheCrazed;
- uint64 BlindeyeTheSeer;
- uint64 OlmTheSummoner;
- uint64 KroshFirehand;
- uint64 Maulgar;
+ struct instance_gruuls_lair_InstanceMapScript : public InstanceScript
+ {
+ instance_gruuls_lair_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
- uint64 MaulgarDoor;
- uint64 GruulDoor;
+ uint32 m_auiEncounter[MAX_ENCOUNTER];
- void Initialize()
- {
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ uint64 MaulgarEvent_Tank;
+ uint64 KigglerTheCrazed;
+ uint64 BlindeyeTheSeer;
+ uint64 OlmTheSummoner;
+ uint64 KroshFirehand;
+ uint64 Maulgar;
- MaulgarEvent_Tank = 0;
- KigglerTheCrazed = 0;
- BlindeyeTheSeer = 0;
- OlmTheSummoner = 0;
- KroshFirehand = 0;
- Maulgar = 0;
+ uint64 MaulgarDoor;
+ uint64 GruulDoor;
- MaulgarDoor = 0;
- GruulDoor = 0;
- }
+ void Initialize()
+ {
+ memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
- bool IsEncounterInProgress() const
- {
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS) return true;
+ MaulgarEvent_Tank = 0;
+ KigglerTheCrazed = 0;
+ BlindeyeTheSeer = 0;
+ OlmTheSummoner = 0;
+ KroshFirehand = 0;
+ Maulgar = 0;
- return false;
- }
+ MaulgarDoor = 0;
+ GruulDoor = 0;
+ }
- void OnCreatureCreate(Creature* pCreature, bool /*add*/)
- {
- switch(pCreature->GetEntry())
+ bool IsEncounterInProgress() const
{
- case 18835: KigglerTheCrazed = pCreature->GetGUID(); break;
- case 18836: BlindeyeTheSeer = pCreature->GetGUID(); break;
- case 18834: OlmTheSummoner = pCreature->GetGUID(); break;
- case 18832: KroshFirehand = pCreature->GetGUID(); break;
- case 18831: Maulgar = pCreature->GetGUID(); break;
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS) return true;
+
+ return false;
}
- }
- void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
- {
- switch(pGo->GetEntry())
+ void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
- case 184468:
- MaulgarDoor = pGo->GetGUID();
- if (m_auiEncounter[0] == DONE) HandleGameObject(NULL, true, pGo);
- break;
- case 184662: GruulDoor = pGo->GetGUID(); break;
+ switch(pCreature->GetEntry())
+ {
+ case 18835: KigglerTheCrazed = pCreature->GetGUID(); break;
+ case 18836: BlindeyeTheSeer = pCreature->GetGUID(); break;
+ case 18834: OlmTheSummoner = pCreature->GetGUID(); break;
+ case 18832: KroshFirehand = pCreature->GetGUID(); break;
+ case 18831: Maulgar = pCreature->GetGUID(); break;
+ }
}
- }
-
- void SetData64(uint32 type, uint64 data)
- {
- if (type == DATA_MAULGAREVENT_TANK)
- MaulgarEvent_Tank = data;
- }
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
+ void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
- case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank;
- case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed;
- case DATA_BLINDEYETHESEER: return BlindeyeTheSeer;
- case DATA_OLMTHESUMMONER: return OlmTheSummoner;
- case DATA_KROSHFIREHAND: return KroshFirehand;
- case DATA_MAULGARDOOR: return MaulgarDoor;
- case DATA_GRUULDOOR: return GruulDoor;
- case DATA_MAULGAR: return Maulgar;
+ switch(pGo->GetEntry())
+ {
+ case 184468:
+ MaulgarDoor = pGo->GetGUID();
+ if (m_auiEncounter[0] == DONE) HandleGameObject(NULL, true, pGo);
+ break;
+ case 184662: GruulDoor = pGo->GetGUID(); break;
+ }
}
- return 0;
- }
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
+ void SetData64(uint32 type, uint64 data)
{
- case DATA_MAULGAREVENT:
- if (data == DONE) HandleGameObject(MaulgarDoor, true);
- m_auiEncounter[0] = data; break;
- case DATA_GRUULEVENT:
- if (data == IN_PROGRESS) HandleGameObject(GruulDoor, false);
- else HandleGameObject(GruulDoor, true);
- m_auiEncounter[1] = data; break;
+ if (type == DATA_MAULGAREVENT_TANK)
+ MaulgarEvent_Tank = data;
}
- if (data == DONE)
- SaveToDB();
- }
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank;
+ case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed;
+ case DATA_BLINDEYETHESEER: return BlindeyeTheSeer;
+ case DATA_OLMTHESUMMONER: return OlmTheSummoner;
+ case DATA_KROSHFIREHAND: return KroshFirehand;
+ case DATA_MAULGARDOOR: return MaulgarDoor;
+ case DATA_GRUULDOOR: return GruulDoor;
+ case DATA_MAULGAR: return Maulgar;
+ }
+ return 0;
+ }
- uint32 GetData(uint32 type)
- {
- switch(type)
+ void SetData(uint32 type, uint32 data)
{
- case DATA_MAULGAREVENT: return m_auiEncounter[0];
- case DATA_GRUULEVENT: return m_auiEncounter[1];
+ switch(type)
+ {
+ case DATA_MAULGAREVENT:
+ if (data == DONE) HandleGameObject(MaulgarDoor, true);
+ m_auiEncounter[0] = data; break;
+ case DATA_GRUULEVENT:
+ if (data == IN_PROGRESS) HandleGameObject(GruulDoor, false);
+ else HandleGameObject(GruulDoor, true);
+ m_auiEncounter[1] = data; break;
+ }
+
+ if (data == DONE)
+ SaveToDB();
}
- return 0;
- }
- std::string GetSaveData()
- {
- OUT_SAVE_INST_DATA;
- std::ostringstream stream;
- stream << m_auiEncounter[0] << " " << m_auiEncounter[1];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if (out)
+ uint32 GetData(uint32 type)
{
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
+ switch(type)
+ {
+ case DATA_MAULGAREVENT: return m_auiEncounter[0];
+ case DATA_GRUULEVENT: return m_auiEncounter[1];
+ }
+ return 0;
}
- return NULL;
- }
+ std::string GetSaveData()
+ {
+ OUT_SAVE_INST_DATA;
+ std::ostringstream stream;
+ stream << m_auiEncounter[0] << " " << m_auiEncounter[1];
+ char* out = new char[stream.str().length() + 1];
+ strcpy(out, stream.str().c_str());
+ if (out)
+ {
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return out;
+ }
+
+ return NULL;
+ }
- void Load(const char* in)
- {
- if (!in)
+ void Load(const char* in)
{
- OUT_LOAD_INST_DATA_FAIL;
- return;
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+ std::istringstream stream(in);
+ stream >> m_auiEncounter[0] >> m_auiEncounter[1];
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
+ m_auiEncounter[i] = NOT_STARTED;
+ OUT_LOAD_INST_DATA_COMPLETE;
}
+ };
- OUT_LOAD_INST_DATA(in);
- std::istringstream stream(in);
- stream >> m_auiEncounter[0] >> m_auiEncounter[1];
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
- m_auiEncounter[i] = NOT_STARTED;
- OUT_LOAD_INST_DATA_COMPLETE;
- }
};
-InstanceData* GetInstanceData_instance_gruuls_lair(Map* pMap)
-{
- return new instance_gruuls_lair(pMap);
-}
void AddSC_instance_gruuls_lair()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_gruuls_lair";
- newscript->GetInstanceData = &GetInstanceData_instance_gruuls_lair;
- newscript->RegisterSelf();
+ new instance_gruuls_lair();
}
-
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
index e620ec08add..e97c9567f4d 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
@@ -50,10 +50,10 @@ class boss_broggok : public CreatureScript
{
boss_broggokAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
uint32 AcidSpray_Timer;
uint32 PoisonSpawn_Timer;
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
index e2674cfcb9d..13378233d61 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
@@ -80,12 +80,12 @@ class boss_kelidan_the_breaker : public CreatureScript
{
boss_kelidan_the_breakerAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
for (uint8 i=0; i<5; ++i)
Channelers[i] = 0;
}
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
uint32 ShadowVolley_Timer;
uint32 BurningNova_Timer;
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
index 74b1fb993ad..0c8d2f48de9 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
@@ -54,10 +54,10 @@ class boss_the_maker : public CreatureScript
{
boss_the_makerAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
uint32 AcidSpray_Timer;
uint32 ExplodingBreaker_Timer;
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
index 97ed35abde7..2c4a88128d3 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
@@ -38,9 +38,9 @@ class instance_blood_furnace : public InstanceMapScript
{
}
- struct instance_blood_furnace_InstanceMapScript : public ScriptedInstance
+ struct instance_blood_furnace_InstanceMapScript : public InstanceScript
{
- instance_blood_furnace_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
+ instance_blood_furnace_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
uint64 The_MakerGUID;
uint64 BroggokGUID;
@@ -226,7 +226,7 @@ class instance_blood_furnace : public InstanceMapScript
}
};
- InstanceData* GetInstanceData(Map* pMap) const
+ InstanceScript* GetInstanceScript(Map* pMap) const
{
return new instance_blood_furnace_InstanceMapScript(pMap);
}
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
index ec81dcf62ff..b9d8c7683e1 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
@@ -34,9 +34,9 @@ class instance_ramparts : public InstanceMapScript
{
}
- struct instance_ramparts_InstanceMapScript : public ScriptedInstance
+ struct instance_ramparts_InstanceMapScript : public InstanceScript
{
- instance_ramparts_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) {Initialize();}
+ instance_ramparts_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();}
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint64 m_uiChestNGUID;
@@ -83,7 +83,7 @@ class instance_ramparts : public InstanceMapScript
}
};
- InstanceData* GetInstanceData(Map* pMap) const
+ InstanceScript* GetInstanceScript(Map* pMap) const
{
return new instance_ramparts_InstanceMapScript(pMap);
}
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
index a5fe18352aa..0a1e11324d9 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
@@ -217,7 +217,7 @@ class boss_magtheridon : public CreatureScript
{
boss_magtheridonAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
@@ -238,7 +238,7 @@ class boss_magtheridon : public CreatureScript
CubeMap Cube;
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
uint32 Berserk_Timer;
uint32 Quake_Timer;
@@ -497,10 +497,10 @@ class mob_hellfire_channeler : public CreatureScript
{
mob_hellfire_channelerAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
uint32 ShadowBoltVolley_Timer;
uint32 DarkMending_Timer;
@@ -613,7 +613,7 @@ public:
bool OnGossipHello(Player *pPlayer, GameObject * pGO)
{
- ScriptedInstance* pInstance = pGO->GetInstanceData();
+ InstanceScript* pInstance = pGO->GetInstanceScript();
if (!pInstance)
return true;
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
index 38b861539d8..5b73727bd78 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
@@ -48,9 +48,9 @@ class instance_magtheridons_lair : public InstanceMapScript
{
}
- struct instance_magtheridons_lair_InstanceMapScript : public ScriptedInstance
+ struct instance_magtheridons_lair_InstanceMapScript : public InstanceScript
{
- instance_magtheridons_lair_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap)
+ instance_magtheridons_lair_InstanceMapScript(Map* pMap) : InstanceScript(pMap)
{
Initialize();
}
@@ -251,7 +251,7 @@ class instance_magtheridons_lair : public InstanceMapScript
}
};
- InstanceData* GetInstanceData(Map* pMap) const
+ InstanceScript* GetInstanceScript(Map* pMap) const
{
return new instance_magtheridons_lair_InstanceMapScript(pMap);
}
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
index 6ca6cbea0d1..9d773f6da55 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
@@ -91,10 +91,10 @@ class boss_grand_warlock_nethekurse : public CreatureScript
{
boss_grand_warlock_nethekurseAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
bool IntroOnce;
bool IsIntroEvent;
@@ -321,10 +321,10 @@ class mob_fel_orc_convert : public CreatureScript
{
mob_fel_orc_convertAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
uint32 Hemorrhage_Timer;
void Reset()
@@ -410,7 +410,7 @@ class mob_lesser_shadow_fissure : public CreatureScript
void EnterCombat(Unit* /*who*/) {}
};
- CreatureAI* GetAI_mob_lesser_shadow_fissure(Creature* pCreature)
+ CreatureAI* GetAI(Creature* pCreature) const
{
return new mob_lesser_shadow_fissureAI (pCreature);
}
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
index 9b2d8af3e6a..a4971acbc9d 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
@@ -164,10 +164,10 @@ class boss_warbringer_omrogg : public CreatureScript
{
LeftHeadGUID = 0;
RightHeadGUID = 0;
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
uint64 LeftHeadGUID;
uint64 RightHeadGUID;
@@ -414,7 +414,7 @@ class boss_warbringer_omrogg : public CreatureScript
}
};
- CreatureAI* GetAI_boss_warbringer_omrogg(Creature* pCreature)
+ CreatureAI* GetAI(Creature* pCreature) const
{
return new boss_warbringer_omroggAI (pCreature);
}
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
index 8f052f592e1..4754bea9315 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
@@ -37,9 +37,9 @@ class instance_shattered_halls : public InstanceMapScript
: InstanceMapScript("instance_shattered_halls")
{
}
- struct instance_shattered_halls_InstanceMapScript : public ScriptedInstance
+ struct instance_shattered_halls_InstanceMapScript : public InstanceScript
{
- instance_shattered_halls_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
+ instance_shattered_halls_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint64 nethekurseGUID;
@@ -111,7 +111,7 @@ class instance_shattered_halls : public InstanceMapScript
}
};
- InstanceData* GetInstanceData(Map* pMap) const
+ InstanceScript* GetInstanceScript(Map* pMap) const
{
return new instance_shattered_halls_InstanceMapScript(pMap);
}
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
index e529f41a7cf..ac5732d4927 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
@@ -82,11 +82,11 @@ class boss_alar : public CreatureScript
{
boss_alarAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
DefaultMoveSpeedRate = pCreature->GetSpeedRate(MOVE_RUN);
}
- ScriptedInstance *pInstance;
+ InstanceScript *pInstance;
WaitEventType WaitEvent;
uint32 WaitTimer;
@@ -469,12 +469,12 @@ class mob_ember_of_alar : public CreatureScript
{
mob_ember_of_alarAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
pCreature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
pCreature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
}
- ScriptedInstance *pInstance;
+ InstanceScript *pInstance;
bool toDie;
void Reset()
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
index c3090b6219a..1326f11e187 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
@@ -84,13 +84,13 @@ class boss_high_astromancer_solarian : public CreatureScript
{
boss_high_astromancer_solarianAI(Creature* pCreature) : ScriptedAI(pCreature), Summons(me)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
defaultarmor = pCreature->GetArmor();
defaultsize = pCreature->GetFloatValue(OBJECT_FIELD_SCALE_X);
}
- ScriptedInstance *pInstance;
+ InstanceScript *pInstance;
SummonList Summons;
uint8 Phase;
@@ -418,10 +418,10 @@ class mob_solarium_priest : public CreatureScript
{
mob_solarium_priestAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance *pInstance;
+ InstanceScript *pInstance;
uint32 healTimer;
uint32 holysmiteTimer;
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
index 86b6de83377..c59dca949ca 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
@@ -147,11 +147,11 @@ struct advisorbase_ai : public ScriptedAI
{
advisorbase_ai(Creature* pCreature) : ScriptedAI(pCreature)
{
- m_pInstance = pCreature->GetInstanceData();
+ m_pInstance = pCreature->GetInstanceScript();
m_bDoubled_Health = false;
}
- ScriptedInstance* m_pInstance;
+ InstanceScript* m_pInstance;
bool FakeDeath;
bool m_bDoubled_Health;
uint32 DelayRes_Timer;
@@ -281,11 +281,11 @@ class boss_kaelthas : public CreatureScript
{
boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me)
{
- m_pInstance = pCreature->GetInstanceData();
+ m_pInstance = pCreature->GetInstanceScript();
memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid));
}
- ScriptedInstance* m_pInstance;
+ InstanceScript* m_pInstance;
uint32 Fireball_Timer;
uint32 ArcaneDisruption_Timer;
@@ -1573,7 +1573,7 @@ class mob_phoenix_egg_tk : public CreatureScript
}
};
- CreatureAI* GetAI_mob_phoenix_egg_tk(Creature* pCreature)
+ CreatureAI* GetAI(Creature* pCreature) const
{
return new mob_phoenix_egg_tkAI(pCreature);
}
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
index 0b2656496ad..0e9e81b3b24 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
@@ -55,10 +55,10 @@ class boss_void_reaver : public CreatureScript
{
boss_void_reaverAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
uint32 Pounding_Timer;
uint32 ArcaneOrb_Timer;
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
index 8fee87e39fd..7e717b204c5 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
@@ -43,9 +43,9 @@ class instance_mechanar : public InstanceMapScript
{
}
- struct instance_the_eye_InstanceMapScript : public ScriptedInstance
+ struct instance_the_eye_InstanceMapScript : public InstanceScript
{
- instance_the_eye_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
+ instance_the_eye_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
uint64 ThaladredTheDarkener;
uint64 LordSanguinar;
@@ -194,7 +194,7 @@ class instance_mechanar : public InstanceMapScript
}
};
- InstanceData* GetInstanceData(InstanceMap* pMap) const
+ InstanceScript* GetInstanceScript(InstanceMap* pMap) const
{
return new instance_the_eye_InstanceMapScript(pMap);
}
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
index 0cee180e88e..083842fd638 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
@@ -63,10 +63,10 @@ class boss_nethermancer_sepethrea : public CreatureScript
{
boss_nethermancer_sepethreaAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance *pInstance;
+ InstanceScript *pInstance;
uint32 frost_attack_Timer;
uint32 arcane_blast_Timer;
@@ -186,10 +186,10 @@ class mob_ragin_flames : public CreatureScript
{
mob_ragin_flamesAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance *pInstance;
+ InstanceScript *pInstance;
uint32 inferno_Timer;
uint32 flame_timer;
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
index 2eaad3cd978..eae3b0ff1d9 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
@@ -192,7 +192,7 @@ class boss_pathaleon_the_calculator : public CreatureScript
}
};
- CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature)
+ CreatureAI* GetAI(Creature* pCreature) const
{
return new boss_pathaleon_the_calculatorAI (pCreature);
}
@@ -267,7 +267,7 @@ class mob_nether_wraith : public CreatureScript
}
};
- CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature)
+ CreatureAI* GetAI(Creature* pCreature) const
{
return new mob_nether_wraithAI (pCreature);
}
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
index 31d10313c7c..aa992098a67 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
@@ -36,9 +36,9 @@ class instance_mechanar : public InstanceMapScript
{
}
- struct instance_mechanar_InstanceMapScript : public ScriptedInstance
+ struct instance_mechanar_InstanceMapScript : public InstanceScript
{
- instance_mechanar_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) { Initialize(); };
+ instance_mechanar_InstanceMapScript(Map* pMap) : InstanceScript(pMap) { Initialize(); };
uint32 m_auiEncounter[MAX_ENCOUNTER];
@@ -79,7 +79,7 @@ class instance_mechanar : public InstanceMapScript
}
}
};
- InstanceData* GetInstanceData(InstanceMap* pMap) const
+ InstanceScript* GetInstanceScript(InstanceMap* pMap) const
{
return new instance_mechanar_InstanceMapScript(pMap);
}
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
index 18cd75b256e..2220526111c 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
@@ -78,10 +78,10 @@ class npc_millhouse_manastorm : public CreatureScript
{
npc_millhouse_manastormAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
uint32 EventProgress_Timer;
uint32 Phase;
@@ -282,10 +282,10 @@ class npc_warden_mellichar : public CreatureScript
{
npc_warden_mellicharAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
}
- ScriptedInstance* pInstance;
+ InstanceScript* pInstance;
bool IsRunning;
bool CanSpawn;
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
index 63e522ad63d..076d1223f1a 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
@@ -70,11 +70,11 @@ class boss_harbinger_skyriss : public CreatureScript
{
boss_harbinger_skyrissAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- pInstance = pCreature->GetInstanceData();
+ pInstance = pCreature->GetInstanceScript();
Intro = false;
}
- ScriptedInstance *pInstance;
+ InstanceScript *pInstance;
bool Intro;
bool IsImage33;
@@ -272,7 +272,7 @@ class boss_harbinger_skyriss : public CreatureScript
}
};
- CreatureAI* GetAI_boss_harbinger_skyriss(Creature* pCreature)
+ CreatureAI* GetAI(Creature* pCreature) const
{
return new boss_harbinger_skyrissAI (pCreature);
}
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
index c06cb6a4d07..7a2d10db48d 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
@@ -58,9 +58,9 @@ class instance_arcatraz : public InstanceMapScript
: InstanceMapScript("instance_arcatraz")
{
}
- struct instance_arcatraz_InstanceMapScript : public ScriptedInstance
+ struct instance_arcatraz_InstanceMapScript : public InstanceScript
{
- instance_arcatraz_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) { Initialize(); };
+ instance_arcatraz_InstanceMapScript(Map* pMap) : InstanceScript(pMap) { Initialize(); };
uint32 m_auiEncounter[MAX_ENCOUNTER];
@@ -229,7 +229,7 @@ class instance_arcatraz : public InstanceMapScript
}
};
- InstanceData* GetInstanceData(InstanceMap* pMap) const
+ InstanceScript* GetInstanceScript(InstanceMap* pMap) const
{
return new instance_arcatraz_InstanceMapScript(pMap);
}
diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp
index b07c637d521..e760453f73c 100644
--- a/src/server/scripts/Outland/blades_edge_mountains.cpp
+++ b/src/server/scripts/Outland/blades_edge_mountains.cpp
@@ -47,25 +47,32 @@ bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five;
## mobs_bladespire_ogre
######*/
-//TODO: add support for quest 10512 + Creature abilities
-struct mobs_bladespire_ogreAI : public ScriptedAI
+//TODO: add support for quest 10512 + Creature abilities class mobs_bladespire_ogre : public CreatureScript
{
- mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {}
+public:
+ mobs_bladespire_ogre() : CreatureScript("mobs_bladespire_ogre") { }
- void Reset() { }
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new mobs_bladespire_ogreAI (pCreature);
+ }
- void UpdateAI(const uint32 /*uiDiff*/)
+ struct mobs_bladespire_ogreAI : public ScriptedAI
{
- if (!UpdateVictim())
- return;
+ mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() { }
+
+ void UpdateAI(const uint32 /*uiDiff*/)
+ {
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mobs_bladespire_ogre(Creature* pCreature)
-{
- return new mobs_bladespire_ogreAI (pCreature);
-}
/*######
## mobs_nether_drake
@@ -91,154 +98,161 @@ enum eNetherdrake
SPELL_MANA_BURN = 38884,
SPELL_INTANGIBLE_PRESENCE = 36513
};
-
-struct mobs_nether_drakeAI : public ScriptedAI
+ class mobs_nether_drake : public CreatureScript
{
- mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {}
-
- bool IsNihil;
- uint32 NihilSpeech_Timer;
- uint32 NihilSpeech_Phase;
-
- uint32 ArcaneBlast_Timer;
- uint32 ManaBurn_Timer;
- uint32 IntangiblePresence_Timer;
+public:
+ mobs_nether_drake() : CreatureScript("mobs_nether_drake") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- IsNihil = false;
- NihilSpeech_Timer = 3000;
- NihilSpeech_Phase = 0;
-
- ArcaneBlast_Timer = 7500;
- ManaBurn_Timer = 10000;
- IntangiblePresence_Timer = 15000;
+ return new mobs_nether_drakeAI (pCreature);
}
- void EnterCombat(Unit* /*who*/) {}
-
- void MoveInLineOfSight(Unit *who)
+ struct mobs_nether_drakeAI : public ScriptedAI
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- return;
+ mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {}
- ScriptedAI::MoveInLineOfSight(who);
- }
+ bool IsNihil;
+ uint32 NihilSpeech_Timer;
+ uint32 NihilSpeech_Phase;
- //in case Creature was not summoned (not expected)
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
+ uint32 ArcaneBlast_Timer;
+ uint32 ManaBurn_Timer;
+ uint32 IntangiblePresence_Timer;
- if (id == 0)
+ void Reset()
{
- me->setDeathState(JUST_DIED);
- me->RemoveCorpse();
- me->SetHealth(0);
+ IsNihil = false;
+ NihilSpeech_Timer = 3000;
+ NihilSpeech_Phase = 0;
+
+ ArcaneBlast_Timer = 7500;
+ ManaBurn_Timer = 10000;
+ IntangiblePresence_Timer = 15000;
}
- }
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER)
+ void EnterCombat(Unit* /*who*/) {}
+
+ void MoveInLineOfSight(Unit *who)
{
- const uint32 entry_list[4] = {ENTRY_PROTO, ENTRY_ADOLE, ENTRY_MATUR, ENTRY_NIHIL};
- int cid = rand()%(4-1);
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
- if (entry_list[cid] == me->GetEntry())
- ++cid;
+ ScriptedAI::MoveInLineOfSight(who);
+ }
- //we are nihil, so say before transform
- if (me->GetEntry() == ENTRY_NIHIL)
+ //in case Creature was not summoned (not expected)
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (id == 0)
{
- DoScriptText(SAY_NIHIL_INTERRUPT, me);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- IsNihil = false;
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
+ me->SetHealth(0);
}
+ }
- if (me->UpdateEntry(entry_list[cid]))
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER)
{
- if (entry_list[cid] == ENTRY_NIHIL)
+ const uint32 entry_list[4] = {ENTRY_PROTO, ENTRY_ADOLE, ENTRY_MATUR, ENTRY_NIHIL};
+ int cid = rand()%(4-1);
+
+ if (entry_list[cid] == me->GetEntry())
+ ++cid;
+
+ //we are nihil, so say before transform
+ if (me->GetEntry() == ENTRY_NIHIL)
+ {
+ DoScriptText(SAY_NIHIL_INTERRUPT, me);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ IsNihil = false;
+ }
+
+ if (me->UpdateEntry(entry_list[cid]))
{
- EnterEvadeMode();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- IsNihil = true;
- }else
- AttackStart(caster);
+ if (entry_list[cid] == ENTRY_NIHIL)
+ {
+ EnterEvadeMode();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ IsNihil = true;
+ }else
+ AttackStart(caster);
+ }
}
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (IsNihil)
+ void UpdateAI(const uint32 diff)
{
- if (NihilSpeech_Timer <= diff)
+ if (IsNihil)
{
- switch(NihilSpeech_Phase)
+ if (NihilSpeech_Timer <= diff)
{
- case 0:
- DoScriptText(SAY_NIHIL_1, me);
- ++NihilSpeech_Phase;
- break;
- case 1:
- DoScriptText(SAY_NIHIL_2, me);
- ++NihilSpeech_Phase;
- break;
- case 2:
- DoScriptText(SAY_NIHIL_3, me);
- ++NihilSpeech_Phase;
- break;
- case 3:
- DoScriptText(SAY_NIHIL_4, me);
- ++NihilSpeech_Phase;
- break;
- case 4:
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //take off to location above
- me->GetMotionMaster()->MovePoint(0, me->GetPositionX()+50.0f, me->GetPositionY(), me->GetPositionZ()+50.0f);
- ++NihilSpeech_Phase;
- break;
- }
- NihilSpeech_Timer = 5000;
- } else NihilSpeech_Timer -=diff;
+ switch(NihilSpeech_Phase)
+ {
+ case 0:
+ DoScriptText(SAY_NIHIL_1, me);
+ ++NihilSpeech_Phase;
+ break;
+ case 1:
+ DoScriptText(SAY_NIHIL_2, me);
+ ++NihilSpeech_Phase;
+ break;
+ case 2:
+ DoScriptText(SAY_NIHIL_3, me);
+ ++NihilSpeech_Phase;
+ break;
+ case 3:
+ DoScriptText(SAY_NIHIL_4, me);
+ ++NihilSpeech_Phase;
+ break;
+ case 4:
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //take off to location above
+ me->GetMotionMaster()->MovePoint(0, me->GetPositionX()+50.0f, me->GetPositionY(), me->GetPositionZ()+50.0f);
+ ++NihilSpeech_Phase;
+ break;
+ }
+ NihilSpeech_Timer = 5000;
+ } else NihilSpeech_Timer -=diff;
+
+ //anything below here is not interesting for Nihil, so skip it
+ return;
+ }
- //anything below here is not interesting for Nihil, so skip it
- return;
- }
+ if (!UpdateVictim())
+ return;
- if (!UpdateVictim())
- return;
+ if (IntangiblePresence_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE);
+ IntangiblePresence_Timer = 15000+rand()%15000;
+ } else IntangiblePresence_Timer -= diff;
- if (IntangiblePresence_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE);
- IntangiblePresence_Timer = 15000+rand()%15000;
- } else IntangiblePresence_Timer -= diff;
+ if (ManaBurn_Timer <= diff)
+ {
+ Unit *pTarget = me->getVictim();
+ if (pTarget && pTarget->getPowerType() == POWER_MANA)
+ DoCast(pTarget, SPELL_MANA_BURN);
+ ManaBurn_Timer = 8000+rand()%8000;
+ } else ManaBurn_Timer -= diff;
- if (ManaBurn_Timer <= diff)
- {
- Unit *pTarget = me->getVictim();
- if (pTarget && pTarget->getPowerType() == POWER_MANA)
- DoCast(pTarget, SPELL_MANA_BURN);
- ManaBurn_Timer = 8000+rand()%8000;
- } else ManaBurn_Timer -= diff;
+ if (ArcaneBlast_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ARCANE_BLAST);
+ ArcaneBlast_Timer = 2500+rand()%5000;
+ } else ArcaneBlast_Timer -= diff;
- if (ArcaneBlast_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_ARCANE_BLAST);
- ArcaneBlast_Timer = 2500+rand()%5000;
- } else ArcaneBlast_Timer -= diff;
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mobs_nether_drake(Creature* pCreature)
-{
- return new mobs_nether_drakeAI (pCreature);
-}
/*######
## npc_daranelle
@@ -249,61 +263,75 @@ enum eDaranelle
SAY_SPELL_INFLUENCE = -1000174,
SPELL_LASHHAN_CHANNEL = 36904
};
-
-struct npc_daranelleAI : public ScriptedAI
+ class npc_daranelle : public CreatureScript
{
- npc_daranelleAI(Creature *c) : ScriptedAI(c) {}
-
- void Reset() { }
+public:
+ npc_daranelle() : CreatureScript("npc_daranelle") { }
- void EnterCombat(Unit* /*who*/) {}
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_daranelleAI (pCreature);
+ }
- void MoveInLineOfSight(Unit *who)
+ struct npc_daranelleAI : public ScriptedAI
{
- if (who->GetTypeId() == TYPEID_PLAYER)
+ npc_daranelleAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() { }
+
+ void EnterCombat(Unit* /*who*/) {}
+
+ void MoveInLineOfSight(Unit *who)
{
- if (who->HasAura(SPELL_LASHHAN_CHANNEL) && me->IsWithinDistInMap(who, 10.0f))
+ if (who->GetTypeId() == TYPEID_PLAYER)
{
- DoScriptText(SAY_SPELL_INFLUENCE, me, who);
- //TODO: Move the below to updateAI and run if this statement == true
- DoCast(who, 37028, true);
+ if (who->HasAura(SPELL_LASHHAN_CHANNEL) && me->IsWithinDistInMap(who, 10.0f))
+ {
+ DoScriptText(SAY_SPELL_INFLUENCE, me, who);
+ //TODO: Move the below to updateAI and run if this statement == true
+ DoCast(who, 37028, true);
+ }
}
+
+ ScriptedAI::MoveInLineOfSight(who);
}
+ };
- ScriptedAI::MoveInLineOfSight(who);
- }
};
-CreatureAI* GetAI_npc_daranelle(Creature* pCreature)
-{
- return new npc_daranelleAI (pCreature);
-}
/*######
## npc_overseer_nuaar
######*/
#define GOSSIP_HELLO_ON "Overseer, I am here to negotiate on behalf of the Cenarion Expedition."
-
-bool GossipHello_npc_overseer_nuaar(Player* pPlayer, Creature* pCreature)
+ class npc_overseer_nuaar : public CreatureScript
{
- if (pPlayer->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+public:
+ npc_overseer_nuaar() : CreatureScript("npc_overseer_nuaar") { }
- pPlayer->SEND_GOSSIP_MENU(10532, pCreature->GetGUID());
-
- return true;
-}
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ pPlayer->SEND_GOSSIP_MENU(10533, pCreature->GetGUID());
+ pPlayer->AreaExploredOrEventHappens(10682);
+ }
+ return true;
+ }
-bool GossipSelect_npc_overseer_nuaar(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- pPlayer->SEND_GOSSIP_MENU(10533, pCreature->GetGUID());
- pPlayer->AreaExploredOrEventHappens(10682);
+ if (pPlayer->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ pPlayer->SEND_GOSSIP_MENU(10532, pCreature->GetGUID());
+
+ return true;
}
- return true;
-}
+
+};
+
/*######
## npc_saikkal_the_elder
@@ -311,74 +339,87 @@ bool GossipSelect_npc_overseer_nuaar(Player* pPlayer, Creature* pCreature, uint3
#define GOSSIP_HELLO_STE "Yes... yes, it's me."
#define GOSSIP_SELECT_STE "Yes elder. Tell me more of the book."
-
-bool GossipHello_npc_saikkal_the_elder(Player* pPlayer, Creature* pCreature)
+ class npc_saikkal_the_elder : public CreatureScript
{
- if (pPlayer->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_STE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- pPlayer->SEND_GOSSIP_MENU(10794, pCreature->GetGUID());
+public:
+ npc_saikkal_the_elder() : CreatureScript("npc_saikkal_the_elder") { }
- return true;
-}
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ switch (uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_STE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ pPlayer->SEND_GOSSIP_MENU(10795, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
+ pPlayer->SEND_GOSSIP_MENU(10796, pCreature->GetGUID());
+ break;
+ }
+ return true;
+ }
-bool GossipSelect_npc_saikkal_the_elder(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch (uiAction)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_STE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- pPlayer->SEND_GOSSIP_MENU(10795, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
- pPlayer->SEND_GOSSIP_MENU(10796, pCreature->GetGUID());
- break;
+ if (pPlayer->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_STE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ pPlayer->SEND_GOSSIP_MENU(10794, pCreature->GetGUID());
+
+ return true;
}
- return true;
-}
+
+};
+
/*######
## go_legion_obelisk
######*/
-
-bool GOHello_go_legion_obelisk(Player* pPlayer, GameObject* pGo)
+ class go_legion_obelisk : public GameObjectScript
{
- if (pPlayer->GetQuestStatus(10821) == QUEST_STATUS_INCOMPLETE)
+public:
+ go_legion_obelisk() : GameObjectScript("go_legion_obelisk") { }
+
+ bool OnGossipHello(Player* pPlayer, GameObject* pGo)
{
- switch(pGo->GetEntry())
+ if (pPlayer->GetQuestStatus(10821) == QUEST_STATUS_INCOMPLETE)
{
- case LEGION_OBELISK_ONE:
- obelisk_one = true;
- break;
- case LEGION_OBELISK_TWO:
- obelisk_two = true;
- break;
- case LEGION_OBELISK_THREE:
- obelisk_three = true;
- break;
- case LEGION_OBELISK_FOUR:
- obelisk_four = true;
- break;
- case LEGION_OBELISK_FIVE:
- obelisk_five = true;
- break;
- }
+ switch(pGo->GetEntry())
+ {
+ case LEGION_OBELISK_ONE:
+ obelisk_one = true;
+ break;
+ case LEGION_OBELISK_TWO:
+ obelisk_two = true;
+ break;
+ case LEGION_OBELISK_THREE:
+ obelisk_three = true;
+ break;
+ case LEGION_OBELISK_FOUR:
+ obelisk_four = true;
+ break;
+ case LEGION_OBELISK_FIVE:
+ obelisk_five = true;
+ break;
+ }
- if (obelisk_one == true && obelisk_two == true && obelisk_three == true && obelisk_four == true && obelisk_five == true)
- {
- pGo->SummonCreature(19963,2943.40f,4778.20f,284.49f,0.94f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
- //reset global var
- obelisk_one = false;
- obelisk_two = false;
- obelisk_three = false;
- obelisk_four = false;
- obelisk_five = false;
+ if (obelisk_one == true && obelisk_two == true && obelisk_three == true && obelisk_four == true && obelisk_five == true)
+ {
+ pGo->SummonCreature(19963,2943.40f,4778.20f,284.49f,0.94f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
+ //reset global var
+ obelisk_one = false;
+ obelisk_two = false;
+ obelisk_three = false;
+ obelisk_four = false;
+ obelisk_five = false;
+ }
}
+
+ return true;
}
- return true;
-}
+};
/*######
@@ -392,87 +433,101 @@ enum eBloodmaul
NPC_QUEST_CREDIT = 21241,
GO_KEG = 184315
};
-
-struct npc_bloodmaul_brutebaneAI : public ScriptedAI
+ class npc_bloodmaul_brutebane : public CreatureScript
{
- npc_bloodmaul_brutebaneAI(Creature *c) : ScriptedAI(c)
+public:
+ npc_bloodmaul_brutebane() : CreatureScript("npc_bloodmaul_brutebane") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if(Creature* Ogre = me->FindNearestCreature(NPC_OGRE_BRUTE, 50, true))
- {
- Ogre->SetReactState(REACT_DEFENSIVE);
- Ogre->GetMotionMaster()->MovePoint(1, me->GetPositionX()-1, me->GetPositionY()+1, me->GetPositionZ());
- }
+ return new npc_bloodmaul_brutebaneAI (pCreature);
}
- uint64 OgreGUID;
-
- void Reset()
+ struct npc_bloodmaul_brutebaneAI : public ScriptedAI
{
- OgreGUID = 0;
- }
+ npc_bloodmaul_brutebaneAI(Creature *c) : ScriptedAI(c)
+ {
+ if(Creature* Ogre = me->FindNearestCreature(NPC_OGRE_BRUTE, 50, true))
+ {
+ Ogre->SetReactState(REACT_DEFENSIVE);
+ Ogre->GetMotionMaster()->MovePoint(1, me->GetPositionX()-1, me->GetPositionY()+1, me->GetPositionZ());
+ }
+ }
+
+ uint64 OgreGUID;
+
+ void Reset()
+ {
+ OgreGUID = 0;
+ }
+
+ void UpdateAI(const uint32 /*uiDiff*/) {}
+ };
- void UpdateAI(const uint32 /*uiDiff*/) {}
};
-CreatureAI* GetAI_npc_bloodmaul_brutebane(Creature* pCreature)
-{
- return new npc_bloodmaul_brutebaneAI (pCreature);
-}
/*######
## npc_ogre_brute
######*/
-
-struct npc_ogre_bruteAI : public ScriptedAI
+ class npc_ogre_brute : public CreatureScript
{
- npc_ogre_bruteAI(Creature *c) : ScriptedAI(c) {}
-
- uint64 PlayerGUID;
+public:
+ npc_ogre_brute() : CreatureScript("npc_ogre_brute") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- PlayerGUID = 0;
+ return new npc_ogre_bruteAI(pCreature);
}
- void MoveInLineOfSight(Unit *who)
+ struct npc_ogre_bruteAI : public ScriptedAI
{
- if (!who || (!who->isAlive())) return;
+ npc_ogre_bruteAI(Creature *c) : ScriptedAI(c) {}
- if (me->IsWithinDistInMap(who, 50.0f) && (who->GetTypeId() == TYPEID_PLAYER) && who->ToPlayer()->GetQuestStatus(10512) == QUEST_STATUS_INCOMPLETE)
+ uint64 PlayerGUID;
+
+ void Reset()
{
- PlayerGUID = who->GetGUID();
+ PlayerGUID = 0;
}
- }
- void MovementInform(uint32 /*type*/, uint32 id)
- {
- Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
- if (id == 1)
+ void MoveInLineOfSight(Unit *who)
{
- GameObject* Keg = me->FindNearestGameObject(GO_KEG, 20);
- if (Keg)
- Keg->Delete();
- me->HandleEmoteCommand(7);
- me->SetReactState(REACT_AGGRESSIVE);
- me->GetMotionMaster()->MoveTargetedHome();
- Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true);
- if (pPlayer && Credit)
- pPlayer->KilledMonster(Credit->GetCreatureInfo(), Credit->GetGUID());
+ if (!who || (!who->isAlive())) return;
+
+ if (me->IsWithinDistInMap(who, 50.0f) && (who->GetTypeId() == TYPEID_PLAYER) && who->ToPlayer()->GetQuestStatus(10512) == QUEST_STATUS_INCOMPLETE)
+ {
+ PlayerGUID = who->GetGUID();
+ }
}
- }
- void UpdateAI(const uint32 /*diff*/)
- {
- if (!UpdateVictim())
- return;
- DoMeleeAttackIfReady();
- }
+ void MovementInform(uint32 /*type*/, uint32 id)
+ {
+ Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
+ if (id == 1)
+ {
+ GameObject* Keg = me->FindNearestGameObject(GO_KEG, 20);
+ if (Keg)
+ Keg->Delete();
+ me->HandleEmoteCommand(7);
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->GetMotionMaster()->MoveTargetedHome();
+ Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true);
+ if (pPlayer && Credit)
+ pPlayer->KilledMonster(Credit->GetCreatureInfo(), Credit->GetGUID());
+ }
+ }
+
+ void UpdateAI(const uint32 /*diff*/)
+ {
+ if (!UpdateVictim())
+ return;
+ DoMeleeAttackIfReady();
+ }
+ };
+
};
-CreatureAI* GetAI_npc_ogre_brute(Creature* pCreature)
-{
- return new npc_ogre_bruteAI(pCreature);
-}
/*######
## AddSC
@@ -480,48 +535,12 @@ CreatureAI* GetAI_npc_ogre_brute(Creature* pCreature)
void AddSC_blades_edge_mountains()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "mobs_bladespire_ogre";
- newscript->GetAI = &GetAI_mobs_bladespire_ogre;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mobs_nether_drake";
- newscript->GetAI = &GetAI_mobs_nether_drake;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_daranelle";
- newscript->GetAI = &GetAI_npc_daranelle;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_overseer_nuaar";
- newscript->pGossipHello = &GossipHello_npc_overseer_nuaar;
- newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_saikkal_the_elder";
- newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder;
- newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "go_legion_obelisk";
- newscript->pGOHello = &GOHello_go_legion_obelisk;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_bloodmaul_brutebane";
- newscript->GetAI = &GetAI_npc_bloodmaul_brutebane;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_ogre_brute";
- newscript->GetAI = &GetAI_npc_ogre_brute;
- newscript->RegisterSelf();
+ new mobs_bladespire_ogre();
+ new mobs_nether_drake();
+ new npc_daranelle();
+ new npc_overseer_nuaar();
+ new npc_saikkal_the_elder();
+ new go_legion_obelisk();
+ new npc_bloodmaul_brutebane();
+ new npc_ogre_brute();
}
-
diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
index b158a1a6fd1..7d09af3aaa9 100644
--- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
+++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
@@ -46,131 +46,133 @@ EndScriptData */
#define SPELL_ENRAGE 32964
#define SPELL_CAPTURESOUL 32966
#define SPELL_TWISTEDREFLECTION 21063
-
-struct boss_doomlordkazzakAI : public ScriptedAI
+ class boss_doomlord_kazzak : public CreatureScript
{
- boss_doomlordkazzakAI(Creature *c) : ScriptedAI(c) {}
-
- uint32 ShadowVolley_Timer;
- uint32 Cleave_Timer;
- uint32 ThunderClap_Timer;
- uint32 VoidBolt_Timer;
- uint32 MarkOfKazzak_Timer;
- uint32 Enrage_Timer;
- uint32 Twisted_Reflection_Timer;
+public:
+ boss_doomlord_kazzak() : CreatureScript("boss_doomlord_kazzak") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- ShadowVolley_Timer = 6000 + rand()%4000;
- Cleave_Timer = 7000;
- ThunderClap_Timer = 14000 + rand()%4000;
- VoidBolt_Timer = 30000;
- MarkOfKazzak_Timer = 25000;
- Enrage_Timer = 60000;
- Twisted_Reflection_Timer = 33000; // Timer may be incorrect
+ return new boss_doomlordkazzakAI (pCreature);
}
- void JustRespawned()
+ struct boss_doomlordkazzakAI : public ScriptedAI
{
- DoScriptText(SAY_INTRO, me);
- }
+ boss_doomlordkazzakAI(Creature *c) : ScriptedAI(c) {}
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2), me);
- }
+ uint32 ShadowVolley_Timer;
+ uint32 Cleave_Timer;
+ uint32 ThunderClap_Timer;
+ uint32 VoidBolt_Timer;
+ uint32 MarkOfKazzak_Timer;
+ uint32 Enrage_Timer;
+ uint32 Twisted_Reflection_Timer;
- void KilledUnit(Unit* victim)
- {
- // When Kazzak kills a player (not pets/totems), he regens some health
- if (victim->GetTypeId() != TYPEID_PLAYER)
- return;
+ void Reset()
+ {
+ ShadowVolley_Timer = 6000 + rand()%4000;
+ Cleave_Timer = 7000;
+ ThunderClap_Timer = 14000 + rand()%4000;
+ VoidBolt_Timer = 30000;
+ MarkOfKazzak_Timer = 25000;
+ Enrage_Timer = 60000;
+ Twisted_Reflection_Timer = 33000; // Timer may be incorrect
+ }
+
+ void JustRespawned()
+ {
+ DoScriptText(SAY_INTRO, me);
+ }
- DoCast(me, SPELL_CAPTURESOUL);
+ void EnterCombat(Unit * /*who*/)
+ {
+ DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2), me);
+ }
- DoScriptText(RAND(SAY_KILL1,SAY_KILL2,SAY_KILL3), me);
- }
+ void KilledUnit(Unit* victim)
+ {
+ // When Kazzak kills a player (not pets/totems), he regens some health
+ if (victim->GetTypeId() != TYPEID_PLAYER)
+ return;
- void JustDied(Unit * /*victim*/)
- {
- DoScriptText(SAY_DEATH, me);
- }
+ DoCast(me, SPELL_CAPTURESOUL);
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ DoScriptText(RAND(SAY_KILL1,SAY_KILL2,SAY_KILL3), me);
+ }
- //ShadowVolley_Timer
- if (ShadowVolley_Timer <= diff)
+ void JustDied(Unit * /*victim*/)
{
- DoCast(me->getVictim(), SPELL_SHADOWVOLLEY);
- ShadowVolley_Timer = 4000 + rand()%2000;
- } else ShadowVolley_Timer -= diff;
+ DoScriptText(SAY_DEATH, me);
+ }
- //Cleave_Timer
- if (Cleave_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me->getVictim(), SPELL_CLEAVE);
- Cleave_Timer = 8000 + rand()%4000;
- } else Cleave_Timer -= diff;
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- //ThunderClap_Timer
- if (ThunderClap_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_THUNDERCLAP);
- ThunderClap_Timer = 10000 + rand()%4000;
- } else ThunderClap_Timer -= diff;
+ //ShadowVolley_Timer
+ if (ShadowVolley_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SHADOWVOLLEY);
+ ShadowVolley_Timer = 4000 + rand()%2000;
+ } else ShadowVolley_Timer -= diff;
- //VoidBolt_Timer
- if (VoidBolt_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_VOIDBOLT);
- VoidBolt_Timer = 15000 + rand()%3000;
- } else VoidBolt_Timer -= diff;
+ //Cleave_Timer
+ if (Cleave_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_CLEAVE);
+ Cleave_Timer = 8000 + rand()%4000;
+ } else Cleave_Timer -= diff;
- //MarkOfKazzak_Timer
- if (MarkOfKazzak_Timer <= diff)
- {
- Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (victim->GetPower(POWER_MANA))
+ //ThunderClap_Timer
+ if (ThunderClap_Timer <= diff)
{
- DoCast(victim, SPELL_MARKOFKAZZAK);
- MarkOfKazzak_Timer = 20000;
- }
- } else MarkOfKazzak_Timer -= diff;
+ DoCast(me->getVictim(), SPELL_THUNDERCLAP);
+ ThunderClap_Timer = 10000 + rand()%4000;
+ } else ThunderClap_Timer -= diff;
- //Enrage_Timer
- if (Enrage_Timer <= diff)
- {
- DoScriptText(EMOTE_FRENZY, me);
- DoCast(me, SPELL_ENRAGE);
- Enrage_Timer = 30000;
- } else Enrage_Timer -= diff;
+ //VoidBolt_Timer
+ if (VoidBolt_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_VOIDBOLT);
+ VoidBolt_Timer = 15000 + rand()%3000;
+ } else VoidBolt_Timer -= diff;
- if (Twisted_Reflection_Timer <= diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_TWISTEDREFLECTION);
- Twisted_Reflection_Timer = 15000;
- } else Twisted_Reflection_Timer -= diff;
+ //MarkOfKazzak_Timer
+ if (MarkOfKazzak_Timer <= diff)
+ {
+ Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (victim->GetPower(POWER_MANA))
+ {
+ DoCast(victim, SPELL_MARKOFKAZZAK);
+ MarkOfKazzak_Timer = 20000;
+ }
+ } else MarkOfKazzak_Timer -= diff;
+
+ //Enrage_Timer
+ if (Enrage_Timer <= diff)
+ {
+ DoScriptText(EMOTE_FRENZY, me);
+ DoCast(me, SPELL_ENRAGE);
+ Enrage_Timer = 30000;
+ } else Enrage_Timer -= diff;
- DoMeleeAttackIfReady();
- }
+ if (Twisted_Reflection_Timer <= diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_TWISTEDREFLECTION);
+ Twisted_Reflection_Timer = 15000;
+ } else Twisted_Reflection_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+ };
};
-CreatureAI* GetAI_boss_doomlordkazzak(Creature* pCreature)
-{
- return new boss_doomlordkazzakAI (pCreature);
-}
void AddSC_boss_doomlordkazzak()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_doomlord_kazzak";
- newscript->GetAI = &GetAI_boss_doomlordkazzak;
- newscript->RegisterSelf();
+ new boss_doomlord_kazzak();
}
-
diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp
index a51cab3426b..1b375ebfcd7 100644
--- a/src/server/scripts/Outland/boss_doomwalker.cpp
+++ b/src/server/scripts/Outland/boss_doomwalker.cpp
@@ -42,139 +42,141 @@ EndScriptData */
#define SPELL_ENRAGE 33653
#define SPELL_MARK_DEATH 37128
#define SPELL_AURA_DEATH 37131
-
-struct boss_doomwalkerAI : public ScriptedAI
+ class boss_doomwalker : public CreatureScript
{
- boss_doomwalkerAI(Creature *c) : ScriptedAI(c) {}
-
- uint32 Chain_Timer;
- uint32 Enrage_Timer;
- uint32 Overrun_Timer;
- uint32 Quake_Timer;
- uint32 Armor_Timer;
-
- bool InEnrage;
+public:
+ boss_doomwalker() : CreatureScript("boss_doomwalker") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Enrage_Timer = 0;
- Armor_Timer = 5000 + rand()%8000;
- Chain_Timer = 10000 + rand()%20000;
- Quake_Timer = 25000 + rand()%10000;
- Overrun_Timer = 30000 + rand()%15000;
-
- InEnrage = false;
+ return new boss_doomwalkerAI (pCreature);
}
- void KilledUnit(Unit* Victim)
+ struct boss_doomwalkerAI : public ScriptedAI
{
- Victim->CastSpell(Victim,SPELL_MARK_DEATH,0);
+ boss_doomwalkerAI(Creature *c) : ScriptedAI(c) {}
- if (rand()%5)
- return;
+ uint32 Chain_Timer;
+ uint32 Enrage_Timer;
+ uint32 Overrun_Timer;
+ uint32 Quake_Timer;
+ uint32 Armor_Timer;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
- }
+ bool InEnrage;
- void JustDied(Unit* /*Killer*/)
- {
- DoScriptText(SAY_DEATH, me);
- }
+ void Reset()
+ {
+ Enrage_Timer = 0;
+ Armor_Timer = 5000 + rand()%8000;
+ Chain_Timer = 10000 + rand()%20000;
+ Quake_Timer = 25000 + rand()%10000;
+ Overrun_Timer = 30000 + rand()%15000;
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
- }
+ InEnrage = false;
+ }
- void MoveInLineOfSight(Unit *who)
- {
- if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who))
+ void KilledUnit(Unit* Victim)
{
- if (who->HasAura(SPELL_MARK_DEATH,0))
- {
- who->CastSpell(who,SPELL_AURA_DEATH,1);
- }
- }
- }
+ Victim->CastSpell(Victim,SPELL_MARK_DEATH,0);
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ if (rand()%5)
+ return;
+
+ DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
+ }
- //Spell Enrage, when hp <= 20% gain enrage
- if (((me->GetHealth()*100)/ me->GetMaxHealth()) <= 20)
+ void JustDied(Unit* /*Killer*/)
{
- if (Enrage_Timer <= diff)
- {
- DoCast(me, SPELL_ENRAGE);
- Enrage_Timer = 6000;
- InEnrage = true;
- } else Enrage_Timer -= diff;
+ DoScriptText(SAY_DEATH, me);
}
- //Spell Overrun
- if (Overrun_Timer <= diff)
+ void EnterCombat(Unit * /*who*/)
{
- DoScriptText(RAND(SAY_OVERRUN_1,SAY_OVERRUN_2), me);
+ DoScriptText(SAY_AGGRO, me);
+ }
- DoCast(me->getVictim(), SPELL_OVERRUN);
- Overrun_Timer = 25000 + rand()%15000;
- } else Overrun_Timer -= diff;
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who))
+ {
+ if (who->HasAura(SPELL_MARK_DEATH,0))
+ {
+ who->CastSpell(who,SPELL_AURA_DEATH,1);
+ }
+ }
+ }
- //Spell Earthquake
- if (Quake_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (rand()%2)
+ if (!UpdateVictim())
return;
- DoScriptText(RAND(SAY_EARTHQUAKE_1,SAY_EARTHQUAKE_2), me);
+ //Spell Enrage, when hp <= 20% gain enrage
+ if (((me->GetHealth()*100)/ me->GetMaxHealth()) <= 20)
+ {
+ if (Enrage_Timer <= diff)
+ {
+ DoCast(me, SPELL_ENRAGE);
+ Enrage_Timer = 6000;
+ InEnrage = true;
+ } else Enrage_Timer -= diff;
+ }
- //remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead
- if (InEnrage)
- me->RemoveAura(SPELL_ENRAGE);
+ //Spell Overrun
+ if (Overrun_Timer <= diff)
+ {
+ DoScriptText(RAND(SAY_OVERRUN_1,SAY_OVERRUN_2), me);
- DoCast(me, SPELL_EARTHQUAKE);
- Quake_Timer = 30000 + rand()%25000;
- } else Quake_Timer -= diff;
+ DoCast(me->getVictim(), SPELL_OVERRUN);
+ Overrun_Timer = 25000 + rand()%15000;
+ } else Overrun_Timer -= diff;
- //Spell Chain Lightning
- if (Chain_Timer <= diff)
- {
- Unit *pTarget = NULL;
- pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
+ //Spell Earthquake
+ if (Quake_Timer <= diff)
+ {
+ if (rand()%2)
+ return;
- if (!pTarget)
- pTarget = me->getVictim();
+ DoScriptText(RAND(SAY_EARTHQUAKE_1,SAY_EARTHQUAKE_2), me);
- if (pTarget)
- DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
+ //remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead
+ if (InEnrage)
+ me->RemoveAura(SPELL_ENRAGE);
- Chain_Timer = 7000 + rand()%20000;
- } else Chain_Timer -= diff;
+ DoCast(me, SPELL_EARTHQUAKE);
+ Quake_Timer = 30000 + rand()%25000;
+ } else Quake_Timer -= diff;
- //Spell Sunder Armor
- if (Armor_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SUNDER_ARMOR);
- Armor_Timer = 10000 + rand()%15000;
- } else Armor_Timer -= diff;
+ //Spell Chain Lightning
+ if (Chain_Timer <= diff)
+ {
+ Unit *pTarget = NULL;
+ pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
+
+ if (!pTarget)
+ pTarget = me->getVictim();
+
+ if (pTarget)
+ DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
+
+ Chain_Timer = 7000 + rand()%20000;
+ } else Chain_Timer -= diff;
+
+ //Spell Sunder Armor
+ if (Armor_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SUNDER_ARMOR);
+ Armor_Timer = 10000 + rand()%15000;
+ } else Armor_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_doomwalker(Creature* pCreature)
-{
- return new boss_doomwalkerAI (pCreature);
-}
void AddSC_boss_doomwalker()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_doomwalker";
- newscript->GetAI = &GetAI_boss_doomwalker;
- newscript->RegisterSelf();
+ new boss_doomwalker();
}
-
diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp
index c3710739926..853da20e3e0 100644
--- a/src/server/scripts/Outland/hellfire_peninsula.cpp
+++ b/src/server/scripts/Outland/hellfire_peninsula.cpp
@@ -53,72 +53,79 @@ enum eAeranas
C_AERANAS = 17085
};
-
-struct npc_aeranasAI : public ScriptedAI
+ class npc_aeranas : public CreatureScript
{
- npc_aeranasAI(Creature* c) : ScriptedAI(c) {}
-
- uint32 Faction_Timer;
- uint32 EnvelopingWinds_Timer;
- uint32 Shock_Timer;
+public:
+ npc_aeranas() : CreatureScript("npc_aeranas") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Faction_Timer = 8000;
- EnvelopingWinds_Timer = 9000;
- Shock_Timer = 5000;
-
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- me->setFaction(FACTION_FRIENDLY);
-
- DoScriptText(SAY_SUMMON, me);
+ return new npc_aeranasAI (pCreature);
}
- void UpdateAI(const uint32 diff)
+ struct npc_aeranasAI : public ScriptedAI
{
- if (Faction_Timer)
- {
- if (Faction_Timer <= diff)
- {
- me->setFaction(FACTION_HOSTILE);
- Faction_Timer = 0;
- } else Faction_Timer -= diff;
- }
+ npc_aeranasAI(Creature* c) : ScriptedAI(c) {}
- if (!UpdateVictim())
- return;
+ uint32 Faction_Timer;
+ uint32 EnvelopingWinds_Timer;
+ uint32 Shock_Timer;
- if ((me->GetHealth()*100) / me->GetMaxHealth() < 30)
+ void Reset()
{
+ Faction_Timer = 8000;
+ EnvelopingWinds_Timer = 9000;
+ Shock_Timer = 5000;
+
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
me->setFaction(FACTION_FRIENDLY);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- me->RemoveAllAuras();
- me->DeleteThreatList();
- me->CombatStop(true);
- DoScriptText(SAY_FREE, me);
- return;
+
+ DoScriptText(SAY_SUMMON, me);
}
- if (Shock_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me->getVictim(), SPELL_SHOCK);
- Shock_Timer = 10000;
- } else Shock_Timer -= diff;
+ if (Faction_Timer)
+ {
+ if (Faction_Timer <= diff)
+ {
+ me->setFaction(FACTION_HOSTILE);
+ Faction_Timer = 0;
+ } else Faction_Timer -= diff;
+ }
- if (EnvelopingWinds_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_ENVELOPING_WINDS);
- EnvelopingWinds_Timer = 25000;
- } else EnvelopingWinds_Timer -= diff;
+ if (!UpdateVictim())
+ return;
+
+ if ((me->GetHealth()*100) / me->GetMaxHealth() < 30)
+ {
+ me->setFaction(FACTION_FRIENDLY);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ DoScriptText(SAY_FREE, me);
+ return;
+ }
+
+ if (Shock_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SHOCK);
+ Shock_Timer = 10000;
+ } else Shock_Timer -= diff;
+
+ if (EnvelopingWinds_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ENVELOPING_WINDS);
+ EnvelopingWinds_Timer = 25000;
+ } else EnvelopingWinds_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_npc_aeranas(Creature* pCreature)
-{
- return new npc_aeranasAI (pCreature);
-}
/*######
## npc_ancestral_wolf
@@ -134,68 +141,81 @@ enum eAncestralWolf
NPC_RYGA = 17123
};
-
-struct npc_ancestral_wolfAI : public npc_escortAI
+ class npc_ancestral_wolf : public CreatureScript
{
- npc_ancestral_wolfAI(Creature* pCreature) : npc_escortAI(pCreature)
- {
- if (pCreature->GetOwner() && pCreature->GetOwner()->GetTypeId() == TYPEID_PLAYER)
- Start(false, false, pCreature->GetOwner()->GetGUID());
- else
- sLog.outError("TRINITY: npc_ancestral_wolf can not obtain owner or owner is not a player.");
-
- pCreature->SetSpeed(MOVE_WALK, 1.5f);
- Reset();
- }
-
- Unit* pRyga;
+public:
+ npc_ancestral_wolf() : CreatureScript("npc_ancestral_wolf") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- pRyga = NULL;
- DoCast(me, SPELL_ANCESTRAL_WOLF_BUFF, true);
+ return new npc_ancestral_wolfAI(pCreature);
}
- void MoveInLineOfSight(Unit* pWho)
+ struct npc_ancestral_wolfAI : public npc_escortAI
{
- if (!pRyga && pWho->GetTypeId() == TYPEID_UNIT && pWho->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(pWho, 15.0f))
- pRyga = pWho;
+ npc_ancestral_wolfAI(Creature* pCreature) : npc_escortAI(pCreature)
+ {
+ if (pCreature->GetOwner() && pCreature->GetOwner()->GetTypeId() == TYPEID_PLAYER)
+ Start(false, false, pCreature->GetOwner()->GetGUID());
+ else
+ sLog.outError("TRINITY: npc_ancestral_wolf can not obtain owner or owner is not a player.");
- npc_escortAI::MoveInLineOfSight(pWho);
- }
+ pCreature->SetSpeed(MOVE_WALK, 1.5f);
+ Reset();
+ }
- void WaypointReached(uint32 uiPointId)
- {
- switch(uiPointId)
+ Unit* pRyga;
+
+ void Reset()
{
- case 0:
- DoScriptText(EMOTE_WOLF_LIFT_HEAD, me);
- break;
- case 2:
- DoScriptText(EMOTE_WOLF_HOWL, me);
- break;
- case 50:
- if (pRyga && pRyga->isAlive() && !pRyga->isInCombat())
- DoScriptText(SAY_WOLF_WELCOME, pRyga);
- break;
+ pRyga = NULL;
+ DoCast(me, SPELL_ANCESTRAL_WOLF_BUFF, true);
}
- }
+
+ void MoveInLineOfSight(Unit* pWho)
+ {
+ if (!pRyga && pWho->GetTypeId() == TYPEID_UNIT && pWho->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(pWho, 15.0f))
+ pRyga = pWho;
+
+ npc_escortAI::MoveInLineOfSight(pWho);
+ }
+
+ void WaypointReached(uint32 uiPointId)
+ {
+ switch(uiPointId)
+ {
+ case 0:
+ DoScriptText(EMOTE_WOLF_LIFT_HEAD, me);
+ break;
+ case 2:
+ DoScriptText(EMOTE_WOLF_HOWL, me);
+ break;
+ case 50:
+ if (pRyga && pRyga->isAlive() && !pRyga->isInCombat())
+ DoScriptText(SAY_WOLF_WELCOME, pRyga);
+ break;
+ }
+ }
+ };
+
};
-CreatureAI* GetAI_npc_ancestral_wolf(Creature* pCreature)
-{
- return new npc_ancestral_wolfAI(pCreature);
-}
/*######
## go_haaleshi_altar
######*/
-
-bool GOHello_go_haaleshi_altar(Player* /*pPlayer*/, GameObject* pGo)
+ class go_haaleshi_altar : public GameObjectScript
{
- pGo->SummonCreature(C_AERANAS,-1321.79, 4043.80, 116.24, 1.25, TEMPSUMMON_TIMED_DESPAWN, 180000);
- return false;
-}
+public:
+ go_haaleshi_altar() : GameObjectScript("go_haaleshi_altar") { }
+
+ bool OnGossipHello(Player* /*pPlayer*/, GameObject* pGo)
+ {
+ pGo->SummonCreature(C_AERANAS,-1321.79, 4043.80, 116.24, 1.25, TEMPSUMMON_TIMED_DESPAWN, 180000);
+ return false;
+ }
+
+};
/*######
## npc_naladu
@@ -207,24 +227,31 @@ enum eNaladu
{
GOSSIP_TEXTID_NALADU1 = 9788
};
-
-bool GossipHello_npc_naladu(Player* pPlayer, Creature* pCreature)
+ class npc_naladu : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+public:
+ npc_naladu() : CreatureScript("npc_naladu") { }
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NALADU_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- return true;
-}
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_NALADU1, pCreature->GetGUID());
-bool GossipSelect_npc_naladu(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
- pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_NALADU1, pCreature->GetGUID());
+ return true;
+ }
+
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NALADU_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
+ }
+
+};
- return true;
-}
/*######
## npc_tracy_proudwell
@@ -239,40 +266,47 @@ enum eTracy
GOSSIP_TEXTID_TRACY_PROUDWELL1 = 10689,
QUEST_DIGGING_FOR_PRAYER_BEADS = 10916
};
-
-bool GossipHello_npc_tracy_proudwell(Player* pPlayer, Creature* pCreature)
+ class npc_tracy_proudwell : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+public:
+ npc_tracy_proudwell() : CreatureScript("npc_tracy_proudwell") { }
- if (pCreature->isVendor())
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_REDEEM_MARKS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- if (pPlayer->GetQuestStatus(QUEST_DIGGING_FOR_PRAYER_BEADS) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ switch(uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TRACY_PROUDWELL1, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_TRADE:
+ pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
+ break;
+ }
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- return true;
-}
+ return true;
+ }
-bool GossipSelect_npc_tracy_proudwell(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch(uiAction)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TRACY_PROUDWELL1, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_TRADE:
- pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
- break;
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+
+ if (pCreature->isVendor())
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_REDEEM_MARKS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ if (pPlayer->GetQuestStatus(QUEST_DIGGING_FOR_PRAYER_BEADS) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
}
- return true;
-}
+};
+
/*######
## npc_trollbane
@@ -288,36 +322,43 @@ enum eTrollbane
GOSSIP_TEXTID_TROLLBANE2 = 9933,
GOSSIP_TEXTID_TROLLBANE3 = 8772
};
-
-bool GossipHello_npc_trollbane(Player* pPlayer, Creature* pCreature)
+ class npc_trollbane : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+public:
+ npc_trollbane() : CreatureScript("npc_trollbane") { }
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- return true;
-}
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ switch(uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE1, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE2, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE3, pCreature->GetGUID());
+ break;
+ }
-bool GossipSelect_npc_trollbane(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch(uiAction)
+ return true;
+ }
+
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE1, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE2, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE3, pCreature->GetGUID());
- break;
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
}
- return true;
-}
+};
+
/*######
## npc_wounded_blood_elf
@@ -334,78 +375,86 @@ enum eWoundedBloodElf
QUEST_ROAD_TO_FALCON_WATCH = 9375
};
-
-struct npc_wounded_blood_elfAI : public npc_escortAI
+ class npc_wounded_blood_elf : public CreatureScript
{
- npc_wounded_blood_elfAI(Creature *c) : npc_escortAI(c) {}
+public:
+ npc_wounded_blood_elf() : CreatureScript("npc_wounded_blood_elf") { }
- void WaypointReached(uint32 i)
+ bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const* quest)
{
- Player* pPlayer = GetPlayerForEscort();
-
- if (!pPlayer)
- return;
-
- switch (i)
+ if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH)
{
- case 0:
- DoScriptText(SAY_ELF_START, me, pPlayer);
- break;
- case 9:
- DoScriptText(SAY_ELF_SUMMON1, me, pPlayer);
- // Spawn two Haal'eshi Talonguard
- DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- break;
- case 13:
- DoScriptText(SAY_ELF_RESTING, me, pPlayer);
- break;
- case 14:
- DoScriptText(SAY_ELF_SUMMON2, me, pPlayer);
- // Spawn two Haal'eshi Windwalker
- DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- break;
- case 27:
- DoScriptText(SAY_ELF_COMPLETE, me, pPlayer);
- // Award quest credit
- pPlayer->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,me);
- break;
+ if (npc_escortAI* pEscortAI = CAST_AI(npc_wounded_blood_elf::npc_wounded_blood_elfAI, pCreature->AI()))
+ pEscortAI->Start(true, false, pPlayer->GetGUID());
+
+ // Change faction so mobs attack
+ pCreature->setFaction(775);
}
- }
- void Reset() { }
+ return true;
+ }
- void EnterCombat(Unit* /*who*/)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (HasEscortState(STATE_ESCORT_ESCORTING))
- DoScriptText(SAY_ELF_AGGRO, me);
+ return new npc_wounded_blood_elfAI(pCreature);
}
- void JustSummoned(Creature* summoned)
+ struct npc_wounded_blood_elfAI : public npc_escortAI
{
- summoned->AI()->AttackStart(me);
- }
-};
+ npc_wounded_blood_elfAI(Creature *c) : npc_escortAI(c) {}
-CreatureAI* GetAI_npc_wounded_blood_elf(Creature* pCreature)
-{
- return new npc_wounded_blood_elfAI(pCreature);
-}
+ void WaypointReached(uint32 i)
+ {
+ Player* pPlayer = GetPlayerForEscort();
-bool QuestAccept_npc_wounded_blood_elf(Player* pPlayer, Creature* pCreature, Quest const* quest)
-{
- if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH)
- {
- if (npc_escortAI* pEscortAI = CAST_AI(npc_wounded_blood_elfAI, pCreature->AI()))
- pEscortAI->Start(true, false, pPlayer->GetGUID());
+ if (!pPlayer)
+ return;
+
+ switch (i)
+ {
+ case 0:
+ DoScriptText(SAY_ELF_START, me, pPlayer);
+ break;
+ case 9:
+ DoScriptText(SAY_ELF_SUMMON1, me, pPlayer);
+ // Spawn two Haal'eshi Talonguard
+ DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ break;
+ case 13:
+ DoScriptText(SAY_ELF_RESTING, me, pPlayer);
+ break;
+ case 14:
+ DoScriptText(SAY_ELF_SUMMON2, me, pPlayer);
+ // Spawn two Haal'eshi Windwalker
+ DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ break;
+ case 27:
+ DoScriptText(SAY_ELF_COMPLETE, me, pPlayer);
+ // Award quest credit
+ pPlayer->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,me);
+ break;
+ }
+ }
+
+ void Reset() { }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ if (HasEscortState(STATE_ESCORT_ESCORTING))
+ DoScriptText(SAY_ELF_AGGRO, me);
+ }
+
+ void JustSummoned(Creature* summoned)
+ {
+ summoned->AI()->AttackStart(me);
+ }
+ };
+
+};
- // Change faction so mobs attack
- pCreature->setFaction(775);
- }
- return true;
-}
/*######
## npc_fel_guard_hound
@@ -417,108 +466,77 @@ enum eFelGuard
NPC_DERANGED_HELBOAR = 16863
};
-
-struct npc_fel_guard_houndAI : public ScriptedAI
+ class npc_fel_guard_hound : public CreatureScript
{
- npc_fel_guard_houndAI(Creature* pCreature) : ScriptedAI(pCreature) {}
-
- uint32 uiCheckTimer;
- uint64 uiHelboarGUID;
+public:
+ npc_fel_guard_hound() : CreatureScript("npc_fel_guard_hound") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- uiCheckTimer = 5000; //check for creature every 5 sec
- uiHelboarGUID = 0;
+ return new npc_fel_guard_houndAI(pCreature);
}
- void MovementInform(uint32 uiType, uint32 uiId)
+ struct npc_fel_guard_houndAI : public ScriptedAI
{
- if (uiType != POINT_MOTION_TYPE || uiId != 1)
- return;
+ npc_fel_guard_houndAI(Creature* pCreature) : ScriptedAI(pCreature) {}
+
+ uint32 uiCheckTimer;
+ uint64 uiHelboarGUID;
+
+ void Reset()
+ {
+ uiCheckTimer = 5000; //check for creature every 5 sec
+ uiHelboarGUID = 0;
+ }
- if (Creature* pHelboar = me->GetCreature(*me,uiHelboarGUID))
+ void MovementInform(uint32 uiType, uint32 uiId)
{
- pHelboar->RemoveCorpse();
- DoCast(SPELL_SUMMON_POO);
+ if (uiType != POINT_MOTION_TYPE || uiId != 1)
+ return;
- if (Player* pOwner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
- me->GetMotionMaster()->MoveFollow(pOwner,0.0f,0.0f);
+ if (Creature* pHelboar = me->GetCreature(*me,uiHelboarGUID))
+ {
+ pHelboar->RemoveCorpse();
+ DoCast(SPELL_SUMMON_POO);
+
+ if (Player* pOwner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
+ me->GetMotionMaster()->MoveFollow(pOwner,0.0f,0.0f);
+ }
}
- }
- void UpdateAI(const uint32 uiDiff)
- {
- if (uiCheckTimer <= uiDiff)
+ void UpdateAI(const uint32 uiDiff)
{
- if (Creature* pHelboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
+ if (uiCheckTimer <= uiDiff)
{
- if (pHelboar->GetGUID() != uiHelboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
+ if (Creature* pHelboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
{
- uiHelboarGUID = pHelboar->GetGUID();
- me->GetMotionMaster()->MovePoint(1,pHelboar->GetPositionX(),pHelboar->GetPositionY(),pHelboar->GetPositionZ());
+ if (pHelboar->GetGUID() != uiHelboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
+ {
+ uiHelboarGUID = pHelboar->GetGUID();
+ me->GetMotionMaster()->MovePoint(1,pHelboar->GetPositionX(),pHelboar->GetPositionY(),pHelboar->GetPositionZ());
+ }
}
- }
- uiCheckTimer = 5000;
- }else uiCheckTimer -= uiDiff;
+ uiCheckTimer = 5000;
+ }else uiCheckTimer -= uiDiff;
- if (!UpdateVictim())
- return;
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_npc_fel_guard_hound(Creature* pCreature)
-{
- return new npc_fel_guard_houndAI(pCreature);
-}
void AddSC_hellfire_peninsula()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "npc_aeranas";
- newscript->GetAI = &GetAI_npc_aeranas;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_ancestral_wolf";
- newscript->GetAI = &GetAI_npc_ancestral_wolf;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "go_haaleshi_altar";
- newscript->pGOHello = &GOHello_go_haaleshi_altar;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_naladu";
- newscript->pGossipHello = &GossipHello_npc_naladu;
- newscript->pGossipSelect = &GossipSelect_npc_naladu;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_tracy_proudwell";
- newscript->pGossipHello = &GossipHello_npc_tracy_proudwell;
- newscript->pGossipSelect = &GossipSelect_npc_tracy_proudwell;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_trollbane";
- newscript->pGossipHello = &GossipHello_npc_trollbane;
- newscript->pGossipSelect = &GossipSelect_npc_trollbane;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_wounded_blood_elf";
- newscript->GetAI = &GetAI_npc_wounded_blood_elf;
- newscript->pQuestAccept = &QuestAccept_npc_wounded_blood_elf;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name="npc_fel_guard_hound";
- newscript->GetAI = &GetAI_npc_fel_guard_hound;
- newscript->RegisterSelf();
+ new npc_aeranas();
+ new npc_ancestral_wolf();
+ new go_haaleshi_altar();
+ new npc_naladu();
+ new npc_tracy_proudwell();
+ new npc_trollbane();
+ new npc_wounded_blood_elf();
+ new npc_fel_guard_hound();
}
-
diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp
index b4c8b76c557..660ae4453cb 100644
--- a/src/server/scripts/Outland/nagrand.cpp
+++ b/src/server/scripts/Outland/nagrand.cpp
@@ -41,41 +41,48 @@ EndContentData */
/*######
## mob_shattered_rumbler - this should be done with ACID
######*/
-
-struct mob_shattered_rumblerAI : public ScriptedAI
+ class mob_shattered_rumbler : public CreatureScript
{
- bool Spawn;
-
- mob_shattered_rumblerAI(Creature *c) : ScriptedAI(c) {}
+public:
+ mob_shattered_rumbler() : CreatureScript("mob_shattered_rumbler") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Spawn = false;
+ return new mob_shattered_rumblerAI (pCreature);
}
- void EnterCombat(Unit* /*who*/) {}
-
- void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
+ struct mob_shattered_rumblerAI : public ScriptedAI
{
- if (Spellkind->Id == 32001 && !Spawn)
+ bool Spawn;
+
+ mob_shattered_rumblerAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset()
{
- float x = me->GetPositionX();
- float y = me->GetPositionY();
- float z = me->GetPositionZ();
-
- Hitter->SummonCreature(18181,x+(0.7 * (rand()%30)),y+(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
- Hitter->SummonCreature(18181,x+(rand()%5),y-(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
- Hitter->SummonCreature(18181,x-(rand()%5),y+(0.5 *(rand()%60)),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
- me->setDeathState(CORPSE);
- Spawn = true;
+ Spawn = false;
}
- return;
- }
+
+ void EnterCombat(Unit* /*who*/) {}
+
+ void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
+ {
+ if (Spellkind->Id == 32001 && !Spawn)
+ {
+ float x = me->GetPositionX();
+ float y = me->GetPositionY();
+ float z = me->GetPositionZ();
+
+ Hitter->SummonCreature(18181,x+(0.7 * (rand()%30)),y+(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
+ Hitter->SummonCreature(18181,x+(rand()%5),y-(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
+ Hitter->SummonCreature(18181,x-(rand()%5),y+(0.5 *(rand()%60)),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000);
+ me->setDeathState(CORPSE);
+ Spawn = true;
+ }
+ return;
+ }
+ };
+
};
-CreatureAI* GetAI_mob_shattered_rumbler(Creature* pCreature)
-{
- return new mob_shattered_rumblerAI (pCreature);
-}
/*######
## mob_lump
@@ -93,169 +100,185 @@ CreatureAI* GetAI_mob_shattered_rumbler(Creature* pCreature)
#define GOSSIP_SL1 "Why are Boulderfist out this far? You know that this is Kurenai territory."
#define GOSSIP_SL2 "And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar."
#define GOSSIP_SL3 "This means war, Lump! War I say!"
-
-struct mob_lumpAI : public ScriptedAI
+ class mob_lump : public CreatureScript
{
- mob_lumpAI(Creature *c) : ScriptedAI(c)
+public:
+ mob_lump() : CreatureScript("mob_lump") { }
+
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- bReset = false;
+ switch (uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ pPlayer->SEND_GOSSIP_MENU(9353, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ pPlayer->SEND_GOSSIP_MENU(9354, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ pPlayer->SEND_GOSSIP_MENU(9355, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ pPlayer->SEND_GOSSIP_MENU(9356, pCreature->GetGUID());
+ pPlayer->TalkedToCreature(18354, pCreature->GetGUID());
+ break;
+ }
+ return true;
}
- uint32 Reset_Timer;
- uint32 Spear_Throw_Timer;
- bool bReset;
-
- void Reset()
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- Reset_Timer = 60000;
- Spear_Throw_Timer = 2000;
+ if (pPlayer->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ pPlayer->SEND_GOSSIP_MENU(9352, pCreature->GetGUID());
+
+ return true;
}
- void AttackedBy(Unit* pAttacker)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (me->getVictim())
- return;
-
- if (me->IsFriendlyTo(pAttacker))
- return;
-
- AttackStart(pAttacker);
+ return new mob_lumpAI(pCreature);
}
- void DamageTaken(Unit *done_by, uint32 & damage)
+ struct mob_lumpAI : public ScriptedAI
{
- if (done_by->GetTypeId() == TYPEID_PLAYER && (me->GetHealth() - damage)*100 / me->GetMaxHealth() < 30)
+ mob_lumpAI(Creature *c) : ScriptedAI(c)
{
- if (!bReset && CAST_PLR(done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
- {
- //Take 0 damage
- damage = 0;
-
- CAST_PLR(done_by)->AttackStop();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->RemoveAllAuras();
- me->DeleteThreatList();
- me->CombatStop(true);
- me->setFaction(1080); //friendly
- me->SetStandState(UNIT_STAND_STATE_SIT);
- DoScriptText(LUMP_DEFEAT, me);
-
- bReset = true;
- }
+ bReset = false;
}
- }
- void EnterCombat(Unit * /*who*/)
- {
- if (me->HasAura(SPELL_VISUAL_SLEEP))
- me->RemoveAura(SPELL_VISUAL_SLEEP);
+ uint32 Reset_Timer;
+ uint32 Spear_Throw_Timer;
+ bool bReset;
- if (!me->IsStandState())
- me->SetStandState(UNIT_STAND_STATE_STAND);
+ void Reset()
+ {
+ Reset_Timer = 60000;
+ Spear_Throw_Timer = 2000;
- DoScriptText(RAND(LUMP_SAY0,LUMP_SAY1), me);
- }
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
- void UpdateAI(const uint32 diff)
- {
- //check if we waiting for a reset
- if (bReset)
+ void AttackedBy(Unit* pAttacker)
{
- if (Reset_Timer <= diff)
- {
- EnterEvadeMode();
- bReset = false;
- me->setFaction(1711); //hostile
+ if (me->getVictim())
return;
+
+ if (me->IsFriendlyTo(pAttacker))
+ return;
+
+ AttackStart(pAttacker);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 & damage)
+ {
+ if (done_by->GetTypeId() == TYPEID_PLAYER && (me->GetHealth() - damage)*100 / me->GetMaxHealth() < 30)
+ {
+ if (!bReset && CAST_PLR(done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
+ {
+ //Take 0 damage
+ damage = 0;
+
+ CAST_PLR(done_by)->AttackStop();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ me->setFaction(1080); //friendly
+ me->SetStandState(UNIT_STAND_STATE_SIT);
+ DoScriptText(LUMP_DEFEAT, me);
+
+ bReset = true;
+ }
}
- else Reset_Timer -= diff;
}
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ void EnterCombat(Unit * /*who*/)
+ {
+ if (me->HasAura(SPELL_VISUAL_SLEEP))
+ me->RemoveAura(SPELL_VISUAL_SLEEP);
- //Spear_Throw_Timer
- if (Spear_Throw_Timer <= diff)
+ if (!me->IsStandState())
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+
+ DoScriptText(RAND(LUMP_SAY0,LUMP_SAY1), me);
+ }
+
+ void UpdateAI(const uint32 diff)
{
- DoCast(me->getVictim(), SPELL_SPEAR_THROW);
- Spear_Throw_Timer = 20000;
- } else Spear_Throw_Timer -= diff;
+ //check if we waiting for a reset
+ if (bReset)
+ {
+ if (Reset_Timer <= diff)
+ {
+ EnterEvadeMode();
+ bReset = false;
+ me->setFaction(1711); //hostile
+ return;
+ }
+ else Reset_Timer -= diff;
+ }
- DoMeleeAttackIfReady();
- }
-};
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
-CreatureAI* GetAI_mob_lump(Creature* pCreature)
-{
- return new mob_lumpAI(pCreature);
-}
+ //Spear_Throw_Timer
+ if (Spear_Throw_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SPEAR_THROW);
+ Spear_Throw_Timer = 20000;
+ } else Spear_Throw_Timer -= diff;
-bool GossipHello_mob_lump(Player* pPlayer, Creature* pCreature)
-{
- if (pPlayer->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ DoMeleeAttackIfReady();
+ }
+ };
+
+};
- pPlayer->SEND_GOSSIP_MENU(9352, pCreature->GetGUID());
- return true;
-}
-bool GossipSelect_mob_lump(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- pPlayer->SEND_GOSSIP_MENU(9353, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- pPlayer->SEND_GOSSIP_MENU(9354, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- pPlayer->SEND_GOSSIP_MENU(9355, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- pPlayer->SEND_GOSSIP_MENU(9356, pCreature->GetGUID());
- pPlayer->TalkedToCreature(18354, pCreature->GetGUID());
- break;
- }
- return true;
-}
/*####
# mob_sunspring_villager - should be done with ACID
####*/
-
-struct mob_sunspring_villagerAI : public ScriptedAI
+ class mob_sunspring_villager : public CreatureScript
{
- mob_sunspring_villagerAI(Creature *c) : ScriptedAI(c) {}
+public:
+ mob_sunspring_villager() : CreatureScript("mob_sunspring_villager") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
- me->SetStandState(UNIT_STAND_STATE_DEAD);
+ return new mob_sunspring_villagerAI (pCreature);
}
- void EnterCombat(Unit * /*who*/) {}
-
- void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
+ struct mob_sunspring_villagerAI : public ScriptedAI
{
- if (spell->Id == 32146)
+ mob_sunspring_villagerAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset()
{
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- me->RemoveCorpse();
+ me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
+ me->SetStandState(UNIT_STAND_STATE_DEAD);
}
- }
+
+ void EnterCombat(Unit * /*who*/) {}
+
+ void SpellHit(Unit * /*caster*/, const SpellEntry *spell)
+ {
+ if (spell->Id == 32146)
+ {
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveCorpse();
+ }
+ }
+ };
+
};
-CreatureAI* GetAI_mob_sunspring_villager(Creature* pCreature)
-{
- return new mob_sunspring_villagerAI (pCreature);
-}
/*######
## npc_altruis_the_sufferer
@@ -271,83 +294,91 @@ CreatureAI* GetAI_mob_sunspring_villager(Creature* pCreature)
#define GOSSIP_SATS4 "Forge camps?"
#define GOSSIP_SATS5 "Ok."
#define GOSSIP_SATS6 "[PH] Story done"
-
-bool GossipHello_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature)
+ class npc_altruis_the_sufferer : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
-
- //gossip before obtaining Survey the Land
- if (pPlayer->GetQuestStatus(9991) == QUEST_STATUS_NONE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
-
- //gossip when Survey the Land is incomplete (technically, after the flight)
- if (pPlayer->GetQuestStatus(9991) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
+public:
+ npc_altruis_the_sufferer() : CreatureScript("npc_altruis_the_sufferer") { }
- //wowwiki.com/Varedis
- if (pPlayer->GetQuestStatus(10646) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+30);
+ bool OnQuestAccept(Player* pPlayer, Creature* /*pCreature*/, Quest const * /*quest*/)
+ {
+ if (!pPlayer->GetQuestRewardStatus(9991)) //Survey the Land, q-id 9991
+ {
+ pPlayer->CLOSE_GOSSIP_MENU();
+ pPlayer->ActivateTaxiPathTo(532); //TaxiPath 532
+ }
+ return true;
+ }
- pPlayer->SEND_GOSSIP_MENU(9419, pCreature->GetGUID());
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ switch (uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF+10:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ pPlayer->SEND_GOSSIP_MENU(9420, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+11:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ pPlayer->SEND_GOSSIP_MENU(9421, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+12:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ pPlayer->SEND_GOSSIP_MENU(9422, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+13:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
+ pPlayer->SEND_GOSSIP_MENU(9423, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+14:
+ pPlayer->SEND_GOSSIP_MENU(9424, pCreature->GetGUID());
+ break;
- return true;
-}
+ case GOSSIP_ACTION_INFO_DEF+20:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
+ pPlayer->SEND_GOSSIP_MENU(9427, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+21:
+ pPlayer->CLOSE_GOSSIP_MENU();
+ pPlayer->AreaExploredOrEventHappens(9991);
+ break;
-bool GossipSelect_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF+10:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- pPlayer->SEND_GOSSIP_MENU(9420, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- pPlayer->SEND_GOSSIP_MENU(9421, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+12:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
- pPlayer->SEND_GOSSIP_MENU(9422, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+13:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
- pPlayer->SEND_GOSSIP_MENU(9423, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+14:
- pPlayer->SEND_GOSSIP_MENU(9424, pCreature->GetGUID());
- break;
-
- case GOSSIP_ACTION_INFO_DEF+20:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
- pPlayer->SEND_GOSSIP_MENU(9427, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+21:
- pPlayer->CLOSE_GOSSIP_MENU();
- pPlayer->AreaExploredOrEventHappens(9991);
- break;
-
- case GOSSIP_ACTION_INFO_DEF+30:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31);
- pPlayer->SEND_GOSSIP_MENU(384, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+31:
- pPlayer->CLOSE_GOSSIP_MENU();
- pPlayer->AreaExploredOrEventHappens(10646);
- break;
+ case GOSSIP_ACTION_INFO_DEF+30:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31);
+ pPlayer->SEND_GOSSIP_MENU(384, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+31:
+ pPlayer->CLOSE_GOSSIP_MENU();
+ pPlayer->AreaExploredOrEventHappens(10646);
+ break;
+ }
+ return true;
}
- return true;
-}
-bool QuestAccept_npc_altruis_the_sufferer(Player* pPlayer, Creature* /*pCreature*/, Quest const * /*quest*/)
-{
- if (!pPlayer->GetQuestRewardStatus(9991)) //Survey the Land, q-id 9991
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- pPlayer->CLOSE_GOSSIP_MENU();
- pPlayer->ActivateTaxiPathTo(532); //TaxiPath 532
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+
+ //gossip before obtaining Survey the Land
+ if (pPlayer->GetQuestStatus(9991) == QUEST_STATUS_NONE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
+
+ //gossip when Survey the Land is incomplete (technically, after the flight)
+ if (pPlayer->GetQuestStatus(9991) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
+
+ //wowwiki.com/Varedis
+ if (pPlayer->GetQuestStatus(10646) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+30);
+
+ pPlayer->SEND_GOSSIP_MENU(9419, pCreature->GetGUID());
+
+ return true;
}
- return true;
-}
+
+};
+
+
/*######
## npc_greatmother_geyah
@@ -368,89 +399,96 @@ bool QuestAccept_npc_altruis_the_sufferer(Player* pPlayer, Creature* /*pCreature
#define GOSSIP_SGG10 "It is my Warchief, Greatmother. The leader of my people. From my world. He ... He is the son of Durotan. He is your grandchild."
#define GOSSIP_SGG11 "I will return to Azeroth at once, Greatmother."
-//all the textId's for the below is unknown, but i do believe the gossip item texts are proper.
-bool GossipHello_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature)
+//all the textId's for the below is unknown, but i do believe the gossip item texts are proper. class npc_greatmother_geyah : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+public:
+ npc_greatmother_geyah() : CreatureScript("npc_greatmother_geyah") { }
- if (pPlayer->GetQuestStatus(10044) == QUEST_STATUS_INCOMPLETE)
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HGG1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- }
- else if (pPlayer->GetQuestStatus(10172) == QUEST_STATUS_INCOMPLETE)
- {
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HGG2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- }
- else
-
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ switch (uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7:
+ pPlayer->AreaExploredOrEventHappens(10044);
+ pPlayer->CLOSE_GOSSIP_MENU();
+ break;
- return true;
-}
+ case GOSSIP_ACTION_INFO_DEF + 10:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 14:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 15:
+ pPlayer->AreaExploredOrEventHappens(10172);
+ pPlayer->CLOSE_GOSSIP_MENU();
+ break;
+ }
+ return true;
+ }
-bool GossipSelect_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch (uiAction)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- case GOSSIP_ACTION_INFO_DEF + 1:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7:
- pPlayer->AreaExploredOrEventHappens(10044);
- pPlayer->CLOSE_GOSSIP_MENU();
- break;
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
- case GOSSIP_ACTION_INFO_DEF + 10:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ if (pPlayer->GetQuestStatus(10044) == QUEST_STATUS_INCOMPLETE)
+ {
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HGG1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
+ }
+ else if (pPlayer->GetQuestStatus(10172) == QUEST_STATUS_INCOMPLETE)
+ {
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HGG2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 14:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
+ }
+ else
+
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 15:
- pPlayer->AreaExploredOrEventHappens(10172);
- pPlayer->CLOSE_GOSSIP_MENU();
- break;
+
+ return true;
}
- return true;
-}
+
+};
+
/*######
## npc_lantresor_of_the_blade
@@ -464,62 +502,69 @@ bool GossipSelect_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature, ui
#define GOSSIP_SLB5 "My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces."
#define GOSSIP_SLB6 "We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people."
#define GOSSIP_SLB7 "What do I need to do?"
-
-bool GossipHello_npc_lantresor_of_the_blade(Player* pPlayer, Creature* pCreature)
+ class npc_lantresor_of_the_blade : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+public:
+ npc_lantresor_of_the_blade() : CreatureScript("npc_lantresor_of_the_blade") { }
+
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ switch (uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ pPlayer->SEND_GOSSIP_MENU(9362, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ pPlayer->SEND_GOSSIP_MENU(9363, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ pPlayer->SEND_GOSSIP_MENU(9364, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ pPlayer->SEND_GOSSIP_MENU(9365, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ pPlayer->SEND_GOSSIP_MENU(9366, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ pPlayer->SEND_GOSSIP_MENU(9367, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ pPlayer->SEND_GOSSIP_MENU(9368, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ pPlayer->SEND_GOSSIP_MENU(9369, pCreature->GetGUID());
+ if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->AreaExploredOrEventHappens(10107);
+ if (pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->AreaExploredOrEventHappens(10108);
+ break;
+ }
+ return true;
+ }
- if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HLB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
- pPlayer->SEND_GOSSIP_MENU(9361, pCreature->GetGUID());
+ if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HLB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- return true;
-}
+ pPlayer->SEND_GOSSIP_MENU(9361, pCreature->GetGUID());
-bool GossipSelect_npc_lantresor_of_the_blade(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- pPlayer->SEND_GOSSIP_MENU(9362, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- pPlayer->SEND_GOSSIP_MENU(9363, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- pPlayer->SEND_GOSSIP_MENU(9364, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- pPlayer->SEND_GOSSIP_MENU(9365, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- pPlayer->SEND_GOSSIP_MENU(9366, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- pPlayer->SEND_GOSSIP_MENU(9367, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- pPlayer->SEND_GOSSIP_MENU(9368, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- pPlayer->SEND_GOSSIP_MENU(9369, pCreature->GetGUID());
- if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE)
- pPlayer->AreaExploredOrEventHappens(10107);
- if (pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
- pPlayer->AreaExploredOrEventHappens(10108);
- break;
+ return true;
}
- return true;
-}
+
+};
+
/*#####
## npc_maghar_captive
@@ -550,178 +595,193 @@ enum eMagharCaptive
static float m_afAmbushA[]= {-1568.805786, 8533.873047, 1.958};
static float m_afAmbushB[]= {-1491.554321, 8506.483398, 1.248};
-
-struct npc_maghar_captiveAI : public npc_escortAI
+ class npc_maghar_captive : public CreatureScript
{
- npc_maghar_captiveAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); }
-
- uint32 m_uiChainLightningTimer;
- uint32 m_uiHealTimer;
- uint32 m_uiFrostShockTimer;
+public:
+ npc_maghar_captive() : CreatureScript("npc_maghar_captive") { }
- void Reset()
+ bool OnQuestAccept(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
- m_uiChainLightningTimer = 1000;
- m_uiHealTimer = 0;
- m_uiFrostShockTimer = 6000;
+ if (pQuest->GetQuestId() == QUEST_TOTEM_KARDASH_H)
+ {
+ if (npc_maghar_captiveAI* pEscortAI = dynamic_cast<npc_maghar_captiveAI*>(pCreature->AI()))
+ {
+ pCreature->SetStandState(UNIT_STAND_STATE_STAND);
+ pCreature->setFaction(232);
+
+ pEscortAI->Start(true, false, pPlayer->GetGUID(), pQuest);
+
+ DoScriptText(SAY_MAG_START, pCreature);
+
+ pCreature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0]+2.5f, m_afAmbushA[1]-2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ pCreature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushA[0]-2.5f, m_afAmbushA[1]+2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ pCreature->SummonCreature(NPC_MURK_BRUTE, m_afAmbushA[0], m_afAmbushA[1], m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ }
+ }
+ return true;
}
- void EnterCombat(Unit* /*pWho*/)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- DoCast(me, SPELL_EARTHBIND_TOTEM, false);
+ return new npc_maghar_captiveAI(pCreature);
}
- void WaypointReached(uint32 uiPointId)
+ struct npc_maghar_captiveAI : public npc_escortAI
{
- switch(uiPointId)
- {
- case 7:
- DoScriptText(SAY_MAG_MORE, me);
+ npc_maghar_captiveAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); }
- if (Creature* pTemp = me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0], m_afAmbushB[1], m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
- DoScriptText(SAY_MAG_MORE_REPLY, pTemp);
+ uint32 m_uiChainLightningTimer;
+ uint32 m_uiHealTimer;
+ uint32 m_uiFrostShockTimer;
- me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ void Reset()
+ {
+ m_uiChainLightningTimer = 1000;
+ m_uiHealTimer = 0;
+ m_uiFrostShockTimer = 6000;
+ }
- me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- break;
- case 16:
- DoScriptText(SAY_MAG_COMPLETE, me);
+ void EnterCombat(Unit* /*pWho*/)
+ {
+ DoCast(me, SPELL_EARTHBIND_TOTEM, false);
+ }
- if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me);
+ void WaypointReached(uint32 uiPointId)
+ {
+ switch(uiPointId)
+ {
+ case 7:
+ DoScriptText(SAY_MAG_MORE, me);
- SetRun();
- break;
- }
- }
+ if (Creature* pTemp = me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0], m_afAmbushB[1], m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
+ DoScriptText(SAY_MAG_MORE_REPLY, pTemp);
- void JustSummoned(Creature* pSummoned)
- {
- if (pSummoned->GetEntry() == NPC_MURK_BRUTE)
- DoScriptText(SAY_MAG_NO_ESCAPE, pSummoned);
+ me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- if (pSummoned->isTotem())
- return;
+ me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ break;
+ case 16:
+ DoScriptText(SAY_MAG_COMPLETE, me);
- pSummoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- pSummoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
- pSummoned->AI()->AttackStart(me);
+ if (Player* pPlayer = GetPlayerForEscort())
+ pPlayer->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me);
- }
+ SetRun();
+ break;
+ }
+ }
- void SpellHitTarget(Unit* /*pTarget*/, const SpellEntry* pSpell)
- {
- if (pSpell->Id == SPELL_CHAIN_LIGHTNING)
+ void JustSummoned(Creature* pSummoned)
{
- if (rand()%10)
- return;
+ if (pSummoned->GetEntry() == NPC_MURK_BRUTE)
+ DoScriptText(SAY_MAG_NO_ESCAPE, pSummoned);
- DoScriptText(SAY_MAG_LIGHTNING, me);
- }
- }
+ if (pSummoned->isTotem())
+ return;
- void UpdateAI(const uint32 uiDiff)
- {
- npc_escortAI::UpdateAI(uiDiff);
- if (!me->getVictim())
- return;
+ pSummoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ pSummoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
+ pSummoned->AI()->AttackStart(me);
- if (m_uiChainLightningTimer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
- m_uiChainLightningTimer = urand(7000, 14000);
}
- else
- m_uiChainLightningTimer -= uiDiff;
- if (me->GetHealth()*100 < me->GetMaxHealth()*30)
+ void SpellHitTarget(Unit* /*pTarget*/, const SpellEntry* pSpell)
{
- if (m_uiHealTimer <= uiDiff)
+ if (pSpell->Id == SPELL_CHAIN_LIGHTNING)
{
- DoCast(me, SPELL_HEALING_WAVE);
- m_uiHealTimer = 5000;
+ if (rand()%10)
+ return;
+
+ DoScriptText(SAY_MAG_LIGHTNING, me);
}
- else
- m_uiHealTimer -= uiDiff;
}
- if (m_uiFrostShockTimer <= uiDiff)
+ void UpdateAI(const uint32 uiDiff)
{
- DoCast(me->getVictim(), SPELL_FROST_SHOCK);
- m_uiFrostShockTimer = urand(7500, 15000);
- }
- else
- m_uiFrostShockTimer -= uiDiff;
-
- DoMeleeAttackIfReady();
- }
-};
+ npc_escortAI::UpdateAI(uiDiff);
+ if (!me->getVictim())
+ return;
-bool QuestAccept_npc_maghar_captive(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
-{
- if (pQuest->GetQuestId() == QUEST_TOTEM_KARDASH_H)
- {
- if (npc_maghar_captiveAI* pEscortAI = dynamic_cast<npc_maghar_captiveAI*>(pCreature->AI()))
- {
- pCreature->SetStandState(UNIT_STAND_STATE_STAND);
- pCreature->setFaction(232);
+ if (m_uiChainLightningTimer <= uiDiff)
+ {
+ DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
+ m_uiChainLightningTimer = urand(7000, 14000);
+ }
+ else
+ m_uiChainLightningTimer -= uiDiff;
- pEscortAI->Start(true, false, pPlayer->GetGUID(), pQuest);
+ if (me->GetHealth()*100 < me->GetMaxHealth()*30)
+ {
+ if (m_uiHealTimer <= uiDiff)
+ {
+ DoCast(me, SPELL_HEALING_WAVE);
+ m_uiHealTimer = 5000;
+ }
+ else
+ m_uiHealTimer -= uiDiff;
+ }
- DoScriptText(SAY_MAG_START, pCreature);
+ if (m_uiFrostShockTimer <= uiDiff)
+ {
+ DoCast(me->getVictim(), SPELL_FROST_SHOCK);
+ m_uiFrostShockTimer = urand(7500, 15000);
+ }
+ else
+ m_uiFrostShockTimer -= uiDiff;
- pCreature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0]+2.5f, m_afAmbushA[1]-2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- pCreature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushA[0]-2.5f, m_afAmbushA[1]+2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- pCreature->SummonCreature(NPC_MURK_BRUTE, m_afAmbushA[0], m_afAmbushA[1], m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ DoMeleeAttackIfReady();
}
- }
- return true;
-}
+ };
+
+};
+
-CreatureAI* GetAI_npc_maghar_captive(Creature* pCreature)
-{
- return new npc_maghar_captiveAI(pCreature);
-}
/*######
## npc_creditmarker_visist_with_ancestors
######*/
-
-struct npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI
+ class npc_creditmarker_visit_with_ancestors : public CreatureScript
{
- npc_creditmarker_visit_with_ancestorsAI(Creature* c) : ScriptedAI(c) {}
+public:
+ npc_creditmarker_visit_with_ancestors() : CreatureScript("npc_creditmarker_visit_with_ancestors") { }
- void Reset() {}
-
- void EnterCombat(Unit* /*who*/) {}
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_creditmarker_visit_with_ancestorsAI (pCreature);
+ }
- void MoveInLineOfSight(Unit *who)
+ struct npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI
{
- if (!who)
- return;
+ npc_creditmarker_visit_with_ancestorsAI(Creature* c) : ScriptedAI(c) {}
+
+ void Reset() {}
- if (who->GetTypeId() == TYPEID_PLAYER)
+ void EnterCombat(Unit* /*who*/) {}
+
+ void MoveInLineOfSight(Unit *who)
{
- if (CAST_PLR(who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE)
+ if (!who)
+ return;
+
+ if (who->GetTypeId() == TYPEID_PLAYER)
{
- uint32 creditMarkerId = me->GetEntry();
- if ((creditMarkerId >= 18840) && (creditMarkerId <= 18843))
+ if (CAST_PLR(who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE)
{
- // 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
- if (!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
- CAST_PLR(who)->KilledMonsterCredit(creditMarkerId, me->GetGUID());
+ uint32 creditMarkerId = me->GetEntry();
+ if ((creditMarkerId >= 18840) && (creditMarkerId <= 18843))
+ {
+ // 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
+ if (!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
+ CAST_PLR(who)->KilledMonsterCredit(creditMarkerId, me->GetGUID());
+ }
}
}
}
- }
+ };
+
};
-CreatureAI* GetAI_npc_creditmarker_visit_with_ancestors(Creature* pCreature)
-{
- return new npc_creditmarker_visit_with_ancestorsAI (pCreature);
-}
/*######
## mob_sparrowhawk
@@ -729,101 +789,108 @@ CreatureAI* GetAI_npc_creditmarker_visit_with_ancestors(Creature* pCreature)
#define SPELL_SPARROWHAWK_NET 39810
#define SPELL_ITEM_CAPTIVE_SPARROWHAWK 39812
-
-struct mob_sparrowhawkAI : public ScriptedAI
+ class mob_sparrowhawk : public CreatureScript
{
+public:
+ mob_sparrowhawk() : CreatureScript("mob_sparrowhawk") { }
- mob_sparrowhawkAI(Creature *c) : ScriptedAI(c) {}
-
- uint32 Check_Timer;
- uint64 PlayerGUID;
- bool fleeing;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- me->RemoveAurasDueToSpell(SPELL_SPARROWHAWK_NET);
- Check_Timer = 1000;
- PlayerGUID = 0;
- fleeing = false;
+ return new mob_sparrowhawkAI (pCreature);
}
- void AttackStart(Unit *who)
- {
- if (PlayerGUID)
- return;
- ScriptedAI::AttackStart(who);
- }
+ struct mob_sparrowhawkAI : public ScriptedAI
+ {
- void EnterCombat(Unit* /*who*/) {}
+ mob_sparrowhawkAI(Creature *c) : ScriptedAI(c) {}
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || PlayerGUID)
- return;
+ uint32 Check_Timer;
+ uint64 PlayerGUID;
+ bool fleeing;
- if (!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
+ void Reset()
{
- PlayerGUID = who->GetGUID();
- return;
+ me->RemoveAurasDueToSpell(SPELL_SPARROWHAWK_NET);
+ Check_Timer = 1000;
+ PlayerGUID = 0;
+ fleeing = false;
}
+ void AttackStart(Unit *who)
+ {
+ if (PlayerGUID)
+ return;
- ScriptedAI::MoveInLineOfSight(who);
- }
+ ScriptedAI::AttackStart(who);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (Check_Timer <= diff)
+ void EnterCombat(Unit* /*who*/) {}
+
+ void MoveInLineOfSight(Unit *who)
{
- if (PlayerGUID)
+ if (!who || PlayerGUID)
+ return;
+
+ if (!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
{
- if (fleeing && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)
- fleeing = false;
+ PlayerGUID = who->GetGUID();
+ return;
+ }
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
- Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
- if (pPlayer && me->IsWithinDistInMap(pPlayer, 30))
+ void UpdateAI(const uint32 diff)
+ {
+ if (Check_Timer <= diff)
+ {
+ if (PlayerGUID)
{
- if (!fleeing)
+ if (fleeing && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)
+ fleeing = false;
+
+ Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
+ if (pPlayer && me->IsWithinDistInMap(pPlayer, 30))
{
- me->DeleteThreatList();
- me->GetMotionMaster()->MoveFleeing(pPlayer);
- fleeing = true;
+ if (!fleeing)
+ {
+ me->DeleteThreatList();
+ me->GetMotionMaster()->MoveFleeing(pPlayer);
+ fleeing = true;
+ }
+ }
+ else if (fleeing)
+ {
+ me->GetMotionMaster()->MovementExpired(false);
+ PlayerGUID = 0;
+ fleeing = false;
}
}
- else if (fleeing)
- {
- me->GetMotionMaster()->MovementExpired(false);
- PlayerGUID = 0;
- fleeing = false;
- }
- }
- Check_Timer = 1000;
- } else Check_Timer -= diff;
+ Check_Timer = 1000;
+ } else Check_Timer -= diff;
- if (PlayerGUID)
- return;
+ if (PlayerGUID)
+ return;
- ScriptedAI::UpdateAI(diff);
- }
+ ScriptedAI::UpdateAI(diff);
+ }
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if (caster->GetTypeId() == TYPEID_PLAYER)
+ void SpellHit(Unit *caster, const SpellEntry *spell)
{
- if (spell->Id == SPELL_SPARROWHAWK_NET && CAST_PLR(caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
+ if (caster->GetTypeId() == TYPEID_PLAYER)
{
- DoCast(caster, SPELL_ITEM_CAPTIVE_SPARROWHAWK, true);
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ if (spell->Id == SPELL_SPARROWHAWK_NET && CAST_PLR(caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
+ {
+ DoCast(caster, SPELL_ITEM_CAPTIVE_SPARROWHAWK, true);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ }
}
+ return;
}
- return;
- }
+ };
+
};
-CreatureAI* GetAI_mob_sparrowhawk(Creature* pCreature)
-{
- return new mob_sparrowhawkAI (pCreature);
-}
/*####
#
@@ -831,58 +898,13 @@ CreatureAI* GetAI_mob_sparrowhawk(Creature* pCreature)
void AddSC_nagrand()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "mob_shattered_rumbler";
- newscript->GetAI = &GetAI_mob_shattered_rumbler;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_lump";
- newscript->GetAI = &GetAI_mob_lump;
- newscript->pGossipHello = &GossipHello_mob_lump;
- newscript->pGossipSelect = &GossipSelect_mob_lump;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_sunspring_villager";
- newscript->GetAI = &GetAI_mob_sunspring_villager;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_altruis_the_sufferer";
- newscript->pGossipHello = &GossipHello_npc_altruis_the_sufferer;
- newscript->pGossipSelect = &GossipSelect_npc_altruis_the_sufferer;
- newscript->pQuestAccept = &QuestAccept_npc_altruis_the_sufferer;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_greatmother_geyah";
- newscript->pGossipHello = &GossipHello_npc_greatmother_geyah;
- newscript->pGossipSelect = &GossipSelect_npc_greatmother_geyah;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_lantresor_of_the_blade";
- newscript->pGossipHello = &GossipHello_npc_lantresor_of_the_blade;
- newscript->pGossipSelect = &GossipSelect_npc_lantresor_of_the_blade;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_maghar_captive";
- newscript->GetAI = &GetAI_npc_maghar_captive;
- newscript->pQuestAccept = &QuestAccept_npc_maghar_captive;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_creditmarker_visit_with_ancestors";
- newscript->GetAI = &GetAI_npc_creditmarker_visit_with_ancestors;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_sparrowhawk";
- newscript->GetAI = &GetAI_mob_sparrowhawk;
- newscript->RegisterSelf();
+ new mob_shattered_rumbler();
+ new mob_lump();
+ new mob_sunspring_villager();
+ new npc_altruis_the_sufferer();
+ new npc_greatmother_geyah();
+ new npc_lantresor_of_the_blade();
+ new npc_maghar_captive();
+ new npc_creditmarker_visit_with_ancestors();
+ new mob_sparrowhawk();
}
-
diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp
index 5a8f02186af..a4648614614 100644
--- a/src/server/scripts/Outland/netherstorm.cpp
+++ b/src/server/scripts/Outland/netherstorm.cpp
@@ -60,278 +60,291 @@ EndContentData */
#define SPELL_DISABLE_VISUAL 35031
#define SPELL_INTERRUPT_1 35016 //ACID mobs should cast this
#define SPELL_INTERRUPT_2 35176 //ACID mobs should cast this (Manaforge Ara-version)
-
-struct npc_manaforge_control_consoleAI : public ScriptedAI
+ class npc_manaforge_control_console : public CreatureScript
{
- npc_manaforge_control_consoleAI(Creature *c) : ScriptedAI(c) {}
-
- uint32 Event_Timer;
- uint32 Wave_Timer;
- uint32 Phase;
- bool Wave;
- uint64 someplayer;
- uint64 goConsole;
- Creature* add;
+public:
+ npc_manaforge_control_console() : CreatureScript("npc_manaforge_control_console") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Event_Timer = 3000;
- Wave_Timer = 0;
- Phase = 1;
- Wave = false;
- someplayer = 0;
- goConsole = 0;
- add = NULL;
+ return new npc_manaforge_control_consoleAI (pCreature);
}
- void EnterCombat(Unit * /*who*/) {}
-
- /*void SpellHit(Unit *caster, const SpellEntry *spell)
+ struct npc_manaforge_control_consoleAI : public ScriptedAI
{
- //we have no way of telling the Creature was hit by spell -> got aura applied after 10-12 seconds
- //then no way for the mobs to actually stop the shutdown as intended.
- if (spell->Id == SPELL_INTERRUPT_1)
- DoSay("Silence! I kill you!",LANG_UNIVERSAL, NULL);
- }*/
+ npc_manaforge_control_consoleAI(Creature *c) : ScriptedAI(c) {}
- void JustDied(Unit* /*killer*/)
- {
- DoScriptText(EMOTE_ABORT, me);
+ uint32 Event_Timer;
+ uint32 Wave_Timer;
+ uint32 Phase;
+ bool Wave;
+ uint64 someplayer;
+ uint64 goConsole;
+ Creature* add;
- if (someplayer)
+ void Reset()
{
- Unit* p = Unit::GetUnit((*me),someplayer);
- if (p && p->GetTypeId() == TYPEID_PLAYER)
- {
- switch(me->GetEntry())
- {
- case ENTRY_BNAAR_C_CONSOLE:
- CAST_PLR(p)->FailQuest(10299);
- CAST_PLR(p)->FailQuest(10329);
- break;
- case ENTRY_CORUU_C_CONSOLE:
- CAST_PLR(p)->FailQuest(10321);
- CAST_PLR(p)->FailQuest(10330);
- break;
- case ENTRY_DURO_C_CONSOLE:
- CAST_PLR(p)->FailQuest(10322);
- CAST_PLR(p)->FailQuest(10338);
- break;
- case ENTRY_ARA_C_CONSOLE:
- CAST_PLR(p)->FailQuest(10323);
- CAST_PLR(p)->FailQuest(10365);
- break;
- }
- }
+ Event_Timer = 3000;
+ Wave_Timer = 0;
+ Phase = 1;
+ Wave = false;
+ someplayer = 0;
+ goConsole = 0;
+ add = NULL;
}
- if (goConsole)
+ void EnterCombat(Unit * /*who*/) {}
+
+ /*void SpellHit(Unit *caster, const SpellEntry *spell)
{
- if (GameObject* pGo = GameObject::GetGameObject((*me),goConsole))
- pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
- }
- }
+ //we have no way of telling the Creature was hit by spell -> got aura applied after 10-12 seconds
+ //then no way for the mobs to actually stop the shutdown as intended.
+ if (spell->Id == SPELL_INTERRUPT_1)
+ DoSay("Silence! I kill you!",LANG_UNIVERSAL, NULL);
+ }*/
- void DoWaveSpawnForCreature(Creature* pCreature)
- {
- switch(pCreature->GetEntry())
+ void JustDied(Unit* /*killer*/)
{
- case ENTRY_BNAAR_C_CONSOLE:
- if (rand()%2)
- {
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2933.68,4162.55,164.00,1.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2927.36,4212.97,164.00);
- }
- else
- {
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2927.36,4212.97,164.00,4.94,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2933.68,4162.55,164.00);
- }
- Wave_Timer = 30000;
- break;
- case ENTRY_CORUU_C_CONSOLE:
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2445.21,2765.26,134.49,3.93,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2424.21,2740.15,133.81);
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2429.86,2731.85,134.53,1.31,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2435.37,2766.04,133.81);
- Wave_Timer = 20000;
- break;
- case ENTRY_DURO_C_CONSOLE:
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2986.80,2205.36,165.37,3.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2985.15,2197.32,164.79);
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2952.91,2191.20,165.32,0.22,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2060.01,2185.27,164.67);
- Wave_Timer = 15000;
- break;
- case ENTRY_ARA_C_CONSOLE:
- if (rand()%2)
- {
- add = me->SummonCreature(ENTRY_ARA_TECH,4035.11,4038.97,194.27,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
- add = me->SummonCreature(ENTRY_ARA_TECH,4033.66,4036.79,194.28,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
- add = me->SummonCreature(ENTRY_ARA_TECH,4037.13,4037.30,194.23,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
- }
- else
+ DoScriptText(EMOTE_ABORT, me);
+
+ if (someplayer)
+ {
+ Unit* p = Unit::GetUnit((*me),someplayer);
+ if (p && p->GetTypeId() == TYPEID_PLAYER)
{
- add = me->SummonCreature(ENTRY_ARA_TECH,3099.59,4049.30,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
- add = me->SummonCreature(ENTRY_ARA_TECH,3999.72,4046.75,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
- add = me->SummonCreature(ENTRY_ARA_TECH,3996.81,4048.26,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
+ switch(me->GetEntry())
+ {
+ case ENTRY_BNAAR_C_CONSOLE:
+ CAST_PLR(p)->FailQuest(10299);
+ CAST_PLR(p)->FailQuest(10329);
+ break;
+ case ENTRY_CORUU_C_CONSOLE:
+ CAST_PLR(p)->FailQuest(10321);
+ CAST_PLR(p)->FailQuest(10330);
+ break;
+ case ENTRY_DURO_C_CONSOLE:
+ CAST_PLR(p)->FailQuest(10322);
+ CAST_PLR(p)->FailQuest(10338);
+ break;
+ case ENTRY_ARA_C_CONSOLE:
+ CAST_PLR(p)->FailQuest(10323);
+ CAST_PLR(p)->FailQuest(10365);
+ break;
+ }
}
- Wave_Timer = 15000;
- break;
- }
- }
- void DoFinalSpawnForCreature(Creature* pCreature)
- {
- switch(pCreature->GetEntry())
- {
- case ENTRY_BNAAR_C_CONSOLE:
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2946.52,4201.42,163.47,3.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2927.49,4192.81,163.00);
- break;
- case ENTRY_CORUU_C_CONSOLE:
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2453.88,2737.85,133.27,2.59,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2441.62,2735.32,134.49,1.97,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2450.73,2754.50,134.49,3.29,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
- break;
- case ENTRY_DURO_C_CONSOLE:
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2956.18,2202.85,165.32,5.45,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
- add = me->SummonCreature(ENTRY_SUNFURY_TECH,2975.30,2211.50,165.32,4.55,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
- add = me->SummonCreature(ENTRY_SUNFURY_PROT,2965.02,2217.45,164.16,4.96,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
- break;
- case ENTRY_ARA_C_CONSOLE:
- add = me->SummonCreature(ENTRY_ARA_ENGI,3994.51,4020.46,192.18,0.91,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,4008.35,4035.04,192.70);
- add = me->SummonCreature(ENTRY_ARA_GORKLONN,4021.56,4059.35,193.59,4.44,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
- if (add) add->GetMotionMaster()->MovePoint(0,4016.62,4039.89,193.46);
- break;
+ }
+
+ if (goConsole)
+ {
+ if (GameObject* pGo = GameObject::GetGameObject((*me),goConsole))
+ pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ }
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (Event_Timer <= diff)
+ void DoWaveSpawnForCreature(Creature* pCreature)
{
- switch(Phase)
+ switch(pCreature->GetEntry())
{
- case 1:
- if (someplayer)
+ case ENTRY_BNAAR_C_CONSOLE:
+ if (rand()%2)
{
- Unit* u = Unit::GetUnit((*me), someplayer);
- if (u && u->GetTypeId() == TYPEID_PLAYER) DoScriptText(EMOTE_START, me, u);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2933.68,4162.55,164.00,1.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2927.36,4212.97,164.00);
}
- Event_Timer = 60000;
- Wave = true;
- ++Phase;
+ else
+ {
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2927.36,4212.97,164.00,4.94,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2933.68,4162.55,164.00);
+ }
+ Wave_Timer = 30000;
break;
- case 2:
- DoScriptText(EMOTE_60, me);
- Event_Timer = 30000;
- ++Phase;
+ case ENTRY_CORUU_C_CONSOLE:
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2445.21,2765.26,134.49,3.93,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2424.21,2740.15,133.81);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2429.86,2731.85,134.53,1.31,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2435.37,2766.04,133.81);
+ Wave_Timer = 20000;
break;
- case 3:
- DoScriptText(EMOTE_30, me);
- Event_Timer = 20000;
- DoFinalSpawnForCreature(me);
- ++Phase;
+ case ENTRY_DURO_C_CONSOLE:
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2986.80,2205.36,165.37,3.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2985.15,2197.32,164.79);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2952.91,2191.20,165.32,0.22,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2060.01,2185.27,164.67);
+ Wave_Timer = 15000;
break;
- case 4:
- DoScriptText(EMOTE_10, me);
- Event_Timer = 10000;
- Wave = false;
- ++Phase;
- break;
- case 5:
- DoScriptText(EMOTE_COMPLETE, me);
- if (someplayer)
+ case ENTRY_ARA_C_CONSOLE:
+ if (rand()%2)
{
- Unit* u = Unit::GetUnit((*me),someplayer);
- if (u && u->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(u)->KilledMonsterCredit(me->GetEntry(),me->GetGUID());
- DoCast(me, SPELL_DISABLE_VISUAL);
+ add = me->SummonCreature(ENTRY_ARA_TECH,4035.11,4038.97,194.27,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
+ add = me->SummonCreature(ENTRY_ARA_TECH,4033.66,4036.79,194.28,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
+ add = me->SummonCreature(ENTRY_ARA_TECH,4037.13,4037.30,194.23,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
}
- if (goConsole)
+ else
{
- if (GameObject* pGo = GameObject::GetGameObject((*me),goConsole))
- pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ add = me->SummonCreature(ENTRY_ARA_TECH,3099.59,4049.30,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
+ add = me->SummonCreature(ENTRY_ARA_TECH,3999.72,4046.75,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
+ add = me->SummonCreature(ENTRY_ARA_TECH,3996.81,4048.26,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
}
- ++Phase;
+ Wave_Timer = 15000;
+ break;
+ }
+ }
+ void DoFinalSpawnForCreature(Creature* pCreature)
+ {
+ switch(pCreature->GetEntry())
+ {
+ case ENTRY_BNAAR_C_CONSOLE:
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2946.52,4201.42,163.47,3.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2927.49,4192.81,163.00);
+ break;
+ case ENTRY_CORUU_C_CONSOLE:
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2453.88,2737.85,133.27,2.59,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2441.62,2735.32,134.49,1.97,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2450.73,2754.50,134.49,3.29,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
+ break;
+ case ENTRY_DURO_C_CONSOLE:
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2956.18,2202.85,165.32,5.45,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
+ add = me->SummonCreature(ENTRY_SUNFURY_TECH,2975.30,2211.50,165.32,4.55,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
+ add = me->SummonCreature(ENTRY_SUNFURY_PROT,2965.02,2217.45,164.16,4.96,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
+ break;
+ case ENTRY_ARA_C_CONSOLE:
+ add = me->SummonCreature(ENTRY_ARA_ENGI,3994.51,4020.46,192.18,0.91,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,4008.35,4035.04,192.70);
+ add = me->SummonCreature(ENTRY_ARA_GORKLONN,4021.56,4059.35,193.59,4.44,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ if (add) add->GetMotionMaster()->MovePoint(0,4016.62,4039.89,193.46);
break;
}
- } else Event_Timer -= diff;
+ }
- if (Wave)
+ void UpdateAI(const uint32 diff)
{
- if (Wave_Timer <= diff)
+ if (Event_Timer <= diff)
{
- DoWaveSpawnForCreature(me);
- } else Wave_Timer -= diff;
+ switch(Phase)
+ {
+ case 1:
+ if (someplayer)
+ {
+ Unit* u = Unit::GetUnit((*me), someplayer);
+ if (u && u->GetTypeId() == TYPEID_PLAYER) DoScriptText(EMOTE_START, me, u);
+ }
+ Event_Timer = 60000;
+ Wave = true;
+ ++Phase;
+ break;
+ case 2:
+ DoScriptText(EMOTE_60, me);
+ Event_Timer = 30000;
+ ++Phase;
+ break;
+ case 3:
+ DoScriptText(EMOTE_30, me);
+ Event_Timer = 20000;
+ DoFinalSpawnForCreature(me);
+ ++Phase;
+ break;
+ case 4:
+ DoScriptText(EMOTE_10, me);
+ Event_Timer = 10000;
+ Wave = false;
+ ++Phase;
+ break;
+ case 5:
+ DoScriptText(EMOTE_COMPLETE, me);
+ if (someplayer)
+ {
+ Unit* u = Unit::GetUnit((*me),someplayer);
+ if (u && u->GetTypeId() == TYPEID_PLAYER)
+ CAST_PLR(u)->KilledMonsterCredit(me->GetEntry(),me->GetGUID());
+ DoCast(me, SPELL_DISABLE_VISUAL);
+ }
+ if (goConsole)
+ {
+ if (GameObject* pGo = GameObject::GetGameObject((*me),goConsole))
+ pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ }
+ ++Phase;
+ break;
+ }
+ } else Event_Timer -= diff;
+
+ if (Wave)
+ {
+ if (Wave_Timer <= diff)
+ {
+ DoWaveSpawnForCreature(me);
+ } else Wave_Timer -= diff;
+ }
}
- }
+ };
+
};
-CreatureAI* GetAI_npc_manaforge_control_console(Creature* pCreature)
-{
- return new npc_manaforge_control_consoleAI (pCreature);
-}
/*######
## go_manaforge_control_console
######*/
-//TODO: clean up this workaround when Trinity adds support to do it properly (with gossip selections instead of instant summon)
-bool GOHello_go_manaforge_control_console(Player* pPlayer, GameObject* pGo)
+//TODO: clean up this workaround when Trinity adds support to do it properly (with gossip selections instead of instant summon) class go_manaforge_control_console : public GameObjectScript
{
- if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
+public:
+ go_manaforge_control_console() : GameObjectScript("go_manaforge_control_console") { }
+
+ bool OnGossipHello(Player* pPlayer, GameObject* pGo)
{
- pPlayer->PrepareQuestMenu(pGo->GetGUID());
- pPlayer->SendPreparedQuest(pGo->GetGUID());
- }
+ if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
+ {
+ pPlayer->PrepareQuestMenu(pGo->GetGUID());
+ pPlayer->SendPreparedQuest(pGo->GetGUID());
+ }
- Creature* manaforge = NULL;
+ Creature* manaforge = NULL;
- switch(pGo->GetAreaId())
- {
- case 3726: //b'naar
- if ((pPlayer->GetQuestStatus(10299) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10329) == QUEST_STATUS_INCOMPLETE) &&
- pPlayer->HasItemCount(29366,1))
- manaforge = pPlayer->SummonCreature(ENTRY_BNAAR_C_CONSOLE,2918.95,4189.98,161.88,0.34,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
- break;
- case 3730: //coruu
- if ((pPlayer->GetQuestStatus(10321) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10330) == QUEST_STATUS_INCOMPLETE) &&
- pPlayer->HasItemCount(29396,1))
- manaforge = pPlayer->SummonCreature(ENTRY_CORUU_C_CONSOLE,2426.77,2750.38,133.24,2.14,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
- break;
- case 3734: //duro
- if ((pPlayer->GetQuestStatus(10322) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10338) == QUEST_STATUS_INCOMPLETE) &&
- pPlayer->HasItemCount(29397,1))
- manaforge = pPlayer->SummonCreature(ENTRY_DURO_C_CONSOLE,2976.48,2183.29,163.20,1.85,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
- break;
- case 3722: //ara
- if ((pPlayer->GetQuestStatus(10323) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10365) == QUEST_STATUS_INCOMPLETE) &&
- pPlayer->HasItemCount(29411,1))
- manaforge = pPlayer->SummonCreature(ENTRY_ARA_C_CONSOLE,4013.71,4028.76,192.10,1.25,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
- break;
- }
+ switch(pGo->GetAreaId())
+ {
+ case 3726: //b'naar
+ if ((pPlayer->GetQuestStatus(10299) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10329) == QUEST_STATUS_INCOMPLETE) &&
+ pPlayer->HasItemCount(29366,1))
+ manaforge = pPlayer->SummonCreature(ENTRY_BNAAR_C_CONSOLE,2918.95,4189.98,161.88,0.34,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
+ break;
+ case 3730: //coruu
+ if ((pPlayer->GetQuestStatus(10321) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10330) == QUEST_STATUS_INCOMPLETE) &&
+ pPlayer->HasItemCount(29396,1))
+ manaforge = pPlayer->SummonCreature(ENTRY_CORUU_C_CONSOLE,2426.77,2750.38,133.24,2.14,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
+ break;
+ case 3734: //duro
+ if ((pPlayer->GetQuestStatus(10322) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10338) == QUEST_STATUS_INCOMPLETE) &&
+ pPlayer->HasItemCount(29397,1))
+ manaforge = pPlayer->SummonCreature(ENTRY_DURO_C_CONSOLE,2976.48,2183.29,163.20,1.85,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
+ break;
+ case 3722: //ara
+ if ((pPlayer->GetQuestStatus(10323) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10365) == QUEST_STATUS_INCOMPLETE) &&
+ pPlayer->HasItemCount(29411,1))
+ manaforge = pPlayer->SummonCreature(ENTRY_ARA_C_CONSOLE,4013.71,4028.76,192.10,1.25,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
+ break;
+ }
- if (manaforge)
- {
- CAST_AI(npc_manaforge_control_consoleAI, manaforge->AI())->someplayer = pPlayer->GetGUID();
- CAST_AI(npc_manaforge_control_consoleAI, manaforge->AI())->goConsole = pGo->GetGUID();
- pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ if (manaforge)
+ {
+ CAST_AI(npc_manaforge_control_console::npc_manaforge_control_consoleAI, manaforge->AI())->someplayer = pPlayer->GetGUID();
+ CAST_AI(npc_manaforge_control_console::npc_manaforge_control_consoleAI, manaforge->AI())->goConsole = pGo->GetGUID();
+ pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ }
+ return true;
}
- return true;
-}
+
+};
/*######
## npc_commander_dawnforge
@@ -360,80 +373,64 @@ const uint32 CreatureEntry[3] =
19831, // Dawnforge
21504 // Pathaleon
};
-
-struct npc_commander_dawnforgeAI : public ScriptedAI
+ class npc_commander_dawnforge : public CreatureScript
{
- npc_commander_dawnforgeAI(Creature *c) : ScriptedAI(c) { Reset (); }
+public:
+ npc_commander_dawnforge() : CreatureScript("npc_commander_dawnforge") { }
- uint64 PlayerGUID;
- uint64 ardonisGUID;
- uint64 pathaleonGUID;
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_commander_dawnforgeAI(pCreature);
+ }
- uint32 Phase;
- uint32 PhaseSubphase;
- uint32 Phase_Timer;
- bool isEvent;
+ struct npc_commander_dawnforgeAI : public ScriptedAI
+ {
+ npc_commander_dawnforgeAI(Creature *c) : ScriptedAI(c) { Reset (); }
- float angle_dawnforge;
- float angle_ardonis;
+ uint64 PlayerGUID;
+ uint64 ardonisGUID;
+ uint64 pathaleonGUID;
- void Reset()
- {
- PlayerGUID = 0;
- ardonisGUID = 0;
- pathaleonGUID = 0;
-
- Phase = 1;
- PhaseSubphase = 0;
- Phase_Timer = 4000;
- isEvent = false;
- }
+ uint32 Phase;
+ uint32 PhaseSubphase;
+ uint32 Phase_Timer;
+ bool isEvent;
- void EnterCombat(Unit * /*who*/) { }
+ float angle_dawnforge;
+ float angle_ardonis;
- void JustSummoned(Creature *summoned)
- {
- pathaleonGUID = summoned->GetGUID();
- }
+ void Reset()
+ {
+ PlayerGUID = 0;
+ ardonisGUID = 0;
+ pathaleonGUID = 0;
- // Emote Ardonis and Pathaleon
- void Turn_to_Pathaleons_Image()
- {
- Creature *ardonis = Unit::GetCreature(*me,ardonisGUID);
- Creature *pathaleon = Unit::GetCreature(*me,pathaleonGUID);
- Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
-
- if (!ardonis || !pathaleon || !pPlayer)
- return;
-
- //Calculate the angle to Pathaleon
- angle_dawnforge = me->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
- angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
-
- //Turn Dawnforge and update
- me->SetOrientation(angle_dawnforge);
- me->SendUpdateToPlayer(pPlayer);
- //Turn Ardonis and update
- ardonis->SetOrientation(angle_ardonis);
- ardonis->SendUpdateToPlayer(pPlayer);
-
- //Set them to kneel
- me->SetStandState(UNIT_STAND_STATE_KNEEL);
- ardonis->SetStandState(UNIT_STAND_STATE_KNEEL);
- }
+ Phase = 1;
+ PhaseSubphase = 0;
+ Phase_Timer = 4000;
+ isEvent = false;
+ }
- //Set them back to each other
- void Turn_to_eachother()
- {
- if (Unit *ardonis = Unit::GetUnit(*me,ardonisGUID))
+ void EnterCombat(Unit * /*who*/) { }
+
+ void JustSummoned(Creature *summoned)
{
+ pathaleonGUID = summoned->GetGUID();
+ }
+
+ // Emote Ardonis and Pathaleon
+ void Turn_to_Pathaleons_Image()
+ {
+ Creature *ardonis = Unit::GetCreature(*me,ardonisGUID);
+ Creature *pathaleon = Unit::GetCreature(*me,pathaleonGUID);
Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
- if (!pPlayer)
+ if (!ardonis || !pathaleon || !pPlayer)
return;
- angle_dawnforge = me->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY());
- angle_ardonis = ardonis->GetAngle(me->GetPositionX(), me->GetPositionY());
+ //Calculate the angle to Pathaleon
+ angle_dawnforge = me->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
+ angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
//Turn Dawnforge and update
me->SetOrientation(angle_dawnforge);
@@ -442,188 +439,217 @@ struct npc_commander_dawnforgeAI : public ScriptedAI
ardonis->SetOrientation(angle_ardonis);
ardonis->SendUpdateToPlayer(pPlayer);
- //Set state
- me->SetStandState(UNIT_STAND_STATE_STAND);
- ardonis->SetStandState(UNIT_STAND_STATE_STAND);
+ //Set them to kneel
+ me->SetStandState(UNIT_STAND_STATE_KNEEL);
+ ardonis->SetStandState(UNIT_STAND_STATE_KNEEL);
}
- }
- bool CanStartEvent(Player* pPlayer)
- {
- if (!isEvent)
+ //Set them back to each other
+ void Turn_to_eachother()
{
- Creature* ardonis = me->FindNearestCreature(CreatureEntry[0], 10.0f);
- if (!ardonis)
- return false;
+ if (Unit *ardonis = Unit::GetUnit(*me,ardonisGUID))
+ {
+ Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
- ardonisGUID = ardonis->GetGUID();
- PlayerGUID = pPlayer->GetGUID();
+ if (!pPlayer)
+ return;
- isEvent = true;
+ angle_dawnforge = me->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY());
+ angle_ardonis = ardonis->GetAngle(me->GetPositionX(), me->GetPositionY());
- Turn_to_eachother();
- return true;
+ //Turn Dawnforge and update
+ me->SetOrientation(angle_dawnforge);
+ me->SendUpdateToPlayer(pPlayer);
+ //Turn Ardonis and update
+ ardonis->SetOrientation(angle_ardonis);
+ ardonis->SendUpdateToPlayer(pPlayer);
+
+ //Set state
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ ardonis->SetStandState(UNIT_STAND_STATE_STAND);
+ }
}
- sLog.outDebug("TSCR: npc_commander_dawnforge event already in progress, need to wait.");
- return false;
- }
+ bool CanStartEvent(Player* pPlayer)
+ {
+ if (!isEvent)
+ {
+ Creature* ardonis = me->FindNearestCreature(CreatureEntry[0], 10.0f);
+ if (!ardonis)
+ return false;
- void UpdateAI(const uint32 diff)
- {
- //Is event even running?
- if (!isEvent)
- return;
+ ardonisGUID = ardonis->GetGUID();
+ PlayerGUID = pPlayer->GetGUID();
- //Phase timing
- if (Phase_Timer >= diff)
- {
- Phase_Timer -= diff;
- return;
- }
+ isEvent = true;
- Unit *ardonis = Unit::GetUnit(*me,ardonisGUID);
- Unit *pathaleon = Unit::GetUnit(*me,pathaleonGUID);
- Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
+ Turn_to_eachother();
+ return true;
+ }
- if (!ardonis || !pPlayer)
- {
- Reset();
- return;
+ sLog.outDebug("TSCR: npc_commander_dawnforge event already in progress, need to wait.");
+ return false;
}
- if (Phase > 4 && !pathaleon)
+ void UpdateAI(const uint32 diff)
{
- Reset();
- return;
- }
+ //Is event even running?
+ if (!isEvent)
+ return;
- //Phase 1 Dawnforge say
- switch (Phase)
- {
- case 1:
- DoScriptText(SAY_COMMANDER_DAWNFORGE_1, me);
- ++Phase;
- Phase_Timer = 16000;
- break;
- //Phase 2 Ardonis say
- case 2:
- DoScriptText(SAY_ARCANIST_ARDONIS_1, ardonis);
- ++Phase;
- Phase_Timer = 16000;
- break;
- //Phase 3 Dawnforge say
- case 3:
- DoScriptText(SAY_COMMANDER_DAWNFORGE_2, me);
- ++Phase;
- Phase_Timer = 16000;
- break;
- //Phase 4 Pathaleon spawns up to phase 9
- case 4:
- //spawn pathaleon's image
- me->SummonCreature(CreatureEntry[2], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000);
- ++Phase;
- Phase_Timer = 500;
- break;
- //Phase 5 Pathaleon say
- case 5:
- DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_1, pathaleon);
- ++Phase;
- Phase_Timer = 6000;
- break;
- //Phase 6
- case 6:
- switch(PhaseSubphase)
+ //Phase timing
+ if (Phase_Timer >= diff)
{
- //Subphase 1: Turn Dawnforge and Ardonis
- case 0:
- Turn_to_Pathaleons_Image();
- ++PhaseSubphase;
- Phase_Timer = 8000;
- break;
- //Subphase 2 Dawnforge say
- case 1:
- DoScriptText(SAY_COMMANDER_DAWNFORGE_3, me);
- PhaseSubphase = 0;
- ++Phase;
- Phase_Timer = 8000;
- break;
+ Phase_Timer -= diff;
+ return;
}
- break;
- //Phase 7 Pathaleons say 3 Sentence, every sentence need a subphase
- case 7:
- switch(PhaseSubphase)
+
+ Unit *ardonis = Unit::GetUnit(*me,ardonisGUID);
+ Unit *pathaleon = Unit::GetUnit(*me,pathaleonGUID);
+ Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
+
+ if (!ardonis || !pPlayer)
+ {
+ Reset();
+ return;
+ }
+
+ if (Phase > 4 && !pathaleon)
+ {
+ Reset();
+ return;
+ }
+
+ //Phase 1 Dawnforge say
+ switch (Phase)
{
- //Subphase 1
- case 0:
- DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2, pathaleon);
- ++PhaseSubphase;
- Phase_Timer = 12000;
- break;
- //Subphase 2
case 1:
- DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_1, pathaleon);
- ++PhaseSubphase;
+ DoScriptText(SAY_COMMANDER_DAWNFORGE_1, me);
+ ++Phase;
Phase_Timer = 16000;
break;
- //Subphase 3
+ //Phase 2 Ardonis say
case 2:
- DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_2, pathaleon);
+ DoScriptText(SAY_ARCANIST_ARDONIS_1, ardonis);
+ ++Phase;
+ Phase_Timer = 16000;
+ break;
+ //Phase 3 Dawnforge say
+ case 3:
+ DoScriptText(SAY_COMMANDER_DAWNFORGE_2, me);
+ ++Phase;
+ Phase_Timer = 16000;
+ break;
+ //Phase 4 Pathaleon spawns up to phase 9
+ case 4:
+ //spawn pathaleon's image
+ me->SummonCreature(CreatureEntry[2], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000);
+ ++Phase;
+ Phase_Timer = 500;
+ break;
+ //Phase 5 Pathaleon say
+ case 5:
+ DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_1, pathaleon);
+ ++Phase;
+ Phase_Timer = 6000;
+ break;
+ //Phase 6
+ case 6:
+ switch(PhaseSubphase)
+ {
+ //Subphase 1: Turn Dawnforge and Ardonis
+ case 0:
+ Turn_to_Pathaleons_Image();
+ ++PhaseSubphase;
+ Phase_Timer = 8000;
+ break;
+ //Subphase 2 Dawnforge say
+ case 1:
+ DoScriptText(SAY_COMMANDER_DAWNFORGE_3, me);
+ PhaseSubphase = 0;
+ ++Phase;
+ Phase_Timer = 8000;
+ break;
+ }
+ break;
+ //Phase 7 Pathaleons say 3 Sentence, every sentence need a subphase
+ case 7:
+ switch(PhaseSubphase)
+ {
+ //Subphase 1
+ case 0:
+ DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2, pathaleon);
+ ++PhaseSubphase;
+ Phase_Timer = 12000;
+ break;
+ //Subphase 2
+ case 1:
+ DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_1, pathaleon);
+ ++PhaseSubphase;
+ Phase_Timer = 16000;
+ break;
+ //Subphase 3
+ case 2:
+ DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_2, pathaleon);
+ PhaseSubphase = 0;
+ ++Phase;
+ Phase_Timer = 10000;
+ break;
+ }
+ break;
+ //Phase 8 Dawnforge & Ardonis say
+ case 8:
+ DoScriptText(SAY_COMMANDER_DAWNFORGE_4, me);
+ DoScriptText(SAY_ARCANIST_ARDONIS_2, ardonis);
+ ++Phase;
+ Phase_Timer = 4000;
+ break;
+ //Phase 9 Pathaleons Despawn, Reset Dawnforge & Ardonis angle
+ case 9:
+ Turn_to_eachother();
+ //hide pathaleon, unit will despawn shortly
+ pathaleon->SetVisibility(VISIBILITY_OFF);
PhaseSubphase = 0;
++Phase;
- Phase_Timer = 10000;
+ Phase_Timer = 3000;
+ break;
+ //Phase 10 Dawnforge say
+ case 10:
+ DoScriptText(SAY_COMMANDER_DAWNFORGE_5, me);
+ pPlayer->AreaExploredOrEventHappens(QUEST_INFO_GATHERING);
+ Reset();
break;
}
- break;
- //Phase 8 Dawnforge & Ardonis say
- case 8:
- DoScriptText(SAY_COMMANDER_DAWNFORGE_4, me);
- DoScriptText(SAY_ARCANIST_ARDONIS_2, ardonis);
- ++Phase;
- Phase_Timer = 4000;
- break;
- //Phase 9 Pathaleons Despawn, Reset Dawnforge & Ardonis angle
- case 9:
- Turn_to_eachother();
- //hide pathaleon, unit will despawn shortly
- pathaleon->SetVisibility(VISIBILITY_OFF);
- PhaseSubphase = 0;
- ++Phase;
- Phase_Timer = 3000;
- break;
- //Phase 10 Dawnforge say
- case 10:
- DoScriptText(SAY_COMMANDER_DAWNFORGE_5, me);
- pPlayer->AreaExploredOrEventHappens(QUEST_INFO_GATHERING);
- Reset();
- break;
- }
- }
-};
+ }
+ };
-CreatureAI* GetAI_npc_commander_dawnforge(Creature* pCreature)
-{
- return new npc_commander_dawnforgeAI(pCreature);
-}
+};
-bool AreaTrigger_at_commander_dawnforge(Player* pPlayer, const AreaTriggerEntry * /*at*/)
+ class at_commander_dawnforge : public AreaTriggerScript
{
- //if player lost aura or not have at all, we should not try start event.
- if (!pPlayer->HasAura(SPELL_SUNFURY_DISGUISE))
- return false;
+public:
+ at_commander_dawnforge() : AreaTriggerScript("at_commander_dawnforge") { }
- if (pPlayer->isAlive() && pPlayer->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE)
+ bool OnTrigger(Player* pPlayer, const AreaTriggerEntry * /*at*/)
{
- Creature* Dawnforge = pPlayer->FindNearestCreature(CreatureEntry[1], 30.0f);
-
- if (!Dawnforge)
+ //if player lost aura or not have at all, we should not try start event.
+ if (!pPlayer->HasAura(SPELL_SUNFURY_DISGUISE))
return false;
- if (CAST_AI(npc_commander_dawnforgeAI, Dawnforge->AI())->CanStartEvent(pPlayer))
- return true;
+ if (pPlayer->isAlive() && pPlayer->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE)
+ {
+ Creature* Dawnforge = pPlayer->FindNearestCreature(CreatureEntry[1], 30.0f);
+
+ if (!Dawnforge)
+ return false;
+
+ if (CAST_AI(npc_commander_dawnforge::npc_commander_dawnforgeAI, Dawnforge->AI())->CanStartEvent(pPlayer))
+ return true;
+ }
+ return false;
}
- return false;
-}
+
+};
/*######
## npc_professor_dabiri
@@ -635,38 +661,46 @@ bool AreaTrigger_at_commander_dawnforge(Player* pPlayer, const AreaTriggerEntry
#define QUEST_DIMENSIUS 10439
#define QUEST_ON_NETHERY_WINGS 10438
-
-bool GossipHello_npc_professor_dabiri(Player* pPlayer, Creature* pCreature)
+ class npc_professor_dabiri : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+public:
+ npc_professor_dabiri() : CreatureScript("npc_professor_dabiri") { }
- if (pPlayer->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(29778, 1))
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const *quest)
+ {
+ if (quest->GetQuestId() == QUEST_DIMENSIUS)
+ DoScriptText(WHISPER_DABIRI, pCreature, pPlayer);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
+ }
- return true;
-}
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ pCreature->CastSpell(pPlayer, SPELL_PHASE_DISTRUPTOR, false);
+ pPlayer->CLOSE_GOSSIP_MENU();
+ }
-bool GossipSelect_npc_professor_dabiri(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ return true;
+ }
+
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- pCreature->CastSpell(pPlayer, SPELL_PHASE_DISTRUPTOR, false);
- pPlayer->CLOSE_GOSSIP_MENU();
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+
+ if (pPlayer->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(29778, 1))
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+
+ return true;
}
- return true;
-}
+};
-bool QuestAccept_npc_professor_dabiri(Player* pPlayer, Creature* pCreature, Quest const *quest)
-{
- if (quest->GetQuestId() == QUEST_DIMENSIUS)
- DoScriptText(WHISPER_DABIRI, pCreature, pPlayer);
- return true;
-}
/*######
## mob_phase_hunter
@@ -685,117 +719,124 @@ bool QuestAccept_npc_professor_dabiri(Player* pPlayer, Creature* pCreature, Ques
#define SPELL_MANA_BURN 13321
#define SPELL_MATERIALIZE 34804
#define SPELL_DE_MATERIALIZE 34814
-
-struct mob_phase_hunterAI : public ScriptedAI
+ class mob_phase_hunter : public CreatureScript
{
- mob_phase_hunterAI(Creature *c) : ScriptedAI(c) {}
+public:
+ mob_phase_hunter() : CreatureScript("mob_phase_hunter") { }
- bool Weak;
- bool Materialize;
- bool Drained;
- uint8 WeakPercent;
- float HpPercent;
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new mob_phase_hunterAI (pCreature);
+ }
- Player *pPlayer;
- uint64 PlayerGUID;
+ struct mob_phase_hunterAI : public ScriptedAI
+ {
+ mob_phase_hunterAI(Creature *c) : ScriptedAI(c) {}
- uint32 ManaBurnTimer;
+ bool Weak;
+ bool Materialize;
+ bool Drained;
+ uint8 WeakPercent;
+ float HpPercent;
- void Reset()
- {
- Weak = false;
- Materialize = false;
- Drained = false;
- WeakPercent = 25 + (rand() % 16); // 25-40
- HpPercent = 0.0f;
+ Player *pPlayer;
+ uint64 PlayerGUID;
- PlayerGUID = 0;
+ uint32 ManaBurnTimer;
- ManaBurnTimer = 5000 + (rand() % 3 * 1000); // 5-8 sec cd
+ void Reset()
+ {
+ Weak = false;
+ Materialize = false;
+ Drained = false;
+ WeakPercent = 25 + (rand() % 16); // 25-40
+ HpPercent = 0.0f;
- if (me->GetEntry() == NPC_DRAINED_PHASE_HUNTER_ENTRY)
- me->UpdateEntry(NPC_PHASE_HUNTER_ENTRY);
- }
+ PlayerGUID = 0;
- void EnterCombat(Unit * who)
- {
- if (who->GetTypeId() == TYPEID_PLAYER)
- PlayerGUID = who->GetGUID();
- }
+ ManaBurnTimer = 5000 + (rand() % 3 * 1000); // 5-8 sec cd
- void SpellHit(Unit * /*caster*/, const SpellEntry * /*spell*/)
- {
- DoCast(me, SPELL_DE_MATERIALIZE);
- }
+ if (me->GetEntry() == NPC_DRAINED_PHASE_HUNTER_ENTRY)
+ me->UpdateEntry(NPC_PHASE_HUNTER_ENTRY);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!Materialize)
+ void EnterCombat(Unit * who)
{
- DoCast(me, SPELL_MATERIALIZE);
- Materialize = true;
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ PlayerGUID = who->GetGUID();
}
- if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->hasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
- DoCast(me, SPELL_PHASE_SLIP);
-
- if (!UpdateVictim())
- return;
+ void SpellHit(Unit * /*caster*/, const SpellEntry * /*spell*/)
+ {
+ DoCast(me, SPELL_DE_MATERIALIZE);
+ }
- // some code to cast spell Mana Burn on random target which has mana
- if (ManaBurnTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- std::list<HostileReference*> AggroList = me->getThreatManager().getThreatList();
- std::list<Unit*> UnitsWithMana;
+ if (!Materialize)
+ {
+ DoCast(me, SPELL_MATERIALIZE);
+ Materialize = true;
+ }
+
+ if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->hasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
+ DoCast(me, SPELL_PHASE_SLIP);
+
+ if (!UpdateVictim())
+ return;
- for (std::list<HostileReference*>::const_iterator itr = AggroList.begin(); itr != AggroList.end(); ++itr)
+ // some code to cast spell Mana Burn on random target which has mana
+ if (ManaBurnTimer <= diff)
{
- if (Unit *pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
+ std::list<HostileReference*> AggroList = me->getThreatManager().getThreatList();
+ std::list<Unit*> UnitsWithMana;
+
+ for (std::list<HostileReference*>::const_iterator itr = AggroList.begin(); itr != AggroList.end(); ++itr)
{
- if (pUnit->GetCreateMana() > 0)
- UnitsWithMana.push_back(pUnit);
+ if (Unit *pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
+ {
+ if (pUnit->GetCreateMana() > 0)
+ UnitsWithMana.push_back(pUnit);
+ }
}
- }
- if (!UnitsWithMana.empty())
- {
- std::list<Unit*>::const_iterator it = UnitsWithMana.begin();
- std::advance(it, rand() % UnitsWithMana.size());
- DoCast(*it, SPELL_MANA_BURN);
- ManaBurnTimer = 8000 + (rand() % 10 * 1000); // 8-18 sec cd
- }
- else
- ManaBurnTimer = 3500;
- } else ManaBurnTimer -= diff;
+ if (!UnitsWithMana.empty())
+ {
+ std::list<Unit*>::const_iterator it = UnitsWithMana.begin();
+ std::advance(it, rand() % UnitsWithMana.size());
+ DoCast(*it, SPELL_MANA_BURN);
+ ManaBurnTimer = 8000 + (rand() % 10 * 1000); // 8-18 sec cd
+ }
+ else
+ ManaBurnTimer = 3500;
+ } else ManaBurnTimer -= diff;
- if (Player *pPlayer = Unit::GetPlayer(*me, PlayerGUID)) // start: support for quest 10190
- {
- if (!Weak && me->GetHealth() < (me->GetMaxHealth() / 100 * WeakPercent)
- && pPlayer->GetQuestStatus(QUEST_RECHARGING_THE_BATTERIES) == QUEST_STATUS_INCOMPLETE)
- {
- DoScriptText(EMOTE_WEAK, me);
- Weak = true;
- }
- if (Weak && !Drained && me->HasAura(SPELL_RECHARGING_BATTERY))
+ if (Player *pPlayer = Unit::GetPlayer(*me, PlayerGUID)) // start: support for quest 10190
{
- Drained = true;
- HpPercent = float(me->GetHealth()) / float(me->GetMaxHealth());
+ if (!Weak && me->GetHealth() < (me->GetMaxHealth() / 100 * WeakPercent)
+ && pPlayer->GetQuestStatus(QUEST_RECHARGING_THE_BATTERIES) == QUEST_STATUS_INCOMPLETE)
+ {
+ DoScriptText(EMOTE_WEAK, me);
+ Weak = true;
+ }
+ if (Weak && !Drained && me->HasAura(SPELL_RECHARGING_BATTERY))
+ {
+ Drained = true;
+ HpPercent = float(me->GetHealth()) / float(me->GetMaxHealth());
- me->UpdateEntry(NPC_DRAINED_PHASE_HUNTER_ENTRY);
+ me->UpdateEntry(NPC_DRAINED_PHASE_HUNTER_ENTRY);
- me->SetHealth(me->GetMaxHealth() * HpPercent);
- me->LowerPlayerDamageReq(me->GetMaxHealth() - me->GetHealth());
- me->SetInCombatWith(pPlayer);
- }
- } // end: support for quest 10190
+ me->SetHealth(me->GetMaxHealth() * HpPercent);
+ me->LowerPlayerDamageReq(me->GetMaxHealth() - me->GetHealth());
+ me->SetInCombatWith(pPlayer);
+ }
+ } // end: support for quest 10190
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_phase_hunter(Creature* pCreature)
-{
- return new mob_phase_hunterAI (pCreature);
-}
/*######
## npc_bessy
@@ -807,76 +848,82 @@ CreatureAI* GetAI_mob_phase_hunter(Creature* pCreature)
#define SPAWN_SECOND 19881
#define SAY_THADELL_1 -1000304
#define SAY_THADELL_2 -1000305
-
-struct npc_bessyAI : public npc_escortAI
+ class npc_bessy : public CreatureScript
{
+public:
+ npc_bessy() : CreatureScript("npc_bessy") { }
- npc_bessyAI(Creature *c) : npc_escortAI(c) {}
+ bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const* quest)
+ {
+ if (quest->GetQuestId() == Q_ALMABTRIEB)
+ {
+ pCreature->setFaction(113);
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID());
+ }
+ return true;
+ }
- void JustDied(Unit* /*killer*/)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->FailQuest(Q_ALMABTRIEB);
+ return new npc_bessyAI(pCreature);
}
- void WaypointReached(uint32 i)
+ struct npc_bessyAI : public npc_escortAI
{
- Player* pPlayer = GetPlayerForEscort();
- if (!pPlayer)
- return;
+ npc_bessyAI(Creature *c) : npc_escortAI(c) {}
- switch(i)
+ void JustDied(Unit* /*killer*/)
{
- case 3: //first spawn
- me->SummonCreature(SPAWN_FIRST, 2449.67, 2183.11, 96.85, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- me->SummonCreature(SPAWN_FIRST, 2449.53, 2184.43, 96.36, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- me->SummonCreature(SPAWN_FIRST, 2449.85, 2186.34, 97.57, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- break;
+ if (Player* pPlayer = GetPlayerForEscort())
+ pPlayer->FailQuest(Q_ALMABTRIEB);
+ }
- case 7:
- me->SummonCreature(SPAWN_SECOND, 2309.64, 2186.24, 92.25, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- me->SummonCreature(SPAWN_SECOND, 2309.25, 2183.46, 91.75, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- break;
+ void WaypointReached(uint32 i)
+ {
+ Player* pPlayer = GetPlayerForEscort();
- case 12:
- if (pPlayer)
- pPlayer->GroupEventHappens(Q_ALMABTRIEB, me);
- if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30))
- DoScriptText(SAY_THADELL_1, me); break;
- case 13:
- if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30))
- DoScriptText(SAY_THADELL_2, me, pPlayer); break;
- }
- }
+ if (!pPlayer)
+ return;
- void JustSummoned(Creature* summoned)
- {
- summoned->AI()->AttackStart(me);
- }
+ switch(i)
+ {
+ case 3: //first spawn
+ me->SummonCreature(SPAWN_FIRST, 2449.67, 2183.11, 96.85, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_FIRST, 2449.53, 2184.43, 96.36, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_FIRST, 2449.85, 2186.34, 97.57, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ break;
- void Reset()
- {
- me->RestoreFaction();
- }
+ case 7:
+ me->SummonCreature(SPAWN_SECOND, 2309.64, 2186.24, 92.25, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(SPAWN_SECOND, 2309.25, 2183.46, 91.75, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ break;
-};
+ case 12:
+ if (pPlayer)
+ pPlayer->GroupEventHappens(Q_ALMABTRIEB, me);
+ if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30))
+ DoScriptText(SAY_THADELL_1, me); break;
+ case 13:
+ if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30))
+ DoScriptText(SAY_THADELL_2, me, pPlayer); break;
+ }
+ }
-bool QuestAccept_npc_bessy(Player* pPlayer, Creature* pCreature, Quest const* quest)
-{
- if (quest->GetQuestId() == Q_ALMABTRIEB)
- {
- pCreature->setFaction(113);
- pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID());
- }
- return true;
-}
+ void JustSummoned(Creature* summoned)
+ {
+ summoned->AI()->AttackStart(me);
+ }
-CreatureAI* GetAI_npc_bessy(Creature* pCreature)
-{
- return new npc_bessyAI(pCreature);
-}
+ void Reset()
+ {
+ me->RestoreFaction();
+ }
+
+ };
+
+};
/*######
##
@@ -884,44 +931,11 @@ CreatureAI* GetAI_npc_bessy(Creature* pCreature)
void AddSC_netherstorm()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "go_manaforge_control_console";
- newscript->pGOHello = &GOHello_go_manaforge_control_console;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_manaforge_control_console";
- newscript->GetAI = &GetAI_npc_manaforge_control_console;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_commander_dawnforge";
- newscript->GetAI = &GetAI_npc_commander_dawnforge;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "at_commander_dawnforge";
- newscript->pAreaTrigger = &AreaTrigger_at_commander_dawnforge;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_professor_dabiri";
- newscript->pGossipHello = &GossipHello_npc_professor_dabiri;
- newscript->pGossipSelect = &GossipSelect_npc_professor_dabiri;
- newscript->pQuestAccept = &QuestAccept_npc_professor_dabiri;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_phase_hunter";
- newscript->GetAI = &GetAI_mob_phase_hunter;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_bessy";
- newscript->GetAI = &GetAI_npc_bessy;
- newscript->pQuestAccept = &QuestAccept_npc_bessy;
- newscript->RegisterSelf();
+ new go_manaforge_control_console();
+ new npc_manaforge_control_console();
+ new npc_commander_dawnforge();
+ new at_commander_dawnforge();
+ new npc_professor_dabiri();
+ new mob_phase_hunter();
+ new npc_bessy();
}
-
diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp
index a9cc104a285..6726928834e 100644
--- a/src/server/scripts/Outland/shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/shadowmoon_valley.cpp
@@ -62,118 +62,125 @@ enum eMatureNetherwing
QUEST_KINDNESS = 10804,
NPC_EVENT_PINGER = 22131
};
-
-struct mob_mature_netherwing_drakeAI : public ScriptedAI
+ class mob_mature_netherwing_drake : public CreatureScript
{
- mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c) { }
-
- uint64 uiPlayerGUID;
-
- bool bCanEat;
- bool bIsEating;
+public:
+ mob_mature_netherwing_drake() : CreatureScript("mob_mature_netherwing_drake") { }
- uint32 EatTimer;
- uint32 CastTimer;
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new mob_mature_netherwing_drakeAI(pCreature);
+ }
- void Reset()
+ struct mob_mature_netherwing_drakeAI : public ScriptedAI
{
- uiPlayerGUID = 0;
+ mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c) { }
- bCanEat = false;
- bIsEating = false;
+ uint64 uiPlayerGUID;
- EatTimer = 5000;
- CastTimer = 5000;
- }
+ bool bCanEat;
+ bool bIsEating;
- void SpellHit(Unit* pCaster, SpellEntry const* pSpell)
- {
- if (bCanEat || bIsEating)
- return;
+ uint32 EatTimer;
+ uint32 CastTimer;
- if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !me->HasAura(SPELL_JUST_EATEN))
+ void Reset()
{
- uiPlayerGUID = pCaster->GetGUID();
- bCanEat = true;
+ uiPlayerGUID = 0;
+
+ bCanEat = false;
+ bIsEating = false;
+
+ EatTimer = 5000;
+ CastTimer = 5000;
}
- }
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
+ void SpellHit(Unit* pCaster, SpellEntry const* pSpell)
+ {
+ if (bCanEat || bIsEating)
+ return;
+
+ if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !me->HasAura(SPELL_JUST_EATEN))
+ {
+ uiPlayerGUID = pCaster->GetGUID();
+ bCanEat = true;
+ }
+ }
- if (id == POINT_ID)
+ void MovementInform(uint32 type, uint32 id)
{
- bIsEating = true;
- EatTimer = 7000;
- me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (id == POINT_ID)
+ {
+ bIsEating = true;
+ EatTimer = 7000;
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
+ }
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (bCanEat || bIsEating)
+ void UpdateAI(const uint32 diff)
{
- if (EatTimer <= diff)
+ if (bCanEat || bIsEating)
{
- if (bCanEat && !bIsEating)
+ if (EatTimer <= diff)
{
- if (Unit* pUnit = Unit::GetUnit(*me, uiPlayerGUID))
+ if (bCanEat && !bIsEating)
{
- if (GameObject* pGo = pUnit->FindNearestGameObject(GO_CARCASS, 10))
+ if (Unit* pUnit = Unit::GetUnit(*me, uiPlayerGUID))
{
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
- me->GetMotionMaster()->MovementExpired();
+ if (GameObject* pGo = pUnit->FindNearestGameObject(GO_CARCASS, 10))
+ {
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
+ me->GetMotionMaster()->MovementExpired();
- me->GetMotionMaster()->MoveIdle();
- me->StopMoving();
+ me->GetMotionMaster()->MoveIdle();
+ me->StopMoving();
- me->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ());
+ me->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ());
+ }
}
+ bCanEat = false;
}
- bCanEat = false;
- }
- else if (bIsEating)
- {
- DoCast(me, SPELL_JUST_EATEN);
- DoScriptText(SAY_JUST_EATEN, me);
-
- if (Player* pPlr = Unit::GetPlayer(*me, uiPlayerGUID))
+ else if (bIsEating)
{
- pPlr->KilledMonsterCredit(NPC_EVENT_PINGER, me->GetGUID());
+ DoCast(me, SPELL_JUST_EATEN);
+ DoScriptText(SAY_JUST_EATEN, me);
- if (GameObject* pGo = pPlr->FindNearestGameObject(GO_CARCASS, 10))
- pGo->Delete();
- }
+ if (Player* pPlr = Unit::GetPlayer(*me, uiPlayerGUID))
+ {
+ pPlr->KilledMonsterCredit(NPC_EVENT_PINGER, me->GetGUID());
+
+ if (GameObject* pGo = pPlr->FindNearestGameObject(GO_CARCASS, 10))
+ pGo->Delete();
+ }
- Reset();
- me->GetMotionMaster()->Clear();
+ Reset();
+ me->GetMotionMaster()->Clear();
+ }
}
+ else
+ EatTimer -= diff;
+
+ return;
}
- else
- EatTimer -= diff;
- return;
- }
+ if (!UpdateVictim())
+ return;
- if (!UpdateVictim())
- return;
+ if (CastTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_NETHER_BREATH);
+ CastTimer = 5000;
+ } else CastTimer -= diff;
- if (CastTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_NETHER_BREATH);
- CastTimer = 5000;
- } else CastTimer -= diff;
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_mature_netherwing_drake(Creature* pCreature)
-{
- return new mob_mature_netherwing_drakeAI(pCreature);
-}
/*###
# mob_enslaved_netherwing_drake
@@ -187,219 +194,240 @@ CreatureAI* GetAI_mob_mature_netherwing_drake(Creature* pCreature)
#define CREATURE_DRAGONMAW_SUBJUGATOR 21718
#define CREATURE_ESCAPE_DUMMY 22317
-
-struct mob_enslaved_netherwing_drakeAI : public ScriptedAI
+ class mob_enslaved_netherwing_drake : public CreatureScript
{
- mob_enslaved_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
- {
- PlayerGUID = 0;
- Tapped = false;
- Reset();
- }
+public:
+ mob_enslaved_netherwing_drake() : CreatureScript("mob_enslaved_netherwing_drake") { }
- uint64 PlayerGUID;
- uint32 FlyTimer;
- bool Tapped;
-
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (!Tapped)
- me->setFaction(FACTION_DEFAULT);
-
- FlyTimer = 10000;
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- me->SetVisibility(VISIBILITY_ON);
+ return new mob_enslaved_netherwing_drakeAI(pCreature);
}
- void SpellHit(Unit* caster, const SpellEntry* spell)
+ struct mob_enslaved_netherwing_drakeAI : public ScriptedAI
{
- if (!caster)
- return;
+ mob_enslaved_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
+ {
+ PlayerGUID = 0;
+ Tapped = false;
+ Reset();
+ }
- if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_HIT_FORCE_OF_NELTHARAKU && !Tapped)
+ uint64 PlayerGUID;
+ uint32 FlyTimer;
+ bool Tapped;
+
+ void Reset()
{
- Tapped = true;
- PlayerGUID = caster->GetGUID();
+ if (!Tapped)
+ me->setFaction(FACTION_DEFAULT);
- me->setFaction(FACTION_FRIENDLY);
- DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true);
+ FlyTimer = 10000;
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SetVisibility(VISIBILITY_ON);
+ }
- Unit* Dragonmaw = me->FindNearestCreature(CREATURE_DRAGONMAW_SUBJUGATOR, 50);
+ void SpellHit(Unit* caster, const SpellEntry* spell)
+ {
+ if (!caster)
+ return;
- if (Dragonmaw)
+ if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_HIT_FORCE_OF_NELTHARAKU && !Tapped)
{
- me->AddThreat(Dragonmaw, 100000.0f);
- AttackStart(Dragonmaw);
- }
+ Tapped = true;
+ PlayerGUID = caster->GetGUID();
- HostileReference* ref = me->getThreatManager().getOnlineContainer().getReferenceByTarget(caster);
- if (ref)
- ref->removeReference();
- }
- }
+ me->setFaction(FACTION_FRIENDLY);
+ DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true);
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
+ Unit* Dragonmaw = me->FindNearestCreature(CREATURE_DRAGONMAW_SUBJUGATOR, 50);
- if (id == 1)
+ if (Dragonmaw)
+ {
+ me->AddThreat(Dragonmaw, 100000.0f);
+ AttackStart(Dragonmaw);
+ }
+
+ HostileReference* ref = me->getThreatManager().getOnlineContainer().getReferenceByTarget(caster);
+ if (ref)
+ ref->removeReference();
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
{
- if (PlayerGUID)
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (id == 1)
{
- Unit* plr = Unit::GetUnit((*me), PlayerGUID);
- if (plr)
- DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true);
+ if (PlayerGUID)
+ {
+ Unit* plr = Unit::GetUnit((*me), PlayerGUID);
+ if (plr)
+ DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true);
- PlayerGUID = 0;
+ PlayerGUID = 0;
+ }
+ me->SetVisibility(VISIBILITY_OFF);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->RemoveCorpse();
}
- me->SetVisibility(VISIBILITY_OFF);
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- me->RemoveCorpse();
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
+ void UpdateAI(const uint32 diff)
{
- if (Tapped)
- if (FlyTimer <= diff)
+ if (!UpdateVictim())
{
- Tapped = false;
- if (PlayerGUID)
+ if (Tapped)
+ if (FlyTimer <= diff)
{
- Player* plr = Unit::GetPlayer(*me, PlayerGUID);
- if (plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE)
+ Tapped = false;
+ if (PlayerGUID)
{
- DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true);
- /*
- float x,y,z;
- me->GetPosition(x,y,z);
-
- float dx,dy,dz;
- me->GetRandomPoint(x, y, z, 20, dx, dy, dz);
- dz += 20; // so it's in the air, not ground*/
-
- Position pos;
- if (Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30))
- EscapeDummy->GetPosition(&pos);
- else
+ Player* plr = Unit::GetPlayer(*me, PlayerGUID);
+ if (plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE)
{
- me->GetRandomNearPosition(pos, 20);
- pos.m_positionZ += 25;
+ DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true);
+ /*
+ float x,y,z;
+ me->GetPosition(x,y,z);
+
+ float dx,dy,dz;
+ me->GetRandomPoint(x, y, z, 20, dx, dy, dz);
+ dz += 20; // so it's in the air, not ground*/
+
+ Position pos;
+ if (Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30))
+ EscapeDummy->GetPosition(&pos);
+ else
+ {
+ me->GetRandomNearPosition(pos, 20);
+ pos.m_positionZ += 25;
+ }
+
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->GetMotionMaster()->MovePoint(1, pos);
}
-
- me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- me->GetMotionMaster()->MovePoint(1, pos);
}
- }
- } else FlyTimer -= diff;
- return;
+ } else FlyTimer -= diff;
+ return;
+ }
+
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_enslaved_netherwing_drake(Creature* pCreature)
-{
- return new mob_enslaved_netherwing_drakeAI(pCreature);
-}
/*#####
# mob_dragonmaw_peon
#####*/
-
-struct mob_dragonmaw_peonAI : public ScriptedAI
+ class mob_dragonmaw_peon : public CreatureScript
{
- mob_dragonmaw_peonAI(Creature* c) : ScriptedAI(c) {}
-
- uint64 PlayerGUID;
- bool Tapped;
- uint32 PoisonTimer;
+public:
+ mob_dragonmaw_peon() : CreatureScript("mob_dragonmaw_peon") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- PlayerGUID = 0;
- Tapped = false;
- PoisonTimer = 0;
+ return new mob_dragonmaw_peonAI(pCreature);
}
- void SpellHit(Unit* caster, const SpellEntry* spell)
+ struct mob_dragonmaw_peonAI : public ScriptedAI
{
- if (!caster)
- return;
+ mob_dragonmaw_peonAI(Creature* c) : ScriptedAI(c) {}
- if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == 40468 && !Tapped)
+ uint64 PlayerGUID;
+ bool Tapped;
+ uint32 PoisonTimer;
+
+ void Reset()
{
- PlayerGUID = caster->GetGUID();
+ PlayerGUID = 0;
+ Tapped = false;
+ PoisonTimer = 0;
+ }
- Tapped = true;
- float x, y, z;
- caster->GetClosePoint(x, y, z, me->GetObjectSize());
+ void SpellHit(Unit* caster, const SpellEntry* spell)
+ {
+ if (!caster)
+ return;
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- me->GetMotionMaster()->MovePoint(1, x, y, z);
- }
- }
+ if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == 40468 && !Tapped)
+ {
+ PlayerGUID = caster->GetGUID();
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
+ Tapped = true;
+ float x, y, z;
+ caster->GetClosePoint(x, y, z, me->GetObjectSize());
- if (id)
- {
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_EAT);
- PoisonTimer = 15000;
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ me->GetMotionMaster()->MovePoint(1, x, y, z);
+ }
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (PoisonTimer)
- if (PoisonTimer <= diff)
+ void MovementInform(uint32 type, uint32 id)
{
- if (PlayerGUID)
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (id)
{
- Player* plr = Unit::GetPlayer(*me, PlayerGUID);
- if (plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
- plr->KilledMonsterCredit(23209, me->GetGUID());
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_EAT);
+ PoisonTimer = 15000;
}
- PoisonTimer = 0;
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- } else PoisonTimer -= diff;
- }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (PoisonTimer)
+ if (PoisonTimer <= diff)
+ {
+ if (PlayerGUID)
+ {
+ Player* plr = Unit::GetPlayer(*me, PlayerGUID);
+ if (plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
+ plr->KilledMonsterCredit(23209, me->GetGUID());
+ }
+ PoisonTimer = 0;
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ } else PoisonTimer -= diff;
+ }
+ };
+
};
-CreatureAI* GetAI_mob_dragonmaw_peon(Creature* pCreature)
-{
- return new mob_dragonmaw_peonAI(pCreature);
-}
/*######
## npc_drake_dealer_hurlunk
######*/
-
-bool GossipHello_npc_drake_dealer_hurlunk(Player* pPlayer, Creature* pCreature)
+ class npc_drake_dealer_hurlunk : public CreatureScript
{
- if (pCreature->isVendor() && pPlayer->GetReputationRank(1015) == REP_EXALTED)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+public:
+ npc_drake_dealer_hurlunk() : CreatureScript("npc_drake_dealer_hurlunk") { }
+
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ if (uiAction == GOSSIP_ACTION_TRADE)
+ pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
+ }
- return true;
-}
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pCreature->isVendor() && pPlayer->GetReputationRank(1015) == REP_EXALTED)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-bool GossipSelect_npc_drake_dealer_hurlunk(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_TRADE)
- pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+
+ return true;
+ }
+
+};
- return true;
-}
/*######
## npc_flanis_swiftwing_and_kagrosh
@@ -407,43 +435,50 @@ bool GossipSelect_npc_drake_dealer_hurlunk(Player* pPlayer, Creature* pCreature,
#define GOSSIP_HSK1 "Take Flanis's Pack"
#define GOSSIP_HSK2 "Take Kagrosh's Pack"
-
-bool GossipHello_npcs_flanis_swiftwing_and_kagrosh(Player* pPlayer, Creature* pCreature)
+ class npcs_flanis_swiftwing_and_kagrosh : public CreatureScript
{
- if (pPlayer->GetQuestStatus(10583) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(30658,1,true))
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HSK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- if (pPlayer->GetQuestStatus(10601) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(30659,1,true))
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HSK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+public:
+ npcs_flanis_swiftwing_and_kagrosh() : CreatureScript("npcs_flanis_swiftwing_and_kagrosh") { }
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npcs_flanis_swiftwing_and_kagrosh(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ bool OnGossipSelect(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction)
{
- ItemPosCountVec dest;
- uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30658, 1, false);
- if (msg == EQUIP_ERR_OK)
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ ItemPosCountVec dest;
+ uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30658, 1, false);
+ if (msg == EQUIP_ERR_OK)
+ {
+ pPlayer->StoreNewItem(dest, 30658, 1, true);
+ pPlayer->PlayerTalkClass->ClearMenus();
+ }
+ }
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
{
- pPlayer->StoreNewItem(dest, 30658, 1, true);
- pPlayer->PlayerTalkClass->ClearMenus();
+ ItemPosCountVec dest;
+ uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30659, 1, false);
+ if (msg == EQUIP_ERR_OK)
+ {
+ pPlayer->StoreNewItem(dest, 30659, 1, true);
+ pPlayer->PlayerTalkClass->ClearMenus();
+ }
}
+ return true;
}
- if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
+
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- ItemPosCountVec dest;
- uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30659, 1, false);
- if (msg == EQUIP_ERR_OK)
- {
- pPlayer->StoreNewItem(dest, 30659, 1, true);
- pPlayer->PlayerTalkClass->ClearMenus();
- }
+ if (pPlayer->GetQuestStatus(10583) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(30658,1,true))
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HSK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ if (pPlayer->GetQuestStatus(10601) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(30659,1,true))
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HSK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+
+ return true;
}
- return true;
-}
+
+};
+
/*######
## npc_murkblood_overseer
@@ -457,54 +492,61 @@ bool GossipSelect_npcs_flanis_swiftwing_and_kagrosh(Player* pPlayer, Creature* /
#define GOSSIP_SMO3 "Continue please."
#define GOSSIP_SMO4 "Who are these bidders?"
#define GOSSIP_SMO5 "Well... yes."
-
-bool GossipHello_npc_murkblood_overseer(Player* pPlayer, Creature* pCreature)
+ class npc_murkblood_overseer : public CreatureScript
{
- if (pPlayer->GetQuestStatus(QUEST_11082) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HMO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+public:
+ npc_murkblood_overseer() : CreatureScript("npc_murkblood_overseer") { }
- pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
- return true;
-}
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ switch (uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ //correct id not known
+ pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ //correct id not known
+ pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ //correct id not known
+ pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ //correct id not known
+ pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ //correct id not known
+ pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ //correct id not known
+ pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
+ pCreature->CastSpell(pPlayer,41121,false);
+ pPlayer->AreaExploredOrEventHappens(QUEST_11082);
+ break;
+ }
+ return true;
+ }
-bool GossipSelect_npc_murkblood_overseer(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch (uiAction)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- //correct id not known
- pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- //correct id not known
- pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- //correct id not known
- pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- //correct id not known
- pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- //correct id not known
- pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- //correct id not known
- pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
- pCreature->CastSpell(pPlayer,41121,false);
- pPlayer->AreaExploredOrEventHappens(QUEST_11082);
- break;
+ if (pPlayer->GetQuestStatus(QUEST_11082) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HMO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID());
+ return true;
}
- return true;
-}
+
+};
+
/*######
## npc_neltharaku
@@ -514,43 +556,50 @@ bool GossipSelect_npc_murkblood_overseer(Player* pPlayer, Creature* pCreature, u
#define GOSSIP_SN1 "But you are dragons! How could orcs do this to you?"
#define GOSSIP_SN2 "Your mate?"
#define GOSSIP_SN3 "I have battled many beasts, dragon. I will help you."
-
-bool GossipHello_npc_neltharaku(Player* pPlayer, Creature* pCreature)
+ class npc_neltharaku : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+public:
+ npc_neltharaku() : CreatureScript("npc_neltharaku") { }
- if (pPlayer->GetQuestStatus(10814) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ switch (uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ pPlayer->SEND_GOSSIP_MENU(10614, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ pPlayer->SEND_GOSSIP_MENU(10615, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ pPlayer->SEND_GOSSIP_MENU(10616, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ pPlayer->CLOSE_GOSSIP_MENU();
+ pPlayer->AreaExploredOrEventHappens(10814);
+ break;
+ }
+ return true;
+ }
- pPlayer->SEND_GOSSIP_MENU(10613, pCreature->GetGUID());
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
- return true;
-}
+ if (pPlayer->GetQuestStatus(10814) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-bool GossipSelect_npc_neltharaku(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- pPlayer->SEND_GOSSIP_MENU(10614, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- pPlayer->SEND_GOSSIP_MENU(10615, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- pPlayer->SEND_GOSSIP_MENU(10616, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- pPlayer->CLOSE_GOSSIP_MENU();
- pPlayer->AreaExploredOrEventHappens(10814);
- break;
+ pPlayer->SEND_GOSSIP_MENU(10613, pCreature->GetGUID());
+
+ return true;
}
- return true;
-}
+
+};
+
/*######
## npc_oronok
@@ -563,62 +612,69 @@ bool GossipSelect_npc_neltharaku(Player* pPlayer, Creature* pCreature, uint32 /*
#define GOSSIP_ORONOK5 "Continue, please."
#define GOSSIP_ORONOK6 "So what of the cipher now? And your boys?"
#define GOSSIP_ORONOK7 "I will find your boys and the cipher, Oronok."
-
-bool GossipHello_npc_oronok_tornheart(Player* pPlayer, Creature* pCreature)
+ class npc_oronok_tornheart : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
- if (pCreature->isVendor())
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+public:
+ npc_oronok_tornheart() : CreatureScript("npc_oronok_tornheart") { }
- if (pPlayer->GetQuestStatus(10519) == QUEST_STATUS_INCOMPLETE)
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- pPlayer->SEND_GOSSIP_MENU(10312, pCreature->GetGUID());
- }else
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
-
- return true;
-}
+ switch (uiAction)
+ {
+ case GOSSIP_ACTION_TRADE:
+ pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF:
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ pPlayer->SEND_GOSSIP_MENU(10313, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ pPlayer->SEND_GOSSIP_MENU(10314, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ pPlayer->SEND_GOSSIP_MENU(10315, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ pPlayer->SEND_GOSSIP_MENU(10316, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ pPlayer->SEND_GOSSIP_MENU(10317, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ pPlayer->SEND_GOSSIP_MENU(10318, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ pPlayer->CLOSE_GOSSIP_MENU();
+ pPlayer->AreaExploredOrEventHappens(10519);
+ break;
+ }
+ return true;
+ }
-bool GossipSelect_npc_oronok_tornheart(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch (uiAction)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- case GOSSIP_ACTION_TRADE:
- pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF:
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- pPlayer->SEND_GOSSIP_MENU(10313, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- pPlayer->SEND_GOSSIP_MENU(10314, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- pPlayer->SEND_GOSSIP_MENU(10315, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- pPlayer->SEND_GOSSIP_MENU(10316, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- pPlayer->SEND_GOSSIP_MENU(10317, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- pPlayer->SEND_GOSSIP_MENU(10318, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- pPlayer->CLOSE_GOSSIP_MENU();
- pPlayer->AreaExploredOrEventHappens(10519);
- break;
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+ if (pCreature->isVendor())
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ if (pPlayer->GetQuestStatus(10519) == QUEST_STATUS_INCOMPLETE)
+ {
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ pPlayer->SEND_GOSSIP_MENU(10312, pCreature->GetGUID());
+ }else
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+
+ return true;
}
- return true;
-}
+
+};
+
/*####
# npc_karynaku
@@ -630,14 +686,20 @@ enum eKarynaku
TAXI_PATH_ID = 649
};
-
-bool QuestAccept_npc_karynaku(Player* pPlayer, Creature* /*pCreature*/, Quest const* quest)
+ class npc_karynaku : public CreatureScript
{
- if (quest->GetQuestId() == QUEST_ALLY_OF_NETHER)
- pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID); //pPlayer->ActivateTaxiPathTo(649);
+public:
+ npc_karynaku() : CreatureScript("npc_karynaku") { }
- return true;
-}
+ bool OnQuestAccept(Player* pPlayer, Creature* /*pCreature*/, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_ALLY_OF_NETHER)
+ pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID); //pPlayer->ActivateTaxiPathTo(649);
+
+ return true;
+ }
+
+};
/*####
# npc_overlord_morghor
@@ -672,188 +734,196 @@ bool QuestAccept_npc_karynaku(Player* pPlayer, Creature* /*pCreature*/, Quest co
#define LORD_ILLIDAN_SAY_7 -1100220
#define YARZILL_THE_MERC_SAY -1100221
-
-struct npc_overlord_morghorAI : public ScriptedAI
+ class npc_overlord_morghor : public CreatureScript
{
- npc_overlord_morghorAI(Creature *c) : ScriptedAI(c) {}
-
- uint64 PlayerGUID;
- uint64 IllidanGUID;
-
- uint32 ConversationTimer;
- uint32 Step;
-
- bool Event;
+public:
+ npc_overlord_morghor() : CreatureScript("npc_overlord_morghor") { }
- void Reset()
+ bool OnQuestAccept(Player* pPlayer, Creature* pCreature, const Quest *_Quest)
{
- PlayerGUID = 0;
- IllidanGUID = 0;
-
- ConversationTimer = 0;
- Step = 0;
-
- Event = false;
- me->SetUInt32Value(UNIT_NPC_FLAGS, 2);
+ if (_Quest->GetQuestId() == QUEST_LORD_ILLIDAN_STORMRAGE)
+ {
+ CAST_AI(npc_overlord_morghor::npc_overlord_morghorAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID();
+ CAST_AI(npc_overlord_morghor::npc_overlord_morghorAI, pCreature->AI())->StartEvent();
+ return true;
+ }
+ return false;
}
- void StartEvent()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
- me->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
- Unit* Illidan = me->SummonCreature(C_ILLIDAN, -5107.83, 602.584, 85.2393, 4.92598, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (Illidan)
- {
- IllidanGUID = Illidan->GetGUID();
- Illidan->SetVisibility(VISIBILITY_OFF);
- }
- if (PlayerGUID)
- {
- Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
- if (pPlayer)
- DoScriptText(OVERLORD_SAY_1, me, pPlayer);
- }
- ConversationTimer = 4200;
- Step = 0;
- Event = true;
+ return new npc_overlord_morghorAI(pCreature);
}
- uint32 NextStep(uint32 Step)
+ struct npc_overlord_morghorAI : public ScriptedAI
{
- Unit* plr = Unit::GetUnit((*me), PlayerGUID);
+ npc_overlord_morghorAI(Creature *c) : ScriptedAI(c) {}
- Unit* Illi = Unit::GetUnit((*me), IllidanGUID);
+ uint64 PlayerGUID;
+ uint64 IllidanGUID;
- if (!plr || !Illi)
+ uint32 ConversationTimer;
+ uint32 Step;
+
+ bool Event;
+
+ void Reset()
{
- EnterEvadeMode();
- return 0;
+ PlayerGUID = 0;
+ IllidanGUID = 0;
+
+ ConversationTimer = 0;
+ Step = 0;
+
+ Event = false;
+ me->SetUInt32Value(UNIT_NPC_FLAGS, 2);
}
- switch(Step)
+ void StartEvent()
{
- case 0: return 0; break;
- case 1: me->GetMotionMaster()->MovePoint(0, -5104.41, 595.297, 85.6838); return 9000; break;
- case 2: DoScriptText(OVERLORD_YELL_1, me, plr); return 4500; break;
- case 3: me->SetInFront(plr); return 3200; break;
- case 4: DoScriptText(OVERLORD_SAY_2, me, plr); return 2000; break;
- case 5: Illi->SetVisibility(VISIBILITY_ON);
- Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break;
- case 6:
- Illi->CastSpell(Illi, SPELL_ONE, true);
- Illi->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
- me->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID);
- return 2000; break;
- case 7: DoScriptText(OVERLORD_YELL_2, me); return 4500; break;
- case 8: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break;
- case 9: DoScriptText(OVERLORD_SAY_3, me); return 6500; break;
- case 10: DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000; break;
- case 11: DoScriptText(OVERLORD_SAY_4, me, plr); return 6000; break;
- case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break;
- case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break;
- case 14: Illi->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 1500; break;
- case 15: DoScriptText(LORD_ILLIDAN_SAY_4, Illi); return 1500; break;
- case 16:
- if (plr)
+ me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
+ Unit* Illidan = me->SummonCreature(C_ILLIDAN, -5107.83, 602.584, 85.2393, 4.92598, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (Illidan)
{
- Illi->CastSpell(plr, SPELL_TWO, true);
- plr->RemoveAurasDueToSpell(SPELL_THREE);
- plr->RemoveAurasDueToSpell(SPELL_FOUR);
- return 5000;
- }else{
- CAST_PLR(plr)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100;
+ IllidanGUID = Illidan->GetGUID();
+ Illidan->SetVisibility(VISIBILITY_OFF);
}
- break;
- case 17: DoScriptText(LORD_ILLIDAN_SAY_5, Illi); return 5000; break;
- case 18: DoScriptText(LORD_ILLIDAN_SAY_6, Illi); return 5000; break;
- case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break;
- case 20:
- Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- Illi->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- return 500; break;
- case 21: DoScriptText(OVERLORD_SAY_5, me); return 500; break;
- case 22:
- Illi->SetVisibility(VISIBILITY_OFF);
- Illi->setDeathState(JUST_DIED);
- return 1000; break;
- case 23: me->SetUInt32Value(UNIT_FIELD_BYTES_1,0); return 2000; break;
- case 24: me->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 5000; break;
- case 25: DoScriptText(OVERLORD_SAY_6, me); return 2000; break;
- case 26:
- if (plr)
- CAST_PLR(plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, me);
- return 6000; break;
- case 27:
- {
- Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
- if (Yarzill)
- Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID);
- return 500; }
- break;
- case 28:
- plr->RemoveAurasDueToSpell(SPELL_TWO);
- plr->RemoveAurasDueToSpell(41519);
- plr->CastSpell(plr, SPELL_THREE, true);
- plr->CastSpell(plr, SPELL_FOUR, true);
- return 1000; break;
- case 29:
+ if (PlayerGUID)
{
- Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
- if (Yarzill)
- DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, plr);
- return 5000; }
- break;
- case 30:
+ Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
+ if (pPlayer)
+ DoScriptText(OVERLORD_SAY_1, me, pPlayer);
+ }
+ ConversationTimer = 4200;
+ Step = 0;
+ Event = true;
+ }
+
+ uint32 NextStep(uint32 Step)
+ {
+ Unit* plr = Unit::GetUnit((*me), PlayerGUID);
+
+ Unit* Illi = Unit::GetUnit((*me), IllidanGUID);
+
+ if (!plr || !Illi)
{
- Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
- if (Yarzill)
- Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0);
- return 5000; }
- break;
- case 31:
+ EnterEvadeMode();
+ return 0;
+ }
+
+ switch(Step)
{
- Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
- if (Yarzill)
- Yarzill->CastSpell(plr, 41540, true);
- return 1000;}
-break;
- case 32: me->GetMotionMaster()->MovePoint(0, -5085.77, 577.231, 86.6719); return 5000; break;
- case 33: Reset(); return 100; break;
-
- default : return 0;
+ case 0: return 0; break;
+ case 1: me->GetMotionMaster()->MovePoint(0, -5104.41, 595.297, 85.6838); return 9000; break;
+ case 2: DoScriptText(OVERLORD_YELL_1, me, plr); return 4500; break;
+ case 3: me->SetInFront(plr); return 3200; break;
+ case 4: DoScriptText(OVERLORD_SAY_2, me, plr); return 2000; break;
+ case 5: Illi->SetVisibility(VISIBILITY_ON);
+ Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break;
+ case 6:
+ Illi->CastSpell(Illi, SPELL_ONE, true);
+ Illi->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
+ me->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID);
+ return 2000; break;
+ case 7: DoScriptText(OVERLORD_YELL_2, me); return 4500; break;
+ case 8: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break;
+ case 9: DoScriptText(OVERLORD_SAY_3, me); return 6500; break;
+ case 10: DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000; break;
+ case 11: DoScriptText(OVERLORD_SAY_4, me, plr); return 6000; break;
+ case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break;
+ case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break;
+ case 14: Illi->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 1500; break;
+ case 15: DoScriptText(LORD_ILLIDAN_SAY_4, Illi); return 1500; break;
+ case 16:
+ if (plr)
+ {
+ Illi->CastSpell(plr, SPELL_TWO, true);
+ plr->RemoveAurasDueToSpell(SPELL_THREE);
+ plr->RemoveAurasDueToSpell(SPELL_FOUR);
+ return 5000;
+ }else{
+ CAST_PLR(plr)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100;
+ }
+ break;
+ case 17: DoScriptText(LORD_ILLIDAN_SAY_5, Illi); return 5000; break;
+ case 18: DoScriptText(LORD_ILLIDAN_SAY_6, Illi); return 5000; break;
+ case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break;
+ case 20:
+ Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ Illi->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ return 500; break;
+ case 21: DoScriptText(OVERLORD_SAY_5, me); return 500; break;
+ case 22:
+ Illi->SetVisibility(VISIBILITY_OFF);
+ Illi->setDeathState(JUST_DIED);
+ return 1000; break;
+ case 23: me->SetUInt32Value(UNIT_FIELD_BYTES_1,0); return 2000; break;
+ case 24: me->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 5000; break;
+ case 25: DoScriptText(OVERLORD_SAY_6, me); return 2000; break;
+ case 26:
+ if (plr)
+ CAST_PLR(plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, me);
+ return 6000; break;
+ case 27:
+ {
+ Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
+ if (Yarzill)
+ Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID);
+ return 500; }
+ break;
+ case 28:
+ plr->RemoveAurasDueToSpell(SPELL_TWO);
+ plr->RemoveAurasDueToSpell(41519);
+ plr->CastSpell(plr, SPELL_THREE, true);
+ plr->CastSpell(plr, SPELL_FOUR, true);
+ return 1000; break;
+ case 29:
+ {
+ Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
+ if (Yarzill)
+ DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, plr);
+ return 5000; }
+ break;
+ case 30:
+ {
+ Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
+ if (Yarzill)
+ Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ return 5000; }
+ break;
+ case 31:
+ {
+ Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
+ if (Yarzill)
+ Yarzill->CastSpell(plr, 41540, true);
+ return 1000;}
+ break;
+ case 32: me->GetMotionMaster()->MovePoint(0, -5085.77, 577.231, 86.6719); return 5000; break;
+ case 33: Reset(); return 100; break;
+
+ default : return 0;
+ }
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (!ConversationTimer)
- return;
-
- if (ConversationTimer <= diff)
+ void UpdateAI(const uint32 diff)
{
- if (Event && IllidanGUID && PlayerGUID)
+ if (!ConversationTimer)
+ return;
+
+ if (ConversationTimer <= diff)
{
- ConversationTimer = NextStep(++Step);
- }
- } else ConversationTimer -= diff;
- }
+ if (Event && IllidanGUID && PlayerGUID)
+ {
+ ConversationTimer = NextStep(++Step);
+ }
+ } else ConversationTimer -= diff;
+ }
+ };
+
};
-CreatureAI* GetAI_npc_overlord_morghor(Creature* pCreature)
-{
-return new npc_overlord_morghorAI(pCreature);
-}
-bool QuestAccept_npc_overlord_morghor(Player* pPlayer, Creature* pCreature, const Quest *_Quest)
-{
- if (_Quest->GetQuestId() == QUEST_LORD_ILLIDAN_STORMRAGE)
- {
- CAST_AI(npc_overlord_morghorAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID();
- CAST_AI(npc_overlord_morghorAI, pCreature->AI())->StartEvent();
- return true;
- }
- return false;
-}
/*####
# npc_earthmender_wilda
@@ -881,150 +951,158 @@ enum eEarthmender
NPC_COILSKAR_ASSASSIN = 21044,
FACTION_EARTHEN = 1726 //guessed
};
-
-struct npc_earthmender_wildaAI : public npc_escortAI
+ class npc_earthmender_wilda : public CreatureScript
{
- npc_earthmender_wildaAI(Creature* pCreature) : npc_escortAI(pCreature) { }
+public:
+ npc_earthmender_wilda() : CreatureScript("npc_earthmender_wilda") { }
- uint32 m_uiHealingTimer;
+ bool OnQuestAccept(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
+ {
+ if (pQuest->GetQuestId() == QUEST_ESCAPE_COILSCAR)
+ {
+ DoScriptText(SAY_WIL_START, pCreature, pPlayer);
+ pCreature->setFaction(FACTION_EARTHEN);
+
+ if (npc_earthmender_wildaAI* pEscortAI = CAST_AI(npc_earthmender_wilda::npc_earthmender_wildaAI, pCreature->AI()))
+ pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest);
+ }
+ return true;
+ }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- m_uiHealingTimer = 0;
+ return new npc_earthmender_wildaAI(pCreature);
}
- void WaypointReached(uint32 uiPointId)
+ struct npc_earthmender_wildaAI : public npc_escortAI
{
- Player* pPlayer = GetPlayerForEscort();
+ npc_earthmender_wildaAI(Creature* pCreature) : npc_escortAI(pCreature) { }
- if (!pPlayer)
- return;
+ uint32 m_uiHealingTimer;
- switch(uiPointId)
+ void Reset()
{
- case 13:
- DoScriptText(SAY_WIL_PROGRESS1, me, pPlayer);
- DoSpawnAssassin();
- break;
- case 14:
- DoSpawnAssassin();
- break;
- case 15:
- DoScriptText(SAY_WIL_FIND_EXIT, me, pPlayer);
- break;
- case 19:
- DoRandomSay();
- break;
- case 20:
- DoSpawnAssassin();
- break;
- case 26:
- DoRandomSay();
- break;
- case 27:
- DoSpawnAssassin();
- break;
- case 33:
- DoRandomSay();
- break;
- case 34:
- DoSpawnAssassin();
- break;
- case 37:
- DoRandomSay();
- break;
- case 38:
- DoSpawnAssassin();
- break;
- case 39:
- DoScriptText(SAY_WIL_JUST_AHEAD, me, pPlayer);
- break;
- case 43:
- DoRandomSay();
- break;
- case 44:
- DoSpawnAssassin();
- break;
- case 50:
- DoScriptText(SAY_WIL_END, me, pPlayer);
-
- if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->GroupEventHappens(QUEST_ESCAPE_COILSCAR, me);
- break;
+ m_uiHealingTimer = 0;
}
- }
- void JustSummoned(Creature* pSummoned)
- {
- if (pSummoned->GetEntry() == NPC_COILSKAR_ASSASSIN)
- pSummoned->AI()->AttackStart(me);
- }
+ void WaypointReached(uint32 uiPointId)
+ {
+ Player* pPlayer = GetPlayerForEscort();
- //this is very unclear, random say without no real relevance to script/event
- void DoRandomSay()
- {
- DoScriptText(RAND(SAY_WIL_PROGRESS2,SAY_WIL_PROGRESS4,SAY_WIL_PROGRESS5), me);
- }
+ if (!pPlayer)
+ return;
- void DoSpawnAssassin()
- {
- //unknown where they actually appear
- DoSummon(NPC_COILSKAR_ASSASSIN, me, 15.0f, 5000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
- }
+ switch(uiPointId)
+ {
+ case 13:
+ DoScriptText(SAY_WIL_PROGRESS1, me, pPlayer);
+ DoSpawnAssassin();
+ break;
+ case 14:
+ DoSpawnAssassin();
+ break;
+ case 15:
+ DoScriptText(SAY_WIL_FIND_EXIT, me, pPlayer);
+ break;
+ case 19:
+ DoRandomSay();
+ break;
+ case 20:
+ DoSpawnAssassin();
+ break;
+ case 26:
+ DoRandomSay();
+ break;
+ case 27:
+ DoSpawnAssassin();
+ break;
+ case 33:
+ DoRandomSay();
+ break;
+ case 34:
+ DoSpawnAssassin();
+ break;
+ case 37:
+ DoRandomSay();
+ break;
+ case 38:
+ DoSpawnAssassin();
+ break;
+ case 39:
+ DoScriptText(SAY_WIL_JUST_AHEAD, me, pPlayer);
+ break;
+ case 43:
+ DoRandomSay();
+ break;
+ case 44:
+ DoSpawnAssassin();
+ break;
+ case 50:
+ DoScriptText(SAY_WIL_END, me, pPlayer);
+
+ if (Player* pPlayer = GetPlayerForEscort())
+ pPlayer->GroupEventHappens(QUEST_ESCAPE_COILSCAR, me);
+ break;
+ }
+ }
- void EnterCombat(Unit* pWho)
- {
- //don't always use
- if (rand()%5)
- return;
+ void JustSummoned(Creature* pSummoned)
+ {
+ if (pSummoned->GetEntry() == NPC_COILSKAR_ASSASSIN)
+ pSummoned->AI()->AttackStart(me);
+ }
- //only aggro text if not player
- if (pWho->GetTypeId() != TYPEID_PLAYER)
+ //this is very unclear, random say without no real relevance to script/event
+ void DoRandomSay()
{
- //appears to be random
- if (urand(0,1))
- DoScriptText(RAND(SAY_WIL_AGGRO1, SAY_WIL_AGGRO2), pWho);
+ DoScriptText(RAND(SAY_WIL_PROGRESS2,SAY_WIL_PROGRESS4,SAY_WIL_PROGRESS5), me);
}
- }
- void UpdateAI(const uint32 uiDiff)
- {
- npc_escortAI::UpdateAI(uiDiff);
+ void DoSpawnAssassin()
+ {
+ //unknown where they actually appear
+ DoSummon(NPC_COILSKAR_ASSASSIN, me, 15.0f, 5000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
+ }
- if (!UpdateVictim())
- return;
+ void EnterCombat(Unit* pWho)
+ {
+ //don't always use
+ if (rand()%5)
+ return;
- //TODO: add more abilities
- if (me->GetHealth()*100 / me->GetMaxHealth() <= 30)
+ //only aggro text if not player
+ if (pWho->GetTypeId() != TYPEID_PLAYER)
+ {
+ //appears to be random
+ if (urand(0,1))
+ DoScriptText(RAND(SAY_WIL_AGGRO1, SAY_WIL_AGGRO2), pWho);
+ }
+ }
+
+ void UpdateAI(const uint32 uiDiff)
{
- if (m_uiHealingTimer <= uiDiff)
+ npc_escortAI::UpdateAI(uiDiff);
+
+ if (!UpdateVictim())
+ return;
+
+ //TODO: add more abilities
+ if (me->GetHealth()*100 / me->GetMaxHealth() <= 30)
{
- DoCast(me, SPELL_HEALING_WAVE);
- m_uiHealingTimer = 15000;
+ if (m_uiHealingTimer <= uiDiff)
+ {
+ DoCast(me, SPELL_HEALING_WAVE);
+ m_uiHealingTimer = 15000;
+ }
+ else
+ m_uiHealingTimer -= uiDiff;
}
- else
- m_uiHealingTimer -= uiDiff;
}
- }
-};
+ };
-CreatureAI* GetAI_npc_earthmender_wilda(Creature* pCreature)
-{
- return new npc_earthmender_wildaAI(pCreature);
-}
+};
-bool QuestAccept_npc_earthmender_wilda(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
-{
- if (pQuest->GetQuestId() == QUEST_ESCAPE_COILSCAR)
- {
- DoScriptText(SAY_WIL_START, pCreature, pPlayer);
- pCreature->setFaction(FACTION_EARTHEN);
- if (npc_earthmender_wildaAI* pEscortAI = CAST_AI(npc_earthmender_wildaAI, pCreature->AI()))
- pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest);
- }
- return true;
-}
/*#####
# Quest: Battle of the crimson watch
@@ -1123,500 +1201,527 @@ static SpawnSpells SpawnCast[]=
};
/*######
-# mob_illidari_spawn
-######*/
-
-struct mob_illidari_spawnAI : public ScriptedAI
+# mob_torloth_the_magnificent
+#####*/
+ class mob_torloth_the_magnificent : public CreatureScript
{
- mob_illidari_spawnAI(Creature* c) : ScriptedAI(c) {}
-
- uint64 LordIllidanGUID;
- uint32 SpellTimer1, SpellTimer2, SpellTimer3;
- bool Timers;
+public:
+ mob_torloth_the_magnificent() : CreatureScript("mob_torloth_the_magnificent") { }
- void Reset()
+ CreatureAI* GetAI(Creature* c)
{
- LordIllidanGUID = 0;
- Timers = false;
+ return new mob_torloth_the_magnificentAI(c);
}
- void EnterCombat(Unit* /*who*/) {}
- void JustDied(Unit* slayer);
-
- void UpdateAI(const uint32 diff)
+ struct mob_torloth_the_magnificentAI : public ScriptedAI
{
- if (!UpdateVictim())
- return;
+ mob_torloth_the_magnificentAI(Creature* c) : ScriptedAI(c) {}
- if (!Timers)
- {
- if (me->GetEntry() == 22075)//Illidari Soldier
- {
- SpellTimer1 = SpawnCast[0].Timer1 + (rand()%4 * 1000);
- }
- if (me->GetEntry() == 22074)//Illidari Mind Breaker
- {
- SpellTimer1 = SpawnCast[1].Timer1 + (rand()%10 * 1000);
- SpellTimer2 = SpawnCast[2].Timer1 + (rand()%4 * 1000);
- SpellTimer3 = SpawnCast[3].Timer1 + (rand()%4 * 1000);
- }
- if (me->GetEntry() == 19797)// Illidari Highlord
- {
- SpellTimer1 = SpawnCast[4].Timer1 + (rand()%4 * 1000);
- SpellTimer2 = SpawnCast[5].Timer1 + (rand()%4 * 1000);
- }
- Timers = true;
- }
- //Illidari Soldier
- if (me->GetEntry() == 22075)
- {
- if (SpellTimer1 <= diff)
- {
- DoCast(me->getVictim(), SpawnCast[0].SpellId);//Spellbreaker
- SpellTimer1 = SpawnCast[0].Timer2 + (rand()%5 * 1000);
- } else SpellTimer1 -= diff;
- }
- //Illidari Mind Breaker
- if (me->GetEntry() == 22074)
- {
- if (SpellTimer1 <= diff)
- {
- if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
- {
- if (pTarget->GetTypeId() == TYPEID_PLAYER)
- {
- DoCast(pTarget, SpawnCast[1].SpellId); //Focused Bursts
- SpellTimer1 = SpawnCast[1].Timer2 + (rand()%5 * 1000);
- } else SpellTimer1 = 2000;
- }
- } else SpellTimer1 -= diff;
-
- if (SpellTimer2 <= diff)
- {
- DoCast(me->getVictim(), SpawnCast[2].SpellId);//Psychic Scream
- SpellTimer2 = SpawnCast[2].Timer2 + (rand()%13 * 1000);
- } else SpellTimer2 -= diff;
-
- if (SpellTimer3 <= diff)
- {
- DoCast(me->getVictim(), SpawnCast[3].SpellId);//Mind Blast
- SpellTimer3 = SpawnCast[3].Timer2 + (rand()%8 * 1000);
- } else SpellTimer3 -= diff;
- }
- //Illidari Highlord
- if (me->GetEntry() == 19797)
- {
- if (SpellTimer1 <= diff)
- {
- DoCast(me->getVictim(), SpawnCast[4].SpellId);//Curse Of Flames
- SpellTimer1 = SpawnCast[4].Timer2 + (rand()%10 * 1000);
- } else SpellTimer1 -= diff;
-
- if (SpellTimer2 <= diff)
- {
- DoCast(me->getVictim(), SpawnCast[5].SpellId);//Flamestrike
- SpellTimer2 = SpawnCast[5].Timer2 + (rand()%7 * 13000);
- } else SpellTimer2 -= diff;
- }
+ uint32 AnimationTimer, SpellTimer1, SpellTimer2, SpellTimer3;
- DoMeleeAttackIfReady();
- }
-};
+ uint8 AnimationCount;
-/*######
-# mob_torloth_the_magnificent
-#####*/
+ uint64 LordIllidanGUID;
+ uint64 AggroTargetGUID;
-struct mob_torloth_the_magnificentAI : public ScriptedAI
-{
- mob_torloth_the_magnificentAI(Creature* c) : ScriptedAI(c) {}
+ bool Timers;
- uint32 AnimationTimer, SpellTimer1, SpellTimer2, SpellTimer3;
+ void Reset()
+ {
+ AnimationTimer = 4000;
+ AnimationCount = 0;
+ LordIllidanGUID = 0;
+ AggroTargetGUID = 0;
+ Timers = false;
+
+ me->addUnitState(UNIT_STAT_ROOT);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
+ }
- uint8 AnimationCount;
+ void EnterCombat(Unit* /*who*/){}
- uint64 LordIllidanGUID;
- uint64 AggroTargetGUID;
+ void HandleAnimation()
+ {
+ Creature* pCreature = me;
- bool Timers;
+ if (TorlothAnim[AnimationCount].pCreature == 1)
+ {
+ pCreature = (Unit::GetCreature(*me, LordIllidanGUID));
- void Reset()
- {
- AnimationTimer = 4000;
- AnimationCount = 0;
- LordIllidanGUID = 0;
- AggroTargetGUID = 0;
- Timers = false;
-
- me->addUnitState(UNIT_STAT_ROOT);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
- }
+ if (!pCreature)
+ return;
+ }
- void EnterCombat(Unit* /*who*/){}
+ if (TorlothAnim[AnimationCount].TextId)
+ DoScriptText(TorlothAnim[AnimationCount].TextId, pCreature);
- void HandleAnimation()
- {
- Creature* pCreature = me;
+ AnimationTimer = TorlothAnim[AnimationCount].Timer;
- if (TorlothAnim[AnimationCount].pCreature == 1)
- {
- pCreature = (Unit::GetCreature(*me, LordIllidanGUID));
+ switch(AnimationCount)
+ {
+ case 0:
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1,8);
+ break;
+ case 3:
+ me->RemoveFlag(UNIT_FIELD_BYTES_1,8);
+ break;
+ case 5:
+ if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID)))
+ {
+ me->SetUInt64Value(UNIT_FIELD_TARGET, AggroTarget->GetGUID());
+ me->AddThreat(AggroTarget, 1);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
+ }
+ break;
+ case 6:
+ if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID)))
+ {
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->clearUnitState(UNIT_STAT_ROOT);
- if (!pCreature)
- return;
+ float x, y, z;
+ AggroTarget->GetPosition(x,y,z);
+ me->GetMotionMaster()->MovePoint(0,x,y,z);
+ }
+ break;
+ }
+ ++AnimationCount;
}
- if (TorlothAnim[AnimationCount].TextId)
- DoScriptText(TorlothAnim[AnimationCount].TextId, pCreature);
-
- AnimationTimer = TorlothAnim[AnimationCount].Timer;
-
- switch(AnimationCount)
+ void UpdateAI(const uint32 diff)
{
- case 0:
- me->SetUInt32Value(UNIT_FIELD_BYTES_1,8);
- break;
- case 3:
- me->RemoveFlag(UNIT_FIELD_BYTES_1,8);
- break;
- case 5:
- if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID)))
+ if (AnimationTimer)
{
- me->SetUInt64Value(UNIT_FIELD_TARGET, AggroTarget->GetGUID());
- me->AddThreat(AggroTarget, 1);
- me->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
+ if (AnimationTimer <= diff)
+ {
+ HandleAnimation();
+ } else AnimationTimer -= diff;
}
- break;
- case 6:
- if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID)))
+
+ if (AnimationCount < 6)
+ {
+ me->CombatStop();
+ } else if (!Timers)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->clearUnitState(UNIT_STAT_ROOT);
- float x, y, z;
- AggroTarget->GetPosition(x,y,z);
- me->GetMotionMaster()->MovePoint(0,x,y,z);
+ SpellTimer1 = SpawnCast[6].Timer1;
+ SpellTimer2 = SpawnCast[7].Timer1;
+ SpellTimer3 = SpawnCast[8].Timer1;
+ Timers = true;
}
- break;
- }
- ++AnimationCount;
- }
- void UpdateAI(const uint32 diff)
- {
- if (AnimationTimer)
- {
- if (AnimationTimer <= diff)
+ if (Timers)
{
- HandleAnimation();
- } else AnimationTimer -= diff;
- }
+ if (SpellTimer1 <= diff)
+ {
+ DoCast(me->getVictim(), SpawnCast[6].SpellId);//Cleave
+ SpellTimer1 = SpawnCast[6].Timer2 + (rand()%10 * 1000);
+ } else SpellTimer1 -= diff;
- if (AnimationCount < 6)
- {
- me->CombatStop();
- } else if (!Timers)
- {
+ if (SpellTimer2 <= diff)
+ {
+ DoCast(me->getVictim(), SpawnCast[7].SpellId);//Shadowfury
+ SpellTimer2 = SpawnCast[7].Timer2 + (rand()%5 * 1000);
+ } else SpellTimer2 -= diff;
+
+ if (SpellTimer3 <= diff)
+ {
+ DoCast(me, SpawnCast[8].SpellId);
+ SpellTimer3 = SpawnCast[8].Timer2 + (rand()%7 * 1000);//Spell Reflection
+ } else SpellTimer3 -= diff;
+ }
- SpellTimer1 = SpawnCast[6].Timer1;
- SpellTimer2 = SpawnCast[7].Timer1;
- SpellTimer3 = SpawnCast[8].Timer1;
- Timers = true;
+ DoMeleeAttackIfReady();
}
- if (Timers)
+ void JustDied(Unit* slayer)
{
- if (SpellTimer1 <= diff)
- {
- DoCast(me->getVictim(), SpawnCast[6].SpellId);//Cleave
- SpellTimer1 = SpawnCast[6].Timer2 + (rand()%10 * 1000);
- } else SpellTimer1 -= diff;
-
- if (SpellTimer2 <= diff)
+ if (slayer)
+ switch(slayer->GetTypeId())
{
- DoCast(me->getVictim(), SpawnCast[7].SpellId);//Shadowfury
- SpellTimer2 = SpawnCast[7].Timer2 + (rand()%5 * 1000);
- } else SpellTimer2 -= diff;
+ case TYPEID_UNIT:
+ if (Unit *owner = slayer->GetOwner())
+ if (owner->GetTypeId() == TYPEID_PLAYER)
+ CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me);
+ break;
+
+ case TYPEID_PLAYER:
+ CAST_PLR(slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me);
+ break;
+ }
- if (SpellTimer3 <= diff)
+ if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID)))
{
- DoCast(me, SpawnCast[8].SpellId);
- SpellTimer3 = SpawnCast[8].Timer2 + (rand()%7 * 1000);//Spell Reflection
- } else SpellTimer3 -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-
- void JustDied(Unit* slayer)
- {
- if (slayer)
- switch(slayer->GetTypeId())
- {
- case TYPEID_UNIT:
- if (Unit *owner = slayer->GetOwner())
- if (owner->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me);
- break;
-
- case TYPEID_PLAYER:
- CAST_PLR(slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me);
- break;
+ DoScriptText(END_TEXT, LordIllidan, slayer);
+ LordIllidan->AI()->EnterEvadeMode();
+ }
}
+ };
- if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID)))
- {
- DoScriptText(END_TEXT, LordIllidan, slayer);
- LordIllidan->AI()->EnterEvadeMode();
- }
- }
};
/*#####
# npc_lord_illidan_stormrage
#####*/
-
-struct npc_lord_illidan_stormrageAI : public ScriptedAI
+ class npc_lord_illidan_stormrage : public CreatureScript
{
- npc_lord_illidan_stormrageAI(Creature* c) : ScriptedAI(c) {}
+public:
+ npc_lord_illidan_stormrage() : CreatureScript("npc_lord_illidan_stormrage") { }
- uint64 PlayerGUID;
+ CreatureAI* GetAI(Creature* c)
+ {
+ return new npc_lord_illidan_stormrageAI(c);
+ }
- uint32 WaveTimer;
- uint32 AnnounceTimer;
+ struct npc_lord_illidan_stormrageAI : public ScriptedAI
+ {
+ npc_lord_illidan_stormrageAI(Creature* c) : ScriptedAI(c) {}
- int8 LiveCount;
- uint8 WaveCount;
+ uint64 PlayerGUID;
- bool EventStarted;
- bool Announced;
- bool Failed;
+ uint32 WaveTimer;
+ uint32 AnnounceTimer;
- void Reset()
- {
- PlayerGUID = 0;
+ int8 LiveCount;
+ uint8 WaveCount;
- WaveTimer = 10000;
- AnnounceTimer = 7000;
- LiveCount = 0;
- WaveCount = 0;
+ bool EventStarted;
+ bool Announced;
+ bool Failed;
- EventStarted = false;
- Announced = false;
- Failed = false;
+ void Reset()
+ {
+ PlayerGUID = 0;
- me->SetVisibility(VISIBILITY_OFF);
- }
+ WaveTimer = 10000;
+ AnnounceTimer = 7000;
+ LiveCount = 0;
+ WaveCount = 0;
- void EnterCombat(Unit* /*who*/) {}
- void MoveInLineOfSight(Unit* /*who*/) {}
- void AttackStart(Unit* /*who*/) {}
+ EventStarted = false;
+ Announced = false;
+ Failed = false;
- void SummonNextWave()
- {
- uint8 count = WavesInfo[WaveCount].SpawnCount;
- uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint;
- srand(time(NULL));//initializing random seed
- uint8 FelguardCount = 0;
- uint8 DreadlordCount = 0;
+ me->SetVisibility(VISIBILITY_OFF);
+ }
+
+ void EnterCombat(Unit* /*who*/) {}
+ void MoveInLineOfSight(Unit* /*who*/) {}
+ void AttackStart(Unit* /*who*/) {}
- for (uint8 i = 0; i < count; ++i)
+ void SummonNextWave();
+
+ void CheckEventFail()
{
- Creature* Spawn = NULL;
- float X = SpawnLocation[locIndex + i].x;
- float Y = SpawnLocation[locIndex + i].y;
- float Z = SpawnLocation[locIndex + i].z;
- float O = SpawnLocation[locIndex + i].o;
- Spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
- ++LiveCount;
-
- if (Spawn)
+ Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
+
+ if (!pPlayer)
+ return;
+
+ if (Group *EventGroup = pPlayer->GetGroup())
{
- Spawn->LoadCreaturesAddon();
+ Player* GroupMember;
- if (WaveCount == 0)//1 Wave
+ uint8 GroupMemberCount = 0;
+ uint8 DeadMemberCount = 0;
+ uint8 FailedMemberCount = 0;
+
+ const Group::MemberSlotList members = EventGroup->GetMemberSlots();
+
+ for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr)
{
- if (rand()%3 == 1 && FelguardCount<2)
- {
- Spawn->SetDisplayId(18654);
- ++FelguardCount;
- }
- else if (DreadlordCount < 3)
+ GroupMember = (Unit::GetPlayer(*me, itr->guid));
+ if (!GroupMember)
+ continue;
+ if (!GroupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE)
{
- Spawn->SetDisplayId(19991);
- ++DreadlordCount;
+ GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH);
+ GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE);
+ ++FailedMemberCount;
}
- else if (FelguardCount<2)
+ ++GroupMemberCount;
+
+ if (GroupMember->isDead())
{
- Spawn->SetDisplayId(18654);
- ++FelguardCount;
+ ++DeadMemberCount;
}
}
- if (WaveCount < 3)//1-3 Wave
+ if (GroupMemberCount == FailedMemberCount)
{
- if (PlayerGUID)
+ Failed = true;
+ }
+
+ if (GroupMemberCount == DeadMemberCount)
+ {
+ for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr)
{
- if (Player* pTarget = Unit::GetPlayer(*me, PlayerGUID))
+ GroupMember = Unit::GetPlayer(*me, itr->guid);
+
+ if (GroupMember && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE)
{
- float x, y, z;
- pTarget->GetPosition(x,y,z);
- Spawn->GetMotionMaster()->MovePoint(0,x, y, z);
+ GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH);
+ GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE);
}
}
- CAST_AI(mob_illidari_spawnAI, Spawn->AI())->LordIllidanGUID = me->GetGUID();
+ Failed = true;
}
+ } else if (pPlayer->isDead() || !pPlayer->IsWithinDistInMap(me, EVENT_AREA_RADIUS))
+ {
+ pPlayer->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH);
+ Failed = true;
+ }
+ }
- if (WavesInfo[WaveCount].CreatureId == 22076) // Torloth
+ void LiveCounter()
+ {
+ --LiveCount;
+ if (!LiveCount)
+ Announced = false;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!PlayerGUID || !EventStarted)
+ return;
+
+ if (!LiveCount && WaveCount < 4)
+ {
+ if (!Announced && AnnounceTimer <= diff)
{
- CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->LordIllidanGUID = me->GetGUID();
- if (PlayerGUID)
- CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->AggroTargetGUID = PlayerGUID;
- }
+ DoScriptText(WavesInfo[WaveCount].WaveTextId, me);
+ Announced = true;
+ } else AnnounceTimer -= diff;
+
+ if (WaveTimer <= diff)
+ {
+ SummonNextWave();
+ } else WaveTimer -= diff;
}
+ CheckEventFail();
+
+ if (Failed)
+ EnterEvadeMode();
}
- ++WaveCount;
- WaveTimer = WavesInfo[WaveCount].SpawnTimer;
- AnnounceTimer = WavesInfo[WaveCount].YellTimer;
+ };
+
+};
+
+/*######
+# mob_illidari_spawn
+######*/
+ class mob_illidari_spawn : public CreatureScript
+{
+public:
+ mob_illidari_spawn() : CreatureScript("mob_illidari_spawn") { }
+
+ CreatureAI* GetAI(Creature* c)
+ {
+ return new mob_illidari_spawnAI(c);
}
- void CheckEventFail()
+ struct mob_illidari_spawnAI : public ScriptedAI
{
- Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
+ mob_illidari_spawnAI(Creature* c) : ScriptedAI(c) {}
- if (!pPlayer)
- return;
+ uint64 LordIllidanGUID;
+ uint32 SpellTimer1, SpellTimer2, SpellTimer3;
+ bool Timers;
- if (Group *EventGroup = pPlayer->GetGroup())
+ void Reset()
{
- Player* GroupMember;
+ LordIllidanGUID = 0;
+ Timers = false;
+ }
- uint8 GroupMemberCount = 0;
- uint8 DeadMemberCount = 0;
- uint8 FailedMemberCount = 0;
+ void EnterCombat(Unit* /*who*/) {}
+ void JustDied(Unit * /*slayer*/)
+ {
+ me->RemoveCorpse();
+ if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID)))
+ if (LordIllidan)
+ CAST_AI(npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI, LordIllidan->AI())->LiveCounter();
+ }
- const Group::MemberSlotList members = EventGroup->GetMemberSlots();
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
- for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr)
+ if (!Timers)
{
- GroupMember = (Unit::GetPlayer(*me, itr->guid));
- if (!GroupMember)
- continue;
- if (!GroupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE)
+ if (me->GetEntry() == 22075)//Illidari Soldier
{
- GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH);
- GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE);
- ++FailedMemberCount;
+ SpellTimer1 = SpawnCast[0].Timer1 + (rand()%4 * 1000);
}
- ++GroupMemberCount;
-
- if (GroupMember->isDead())
+ if (me->GetEntry() == 22074)//Illidari Mind Breaker
+ {
+ SpellTimer1 = SpawnCast[1].Timer1 + (rand()%10 * 1000);
+ SpellTimer2 = SpawnCast[2].Timer1 + (rand()%4 * 1000);
+ SpellTimer3 = SpawnCast[3].Timer1 + (rand()%4 * 1000);
+ }
+ if (me->GetEntry() == 19797)// Illidari Highlord
{
- ++DeadMemberCount;
+ SpellTimer1 = SpawnCast[4].Timer1 + (rand()%4 * 1000);
+ SpellTimer2 = SpawnCast[5].Timer1 + (rand()%4 * 1000);
}
+ Timers = true;
}
-
- if (GroupMemberCount == FailedMemberCount)
+ //Illidari Soldier
+ if (me->GetEntry() == 22075)
{
- Failed = true;
+ if (SpellTimer1 <= diff)
+ {
+ DoCast(me->getVictim(), SpawnCast[0].SpellId);//Spellbreaker
+ SpellTimer1 = SpawnCast[0].Timer2 + (rand()%5 * 1000);
+ } else SpellTimer1 -= diff;
}
-
- if (GroupMemberCount == DeadMemberCount)
+ //Illidari Mind Breaker
+ if (me->GetEntry() == 22074)
{
- for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr)
+ if (SpellTimer1 <= diff)
{
- GroupMember = Unit::GetPlayer(*me, itr->guid);
-
- if (GroupMember && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE)
+ if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
- GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH);
- GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE);
+ if (pTarget->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoCast(pTarget, SpawnCast[1].SpellId); //Focused Bursts
+ SpellTimer1 = SpawnCast[1].Timer2 + (rand()%5 * 1000);
+ } else SpellTimer1 = 2000;
}
- }
- Failed = true;
+ } else SpellTimer1 -= diff;
+
+ if (SpellTimer2 <= diff)
+ {
+ DoCast(me->getVictim(), SpawnCast[2].SpellId);//Psychic Scream
+ SpellTimer2 = SpawnCast[2].Timer2 + (rand()%13 * 1000);
+ } else SpellTimer2 -= diff;
+
+ if (SpellTimer3 <= diff)
+ {
+ DoCast(me->getVictim(), SpawnCast[3].SpellId);//Mind Blast
+ SpellTimer3 = SpawnCast[3].Timer2 + (rand()%8 * 1000);
+ } else SpellTimer3 -= diff;
}
- } else if (pPlayer->isDead() || !pPlayer->IsWithinDistInMap(me, EVENT_AREA_RADIUS))
- {
- pPlayer->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH);
- Failed = true;
+ //Illidari Highlord
+ if (me->GetEntry() == 19797)
+ {
+ if (SpellTimer1 <= diff)
+ {
+ DoCast(me->getVictim(), SpawnCast[4].SpellId);//Curse Of Flames
+ SpellTimer1 = SpawnCast[4].Timer2 + (rand()%10 * 1000);
+ } else SpellTimer1 -= diff;
+
+ if (SpellTimer2 <= diff)
+ {
+ DoCast(me->getVictim(), SpawnCast[5].SpellId);//Flamestrike
+ SpellTimer2 = SpawnCast[5].Timer2 + (rand()%7 * 13000);
+ } else SpellTimer2 -= diff;
+ }
+
+ DoMeleeAttackIfReady();
}
- }
+ };
- void LiveCounter()
- {
- --LiveCount;
- if (!LiveCount)
- Announced = false;
- }
+};
- void UpdateAI(const uint32 diff)
- {
- if (!PlayerGUID || !EventStarted)
- return;
+void npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI::SummonNextWave()
+{
+ uint8 count = WavesInfo[WaveCount].SpawnCount;
+ uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint;
+ srand(time(NULL));//initializing random seed
+ uint8 FelguardCount = 0;
+ uint8 DreadlordCount = 0;
- if (!LiveCount && WaveCount < 4)
+ for (uint8 i = 0; i < count; ++i)
+ {
+ Creature* Spawn = NULL;
+ float X = SpawnLocation[locIndex + i].x;
+ float Y = SpawnLocation[locIndex + i].y;
+ float Z = SpawnLocation[locIndex + i].z;
+ float O = SpawnLocation[locIndex + i].o;
+ Spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
+ ++LiveCount;
+
+ if (Spawn)
{
- if (!Announced && AnnounceTimer <= diff)
+ Spawn->LoadCreaturesAddon();
+
+ if (WaveCount == 0)//1 Wave
{
- DoScriptText(WavesInfo[WaveCount].WaveTextId, me);
- Announced = true;
- } else AnnounceTimer -= diff;
+ if (rand()%3 == 1 && FelguardCount<2)
+ {
+ Spawn->SetDisplayId(18654);
+ ++FelguardCount;
+ }
+ else if (DreadlordCount < 3)
+ {
+ Spawn->SetDisplayId(19991);
+ ++DreadlordCount;
+ }
+ else if (FelguardCount<2)
+ {
+ Spawn->SetDisplayId(18654);
+ ++FelguardCount;
+ }
+ }
- if (WaveTimer <= diff)
+ if (WaveCount < 3)//1-3 Wave
{
- SummonNextWave();
- } else WaveTimer -= diff;
- }
- CheckEventFail();
+ if (PlayerGUID)
+ {
+ if (Player* pTarget = Unit::GetPlayer(*me, PlayerGUID))
+ {
+ float x, y, z;
+ pTarget->GetPosition(x,y,z);
+ Spawn->GetMotionMaster()->MovePoint(0,x, y, z);
+ }
+ }
+ CAST_AI(mob_illidari_spawn::mob_illidari_spawnAI, Spawn->AI())->LordIllidanGUID = me->GetGUID();
+ }
- if (Failed)
- EnterEvadeMode();
+ if (WavesInfo[WaveCount].CreatureId == 22076) // Torloth
+ {
+ CAST_AI(mob_torloth_the_magnificent::mob_torloth_the_magnificentAI, Spawn->AI())->LordIllidanGUID = me->GetGUID();
+ if (PlayerGUID)
+ CAST_AI(mob_torloth_the_magnificent::mob_torloth_the_magnificentAI, Spawn->AI())->AggroTargetGUID = PlayerGUID;
+ }
+ }
}
-};
-
-void mob_illidari_spawnAI::JustDied(Unit * /*slayer*/)
-{
- me->RemoveCorpse();
- if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID)))
- if (LordIllidan)
- CAST_AI(npc_lord_illidan_stormrageAI, LordIllidan->AI())->LiveCounter();
+ ++WaveCount;
+ WaveTimer = WavesInfo[WaveCount].SpawnTimer;
+ AnnounceTimer = WavesInfo[WaveCount].YellTimer;
}
/*#####
# go_crystal_prison
######*/
-
-bool GOQuestAccept_GO_crystal_prison(Player* plr, GameObject* /*go*/, Quest const* quest)
+ class go_crystal_prison : public GameObjectScript
{
- if (quest->GetQuestId() == QUEST_BATTLE_OF_THE_CRIMSON_WATCH)
- {
- Creature* Illidan = plr->FindNearestCreature(22083, 50);
+public:
+ go_crystal_prison() : GameObjectScript("go_crystal_prison") { }
- if (Illidan && !CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted)
+ bool OnQuestAccept(Player* plr, GameObject* /*go*/, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_BATTLE_OF_THE_CRIMSON_WATCH)
{
- CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->PlayerGUID = plr->GetGUID();
- CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->LiveCount = 0;
- CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted=true;
+ Creature* Illidan = plr->FindNearestCreature(22083, 50);
+
+ if (Illidan && !CAST_AI(npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted)
+ {
+ CAST_AI(npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI, Illidan->AI())->PlayerGUID = plr->GetGUID();
+ CAST_AI(npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI, Illidan->AI())->LiveCount = 0;
+ CAST_AI(npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted=true;
+ }
}
+ return true;
}
- return true;
-}
-CreatureAI* GetAI_npc_lord_illidan_stormrage(Creature* c)
-{
- return new npc_lord_illidan_stormrageAI(c);
-}
+};
+
-CreatureAI* GetAI_mob_illidari_spawn(Creature* c)
-{
- return new mob_illidari_spawnAI(c);
-}
-CreatureAI* GetAI_mob_torloth_the_magnificent(Creature* c)
-{
- return new mob_torloth_the_magnificentAI(c);
-}
/*####
# npc_enraged_spirits
@@ -1661,76 +1766,82 @@ CreatureAI* GetAI_mob_torloth_the_magnificent(Creature* c)
/* Factions */
#define ENRAGED_SOUL_FRIENDLY 35
#define ENRAGED_SOUL_HOSTILE 14
-
-struct npc_enraged_spiritAI : public ScriptedAI
+ class npc_enraged_spirit : public CreatureScript
{
- npc_enraged_spiritAI(Creature *c) : ScriptedAI(c) {}
+public:
+ npc_enraged_spirit() : CreatureScript("npc_enraged_spirit") { }
- void Reset() { }
-
- void EnterCombat(Unit * /*who*/){}
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_enraged_spiritAI(pCreature);
+ }
- void JustDied(Unit* /*killer*/)
+ struct npc_enraged_spiritAI : public ScriptedAI
{
- // always spawn spirit on death
- // if totem around
- // move spirit to totem and cast kill count
- uint32 entry = 0;
- uint32 credit = 0;
-
- switch(me->GetEntry()) {
- case ENTRY_ENRAGED_FIRE_SPIRIT:
- entry = ENTRY_FIERY_SOUL;
- //credit = SPELL_FIERY_SOUL_CAPTURED_CREDIT;
- credit = CREDIT_FIRE;
- break;
- case ENTRY_ENRAGED_EARTH_SPIRIT:
- entry = ENTRY_EARTHEN_SOUL;
- //credit = SPELL_EARTHEN_SOUL_CAPTURED_CREDIT;
- credit = CREDIT_EARTH;
- break;
- case ENTRY_ENRAGED_AIR_SPIRIT:
- entry = ENTRY_ENRAGED_AIRY_SOUL;
- //credit = SPELL_AIRY_SOUL_CAPTURED_CREDIT;
- credit = CREDIT_AIR;
- break;
- case ENTRY_ENRAGED_WATER_SPIRIT:
- entry = ENTRY_ENRAGED_WATERY_SOUL;
- //credit = SPELL_WATERY_SOUL_CAPTURED_CREDIT;
- credit = CREDIT_WATER;
- break;
- }
+ npc_enraged_spiritAI(Creature *c) : ScriptedAI(c) {}
- // Spawn Soul on Kill ALWAYS!
- Creature* Summoned = NULL;
- Unit* totemOspirits = NULL;
+ void Reset() { }
- if (entry != 0)
- Summoned = DoSpawnCreature(entry, 0, 0, 1, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
+ void EnterCombat(Unit * /*who*/){}
- // FIND TOTEM, PROCESS QUEST
- if (Summoned)
+ void JustDied(Unit* /*killer*/)
{
- totemOspirits = me->FindNearestCreature(ENTRY_TOTEM_OF_SPIRITS, RADIUS_TOTEM_OF_SPIRITS);
- if (totemOspirits)
- {
- Summoned->setFaction(ENRAGED_SOUL_FRIENDLY);
- Summoned->GetMotionMaster()->MovePoint(0,totemOspirits->GetPositionX(), totemOspirits->GetPositionY(), Summoned->GetPositionZ());
-
- Unit* Owner = totemOspirits->GetOwner();
- if (Owner && Owner->GetTypeId() == TYPEID_PLAYER)
- // DoCast(Owner, credit); -- not working!
- CAST_PLR(Owner)->KilledMonsterCredit(credit, Summoned->GetGUID());
- DoCast(totemOspirits, SPELL_SOUL_CAPTURED);
- }
+ // always spawn spirit on death
+ // if totem around
+ // move spirit to totem and cast kill count
+ uint32 entry = 0;
+ uint32 credit = 0;
+
+ switch(me->GetEntry()) {
+ case ENTRY_ENRAGED_FIRE_SPIRIT:
+ entry = ENTRY_FIERY_SOUL;
+ //credit = SPELL_FIERY_SOUL_CAPTURED_CREDIT;
+ credit = CREDIT_FIRE;
+ break;
+ case ENTRY_ENRAGED_EARTH_SPIRIT:
+ entry = ENTRY_EARTHEN_SOUL;
+ //credit = SPELL_EARTHEN_SOUL_CAPTURED_CREDIT;
+ credit = CREDIT_EARTH;
+ break;
+ case ENTRY_ENRAGED_AIR_SPIRIT:
+ entry = ENTRY_ENRAGED_AIRY_SOUL;
+ //credit = SPELL_AIRY_SOUL_CAPTURED_CREDIT;
+ credit = CREDIT_AIR;
+ break;
+ case ENTRY_ENRAGED_WATER_SPIRIT:
+ entry = ENTRY_ENRAGED_WATERY_SOUL;
+ //credit = SPELL_WATERY_SOUL_CAPTURED_CREDIT;
+ credit = CREDIT_WATER;
+ break;
+ }
+
+ // Spawn Soul on Kill ALWAYS!
+ Creature* Summoned = NULL;
+ Unit* totemOspirits = NULL;
+
+ if (entry != 0)
+ Summoned = DoSpawnCreature(entry, 0, 0, 1, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
+
+ // FIND TOTEM, PROCESS QUEST
+ if (Summoned)
+ {
+ totemOspirits = me->FindNearestCreature(ENTRY_TOTEM_OF_SPIRITS, RADIUS_TOTEM_OF_SPIRITS);
+ if (totemOspirits)
+ {
+ Summoned->setFaction(ENRAGED_SOUL_FRIENDLY);
+ Summoned->GetMotionMaster()->MovePoint(0,totemOspirits->GetPositionX(), totemOspirits->GetPositionY(), Summoned->GetPositionZ());
+
+ Unit* Owner = totemOspirits->GetOwner();
+ if (Owner && Owner->GetTypeId() == TYPEID_PLAYER)
+ // DoCast(Owner, credit); -- not working!
+ CAST_PLR(Owner)->KilledMonsterCredit(credit, Summoned->GetGUID());
+ DoCast(totemOspirits, SPELL_SOUL_CAPTURED);
+ }
+ }
}
- }
-};
+ };
-CreatureAI* GetAI_npc_enraged_spirit(Creature* pCreature)
-{
-return new npc_enraged_spiritAI(pCreature);
-}
+};
/*#####
#
@@ -1738,93 +1849,20 @@ return new npc_enraged_spiritAI(pCreature);
void AddSC_shadowmoon_valley()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "mob_mature_netherwing_drake";
- newscript->GetAI = &GetAI_mob_mature_netherwing_drake;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_enslaved_netherwing_drake";
- newscript->GetAI = &GetAI_mob_enslaved_netherwing_drake;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_dragonmaw_peon";
- newscript->GetAI = &GetAI_mob_dragonmaw_peon;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_drake_dealer_hurlunk";
- newscript->pGossipHello = &GossipHello_npc_drake_dealer_hurlunk;
- newscript->pGossipSelect = &GossipSelect_npc_drake_dealer_hurlunk;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npcs_flanis_swiftwing_and_kagrosh";
- newscript->pGossipHello = &GossipHello_npcs_flanis_swiftwing_and_kagrosh;
- newscript->pGossipSelect = &GossipSelect_npcs_flanis_swiftwing_and_kagrosh;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_murkblood_overseer";
- newscript->pGossipHello = &GossipHello_npc_murkblood_overseer;
- newscript->pGossipSelect = &GossipSelect_npc_murkblood_overseer;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_neltharaku";
- newscript->pGossipHello = &GossipHello_npc_neltharaku;
- newscript->pGossipSelect = &GossipSelect_npc_neltharaku;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_karynaku";
- newscript->pQuestAccept = &QuestAccept_npc_karynaku;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_oronok_tornheart";
- newscript->pGossipHello = &GossipHello_npc_oronok_tornheart;
- newscript->pGossipSelect = &GossipSelect_npc_oronok_tornheart;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_overlord_morghor";
- newscript->GetAI = &GetAI_npc_overlord_morghor;
- newscript->pQuestAccept = &QuestAccept_npc_overlord_morghor;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_earthmender_wilda";
- newscript->GetAI = &GetAI_npc_earthmender_wilda;
- newscript->pQuestAccept = &QuestAccept_npc_earthmender_wilda;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_lord_illidan_stormrage";
- newscript->GetAI = &GetAI_npc_lord_illidan_stormrage;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "go_crystal_prison";
- newscript->pGOQuestAccept = &GOQuestAccept_GO_crystal_prison;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_illidari_spawn";
- newscript->GetAI = &GetAI_mob_illidari_spawn;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_torloth_the_magnificent";
- newscript->GetAI = &GetAI_mob_torloth_the_magnificent;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_enraged_spirit";
- newscript->GetAI = &GetAI_npc_enraged_spirit;
- newscript->RegisterSelf();
+ new mob_mature_netherwing_drake();
+ new mob_enslaved_netherwing_drake();
+ new mob_dragonmaw_peon();
+ new npc_drake_dealer_hurlunk();
+ new npcs_flanis_swiftwing_and_kagrosh();
+ new npc_murkblood_overseer();
+ new npc_neltharaku();
+ new npc_karynaku();
+ new npc_oronok_tornheart();
+ new npc_overlord_morghor();
+ new npc_earthmender_wilda();
+ new npc_lord_illidan_stormrage();
+ new go_crystal_prison();
+ new mob_illidari_spawn();
+ new mob_torloth_the_magnificent();
+ new npc_enraged_spirit();
}
-
diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp
index 419cb387e8b..feb768cb345 100644
--- a/src/server/scripts/Outland/shattrath_city.cpp
+++ b/src/server/scripts/Outland/shattrath_city.cpp
@@ -49,62 +49,71 @@ enum eRaliq
QUEST_CRACK_SKULLS = 10009,
FACTION_HOSTILE_RD = 45
};
-
-struct npc_raliq_the_drunkAI : public ScriptedAI
+ class npc_raliq_the_drunk : public CreatureScript
{
- npc_raliq_the_drunkAI(Creature* c) : ScriptedAI(c)
+public:
+ npc_raliq_the_drunk() : CreatureScript("npc_raliq_the_drunk") { }
+
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- m_uiNormFaction = c->getFaction();
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ pPlayer->CLOSE_GOSSIP_MENU();
+ pCreature->setFaction(FACTION_HOSTILE_RD);
+ pCreature->AI()->AttackStart(pPlayer);
+ }
+ return true;
}
- uint32 m_uiNormFaction;
- uint32 Uppercut_Timer;
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_RALIQ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ pPlayer->SEND_GOSSIP_MENU(9440, pCreature->GetGUID());
+ return true;
+ }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Uppercut_Timer = 5000;
- me->RestoreFaction();
+ return new npc_raliq_the_drunkAI (pCreature);
}
- void UpdateAI(const uint32 diff)
+ struct npc_raliq_the_drunkAI : public ScriptedAI
{
- if (!UpdateVictim())
- return;
+ npc_raliq_the_drunkAI(Creature* c) : ScriptedAI(c)
+ {
+ m_uiNormFaction = c->getFaction();
+ }
- if (Uppercut_Timer <= diff)
+ uint32 m_uiNormFaction;
+ uint32 Uppercut_Timer;
+
+ void Reset()
{
- DoCast(me->getVictim(), SPELL_UPPERCUT);
- Uppercut_Timer = 15000;
- } else Uppercut_Timer -= diff;
+ Uppercut_Timer = 5000;
+ me->RestoreFaction();
+ }
- DoMeleeAttackIfReady();
- }
-};
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
-CreatureAI* GetAI_npc_raliq_the_drunk(Creature* pCreature)
-{
- return new npc_raliq_the_drunkAI (pCreature);
-}
+ if (Uppercut_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_UPPERCUT);
+ Uppercut_Timer = 15000;
+ } else Uppercut_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+};
-bool GossipHello_npc_raliq_the_drunk(Player* pPlayer, Creature* pCreature)
-{
- if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_RALIQ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- pPlayer->SEND_GOSSIP_MENU(9440, pCreature->GetGUID());
- return true;
-}
-bool GossipSelect_npc_raliq_the_drunk(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
- {
- pPlayer->CLOSE_GOSSIP_MENU();
- pCreature->setFaction(FACTION_HOSTILE_RD);
- pCreature->AI()->AttackStart(pPlayer);
- }
- return true;
-}
/*######
# npc_salsalabim
@@ -115,64 +124,72 @@ bool GossipSelect_npc_raliq_the_drunk(Player* pPlayer, Creature* pCreature, uint
#define QUEST_10004 10004
#define SPELL_MAGNETIC_PULL 31705
-
-struct npc_salsalabimAI : public ScriptedAI
+ class npc_salsalabim : public CreatureScript
{
- npc_salsalabimAI(Creature* c) : ScriptedAI(c) {}
-
- uint32 MagneticPull_Timer;
+public:
+ npc_salsalabim() : CreatureScript("npc_salsalabim") { }
- void Reset()
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- MagneticPull_Timer = 15000;
- me->RestoreFaction();
+ if (pPlayer->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE)
+ {
+ pCreature->setFaction(FACTION_HOSTILE_SA);
+ pCreature->AI()->AttackStart(pPlayer);
+ }
+ else
+ {
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ }
+ return true;
}
- void DamageTaken(Unit *done_by, uint32 &damage)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (done_by->GetTypeId() == TYPEID_PLAYER)
- if ((me->GetHealth()-damage)*100 / me->GetMaxHealth() < 20)
- {
- CAST_PLR(done_by)->GroupEventHappens(QUEST_10004,me);
- damage = 0;
- EnterEvadeMode();
- }
+ return new npc_salsalabimAI (pCreature);
}
- void UpdateAI(const uint32 diff)
+ struct npc_salsalabimAI : public ScriptedAI
{
- if (!UpdateVictim())
- return;
+ npc_salsalabimAI(Creature* c) : ScriptedAI(c) {}
- if (MagneticPull_Timer <= diff)
+ uint32 MagneticPull_Timer;
+
+ void Reset()
{
- DoCast(me->getVictim(), SPELL_MAGNETIC_PULL);
MagneticPull_Timer = 15000;
- } else MagneticPull_Timer -= diff;
+ me->RestoreFaction();
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if (done_by->GetTypeId() == TYPEID_PLAYER)
+ if ((me->GetHealth()-damage)*100 / me->GetMaxHealth() < 20)
+ {
+ CAST_PLR(done_by)->GroupEventHappens(QUEST_10004,me);
+ damage = 0;
+ EnterEvadeMode();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (MagneticPull_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_MAGNETIC_PULL);
+ MagneticPull_Timer = 15000;
+ } else MagneticPull_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_npc_salsalabim(Creature* pCreature)
-{
- return new npc_salsalabimAI (pCreature);
-}
-bool GossipHello_npc_salsalabim(Player* pPlayer, Creature* pCreature)
-{
- if (pPlayer->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE)
- {
- pCreature->setFaction(FACTION_HOSTILE_SA);
- pCreature->AI()->AttackStart(pPlayer);
- }
- else
- {
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- }
- return true;
-}
/*
##################################################
@@ -184,71 +201,85 @@ purchasable for one Mark of Illidari each
Purchase requires exalted reputation with Scryers/Aldor, Cenarion Expedition and The Sha'tar
##################################################
*/
-
-bool GossipHello_npc_shattrathflaskvendors(Player* pPlayer, Creature* pCreature)
+ class npc_shattrathflaskvendors : public CreatureScript
{
- if (pCreature->GetEntry() == 23484)
+public:
+ npc_shattrathflaskvendors() : CreatureScript("npc_shattrathflaskvendors") { }
+
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- // Aldor vendor
- if (pCreature->isVendor() && (pPlayer->GetReputationRank(932) == REP_EXALTED) && (pPlayer->GetReputationRank(935) == REP_EXALTED) && (pPlayer->GetReputationRank(942) == REP_EXALTED))
- {
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- pPlayer->SEND_GOSSIP_MENU(11085, pCreature->GetGUID());
- }
- else
- {
- pPlayer->SEND_GOSSIP_MENU(11083, pCreature->GetGUID());
- }
+ if (uiAction == GOSSIP_ACTION_TRADE)
+ pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
+
+ return true;
}
- if (pCreature->GetEntry() == 23483)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- // Scryers vendor
- if (pCreature->isVendor() && (pPlayer->GetReputationRank(934) == REP_EXALTED) && (pPlayer->GetReputationRank(935) == REP_EXALTED) && (pPlayer->GetReputationRank(942) == REP_EXALTED))
+ if (pCreature->GetEntry() == 23484)
{
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- pPlayer->SEND_GOSSIP_MENU(11085, pCreature->GetGUID());
+ // Aldor vendor
+ if (pCreature->isVendor() && (pPlayer->GetReputationRank(932) == REP_EXALTED) && (pPlayer->GetReputationRank(935) == REP_EXALTED) && (pPlayer->GetReputationRank(942) == REP_EXALTED))
+ {
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ pPlayer->SEND_GOSSIP_MENU(11085, pCreature->GetGUID());
+ }
+ else
+ {
+ pPlayer->SEND_GOSSIP_MENU(11083, pCreature->GetGUID());
+ }
}
- else
+
+ if (pCreature->GetEntry() == 23483)
{
- pPlayer->SEND_GOSSIP_MENU(11084, pCreature->GetGUID());
+ // Scryers vendor
+ if (pCreature->isVendor() && (pPlayer->GetReputationRank(934) == REP_EXALTED) && (pPlayer->GetReputationRank(935) == REP_EXALTED) && (pPlayer->GetReputationRank(942) == REP_EXALTED))
+ {
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ pPlayer->SEND_GOSSIP_MENU(11085, pCreature->GetGUID());
+ }
+ else
+ {
+ pPlayer->SEND_GOSSIP_MENU(11084, pCreature->GetGUID());
+ }
}
- }
- return true;
-}
+ return true;
+ }
-bool GossipSelect_npc_shattrathflaskvendors(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_TRADE)
- pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
+};
- return true;
-}
/*######
# npc_zephyr
######*/
#define GOSSIP_HZ "Take me to the Caverns of Time."
-
-bool GossipHello_npc_zephyr(Player* pPlayer, Creature* pCreature)
+ class npc_zephyr : public CreatureScript
{
- if (pPlayer->GetReputationRank(989) >= REP_REVERED)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HZ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+public:
+ npc_zephyr() : CreatureScript("npc_zephyr") { }
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ bool OnGossipSelect(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ pPlayer->CastSpell(pPlayer,37778,false);
- return true;
-}
+ return true;
+ }
-bool GossipSelect_npc_zephyr(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
- pPlayer->CastSpell(pPlayer,37778,false);
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pPlayer->GetReputationRank(989) >= REP_REVERED)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HZ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+
+ return true;
+ }
+
+};
- return true;
-}
/*######
# npc_kservant
@@ -276,73 +307,79 @@ bool GossipSelect_npc_zephyr(Player* pPlayer, Creature* /*pCreature*/, uint32 /*
#define WHISP19 -1000253
#define WHISP20 -1000254
#define WHISP21 -1000255
-
-struct npc_kservantAI : public npc_escortAI
+class npc_kservant : public CreatureScript
{
public:
- npc_kservantAI(Creature *c) : npc_escortAI(c) {}
+ npc_kservant() : CreatureScript("npc_kservant") { }
- void WaypointReached(uint32 i)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- Player* pPlayer = GetPlayerForEscort();
+ return new npc_kservantAI(pCreature);
+ }
- if (!pPlayer)
- return;
+ struct npc_kservantAI : public npc_escortAI
+ {
+ public:
+ npc_kservantAI(Creature *c) : npc_escortAI(c) {}
- switch(i)
+ void WaypointReached(uint32 i)
{
- case 0: DoScriptText(SAY1, me, pPlayer); break;
- case 4: DoScriptText(WHISP1, me, pPlayer); break;
- case 6: DoScriptText(WHISP2, me, pPlayer); break;
- case 7: DoScriptText(WHISP3, me, pPlayer); break;
- case 8: DoScriptText(WHISP4, me, pPlayer); break;
- case 17: DoScriptText(WHISP5, me, pPlayer); break;
- case 18: DoScriptText(WHISP6, me, pPlayer); break;
- case 19: DoScriptText(WHISP7, me, pPlayer); break;
- case 33: DoScriptText(WHISP8, me, pPlayer); break;
- case 34: DoScriptText(WHISP9, me, pPlayer); break;
- case 35: DoScriptText(WHISP10, me, pPlayer); break;
- case 36: DoScriptText(WHISP11, me, pPlayer); break;
- case 43: DoScriptText(WHISP12, me, pPlayer); break;
- case 44: DoScriptText(WHISP13, me, pPlayer); break;
- case 49: DoScriptText(WHISP14, me, pPlayer); break;
- case 50: DoScriptText(WHISP15, me, pPlayer); break;
- case 51: DoScriptText(WHISP16, me, pPlayer); break;
- case 52: DoScriptText(WHISP17, me, pPlayer); break;
- case 53: DoScriptText(WHISP18, me, pPlayer); break;
- case 54: DoScriptText(WHISP19, me, pPlayer); break;
- case 55: DoScriptText(WHISP20, me, pPlayer); break;
- case 56: DoScriptText(WHISP21, me, pPlayer);
- if (pPlayer)
- pPlayer->GroupEventHappens(10211,me);
- break;
- }
- }
+ Player* pPlayer = GetPlayerForEscort();
- void MoveInLineOfSight(Unit* pWho)
- {
- if (HasEscortState(STATE_ESCORT_ESCORTING))
- return;
+ if (!pPlayer)
+ return;
+
+ switch(i)
+ {
+ case 0: DoScriptText(SAY1, me, pPlayer); break;
+ case 4: DoScriptText(WHISP1, me, pPlayer); break;
+ case 6: DoScriptText(WHISP2, me, pPlayer); break;
+ case 7: DoScriptText(WHISP3, me, pPlayer); break;
+ case 8: DoScriptText(WHISP4, me, pPlayer); break;
+ case 17: DoScriptText(WHISP5, me, pPlayer); break;
+ case 18: DoScriptText(WHISP6, me, pPlayer); break;
+ case 19: DoScriptText(WHISP7, me, pPlayer); break;
+ case 33: DoScriptText(WHISP8, me, pPlayer); break;
+ case 34: DoScriptText(WHISP9, me, pPlayer); break;
+ case 35: DoScriptText(WHISP10, me, pPlayer); break;
+ case 36: DoScriptText(WHISP11, me, pPlayer); break;
+ case 43: DoScriptText(WHISP12, me, pPlayer); break;
+ case 44: DoScriptText(WHISP13, me, pPlayer); break;
+ case 49: DoScriptText(WHISP14, me, pPlayer); break;
+ case 50: DoScriptText(WHISP15, me, pPlayer); break;
+ case 51: DoScriptText(WHISP16, me, pPlayer); break;
+ case 52: DoScriptText(WHISP17, me, pPlayer); break;
+ case 53: DoScriptText(WHISP18, me, pPlayer); break;
+ case 54: DoScriptText(WHISP19, me, pPlayer); break;
+ case 55: DoScriptText(WHISP20, me, pPlayer); break;
+ case 56: DoScriptText(WHISP21, me, pPlayer);
+ if (pPlayer)
+ pPlayer->GroupEventHappens(10211,me);
+ break;
+ }
+ }
- if (pWho->GetTypeId() == TYPEID_PLAYER)
+ void MoveInLineOfSight(Unit* pWho)
{
- if (CAST_PLR(pWho)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE)
+ if (HasEscortState(STATE_ESCORT_ESCORTING))
+ return;
+
+ if (pWho->GetTypeId() == TYPEID_PLAYER)
{
- float Radius = 10.0;
- if (me->IsWithinDistInMap(pWho, Radius))
+ if (CAST_PLR(pWho)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE)
{
- Start(false, false, pWho->GetGUID());
+ float Radius = 10.0;
+ if (me->IsWithinDistInMap(pWho, Radius))
+ {
+ Start(false, false, pWho->GetGUID());
+ }
}
}
}
- }
- void Reset() {}
+ void Reset() {}
+ };
};
-CreatureAI* GetAI_npc_kservantAI(Creature* pCreature)
-{
- return new npc_kservantAI(pCreature);
-}
/*######
# npc_dirty_larry
@@ -360,122 +397,41 @@ CreatureAI* GetAI_npc_kservantAI(Creature* pCreature)
#define QUEST_WBI 10231
#define NPC_CREEPJACK 19726
#define NPC_MALONE 19725
-
-struct npc_dirty_larryAI : public ScriptedAI
+ class npc_dirty_larry : public CreatureScript
{
- npc_dirty_larryAI(Creature* c) : ScriptedAI(c) {}
-
- bool Event;
- bool Attack;
- bool Done;
-
- uint64 PlayerGUID;
-
- uint32 SayTimer;
- uint32 Step;
-
- void Reset()
- {
- Event = false;
- Attack = false;
- Done = false;
-
- PlayerGUID = 0;
- SayTimer = 0;
- Step = 0;
-
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->setFaction(1194);
- Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
- if (Creepjack)
- {
- CAST_CRE(Creepjack)->AI()->EnterEvadeMode();
- Creepjack->setFaction(1194);
- Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
- if (Malone)
- {
- CAST_CRE(Malone)->AI()->EnterEvadeMode();
- Malone->setFaction(1194);
- Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- }
+public:
+ npc_dirty_larry() : CreatureScript("npc_dirty_larry") { }
- uint32 NextStep(uint32 Step)
+ struct npc_dirty_larryAI : public ScriptedAI
{
- Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
+ npc_dirty_larryAI(Creature* c) : ScriptedAI(c) {}
- switch(Step)
- {
- case 0:{ me->SetInFront(pPlayer);
- Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
- if (Creepjack)
- Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
- if (Malone)
- Malone->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }return 2000;
- case 1: DoScriptText(SAY_1, me, pPlayer); return 3000;
- case 2: DoScriptText(SAY_2, me, pPlayer); return 5000;
- case 3: DoScriptText(SAY_3, me, pPlayer); return 2000;
- case 4: DoScriptText(SAY_4, me, pPlayer); return 2000;
- case 5: DoScriptText(SAY_5, me, pPlayer); return 2000;
- case 6: Attack = true; return 2000;
- default: return 0;
- }
- }
+ bool Event;
+ bool Attack;
+ bool Done;
- void EnterCombat(Unit* /*who*/){}
+ uint64 PlayerGUID;
- void UpdateAI(const uint32 diff)
- {
- if (SayTimer <= diff)
- {
- if (Event)
- SayTimer = NextStep(++Step);
- } else SayTimer -= diff;
+ uint32 SayTimer;
+ uint32 Step;
- if (Attack)
+ void Reset()
{
- Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
- me->setFaction(14);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (pPlayer)
- {
- Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
- if (Creepjack)
- {
- Creepjack->Attack(pPlayer, true);
- Creepjack->setFaction(14);
- Creepjack->GetMotionMaster()->MoveChase(pPlayer);
- Creepjack->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
- if (Malone)
- {
- Malone->Attack(pPlayer, true);
- Malone->setFaction(14);
- Malone->GetMotionMaster()->MoveChase(pPlayer);
- Malone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- DoStartMovement(pPlayer);
- AttackStart(pPlayer);
- }
+ Event = false;
Attack = false;
- }
+ Done = false;
- if ((me->GetHealth()*100)/me->GetMaxHealth() < 5 && !Done)
- {
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->RemoveAllAuras();
+ PlayerGUID = 0;
+ SayTimer = 0;
+ Step = 0;
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->setFaction(1194);
Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
if (Creepjack)
{
CAST_CRE(Creepjack)->AI()->EnterEvadeMode();
Creepjack->setFaction(1194);
- Creepjack->GetMotionMaster()->MoveTargetedHome();
Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
@@ -483,51 +439,140 @@ struct npc_dirty_larryAI : public ScriptedAI
{
CAST_CRE(Malone)->AI()->EnterEvadeMode();
Malone->setFaction(1194);
- Malone->GetMotionMaster()->MoveTargetedHome();
Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
- me->setFaction(1194);
- Done = true;
- DoScriptText(SAY_GIVEUP, me, NULL);
- me->DeleteThreatList();
- me->CombatStop();
- me->GetMotionMaster()->MoveTargetedHome();
+ }
+
+ uint32 NextStep(uint32 Step)
+ {
Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
- if (pPlayer)
- CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WBI, me);
+
+ switch(Step)
+ {
+ case 0:{ me->SetInFront(pPlayer);
+ Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
+ if (Creepjack)
+ Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
+ if (Malone)
+ Malone->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }return 2000;
+ case 1: DoScriptText(SAY_1, me, pPlayer); return 3000;
+ case 2: DoScriptText(SAY_2, me, pPlayer); return 5000;
+ case 3: DoScriptText(SAY_3, me, pPlayer); return 2000;
+ case 4: DoScriptText(SAY_4, me, pPlayer); return 2000;
+ case 5: DoScriptText(SAY_5, me, pPlayer); return 2000;
+ case 6: Attack = true; return 2000;
+ default: return 0;
+ }
}
- DoMeleeAttackIfReady();
+
+ void EnterCombat(Unit* /*who*/){}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (SayTimer <= diff)
+ {
+ if (Event)
+ SayTimer = NextStep(++Step);
+ } else SayTimer -= diff;
+
+ if (Attack)
+ {
+ Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
+ me->setFaction(14);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if (pPlayer)
+ {
+ Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
+ if (Creepjack)
+ {
+ Creepjack->Attack(pPlayer, true);
+ Creepjack->setFaction(14);
+ Creepjack->GetMotionMaster()->MoveChase(pPlayer);
+ Creepjack->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+ Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
+ if (Malone)
+ {
+ Malone->Attack(pPlayer, true);
+ Malone->setFaction(14);
+ Malone->GetMotionMaster()->MoveChase(pPlayer);
+ Malone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+ DoStartMovement(pPlayer);
+ AttackStart(pPlayer);
+ }
+ Attack = false;
+ }
+
+ if ((me->GetHealth()*100)/me->GetMaxHealth() < 5 && !Done)
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveAllAuras();
+
+ Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
+ if (Creepjack)
+ {
+ CAST_CRE(Creepjack)->AI()->EnterEvadeMode();
+ Creepjack->setFaction(1194);
+ Creepjack->GetMotionMaster()->MoveTargetedHome();
+ Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+ Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
+ if (Malone)
+ {
+ CAST_CRE(Malone)->AI()->EnterEvadeMode();
+ Malone->setFaction(1194);
+ Malone->GetMotionMaster()->MoveTargetedHome();
+ Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+ me->setFaction(1194);
+ Done = true;
+ DoScriptText(SAY_GIVEUP, me, NULL);
+ me->DeleteThreatList();
+ me->CombatStop();
+ me->GetMotionMaster()->MoveTargetedHome();
+ Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
+ if (pPlayer)
+ CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WBI, me);
+ }
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ CAST_AI(npc_dirty_larry::npc_dirty_larryAI, pCreature->AI())->Event = true;
+ CAST_AI(npc_dirty_larry::npc_dirty_larryAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID();
+ pPlayer->CLOSE_GOSSIP_MENU();
+ }
+
+ return true;
}
-};
-bool GossipHello_npc_dirty_larry(Player* pPlayer, Creature* pCreature)
-{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
- if (pPlayer->GetQuestStatus(QUEST_WBI) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BOOK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ if (pPlayer->GetQuestStatus(QUEST_WBI) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BOOK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
- return true;
-}
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
+ }
-bool GossipSelect_npc_dirty_larry(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- CAST_AI(npc_dirty_larryAI, pCreature->AI())->Event = true;
- CAST_AI(npc_dirty_larryAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID();
- pPlayer->CLOSE_GOSSIP_MENU();
+ return new npc_dirty_larryAI (pCreature);
}
- return true;
-}
+};
+
-CreatureAI* GetAI_npc_dirty_larryAI(Creature* pCreature)
-{
- return new npc_dirty_larryAI (pCreature);
-}
/*######
# npc_ishanah
@@ -535,29 +580,36 @@ CreatureAI* GetAI_npc_dirty_larryAI(Creature* pCreature)
#define ISANAH_GOSSIP_1 "Who are the Sha'tar?"
#define ISANAH_GOSSIP_2 "Isn't Shattrath a draenei city? Why do you allow others here?"
-
-bool GossipHello_npc_ishanah(Player* pPlayer, Creature* pCreature)
+ class npc_ishanah : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+public:
+ npc_ishanah() : CreatureScript("npc_ishanah") { }
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ pPlayer->SEND_GOSSIP_MENU(9458, pCreature->GetGUID());
+ else if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
+ pPlayer->SEND_GOSSIP_MENU(9459, pCreature->GetGUID());
- pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
+ }
- return true;
-}
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
-bool GossipSelect_npc_ishanah(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
- pPlayer->SEND_GOSSIP_MENU(9458, pCreature->GetGUID());
- else if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
- pPlayer->SEND_GOSSIP_MENU(9459, pCreature->GetGUID());
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+
+ return true;
+ }
+
+};
- return true;
-}
/*######
# npc_khadgar
@@ -569,107 +621,71 @@ bool GossipSelect_npc_ishanah(Player* pPlayer, Creature* pCreature, uint32 /*uiS
#define KHADGAR_GOSSIP_4 "What did you do then?"
#define KHADGAR_GOSSIP_5 "What happened next?"
#define KHADGAR_GOSSIP_7 "There was something else I wanted to ask you."
-
-bool GossipHello_npc_khadgar(Player* pPlayer, Creature* pCreature)
+ class npc_khadgar : public CreatureScript
{
- if (pCreature->isQuestGiver())
- pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+public:
+ npc_khadgar() : CreatureScript("npc_khadgar") { }
- if (!pPlayer->hasQuest(10211))
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ switch(uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ pPlayer->SEND_GOSSIP_MENU(9876, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ pPlayer->SEND_GOSSIP_MENU(9877, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ pPlayer->SEND_GOSSIP_MENU(9878, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ pPlayer->SEND_GOSSIP_MENU(9879, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ pPlayer->SEND_GOSSIP_MENU(9880, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
+ pPlayer->SEND_GOSSIP_MENU(9881, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ pPlayer->SEND_GOSSIP_MENU(9243, pCreature->GetGUID());
+ break;
+ }
+ return true;
+ }
- pPlayer->SEND_GOSSIP_MENU(9243, pCreature->GetGUID());
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
- return true;
-}
+ if (!pPlayer->hasQuest(10211))
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-bool GossipSelect_npc_khadgar(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch(uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- pPlayer->SEND_GOSSIP_MENU(9876, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- pPlayer->SEND_GOSSIP_MENU(9877, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- pPlayer->SEND_GOSSIP_MENU(9878, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- pPlayer->SEND_GOSSIP_MENU(9879, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- pPlayer->SEND_GOSSIP_MENU(9880, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
- pPlayer->SEND_GOSSIP_MENU(9881, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- pPlayer->SEND_GOSSIP_MENU(9243, pCreature->GetGUID());
- break;
+ pPlayer->SEND_GOSSIP_MENU(9243, pCreature->GetGUID());
+
+ return true;
}
- return true;
-}
+
+};
+
void AddSC_shattrath_city()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "npc_raliq_the_drunk";
- newscript->GetAI = &GetAI_npc_raliq_the_drunk;
- newscript->pGossipHello = &GossipHello_npc_raliq_the_drunk;
- newscript->pGossipSelect = &GossipSelect_npc_raliq_the_drunk;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_salsalabim";
- newscript->GetAI = &GetAI_npc_salsalabim;
- newscript->pGossipHello = &GossipHello_npc_salsalabim;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_shattrathflaskvendors";
- newscript->pGossipHello = &GossipHello_npc_shattrathflaskvendors;
- newscript->pGossipSelect = &GossipSelect_npc_shattrathflaskvendors;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_zephyr";
- newscript->pGossipHello = &GossipHello_npc_zephyr;
- newscript->pGossipSelect = &GossipSelect_npc_zephyr;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_kservant";
- newscript->GetAI = &GetAI_npc_kservantAI;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_dirty_larry";
- newscript->GetAI = &GetAI_npc_dirty_larryAI;
- newscript->pGossipHello = &GossipHello_npc_dirty_larry;
- newscript->pGossipSelect = &GossipSelect_npc_dirty_larry;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_ishanah";
- newscript->pGossipHello = &GossipHello_npc_ishanah;
- newscript->pGossipSelect = &GossipSelect_npc_ishanah;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_khadgar";
- newscript->pGossipHello = &GossipHello_npc_khadgar;
- newscript->pGossipSelect = &GossipSelect_npc_khadgar;
- newscript->RegisterSelf();
+ new npc_raliq_the_drunk();
+ new npc_salsalabim();
+ new npc_shattrathflaskvendors();
+ new npc_zephyr();
+ new npc_kservant();
+ new npc_dirty_larry();
+ new npc_ishanah();
+ new npc_khadgar();
}
-
diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp
index 6281a957d43..71f336eddee 100644
--- a/src/server/scripts/Outland/terokkar_forest.cpp
+++ b/src/server/scripts/Outland/terokkar_forest.cpp
@@ -48,207 +48,235 @@ EndContentData */
#define SPELL_PULVERIZE 2676
//#define SPELL_QUID9889 32174
-
-struct mob_unkor_the_ruthlessAI : public ScriptedAI
+ class mob_unkor_the_ruthless : public CreatureScript
{
- mob_unkor_the_ruthlessAI(Creature* c) : ScriptedAI(c) {}
-
- bool CanDoQuest;
- uint32 UnkorUnfriendly_Timer;
- uint32 Pulverize_Timer;
+public:
+ mob_unkor_the_ruthless() : CreatureScript("mob_unkor_the_ruthless") { }
- void Reset()
+ CreatureAI* GetAI(Creature* pCreature) const
{
- CanDoQuest = false;
- UnkorUnfriendly_Timer = 0;
- Pulverize_Timer = 3000;
- me->SetStandState(UNIT_STAND_STATE_STAND);
- me->setFaction(FACTION_HOSTILE);
+ return new mob_unkor_the_ruthlessAI (pCreature);
}
- void EnterCombat(Unit * /*who*/) {}
-
- void DoNice()
+ struct mob_unkor_the_ruthlessAI : public ScriptedAI
{
- DoScriptText(SAY_SUBMIT, me);
- me->setFaction(FACTION_FRIENDLY);
- me->SetStandState(UNIT_STAND_STATE_SIT);
- me->RemoveAllAuras();
- me->DeleteThreatList();
- me->CombatStop(true);
- UnkorUnfriendly_Timer = 60000;
- }
+ mob_unkor_the_ruthlessAI(Creature* c) : ScriptedAI(c) {}
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if (done_by->GetTypeId() == TYPEID_PLAYER)
- if ((me->GetHealth()-damage)*100 / me->GetMaxHealth() < 30)
+ bool CanDoQuest;
+ uint32 UnkorUnfriendly_Timer;
+ uint32 Pulverize_Timer;
+
+ void Reset()
+ {
+ CanDoQuest = false;
+ UnkorUnfriendly_Timer = 0;
+ Pulverize_Timer = 3000;
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->setFaction(FACTION_HOSTILE);
+ }
+
+ void EnterCombat(Unit * /*who*/) {}
+
+ void DoNice()
+ {
+ DoScriptText(SAY_SUBMIT, me);
+ me->setFaction(FACTION_FRIENDLY);
+ me->SetStandState(UNIT_STAND_STATE_SIT);
+ me->RemoveAllAuras();
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ UnkorUnfriendly_Timer = 60000;
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
{
- if (Group* pGroup = CAST_PLR(done_by)->GetGroup())
+ if (done_by->GetTypeId() == TYPEID_PLAYER)
+ if ((me->GetHealth()-damage)*100 / me->GetMaxHealth() < 30)
{
- for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ if (Group* pGroup = CAST_PLR(done_by)->GetGroup())
{
- Player *pGroupie = itr->getSource();
- if (pGroupie &&
- pGroupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
- pGroupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
+ for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{
- pGroupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
- if (!CanDoQuest)
- CanDoQuest = true;
+ Player *pGroupie = itr->getSource();
+ if (pGroupie &&
+ pGroupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
+ pGroupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
+ {
+ pGroupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
+ if (!CanDoQuest)
+ CanDoQuest = true;
+ }
}
+ } else
+ if (CAST_PLR(done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
+ CAST_PLR(done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
+ {
+ CAST_PLR(done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
+ CanDoQuest = true;
}
- } else
- if (CAST_PLR(done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
- CAST_PLR(done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
- {
- CAST_PLR(done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
- CanDoQuest = true;
}
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (CanDoQuest)
+ void UpdateAI(const uint32 diff)
{
- if (!UnkorUnfriendly_Timer)
- {
- //DoCast(me, SPELL_QUID9889); //not using spell for now
- DoNice();
- }
- else
+ if (CanDoQuest)
{
- if (UnkorUnfriendly_Timer <= diff)
+ if (!UnkorUnfriendly_Timer)
{
- EnterEvadeMode();
- return;
- } else UnkorUnfriendly_Timer -= diff;
+ //DoCast(me, SPELL_QUID9889); //not using spell for now
+ DoNice();
+ }
+ else
+ {
+ if (UnkorUnfriendly_Timer <= diff)
+ {
+ EnterEvadeMode();
+ return;
+ } else UnkorUnfriendly_Timer -= diff;
+ }
}
- }
- if (!UpdateVictim())
- return;
+ if (!UpdateVictim())
+ return;
- if (Pulverize_Timer <= diff)
- {
- DoCast(me, SPELL_PULVERIZE);
- Pulverize_Timer = 9000;
- } else Pulverize_Timer -= diff;
+ if (Pulverize_Timer <= diff)
+ {
+ DoCast(me, SPELL_PULVERIZE);
+ Pulverize_Timer = 9000;
+ } else Pulverize_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_mob_unkor_the_ruthless(Creature* pCreature)
-{
- return new mob_unkor_the_ruthlessAI (pCreature);
-}
/*######
## mob_infested_root_walker
######*/
-
-struct mob_infested_root_walkerAI : public ScriptedAI
+ class mob_infested_root_walker : public CreatureScript
{
- mob_infested_root_walkerAI(Creature *c) : ScriptedAI(c) {}
-
- void Reset() { }
- void EnterCombat(Unit * /*who*/) { }
+public:
+ mob_infested_root_walker() : CreatureScript("mob_infested_root_walker") { }
- void DamageTaken(Unit *done_by, uint32 &damage)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (done_by && done_by->GetTypeId() == TYPEID_PLAYER)
- if (me->GetHealth() <= damage)
- if (rand()%100 < 75)
- //Summon Wood Mites
- DoCast(me, 39130, true);
+ return new mob_infested_root_walkerAI (pCreature);
}
+
+ struct mob_infested_root_walkerAI : public ScriptedAI
+ {
+ mob_infested_root_walkerAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() { }
+ void EnterCombat(Unit * /*who*/) { }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if (done_by && done_by->GetTypeId() == TYPEID_PLAYER)
+ if (me->GetHealth() <= damage)
+ if (rand()%100 < 75)
+ //Summon Wood Mites
+ DoCast(me, 39130, true);
+ }
+ };
+
};
-CreatureAI* GetAI_mob_infested_root_walker(Creature* pCreature)
-{
- return new mob_infested_root_walkerAI (pCreature);
-}
/*######
## mob_skywing
######*/
-struct npc_skywingAI : public npc_escortAI
+class npc_skywing : public CreatureScript
{
public:
- npc_skywingAI(Creature *c) : npc_escortAI(c) {}
+ npc_skywing() : CreatureScript("npc_skywing") { }
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_skywingAI(pCreature);
+ }
- void WaypointReached(uint32 i)
+ struct npc_skywingAI : public npc_escortAI
{
- Player* pPlayer = GetPlayerForEscort();
- if (!pPlayer)
- return;
+ public:
+ npc_skywingAI(Creature *c) : npc_escortAI(c) {}
- switch(i)
+ void WaypointReached(uint32 i)
{
- case 8:
- pPlayer->AreaExploredOrEventHappens(10898);
- break;
- }
- }
+ Player* pPlayer = GetPlayerForEscort();
+ if (!pPlayer)
+ return;
- void EnterCombat(Unit* /*who*/) {}
+ switch(i)
+ {
+ case 8:
+ pPlayer->AreaExploredOrEventHappens(10898);
+ break;
+ }
+ }
- void MoveInLineOfSight(Unit *who)
- {
- if (HasEscortState(STATE_ESCORT_ESCORTING))
- return;
+ void EnterCombat(Unit* /*who*/) {}
- if (who->GetTypeId() == TYPEID_PLAYER)
+ void MoveInLineOfSight(Unit *who)
{
- if (CAST_PLR(who)->GetQuestStatus(10898) == QUEST_STATUS_INCOMPLETE)
+ if (HasEscortState(STATE_ESCORT_ESCORTING))
+ return;
+
+ if (who->GetTypeId() == TYPEID_PLAYER)
{
- float Radius = 10.0;
- if (me->IsWithinDistInMap(who, Radius))
+ if (CAST_PLR(who)->GetQuestStatus(10898) == QUEST_STATUS_INCOMPLETE)
{
- Start(false, false, who->GetGUID());
+ float Radius = 10.0;
+ if (me->IsWithinDistInMap(who, Radius))
+ {
+ Start(false, false, who->GetGUID());
+ }
}
}
}
- }
- void Reset() {}
+ void Reset() {}
- void UpdateAI(const uint32 diff)
- {
- npc_escortAI::UpdateAI(diff);
- }
-};
+ void UpdateAI(const uint32 diff)
+ {
+ npc_escortAI::UpdateAI(diff);
+ }
+ };
-CreatureAI* GetAI_npc_skywingAI(Creature* pCreature)
-{
- return new npc_skywingAI(pCreature);
-}
+};
/*######
## mob_rotting_forest_rager
######*/
-
-struct mob_rotting_forest_ragerAI : public ScriptedAI
+ class mob_rotting_forest_rager : public CreatureScript
{
- mob_rotting_forest_ragerAI(Creature *c) : ScriptedAI(c) {}
-
- void Reset() { }
- void EnterCombat(Unit * /*who*/) { }
+public:
+ mob_rotting_forest_rager() : CreatureScript("mob_rotting_forest_rager") { }
- void DamageTaken(Unit *done_by, uint32 &damage)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (done_by->GetTypeId() == TYPEID_PLAYER)
- if (me->GetHealth() <= damage)
- if (rand()%100 < 75)
- //Summon Lots of Wood Mights
- DoCast(me, 39134, true);
+ return new mob_rotting_forest_ragerAI (pCreature);
}
+
+ struct mob_rotting_forest_ragerAI : public ScriptedAI
+ {
+ mob_rotting_forest_ragerAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() { }
+ void EnterCombat(Unit * /*who*/) { }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if (done_by->GetTypeId() == TYPEID_PLAYER)
+ if (me->GetHealth() <= damage)
+ if (rand()%100 < 75)
+ //Summon Lots of Wood Mights
+ DoCast(me, 39134, true);
+ }
+ };
+
};
-CreatureAI* GetAI_mob_rotting_forest_rager(Creature* pCreature)
-{
- return new mob_rotting_forest_ragerAI (pCreature);
-}
/*######
## mob_netherweb_victim
@@ -260,40 +288,47 @@ CreatureAI* GetAI_mob_rotting_forest_rager(Creature* pCreature)
const uint32 netherwebVictims[6] =
{
18470, 16805, 21242, 18452, 22482, 21285
-};
-struct mob_netherweb_victimAI : public ScriptedAI
+}; class mob_netherweb_victim : public CreatureScript
{
- mob_netherweb_victimAI(Creature *c) : ScriptedAI(c) {}
+public:
+ mob_netherweb_victim() : CreatureScript("mob_netherweb_victim") { }
- void Reset() { }
- void EnterCombat(Unit * /*who*/) { }
- void MoveInLineOfSight(Unit * /*who*/) { }
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new mob_netherweb_victimAI (pCreature);
+ }
- void JustDied(Unit* Killer)
+ struct mob_netherweb_victimAI : public ScriptedAI
{
- if (Killer->GetTypeId() == TYPEID_PLAYER)
+ mob_netherweb_victimAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() { }
+ void EnterCombat(Unit * /*who*/) { }
+ void MoveInLineOfSight(Unit * /*who*/) { }
+
+ void JustDied(Unit* Killer)
{
- if (CAST_PLR(Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE)
+ if (Killer->GetTypeId() == TYPEID_PLAYER)
{
- if (rand()%100 < 25)
+ if (CAST_PLR(Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE)
{
- me->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
- CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, me->GetGUID());
- }
- else
- me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ if (rand()%100 < 25)
+ {
+ me->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, me->GetGUID());
+ }
+ else
+ me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
- if (rand()%100 < 75)
- me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f,0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
- me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ if (rand()%100 < 75)
+ me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f,0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ }
}
}
- }
+ };
+
};
-CreatureAI* GetAI_mob_netherweb_victim(Creature* pCreature)
-{
- return new mob_netherweb_victimAI (pCreature);
-}
/*######
## npc_floon
@@ -313,87 +348,96 @@ enum eFloon
FACTION_HOSTILE_FL = 1738,
QUEST_CRACK_SKULLS = 10009
};
-
-struct npc_floonAI : public ScriptedAI
+ class npc_floon : public CreatureScript
{
- npc_floonAI(Creature* c) : ScriptedAI(c)
+public:
+ npc_floon() : CreatureScript("npc_floon") { }
+
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- m_uiNormFaction = c->getFaction();
+ if (uiAction == GOSSIP_ACTION_INFO_DEF)
+ {
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ pPlayer->SEND_GOSSIP_MENU(9443, pCreature->GetGUID());
+ }
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ pPlayer->CLOSE_GOSSIP_MENU();
+ pCreature->setFaction(FACTION_HOSTILE_FL);
+ DoScriptText(SAY_FLOON_ATTACK, pCreature, pPlayer);
+ pCreature->AI()->AttackStart(pPlayer);
+ }
+ return true;
}
- uint32 m_uiNormFaction;
- uint32 Silence_Timer;
- uint32 Frostbolt_Timer;
- uint32 FrostNova_Timer;
-
- void Reset()
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- Silence_Timer = 2000;
- Frostbolt_Timer = 4000;
- FrostNova_Timer = 9000;
- if (me->getFaction() != m_uiNormFaction)
- me->setFaction(m_uiNormFaction);
- }
+ if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- void EnterCombat(Unit * /*who*/) {}
+ pPlayer->SEND_GOSSIP_MENU(9442, pCreature->GetGUID());
+ return true;
+ }
- void UpdateAI(const uint32 diff)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- if (!UpdateVictim())
- return;
+ return new npc_floonAI (pCreature);
+ }
- if (Silence_Timer <= diff)
+ struct npc_floonAI : public ScriptedAI
+ {
+ npc_floonAI(Creature* c) : ScriptedAI(c)
{
- DoCast(me->getVictim(), SPELL_SILENCE);
- Silence_Timer = 30000;
- } else Silence_Timer -= diff;
+ m_uiNormFaction = c->getFaction();
+ }
+
+ uint32 m_uiNormFaction;
+ uint32 Silence_Timer;
+ uint32 Frostbolt_Timer;
+ uint32 FrostNova_Timer;
- if (FrostNova_Timer <= diff)
+ void Reset()
{
- DoCast(me, SPELL_FROST_NOVA);
- FrostNova_Timer = 20000;
- } else FrostNova_Timer -= diff;
+ Silence_Timer = 2000;
+ Frostbolt_Timer = 4000;
+ FrostNova_Timer = 9000;
+ if (me->getFaction() != m_uiNormFaction)
+ me->setFaction(m_uiNormFaction);
+ }
+
+ void EnterCombat(Unit * /*who*/) {}
- if (Frostbolt_Timer <= diff)
+ void UpdateAI(const uint32 diff)
{
- DoCast(me->getVictim(), SPELL_FROSTBOLT);
- Frostbolt_Timer = 5000;
- } else Frostbolt_Timer -= diff;
+ if (!UpdateVictim())
+ return;
- DoMeleeAttackIfReady();
- }
-};
+ if (Silence_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SILENCE);
+ Silence_Timer = 30000;
+ } else Silence_Timer -= diff;
-CreatureAI* GetAI_npc_floon(Creature* pCreature)
-{
- return new npc_floonAI (pCreature);
-}
+ if (FrostNova_Timer <= diff)
+ {
+ DoCast(me, SPELL_FROST_NOVA);
+ FrostNova_Timer = 20000;
+ } else FrostNova_Timer -= diff;
+
+ if (Frostbolt_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FROSTBOLT);
+ Frostbolt_Timer = 5000;
+ } else Frostbolt_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+};
-bool GossipHello_npc_floon(Player* pPlayer, Creature* pCreature)
-{
- if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- pPlayer->SEND_GOSSIP_MENU(9442, pCreature->GetGUID());
- return true;
-}
-bool GossipSelect_npc_floon(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_INFO_DEF)
- {
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- pPlayer->SEND_GOSSIP_MENU(9443, pCreature->GetGUID());
- }
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
- {
- pPlayer->CLOSE_GOSSIP_MENU();
- pCreature->setFaction(FACTION_HOSTILE_FL);
- DoScriptText(SAY_FLOON_ATTACK, pCreature, pPlayer);
- pCreature->AI()->AttackStart(pPlayer);
- }
- return true;
-}
/*######
## npc_isla_starmane
@@ -408,76 +452,83 @@ bool GossipSelect_npc_floon(Player* pPlayer, Creature* pCreature, uint32 /*uiSen
#define QUEST_EFTW_A 10051
#define GO_CAGE 182794
#define SPELL_CAT 32447
-
-struct npc_isla_starmaneAI : public npc_escortAI
+ class npc_isla_starmane : public CreatureScript
{
- npc_isla_starmaneAI(Creature* c) : npc_escortAI(c) {}
+public:
+ npc_isla_starmane() : CreatureScript("npc_isla_starmane") { }
- void WaypointReached(uint32 i)
+ struct npc_isla_starmaneAI : public npc_escortAI
{
- Player* pPlayer = GetPlayerForEscort();
-
- if (!pPlayer)
- return;
+ npc_isla_starmaneAI(Creature* c) : npc_escortAI(c) {}
- switch(i)
+ void WaypointReached(uint32 i)
{
- case 0:
+ Player* pPlayer = GetPlayerForEscort();
+
+ if (!pPlayer)
+ return;
+
+ switch(i)
{
- GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10);
- if (Cage)
- Cage->SetGoState(GO_STATE_ACTIVE);
+ case 0:
+ {
+ GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10);
+ if (Cage)
+ Cage->SetGoState(GO_STATE_ACTIVE);
+ }
+ break;
+ case 2: DoScriptText(SAY_PROGRESS_1, me, pPlayer); break;
+ case 5: DoScriptText(SAY_PROGRESS_2, me, pPlayer); break;
+ case 6: DoScriptText(SAY_PROGRESS_3, me, pPlayer); break;
+ case 29:DoScriptText(SAY_PROGRESS_4, me, pPlayer);
+ if (pPlayer)
+ {
+ if (pPlayer->GetTeam() == ALLIANCE)
+ pPlayer->GroupEventHappens(QUEST_EFTW_A, me);
+ else if (pPlayer->GetTeam() == HORDE)
+ pPlayer->GroupEventHappens(QUEST_EFTW_H, me);
+ }
+ me->SetInFront(pPlayer); break;
+ case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
+ case 31: DoCast(me, SPELL_CAT);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break;
}
- break;
- case 2: DoScriptText(SAY_PROGRESS_1, me, pPlayer); break;
- case 5: DoScriptText(SAY_PROGRESS_2, me, pPlayer); break;
- case 6: DoScriptText(SAY_PROGRESS_3, me, pPlayer); break;
- case 29:DoScriptText(SAY_PROGRESS_4, me, pPlayer);
- if (pPlayer)
+ }
+
+ void Reset()
+ {
+ me->RestoreFaction();
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ if (Player* pPlayer = GetPlayerForEscort())
{
if (pPlayer->GetTeam() == ALLIANCE)
- pPlayer->GroupEventHappens(QUEST_EFTW_A, me);
+ pPlayer->FailQuest(QUEST_EFTW_A);
else if (pPlayer->GetTeam() == HORDE)
- pPlayer->GroupEventHappens(QUEST_EFTW_H, me);
+ pPlayer->FailQuest(QUEST_EFTW_H);
}
- me->SetInFront(pPlayer); break;
- case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
- case 31: DoCast(me, SPELL_CAT);
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break;
}
- }
-
- void Reset()
- {
- me->RestoreFaction();
- }
+ };
- void JustDied(Unit* /*killer*/)
+ bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const* quest)
{
- if (Player* pPlayer = GetPlayerForEscort())
+ if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A)
{
- if (pPlayer->GetTeam() == ALLIANCE)
- pPlayer->FailQuest(QUEST_EFTW_A);
- else if (pPlayer->GetTeam() == HORDE)
- pPlayer->FailQuest(QUEST_EFTW_H);
+ CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID());
+ pCreature->setFaction(113);
}
+ return true;
}
-};
-bool QuestAccept_npc_isla_starmane(Player* pPlayer, Creature* pCreature, Quest const* quest)
-{
- if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID());
- pCreature->setFaction(113);
+ return new npc_isla_starmaneAI(pCreature);
}
- return true;
-}
-CreatureAI* GetAI_npc_isla_starmaneAI(Creature* pCreature)
-{
- return new npc_isla_starmaneAI(pCreature);
-}
+};
+
/*######
## go_skull_pile
@@ -486,48 +537,53 @@ CreatureAI* GetAI_npc_isla_starmaneAI(Creature* pCreature)
#define GOSSIP_S_KARROG "Summon Karrog"
#define GOSSIP_S_GEZZARAK_THE_HUNTRESS "Summon Gezzarak the Huntress"
#define GOSSIP_S_VAKKIZ_THE_WINDRAGER "Summon Vakkiz the Windrager"
-
-bool GossipHello_go_skull_pile(Player* pPlayer, GameObject* pGo)
+ class go_skull_pile : public GameObjectScript
{
- if ((pPlayer->GetQuestStatus(11885) == QUEST_STATUS_INCOMPLETE) || pPlayer->GetQuestRewardStatus(11885))
+public:
+ go_skull_pile() : GameObjectScript("go_skull_pile") { }
+
+ bool OnGossipSelect(Player* pPlayer, GameObject* pGo, uint32 uiSender, uint32 uiAction)
{
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ switch(uiSender)
+ {
+ case GOSSIP_SENDER_MAIN: SendActionMenu(pPlayer, pGo, uiAction); break;
+ }
+ return true;
}
- pPlayer->SEND_GOSSIP_MENU(pGo->GetGOInfo()->questgiver.gossipID, pGo->GetGUID());
- return true;
-}
-
-void SendActionMenu_go_skull_pile(Player* pPlayer, GameObject* /*pGo*/, uint32 uiAction)
-{
- switch(uiAction)
+ bool OnGossipHello(Player* pPlayer, GameObject* pGo)
{
- case GOSSIP_ACTION_INFO_DEF + 1:
- pPlayer->CastSpell(pPlayer,40642,false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- pPlayer->CastSpell(pPlayer,40640,false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- pPlayer->CastSpell(pPlayer,40632,false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- pPlayer->CastSpell(pPlayer,40644,false);
- break;
+ if ((pPlayer->GetQuestStatus(11885) == QUEST_STATUS_INCOMPLETE) || pPlayer->GetQuestRewardStatus(11885))
+ {
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ }
+
+ pPlayer->SEND_GOSSIP_MENU(pGo->GetGOInfo()->questgiver.gossipID, pGo->GetGUID());
+ return true;
}
-}
-bool GossipSelect_go_skull_pile(Player* pPlayer, GameObject* pGo, uint32 uiSender, uint32 uiAction)
-{
- switch(uiSender)
+ void SendActionMenu(Player* pPlayer, GameObject* /*pGo*/, uint32 uiAction)
{
- case GOSSIP_SENDER_MAIN: SendActionMenu_go_skull_pile(pPlayer, pGo, uiAction); break;
+ switch(uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ pPlayer->CastSpell(pPlayer,40642,false);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ pPlayer->CastSpell(pPlayer,40640,false);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ pPlayer->CastSpell(pPlayer,40632,false);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ pPlayer->CastSpell(pPlayer,40644,false);
+ break;
+ }
}
- return true;
-}
+};
/*######
## npc_slim
@@ -537,27 +593,34 @@ enum eSlim
{
FACTION_CONSORTIUM = 933
};
-
-bool GossipHello_npc_slim(Player* pPlayer, Creature* pCreature)
+ class npc_slim : public CreatureScript
{
- if (pCreature->isVendor() && pPlayer->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY)
+public:
+ npc_slim() : CreatureScript("npc_slim") { }
+
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- pPlayer->SEND_GOSSIP_MENU(9896, pCreature->GetGUID());
+ if (uiAction == GOSSIP_ACTION_TRADE)
+ pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
+
+ return true;
}
- else
- pPlayer->SEND_GOSSIP_MENU(9895, pCreature->GetGUID());
- return true;
-}
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pCreature->isVendor() && pPlayer->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY)
+ {
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ pPlayer->SEND_GOSSIP_MENU(9896, pCreature->GetGUID());
+ }
+ else
+ pPlayer->SEND_GOSSIP_MENU(9895, pCreature->GetGUID());
-bool GossipSelect_npc_slim(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- if (uiAction == GOSSIP_ACTION_TRADE)
- pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
+ return true;
+ }
+
+};
- return true;
-}
/*########
####npc_akuno
@@ -568,115 +631,73 @@ enum eAkuno
QUEST_ESCAPING_THE_TOMB = 10887,
NPC_CABAL_SKRIMISHER = 21661
};
-
-struct npc_akunoAI : public npc_escortAI
+ class npc_akuno : public CreatureScript
{
- npc_akunoAI(Creature *c) : npc_escortAI(c) {}
+public:
+ npc_akuno() : CreatureScript("npc_akuno") { }
- void WaypointReached(uint32 i)
+ bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
- Player* pPlayer = GetPlayerForEscort();
-
- if (!pPlayer)
- return;
-
- switch(i)
+ if (pQuest->GetQuestId() == QUEST_ESCAPING_THE_TOMB)
{
- case 3:
- me->SummonCreature(NPC_CABAL_SKRIMISHER,-2795.99,5420.33,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- me->SummonCreature(NPC_CABAL_SKRIMISHER,-2793.55,5412.79,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- break;
- case 11:
- if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER)
- pPlayer->GroupEventHappens(QUEST_ESCAPING_THE_TOMB,me);
- break;
+ if (npc_akunoAI* pEscortAI = CAST_AI(npc_akuno::npc_akunoAI, pCreature->AI()))
+ pEscortAI->Start(false, false, pPlayer->GetGUID());
+
+ if (pPlayer->GetTeamId() == TEAM_ALLIANCE)
+ pCreature->setFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
+ else
+ pCreature->setFaction(FACTION_ESCORT_H_NEUTRAL_PASSIVE);
}
+ return true;
}
- void JustSummoned(Creature* summon)
+ CreatureAI* GetAI(Creature* pCreature) const
{
- summon->AI()->AttackStart(me);
+ return new npc_akunoAI(pCreature);
}
-};
-bool QuestAccept_npc_akuno(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
-{
- if (pQuest->GetQuestId() == QUEST_ESCAPING_THE_TOMB)
+ struct npc_akunoAI : public npc_escortAI
{
- if (npc_akunoAI* pEscortAI = CAST_AI(npc_akunoAI, pCreature->AI()))
- pEscortAI->Start(false, false, pPlayer->GetGUID());
+ npc_akunoAI(Creature *c) : npc_escortAI(c) {}
- if (pPlayer->GetTeamId() == TEAM_ALLIANCE)
- pCreature->setFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
- else
- pCreature->setFaction(FACTION_ESCORT_H_NEUTRAL_PASSIVE);
- }
- return true;
-}
+ void WaypointReached(uint32 i)
+ {
+ Player* pPlayer = GetPlayerForEscort();
-CreatureAI* GetAI_npc_akuno(Creature* pCreature)
-{
- return new npc_akunoAI(pCreature);
-}
+ if (!pPlayer)
+ return;
+
+ switch(i)
+ {
+ case 3:
+ me->SummonCreature(NPC_CABAL_SKRIMISHER,-2795.99,5420.33,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_CABAL_SKRIMISHER,-2793.55,5412.79,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ break;
+ case 11:
+ if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER)
+ pPlayer->GroupEventHappens(QUEST_ESCAPING_THE_TOMB,me);
+ break;
+ }
+ }
+
+ void JustSummoned(Creature* summon)
+ {
+ summon->AI()->AttackStart(me);
+ }
+ };
+
+};
void AddSC_terokkar_forest()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "mob_unkor_the_ruthless";
- newscript->GetAI = &GetAI_mob_unkor_the_ruthless;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_infested_root_walker";
- newscript->GetAI = &GetAI_mob_infested_root_walker;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_rotting_forest_rager";
- newscript->GetAI = &GetAI_mob_rotting_forest_rager;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_netherweb_victim";
- newscript->GetAI = &GetAI_mob_netherweb_victim;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_floon";
- newscript->GetAI = &GetAI_npc_floon;
- newscript->pGossipHello = &GossipHello_npc_floon;
- newscript->pGossipSelect = &GossipSelect_npc_floon;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_isla_starmane";
- newscript->GetAI = &GetAI_npc_isla_starmaneAI;
- newscript->pQuestAccept = &QuestAccept_npc_isla_starmane;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "go_skull_pile";
- newscript->pGOHello = &GossipHello_go_skull_pile;
- newscript->pGOSelect = &GossipSelect_go_skull_pile;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_skywing";
- newscript->GetAI = &GetAI_npc_skywingAI;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_slim";
- newscript->pGossipHello = &GossipHello_npc_slim;
- newscript->pGossipSelect = &GossipSelect_npc_slim;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_akuno";
- newscript->GetAI = &GetAI_npc_akuno;
- newscript->pQuestAccept = &QuestAccept_npc_akuno;
- newscript->RegisterSelf();
+ new mob_unkor_the_ruthless();
+ new mob_infested_root_walker();
+ new mob_rotting_forest_rager();
+ new mob_netherweb_victim();
+ new npc_floon();
+ new npc_isla_starmane();
+ new go_skull_pile();
+ new npc_skywing();
+ new npc_slim();
+ new npc_akuno();
}
-
diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zangarmarsh.cpp
index 5bf0ef83047..17adb1029fb 100644
--- a/src/server/scripts/Outland/zangarmarsh.cpp
+++ b/src/server/scripts/Outland/zangarmarsh.cpp
@@ -176,12 +176,12 @@ public:
}
};
- CreatureAI* GetAI(Creature* pCreature)
+ CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_cooshcooshAI (pCreature);
}
- bool GossipHello(Player* pPlayer, Creature* pCreature)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_COOSH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
@@ -190,7 +190,7 @@ public:
return true;
}
- bool GossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF)
{
@@ -215,7 +215,7 @@ class npc_elder_kuruti : public CreatureScript
public:
npc_elder_kuruti() : CreatureScript("npc_elder_kuruti") { }
- bool GossipHello(Player* pPlayer, Creature* pCreature)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestStatus(9803) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
@@ -225,7 +225,7 @@ public:
return true;
}
- bool GossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
switch (uiAction)
{
@@ -267,7 +267,7 @@ class npc_mortog_steamhead : public CreatureScript
public:
npc_mortog_steamhead() : CreatureScript("npc_mortog_steamhead") { }
- bool GossipHello(Player* pPlayer, Creature* pCreature)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isVendor() && pPlayer->GetReputationRank(942) == REP_EXALTED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
@@ -277,7 +277,7 @@ public:
return true;
}
- bool GossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_TRADE)
{
@@ -350,19 +350,19 @@ public:
}
};
- bool QuestAccept(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
+ bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
if (pQuest->GetQuestId() == QUEST_ESCAPE_FROM)
{
DoScriptText(SAY_START, pCreature, pPlayer);
- if (npc_escortAI* pEscortAI = CAST_AI(npc_kayra_longmaneAI, pCreature->AI()))
+ if (npc_escortAI* pEscortAI = CAST_AI(npc_kayra_longmane::npc_kayra_longmaneAI, pCreature->AI()))
pEscortAI->Start(false, false, pPlayer->GetGUID());
}
return true;
}
- CreatureAI* GetAI(Creature* pCreature)
+ CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_kayra_longmaneAI(pCreature);
}
@@ -385,7 +385,7 @@ class npc_timothy_daniels : public CreatureScript
public:
npc_timothy_daniels() : CreatureScript("npc_timothy_daniels") { }
- bool GossipHello(Player* pPlayer, Creature* pCreature)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
@@ -398,7 +398,7 @@ public:
return true;
}
- bool GossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
switch(uiAction)
{