diff --git a/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp b/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp
index 56b5908f6ca..117121d8530 100644
--- a/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp
+++ b/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp
@@ -1,44 +1,44 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Areatrigger_Scripts
-SD%Complete: 100
-SDComment: Scripts for areatriggers
-SDCategory: Areatrigger
-EndScriptData */
-
-/* ContentData
-at_test script test only
-EndContentData */
-
-#include "precompiled.h"
-
-bool ATtest(Player *player, AreaTriggerEntry *at)
-{
- player->Say("Hi!",LANG_UNIVERSAL);
- return true;
-}
-
-void AddSC_areatrigger_scripts()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="at_test";
- newscript->pAreaTrigger = ATtest;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Areatrigger_Scripts
+SD%Complete: 100
+SDComment: Scripts for areatriggers
+SDCategory: Areatrigger
+EndScriptData */
+
+/* ContentData
+at_test script test only
+EndContentData */
+
+#include "precompiled.h"
+
+bool ATtest(Player *player, AreaTriggerEntry *at)
+{
+ player->Say("Hi!",LANG_UNIVERSAL);
+ return true;
+}
+
+void AddSC_areatrigger_scripts()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="at_test";
+ newscript->pAreaTrigger = ATtest;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/boss/boss_emeriss.cpp b/src/bindings/scripts/scripts/boss/boss_emeriss.cpp
index 25e0ec976e0..99b3a845f95 100644
--- a/src/bindings/scripts/scripts/boss/boss_emeriss.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_emeriss.cpp
@@ -1,156 +1,156 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Emeriss
-SD%Complete: 90
-SDComment: Teleport function & Mark of Nature missing
-SDCategory: Bosses
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SLEEP 24777
-#define SPELL_NOXIOUSBREATH 24818
-#define SPELL_TAILSWEEP 15847
-//#define SPELL_MARKOFNATURE 25040 // Not working
-#define SPELL_VOLATILEINFECTION 24928
-#define SPELL_CORRUPTIONOFEARTH 24910
-
-struct TRINITY_DLL_DECL boss_emerissAI : public ScriptedAI
-{
- boss_emerissAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Sleep_Timer;
- uint32 NoxiousBreath_Timer;
- uint32 TailSweep_Timer;
- //uint32 MarkOfNature_Timer;
- uint32 VolatileInfection_Timer;
- uint32 CorruptionofEarth1_Timer;
- uint32 CorruptionofEarth2_Timer;
- uint32 CorruptionofEarth3_Timer;
-
- void Reset()
- {
- Sleep_Timer = 15000 + rand()%5000;
- NoxiousBreath_Timer = 8000;
- TailSweep_Timer = 4000;
- //MarkOfNature_Timer = 45000;
- VolatileInfection_Timer = 12000;
- CorruptionofEarth1_Timer = 0;
- CorruptionofEarth2_Timer = 0;
- CorruptionofEarth3_Timer = 0;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Sleep_Timer
- if (Sleep_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SLEEP);
-
- Sleep_Timer = 8000 + rand()%8000;
- }else Sleep_Timer -= diff;
-
- //NoxiousBreath_Timer
- if (NoxiousBreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
- NoxiousBreath_Timer = 14000 + rand()%6000;
- }else NoxiousBreath_Timer -= diff;
-
- //Tailsweep every 2 seconds
- if (TailSweep_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_TAILSWEEP);
-
- TailSweep_Timer = 2000;
- }else TailSweep_Timer -= diff;
-
- //MarkOfNature_Timer
- //if (MarkOfNature_Timer < diff)
- //{
- // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
- // MarkOfNature_Timer = 45000;
- //}else MarkOfNature_Timer -= diff;
-
- //VolatileInfection_Timer
- if (VolatileInfection_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_VOLATILEINFECTION);
- VolatileInfection_Timer = 7000 + rand()%5000;
- }else VolatileInfection_Timer -= diff;
-
- //CorruptionofEarth_Timer
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
- {
- if (CorruptionofEarth1_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
-
- //1 minutes for next one. Means not again with this health value
- CorruptionofEarth1_Timer = 60000;
- } else CorruptionofEarth1_Timer -= diff;
- }
-
- //CorruptionofEarth_Timer
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
- {
- if (CorruptionofEarth2_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
-
- //1 minutes for next one. Means not again with this health value
- CorruptionofEarth2_Timer = 60000;
- } else CorruptionofEarth2_Timer -= diff;
- }
-
- //CorruptionofEarth_Timer
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
- {
- if (CorruptionofEarth3_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
-
- //1 minutes for next one. Means not again with this health value
- CorruptionofEarth3_Timer = 60000;
- } else CorruptionofEarth3_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_emeriss(Creature *_Creature)
-{
- return new boss_emerissAI (_Creature);
-}
-
-void AddSC_boss_emeriss()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_emeriss";
- newscript->GetAI = GetAI_boss_emeriss;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Emeriss
+SD%Complete: 90
+SDComment: Teleport function & Mark of Nature missing
+SDCategory: Bosses
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SLEEP 24777
+#define SPELL_NOXIOUSBREATH 24818
+#define SPELL_TAILSWEEP 15847
+//#define SPELL_MARKOFNATURE 25040 // Not working
+#define SPELL_VOLATILEINFECTION 24928
+#define SPELL_CORRUPTIONOFEARTH 24910
+
+struct TRINITY_DLL_DECL boss_emerissAI : public ScriptedAI
+{
+ boss_emerissAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Sleep_Timer;
+ uint32 NoxiousBreath_Timer;
+ uint32 TailSweep_Timer;
+ //uint32 MarkOfNature_Timer;
+ uint32 VolatileInfection_Timer;
+ uint32 CorruptionofEarth1_Timer;
+ uint32 CorruptionofEarth2_Timer;
+ uint32 CorruptionofEarth3_Timer;
+
+ void Reset()
+ {
+ Sleep_Timer = 15000 + rand()%5000;
+ NoxiousBreath_Timer = 8000;
+ TailSweep_Timer = 4000;
+ //MarkOfNature_Timer = 45000;
+ VolatileInfection_Timer = 12000;
+ CorruptionofEarth1_Timer = 0;
+ CorruptionofEarth2_Timer = 0;
+ CorruptionofEarth3_Timer = 0;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Sleep_Timer
+ if (Sleep_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SLEEP);
+
+ Sleep_Timer = 8000 + rand()%8000;
+ }else Sleep_Timer -= diff;
+
+ //NoxiousBreath_Timer
+ if (NoxiousBreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
+ NoxiousBreath_Timer = 14000 + rand()%6000;
+ }else NoxiousBreath_Timer -= diff;
+
+ //Tailsweep every 2 seconds
+ if (TailSweep_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_TAILSWEEP);
+
+ TailSweep_Timer = 2000;
+ }else TailSweep_Timer -= diff;
+
+ //MarkOfNature_Timer
+ //if (MarkOfNature_Timer < diff)
+ //{
+ // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
+ // MarkOfNature_Timer = 45000;
+ //}else MarkOfNature_Timer -= diff;
+
+ //VolatileInfection_Timer
+ if (VolatileInfection_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_VOLATILEINFECTION);
+ VolatileInfection_Timer = 7000 + rand()%5000;
+ }else VolatileInfection_Timer -= diff;
+
+ //CorruptionofEarth_Timer
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
+ {
+ if (CorruptionofEarth1_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
+
+ //1 minutes for next one. Means not again with this health value
+ CorruptionofEarth1_Timer = 60000;
+ } else CorruptionofEarth1_Timer -= diff;
+ }
+
+ //CorruptionofEarth_Timer
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
+ {
+ if (CorruptionofEarth2_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
+
+ //1 minutes for next one. Means not again with this health value
+ CorruptionofEarth2_Timer = 60000;
+ } else CorruptionofEarth2_Timer -= diff;
+ }
+
+ //CorruptionofEarth_Timer
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
+ {
+ if (CorruptionofEarth3_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CORRUPTIONOFEARTH);
+
+ //1 minutes for next one. Means not again with this health value
+ CorruptionofEarth3_Timer = 60000;
+ } else CorruptionofEarth3_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_emeriss(Creature *_Creature)
+{
+ return new boss_emerissAI (_Creature);
+}
+
+void AddSC_boss_emeriss()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_emeriss";
+ newscript->GetAI = GetAI_boss_emeriss;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/boss/boss_lethon.cpp b/src/bindings/scripts/scripts/boss/boss_lethon.cpp
index 2aa40f5cb3b..2a6ab499c2d 100644
--- a/src/bindings/scripts/scripts/boss/boss_lethon.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_lethon.cpp
@@ -1,24 +1,24 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Lethon
-SD%Complete: 0
-SDComment: Place Holder
-SDCategory: Bosses
-EndScriptData */
-
-#include "precompiled.h"
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Lethon
+SD%Complete: 0
+SDComment: Place Holder
+SDCategory: Bosses
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/boss/boss_taerar.cpp b/src/bindings/scripts/scripts/boss/boss_taerar.cpp
index ee6438087b9..67d3364dd66 100644
--- a/src/bindings/scripts/scripts/boss/boss_taerar.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_taerar.cpp
@@ -1,306 +1,306 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Taerar
-SD%Complete: 90
-SDComment: Mark of Nature & Teleport NYI
-SDCategory: Bosses
-EndScriptData */
-
-#include "precompiled.h"
-
-//Spells of Taerar
-
-#define SPELL_SLEEP 24777
-#define SPELL_NOXIOUSBREATH 24818
-#define SPELL_TAILSWEEP 15847
-//#define SPELL_MARKOFNATURE 25040 // Not working
-#define SPELL_ARCANEBLAST 24857
-#define SPELL_BELLOWINGROAR 22686
-#define SPELL_SUMMONSHADE 24843
-
-//Spells of Shades of Taerar
-
-#define SPELL_POSIONCLOUD 24840
-#define SPELL_POSIONBREATH 20667
-
-struct TRINITY_DLL_DECL boss_taerarAI : public ScriptedAI
-{
- boss_taerarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Sleep_Timer;
- uint32 NoxiousBreath_Timer;
- uint32 TailSweep_Timer;
- //uint32 MarkOfNature_Timer;
- uint32 ArcaneBlast_Timer;
- uint32 BellowingRoar_Timer;
- uint32 Shades_Timer;
- uint32 Summon1_Timer;
- uint32 Summon2_Timer;
- uint32 Summon3_Timer;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
- bool Shades;
-
- void Reset()
- {
- Sleep_Timer = 15000 + rand()%5000;
- NoxiousBreath_Timer = 8000;
- TailSweep_Timer = 4000;
- //MarkOfNature_Timer = 45000;
- ArcaneBlast_Timer = 12000;
- BellowingRoar_Timer = 30000;
- Summon1_Timer = 0;
- Summon2_Timer = 0;
- Summon3_Timer = 0;
- Shades_Timer = 60000; //The time that Taerar is banished
- Shades = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonShades(Unit* victim)
- {
- Rand = rand()%15;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%15;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(15302, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (Shades && Shades_Timer < diff)
- {
- //Become unbanished again
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->m_canMove = true;
- Shades = false;
- } else if (Shades)
- {
- Shades_Timer -= diff;
- //Do nothing while banished
- return;
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Sleep_Timer
- if (Sleep_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_SLEEP);
-
- Sleep_Timer = 8000 + rand()%7000;
- }else Sleep_Timer -= diff;
-
- //NoxiousBreath_Timer
- if (NoxiousBreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
- NoxiousBreath_Timer = 14000 + rand()%6000;
- } else NoxiousBreath_Timer -= diff;
-
- //Tailsweep every 2 seconds
- if (TailSweep_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_TAILSWEEP);
-
- TailSweep_Timer = 2000;
- }else TailSweep_Timer -= diff;
-
- //MarkOfNature_Timer
- //if (MarkOfNature_Timer < diff)
- //{
- // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
- // MarkOfNature_Timer = 45000;
- //}else MarkOfNature_Timer -= diff;
-
- //ArcaneBlast_Timer
- if (ArcaneBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANEBLAST);
- ArcaneBlast_Timer = 7000 + rand()%5000;
- }else ArcaneBlast_Timer -= diff;
-
- //BellowingRoar_Timer
- if (BellowingRoar_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR);
- BellowingRoar_Timer = 20000 + rand()%10000;
- } else BellowingRoar_Timer -= diff;
-
- //Summon 3 Shades
- if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
- {
- if (Summon1_Timer < diff)
- {
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->m_canMove = false;
-
- //Cast
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonShades(target);
- SummonShades(target);
- SummonShades(target);
- Summon1_Timer = 120000;
- Shades = true;
- Shades_Timer = 60000;
- } else Summon1_Timer -= diff;
- }
-
- //Summon 3 Shades
- if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
- {
- if (Summon2_Timer < diff)
- {
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->m_canMove = false;
-
- //Cast
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonShades(target);
- SummonShades(target);
- SummonShades(target);
- Summon2_Timer = 120000;
- Shades = true;
- Shades_Timer = 60000;
- } else Summon2_Timer -= diff;
- }
-
- //Summon 3 Shades
- if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
- {
- if (Summon3_Timer < diff)
- {
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->setFaction(35);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->m_canMove = false;
-
- //Cast
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonShades(target);
- SummonShades(target);
- SummonShades(target);
- Summon3_Timer = 120000;
- Shades = true;
- Shades_Timer = 60000;
- } else Summon3_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-// Shades of Taerar Script
-
-struct TRINITY_DLL_DECL boss_shadeoftaerarAI : public ScriptedAI
-{
- boss_shadeoftaerarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 PoisonCloud_Timer;
- uint32 PosionBreath_Timer;
-
- void Reset()
- {
- PoisonCloud_Timer = 8000;
- PosionBreath_Timer = 12000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //PoisonCloud_Timer
- if (PoisonCloud_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_POSIONCLOUD);
- PoisonCloud_Timer = 30000;
- }else PoisonCloud_Timer -= diff;
-
- //PosionBreath_Timer
- if (PosionBreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_POSIONBREATH);
- PosionBreath_Timer = 12000;
- }else PosionBreath_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_taerar(Creature *_Creature)
-{
- return new boss_taerarAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_shadeoftaerar(Creature *_Creature)
-{
- return new boss_shadeoftaerarAI (_Creature);
-}
-
-void AddSC_boss_taerar()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_taerar";
- newscript->GetAI = GetAI_boss_taerar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_shade_of_taerar";
- newscript->GetAI = GetAI_boss_shadeoftaerar;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Taerar
+SD%Complete: 90
+SDComment: Mark of Nature & Teleport NYI
+SDCategory: Bosses
+EndScriptData */
+
+#include "precompiled.h"
+
+//Spells of Taerar
+
+#define SPELL_SLEEP 24777
+#define SPELL_NOXIOUSBREATH 24818
+#define SPELL_TAILSWEEP 15847
+//#define SPELL_MARKOFNATURE 25040 // Not working
+#define SPELL_ARCANEBLAST 24857
+#define SPELL_BELLOWINGROAR 22686
+#define SPELL_SUMMONSHADE 24843
+
+//Spells of Shades of Taerar
+
+#define SPELL_POSIONCLOUD 24840
+#define SPELL_POSIONBREATH 20667
+
+struct TRINITY_DLL_DECL boss_taerarAI : public ScriptedAI
+{
+ boss_taerarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Sleep_Timer;
+ uint32 NoxiousBreath_Timer;
+ uint32 TailSweep_Timer;
+ //uint32 MarkOfNature_Timer;
+ uint32 ArcaneBlast_Timer;
+ uint32 BellowingRoar_Timer;
+ uint32 Shades_Timer;
+ uint32 Summon1_Timer;
+ uint32 Summon2_Timer;
+ uint32 Summon3_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+ bool Shades;
+
+ void Reset()
+ {
+ Sleep_Timer = 15000 + rand()%5000;
+ NoxiousBreath_Timer = 8000;
+ TailSweep_Timer = 4000;
+ //MarkOfNature_Timer = 45000;
+ ArcaneBlast_Timer = 12000;
+ BellowingRoar_Timer = 30000;
+ Summon1_Timer = 0;
+ Summon2_Timer = 0;
+ Summon3_Timer = 0;
+ Shades_Timer = 60000; //The time that Taerar is banished
+ Shades = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonShades(Unit* victim)
+ {
+ Rand = rand()%15;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%15;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(15302, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (Shades && Shades_Timer < diff)
+ {
+ //Become unbanished again
+ m_creature->setFaction(14);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->m_canMove = true;
+ Shades = false;
+ } else if (Shades)
+ {
+ Shades_Timer -= diff;
+ //Do nothing while banished
+ return;
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Sleep_Timer
+ if (Sleep_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_SLEEP);
+
+ Sleep_Timer = 8000 + rand()%7000;
+ }else Sleep_Timer -= diff;
+
+ //NoxiousBreath_Timer
+ if (NoxiousBreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
+ NoxiousBreath_Timer = 14000 + rand()%6000;
+ } else NoxiousBreath_Timer -= diff;
+
+ //Tailsweep every 2 seconds
+ if (TailSweep_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_TAILSWEEP);
+
+ TailSweep_Timer = 2000;
+ }else TailSweep_Timer -= diff;
+
+ //MarkOfNature_Timer
+ //if (MarkOfNature_Timer < diff)
+ //{
+ // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
+ // MarkOfNature_Timer = 45000;
+ //}else MarkOfNature_Timer -= diff;
+
+ //ArcaneBlast_Timer
+ if (ArcaneBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANEBLAST);
+ ArcaneBlast_Timer = 7000 + rand()%5000;
+ }else ArcaneBlast_Timer -= diff;
+
+ //BellowingRoar_Timer
+ if (BellowingRoar_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR);
+ BellowingRoar_Timer = 20000 + rand()%10000;
+ } else BellowingRoar_Timer -= diff;
+
+ //Summon 3 Shades
+ if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
+ {
+ if (Summon1_Timer < diff)
+ {
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->setFaction(35);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->m_canMove = false;
+
+ //Cast
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonShades(target);
+ SummonShades(target);
+ SummonShades(target);
+ Summon1_Timer = 120000;
+ Shades = true;
+ Shades_Timer = 60000;
+ } else Summon1_Timer -= diff;
+ }
+
+ //Summon 3 Shades
+ if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
+ {
+ if (Summon2_Timer < diff)
+ {
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->setFaction(35);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->m_canMove = false;
+
+ //Cast
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonShades(target);
+ SummonShades(target);
+ SummonShades(target);
+ Summon2_Timer = 120000;
+ Shades = true;
+ Shades_Timer = 60000;
+ } else Summon2_Timer -= diff;
+ }
+
+ //Summon 3 Shades
+ if ( !Shades && (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
+ {
+ if (Summon3_Timer < diff)
+ {
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->setFaction(35);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->m_canMove = false;
+
+ //Cast
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonShades(target);
+ SummonShades(target);
+ SummonShades(target);
+ Summon3_Timer = 120000;
+ Shades = true;
+ Shades_Timer = 60000;
+ } else Summon3_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+// Shades of Taerar Script
+
+struct TRINITY_DLL_DECL boss_shadeoftaerarAI : public ScriptedAI
+{
+ boss_shadeoftaerarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 PoisonCloud_Timer;
+ uint32 PosionBreath_Timer;
+
+ void Reset()
+ {
+ PoisonCloud_Timer = 8000;
+ PosionBreath_Timer = 12000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //PoisonCloud_Timer
+ if (PoisonCloud_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POSIONCLOUD);
+ PoisonCloud_Timer = 30000;
+ }else PoisonCloud_Timer -= diff;
+
+ //PosionBreath_Timer
+ if (PosionBreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_POSIONBREATH);
+ PosionBreath_Timer = 12000;
+ }else PosionBreath_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_taerar(Creature *_Creature)
+{
+ return new boss_taerarAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_shadeoftaerar(Creature *_Creature)
+{
+ return new boss_shadeoftaerarAI (_Creature);
+}
+
+void AddSC_boss_taerar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_taerar";
+ newscript->GetAI = GetAI_boss_taerar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_shade_of_taerar";
+ newscript->GetAI = GetAI_boss_shadeoftaerar;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/boss/boss_ysondre.cpp b/src/bindings/scripts/scripts/boss/boss_ysondre.cpp
index 19513f552b2..3df1746bd76 100644
--- a/src/bindings/scripts/scripts/boss/boss_ysondre.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_ysondre.cpp
@@ -1,246 +1,246 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Ysondre
-SD%Complete: 90
-SDComment: Mark of Nature & Teleport missing
-SDCategory: Bosses
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SLEEP 24777
-#define SPELL_NOXIOUSBREATH 24818
-#define SPELL_TAILSWEEP 15847
-//#define SPELL_MARKOFNATURE 25040 // Not working
-#define SPELL_LIGHTNINGWAVE 24819
-#define SPELL_SUMMONDRUIDS 24795
-
-//druid spells
-#define SPELL_MOONFIRE 21669
-
-// Ysondre script
-struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI
-{
- boss_ysondreAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Sleep_Timer;
- uint32 NoxiousBreath_Timer;
- uint32 TailSweep_Timer;
- //uint32 MarkOfNature_Timer;
- uint32 LightningWave_Timer;
- uint32 SummonDruids1_Timer;
- uint32 SummonDruids2_Timer;
- uint32 SummonDruids3_Timer;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- Sleep_Timer = 15000 + rand()%5000;
- NoxiousBreath_Timer = 8000;
- TailSweep_Timer = 4000;
- //MarkOfNature_Timer = 45000;
- LightningWave_Timer = 12000;
- SummonDruids1_Timer = 0;
- SummonDruids2_Timer = 0;
- SummonDruids3_Timer = 0;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonDruids(Unit* victim)
- {
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(15260, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Sleep_Timer
- if (Sleep_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SLEEP);
-
- Sleep_Timer = 8000 + rand()%7000;
- }else Sleep_Timer -= diff;
-
- //NoxiousBreath_Timer
- if (NoxiousBreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
- NoxiousBreath_Timer = 14000 + rand()%6000;
- }else NoxiousBreath_Timer -= diff;
-
- //Tailsweep every 2 seconds
- if (TailSweep_Timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_TAILSWEEP);
-
- TailSweep_Timer = 2000;
- }else TailSweep_Timer -= diff;
-
- //MarkOfNature_Timer
- //if (MarkOfNature_Timer < diff)
- //{
- // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
- // MarkOfNature_Timer = 45000;
- //}else MarkOfNature_Timer -= diff;
-
- //LightningWave_Timer
- if (LightningWave_Timer < diff)
- {
- //Cast LIGHTNINGWAVE on a Random target
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_LIGHTNINGWAVE);
-
- LightningWave_Timer = 7000 + rand()%5000;
- }else LightningWave_Timer -= diff;
-
- //Summon Druids
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
- {
- if (SummonDruids1_Timer < diff)
- {
- // summon 10 druids
- Unit* target = NULL;
- for(int i = 0; i < 10;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonDruids(target);
- }
-
- SummonDruids1_Timer = 60000;
- } else SummonDruids1_Timer -= diff;
- }
-
- //Summon Druids
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
- {
- if (SummonDruids2_Timer < diff)
- {
- // summon 10 druids
- Unit* target = NULL;
- for(int i = 0; i < 10;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonDruids(target);
- }
-
- SummonDruids2_Timer = 60000;
- } else SummonDruids2_Timer -= diff;
- }
-
- //Summon Druids
- if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
- {
- if (SummonDruids3_Timer < diff)
- {
- // summon 10 druids
- Unit* target = NULL;
- for(int i = 0; i < 10;i++)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- SummonDruids(target);
- }
-
- SummonDruids3_Timer = 60000;
- } else SummonDruids3_Timer -= diff;
- }
- DoMeleeAttackIfReady();
- }
-};
-// Summoned druid script
-struct TRINITY_DLL_DECL mob_dementeddruidsAI : public ScriptedAI
-{
- mob_dementeddruidsAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MoonFire_Timer;
-
- void Reset()
- {
- MoonFire_Timer = 3000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //MoonFire_Timer
- if (MoonFire_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MOONFIRE);
- MoonFire_Timer = 5000;
- }else MoonFire_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_ysondre(Creature *_Creature)
-{
- return new boss_ysondreAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_dementeddruids(Creature *_Creature)
-{
- return new mob_dementeddruidsAI (_Creature);
-}
-
-void AddSC_boss_ysondre()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_ysondre";
- newscript->GetAI = GetAI_boss_ysondre;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_dementeddruids";
- newscript->GetAI = GetAI_mob_dementeddruids;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Ysondre
+SD%Complete: 90
+SDComment: Mark of Nature & Teleport missing
+SDCategory: Bosses
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SLEEP 24777
+#define SPELL_NOXIOUSBREATH 24818
+#define SPELL_TAILSWEEP 15847
+//#define SPELL_MARKOFNATURE 25040 // Not working
+#define SPELL_LIGHTNINGWAVE 24819
+#define SPELL_SUMMONDRUIDS 24795
+
+//druid spells
+#define SPELL_MOONFIRE 21669
+
+// Ysondre script
+struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI
+{
+ boss_ysondreAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Sleep_Timer;
+ uint32 NoxiousBreath_Timer;
+ uint32 TailSweep_Timer;
+ //uint32 MarkOfNature_Timer;
+ uint32 LightningWave_Timer;
+ uint32 SummonDruids1_Timer;
+ uint32 SummonDruids2_Timer;
+ uint32 SummonDruids3_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ Sleep_Timer = 15000 + rand()%5000;
+ NoxiousBreath_Timer = 8000;
+ TailSweep_Timer = 4000;
+ //MarkOfNature_Timer = 45000;
+ LightningWave_Timer = 12000;
+ SummonDruids1_Timer = 0;
+ SummonDruids2_Timer = 0;
+ SummonDruids3_Timer = 0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonDruids(Unit* victim)
+ {
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(15260, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Sleep_Timer
+ if (Sleep_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SLEEP);
+
+ Sleep_Timer = 8000 + rand()%7000;
+ }else Sleep_Timer -= diff;
+
+ //NoxiousBreath_Timer
+ if (NoxiousBreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_NOXIOUSBREATH);
+ NoxiousBreath_Timer = 14000 + rand()%6000;
+ }else NoxiousBreath_Timer -= diff;
+
+ //Tailsweep every 2 seconds
+ if (TailSweep_Timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_TAILSWEEP);
+
+ TailSweep_Timer = 2000;
+ }else TailSweep_Timer -= diff;
+
+ //MarkOfNature_Timer
+ //if (MarkOfNature_Timer < diff)
+ //{
+ // DoCast(m_creature->getVictim(),SPELL_MARKOFNATURE);
+ // MarkOfNature_Timer = 45000;
+ //}else MarkOfNature_Timer -= diff;
+
+ //LightningWave_Timer
+ if (LightningWave_Timer < diff)
+ {
+ //Cast LIGHTNINGWAVE on a Random target
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_LIGHTNINGWAVE);
+
+ LightningWave_Timer = 7000 + rand()%5000;
+ }else LightningWave_Timer -= diff;
+
+ //Summon Druids
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 75)
+ {
+ if (SummonDruids1_Timer < diff)
+ {
+ // summon 10 druids
+ Unit* target = NULL;
+ for(int i = 0; i < 10;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonDruids(target);
+ }
+
+ SummonDruids1_Timer = 60000;
+ } else SummonDruids1_Timer -= diff;
+ }
+
+ //Summon Druids
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 50)
+ {
+ if (SummonDruids2_Timer < diff)
+ {
+ // summon 10 druids
+ Unit* target = NULL;
+ for(int i = 0; i < 10;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonDruids(target);
+ }
+
+ SummonDruids2_Timer = 60000;
+ } else SummonDruids2_Timer -= diff;
+ }
+
+ //Summon Druids
+ if ( (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5) == 25)
+ {
+ if (SummonDruids3_Timer < diff)
+ {
+ // summon 10 druids
+ Unit* target = NULL;
+ for(int i = 0; i < 10;i++)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ SummonDruids(target);
+ }
+
+ SummonDruids3_Timer = 60000;
+ } else SummonDruids3_Timer -= diff;
+ }
+ DoMeleeAttackIfReady();
+ }
+};
+// Summoned druid script
+struct TRINITY_DLL_DECL mob_dementeddruidsAI : public ScriptedAI
+{
+ mob_dementeddruidsAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MoonFire_Timer;
+
+ void Reset()
+ {
+ MoonFire_Timer = 3000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //MoonFire_Timer
+ if (MoonFire_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MOONFIRE);
+ MoonFire_Timer = 5000;
+ }else MoonFire_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_ysondre(Creature *_Creature)
+{
+ return new boss_ysondreAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_dementeddruids(Creature *_Creature)
+{
+ return new mob_dementeddruidsAI (_Creature);
+}
+
+void AddSC_boss_ysondre()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_ysondre";
+ newscript->GetAI = GetAI_boss_ysondre;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_dementeddruids";
+ newscript->GetAI = GetAI_mob_dementeddruids;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
index 4d9421d645c..4086430ae74 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
@@ -1,1377 +1,1377 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Mob_Event_AI
-SD%Complete: 90
-SDComment: Database Event AI
-SDCategory: Creatures
-EndScriptData */
-
-#include "precompiled.h"
-#include "mob_event_ai.h"
-
-#define EVENT_UPDATE_TIME 500
-#define SPELL_RUN_AWAY 8225
-
-struct EventHolder
-{
- EventHolder(EventAI_Event p) : Event(p), Time(0), Enabled(true){}
-
- EventAI_Event Event;
- uint32 Time;
- bool Enabled;
-};
-
-struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
-{
- Mob_EventAI(Creature *c, std::list pEventList) : ScriptedAI(c)
- {
- EventList = pEventList;
- Phase = 0;
- CombatMovementEnabled = true;
- MeleeEnabled = true;
- AttackDistance = 0;
- AttackAngle = 0.0f;
-
- //Handle Spawned Events
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_SPAWNED:
- ProcessEvent(*i);
- break;
- }
- }
-
- Reset();
- }
-
- ~Mob_EventAI()
- {
- EventList.clear();
- }
-
- //Variables used by EventAI for handling events
- std::list EventList; //Holder for events (stores enabled, time, and eventid)
- uint32 EventUpdateTime; //Time between event updates
- uint32 EventDiff; //Time between the last event call
-
- //Variables used by Events themselves
- uint8 Phase; //Current phase, max 32 phases
- bool CombatMovementEnabled; //If we allow targeted movment gen (movement twoards top threat)
- bool MeleeEnabled; //If we allow melee auto attack
- uint32 AttackDistance; //Distance to attack from
- float AttackAngle; //Angle of attack
- uint32 TimetoFleeLeft; //For fleeing
-
- bool ProcessEvent(EventHolder& pHolder, Unit* pActionInvoker = NULL)
- {
- if (!pHolder.Enabled || pHolder.Time)
- return false;
-
- //Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask)
- if (pHolder.Event.event_inverse_phase_mask & (1 << Phase))
- return false;
-
- //Store random here so that all random actions match up
- uint32 rnd = rand();
-
- //Return if chance for event is not met
- if (pHolder.Event.event_chance <= rnd % 100)
- return false;
-
- union
- {
- uint32 param1;
- int32 param1_s;
- };
-
- union
- {
- uint32 param2;
- int32 param2_s;
- };
-
- union
- {
- uint32 param3;
- int32 param3_s;
- };
-
- union
- {
- uint32 param4;
- int32 param4_s;
- };
-
- param1 = pHolder.Event.event_param1;
- param2 = pHolder.Event.event_param2;
- param3 = pHolder.Event.event_param3;
- param4 = pHolder.Event.event_param4;
-
- //Check event conditions based on the event type, also reset events
- switch (pHolder.Event.event_type)
- {
- case EVENT_T_TIMER:
- {
- if (!InCombat)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_TIMER_OOC:
- {
- if (InCombat)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_HP:
- {
- if (!InCombat || !m_creature->GetMaxHealth())
- return false;
-
- uint32 perc = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
-
- if (perc > param1 || perc < param2)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_MANA:
- {
- if (!InCombat || !m_creature->GetMaxPower(POWER_MANA))
- return false;
-
- uint32 perc = (m_creature->GetPower(POWER_MANA)*100) / m_creature->GetMaxPower(POWER_MANA);
-
- if (perc > param1 || perc < param2)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_AGGRO:
- {
- }
- break;
- case EVENT_T_KILL:
- {
- //Repeat Timers
- if (param1 == param2)
- {
- pHolder.Time = param1;
-
- }else if (param2 > param1)
- pHolder.Time = urand(param1, param2);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- case EVENT_T_DEATH:
- {
- }
- break;
- case EVENT_T_EVADE:
- {
- }
- break;
- case EVENT_T_SPELLHIT:
- {
- //Spell hit is special case, param1 and param2 handled within EventAI::SpellHit
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_RANGE:
- {
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_OOC_LOS:
- {
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_SPAWNED:
- {
- }
- break;
- case EVENT_T_TARGET_HP:
- {
- if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxHealth())
- return false;
-
- uint32 perc = (m_creature->getVictim()->GetHealth()*100) / m_creature->getVictim()->GetMaxHealth();
-
- if (perc > param1 || perc < param2)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_TARGET_CASTING:
- {
- if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true))
- return false;
-
- //Repeat Timers
- if (param1 == param2)
- {
- pHolder.Time = param1;
-
- }else if (param2 > param1)
- pHolder.Time = urand(param1, param2);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_FRIENDLY_HP:
- {
- if (!InCombat)
- return false;
-
- Unit* pUnit = DoSelectLowestHpFriendly(param2, param1);
-
- if (!pUnit)
- return false;
-
- pActionInvoker = pUnit;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_FRIENDLY_IS_CC:
- {
- if (!InCombat)
- return false;
-
- std::list pList = DoFindFriendlyCC(param2);
-
- //List is empty
- if (pList.empty())
- return false;
-
- //We don't really care about the whole list, just return first available
- pActionInvoker = *(pList.begin());
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_FRIENDLY_MISSING_BUFF:
- {
- std::list pList = DoFindFriendlyMissingBuff(param2, param1);
-
- //List is empty
- if (pList.empty())
- return false;
-
- //We don't really care about the whole list, just return first available
- pActionInvoker = *(pList.begin());
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_SUMMONED_UNIT:
- {
- //Prevent event from occuring on no unit or non creatures
- if (!pActionInvoker || pActionInvoker->GetTypeId()!=TYPEID_UNIT)
- return false;
-
- //Creature id doesn't match up
- if (param1 && ((Creature*)pActionInvoker)->GetEntry() != param1)
- return false;
-
- //Repeat Timers
- if (param2 == param3)
- {
- pHolder.Time = param2;
-
- }else if (param3 > param2)
- pHolder.Time = urand(param2, param3);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- default:
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- break;
- }
-
- //Disable non-repeatable events
- if (!(pHolder.Event.event_flags & EFLAG_REPEATABLE))
- pHolder.Enabled = false;
-
- //Process actions
- for (uint32 j = 0; j < MAX_ACTIONS; j++)
- ProcessAction(pHolder.Event.action[j].type, pHolder.Event.action[j].param1, pHolder.Event.action[j].param2, pHolder.Event.action[j].param3, rnd, pHolder.Event.event_id, pActionInvoker);
-
- return true;
- }
-
- inline uint32 GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3)
- {
- switch (rnd % 3)
- {
- case 0:
- return param1;
- break;
- case 1:
- return param2;
- break;
- case 2:
- return param3;
- break;
- }
- return 0;
- }
-
- inline Unit* GetTargetByType(uint32 Target, Unit* pActionInvoker)
- {
- switch (Target)
- {
- case TARGET_T_SELF:
- return m_creature;
- break;
- case TARGET_T_HOSTILE:
- return m_creature->getVictim();
- break;
- case TARGET_T_HOSTILE_SECOND_AGGRO:
- return SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- break;
- case TARGET_T_HOSTILE_LAST_AGGRO:
- return SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
- break;
- case TARGET_T_HOSTILE_RANDOM:
- return SelectUnit(SELECT_TARGET_RANDOM,0);
- break;
- case TARGET_T_HOSTILE_RANDOM_NOT_TOP:
- return SelectUnit(SELECT_TARGET_RANDOM,1);
- break;
- case TARGET_T_ACTION_INVOKER:
- return pActionInvoker;
- break;
- default:
- return NULL;
- break;
- };
- }
-
- void ProcessAction(uint16 type, uint32 param1, uint32 param2, uint32 param3, uint32 rnd, uint32 EventId, Unit* pActionInvoker)
- {
- switch (type)
- {
- case ACTION_T_SAY:
- DoSay(GetEventAIText(param1), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
- break;
- case ACTION_T_YELL:
- DoYell(GetEventAIText(param1), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
- break;
- case ACTION_T_TEXTEMOTE:
- DoTextEmote(GetEventAIText(param1), pActionInvoker ? pActionInvoker : m_creature->getVictim());
- break;
- case ACTION_T_SOUND:
- DoPlaySoundToSet(m_creature, param1);
- break;
- case ACTION_T_EMOTE:
- m_creature->HandleEmoteCommand(param1);
- break;
- case ACTION_T_RANDOM_SAY:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- DoSay(GetEventAIText(temp), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
- }
- break;
- case ACTION_T_RANDOM_YELL:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- DoYell(GetEventAIText(temp), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
- }
- break;
- case ACTION_T_RANDOM_TEXTEMOTE:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- DoTextEmote(GetEventAIText(temp), pActionInvoker ? pActionInvoker : m_creature->getVictim());
- }
- break;
- case ACTION_T_RANDOM_SOUND:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- DoPlaySoundToSet(m_creature, temp);
- }
- break;
- case ACTION_T_RANDOM_EMOTE:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- m_creature->HandleEmoteCommand(temp);
- }
- break;
- case ACTION_T_CAST:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
- Unit* caster = m_creature;
-
- if (!target)
- return;
-
- //Cast is always triggered if target is forced to cast on self
- if (param3 & CAST_FORCE_TARGET_SELF)
- {
- param3 |= CAST_TRIGGERED;
- caster = target;
- }
-
- //Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered
- bool canCast = !(caster->IsNonMeleeSpellCasted(false) && (param3 & CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS));
-
- // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them
- if(param3 & CAST_AURA_NOT_PRESENT)
- {
- for(uint8 i = 0; i < 3; ++i)
- if(target->HasAura(param1, i))
- return;
- }
-
- if (canCast)
- {
- const SpellEntry* tSpell = GetSpellStore()->LookupEntry(param1);
-
- //Verify that spell exists
- if (tSpell)
- {
- //Check if cannot cast spell
- if (!(param3 & (CAST_FORCE_TARGET_SELF | CAST_FORCE_CAST)) &&
- !CanCast(target, tSpell, (param3 & CAST_TRIGGERED)))
- {
- //Melee current victim if flag not set
- if (!(param3 & CAST_NO_MELEE_IF_OOM))
- {
- AttackDistance = 0;
- AttackAngle = 0;
-
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
- }
-
- }else
- {
- //Interrupt any previous spell
- if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS)
- caster->InterruptNonMeleeSpells(false);
-
- caster->CastSpell(target, param1, (param3 & CAST_TRIGGERED));
- }
-
- }else if (EAI_ErrorLevel > 0)
- error_db_log("SD2: EventAI event %d creature %d attempt to cast spell that doesn't exist %d", EventId, m_creature->GetEntry(), param1);
- }
- }
- break;
- case ACTION_T_SUMMON:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- Creature* pCreature = NULL;
-
- if (param3)
- pCreature = DoSpawnCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, param3);
- else pCreature = pCreature = DoSpawnCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
-
- if (!pCreature)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: EventAI failed to spawn creature %u. Spawn event %d is on creature %d", param1, EventId, m_creature->GetEntry());
- }
- else if (param2 != TARGET_T_SELF && target)
- pCreature->AI()->AttackStart(target);
- }
- break;
- case ACTION_T_THREAT_SINGLE_PCT:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target)
- m_creature->getThreatManager().modifyThreatPercent(target, param1);
- }
- break;
- case ACTION_T_THREAT_ALL_PCT:
- {
- Unit* Temp = NULL;
-
- std::list::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Temp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
- if (Temp)
- m_creature->getThreatManager().modifyThreatPercent(Temp, param1);
- }
- }
- break;
- case ACTION_T_QUEST_EVENT:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)target)->AreaExploredOrEventHappens(param1);
- }
- break;
- case ACTION_T_CASTCREATUREGO:
- {
- Unit* target = GetTargetByType(param3, pActionInvoker);
-
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)target)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
- }
- break;
- case ACTION_T_SET_UNIT_FIELD:
- {
- Unit* target = GetTargetByType(param3, pActionInvoker);
-
- if (target)
- target->SetUInt32Value(param1, param2);
- }
- break;
- case ACTION_T_SET_UNIT_FLAG:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target)
- target->SetFlag(UNIT_FIELD_FLAGS, param1);
- }
- break;
- case ACTION_T_REMOVE_UNIT_FLAG:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target)
- target->RemoveFlag(UNIT_FIELD_FLAGS, param1);
- }
- break;
- case ACTION_T_AUTO_ATTACK:
- {
- if (param1)
- MeleeEnabled = true;
- else MeleeEnabled = false;
- }
- break;
- case ACTION_T_COMBAT_MOVEMENT:
- {
- CombatMovementEnabled = param1;
-
- //Allow movement (create new targeted movement gen if none exist already)
- if (CombatMovementEnabled)
- {
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
- }
- }
- else
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->StopMoving();
- }
- }
- break;
- case ACTION_T_SET_PHASE:
- {
- Phase = param1;
- }
- break;
- case ACTION_T_INC_PHASE:
- {
- Phase += param1;
-
- if (Phase > 31)
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: Event %d incremented Phase above 31. Phase mask cannot be used with phases past 31. CreatureEntry = %d", EventId, m_creature->GetEntry());
- }
- break;
- case ACTION_T_EVADE:
- {
- EnterEvadeMode();
- }
- break;
- case ACTION_T_FLEE:
- {
- TimetoFleeLeft = 8000;
- m_creature->DoFleeToGetAssistance();
- IsFleeing = true;
- }
- break;
- case ACTION_T_QUEST_EVENT_ALL:
- {
- Unit* Temp = NULL;
- if( pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER )
- {
- Temp = Unit::GetUnit((*m_creature),pActionInvoker->GetGUID());
- if( Temp )
- ((Player*)Temp)->GroupEventHappens(param1,m_creature);
- }
- }
- break;
- case ACTION_T_CASTCREATUREGO_ALL:
- {
- Unit* Temp = NULL;
-
- std::list::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Temp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
- if (Temp && Temp->GetTypeId() == TYPEID_PLAYER)
- ((Player*)Temp)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
- }
- }
- break;
- case ACTION_T_REMOVEAURASFROMSPELL:
- {
- Unit* target = GetTargetByType(param1, pActionInvoker);
-
- if (target)
- target->RemoveAurasDueToSpell(param2);
- }
- break;
- case ACTION_T_RANGED_MOVEMENT:
- {
- AttackDistance = param1;
- AttackAngle = ((float)param2/180)*M_PI;
-
- if (CombatMovementEnabled)
- {
- //Drop current movement gen
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
- }
- }
- break;
- case ACTION_T_RANDOM_PHASE:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- Phase = temp;
- }
- break;
- case ACTION_T_RANDOM_PHASE_RANGE:
- {
- if (param2 > param1)
- {
- Phase = param1 + (rnd % (param2 - param1));
- }
- else if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 <= Param1. Divide by Zero. Event = %d. CreatureEntry = %d", EventId, m_creature->GetEntry());
- }
- break;
- case ACTION_T_SUMMON_ID:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- //Duration
- Creature* pCreature = NULL;
-
- HM_NAMESPACE::hash_map::iterator i = EventAI_Summon_Map.find(param3);
-
- if (i == EventAI_Summon_Map.end())
- {
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: EventAI failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", param1, param3, EventId, m_creature->GetEntry());
- return;
- }
-
- if ((*i).second.SpawnTimeSecs)
- pCreature = m_creature->SummonCreature(param1, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, (*i).second.SpawnTimeSecs);
- else pCreature = m_creature->SummonCreature(param1, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
-
- if (!pCreature)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: EventAI failed to spawn creature %u. EventId %d.Creature %d", param1, EventId, m_creature->GetEntry());
- }
- else if (param2 != TARGET_T_SELF && target)
- pCreature->AI()->AttackStart(target);
- }
- break;
- case ACTION_T_KILLED_MONSTER:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)target)->KilledMonster(param1, m_creature->GetGUID());
- }
- break;
- case ACTION_T_SET_INST_DATA:
- {
- ScriptedInstance* pInst = (ScriptedInstance*)m_creature->GetInstanceData();
- if (!pInst)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d attempt to set instance data without instance script. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- pInst->SetData(param1, param2);
- }
- break;
- case ACTION_T_SET_INST_DATA64:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (!target)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- ScriptedInstance* pInst = (ScriptedInstance*)m_creature->GetInstanceData();
-
- if (!pInst)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- pInst->SetData64(param1, target->GetGUID());
- }
- break;
- case ACTION_T_UPDATE_TEMPLATE:
- {
- if (m_creature->GetEntry() == param1)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- m_creature->UpdateEntry(param1, param2 ? HORDE : ALLIANCE);
- }
- break;
- case ACTION_T_DIE:
- {
- if (m_creature->isDead())
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
- m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- break;
- case ACTION_T_ZONE_COMBAT_PULSE:
- {
- if (!m_creature->isInCombat() || !m_creature->GetMap()->IsDungeon())
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d ACTION_T_ZONE_COMBAT_PULSE on creature out of combat or in non-dungeon map. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- DoZoneInCombat();
- }
- break;
- }
- }
-
- void JustRespawned()
- {
- InCombat = false;
- IsFleeing = false;
- Reset();
-
- //Handle Spawned Events
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_SPAWNED:
- ProcessEvent(*i);
- break;
- }
- }
- }
-
- void Reset()
- {
- EventUpdateTime = EVENT_UPDATE_TIME;
- EventDiff = 0;
-
- //Handle Evade events and reset all events to enabled
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Reset all out of combat timers
- case EVENT_T_TIMER_OOC:
- {
- if ((*i).Event.event_param2 == (*i).Event.event_param1)
- {
- (*i).Time = (*i).Event.event_param1;
- (*i).Enabled = true;
- }else if ((*i).Event.event_param2 > (*i).Event.event_param1)
- {
- (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
- (*i).Enabled = true;
- }else if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
- }
- break;
- //default:
- //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro()
- //(*i).Enabled = true;
- //(*i).Time = 0;
- //break;
- }
- }
- }
-
- void EnterEvadeMode()
- {
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- m_creature->LoadCreaturesAddon();
- if( m_creature->isAlive() )
- m_creature->GetMotionMaster()->MoveTargetedHome();
-
- m_creature->SetLootRecipient(NULL);
-
- InCombat = false;
- IsFleeing = false;
- Reset();
-
- //Handle Evade events
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Evade
- case EVENT_T_EVADE:
- ProcessEvent(*i);
- break;
- }
- }
- }
-
- void JustDied(Unit* killer)
- {
- InCombat = false;
- IsFleeing = false;
- Reset();
-
- //Handle Evade events
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Evade
- case EVENT_T_DEATH:
- ProcessEvent(*i, killer);
- break;
- }
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- if (victim->GetTypeId() != TYPEID_PLAYER)
- return;
-
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Kill
- case EVENT_T_KILL:
- ProcessEvent(*i, victim);
- break;
- }
- }
-
- }
-
- void JustSummoned(Creature* pUnit)
- {
- if (!pUnit)
- return;
-
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Summoned
- case EVENT_T_SUMMONED_UNIT:
- ProcessEvent(*i, pUnit);
- break;
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- //Check for on combat start events
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_AGGRO:
- (*i).Enabled = true;
- ProcessEvent(*i, who);
- break;
- //Reset all in combat timers
- case EVENT_T_TIMER:
- if ((*i).Event.event_param2 == (*i).Event.event_param1)
- {
- (*i).Time = (*i).Event.event_param1;
- (*i).Enabled = true;
- }else if ((*i).Event.event_param2 > (*i).Event.event_param1)
- {
- (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
- (*i).Enabled = true;
- }else if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
- break;
- //All normal events need to be re-enabled and their time set to 0
- default:
- (*i).Enabled = true;
- (*i).Time = 0;
- break;
- }
- }
-
- EventUpdateTime = EVENT_UPDATE_TIME;
- EventDiff = 0;
- }
-
- void AttackStart(Unit *who)
- {
- if (!who)
- return;
-
- if (m_creature->Attack(who, MeleeEnabled))
- {
- //Begin melee attack if we are within range
- m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
-
- if (CombatMovementEnabled)
- {
- m_creature->GetMotionMaster()->MoveChase(who, AttackDistance, AttackAngle);
- }
- else
- {
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->StopMoving();
- }
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || InCombat)
- return;
-
- //Check for OOC LOS Event
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_OOC_LOS:
- {
- if ((*i).Event.event_param1 && m_creature->IsHostileTo(who))
- break;
-
- if ((*i).Event.event_param2 && !m_creature->IsHostileTo(who))
- break;
-
- ProcessEvent(*i, who);
- }
- break;
- }
- }
-
- if (m_creature->isCivilian() && m_creature->IsNeutralToAll())
- return;
-
-
- if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- //Begin melee attack if we are within range
- AttackStart(who);
- }
- }
- }
-
- void SpellHit(Unit* pUnit, const SpellEntry* pSpell)
- {
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Spell hit
- case EVENT_T_SPELLHIT:
- {
- //If spell id matches (or no spell id) & if spell school matches (or no spell school)
- if (!(*i).Event.event_param1 || pSpell->Id == (*i).Event.event_param1)
- if ((*i).Event.event_param2_s == -1 || pSpell->SchoolMask == (*i).Event.event_param2)
- ProcessEvent(*i, pUnit);
- }
- break;
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Check if we are in combat (also updates calls threat update code)
- bool Combat = InCombat ? (m_creature->SelectHostilTarget() && m_creature->getVictim()) : false;
-
- //Must return if creature isn't alive. Normally select hostil target and get victim prevent this
- if (!m_creature->isAlive())
- return;
-
- if ((TimetoFleeLeft < diff || (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)) && IsFleeing)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->SetNoCallAssistence(false);
- m_creature->CallAssistence();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- IsFleeing = false;
- }
- else
- TimetoFleeLeft -= diff;
-
- if(IsFleeing)
- return;
-
- //Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events
- if (EventUpdateTime < diff)
- {
- EventDiff += diff;
-
- //Check for range based events
- //if (m_creature->GetDistance(m_creature->getVictim()) >
- if (Combat)
- {
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_RANGE:
- float dist = m_creature->GetDistance(m_creature->getVictim());
- if (dist > (*i).Event.event_param1 && dist < (*i).Event.event_param2)
- ProcessEvent(*i);
- break;
- }
- }
- }
-
- //Check for time based events
- for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- //Decrement Timers
- if ((*i).Time)
-
- {
- if ((*i).Time > EventDiff)
- {
- //Do not decrement timers if event cannot trigger in this phase
- if (!((*i).Event.event_inverse_phase_mask & (1 << Phase)))
- (*i).Time -= EventDiff;
- //Skip processing of events that have time remaining
- continue;
- }
- else (*i).Time = 0;
- }
-
- switch ((*i).Event.event_type)
- {
- //Events that are updated every EVENT_UPDATE_TIME
- case EVENT_T_TIMER_OOC:
- ProcessEvent(*i);
- break;
- case EVENT_T_TIMER:
- case EVENT_T_MANA:
- case EVENT_T_HP:
- case EVENT_T_TARGET_HP:
- case EVENT_T_TARGET_CASTING:
- case EVENT_T_FRIENDLY_HP:
- if( Combat )
- ProcessEvent(*i);
- break;
- }
- }
-
- EventDiff = 0;
- EventUpdateTime = EVENT_UPDATE_TIME;
- }else
- {
- EventDiff += diff;
- EventUpdateTime -= diff;
- }
-
- //Melee Auto-Attack
- if (Combat && MeleeEnabled)
- DoMeleeAttackIfReady();
-
- }
-};
-
-CreatureAI* GetAI_Mob_EventAI(Creature *_Creature)
-{
- //Select events by creature id
- std::list EventList;
- uint32 ID = _Creature->GetEntry();
-
- std::list::iterator i;
-
- for (i = EventAI_Event_List.begin(); i != EventAI_Event_List.end(); ++i)
- {
- if ((*i).creature_id == ID)
- {
-//Debug check
-#ifndef _DEBUG
- if ((*i).event_flags & EFLAG_DEBUG_ONLY)
- continue;
-#endif
- if( _Creature->GetMap()->IsDungeon() )
- {
- if( _Creature->GetMap()->IsHeroic() )
- {
- if( (*i).event_flags & EFLAG_HEROIC )
- {
- EventList.push_back(EventHolder(*i));
- continue;
- }else if( (*i).event_flags & EFLAG_NORMAL )
- continue;
- }
- else
- {
- if( (*i).event_flags & EFLAG_NORMAL )
- {
- EventList.push_back(EventHolder(*i));
- continue;
- }else if( (*i).event_flags & EFLAG_HEROIC )
- continue;
- }
-
- if (EAI_ErrorLevel > 1)
- error_db_log("SD2: Creature %u Event %u. Creature are in instance but neither EFLAG_NORMAL or EFLAG_HEROIC are set. Event Disabled.", _Creature->GetEntry(), (*i).event_id);
-
- continue;
- }
-
- EventList.push_back(EventHolder(*i));
- }
- }
-
- //EventAI is pointless to use without events and may cause crashes
- if (EventList.empty())
- {
- if (EAI_ErrorLevel > 1)
- error_db_log("SD2: Eventlist for Creature %u is empty but creature is using Mob_EventAI. Preventing EventAI on this creature.", _Creature->GetEntry());
-
- return NULL;
- }
-
- return new Mob_EventAI (_Creature, EventList);
-}
-
-void AddSC_mob_event()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="mob_eventai";
- newscript->GetAI = GetAI_Mob_EventAI;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Mob_Event_AI
+SD%Complete: 90
+SDComment: Database Event AI
+SDCategory: Creatures
+EndScriptData */
+
+#include "precompiled.h"
+#include "mob_event_ai.h"
+
+#define EVENT_UPDATE_TIME 500
+#define SPELL_RUN_AWAY 8225
+
+struct EventHolder
+{
+ EventHolder(EventAI_Event p) : Event(p), Time(0), Enabled(true){}
+
+ EventAI_Event Event;
+ uint32 Time;
+ bool Enabled;
+};
+
+struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
+{
+ Mob_EventAI(Creature *c, std::list pEventList) : ScriptedAI(c)
+ {
+ EventList = pEventList;
+ Phase = 0;
+ CombatMovementEnabled = true;
+ MeleeEnabled = true;
+ AttackDistance = 0;
+ AttackAngle = 0.0f;
+
+ //Handle Spawned Events
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_SPAWNED:
+ ProcessEvent(*i);
+ break;
+ }
+ }
+
+ Reset();
+ }
+
+ ~Mob_EventAI()
+ {
+ EventList.clear();
+ }
+
+ //Variables used by EventAI for handling events
+ std::list EventList; //Holder for events (stores enabled, time, and eventid)
+ uint32 EventUpdateTime; //Time between event updates
+ uint32 EventDiff; //Time between the last event call
+
+ //Variables used by Events themselves
+ uint8 Phase; //Current phase, max 32 phases
+ bool CombatMovementEnabled; //If we allow targeted movment gen (movement twoards top threat)
+ bool MeleeEnabled; //If we allow melee auto attack
+ uint32 AttackDistance; //Distance to attack from
+ float AttackAngle; //Angle of attack
+ uint32 TimetoFleeLeft; //For fleeing
+
+ bool ProcessEvent(EventHolder& pHolder, Unit* pActionInvoker = NULL)
+ {
+ if (!pHolder.Enabled || pHolder.Time)
+ return false;
+
+ //Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask)
+ if (pHolder.Event.event_inverse_phase_mask & (1 << Phase))
+ return false;
+
+ //Store random here so that all random actions match up
+ uint32 rnd = rand();
+
+ //Return if chance for event is not met
+ if (pHolder.Event.event_chance <= rnd % 100)
+ return false;
+
+ union
+ {
+ uint32 param1;
+ int32 param1_s;
+ };
+
+ union
+ {
+ uint32 param2;
+ int32 param2_s;
+ };
+
+ union
+ {
+ uint32 param3;
+ int32 param3_s;
+ };
+
+ union
+ {
+ uint32 param4;
+ int32 param4_s;
+ };
+
+ param1 = pHolder.Event.event_param1;
+ param2 = pHolder.Event.event_param2;
+ param3 = pHolder.Event.event_param3;
+ param4 = pHolder.Event.event_param4;
+
+ //Check event conditions based on the event type, also reset events
+ switch (pHolder.Event.event_type)
+ {
+ case EVENT_T_TIMER:
+ {
+ if (!InCombat)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_TIMER_OOC:
+ {
+ if (InCombat)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_HP:
+ {
+ if (!InCombat || !m_creature->GetMaxHealth())
+ return false;
+
+ uint32 perc = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
+
+ if (perc > param1 || perc < param2)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_MANA:
+ {
+ if (!InCombat || !m_creature->GetMaxPower(POWER_MANA))
+ return false;
+
+ uint32 perc = (m_creature->GetPower(POWER_MANA)*100) / m_creature->GetMaxPower(POWER_MANA);
+
+ if (perc > param1 || perc < param2)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_AGGRO:
+ {
+ }
+ break;
+ case EVENT_T_KILL:
+ {
+ //Repeat Timers
+ if (param1 == param2)
+ {
+ pHolder.Time = param1;
+
+ }else if (param2 > param1)
+ pHolder.Time = urand(param1, param2);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ case EVENT_T_DEATH:
+ {
+ }
+ break;
+ case EVENT_T_EVADE:
+ {
+ }
+ break;
+ case EVENT_T_SPELLHIT:
+ {
+ //Spell hit is special case, param1 and param2 handled within EventAI::SpellHit
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_RANGE:
+ {
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_OOC_LOS:
+ {
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_SPAWNED:
+ {
+ }
+ break;
+ case EVENT_T_TARGET_HP:
+ {
+ if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxHealth())
+ return false;
+
+ uint32 perc = (m_creature->getVictim()->GetHealth()*100) / m_creature->getVictim()->GetMaxHealth();
+
+ if (perc > param1 || perc < param2)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_TARGET_CASTING:
+ {
+ if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true))
+ return false;
+
+ //Repeat Timers
+ if (param1 == param2)
+ {
+ pHolder.Time = param1;
+
+ }else if (param2 > param1)
+ pHolder.Time = urand(param1, param2);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_FRIENDLY_HP:
+ {
+ if (!InCombat)
+ return false;
+
+ Unit* pUnit = DoSelectLowestHpFriendly(param2, param1);
+
+ if (!pUnit)
+ return false;
+
+ pActionInvoker = pUnit;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_FRIENDLY_IS_CC:
+ {
+ if (!InCombat)
+ return false;
+
+ std::list pList = DoFindFriendlyCC(param2);
+
+ //List is empty
+ if (pList.empty())
+ return false;
+
+ //We don't really care about the whole list, just return first available
+ pActionInvoker = *(pList.begin());
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_FRIENDLY_MISSING_BUFF:
+ {
+ std::list pList = DoFindFriendlyMissingBuff(param2, param1);
+
+ //List is empty
+ if (pList.empty())
+ return false;
+
+ //We don't really care about the whole list, just return first available
+ pActionInvoker = *(pList.begin());
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_SUMMONED_UNIT:
+ {
+ //Prevent event from occuring on no unit or non creatures
+ if (!pActionInvoker || pActionInvoker->GetTypeId()!=TYPEID_UNIT)
+ return false;
+
+ //Creature id doesn't match up
+ if (param1 && ((Creature*)pActionInvoker)->GetEntry() != param1)
+ return false;
+
+ //Repeat Timers
+ if (param2 == param3)
+ {
+ pHolder.Time = param2;
+
+ }else if (param3 > param2)
+ pHolder.Time = urand(param2, param3);
+ else
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ default:
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ break;
+ }
+
+ //Disable non-repeatable events
+ if (!(pHolder.Event.event_flags & EFLAG_REPEATABLE))
+ pHolder.Enabled = false;
+
+ //Process actions
+ for (uint32 j = 0; j < MAX_ACTIONS; j++)
+ ProcessAction(pHolder.Event.action[j].type, pHolder.Event.action[j].param1, pHolder.Event.action[j].param2, pHolder.Event.action[j].param3, rnd, pHolder.Event.event_id, pActionInvoker);
+
+ return true;
+ }
+
+ inline uint32 GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3)
+ {
+ switch (rnd % 3)
+ {
+ case 0:
+ return param1;
+ break;
+ case 1:
+ return param2;
+ break;
+ case 2:
+ return param3;
+ break;
+ }
+ return 0;
+ }
+
+ inline Unit* GetTargetByType(uint32 Target, Unit* pActionInvoker)
+ {
+ switch (Target)
+ {
+ case TARGET_T_SELF:
+ return m_creature;
+ break;
+ case TARGET_T_HOSTILE:
+ return m_creature->getVictim();
+ break;
+ case TARGET_T_HOSTILE_SECOND_AGGRO:
+ return SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+ break;
+ case TARGET_T_HOSTILE_LAST_AGGRO:
+ return SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
+ break;
+ case TARGET_T_HOSTILE_RANDOM:
+ return SelectUnit(SELECT_TARGET_RANDOM,0);
+ break;
+ case TARGET_T_HOSTILE_RANDOM_NOT_TOP:
+ return SelectUnit(SELECT_TARGET_RANDOM,1);
+ break;
+ case TARGET_T_ACTION_INVOKER:
+ return pActionInvoker;
+ break;
+ default:
+ return NULL;
+ break;
+ };
+ }
+
+ void ProcessAction(uint16 type, uint32 param1, uint32 param2, uint32 param3, uint32 rnd, uint32 EventId, Unit* pActionInvoker)
+ {
+ switch (type)
+ {
+ case ACTION_T_SAY:
+ DoSay(GetEventAIText(param1), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ break;
+ case ACTION_T_YELL:
+ DoYell(GetEventAIText(param1), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ break;
+ case ACTION_T_TEXTEMOTE:
+ DoTextEmote(GetEventAIText(param1), pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ break;
+ case ACTION_T_SOUND:
+ DoPlaySoundToSet(m_creature, param1);
+ break;
+ case ACTION_T_EMOTE:
+ m_creature->HandleEmoteCommand(param1);
+ break;
+ case ACTION_T_RANDOM_SAY:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != 0xffffffff)
+ DoSay(GetEventAIText(temp), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ }
+ break;
+ case ACTION_T_RANDOM_YELL:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != 0xffffffff)
+ DoYell(GetEventAIText(temp), LANG_UNIVERSAL, pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ }
+ break;
+ case ACTION_T_RANDOM_TEXTEMOTE:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != 0xffffffff)
+ DoTextEmote(GetEventAIText(temp), pActionInvoker ? pActionInvoker : m_creature->getVictim());
+ }
+ break;
+ case ACTION_T_RANDOM_SOUND:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != 0xffffffff)
+ DoPlaySoundToSet(m_creature, temp);
+ }
+ break;
+ case ACTION_T_RANDOM_EMOTE:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != 0xffffffff)
+ m_creature->HandleEmoteCommand(temp);
+ }
+ break;
+ case ACTION_T_CAST:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+ Unit* caster = m_creature;
+
+ if (!target)
+ return;
+
+ //Cast is always triggered if target is forced to cast on self
+ if (param3 & CAST_FORCE_TARGET_SELF)
+ {
+ param3 |= CAST_TRIGGERED;
+ caster = target;
+ }
+
+ //Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered
+ bool canCast = !(caster->IsNonMeleeSpellCasted(false) && (param3 & CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS));
+
+ // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them
+ if(param3 & CAST_AURA_NOT_PRESENT)
+ {
+ for(uint8 i = 0; i < 3; ++i)
+ if(target->HasAura(param1, i))
+ return;
+ }
+
+ if (canCast)
+ {
+ const SpellEntry* tSpell = GetSpellStore()->LookupEntry(param1);
+
+ //Verify that spell exists
+ if (tSpell)
+ {
+ //Check if cannot cast spell
+ if (!(param3 & (CAST_FORCE_TARGET_SELF | CAST_FORCE_CAST)) &&
+ !CanCast(target, tSpell, (param3 & CAST_TRIGGERED)))
+ {
+ //Melee current victim if flag not set
+ if (!(param3 & CAST_NO_MELEE_IF_OOM))
+ {
+ AttackDistance = 0;
+ AttackAngle = 0;
+
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ }
+
+ }else
+ {
+ //Interrupt any previous spell
+ if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS)
+ caster->InterruptNonMeleeSpells(false);
+
+ caster->CastSpell(target, param1, (param3 & CAST_TRIGGERED));
+ }
+
+ }else if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: EventAI event %d creature %d attempt to cast spell that doesn't exist %d", EventId, m_creature->GetEntry(), param1);
+ }
+ }
+ break;
+ case ACTION_T_SUMMON:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ Creature* pCreature = NULL;
+
+ if (param3)
+ pCreature = DoSpawnCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, param3);
+ else pCreature = pCreature = DoSpawnCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
+
+ if (!pCreature)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: EventAI failed to spawn creature %u. Spawn event %d is on creature %d", param1, EventId, m_creature->GetEntry());
+ }
+ else if (param2 != TARGET_T_SELF && target)
+ pCreature->AI()->AttackStart(target);
+ }
+ break;
+ case ACTION_T_THREAT_SINGLE_PCT:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target)
+ m_creature->getThreatManager().modifyThreatPercent(target, param1);
+ }
+ break;
+ case ACTION_T_THREAT_ALL_PCT:
+ {
+ Unit* Temp = NULL;
+
+ std::list::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Temp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
+ if (Temp)
+ m_creature->getThreatManager().modifyThreatPercent(Temp, param1);
+ }
+ }
+ break;
+ case ACTION_T_QUEST_EVENT:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)target)->AreaExploredOrEventHappens(param1);
+ }
+ break;
+ case ACTION_T_CASTCREATUREGO:
+ {
+ Unit* target = GetTargetByType(param3, pActionInvoker);
+
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)target)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
+ }
+ break;
+ case ACTION_T_SET_UNIT_FIELD:
+ {
+ Unit* target = GetTargetByType(param3, pActionInvoker);
+
+ if (target)
+ target->SetUInt32Value(param1, param2);
+ }
+ break;
+ case ACTION_T_SET_UNIT_FLAG:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target)
+ target->SetFlag(UNIT_FIELD_FLAGS, param1);
+ }
+ break;
+ case ACTION_T_REMOVE_UNIT_FLAG:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target)
+ target->RemoveFlag(UNIT_FIELD_FLAGS, param1);
+ }
+ break;
+ case ACTION_T_AUTO_ATTACK:
+ {
+ if (param1)
+ MeleeEnabled = true;
+ else MeleeEnabled = false;
+ }
+ break;
+ case ACTION_T_COMBAT_MOVEMENT:
+ {
+ CombatMovementEnabled = param1;
+
+ //Allow movement (create new targeted movement gen if none exist already)
+ if (CombatMovementEnabled)
+ {
+ if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ }
+ }
+ else
+ if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->StopMoving();
+ }
+ }
+ break;
+ case ACTION_T_SET_PHASE:
+ {
+ Phase = param1;
+ }
+ break;
+ case ACTION_T_INC_PHASE:
+ {
+ Phase += param1;
+
+ if (Phase > 31)
+ if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: Event %d incremented Phase above 31. Phase mask cannot be used with phases past 31. CreatureEntry = %d", EventId, m_creature->GetEntry());
+ }
+ break;
+ case ACTION_T_EVADE:
+ {
+ EnterEvadeMode();
+ }
+ break;
+ case ACTION_T_FLEE:
+ {
+ TimetoFleeLeft = 8000;
+ m_creature->DoFleeToGetAssistance();
+ IsFleeing = true;
+ }
+ break;
+ case ACTION_T_QUEST_EVENT_ALL:
+ {
+ Unit* Temp = NULL;
+ if( pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER )
+ {
+ Temp = Unit::GetUnit((*m_creature),pActionInvoker->GetGUID());
+ if( Temp )
+ ((Player*)Temp)->GroupEventHappens(param1,m_creature);
+ }
+ }
+ break;
+ case ACTION_T_CASTCREATUREGO_ALL:
+ {
+ Unit* Temp = NULL;
+
+ std::list::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Temp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
+ if (Temp && Temp->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)Temp)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
+ }
+ }
+ break;
+ case ACTION_T_REMOVEAURASFROMSPELL:
+ {
+ Unit* target = GetTargetByType(param1, pActionInvoker);
+
+ if (target)
+ target->RemoveAurasDueToSpell(param2);
+ }
+ break;
+ case ACTION_T_RANGED_MOVEMENT:
+ {
+ AttackDistance = param1;
+ AttackAngle = ((float)param2/180)*M_PI;
+
+ if (CombatMovementEnabled)
+ {
+ //Drop current movement gen
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ }
+ }
+ break;
+ case ACTION_T_RANDOM_PHASE:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ Phase = temp;
+ }
+ break;
+ case ACTION_T_RANDOM_PHASE_RANGE:
+ {
+ if (param2 > param1)
+ {
+ Phase = param1 + (rnd % (param2 - param1));
+ }
+ else if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 <= Param1. Divide by Zero. Event = %d. CreatureEntry = %d", EventId, m_creature->GetEntry());
+ }
+ break;
+ case ACTION_T_SUMMON_ID:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ //Duration
+ Creature* pCreature = NULL;
+
+ HM_NAMESPACE::hash_map::iterator i = EventAI_Summon_Map.find(param3);
+
+ if (i == EventAI_Summon_Map.end())
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: EventAI failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", param1, param3, EventId, m_creature->GetEntry());
+ return;
+ }
+
+ if ((*i).second.SpawnTimeSecs)
+ pCreature = m_creature->SummonCreature(param1, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, (*i).second.SpawnTimeSecs);
+ else pCreature = m_creature->SummonCreature(param1, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
+
+ if (!pCreature)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: EventAI failed to spawn creature %u. EventId %d.Creature %d", param1, EventId, m_creature->GetEntry());
+ }
+ else if (param2 != TARGET_T_SELF && target)
+ pCreature->AI()->AttackStart(target);
+ }
+ break;
+ case ACTION_T_KILLED_MONSTER:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)target)->KilledMonster(param1, m_creature->GetGUID());
+ }
+ break;
+ case ACTION_T_SET_INST_DATA:
+ {
+ ScriptedInstance* pInst = (ScriptedInstance*)m_creature->GetInstanceData();
+ if (!pInst)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d attempt to set instance data without instance script. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ pInst->SetData(param1, param2);
+ }
+ break;
+ case ACTION_T_SET_INST_DATA64:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (!target)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ ScriptedInstance* pInst = (ScriptedInstance*)m_creature->GetInstanceData();
+
+ if (!pInst)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ pInst->SetData64(param1, target->GetGUID());
+ }
+ break;
+ case ACTION_T_UPDATE_TEMPLATE:
+ {
+ if (m_creature->GetEntry() == param1)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ m_creature->UpdateEntry(param1, param2 ? HORDE : ALLIANCE);
+ }
+ break;
+ case ACTION_T_DIE:
+ {
+ if (m_creature->isDead())
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ break;
+ case ACTION_T_ZONE_COMBAT_PULSE:
+ {
+ if (!m_creature->isInCombat() || !m_creature->GetMap()->IsDungeon())
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Event %d ACTION_T_ZONE_COMBAT_PULSE on creature out of combat or in non-dungeon map. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ DoZoneInCombat();
+ }
+ break;
+ }
+ }
+
+ void JustRespawned()
+ {
+ InCombat = false;
+ IsFleeing = false;
+ Reset();
+
+ //Handle Spawned Events
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_SPAWNED:
+ ProcessEvent(*i);
+ break;
+ }
+ }
+ }
+
+ void Reset()
+ {
+ EventUpdateTime = EVENT_UPDATE_TIME;
+ EventDiff = 0;
+
+ //Handle Evade events and reset all events to enabled
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Reset all out of combat timers
+ case EVENT_T_TIMER_OOC:
+ {
+ if ((*i).Event.event_param2 == (*i).Event.event_param1)
+ {
+ (*i).Time = (*i).Event.event_param1;
+ (*i).Enabled = true;
+ }else if ((*i).Event.event_param2 > (*i).Event.event_param1)
+ {
+ (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
+ (*i).Enabled = true;
+ }else if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
+ }
+ break;
+ //default:
+ //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro()
+ //(*i).Enabled = true;
+ //(*i).Time = 0;
+ //break;
+ }
+ }
+ }
+
+ void EnterEvadeMode()
+ {
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ m_creature->LoadCreaturesAddon();
+ if( m_creature->isAlive() )
+ m_creature->GetMotionMaster()->MoveTargetedHome();
+
+ m_creature->SetLootRecipient(NULL);
+
+ InCombat = false;
+ IsFleeing = false;
+ Reset();
+
+ //Handle Evade events
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Evade
+ case EVENT_T_EVADE:
+ ProcessEvent(*i);
+ break;
+ }
+ }
+ }
+
+ void JustDied(Unit* killer)
+ {
+ InCombat = false;
+ IsFleeing = false;
+ Reset();
+
+ //Handle Evade events
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Evade
+ case EVENT_T_DEATH:
+ ProcessEvent(*i, killer);
+ break;
+ }
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (victim->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Kill
+ case EVENT_T_KILL:
+ ProcessEvent(*i, victim);
+ break;
+ }
+ }
+
+ }
+
+ void JustSummoned(Creature* pUnit)
+ {
+ if (!pUnit)
+ return;
+
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Summoned
+ case EVENT_T_SUMMONED_UNIT:
+ ProcessEvent(*i, pUnit);
+ break;
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ //Check for on combat start events
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_AGGRO:
+ (*i).Enabled = true;
+ ProcessEvent(*i, who);
+ break;
+ //Reset all in combat timers
+ case EVENT_T_TIMER:
+ if ((*i).Event.event_param2 == (*i).Event.event_param1)
+ {
+ (*i).Time = (*i).Event.event_param1;
+ (*i).Enabled = true;
+ }else if ((*i).Event.event_param2 > (*i).Event.event_param1)
+ {
+ (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
+ (*i).Enabled = true;
+ }else if (EAI_ErrorLevel > 0)
+ error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
+ break;
+ //All normal events need to be re-enabled and their time set to 0
+ default:
+ (*i).Enabled = true;
+ (*i).Time = 0;
+ break;
+ }
+ }
+
+ EventUpdateTime = EVENT_UPDATE_TIME;
+ EventDiff = 0;
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if (!who)
+ return;
+
+ if (m_creature->Attack(who, MeleeEnabled))
+ {
+ //Begin melee attack if we are within range
+ m_creature->AddThreat(who, 0.0f);
+ m_creature->SetInCombatWith(who);
+ who->SetInCombatWith(m_creature);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+
+ if (CombatMovementEnabled)
+ {
+ m_creature->GetMotionMaster()->MoveChase(who, AttackDistance, AttackAngle);
+ }
+ else
+ {
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->StopMoving();
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || InCombat)
+ return;
+
+ //Check for OOC LOS Event
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_OOC_LOS:
+ {
+ if ((*i).Event.event_param1 && m_creature->IsHostileTo(who))
+ break;
+
+ if ((*i).Event.event_param2 && !m_creature->IsHostileTo(who))
+ break;
+
+ ProcessEvent(*i, who);
+ }
+ break;
+ }
+ }
+
+ if (m_creature->isCivilian() && m_creature->IsNeutralToAll())
+ return;
+
+
+ if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ //Begin melee attack if we are within range
+ AttackStart(who);
+ }
+ }
+ }
+
+ void SpellHit(Unit* pUnit, const SpellEntry* pSpell)
+ {
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Spell hit
+ case EVENT_T_SPELLHIT:
+ {
+ //If spell id matches (or no spell id) & if spell school matches (or no spell school)
+ if (!(*i).Event.event_param1 || pSpell->Id == (*i).Event.event_param1)
+ if ((*i).Event.event_param2_s == -1 || pSpell->SchoolMask == (*i).Event.event_param2)
+ ProcessEvent(*i, pUnit);
+ }
+ break;
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Check if we are in combat (also updates calls threat update code)
+ bool Combat = InCombat ? (m_creature->SelectHostilTarget() && m_creature->getVictim()) : false;
+
+ //Must return if creature isn't alive. Normally select hostil target and get victim prevent this
+ if (!m_creature->isAlive())
+ return;
+
+ if ((TimetoFleeLeft < diff || (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)) && IsFleeing)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->SetNoCallAssistence(false);
+ m_creature->CallAssistence();
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ IsFleeing = false;
+ }
+ else
+ TimetoFleeLeft -= diff;
+
+ if(IsFleeing)
+ return;
+
+ //Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events
+ if (EventUpdateTime < diff)
+ {
+ EventDiff += diff;
+
+ //Check for range based events
+ //if (m_creature->GetDistance(m_creature->getVictim()) >
+ if (Combat)
+ {
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_RANGE:
+ float dist = m_creature->GetDistance(m_creature->getVictim());
+ if (dist > (*i).Event.event_param1 && dist < (*i).Event.event_param2)
+ ProcessEvent(*i);
+ break;
+ }
+ }
+ }
+
+ //Check for time based events
+ for (std::list::iterator i = EventList.begin(); i != EventList.end(); ++i)
+ {
+ //Decrement Timers
+ if ((*i).Time)
+
+ {
+ if ((*i).Time > EventDiff)
+ {
+ //Do not decrement timers if event cannot trigger in this phase
+ if (!((*i).Event.event_inverse_phase_mask & (1 << Phase)))
+ (*i).Time -= EventDiff;
+ //Skip processing of events that have time remaining
+ continue;
+ }
+ else (*i).Time = 0;
+ }
+
+ switch ((*i).Event.event_type)
+ {
+ //Events that are updated every EVENT_UPDATE_TIME
+ case EVENT_T_TIMER_OOC:
+ ProcessEvent(*i);
+ break;
+ case EVENT_T_TIMER:
+ case EVENT_T_MANA:
+ case EVENT_T_HP:
+ case EVENT_T_TARGET_HP:
+ case EVENT_T_TARGET_CASTING:
+ case EVENT_T_FRIENDLY_HP:
+ if( Combat )
+ ProcessEvent(*i);
+ break;
+ }
+ }
+
+ EventDiff = 0;
+ EventUpdateTime = EVENT_UPDATE_TIME;
+ }else
+ {
+ EventDiff += diff;
+ EventUpdateTime -= diff;
+ }
+
+ //Melee Auto-Attack
+ if (Combat && MeleeEnabled)
+ DoMeleeAttackIfReady();
+
+ }
+};
+
+CreatureAI* GetAI_Mob_EventAI(Creature *_Creature)
+{
+ //Select events by creature id
+ std::list EventList;
+ uint32 ID = _Creature->GetEntry();
+
+ std::list::iterator i;
+
+ for (i = EventAI_Event_List.begin(); i != EventAI_Event_List.end(); ++i)
+ {
+ if ((*i).creature_id == ID)
+ {
+//Debug check
+#ifndef _DEBUG
+ if ((*i).event_flags & EFLAG_DEBUG_ONLY)
+ continue;
+#endif
+ if( _Creature->GetMap()->IsDungeon() )
+ {
+ if( _Creature->GetMap()->IsHeroic() )
+ {
+ if( (*i).event_flags & EFLAG_HEROIC )
+ {
+ EventList.push_back(EventHolder(*i));
+ continue;
+ }else if( (*i).event_flags & EFLAG_NORMAL )
+ continue;
+ }
+ else
+ {
+ if( (*i).event_flags & EFLAG_NORMAL )
+ {
+ EventList.push_back(EventHolder(*i));
+ continue;
+ }else if( (*i).event_flags & EFLAG_HEROIC )
+ continue;
+ }
+
+ if (EAI_ErrorLevel > 1)
+ error_db_log("SD2: Creature %u Event %u. Creature are in instance but neither EFLAG_NORMAL or EFLAG_HEROIC are set. Event Disabled.", _Creature->GetEntry(), (*i).event_id);
+
+ continue;
+ }
+
+ EventList.push_back(EventHolder(*i));
+ }
+ }
+
+ //EventAI is pointless to use without events and may cause crashes
+ if (EventList.empty())
+ {
+ if (EAI_ErrorLevel > 1)
+ error_db_log("SD2: Eventlist for Creature %u is empty but creature is using Mob_EventAI. Preventing EventAI on this creature.", _Creature->GetEntry());
+
+ return NULL;
+ }
+
+ return new Mob_EventAI (_Creature, EventList);
+}
+
+void AddSC_mob_event()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="mob_eventai";
+ newscript->GetAI = GetAI_Mob_EventAI;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.h b/src/bindings/scripts/scripts/creature/mob_event_ai.h
index 10afd68f736..b063df8b585 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.h
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.h
@@ -1,216 +1,216 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
-* This program is free software licensed under GPL version 2
-* Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef SC_EVENTAI_H
-#define SC_EVENTAI_H
-
-#define MAX_ACTIONS 3
-
-enum Event_Types
-{
- EVENT_T_TIMER = 0, //InitialMin, InitialMax, RepeatMin, RepeatMax
- EVENT_T_TIMER_OOC = 1, //InitialMin, InitialMax, RepeatMin, RepeatMax
- EVENT_T_HP = 2, //HPMax%, HPMin%, RepeatMin, RepeatMax
- EVENT_T_MANA = 3, //ManaMax%,ManaMin% RepeatMin, RepeatMax
- EVENT_T_AGGRO = 4, //NONE
- EVENT_T_KILL = 5, //RepeatMin, RepeatMax
- EVENT_T_DEATH = 6, //NONE
- EVENT_T_EVADE = 7, //NONE
- EVENT_T_SPELLHIT = 8, //SpellID, School, RepeatMin, RepeatMax
- EVENT_T_RANGE = 9, //MinDist, MaxDist, RepeatMin, RepeatMax
- EVENT_T_OOC_LOS = 10, //NoHostile, NoFriendly, RepeatMin, RepeatMax
- EVENT_T_SPAWNED = 11, //NONE
- EVENT_T_TARGET_HP = 12, //HPMax%, HPMin%, RepeatMin, RepeatMax
- EVENT_T_TARGET_CASTING = 13, //RepeatMin, RepeatMax
- EVENT_T_FRIENDLY_HP = 14, //HPDeficit, Radius, RepeatMin, RepeatMax
- EVENT_T_FRIENDLY_IS_CC = 15, //DispelType, Radius, RepeatMin, RepeatMax
- EVENT_T_FRIENDLY_MISSING_BUFF = 16, //SpellId, Radius, RepeatMin, RepeatMax
- EVENT_T_SUMMONED_UNIT = 17, //CreatureId, RepeatMin, RepeatMax
- EVENT_T_TARGET_MANA = 18, //ManaMax%, ManaMin%, RepeatMin, RepeatMax
- EVENT_T_QUEST_ACCEPT = 19, //QuestID
- EVENT_T_QUEST_COMPLETE = 20, //
-
- EVENT_T_END,
-};
-
-enum Action_Types
-{
- ACTION_T_NONE = 0, //No action
- ACTION_T_SAY = 1, //TextId
- ACTION_T_YELL = 2, //TextId
- ACTION_T_TEXTEMOTE = 3, //TextId
- ACTION_T_SOUND = 4, //SoundId
- ACTION_T_EMOTE = 5, //EmoteId
- ACTION_T_RANDOM_SAY = 6, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
- ACTION_T_RANDOM_YELL = 7, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
- ACTION_T_RANDOM_TEXTEMOTE = 8, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
- ACTION_T_RANDOM_SOUND = 9, //SoundId1, SoundId2, SoundId3 (-1 in any field means no output if randomed that field)
- ACTION_T_RANDOM_EMOTE = 10, //EmoteId1, EmoteId2, EmoteId3 (-1 in any field means no output if randomed that field)
- ACTION_T_CAST = 11, //SpellId, Target, CastFlags
- ACTION_T_SUMMON = 12, //CreatureID, Target, Duration in ms
- ACTION_T_THREAT_SINGLE_PCT = 13, //Threat%, Target
- ACTION_T_THREAT_ALL_PCT = 14, //Threat%
- ACTION_T_QUEST_EVENT = 15, //QuestID, Target
- ACTION_T_CASTCREATUREGO = 16, //QuestID, SpellId, Target
- ACTION_T_SET_UNIT_FIELD = 17, //Field_Number, Value, Target
- ACTION_T_SET_UNIT_FLAG = 18, //Flags (may be more than one field OR'd together), Target
- ACTION_T_REMOVE_UNIT_FLAG = 19, //Flags (may be more than one field OR'd together), Target
- ACTION_T_AUTO_ATTACK = 20, //AllowAttackState (0 = stop attack, anything else means continue attacking)
- ACTION_T_COMBAT_MOVEMENT = 21, //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
- ACTION_T_SET_PHASE = 22, //Phase
- ACTION_T_INC_PHASE = 23, //Value (may be negative to decrement phase, should not be 0)
- ACTION_T_EVADE = 24, //No Params
- ACTION_T_FLEE = 25, //No Params
- ACTION_T_QUEST_EVENT_ALL = 26, //QuestID
- ACTION_T_CASTCREATUREGO_ALL = 27, //QuestId, SpellId
- ACTION_T_REMOVEAURASFROMSPELL = 28, //Target, Spellid
- ACTION_T_RANGED_MOVEMENT = 29, //Distance, Angle
- ACTION_T_RANDOM_PHASE = 30, //PhaseId1, PhaseId2, PhaseId3
- ACTION_T_RANDOM_PHASE_RANGE = 31, //PhaseMin, PhaseMax
- ACTION_T_SUMMON_ID = 32, //CreatureId, Target, SpawnId
- ACTION_T_KILLED_MONSTER = 33, //CreatureId, Target
- ACTION_T_SET_INST_DATA = 34, //Field, Data
- ACTION_T_SET_INST_DATA64 = 35, //Field, Target
- ACTION_T_UPDATE_TEMPLATE = 36, //Entry, Team
- ACTION_T_DIE = 37, //No Params
- ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params
-
- ACTION_T_END,
-};
-
-enum Target
-{
- //Self (m_creature)
- TARGET_T_SELF = 0, //Self cast
-
- //Hostile targets (if pet then returns pet owner)
- TARGET_T_HOSTILE, //Our current target (ie: highest aggro)
- TARGET_T_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
- TARGET_T_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
- TARGET_T_HOSTILE_RANDOM, //Just any random target on our threat list
- TARGET_T_HOSTILE_RANDOM_NOT_TOP, //Any random target except top threat
-
- //Invoker targets (if pet then returns pet owner)
- TARGET_T_ACTION_INVOKER, //Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF)
-
- //Hostile targets (including pets)
- TARGET_T_HOSTILE_WPET, //Current target (can be a pet)
- TARGET_T_HOSTILE_WPET_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
- TARGET_T_HOSTILE_WPET_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
- TARGET_T_HOSTILE_WPET_RANDOM, //Just any random target on our threat list
- TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, //Any random target except top threat
-
- TARGET_T_ACTION_INVOKER_WPET,
-
- TARGET_T_END
-};
-
-enum CastFlags
-{
- CAST_INTURRUPT_PREVIOUS = 0x01, //Interrupt any spell casting
- CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time)
- CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
- CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
- CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
- CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell
-};
-
-enum EventFlags
-{
- EFLAG_REPEATABLE = 0x01, //Event repeats
- EFLAG_NORMAL = 0x02, //Event only occurs in Normal instance difficulty
- EFLAG_HEROIC = 0x04, //Event only occurs in Heroic instance difficulty
- EFLAG_RESERVED_3 = 0x08,
- EFLAG_RESERVED_4 = 0x10,
- EFLAG_RESERVED_5 = 0x20,
- EFLAG_RESERVED_6 = 0x40,
- EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build of SD2 only
-};
-
-struct EventAI_Event
-{
- uint32 event_id;
-
- uint32 creature_id;
-
- uint16 event_type;
- uint32 event_inverse_phase_mask;
- uint8 event_chance;
- uint8 event_flags;
- union
- {
- uint32 event_param1;
- int32 event_param1_s;
- };
- union
- {
- uint32 event_param2;
- int32 event_param2_s;
- };
- union
- {
- uint32 event_param3;
- int32 event_param3_s;
- };
- union
- {
- uint32 event_param4;
- int32 event_param4_s;
- };
-
- struct _action
- {
- uint16 type;
- union
- {
- uint32 param1;
- int32 param1_s;
- };
- union
- {
- uint32 param2;
- int32 param2_s;
- };
- union
- {
- uint32 param3;
- int32 param3_s;
- };
- }action[MAX_ACTIONS];
-};
-
-//Event_Map
-extern std::list EventAI_Event_List;
-
-struct EventAI_Summon
-{
- uint32 id;
-
- float position_x;
- float position_y;
- float position_z;
- float orientation;
- uint32 SpawnTimeSecs;
-};
-
-//EventSummon_Map
-extern HM_NAMESPACE::hash_map EventAI_Summon_Map;
-
-//EventAI Error handling
-extern uint32 EAI_ErrorLevel;
-/*
-
-struct EventAI_CreatureError
-{
- bool ListEmpty;
- bool NoInstance;
-};
-
-//Error prevention list
-extern HM_NAMESPACE::hash_map EventAI_CreatureErrorPreventionList;
-
-//Defines
-#define EVENTAI_EMPTY_EVENTLIST "SD2: Eventlist for Creature %i is empty but creature is using Mob_EventAI. Preventing EventAI on this creature."
-*/
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2
+* This program is free software licensed under GPL version 2
+* Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef SC_EVENTAI_H
+#define SC_EVENTAI_H
+
+#define MAX_ACTIONS 3
+
+enum Event_Types
+{
+ EVENT_T_TIMER = 0, //InitialMin, InitialMax, RepeatMin, RepeatMax
+ EVENT_T_TIMER_OOC = 1, //InitialMin, InitialMax, RepeatMin, RepeatMax
+ EVENT_T_HP = 2, //HPMax%, HPMin%, RepeatMin, RepeatMax
+ EVENT_T_MANA = 3, //ManaMax%,ManaMin% RepeatMin, RepeatMax
+ EVENT_T_AGGRO = 4, //NONE
+ EVENT_T_KILL = 5, //RepeatMin, RepeatMax
+ EVENT_T_DEATH = 6, //NONE
+ EVENT_T_EVADE = 7, //NONE
+ EVENT_T_SPELLHIT = 8, //SpellID, School, RepeatMin, RepeatMax
+ EVENT_T_RANGE = 9, //MinDist, MaxDist, RepeatMin, RepeatMax
+ EVENT_T_OOC_LOS = 10, //NoHostile, NoFriendly, RepeatMin, RepeatMax
+ EVENT_T_SPAWNED = 11, //NONE
+ EVENT_T_TARGET_HP = 12, //HPMax%, HPMin%, RepeatMin, RepeatMax
+ EVENT_T_TARGET_CASTING = 13, //RepeatMin, RepeatMax
+ EVENT_T_FRIENDLY_HP = 14, //HPDeficit, Radius, RepeatMin, RepeatMax
+ EVENT_T_FRIENDLY_IS_CC = 15, //DispelType, Radius, RepeatMin, RepeatMax
+ EVENT_T_FRIENDLY_MISSING_BUFF = 16, //SpellId, Radius, RepeatMin, RepeatMax
+ EVENT_T_SUMMONED_UNIT = 17, //CreatureId, RepeatMin, RepeatMax
+ EVENT_T_TARGET_MANA = 18, //ManaMax%, ManaMin%, RepeatMin, RepeatMax
+ EVENT_T_QUEST_ACCEPT = 19, //QuestID
+ EVENT_T_QUEST_COMPLETE = 20, //
+
+ EVENT_T_END,
+};
+
+enum Action_Types
+{
+ ACTION_T_NONE = 0, //No action
+ ACTION_T_SAY = 1, //TextId
+ ACTION_T_YELL = 2, //TextId
+ ACTION_T_TEXTEMOTE = 3, //TextId
+ ACTION_T_SOUND = 4, //SoundId
+ ACTION_T_EMOTE = 5, //EmoteId
+ ACTION_T_RANDOM_SAY = 6, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_RANDOM_YELL = 7, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_RANDOM_TEXTEMOTE = 8, //TextId1, TextId2, TextId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_RANDOM_SOUND = 9, //SoundId1, SoundId2, SoundId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_RANDOM_EMOTE = 10, //EmoteId1, EmoteId2, EmoteId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_CAST = 11, //SpellId, Target, CastFlags
+ ACTION_T_SUMMON = 12, //CreatureID, Target, Duration in ms
+ ACTION_T_THREAT_SINGLE_PCT = 13, //Threat%, Target
+ ACTION_T_THREAT_ALL_PCT = 14, //Threat%
+ ACTION_T_QUEST_EVENT = 15, //QuestID, Target
+ ACTION_T_CASTCREATUREGO = 16, //QuestID, SpellId, Target
+ ACTION_T_SET_UNIT_FIELD = 17, //Field_Number, Value, Target
+ ACTION_T_SET_UNIT_FLAG = 18, //Flags (may be more than one field OR'd together), Target
+ ACTION_T_REMOVE_UNIT_FLAG = 19, //Flags (may be more than one field OR'd together), Target
+ ACTION_T_AUTO_ATTACK = 20, //AllowAttackState (0 = stop attack, anything else means continue attacking)
+ ACTION_T_COMBAT_MOVEMENT = 21, //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
+ ACTION_T_SET_PHASE = 22, //Phase
+ ACTION_T_INC_PHASE = 23, //Value (may be negative to decrement phase, should not be 0)
+ ACTION_T_EVADE = 24, //No Params
+ ACTION_T_FLEE = 25, //No Params
+ ACTION_T_QUEST_EVENT_ALL = 26, //QuestID
+ ACTION_T_CASTCREATUREGO_ALL = 27, //QuestId, SpellId
+ ACTION_T_REMOVEAURASFROMSPELL = 28, //Target, Spellid
+ ACTION_T_RANGED_MOVEMENT = 29, //Distance, Angle
+ ACTION_T_RANDOM_PHASE = 30, //PhaseId1, PhaseId2, PhaseId3
+ ACTION_T_RANDOM_PHASE_RANGE = 31, //PhaseMin, PhaseMax
+ ACTION_T_SUMMON_ID = 32, //CreatureId, Target, SpawnId
+ ACTION_T_KILLED_MONSTER = 33, //CreatureId, Target
+ ACTION_T_SET_INST_DATA = 34, //Field, Data
+ ACTION_T_SET_INST_DATA64 = 35, //Field, Target
+ ACTION_T_UPDATE_TEMPLATE = 36, //Entry, Team
+ ACTION_T_DIE = 37, //No Params
+ ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params
+
+ ACTION_T_END,
+};
+
+enum Target
+{
+ //Self (m_creature)
+ TARGET_T_SELF = 0, //Self cast
+
+ //Hostile targets (if pet then returns pet owner)
+ TARGET_T_HOSTILE, //Our current target (ie: highest aggro)
+ TARGET_T_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
+ TARGET_T_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
+ TARGET_T_HOSTILE_RANDOM, //Just any random target on our threat list
+ TARGET_T_HOSTILE_RANDOM_NOT_TOP, //Any random target except top threat
+
+ //Invoker targets (if pet then returns pet owner)
+ TARGET_T_ACTION_INVOKER, //Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF)
+
+ //Hostile targets (including pets)
+ TARGET_T_HOSTILE_WPET, //Current target (can be a pet)
+ TARGET_T_HOSTILE_WPET_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
+ TARGET_T_HOSTILE_WPET_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
+ TARGET_T_HOSTILE_WPET_RANDOM, //Just any random target on our threat list
+ TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, //Any random target except top threat
+
+ TARGET_T_ACTION_INVOKER_WPET,
+
+ TARGET_T_END
+};
+
+enum CastFlags
+{
+ CAST_INTURRUPT_PREVIOUS = 0x01, //Interrupt any spell casting
+ CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time)
+ CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
+ CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
+ CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
+ CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell
+};
+
+enum EventFlags
+{
+ EFLAG_REPEATABLE = 0x01, //Event repeats
+ EFLAG_NORMAL = 0x02, //Event only occurs in Normal instance difficulty
+ EFLAG_HEROIC = 0x04, //Event only occurs in Heroic instance difficulty
+ EFLAG_RESERVED_3 = 0x08,
+ EFLAG_RESERVED_4 = 0x10,
+ EFLAG_RESERVED_5 = 0x20,
+ EFLAG_RESERVED_6 = 0x40,
+ EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build of SD2 only
+};
+
+struct EventAI_Event
+{
+ uint32 event_id;
+
+ uint32 creature_id;
+
+ uint16 event_type;
+ uint32 event_inverse_phase_mask;
+ uint8 event_chance;
+ uint8 event_flags;
+ union
+ {
+ uint32 event_param1;
+ int32 event_param1_s;
+ };
+ union
+ {
+ uint32 event_param2;
+ int32 event_param2_s;
+ };
+ union
+ {
+ uint32 event_param3;
+ int32 event_param3_s;
+ };
+ union
+ {
+ uint32 event_param4;
+ int32 event_param4_s;
+ };
+
+ struct _action
+ {
+ uint16 type;
+ union
+ {
+ uint32 param1;
+ int32 param1_s;
+ };
+ union
+ {
+ uint32 param2;
+ int32 param2_s;
+ };
+ union
+ {
+ uint32 param3;
+ int32 param3_s;
+ };
+ }action[MAX_ACTIONS];
+};
+
+//Event_Map
+extern std::list EventAI_Event_List;
+
+struct EventAI_Summon
+{
+ uint32 id;
+
+ float position_x;
+ float position_y;
+ float position_z;
+ float orientation;
+ uint32 SpawnTimeSecs;
+};
+
+//EventSummon_Map
+extern HM_NAMESPACE::hash_map EventAI_Summon_Map;
+
+//EventAI Error handling
+extern uint32 EAI_ErrorLevel;
+/*
+
+struct EventAI_CreatureError
+{
+ bool ListEmpty;
+ bool NoInstance;
+};
+
+//Error prevention list
+extern HM_NAMESPACE::hash_map EventAI_CreatureErrorPreventionList;
+
+//Defines
+#define EVENTAI_EMPTY_EVENTLIST "SD2: Eventlist for Creature %i is empty but creature is using Mob_EventAI. Preventing EventAI on this creature."
+*/
+#endif
diff --git a/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp b/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
index ace24b8a405..3f07390b06f 100644
--- a/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
@@ -1,172 +1,172 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Generic_Creature
-SD%Complete: 80
-SDComment: Should be replaced with core based AI
-SDCategory: Creatures
-EndScriptData */
-
-#include "precompiled.h"
-
-#define GENERIC_CREATURE_COOLDOWN 5000
-
-struct TRINITY_DLL_DECL generic_creatureAI : public ScriptedAI
-{
- generic_creatureAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
- uint32 BuffTimer; //This variable keeps track of buffs
- bool IsSelfRooted;
-
- void Reset()
- {
- GlobalCooldown = 0;
- BuffTimer = 0; //Rebuff as soon as we can
- IsSelfRooted = false;
- }
-
- void Aggro(Unit *who)
- {
- if (!m_creature->IsWithinDistInMap(who, ATTACK_DISTANCE))
- {
- IsSelfRooted = true;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Always decrease our global cooldown first
- if (GlobalCooldown > diff)
- GlobalCooldown -= diff;
- else GlobalCooldown = 0;
-
- //Buff timer (only buff when we are alive and not in combat
- if (!InCombat && m_creature->isAlive())
- if (BuffTimer < diff )
- {
- //Find a spell that targets friendly and applies an aura (these are generally buffs)
- SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
-
- if (info && !GlobalCooldown)
- {
- //Cast the buff spell
- DoCastSpell(m_creature, info);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
-
- //Set our timer to 10 minutes before rebuff
- BuffTimer = 600000;
- }//Try agian in 30 seconds
- else BuffTimer = 30000;
- }else BuffTimer -= diff;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //If we are within range melee the target
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- //Make sure our attack is ready and we arn't currently casting
- if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
- {
- bool Healing = false;
- SpellEntry const *info = NULL;
-
- //Select a healing spell if less than 30% hp
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
- info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
-
- //No healing spell available, select a hostile spell
- if (info) Healing = true;
- else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
-
- //50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell
- if (info && (rand() % (m_creature->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
- {
- //Cast the spell
- if (Healing)DoCastSpell(m_creature, info);
- else DoCastSpell(m_creature->getVictim(), info);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
- }
- else m_creature->AttackerStateUpdate(m_creature->getVictim());
-
- m_creature->resetAttackTimer();
- }
- }
- else
- {
- //Only run this code if we arn't already casting
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- bool Healing = false;
- SpellEntry const *info = NULL;
-
- //Select a healing spell if less than 30% hp ONLY 33% of the time
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30 && rand() % 3 == 0)
- info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
-
- //No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
- if (info) Healing = true;
- else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, ATTACK_DISTANCE, 0, SELECT_EFFECT_DONTCARE);
-
- //Found a spell, check if we arn't on cooldown
- if (info && !GlobalCooldown)
- {
- //If we are currently moving stop us and set the movement generator
- if (!IsSelfRooted)
- {
- IsSelfRooted = true;
- }
-
- //Cast spell
- if (Healing) DoCastSpell(m_creature,info);
- else DoCastSpell(m_creature->getVictim(),info);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
-
-
- }//If no spells available and we arn't moving run to target
- else if (IsSelfRooted)
- {
- //Cancel our current spell and then allow movement agian
- m_creature->InterruptNonMeleeSpells(false);
- IsSelfRooted = false;
- }
- }
- }
- }
-};
-CreatureAI* GetAI_generic_creature(Creature *_Creature)
-{
- return new generic_creatureAI (_Creature);
-}
-
-
-void AddSC_generic_creature()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="generic_creature";
- newscript->GetAI = GetAI_generic_creature;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Generic_Creature
+SD%Complete: 80
+SDComment: Should be replaced with core based AI
+SDCategory: Creatures
+EndScriptData */
+
+#include "precompiled.h"
+
+#define GENERIC_CREATURE_COOLDOWN 5000
+
+struct TRINITY_DLL_DECL generic_creatureAI : public ScriptedAI
+{
+ generic_creatureAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
+ uint32 BuffTimer; //This variable keeps track of buffs
+ bool IsSelfRooted;
+
+ void Reset()
+ {
+ GlobalCooldown = 0;
+ BuffTimer = 0; //Rebuff as soon as we can
+ IsSelfRooted = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ if (!m_creature->IsWithinDistInMap(who, ATTACK_DISTANCE))
+ {
+ IsSelfRooted = true;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Always decrease our global cooldown first
+ if (GlobalCooldown > diff)
+ GlobalCooldown -= diff;
+ else GlobalCooldown = 0;
+
+ //Buff timer (only buff when we are alive and not in combat
+ if (!InCombat && m_creature->isAlive())
+ if (BuffTimer < diff )
+ {
+ //Find a spell that targets friendly and applies an aura (these are generally buffs)
+ SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
+
+ if (info && !GlobalCooldown)
+ {
+ //Cast the buff spell
+ DoCastSpell(m_creature, info);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+
+ //Set our timer to 10 minutes before rebuff
+ BuffTimer = 600000;
+ }//Try agian in 30 seconds
+ else BuffTimer = 30000;
+ }else BuffTimer -= diff;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //If we are within range melee the target
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ //Make sure our attack is ready and we arn't currently casting
+ if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ bool Healing = false;
+ SpellEntry const *info = NULL;
+
+ //Select a healing spell if less than 30% hp
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
+ info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
+
+ //No healing spell available, select a hostile spell
+ if (info) Healing = true;
+ else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
+
+ //50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell
+ if (info && (rand() % (m_creature->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
+ {
+ //Cast the spell
+ if (Healing)DoCastSpell(m_creature, info);
+ else DoCastSpell(m_creature->getVictim(), info);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+ }
+ else m_creature->AttackerStateUpdate(m_creature->getVictim());
+
+ m_creature->resetAttackTimer();
+ }
+ }
+ else
+ {
+ //Only run this code if we arn't already casting
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ bool Healing = false;
+ SpellEntry const *info = NULL;
+
+ //Select a healing spell if less than 30% hp ONLY 33% of the time
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30 && rand() % 3 == 0)
+ info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
+
+ //No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
+ if (info) Healing = true;
+ else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, ATTACK_DISTANCE, 0, SELECT_EFFECT_DONTCARE);
+
+ //Found a spell, check if we arn't on cooldown
+ if (info && !GlobalCooldown)
+ {
+ //If we are currently moving stop us and set the movement generator
+ if (!IsSelfRooted)
+ {
+ IsSelfRooted = true;
+ }
+
+ //Cast spell
+ if (Healing) DoCastSpell(m_creature,info);
+ else DoCastSpell(m_creature->getVictim(),info);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+
+
+ }//If no spells available and we arn't moving run to target
+ else if (IsSelfRooted)
+ {
+ //Cancel our current spell and then allow movement agian
+ m_creature->InterruptNonMeleeSpells(false);
+ IsSelfRooted = false;
+ }
+ }
+ }
+ }
+};
+CreatureAI* GetAI_generic_creature(Creature *_Creature)
+{
+ return new generic_creatureAI (_Creature);
+}
+
+
+void AddSC_generic_creature()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="generic_creature";
+ newscript->GetAI = GetAI_generic_creature;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/creature/simple_ai.cpp b/src/bindings/scripts/scripts/creature/simple_ai.cpp
index c19fcc17fea..365b4269009 100644
--- a/src/bindings/scripts/scripts/creature/simple_ai.cpp
+++ b/src/bindings/scripts/scripts/creature/simple_ai.cpp
@@ -1,294 +1,294 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: SimpleAI
-SD%Complete: 100
-SDComment: Base Class for SimpleAI creatures
-SDCategory: Creatures
-EndScriptData */
-
-#include "precompiled.h"
-#include "simple_ai.h"
-
-SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
-{
- //Clear all data
- Aggro_Text[0] = NULL;
- Aggro_Text[1] = NULL;
- Aggro_Text[2] = NULL;
- Aggro_Say[0] = false;
- Aggro_Say[1] = false;
- Aggro_Say[2] = false;
- Aggro_Sound[0] = 0;
- Aggro_Sound[1] = 0;
- Aggro_Sound[2] = 0;
-
- Death_Text[0] = NULL;
- Death_Text[1] = NULL;
- Death_Text[2] = NULL;
- Death_Say[0] = false;
- Death_Say[1] = false;
- Death_Say[2] = false;
- Death_Sound[0] = 0;
- Death_Sound[1] = 0;
- Death_Sound[2] = 0;
- Death_Spell = 0;
- Death_Target_Type = 0;
-
- Kill_Text[0] = NULL;
- Kill_Text[1] = NULL;
- Kill_Text[2] = NULL;
- Kill_Say[0] = false;
- Kill_Say[1] = false;
- Kill_Say[2] = false;
- Kill_Sound[0] = 0;
- Kill_Sound[1] = 0;
- Kill_Sound[2] = 0;
- Kill_Spell = 0;
- Kill_Target_Type = 0;
-
- memset(Spell,0,sizeof(Spell));
-
- EnterEvadeMode();
-}
-
-void SimpleAI::Reset()
-{
-}
-
-void SimpleAI::Aggro(Unit *who)
-{
- //Reset cast timers
- if (Spell[0].First_Cast >= 0)
- Spell_Timer[0] = Spell[0].First_Cast;
- else Spell_Timer[0] = 1000;
- if (Spell[1].First_Cast >= 0)
- Spell_Timer[1] = Spell[1].First_Cast;
- else Spell_Timer[1] = 1000;
- if (Spell[2].First_Cast >= 0)
- Spell_Timer[2] = Spell[2].First_Cast;
- else Spell_Timer[2] = 1000;
- if (Spell[3].First_Cast >= 0)
- Spell_Timer[3] = Spell[3].First_Cast;
- else Spell_Timer[3] = 1000;
- if (Spell[4].First_Cast >= 0)
- Spell_Timer[4] = Spell[4].First_Cast;
- else Spell_Timer[4] = 1000;
- if (Spell[5].First_Cast >= 0)
- Spell_Timer[5] = Spell[5].First_Cast;
- else Spell_Timer[5] = 1000;
- if (Spell[6].First_Cast >= 0)
- Spell_Timer[6] = Spell[6].First_Cast;
- else Spell_Timer[6] = 1000;
- if (Spell[7].First_Cast >= 0)
- Spell_Timer[7] = Spell[7].First_Cast;
- else Spell_Timer[7] = 1000;
- if (Spell[8].First_Cast >= 0)
- Spell_Timer[8] = Spell[8].First_Cast;
- else Spell_Timer[8] = 1000;
- if (Spell[9].First_Cast >= 0)
- Spell_Timer[9] = Spell[9].First_Cast;
- else Spell_Timer[9] = 1000;
-
- uint32 random_text = rand()%3;
-
- //Random yell
- if (Aggro_Text[random_text])
- if (Aggro_Say[random_text])
- DoSay(Aggro_Text[random_text], LANG_UNIVERSAL, who);
- else DoYell(Aggro_Text[random_text], LANG_UNIVERSAL, who);
-
- //Random sound
- if (Aggro_Sound[random_text])
- DoPlaySoundToSet(m_creature, Aggro_Sound[random_text]);
-}
-
-void SimpleAI::KilledUnit(Unit *victim)
-{
- uint32 random_text = rand()%3;
-
- //Random yell
- if (Kill_Text[random_text])
- if (Kill_Say[random_text])
- DoSay(Kill_Text[random_text], LANG_UNIVERSAL, victim);
- else DoYell(Kill_Text[random_text], LANG_UNIVERSAL, victim);
-
- //Random sound
- if (Kill_Sound[random_text])
- DoPlaySoundToSet(m_creature, Kill_Sound[random_text]);
-
- if (!Kill_Spell)
- return;
-
- Unit* target = NULL;
-
- switch (Kill_Target_Type)
- {
- case CAST_SELF:
- target = m_creature;
- break;
- case CAST_HOSTILE_TARGET:
- target = m_creature->getVictim();
- break;
- case CAST_HOSTILE_SECOND_AGGRO:
- target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- break;
- case CAST_HOSTILE_LAST_AGGRO:
- target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
- break;
- case CAST_HOSTILE_RANDOM:
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- break;
- case CAST_KILLEDUNIT_VICTIM:
- target = victim;
- break;
- }
-
- //Target is ok, cast a spell on it
- if (target)
- DoCast(target, Kill_Spell);
-}
-
-void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
-{
- //Return if damage taken won't kill us
- if (m_creature->GetHealth() > damage)
- return;
-
- uint32 random_text = rand()%3;
-
- //Random yell
- if (Death_Text[random_text])
- if (Death_Say[random_text])
- DoSay(Death_Text[random_text], LANG_UNIVERSAL, killer);
- else DoYell(Death_Text[random_text], LANG_UNIVERSAL, killer);
-
- //Random sound
- if (Death_Sound[random_text])
- DoPlaySoundToSet(m_creature, Death_Sound[random_text]);
-
- if (!Death_Spell)
- return;
-
- Unit* target = NULL;
-
- switch (Death_Target_Type)
- {
- case CAST_SELF:
- target = m_creature;
- break;
- case CAST_HOSTILE_TARGET:
- target = m_creature->getVictim();
- break;
- case CAST_HOSTILE_SECOND_AGGRO:
- target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- break;
- case CAST_HOSTILE_LAST_AGGRO:
- target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
- break;
- case CAST_HOSTILE_RANDOM:
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- break;
- case CAST_JUSTDIED_KILLER:
- target = killer;
- break;
- }
-
- //Target is ok, cast a spell on it
- if (target)
- DoCast(target, Death_Spell);
-}
-
-void SimpleAI::UpdateAI(const uint32 diff)
-{
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Spells
- for (uint32 i = 0; i < 10; ++i)
- {
- //Spell not valid
- if (!Spell[i].Enabled || !Spell[i].Spell_Id)
- continue;
-
- if (Spell_Timer[i] < diff)
- {
- //Check if this is a percentage based
- if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > -Spell[i].First_Cast)
- continue;
-
- //Check Current spell
- if (!(Spell[i].InterruptPreviousCast && m_creature->IsNonMeleeSpellCasted(false)))
- {
- Unit* target = NULL;
-
- switch (Spell[i].Cast_Target_Type)
- {
- case CAST_SELF:
- target = m_creature;
- break;
- case CAST_HOSTILE_TARGET:
- target = m_creature->getVictim();
- break;
- case CAST_HOSTILE_SECOND_AGGRO:
- target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- break;
- case CAST_HOSTILE_LAST_AGGRO:
- target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
- break;
- case CAST_HOSTILE_RANDOM:
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- break;
- }
-
- //Target is ok, cast a spell on it and then do our random yell
- if (target)
- {
- if (m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
-
- DoCast(target, Spell[i].Spell_Id);
-
- //Yell and sound use the same number so that you can make
- //the creature yell with the correct sound effect attached
- uint32 random_text = rand()%3;
-
- //Random yell
- if (Spell[i].Text[random_text])
- if (Spell[i].Say[random_text])
- DoSay(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
- else DoYell(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
-
- //Random sound
- if (Spell[i].Text_Sound[random_text])
- DoPlaySoundToSet(m_creature, Spell[i].Text_Sound[random_text]);
- }
-
- }
-
- //Spell will cast agian when the cooldown is up
- if (Spell[i].CooldownRandomAddition)
- Spell_Timer[i] = Spell[i].Cooldown + (rand() % Spell[i].CooldownRandomAddition);
- else Spell_Timer[i] = Spell[i].Cooldown;
-
- }else Spell_Timer[i] -= diff;
-
- }
-
- DoMeleeAttackIfReady();
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: SimpleAI
+SD%Complete: 100
+SDComment: Base Class for SimpleAI creatures
+SDCategory: Creatures
+EndScriptData */
+
+#include "precompiled.h"
+#include "simple_ai.h"
+
+SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
+{
+ //Clear all data
+ Aggro_Text[0] = NULL;
+ Aggro_Text[1] = NULL;
+ Aggro_Text[2] = NULL;
+ Aggro_Say[0] = false;
+ Aggro_Say[1] = false;
+ Aggro_Say[2] = false;
+ Aggro_Sound[0] = 0;
+ Aggro_Sound[1] = 0;
+ Aggro_Sound[2] = 0;
+
+ Death_Text[0] = NULL;
+ Death_Text[1] = NULL;
+ Death_Text[2] = NULL;
+ Death_Say[0] = false;
+ Death_Say[1] = false;
+ Death_Say[2] = false;
+ Death_Sound[0] = 0;
+ Death_Sound[1] = 0;
+ Death_Sound[2] = 0;
+ Death_Spell = 0;
+ Death_Target_Type = 0;
+
+ Kill_Text[0] = NULL;
+ Kill_Text[1] = NULL;
+ Kill_Text[2] = NULL;
+ Kill_Say[0] = false;
+ Kill_Say[1] = false;
+ Kill_Say[2] = false;
+ Kill_Sound[0] = 0;
+ Kill_Sound[1] = 0;
+ Kill_Sound[2] = 0;
+ Kill_Spell = 0;
+ Kill_Target_Type = 0;
+
+ memset(Spell,0,sizeof(Spell));
+
+ EnterEvadeMode();
+}
+
+void SimpleAI::Reset()
+{
+}
+
+void SimpleAI::Aggro(Unit *who)
+{
+ //Reset cast timers
+ if (Spell[0].First_Cast >= 0)
+ Spell_Timer[0] = Spell[0].First_Cast;
+ else Spell_Timer[0] = 1000;
+ if (Spell[1].First_Cast >= 0)
+ Spell_Timer[1] = Spell[1].First_Cast;
+ else Spell_Timer[1] = 1000;
+ if (Spell[2].First_Cast >= 0)
+ Spell_Timer[2] = Spell[2].First_Cast;
+ else Spell_Timer[2] = 1000;
+ if (Spell[3].First_Cast >= 0)
+ Spell_Timer[3] = Spell[3].First_Cast;
+ else Spell_Timer[3] = 1000;
+ if (Spell[4].First_Cast >= 0)
+ Spell_Timer[4] = Spell[4].First_Cast;
+ else Spell_Timer[4] = 1000;
+ if (Spell[5].First_Cast >= 0)
+ Spell_Timer[5] = Spell[5].First_Cast;
+ else Spell_Timer[5] = 1000;
+ if (Spell[6].First_Cast >= 0)
+ Spell_Timer[6] = Spell[6].First_Cast;
+ else Spell_Timer[6] = 1000;
+ if (Spell[7].First_Cast >= 0)
+ Spell_Timer[7] = Spell[7].First_Cast;
+ else Spell_Timer[7] = 1000;
+ if (Spell[8].First_Cast >= 0)
+ Spell_Timer[8] = Spell[8].First_Cast;
+ else Spell_Timer[8] = 1000;
+ if (Spell[9].First_Cast >= 0)
+ Spell_Timer[9] = Spell[9].First_Cast;
+ else Spell_Timer[9] = 1000;
+
+ uint32 random_text = rand()%3;
+
+ //Random yell
+ if (Aggro_Text[random_text])
+ if (Aggro_Say[random_text])
+ DoSay(Aggro_Text[random_text], LANG_UNIVERSAL, who);
+ else DoYell(Aggro_Text[random_text], LANG_UNIVERSAL, who);
+
+ //Random sound
+ if (Aggro_Sound[random_text])
+ DoPlaySoundToSet(m_creature, Aggro_Sound[random_text]);
+}
+
+void SimpleAI::KilledUnit(Unit *victim)
+{
+ uint32 random_text = rand()%3;
+
+ //Random yell
+ if (Kill_Text[random_text])
+ if (Kill_Say[random_text])
+ DoSay(Kill_Text[random_text], LANG_UNIVERSAL, victim);
+ else DoYell(Kill_Text[random_text], LANG_UNIVERSAL, victim);
+
+ //Random sound
+ if (Kill_Sound[random_text])
+ DoPlaySoundToSet(m_creature, Kill_Sound[random_text]);
+
+ if (!Kill_Spell)
+ return;
+
+ Unit* target = NULL;
+
+ switch (Kill_Target_Type)
+ {
+ case CAST_SELF:
+ target = m_creature;
+ break;
+ case CAST_HOSTILE_TARGET:
+ target = m_creature->getVictim();
+ break;
+ case CAST_HOSTILE_SECOND_AGGRO:
+ target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+ break;
+ case CAST_HOSTILE_LAST_AGGRO:
+ target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
+ break;
+ case CAST_HOSTILE_RANDOM:
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ break;
+ case CAST_KILLEDUNIT_VICTIM:
+ target = victim;
+ break;
+ }
+
+ //Target is ok, cast a spell on it
+ if (target)
+ DoCast(target, Kill_Spell);
+}
+
+void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
+{
+ //Return if damage taken won't kill us
+ if (m_creature->GetHealth() > damage)
+ return;
+
+ uint32 random_text = rand()%3;
+
+ //Random yell
+ if (Death_Text[random_text])
+ if (Death_Say[random_text])
+ DoSay(Death_Text[random_text], LANG_UNIVERSAL, killer);
+ else DoYell(Death_Text[random_text], LANG_UNIVERSAL, killer);
+
+ //Random sound
+ if (Death_Sound[random_text])
+ DoPlaySoundToSet(m_creature, Death_Sound[random_text]);
+
+ if (!Death_Spell)
+ return;
+
+ Unit* target = NULL;
+
+ switch (Death_Target_Type)
+ {
+ case CAST_SELF:
+ target = m_creature;
+ break;
+ case CAST_HOSTILE_TARGET:
+ target = m_creature->getVictim();
+ break;
+ case CAST_HOSTILE_SECOND_AGGRO:
+ target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+ break;
+ case CAST_HOSTILE_LAST_AGGRO:
+ target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
+ break;
+ case CAST_HOSTILE_RANDOM:
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ break;
+ case CAST_JUSTDIED_KILLER:
+ target = killer;
+ break;
+ }
+
+ //Target is ok, cast a spell on it
+ if (target)
+ DoCast(target, Death_Spell);
+}
+
+void SimpleAI::UpdateAI(const uint32 diff)
+{
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Spells
+ for (uint32 i = 0; i < 10; ++i)
+ {
+ //Spell not valid
+ if (!Spell[i].Enabled || !Spell[i].Spell_Id)
+ continue;
+
+ if (Spell_Timer[i] < diff)
+ {
+ //Check if this is a percentage based
+ if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > -Spell[i].First_Cast)
+ continue;
+
+ //Check Current spell
+ if (!(Spell[i].InterruptPreviousCast && m_creature->IsNonMeleeSpellCasted(false)))
+ {
+ Unit* target = NULL;
+
+ switch (Spell[i].Cast_Target_Type)
+ {
+ case CAST_SELF:
+ target = m_creature;
+ break;
+ case CAST_HOSTILE_TARGET:
+ target = m_creature->getVictim();
+ break;
+ case CAST_HOSTILE_SECOND_AGGRO:
+ target = SelectUnit(SELECT_TARGET_TOPAGGRO,1);
+ break;
+ case CAST_HOSTILE_LAST_AGGRO:
+ target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
+ break;
+ case CAST_HOSTILE_RANDOM:
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ break;
+ }
+
+ //Target is ok, cast a spell on it and then do our random yell
+ if (target)
+ {
+ if (m_creature->IsNonMeleeSpellCasted(false))
+ m_creature->InterruptNonMeleeSpells(false);
+
+ DoCast(target, Spell[i].Spell_Id);
+
+ //Yell and sound use the same number so that you can make
+ //the creature yell with the correct sound effect attached
+ uint32 random_text = rand()%3;
+
+ //Random yell
+ if (Spell[i].Text[random_text])
+ if (Spell[i].Say[random_text])
+ DoSay(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
+ else DoYell(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
+
+ //Random sound
+ if (Spell[i].Text_Sound[random_text])
+ DoPlaySoundToSet(m_creature, Spell[i].Text_Sound[random_text]);
+ }
+
+ }
+
+ //Spell will cast agian when the cooldown is up
+ if (Spell[i].CooldownRandomAddition)
+ Spell_Timer[i] = Spell[i].Cooldown + (rand() % Spell[i].CooldownRandomAddition);
+ else Spell_Timer[i] = Spell[i].Cooldown;
+
+ }else Spell_Timer[i] -= diff;
+
+ }
+
+ DoMeleeAttackIfReady();
+}
diff --git a/src/bindings/scripts/scripts/creature/simple_ai.h b/src/bindings/scripts/scripts/creature/simple_ai.h
index 421ef6313c5..49d0f0c4922 100644
--- a/src/bindings/scripts/scripts/creature/simple_ai.h
+++ b/src/bindings/scripts/scripts/creature/simple_ai.h
@@ -1,74 +1,74 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
-* This program is free software licensed under GPL version 2
-* Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef SC_SIMPLEAI_H
-#define SC_SIMPLEAI_H
-
-enum CastTarget
-{
- CAST_SELF = 0, //Self cast
- CAST_HOSTILE_TARGET, //Our current target (ie: highest aggro)
- CAST_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
- CAST_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
- CAST_HOSTILE_RANDOM, //Just any random target on our threat list
- CAST_FRIENDLY_RANDOM, //NOT YET IMPLEMENTED
-
- //Special cases
- CAST_KILLEDUNIT_VICTIM, //Only works within KilledUnit function
- CAST_JUSTDIED_KILLER, //Only works within JustDied function
-};
-
-struct TRINITY_DLL_DECL SimpleAI : public ScriptedAI
-{
- SimpleAI(Creature *c);// : ScriptedAI(c);
-
- void Reset();
-
- void Aggro(Unit *who);
-
- void KilledUnit(Unit *victim);
-
- void DamageTaken(Unit *killer, uint32 &damage);
-
- void UpdateAI(const uint32 diff);
-
-public:
-
- char* Aggro_Text[3];
- bool Aggro_Say[3];
- uint32 Aggro_Sound[3];
-
- char* Death_Text[3];
- bool Death_Say[3];
- uint32 Death_Sound[3];
- uint32 Death_Spell;
- uint32 Death_Target_Type;
-
- char* Kill_Text[3];
- bool Kill_Say[3];
- uint32 Kill_Sound[3];
- uint32 Kill_Spell;
- uint32 Kill_Target_Type;
-
- struct SimpleAI_Spell
- {
- uint32 Spell_Id; //Spell ID to cast
- int32 First_Cast; //Delay for first cast
- uint32 Cooldown; //Cooldown between casts
- uint32 CooldownRandomAddition; //Random addition to cooldown (in range from 0 - CooldownRandomAddition)
- uint32 Cast_Target_Type; //Target type (note that certain spells may ignore this)
- bool InterruptPreviousCast; //Interrupt a previous cast if this spell needs to be cast
- bool Enabled; //Spell enabled or disabled (default: false)
-
- //3 texts to many?
- char* Text[3];
- bool Say[3];
- uint32 Text_Sound[3];
- }Spell[10];
-
-protected:
- uint32 Spell_Timer[10];
-};
-
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2
+* This program is free software licensed under GPL version 2
+* Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef SC_SIMPLEAI_H
+#define SC_SIMPLEAI_H
+
+enum CastTarget
+{
+ CAST_SELF = 0, //Self cast
+ CAST_HOSTILE_TARGET, //Our current target (ie: highest aggro)
+ CAST_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
+ CAST_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
+ CAST_HOSTILE_RANDOM, //Just any random target on our threat list
+ CAST_FRIENDLY_RANDOM, //NOT YET IMPLEMENTED
+
+ //Special cases
+ CAST_KILLEDUNIT_VICTIM, //Only works within KilledUnit function
+ CAST_JUSTDIED_KILLER, //Only works within JustDied function
+};
+
+struct TRINITY_DLL_DECL SimpleAI : public ScriptedAI
+{
+ SimpleAI(Creature *c);// : ScriptedAI(c);
+
+ void Reset();
+
+ void Aggro(Unit *who);
+
+ void KilledUnit(Unit *victim);
+
+ void DamageTaken(Unit *killer, uint32 &damage);
+
+ void UpdateAI(const uint32 diff);
+
+public:
+
+ char* Aggro_Text[3];
+ bool Aggro_Say[3];
+ uint32 Aggro_Sound[3];
+
+ char* Death_Text[3];
+ bool Death_Say[3];
+ uint32 Death_Sound[3];
+ uint32 Death_Spell;
+ uint32 Death_Target_Type;
+
+ char* Kill_Text[3];
+ bool Kill_Say[3];
+ uint32 Kill_Sound[3];
+ uint32 Kill_Spell;
+ uint32 Kill_Target_Type;
+
+ struct SimpleAI_Spell
+ {
+ uint32 Spell_Id; //Spell ID to cast
+ int32 First_Cast; //Delay for first cast
+ uint32 Cooldown; //Cooldown between casts
+ uint32 CooldownRandomAddition; //Random addition to cooldown (in range from 0 - CooldownRandomAddition)
+ uint32 Cast_Target_Type; //Target type (note that certain spells may ignore this)
+ bool InterruptPreviousCast; //Interrupt a previous cast if this spell needs to be cast
+ bool Enabled; //Spell enabled or disabled (default: false)
+
+ //3 texts to many?
+ char* Text[3];
+ bool Say[3];
+ uint32 Text_Sound[3];
+ }Spell[10];
+
+protected:
+ uint32 Spell_Timer[10];
+};
+
+#endif
diff --git a/src/bindings/scripts/scripts/custom/custom_example.cpp b/src/bindings/scripts/scripts/custom/custom_example.cpp
index b283d196ddf..133b2136a1c 100644
--- a/src/bindings/scripts/scripts/custom/custom_example.cpp
+++ b/src/bindings/scripts/scripts/custom/custom_example.cpp
@@ -1,277 +1,277 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Custom_Example
-SD%Complete: 100
-SDComment: Short custom scripting example
-SDCategory: Script Examples
-EndScriptData */
-
-#include "precompiled.h"
-
-// **** This script is designed as an example for others to build on ****
-// **** Please modify whatever you'd like to as this script is only for developement ****
-
-// **** Script Info ****
-// This script is written in a way that it can be used for both friendly and hostile monsters
-// Its primary purpose is to show just how much you can really do with scripts
-// I recommend trying it out on both an agressive NPC and on friendly npc
-
-// **** Quick Info ****
-// Functions with Handled Function marked above them are functions that are called automatically by the core
-// Functions that are marked Custom Function are functions I've created to simplify code
-
-#define SPELL_BUFF 25661
-#define SPELL_ONE 12555
-#define SPELL_ONE_ALT 24099
-#define SPELL_TWO 10017
-#define SPELL_THREE 26027
-#define SPELL_ENRAGE 23537
-#define SPELL_BESERK 32309
-
-#define SAY_AGGRO "Let the games begin."
-#define SAY_RANDOM_0 "I see endless suffering. I see torment. I see rage. I see everything."
-#define SAY_RANDOM_1 "Muahahahaha"
-#define SAY_RANDOM_2 "These mortal infedels my lord, they have invaded your sanctum and seek to steal your secrets."
-#define SAY_RANDOM_3 "You are already dead."
-#define SAY_RANDOM_4 "Where to go? What to do? So many choices that all end in pain, end in death."
-#define SAY_BESERK "$N, I sentance you to death!"
-#define SAY_PHASE "The suffering has just begun!"
-
-#define GOSSIP_ITEM "I'm looking for a fight"
-#define SAY_DANCE "I always thought I was a good dancer"
-#define SAY_SALUTE "Move out Soldier!"
-
-struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
-{
- //*** HANDLED FUNCTION ***
- //This is the constructor, called only once when the creature is first created
- custom_exampleAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- //*** CUSTOM VARIABLES ****
- //These variables are for use only by this individual script.
- //Nothing else will ever call them but us.
-
- uint32 Say_Timer; //Timer for random chat
- uint32 Rebuff_Timer; //Timer for rebuffing
- uint32 Spell_1_Timer; //Timer for spell 1 when in combat
- uint32 Spell_2_Timer; //Timer for spell 1 when in combat
- uint32 Spell_3_Timer; //Timer for spell 1 when in combat
- uint32 Beserk_Timer; //Timer until we go into Beserk (enraged) mode
- uint32 Phase; //The current battle phase we are in
- uint32 Phase_Timer; //Timer until phase transition
-
- //*** HANDLED FUNCTION ***
- //This is called whenever the core decides we need to evade
- void Reset()
- {
- Phase = 1; //Start in phase 1
- Phase_Timer = 60000; //60 seconds
- Spell_1_Timer = 5000; //5 seconds
- Spell_2_Timer = 37000; //37 seconds
- Spell_3_Timer = 19000; //19 seconds
- Beserk_Timer = 120000; //2 minutes
- }
-
- //*** HANDLED FUNCTION ***
- //Attack Start is called whenever someone hits us.
- void Aggro(Unit *who)
- {
- //Say some stuff
- DoSay(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8280);
- }
-
- //*** HANDLED FUNCTION ***
- //Update AI is called Every single map update (roughly once every 100ms if a player is within the grid)
- void UpdateAI(const uint32 diff)
- {
- //Out of combat timers
- if (!m_creature->getVictim())
- {
- //Random Say timer
- if (Say_Timer < diff)
- {
- //Random switch between 5 outcomes
- switch (rand()%5)
- {
- case 0:
- DoYell(SAY_RANDOM_0,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8831); //8831 is the index of the sound we are playing. You find these numbers in SoundEntries.dbc
- break;
-
- case 1:
- DoYell(SAY_RANDOM_1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8818);
- break;
-
- case 2:
- DoYell(SAY_RANDOM_2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8041);
- break;
-
- case 3:
- DoYell(SAY_RANDOM_3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8581);
- break;
-
- case 4:
- DoYell(SAY_RANDOM_4,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,8791);
- break;
- }
-
- Say_Timer = 45000; //Say something agian in 45 seconds
- }else Say_Timer -= diff;
-
- //Rebuff timer
- if (Rebuff_Timer < diff)
- {
- DoCast(m_creature,SPELL_BUFF);
- Rebuff_Timer = 900000; //Rebuff agian in 15 minutes
- }else Rebuff_Timer -= diff;
- }
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //Spell 1 timer
- if (Spell_1_Timer < diff)
- {
- //Cast spell one on our current target.
- if (rand()%50 > 10)
- DoCast(m_creature->getVictim(),SPELL_ONE_ALT);
- else if (m_creature->GetDistance(m_creature->getVictim()) < 25)
- DoCast(m_creature->getVictim(),SPELL_ONE);
-
- Spell_1_Timer = 5000;
- }else Spell_1_Timer -= diff;
-
- //Spell 2 timer
- if (Spell_2_Timer < diff)
- {
- //Cast spell one on our current target.
- DoCast(m_creature->getVictim(),SPELL_TWO);
-
- Spell_2_Timer = 37000;
- }else Spell_2_Timer -= diff;
-
- //Spell 3 timer
- if (Phase > 1)
- if (Spell_3_Timer < diff)
- {
- //Cast spell one on our current target.
- DoCast(m_creature->getVictim(),SPELL_THREE);
-
- Spell_3_Timer = 19000;
- }else Spell_3_Timer -= diff;
-
- //Beserk timer
- if (Phase > 1)
- if (Beserk_Timer < diff)
- {
- //Say our line then cast uber death spell
- DoPlaySoundToSet(m_creature,8588);
- DoYell(SAY_BESERK,LANG_UNIVERSAL,m_creature->getVictim());
- DoCast(m_creature->getVictim(),SPELL_BESERK);
-
- //Cast our beserk spell agian in 12 seconds if we didn't kill everyone
- Beserk_Timer = 12000;
- }else Beserk_Timer -= diff;
-
- //Phase timer
- if (Phase == 1)
- if (Phase_Timer < diff)
- {
- //Go to next phase
- Phase++;
- DoYell(SAY_PHASE,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_ENRAGE);
- }else Phase_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-//This is the GetAI method used by all scripts that involve AI
-//It is called every time a new creature using this script is created
-CreatureAI* GetAI_custom_example(Creature *_Creature)
-{
- return new custom_exampleAI (_Creature);
-}
-
-//This function is called when the player clicks an option on the gossip menu
-void SendDefaultMenu_custom_example(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
- {
- //Set our faction to hostile twoards all
- _Creature->setFaction(24);
- _Creature->Attack(player, true);
- player->PlayerTalkClass->CloseGossip();
- }
-}
-
-//This function is called when the player clicks an option on the gossip menu
-bool GossipSelect_custom_example(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (sender == GOSSIP_SENDER_MAIN)
- SendDefaultMenu_custom_example(player, _Creature, action);
-
- return true;
-}
-
-//This function is called when the player opens the gossip menu
-bool GossipHello_custom_example(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
-
- return true;
-}
-
-//Our Recive emote function
-bool ReceiveEmote_custom_example(Player *player, Creature *_Creature, uint32 emote)
-{
- _Creature->HandleEmoteCommand(emote);
-
- if (emote == TEXTEMOTE_DANCE)
- ((custom_exampleAI*)_Creature->AI())->DoSay(SAY_DANCE,LANG_UNIVERSAL,NULL);
-
- if (emote == TEXTEMOTE_SALUTE)
- ((custom_exampleAI*)_Creature->AI())->DoSay(SAY_SALUTE,LANG_UNIVERSAL,NULL);
-
- return true;
-}
-
-//This is the actual function called only once durring InitScripts()
-//It must define all handled functions that are to be run in this script
-//For example if you want this Script to handle Emotes you must include
-//newscript->ReciveEmote = My_Emote_Function;
-void AddSC_custom_example()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="custom_example";
- newscript->GetAI = GetAI_custom_example;
- newscript->pGossipHello = &GossipHello_custom_example;
- newscript->pGossipSelect = &GossipSelect_custom_example;
- newscript->pReceiveEmote = &ReceiveEmote_custom_example;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Custom_Example
+SD%Complete: 100
+SDComment: Short custom scripting example
+SDCategory: Script Examples
+EndScriptData */
+
+#include "precompiled.h"
+
+// **** This script is designed as an example for others to build on ****
+// **** Please modify whatever you'd like to as this script is only for developement ****
+
+// **** Script Info ****
+// This script is written in a way that it can be used for both friendly and hostile monsters
+// Its primary purpose is to show just how much you can really do with scripts
+// I recommend trying it out on both an agressive NPC and on friendly npc
+
+// **** Quick Info ****
+// Functions with Handled Function marked above them are functions that are called automatically by the core
+// Functions that are marked Custom Function are functions I've created to simplify code
+
+#define SPELL_BUFF 25661
+#define SPELL_ONE 12555
+#define SPELL_ONE_ALT 24099
+#define SPELL_TWO 10017
+#define SPELL_THREE 26027
+#define SPELL_ENRAGE 23537
+#define SPELL_BESERK 32309
+
+#define SAY_AGGRO "Let the games begin."
+#define SAY_RANDOM_0 "I see endless suffering. I see torment. I see rage. I see everything."
+#define SAY_RANDOM_1 "Muahahahaha"
+#define SAY_RANDOM_2 "These mortal infedels my lord, they have invaded your sanctum and seek to steal your secrets."
+#define SAY_RANDOM_3 "You are already dead."
+#define SAY_RANDOM_4 "Where to go? What to do? So many choices that all end in pain, end in death."
+#define SAY_BESERK "$N, I sentance you to death!"
+#define SAY_PHASE "The suffering has just begun!"
+
+#define GOSSIP_ITEM "I'm looking for a fight"
+#define SAY_DANCE "I always thought I was a good dancer"
+#define SAY_SALUTE "Move out Soldier!"
+
+struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
+{
+ //*** HANDLED FUNCTION ***
+ //This is the constructor, called only once when the creature is first created
+ custom_exampleAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ //*** CUSTOM VARIABLES ****
+ //These variables are for use only by this individual script.
+ //Nothing else will ever call them but us.
+
+ uint32 Say_Timer; //Timer for random chat
+ uint32 Rebuff_Timer; //Timer for rebuffing
+ uint32 Spell_1_Timer; //Timer for spell 1 when in combat
+ uint32 Spell_2_Timer; //Timer for spell 1 when in combat
+ uint32 Spell_3_Timer; //Timer for spell 1 when in combat
+ uint32 Beserk_Timer; //Timer until we go into Beserk (enraged) mode
+ uint32 Phase; //The current battle phase we are in
+ uint32 Phase_Timer; //Timer until phase transition
+
+ //*** HANDLED FUNCTION ***
+ //This is called whenever the core decides we need to evade
+ void Reset()
+ {
+ Phase = 1; //Start in phase 1
+ Phase_Timer = 60000; //60 seconds
+ Spell_1_Timer = 5000; //5 seconds
+ Spell_2_Timer = 37000; //37 seconds
+ Spell_3_Timer = 19000; //19 seconds
+ Beserk_Timer = 120000; //2 minutes
+ }
+
+ //*** HANDLED FUNCTION ***
+ //Attack Start is called whenever someone hits us.
+ void Aggro(Unit *who)
+ {
+ //Say some stuff
+ DoSay(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8280);
+ }
+
+ //*** HANDLED FUNCTION ***
+ //Update AI is called Every single map update (roughly once every 100ms if a player is within the grid)
+ void UpdateAI(const uint32 diff)
+ {
+ //Out of combat timers
+ if (!m_creature->getVictim())
+ {
+ //Random Say timer
+ if (Say_Timer < diff)
+ {
+ //Random switch between 5 outcomes
+ switch (rand()%5)
+ {
+ case 0:
+ DoYell(SAY_RANDOM_0,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8831); //8831 is the index of the sound we are playing. You find these numbers in SoundEntries.dbc
+ break;
+
+ case 1:
+ DoYell(SAY_RANDOM_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8818);
+ break;
+
+ case 2:
+ DoYell(SAY_RANDOM_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8041);
+ break;
+
+ case 3:
+ DoYell(SAY_RANDOM_3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8581);
+ break;
+
+ case 4:
+ DoYell(SAY_RANDOM_4,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,8791);
+ break;
+ }
+
+ Say_Timer = 45000; //Say something agian in 45 seconds
+ }else Say_Timer -= diff;
+
+ //Rebuff timer
+ if (Rebuff_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_BUFF);
+ Rebuff_Timer = 900000; //Rebuff agian in 15 minutes
+ }else Rebuff_Timer -= diff;
+ }
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //Spell 1 timer
+ if (Spell_1_Timer < diff)
+ {
+ //Cast spell one on our current target.
+ if (rand()%50 > 10)
+ DoCast(m_creature->getVictim(),SPELL_ONE_ALT);
+ else if (m_creature->GetDistance(m_creature->getVictim()) < 25)
+ DoCast(m_creature->getVictim(),SPELL_ONE);
+
+ Spell_1_Timer = 5000;
+ }else Spell_1_Timer -= diff;
+
+ //Spell 2 timer
+ if (Spell_2_Timer < diff)
+ {
+ //Cast spell one on our current target.
+ DoCast(m_creature->getVictim(),SPELL_TWO);
+
+ Spell_2_Timer = 37000;
+ }else Spell_2_Timer -= diff;
+
+ //Spell 3 timer
+ if (Phase > 1)
+ if (Spell_3_Timer < diff)
+ {
+ //Cast spell one on our current target.
+ DoCast(m_creature->getVictim(),SPELL_THREE);
+
+ Spell_3_Timer = 19000;
+ }else Spell_3_Timer -= diff;
+
+ //Beserk timer
+ if (Phase > 1)
+ if (Beserk_Timer < diff)
+ {
+ //Say our line then cast uber death spell
+ DoPlaySoundToSet(m_creature,8588);
+ DoYell(SAY_BESERK,LANG_UNIVERSAL,m_creature->getVictim());
+ DoCast(m_creature->getVictim(),SPELL_BESERK);
+
+ //Cast our beserk spell agian in 12 seconds if we didn't kill everyone
+ Beserk_Timer = 12000;
+ }else Beserk_Timer -= diff;
+
+ //Phase timer
+ if (Phase == 1)
+ if (Phase_Timer < diff)
+ {
+ //Go to next phase
+ Phase++;
+ DoYell(SAY_PHASE,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_ENRAGE);
+ }else Phase_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+//This is the GetAI method used by all scripts that involve AI
+//It is called every time a new creature using this script is created
+CreatureAI* GetAI_custom_example(Creature *_Creature)
+{
+ return new custom_exampleAI (_Creature);
+}
+
+//This function is called when the player clicks an option on the gossip menu
+void SendDefaultMenu_custom_example(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
+ {
+ //Set our faction to hostile twoards all
+ _Creature->setFaction(24);
+ _Creature->Attack(player, true);
+ player->PlayerTalkClass->CloseGossip();
+ }
+}
+
+//This function is called when the player clicks an option on the gossip menu
+bool GossipSelect_custom_example(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (sender == GOSSIP_SENDER_MAIN)
+ SendDefaultMenu_custom_example(player, _Creature, action);
+
+ return true;
+}
+
+//This function is called when the player opens the gossip menu
+bool GossipHello_custom_example(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
+
+ return true;
+}
+
+//Our Recive emote function
+bool ReceiveEmote_custom_example(Player *player, Creature *_Creature, uint32 emote)
+{
+ _Creature->HandleEmoteCommand(emote);
+
+ if (emote == TEXTEMOTE_DANCE)
+ ((custom_exampleAI*)_Creature->AI())->DoSay(SAY_DANCE,LANG_UNIVERSAL,NULL);
+
+ if (emote == TEXTEMOTE_SALUTE)
+ ((custom_exampleAI*)_Creature->AI())->DoSay(SAY_SALUTE,LANG_UNIVERSAL,NULL);
+
+ return true;
+}
+
+//This is the actual function called only once durring InitScripts()
+//It must define all handled functions that are to be run in this script
+//For example if you want this Script to handle Emotes you must include
+//newscript->ReciveEmote = My_Emote_Function;
+void AddSC_custom_example()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="custom_example";
+ newscript->GetAI = GetAI_custom_example;
+ newscript->pGossipHello = &GossipHello_custom_example;
+ newscript->pGossipSelect = &GossipSelect_custom_example;
+ newscript->pReceiveEmote = &ReceiveEmote_custom_example;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/custom/custom_gossip_codebox.cpp b/src/bindings/scripts/scripts/custom/custom_gossip_codebox.cpp
index 5a75d78f1e6..c8cfe711fc9 100644
--- a/src/bindings/scripts/scripts/custom/custom_gossip_codebox.cpp
+++ b/src/bindings/scripts/scripts/custom/custom_gossip_codebox.cpp
@@ -1,81 +1,81 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Custom_Gossip_Codebox
-SD%Complete: 100
-SDComment: Show a codebox in gossip option
-SDCategory: Script Examples
-EndScriptData */
-
-#include "precompiled.h"
-#include
-
-//This function is called when the player opens the gossip menubool
-bool GossipHello_custom_gossip_codebox(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM_EXTENDED(0, "A quiz: what's your name?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
- player->ADD_GOSSIP_ITEM(0, "I'm not interested", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
- return true;
-}
-
-//This function is called when the player clicks an option on the gossip menubool
-bool GossipSelect_custom_gossip_codebox(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if(action == GOSSIP_ACTION_INFO_DEF+2)
- {
- _Creature->Say("Normal select, guess you're not interested.", LANG_UNIVERSAL, 0);
- player->CLOSE_GOSSIP_MENU();
- }
- return true;
-}
-
-bool GossipSelectWithCode_custom_gossip_codebox( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode )
-{
- if(sender == GOSSIP_SENDER_MAIN)
- {
- if(action == GOSSIP_ACTION_INFO_DEF+1)
- {
- if(std::strcmp(sCode, player->GetName())!=0)
- {
- _Creature->Say("Wrong!", LANG_UNIVERSAL, 0);
- _Creature->CastSpell(player, 12826, true);
- }
- else
- {
- _Creature->Say("You're right, you are allowed to see my inner secrets.", LANG_UNIVERSAL, 0);
- _Creature->CastSpell(player, 26990, true);
- }
- player->CLOSE_GOSSIP_MENU();
- return true;
- }
- }
- return false;
-}
-
-void AddSC_custom_gossip_codebox()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="custom_gossip_codebox";
- newscript->pGossipHello = &GossipHello_custom_gossip_codebox;
- newscript->pGossipSelect = &GossipSelect_custom_gossip_codebox;
- newscript->pGossipSelectWithCode = &GossipSelectWithCode_custom_gossip_codebox;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Custom_Gossip_Codebox
+SD%Complete: 100
+SDComment: Show a codebox in gossip option
+SDCategory: Script Examples
+EndScriptData */
+
+#include "precompiled.h"
+#include
+
+//This function is called when the player opens the gossip menubool
+bool GossipHello_custom_gossip_codebox(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM_EXTENDED(0, "A quiz: what's your name?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
+ player->ADD_GOSSIP_ITEM(0, "I'm not interested", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
+ return true;
+}
+
+//This function is called when the player clicks an option on the gossip menubool
+bool GossipSelect_custom_gossip_codebox(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if(action == GOSSIP_ACTION_INFO_DEF+2)
+ {
+ _Creature->Say("Normal select, guess you're not interested.", LANG_UNIVERSAL, 0);
+ player->CLOSE_GOSSIP_MENU();
+ }
+ return true;
+}
+
+bool GossipSelectWithCode_custom_gossip_codebox( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode )
+{
+ if(sender == GOSSIP_SENDER_MAIN)
+ {
+ if(action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ if(std::strcmp(sCode, player->GetName())!=0)
+ {
+ _Creature->Say("Wrong!", LANG_UNIVERSAL, 0);
+ _Creature->CastSpell(player, 12826, true);
+ }
+ else
+ {
+ _Creature->Say("You're right, you are allowed to see my inner secrets.", LANG_UNIVERSAL, 0);
+ _Creature->CastSpell(player, 26990, true);
+ }
+ player->CLOSE_GOSSIP_MENU();
+ return true;
+ }
+ }
+ return false;
+}
+
+void AddSC_custom_gossip_codebox()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="custom_gossip_codebox";
+ newscript->pGossipHello = &GossipHello_custom_gossip_codebox;
+ newscript->pGossipSelect = &GossipSelect_custom_gossip_codebox;
+ newscript->pGossipSelectWithCode = &GossipSelectWithCode_custom_gossip_codebox;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/custom/test.cpp b/src/bindings/scripts/scripts/custom/test.cpp
index 37d6dae893d..52d5c7d6f4f 100644
--- a/src/bindings/scripts/scripts/custom/test.cpp
+++ b/src/bindings/scripts/scripts/custom/test.cpp
@@ -1,200 +1,200 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Test
-SD%Complete: 100
-SDComment: Script used for testing escortAI
-SDCategory: Script Examples
-EndScriptData */
-
-#include "precompiled.h"
-#include "../npc/npc_escortAI.h"
-
-struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
-{
- public:
-
- // CreatureAI functions
- npc_testAI(Creature *c) : npc_escortAI(c) {Reset();}
-
- uint32 DeathCoilTimer;
- uint32 ChatTimer;
-
- // Pure Virtual Functions
- void WaypointReached(uint32 i)
- {
- switch (i)
- {
- case 1:
- m_creature->Say("Hmm a nice day for a walk alright", LANG_UNIVERSAL, 0);
- break;
-
- case 3:
- {
- m_creature->Say("Wild Felboar attack!", LANG_UNIVERSAL, 0);
- Creature* temp = m_creature->SummonCreature(21878, m_creature->GetPositionX()+5, m_creature->GetPositionY()+7, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
-
- temp->AI()->AttackStart(m_creature);
- }
- break;
-
- case 4:
- {
- m_creature->Say("Time for me to go! See ya around $N!", LANG_UNIVERSAL, PlayerGUID);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
-
- Unit* temp = Unit::GetUnit(*m_creature, PlayerGUID);
- if (temp)
- {
- temp->MonsterSay("Bye Bye!", LANG_UNIVERSAL, 0);
- temp->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
- }
- }
- break;
- }
- }
-
- void Aggro(Unit*)
- {
- if (IsBeingEscorted)
- m_creature->Say("Help $N! I'm under attack!", LANG_UNIVERSAL, PlayerGUID);
- else m_creature->Say("Die scum!", LANG_UNIVERSAL, 0);
- }
-
- void Reset()
- {
- DeathCoilTimer = 4000;
- ChatTimer = 4000;
- }
-
- void JustDied(Unit* killer)
- {
- if (IsBeingEscorted)
- {
- //killer = m_creature when player got to far from creature
- if (killer == m_creature)
- {
- Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID);
- if( pTemp )
- DoWhisper("How dare you leave me like that! I hate you! =*(", pTemp);
- }
- else m_creature->Say("...no...how could you let me die $N", LANG_UNIVERSAL, PlayerGUID);
- }
- else m_creature->Say("ugh...", LANG_UNIVERSAL, 0);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Must update npc_escortAI
- npc_escortAI::UpdateAI(diff);
-
- //Combat check
- if (InCombat && m_creature->getVictim())
- {
- if (DeathCoilTimer < diff)
- {
- m_creature->Say("Taste death!", LANG_UNIVERSAL, 0);
- m_creature->CastSpell(m_creature->getVictim(), 33130, false);
-
- DeathCoilTimer = 4000;
- }else DeathCoilTimer -= diff;
- }else
- {
- //Out of combat but being escorted
- if (IsBeingEscorted)
- if (ChatTimer < diff)
- {
- if (m_creature->HasAura(3593, 0))
- {
- m_creature->Say("Fireworks!", LANG_UNIVERSAL, 0);
- m_creature->CastSpell(m_creature, 11540, false);
- }else
- {
- m_creature->Say("Hmm, I think I could use a buff", LANG_UNIVERSAL, 0);
- m_creature->CastSpell(m_creature, 3593, false);
- }
-
- ChatTimer = 12000;
- }else ChatTimer -= diff;
- }
- }
-};
-
-CreatureAI* GetAI_test(Creature *_Creature)
-{
- npc_testAI* testAI = new npc_testAI(_Creature);
-
- testAI->AddWaypoint(0, 1231, -4419, 23);
- testAI->AddWaypoint(1, 1198, -4440, 23, 0);
- testAI->AddWaypoint(2, 1208, -4392, 23);
- testAI->AddWaypoint(3, 1231, -4419, 23, 5000);
- testAI->AddWaypoint(4, 1208, -4392, 23, 5000);
-
- return (CreatureAI*)testAI;
-}
-
-bool GossipHello_npc_test(Player *player, Creature *_Creature)
-{
- player->TalkedToCreature(_Creature->GetEntry(),_Creature->GetGUID());
- _Creature->prepareGossipMenu(player,0);
-
- player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(Attack, Defend, Run)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(NoAttack, NoDefend, Walk)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(NoAttack, Defend, Walk)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
-
- _Creature->sendPreparedGossip( player );
- return true;
-}
-
-bool GossipSelect_npc_test(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_escortAI*)(_Creature->AI()))->Start(true, true, true, player->GetGUID());
-
- return true; // prevent Trinity core handling
- }
-
- if (action == GOSSIP_ACTION_INFO_DEF+2)
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false, player->GetGUID());
-
- return true; // prevent Trinity core handling
- }
-
- if (action == GOSSIP_ACTION_INFO_DEF+3)
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_escortAI*)(_Creature->AI()))->Start(false, true, false, player->GetGUID());
-
- return true; // prevent Trinity core handling
- }
- return false;
-}
-
-void AddSC_test()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="test";
- newscript->GetAI = GetAI_test;
- newscript->pGossipHello = &GossipHello_npc_test;
- newscript->pGossipSelect = &GossipSelect_npc_test;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Test
+SD%Complete: 100
+SDComment: Script used for testing escortAI
+SDCategory: Script Examples
+EndScriptData */
+
+#include "precompiled.h"
+#include "../npc/npc_escortAI.h"
+
+struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
+{
+ public:
+
+ // CreatureAI functions
+ npc_testAI(Creature *c) : npc_escortAI(c) {Reset();}
+
+ uint32 DeathCoilTimer;
+ uint32 ChatTimer;
+
+ // Pure Virtual Functions
+ void WaypointReached(uint32 i)
+ {
+ switch (i)
+ {
+ case 1:
+ m_creature->Say("Hmm a nice day for a walk alright", LANG_UNIVERSAL, 0);
+ break;
+
+ case 3:
+ {
+ m_creature->Say("Wild Felboar attack!", LANG_UNIVERSAL, 0);
+ Creature* temp = m_creature->SummonCreature(21878, m_creature->GetPositionX()+5, m_creature->GetPositionY()+7, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
+
+ temp->AI()->AttackStart(m_creature);
+ }
+ break;
+
+ case 4:
+ {
+ m_creature->Say("Time for me to go! See ya around $N!", LANG_UNIVERSAL, PlayerGUID);
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
+
+ Unit* temp = Unit::GetUnit(*m_creature, PlayerGUID);
+ if (temp)
+ {
+ temp->MonsterSay("Bye Bye!", LANG_UNIVERSAL, 0);
+ temp->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
+ }
+ }
+ break;
+ }
+ }
+
+ void Aggro(Unit*)
+ {
+ if (IsBeingEscorted)
+ m_creature->Say("Help $N! I'm under attack!", LANG_UNIVERSAL, PlayerGUID);
+ else m_creature->Say("Die scum!", LANG_UNIVERSAL, 0);
+ }
+
+ void Reset()
+ {
+ DeathCoilTimer = 4000;
+ ChatTimer = 4000;
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (IsBeingEscorted)
+ {
+ //killer = m_creature when player got to far from creature
+ if (killer == m_creature)
+ {
+ Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID);
+ if( pTemp )
+ DoWhisper("How dare you leave me like that! I hate you! =*(", pTemp);
+ }
+ else m_creature->Say("...no...how could you let me die $N", LANG_UNIVERSAL, PlayerGUID);
+ }
+ else m_creature->Say("ugh...", LANG_UNIVERSAL, 0);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Must update npc_escortAI
+ npc_escortAI::UpdateAI(diff);
+
+ //Combat check
+ if (InCombat && m_creature->getVictim())
+ {
+ if (DeathCoilTimer < diff)
+ {
+ m_creature->Say("Taste death!", LANG_UNIVERSAL, 0);
+ m_creature->CastSpell(m_creature->getVictim(), 33130, false);
+
+ DeathCoilTimer = 4000;
+ }else DeathCoilTimer -= diff;
+ }else
+ {
+ //Out of combat but being escorted
+ if (IsBeingEscorted)
+ if (ChatTimer < diff)
+ {
+ if (m_creature->HasAura(3593, 0))
+ {
+ m_creature->Say("Fireworks!", LANG_UNIVERSAL, 0);
+ m_creature->CastSpell(m_creature, 11540, false);
+ }else
+ {
+ m_creature->Say("Hmm, I think I could use a buff", LANG_UNIVERSAL, 0);
+ m_creature->CastSpell(m_creature, 3593, false);
+ }
+
+ ChatTimer = 12000;
+ }else ChatTimer -= diff;
+ }
+ }
+};
+
+CreatureAI* GetAI_test(Creature *_Creature)
+{
+ npc_testAI* testAI = new npc_testAI(_Creature);
+
+ testAI->AddWaypoint(0, 1231, -4419, 23);
+ testAI->AddWaypoint(1, 1198, -4440, 23, 0);
+ testAI->AddWaypoint(2, 1208, -4392, 23);
+ testAI->AddWaypoint(3, 1231, -4419, 23, 5000);
+ testAI->AddWaypoint(4, 1208, -4392, 23, 5000);
+
+ return (CreatureAI*)testAI;
+}
+
+bool GossipHello_npc_test(Player *player, Creature *_Creature)
+{
+ player->TalkedToCreature(_Creature->GetEntry(),_Creature->GetGUID());
+ _Creature->prepareGossipMenu(player,0);
+
+ player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(Attack, Defend, Run)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(NoAttack, NoDefend, Walk)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->ADD_GOSSIP_ITEM(0, "Click to Test Escort(NoAttack, Defend, Walk)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+
+ _Creature->sendPreparedGossip( player );
+ return true;
+}
+
+bool GossipSelect_npc_test(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(_Creature->AI()))->Start(true, true, true, player->GetGUID());
+
+ return true; // prevent Trinity core handling
+ }
+
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false, player->GetGUID());
+
+ return true; // prevent Trinity core handling
+ }
+
+ if (action == GOSSIP_ACTION_INFO_DEF+3)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(_Creature->AI()))->Start(false, true, false, player->GetGUID());
+
+ return true; // prevent Trinity core handling
+ }
+ return false;
+}
+
+void AddSC_test()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="test";
+ newscript->GetAI = GetAI_test;
+ newscript->pGossipHello = &GossipHello_npc_test;
+ newscript->pGossipSelect = &GossipSelect_npc_test;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/go/go_scripts.cpp b/src/bindings/scripts/scripts/go/go_scripts.cpp
index 8f6d274955b..f07aff74f5f 100644
--- a/src/bindings/scripts/scripts/go/go_scripts.cpp
+++ b/src/bindings/scripts/scripts/go/go_scripts.cpp
@@ -1,209 +1,209 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: GO_Scripts
-SD%Complete: 100
-SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296. Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089
-SDCategory: Game Objects
-EndScriptData */
-
-/* ContentData
-go_northern_crystal_pylon
-go_eastern_crystal_pylon
-go_western_crystal_pylon
-go_barov_journal
-go_field_repair_bot_74A
-go_orb_of_command
-go_tablet_of_madness
-go_tablet_of_the_seven
-go_teleporter
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## go_crystal_pylons (3x)
-######*/
-
-bool GOHello_go_northern_crystal_pylon(Player *player, GameObject* _GO)
-{
- if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
- {
- player->PrepareQuestMenu(_GO->GetGUID());
- player->SendPreparedQuest(_GO->GetGUID());
- }
-
- if (player->GetQuestStatus(4285) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(4285);
-
- return true;
-}
-
-bool GOHello_go_eastern_crystal_pylon(Player *player, GameObject* _GO)
-{
- if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
- {
- player->PrepareQuestMenu(_GO->GetGUID());
- player->SendPreparedQuest(_GO->GetGUID());
- }
-
- if (player->GetQuestStatus(4287) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(4287);
-
- return true;
-}
-
-bool GOHello_go_western_crystal_pylon(Player *player, GameObject* _GO)
-{
- if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
- {
- player->PrepareQuestMenu(_GO->GetGUID());
- player->SendPreparedQuest(_GO->GetGUID());
- }
-
- if (player->GetQuestStatus(4288) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(4288);
-
- return true;
-}
-
-/*######
-## go_barov_journal
-######*/
-
-bool GOHello_go_barov_journal(Player *player, GameObject* _GO)
-{
- if(player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !player->HasSpell(26086))
- {
- player->CastSpell(player,26095,false);
- }
- return true;
-}
-
-/*######
-## go_field_repair_bot_74A
-######*/
-
-bool GOHello_go_field_repair_bot_74A(Player *player, GameObject* _GO)
-{
- if(player->HasSkill(SKILL_ENGINERING) && player->GetBaseSkillValue(SKILL_ENGINERING) >= 300 && !player->HasSpell(22704))
- {
- player->CastSpell(player,22864,false);
- }
- return true;
-}
-
-/*######
-## go_orb_of_command
-######*/
-
-bool GOHello_go_orb_of_command(Player *player, GameObject* _GO)
-{
- if( player->GetQuestRewardStatus(7761) )
- player->CastSpell(player,23460,true);
-
- return true;
-}
-
-/*######
-## go_tablet_of_madness
-######*/
-
-bool GOHello_go_tablet_of_madness(Player *player, GameObject* _GO)
-{
- if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266))
- {
- player->CastSpell(player,24267,false);
- }
- return true;
-}
-
-/*######
-## go_tablet_of_the_seven
-######*/
-
-//TODO: use gossip option ("Transcript the Tablet") instead, if Trinity adds support.
-bool GOHello_go_tablet_of_the_seven(Player *player, GameObject* _GO)
-{
- if (_GO->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
- return true;
-
- if (player->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE)
- player->CastSpell(player,15065,false);
-
- return true;
-}
-
-/*######
-## go_teleporter
-######*/
-
-bool GOHello_go_teleporter(Player *player, GameObject* _GO)
-{
- player->TeleportTo(0, 1807.07f,336.105f,70.3975f,0.0f);
- return false;
-}
-
-void AddSC_go_scripts()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="go_northern_crystal_pylon";
- newscript->pGOHello = &GOHello_go_northern_crystal_pylon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_eastern_crystal_pylon";
- newscript->pGOHello = &GOHello_go_eastern_crystal_pylon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_western_crystal_pylon";
- newscript->pGOHello = &GOHello_go_western_crystal_pylon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_barov_journal";
- newscript->pGOHello = &GOHello_go_barov_journal;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_field_repair_bot_74A";
- newscript->pGOHello = &GOHello_go_field_repair_bot_74A;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_orb_of_command";
- newscript->pGOHello = &GOHello_go_orb_of_command;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_tablet_of_madness";
- newscript->pGOHello = GOHello_go_tablet_of_madness;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_tablet_of_the_seven";
- newscript->pGOHello = GOHello_go_tablet_of_the_seven;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="go_teleporter";
- newscript->pGOHello = GOHello_go_teleporter;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: GO_Scripts
+SD%Complete: 100
+SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296. Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089
+SDCategory: Game Objects
+EndScriptData */
+
+/* ContentData
+go_northern_crystal_pylon
+go_eastern_crystal_pylon
+go_western_crystal_pylon
+go_barov_journal
+go_field_repair_bot_74A
+go_orb_of_command
+go_tablet_of_madness
+go_tablet_of_the_seven
+go_teleporter
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## go_crystal_pylons (3x)
+######*/
+
+bool GOHello_go_northern_crystal_pylon(Player *player, GameObject* _GO)
+{
+ if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
+ {
+ player->PrepareQuestMenu(_GO->GetGUID());
+ player->SendPreparedQuest(_GO->GetGUID());
+ }
+
+ if (player->GetQuestStatus(4285) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(4285);
+
+ return true;
+}
+
+bool GOHello_go_eastern_crystal_pylon(Player *player, GameObject* _GO)
+{
+ if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
+ {
+ player->PrepareQuestMenu(_GO->GetGUID());
+ player->SendPreparedQuest(_GO->GetGUID());
+ }
+
+ if (player->GetQuestStatus(4287) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(4287);
+
+ return true;
+}
+
+bool GOHello_go_western_crystal_pylon(Player *player, GameObject* _GO)
+{
+ if (_GO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
+ {
+ player->PrepareQuestMenu(_GO->GetGUID());
+ player->SendPreparedQuest(_GO->GetGUID());
+ }
+
+ if (player->GetQuestStatus(4288) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(4288);
+
+ return true;
+}
+
+/*######
+## go_barov_journal
+######*/
+
+bool GOHello_go_barov_journal(Player *player, GameObject* _GO)
+{
+ if(player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !player->HasSpell(26086))
+ {
+ player->CastSpell(player,26095,false);
+ }
+ return true;
+}
+
+/*######
+## go_field_repair_bot_74A
+######*/
+
+bool GOHello_go_field_repair_bot_74A(Player *player, GameObject* _GO)
+{
+ if(player->HasSkill(SKILL_ENGINERING) && player->GetBaseSkillValue(SKILL_ENGINERING) >= 300 && !player->HasSpell(22704))
+ {
+ player->CastSpell(player,22864,false);
+ }
+ return true;
+}
+
+/*######
+## go_orb_of_command
+######*/
+
+bool GOHello_go_orb_of_command(Player *player, GameObject* _GO)
+{
+ if( player->GetQuestRewardStatus(7761) )
+ player->CastSpell(player,23460,true);
+
+ return true;
+}
+
+/*######
+## go_tablet_of_madness
+######*/
+
+bool GOHello_go_tablet_of_madness(Player *player, GameObject* _GO)
+{
+ if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266))
+ {
+ player->CastSpell(player,24267,false);
+ }
+ return true;
+}
+
+/*######
+## go_tablet_of_the_seven
+######*/
+
+//TODO: use gossip option ("Transcript the Tablet") instead, if Trinity adds support.
+bool GOHello_go_tablet_of_the_seven(Player *player, GameObject* _GO)
+{
+ if (_GO->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
+ return true;
+
+ if (player->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE)
+ player->CastSpell(player,15065,false);
+
+ return true;
+}
+
+/*######
+## go_teleporter
+######*/
+
+bool GOHello_go_teleporter(Player *player, GameObject* _GO)
+{
+ player->TeleportTo(0, 1807.07f,336.105f,70.3975f,0.0f);
+ return false;
+}
+
+void AddSC_go_scripts()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="go_northern_crystal_pylon";
+ newscript->pGOHello = &GOHello_go_northern_crystal_pylon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_eastern_crystal_pylon";
+ newscript->pGOHello = &GOHello_go_eastern_crystal_pylon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_western_crystal_pylon";
+ newscript->pGOHello = &GOHello_go_western_crystal_pylon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_barov_journal";
+ newscript->pGOHello = &GOHello_go_barov_journal;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_field_repair_bot_74A";
+ newscript->pGOHello = &GOHello_go_field_repair_bot_74A;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_orb_of_command";
+ newscript->pGOHello = &GOHello_go_orb_of_command;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_tablet_of_madness";
+ newscript->pGOHello = GOHello_go_tablet_of_madness;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_tablet_of_the_seven";
+ newscript->pGOHello = GOHello_go_tablet_of_the_seven;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="go_teleporter";
+ newscript->pGOHello = GOHello_go_teleporter;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/guard/guard_ai.cpp b/src/bindings/scripts/scripts/guard/guard_ai.cpp
index 7504ff49452..5777a886cbe 100644
--- a/src/bindings/scripts/scripts/guard/guard_ai.cpp
+++ b/src/bindings/scripts/scripts/guard/guard_ai.cpp
@@ -1,160 +1,160 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Guard_AI
-SD%Complete: 90
-SDComment:
-SDCategory: Guards
-EndScriptData */
-
-#include "precompiled.h"
-#include "guard_ai.h"
-
-// **** This script is for use within every single guard to save coding time ****
-
-#define GENERIC_CREATURE_COOLDOWN 5000
-
-void guardAI::Reset()
-{
- GlobalCooldown = 0;
- BuffTimer = 0; //Rebuff as soon as we can
-}
-
-void guardAI::Aggro(Unit *who)
-{
-}
-
-void guardAI::JustDied(Unit *Killer)
-{
- //Send Zone Under Attack message to the LocalDefense and WorldDefense Channels
- if( Killer->GetTypeId() == TYPEID_PLAYER )
- m_creature->SendZoneUnderAttackMessage((Player*)Killer);
- else if( Unit *owner = Killer->GetOwner() )
- {
- if( owner->GetTypeId() == TYPEID_PLAYER )
- m_creature->SendZoneUnderAttackMessage((Player*)owner);
- }
-}
-
-void guardAI::UpdateAI(const uint32 diff)
-{
- //Always decrease our global cooldown first
- if (GlobalCooldown > diff)
- GlobalCooldown -= diff;
- else GlobalCooldown = 0;
-
- //Buff timer (only buff when we are alive and not in combat
- if (m_creature->isAlive() && !InCombat)
- if (BuffTimer < diff )
- {
- //Find a spell that targets friendly and applies an aura (these are generally buffs)
- SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
-
- if (info && !GlobalCooldown)
- {
- //Cast the buff spell
- DoCastSpell(m_creature, info);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
-
- //Set our timer to 10 minutes before rebuff
- BuffTimer = 600000;
- } //Try agian in 30 seconds
- else BuffTimer = 30000;
- }else BuffTimer -= diff;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- // Make sure our attack is ready and we arn't currently casting
- if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
- {
- //If we are within range melee the target
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- bool Healing = false;
- SpellEntry const *info = NULL;
-
- //Select a healing spell if less than 30% hp
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
- info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
-
- //No healing spell available, select a hostile spell
- if (info) Healing = true;
- else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
-
- //20% chance to replace our white hit with a spell
- if (info && rand() % 5 == 0 && !GlobalCooldown)
- {
- //Cast the spell
- if (Healing)DoCastSpell(m_creature, info);
- else DoCastSpell(m_creature->getVictim(), info);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
- }
- else m_creature->AttackerStateUpdate(m_creature->getVictim());
-
- m_creature->resetAttackTimer();
- }
- }
- else
- {
- //Only run this code if we arn't already casting
- if (!m_creature->IsNonMeleeSpellCasted(false))
- {
- bool Healing = false;
- SpellEntry const *info = NULL;
-
- //Select a healing spell if less than 30% hp ONLY 33% of the time
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30 && rand() % 3 == 0)
- info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
-
- //No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
- if (info) Healing = true;
- else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, ATTACK_DISTANCE, 0, SELECT_EFFECT_DONTCARE);
-
- //Found a spell, check if we arn't on cooldown
- if (info && !GlobalCooldown)
- {
- //If we are currently moving stop us and set the movement generator
- if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType()!=IDLE_MOTION_TYPE)
- {
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MoveIdle();
- }
-
- //Cast spell
- if (Healing) DoCastSpell(m_creature,info);
- else DoCastSpell(m_creature->getVictim(),info);
-
- //Set our global cooldown
- GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
-
- } //If no spells available and we arn't moving run to target
- else if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType()!=TARGETED_MOTION_TYPE)
- {
- //Cancel our current spell and then mutate new movement generator
- m_creature->InterruptNonMeleeSpells(false);
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim());
- }
- }
- }
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Guard_AI
+SD%Complete: 90
+SDComment:
+SDCategory: Guards
+EndScriptData */
+
+#include "precompiled.h"
+#include "guard_ai.h"
+
+// **** This script is for use within every single guard to save coding time ****
+
+#define GENERIC_CREATURE_COOLDOWN 5000
+
+void guardAI::Reset()
+{
+ GlobalCooldown = 0;
+ BuffTimer = 0; //Rebuff as soon as we can
+}
+
+void guardAI::Aggro(Unit *who)
+{
+}
+
+void guardAI::JustDied(Unit *Killer)
+{
+ //Send Zone Under Attack message to the LocalDefense and WorldDefense Channels
+ if( Killer->GetTypeId() == TYPEID_PLAYER )
+ m_creature->SendZoneUnderAttackMessage((Player*)Killer);
+ else if( Unit *owner = Killer->GetOwner() )
+ {
+ if( owner->GetTypeId() == TYPEID_PLAYER )
+ m_creature->SendZoneUnderAttackMessage((Player*)owner);
+ }
+}
+
+void guardAI::UpdateAI(const uint32 diff)
+{
+ //Always decrease our global cooldown first
+ if (GlobalCooldown > diff)
+ GlobalCooldown -= diff;
+ else GlobalCooldown = 0;
+
+ //Buff timer (only buff when we are alive and not in combat
+ if (m_creature->isAlive() && !InCombat)
+ if (BuffTimer < diff )
+ {
+ //Find a spell that targets friendly and applies an aura (these are generally buffs)
+ SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
+
+ if (info && !GlobalCooldown)
+ {
+ //Cast the buff spell
+ DoCastSpell(m_creature, info);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+
+ //Set our timer to 10 minutes before rebuff
+ BuffTimer = 600000;
+ } //Try agian in 30 seconds
+ else BuffTimer = 30000;
+ }else BuffTimer -= diff;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ // Make sure our attack is ready and we arn't currently casting
+ if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //If we are within range melee the target
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ bool Healing = false;
+ SpellEntry const *info = NULL;
+
+ //Select a healing spell if less than 30% hp
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
+ info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
+
+ //No healing spell available, select a hostile spell
+ if (info) Healing = true;
+ else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
+
+ //20% chance to replace our white hit with a spell
+ if (info && rand() % 5 == 0 && !GlobalCooldown)
+ {
+ //Cast the spell
+ if (Healing)DoCastSpell(m_creature, info);
+ else DoCastSpell(m_creature->getVictim(), info);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+ }
+ else m_creature->AttackerStateUpdate(m_creature->getVictim());
+
+ m_creature->resetAttackTimer();
+ }
+ }
+ else
+ {
+ //Only run this code if we arn't already casting
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ bool Healing = false;
+ SpellEntry const *info = NULL;
+
+ //Select a healing spell if less than 30% hp ONLY 33% of the time
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30 && rand() % 3 == 0)
+ info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
+
+ //No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
+ if (info) Healing = true;
+ else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, ATTACK_DISTANCE, 0, SELECT_EFFECT_DONTCARE);
+
+ //Found a spell, check if we arn't on cooldown
+ if (info && !GlobalCooldown)
+ {
+ //If we are currently moving stop us and set the movement generator
+ if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType()!=IDLE_MOTION_TYPE)
+ {
+ (*m_creature).GetMotionMaster()->Clear(false);
+ (*m_creature).GetMotionMaster()->MoveIdle();
+ }
+
+ //Cast spell
+ if (Healing) DoCastSpell(m_creature,info);
+ else DoCastSpell(m_creature->getVictim(),info);
+
+ //Set our global cooldown
+ GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
+
+ } //If no spells available and we arn't moving run to target
+ else if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType()!=TARGETED_MOTION_TYPE)
+ {
+ //Cancel our current spell and then mutate new movement generator
+ m_creature->InterruptNonMeleeSpells(false);
+ (*m_creature).GetMotionMaster()->Clear(false);
+ (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim());
+ }
+ }
+ }
+}
diff --git a/src/bindings/scripts/scripts/guard/guard_ai.h b/src/bindings/scripts/scripts/guard/guard_ai.h
index a6ba365e9a6..57e7bdc226b 100644
--- a/src/bindings/scripts/scripts/guard/guard_ai.h
+++ b/src/bindings/scripts/scripts/guard/guard_ai.h
@@ -1,25 +1,25 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef SC_GUARDAI_H
-#define SC_GUARDAI_H
-
-#define GENERIC_CREATURE_COOLDOWN 5000
-
-struct TRINITY_DLL_DECL guardAI : public ScriptedAI
-{
- guardAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
- uint32 BuffTimer; //This variable keeps track of buffs
-
- void Reset();
-
- void Aggro(Unit *who);
-
- void JustDied(Unit *Killer);
-
- void UpdateAI(const uint32 diff);
-};
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef SC_GUARDAI_H
+#define SC_GUARDAI_H
+
+#define GENERIC_CREATURE_COOLDOWN 5000
+
+struct TRINITY_DLL_DECL guardAI : public ScriptedAI
+{
+ guardAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
+ uint32 BuffTimer; //This variable keeps track of buffs
+
+ void Reset();
+
+ void Aggro(Unit *who);
+
+ void JustDied(Unit *Killer);
+
+ void UpdateAI(const uint32 diff);
+};
+#endif
diff --git a/src/bindings/scripts/scripts/guard/guards.cpp b/src/bindings/scripts/scripts/guard/guards.cpp
index b0565b9bf3e..a6922be362d 100644
--- a/src/bindings/scripts/scripts/guard/guards.cpp
+++ b/src/bindings/scripts/scripts/guard/guards.cpp
@@ -1,4117 +1,4117 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Guards
-SD%Complete: 100
-SDComment: All Guard gossip data, quite some npc_text-id's still missing, adding constantly as new id's are known. CombatAI should be organized better for future.
-SDCategory: Guards
-EndScriptData */
-
-/* ContentData
-guard_azuremyst
-guard_bluffwatcher
-guard_contested
-guard_darnassus
-guard_dunmorogh
-guard_durotar
-guard_elwynnforest
-guard_eversong
-guard_exodar
-guard_ironforge
-guard_mulgore
-guard_orgrimmar
-guard_shattrath
-guard_shattrath_aldor
-guard_shattrath_scryer
-guard_silvermoon
-guard_stormwind
-guard_teldrassil
-guard_tirisfal
-guard_undercity
-EndContentData */
-
-#include "precompiled.h"
-#include "guard_ai.h"
-
-//script spesific action
-#define GOSSIP_ACTION_TAVERN 101
-#define GOSSIP_ACTION_GEMMERCHANT 102
-#define GOSSIP_ACTION_MANALOOM 103
-
-//script spesific sender
-#define GOSSIP_SENDER_SEC_GEMMERCHANT 101
-#define GOSSIP_SENDER_SEC_AUCTIONHOUSE 102
-
-//script spesific gossip text
-#define GOSSIP_TEXT_TAVERN "Worlds End Tavern"
-#define GOSSIP_TEXT_BANKSCYERS "Scyers bank"
-#define GOSSIP_TEXT_BANKALDOR "Aldor Bank"
-#define GOSSIP_TEXT_INNSCYERS "Scyers Inn"
-#define GOSSIP_TEXT_INNALDOR "Aldor Inn"
-#define GOSSIP_TEXT_STABLESCYERS "Scyers Stable"
-#define GOSSIP_TEXT_STABLEALDOR "Aldor Stable"
-#define GOSSIP_TEXT_BATTLEMASTERALLIANCE "Alliance Battlemasters"
-#define GOSSIP_TEXT_BATTLEMASTERHORDE "Horde Battlemasters"
-#define GOSSIP_TEXT_BATTLEMASTERARENA "Arena Battlemasters"
-#define GOSSIP_TEXT_MANALOOM "Mana Loom"
-#define GOSSIP_TEXT_ALCHEMYLAB "Alchemy Lab"
-#define GOSSIP_TEXT_GEMMERCHANT "Gem Merchant"
-#define GOSSIP_TEXT_GEMSCYERS "Scyers Gem Merchant"
-#define GOSSIP_TEXT_GEMALDOR "Aldor Gem Merchant"
-
-#define GOSSIP_TEXT_AH_SILVERMOON_1 "Western Auction House"
-#define GOSSIP_TEXT_AH_SILVERMOON_2 "Royal Exchange Auction House"
-
-#define GOSSIP_TEXT_INN_SILVERMOON_1 "Silvermoon City Inn"
-#define GOSSIP_TEXT_INN_SILVERMOON_2 "Wayfarer's Rest tavern"
-
-//common used for guards in main cities
-void DoReplyToTextEmote(Creature *_Creature,uint32 em)
-{
- switch(em)
- {
- case TEXTEMOTE_KISS: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
- case TEXTEMOTE_WAVE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
- case TEXTEMOTE_SALUTE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break;
- case TEXTEMOTE_SHY: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break;
- case TEXTEMOTE_RUDE:
- case TEXTEMOTE_CHICKEN: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
- }
-}
-
-/*******************************************************
- * guard_azuremyst start
- *******************************************************/
-
-bool GossipHello_guard_azuremyst(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(10066,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(-3918.95, -11544.7, 6, 6, 0, "Bank");
- player->SEND_GOSSIP_MENU(10067,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hippogryph Master
- player->SEND_POI(-4057.15, -11788.6, 6, 6, 0, "Stephanos");
- player->SEND_GOSSIP_MENU(10071,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(-4092.43, -11626.6, 6, 6, 0, "Funaam");
- player->SEND_GOSSIP_MENU(10073,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-4129.43, -12469, 6, 6, 0, "Caregiver Chellan");
- player->SEND_GOSSIP_MENU(10074,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
- player->SEND_POI(-4146.42, -12492.7, 6, 6, 0, "Esbina");
- player->SEND_GOSSIP_MENU(10075,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(10076,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(10087,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-4274.81, -11495.3, 6, 6, 0, "Shalannius");
- player->SEND_GOSSIP_MENU(10077,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-4203.65, -12526.5, 6, 6, 0, "Acteon");
- player->SEND_GOSSIP_MENU(10078,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-4149.62, -12530.1, 6, 6, 0, "Semid");
- player->SEND_GOSSIP_MENU(10081,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(-4138.98, -12468.5, 6, 6, 0, "Tullas");
- player->SEND_GOSSIP_MENU(10083,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-4131.66, -12478.6, 6, 6, 0, "Guvan");
- player->SEND_GOSSIP_MENU(10084,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Shaman
- player->SEND_POI(-4162.33, -12456.1, 6, 6, 0, "Tuluun");
- player->SEND_GOSSIP_MENU(10085,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-4165.05, -12536.4, 6, 6, 0, "Ruada");
- player->SEND_GOSSIP_MENU(10086,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-4191.15, -12470, 6, 6, 0, "Daedal");
- player->SEND_GOSSIP_MENU(10088,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-4726.29, -12387, 6, 6, 0, "Blacksmith Calypso");
- player->SEND_GOSSIP_MENU(10089,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-4710.87, -12400.6, 6, 6, 0, "'Cookie' McWeaksauce");
- player->SEND_GOSSIP_MENU(10090,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-3882.85, -11496.7, 6, 6, 0, "Nahogg");
- player->SEND_GOSSIP_MENU(10091,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-4157.57, -12470.2, 6, 6, 0, "Artificer Daelo");
- player->SEND_GOSSIP_MENU(10092,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-4199.11, -12469.9, 6, 6, 0, "Anchorite Fateema");
- player->SEND_GOSSIP_MENU(10093,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-4266.38, -12985.1, 6, 6, 0, "Diktynna");
- player->SEND_GOSSIP_MENU(10094,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_GOSSIP_MENU(10095,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Jewelcrafting
- player->SEND_POI(-3781.55, -11541.8, 6, 6, 0, "Farii");
- player->SEND_GOSSIP_MENU(10097,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
- player->SEND_POI(-3442.68, -12322.2, 6, 6, 0, "Moordo");
- player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Mining
- player->SEND_POI(-4179.89, -12493.1, 6, 6, 0, "Dulvi");
- player->SEND_GOSSIP_MENU(10097,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
- player->SEND_POI(-3431.17, -12316.5, 6, 6, 0, "Gurf");
- player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
- player->SEND_POI(-4711.54, -12386.7, 6, 6, 0, "Erin Kelly");
- player->SEND_GOSSIP_MENU(10099,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_azuremyst(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_azuremyst(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_azuremyst(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_azuremyst(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_azuremyst end
- *******************************************************/
-
-CreatureAI* GetAI_guard_azuremyst(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_bluffwatcher start
- *******************************************************/
-
-bool GossipHello_guard_bluffwatcher(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(-1257.8, 24.14, 6, 6, 0, "Thunder Bluff Bank");
- player->SEND_GOSSIP_MENU(1292,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Wind master
- player->SEND_POI(-1196.43, 28.26, 6, 6, 0, "Wind Rider Roost");
- player->SEND_GOSSIP_MENU(1293,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(-1296.5, 127.57, 6, 6, 0, "Thunder Bluff Civic Information");
- player->SEND_GOSSIP_MENU(1291,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-1296, 39.7, 6, 6, 0, "Thunder Bluff Inn");
- player->SEND_GOSSIP_MENU(3153,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(-1263.59, 44.36, 6, 6, 0, "Thunder Bluff Mailbox");
- player->SEND_GOSSIP_MENU(3154,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Auction House
- player->SEND_POI(1381.77, -4371.16, 6, 6, 0, GOSSIP_TEXT_AUCTIONHOUSE);
- player->SEND_GOSSIP_MENU(3155,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Weapon master
- player->SEND_POI(-1282.31, 89.56, 6, 6, 0, "Ansekhwa");
- player->SEND_GOSSIP_MENU(4520,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Stable master
- player->SEND_POI(-1270.19, 48.84, 6, 6, 0, "Bulrug");
- player->SEND_GOSSIP_MENU(5977,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7527,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(3542,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(3541,_Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-1387.82, -97.55, 6, 6, 0, "Taim Ragetotem");
- player->SEND_GOSSIP_MENU(7522,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-997, 214.12, 6, 6, 0, "Martin Lindsey");
- player->SEND_GOSSIP_MENU(7648,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(-1384.94, -75.91, 6, 6, 0, "Kergul Bloodaxe");
- player->SEND_GOSSIP_MENU(7523,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-1054.47, -285, 6, 6, 0, "Hall of Elders");
- player->SEND_GOSSIP_MENU(1294,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall");
- player->SEND_GOSSIP_MENU(1295,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision");
- player->SEND_GOSSIP_MENU(1296,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Priest
- player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision");
- player->SEND_GOSSIP_MENU(1297,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Shaman
- player->SEND_POI(-989.54, 278.25, 6, 6, 0, "Hall of Spirits");
- player->SEND_GOSSIP_MENU(1298,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Warrior
- player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall");
- player->SEND_GOSSIP_MENU(1299,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1085.56, 27.29, 6, 6, 0, "Bena's Alchemy");
- player->SEND_GOSSIP_MENU(1332,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1239.75, 104.88, 6, 6, 0, "Karn's Smithy");
- player->SEND_GOSSIP_MENU(1333,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-1214.5, -21.23, 6, 6, 0, "Aska's Kitchen");
- player->SEND_GOSSIP_MENU(1334,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-1112.65, 48.26, 6, 6, 0, "Dawnstrider Enchanters");
- player->SEND_GOSSIP_MENU(1335,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-996.58, 200.5, 6, 6, 0, "Spiritual Healing");
- player->SEND_GOSSIP_MENU(1336,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
- player->SEND_POI(-1169.35, -68.87, 6, 6, 0, "Mountaintop Bait & Tackle");
- player->SEND_GOSSIP_MENU(1337,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
- player->SEND_POI(-1137.7, -1.51, 6, 6, 0, "Holistic Herbalism");
- player->SEND_GOSSIP_MENU(1338,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking
- player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers");
- player->SEND_GOSSIP_MENU(1339,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Mining
- player->SEND_POI(-1249.17, 155, 6, 6, 0, "Stonehoof Geology");
- player->SEND_GOSSIP_MENU(1340,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Skinning
- player->SEND_POI(-1148.56, 51.18, 6, 6, 0, "Mooranta");
- player->SEND_GOSSIP_MENU(1343,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring
- player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers");
- player->SEND_GOSSIP_MENU(1341,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_bluffwatcher(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_bluffwatcher(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_bluffwatcher(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_bluffwatcher(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_bluffwatcher end
- *******************************************************/
-
-CreatureAI* GetAI_guard_bluffwatcher(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_contested start
- *******************************************************/
-
-struct TRINITY_DLL_DECL guard_contested : public guardAI
-{
- guard_contested(Creature *c) : guardAI(c) {}
-
- void MoveInLineOfSight(Unit *who)
- {
- if ( who->isAttackingPlayer() )
- {
- if(who->GetTypeId() == TYPEID_PLAYER || who->GetOwnerGUID() && GUID_HIPART(who->GetOwnerGUID())==HIGHGUID_PLAYER)
- {
- m_creature->AddThreat(who, 0.0f);
- if(Unit* owner = who->GetOwner())
- m_creature->AddThreat(owner, 0.0f);
-
- if(!m_creature->isInCombat())
- {
- if (m_creature->GetEntry() == 15184) //Cenarion Hold Infantry
- {
- srand (time(NULL));
- if (rand()%100 <= 30)
- {
- DoSay("Taste blade, mongrel!", LANG_UNIVERSAL,NULL);
- }
- else if (rand()%100 > 30 && rand()%100 < 50)
- {
- DoSay("Please tell me that you didn`t just do what I think you just did. Please tell me that I`m not going to have to hurt you...", LANG_UNIVERSAL,NULL);
- }
- else if (rand()%100 >= 50)
- {
- DoSay("As if we don`t have enough problems, you go and create more!", LANG_UNIVERSAL,NULL);
- }
- }
- else
- {
- SpellEntry const *spell = m_creature->reachWithSpellAttack(who);
- DoCastSpell(who, spell);
- }
- }
- DoStartAttackAndMovement(who);
- }
- }
- }
-};
-/*******************************************************
- * guard_contested end
- *******************************************************/
-
-CreatureAI* GetAI_guard_contested(Creature *_Creature)
-{
- return new guard_contested (_Creature);
-}
-
-/*******************************************************
- * guard_darnassus start
- *******************************************************/
-
-bool GossipHello_guard_darnassus(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(3016, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
- player->SEND_POI(9861.23, 2334.55, 6, 6, 0, "Darnassus Auction House");
- player->SEND_GOSSIP_MENU(3833, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(9938.45, 2512.35, 6, 6, 0, "Darnassus Bank");
- player->SEND_GOSSIP_MENU(3017, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Wind master
- player->SEND_POI(9945.65, 2618.94, 6, 6, 0, "Rut'theran Village");
- player->SEND_GOSSIP_MENU(3018, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Guild master
- player->SEND_POI(10076.40, 2199.59, 6, 6, 0, "Darnassus Guild Master");
- player->SEND_GOSSIP_MENU(3019, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Inn
- player->SEND_POI(10133.29, 2222.52, 6, 6, 0, "Darnassus Inn");
- player->SEND_GOSSIP_MENU(3020, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox
- player->SEND_POI(9942.17, 2495.48, 6, 6, 0, "Darnassus Mailbox");
- player->SEND_GOSSIP_MENU(3021, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Stable master
- player->SEND_POI(10167.20, 2522.66, 6, 6, 0, "Alassin");
- player->SEND_GOSSIP_MENU(5980, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer
- player->SEND_POI(9907.11, 2329.70, 6, 6, 0, "Ilyenia Moonfire");
- player->SEND_GOSSIP_MENU(4517, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7519, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(4264, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->SEND_GOSSIP_MENU(4273, _Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(9923.61, 2327.43, 6, 6, 0, "Brogun Stoneshield");
- player->SEND_GOSSIP_MENU(7518, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(9977.37, 2324.39, 6, 6, 0, "Keras Wolfheart");
- player->SEND_GOSSIP_MENU(7651, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(9979.84, 2315.79, 6, 6, 0, "Aethalas");
- player->SEND_GOSSIP_MENU(7482, _Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(10186, 2570.46, 6, 6, 0, "Darnassus Druid Trainer");
- player->SEND_GOSSIP_MENU(3024, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(10177.29, 2511.10, 6, 6, 0, "Darnassus Hunter Trainer");
- player->SEND_GOSSIP_MENU(3023, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(9659.12, 2524.88, 6, 6, 0, "Temple of the Moon");
- player->SEND_GOSSIP_MENU(3025, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
- player->SEND_POI(10122, 2599.12, 6, 6, 0, "Darnassus Rogue Trainer");
- player->SEND_GOSSIP_MENU(3026, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(9951.91, 2280.38, 6, 6, 0, "Warrior's Terrace");
- player->SEND_GOSSIP_MENU(3033, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(10075.90, 2356.76, 6, 6, 0, "Darnassus Alchemy Trainer");
- player->SEND_GOSSIP_MENU(3035, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Cooking
- player->SEND_POI(10088.59, 2419.21, 6, 6, 0, "Darnassus Cooking Trainer");
- player->SEND_GOSSIP_MENU(3036, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting
- player->SEND_POI(10146.09, 2313.42, 6, 6, 0, "Darnassus Enchanting Trainer");
- player->SEND_GOSSIP_MENU(3337, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //First Aid
- player->SEND_POI(10150.09, 2390.43, 6, 6, 0, "Darnassus First Aid Trainer");
- player->SEND_GOSSIP_MENU(3037, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Fishing
- player->SEND_POI(9836.20, 2432.17, 6, 6, 0, "Darnassus Fishing Trainer");
- player->SEND_GOSSIP_MENU(3038, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism
- player->SEND_POI(9757.17, 2430.16, 6, 6, 0, "Darnassus Herbalism Trainer");
- player->SEND_GOSSIP_MENU(3039, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(10086.59, 2255.77, 6, 6, 0, "Darnassus Leatherworking Trainer");
- player->SEND_GOSSIP_MENU(3040, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(10081.40, 2257.18, 6, 6, 0, "Darnassus Skinning Trainer");
- player->SEND_GOSSIP_MENU(3042, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring
- player->SEND_POI(10079.70, 2268.19, 6, 6, 0, "Darnassus Tailor");
- player->SEND_GOSSIP_MENU(3044, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_darnassus(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_darnassus(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_darnassus(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_darnassus(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_darnassus(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_darnassus end
- *******************************************************/
-
-CreatureAI* GetAI_guard_darnassus(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_dunmorogh start
- *******************************************************/
-
-bool GossipHello_guard_dunmorogh(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(4287,_Creature->GetGUID());
-
- return true;
-}
-
-void SendDefaultMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4288,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Gryphon master
- player->SEND_GOSSIP_MENU(4289,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_GOSSIP_MENU(4290,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-5582.66, -525.89, 6, 6, 0, "Thunderbrew Distillery");
- player->SEND_GOSSIP_MENU(4291,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
- player->SEND_POI(-5604, -509.58, 6, 6, 0, "Shelby Stoneflint");
- player->SEND_GOSSIP_MENU(5985,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(4292,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(4300,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(-5618.29, -454.25, 6, 6, 0, "Grif Wildheart");
- player->SEND_GOSSIP_MENU(4293,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Magis Sparkmantle");
- player->SEND_GOSSIP_MENU(4294,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Paladin
- player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Azar Stronghammer");
- player->SEND_GOSSIP_MENU(4295,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Priest
- player->SEND_POI(-5591.74, -525.61, 6, 6, 0, "Maxan Anvol");
- player->SEND_GOSSIP_MENU(4296,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
- player->SEND_POI(-5602.75, -542.4, 6, 6, 0, "Hogral Bakkan");
- player->SEND_GOSSIP_MENU(4297,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(-5641.97, -523.76, 6, 6, 0, "Gimrizz Shadowcog");
- player->SEND_GOSSIP_MENU(4298,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-5604.79, -529.38, 6, 6, 0, "Granis Swiftaxe");
- player->SEND_GOSSIP_MENU(4299,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_GOSSIP_MENU(4301,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-5584.72, -428.41, 6, 6, 0, "Tognus Flintfire");
- player->SEND_GOSSIP_MENU(4302,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-5596.85, -541.43, 6, 6, 0, "Gremlock Pilsnor");
- player->SEND_GOSSIP_MENU(4303,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_GOSSIP_MENU(4304,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-5531, -666.53, 6, 6, 0, "Bronk Guzzlegear");
- player->SEND_GOSSIP_MENU(4305,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-5603.67, -523.57, 6, 6, 0, "Thamner Pol");
- player->SEND_GOSSIP_MENU(4306,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-5199.9, 58.58, 6, 6, 0, "Paxton Ganter");
- player->SEND_GOSSIP_MENU(4307,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_GOSSIP_MENU(4308,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_GOSSIP_MENU(4310,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(-5531, -666.53, 6, 6, 0, "Yarr Hamerstone");
- player->SEND_GOSSIP_MENU(4311,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_GOSSIP_MENU(4312,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_GOSSIP_MENU(4313,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_dunmorogh(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_dunmorogh(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_dunmorogh(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_dunmorogh(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_dunmorogh end
- *******************************************************/
-
-CreatureAI* GetAI_guard_dunmorogh(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_durotar start
- *******************************************************/
-
-bool GossipHello_guard_durotar(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(4037,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4032,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Wind rider
- player->SEND_GOSSIP_MENU(4033,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(338.7, -4688.87, 6, 6, 0, "Razor Hill Inn");
- player->SEND_GOSSIP_MENU(4034,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Stable master
- player->SEND_POI(330.31, -4710.66, 6, 6, 0, "Shoja'my");
- player->SEND_GOSSIP_MENU(5973,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(4035,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(4036,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(276, -4706.72, 6, 6, 0, "Thotar");
- player->SEND_GOSSIP_MENU(4013,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(-839.33, -4935.6, 6, 6, 0, "Un'Thuwa");
- player->SEND_GOSSIP_MENU(4014,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(296.22, -4828.1, 6, 6, 0, "Tai'jin");
- player->SEND_GOSSIP_MENU(4015,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
- player->SEND_POI(265.76, -4709, 6, 6, 0, "Kaplak");
- player->SEND_GOSSIP_MENU(4016,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Shaman
- player->SEND_POI(307.79, -4836.97, 6, 6, 0, "Swart");
- player->SEND_GOSSIP_MENU(4017,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(355.88, -4836.45, 6, 6, 0, "Dhugru Gorelust");
- player->SEND_GOSSIP_MENU(4018,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(312.3, -4824.66, 6, 6, 0, "Tarshaw Jaggedscar");
- player->SEND_GOSSIP_MENU(4019,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-800.25, -4894.33, 6, 6, 0, "Miao'zan");
- player->SEND_GOSSIP_MENU(4020,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(373.24, -4716.45, 6, 6, 0, "Dwukk");
- player->SEND_GOSSIP_MENU(4021,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_GOSSIP_MENU(4022,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_GOSSIP_MENU(4023,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(368.95, -4723.95, 6, 6, 0, "Mukdrak");
- player->SEND_GOSSIP_MENU(4024,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(327.17, -4825.62, 6, 6, 0, "Rawrk");
- player->SEND_GOSSIP_MENU(4025,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-1065.48, -4777.43, 6, 6, 0, "Lau'Tiki");
- player->SEND_GOSSIP_MENU(4026,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-836.25, -4896.89, 6, 6, 0, "Mishiki");
- player->SEND_GOSSIP_MENU(4027,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_GOSSIP_MENU(4028,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(366.94, -4705, 6, 6, 0, "Krunn");
- player->SEND_GOSSIP_MENU(4029,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_GOSSIP_MENU(4030,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_GOSSIP_MENU(4031,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_durotar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_durotar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_durotar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_durotar(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_durotar end
- *******************************************************/
-
-CreatureAI* GetAI_guard_durotar(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_elwynnforest start
- *******************************************************/
-
-bool GossipHello_guard_elwynnforest(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(933,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4260,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Gryphon master
- player->SEND_GOSSIP_MENU(4261,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_GOSSIP_MENU(4262,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-9459.34, 42.08, 6, 6, 0, "Lion's Pride Inn");
- player->SEND_GOSSIP_MENU(4263,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
- player->SEND_POI(-9466.62, 45.87, 6, 6, 0, "Erma");
- player->SEND_GOSSIP_MENU(5983,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(4264,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(4273,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_GOSSIP_MENU(4265,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_GOSSIP_MENU(4266,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-9471.12, 33.44, 6, 6, 0, "Zaldimar Wefhellt");
- player->SEND_GOSSIP_MENU(4268,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(-9469, 108.05, 6, 6, 0, "Brother Wilhelm");
- player->SEND_GOSSIP_MENU(4269,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-9461.07, 32.6, 6, 6, 0, "Priestess Josetta");
- player->SEND_GOSSIP_MENU(4267,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
- player->SEND_POI(-9465.13, 13.29, 6, 6, 0, "Keryn Sylvius");
- player->SEND_GOSSIP_MENU(4270,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
- player->SEND_POI(-9473.21, -4.08, 6, 6, 0, "Maximillian Crowe");
- player->SEND_GOSSIP_MENU(4272,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Warrior
- player->SEND_POI(-9461.82, 109.50, 6, 6, 0, "Lyria Du Lac");
- player->SEND_GOSSIP_MENU(4271,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-9057.04, 153.63, 6, 6, 0, "Alchemist Mallory");
- player->SEND_GOSSIP_MENU(4274,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-9456.58, 87.90, 6, 6, 0, "Smith Argus");
- player->SEND_GOSSIP_MENU(4275,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-9467.54, -3.16, 6, 6, 0, "Tomas");
- player->SEND_GOSSIP_MENU(4276,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_GOSSIP_MENU(4277,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_GOSSIP_MENU(4278,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-9456.82, 30.49, 6, 6, 0, "Michelle Belle");
- player->SEND_GOSSIP_MENU(4279,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-9386.54, -118.73, 6, 6, 0, "Lee Brown");
- player->SEND_GOSSIP_MENU(4280,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-9060.70, 149.23, 6, 6, 0, "Herbalist Pomeroy");
- player->SEND_GOSSIP_MENU(4281,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Adele Fielder");
- player->SEND_GOSSIP_MENU(4282,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_GOSSIP_MENU(4283,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(-9536.91, -1212.76, 6, 6, 0, "Helene Peltskinner");
- player->SEND_GOSSIP_MENU(4284,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Eldrin");
- player->SEND_GOSSIP_MENU(4285,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_elwynnforest(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_elwynnforest(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_elwynnforest(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_elwynnforest(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_elwynnforest end
- *******************************************************/
-
-CreatureAI* GetAI_guard_elwynnforest(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_eversong start
- *******************************************************/
-
-bool GossipHello_guard_eversong(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bat Handler
- player->SEND_POI(9371.93, -7164.80, 6, 6, 0, "Skymistress Gloaming");
- player->SEND_GOSSIP_MENU(10181,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Guild master
- player->SEND_GOSSIP_MENU(10182,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(9483.74, -6844.58, 6, 6, 0, "Delaniel's inn");
- player->SEND_GOSSIP_MENU(10183,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master
- player->SEND_POI(9489.62, -6829.93, 6, 6, 0, "Anathos");
- player->SEND_GOSSIP_MENU(10184,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_GOSSIP_MENU(10185,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(9527.44, -6865.25, 6, 6, 0, "Hannovia");
- player->SEND_GOSSIP_MENU(10186,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(9464.24, -6855.52, 6, 6, 0, "Garridel");
- player->SEND_GOSSIP_MENU(10187,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(9517.61, -6871.04, 6, 6, 0, "Noellene");
- player->SEND_GOSSIP_MENU(10189,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(9467.39, -6845.72, 6, 6, 0, "Ponaris");
- player->SEND_GOSSIP_MENU(10190,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
- player->SEND_POI(9533.67, -6877.39, 6, 6, 0, "Tannaria");
- player->SEND_GOSSIP_MENU(10191,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
- player->SEND_POI(9468.99, -6865.60, 6, 6, 0, "Celoenus");
- player->SEND_GOSSIP_MENU(10192,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(8659.90, -6368.12, 6, 6, 0, "Arcanist Sheynathren");
- player->SEND_GOSSIP_MENU(10193,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(8984.21, -7419.21, 6, 6, 0, "Arathel Sunforge");
- player->SEND_GOSSIP_MENU(10194,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(9494.04, -6881.51, 6, 6, 0, "Quarelestra");
- player->SEND_GOSSIP_MENU(10195,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Engineering
- player->SEND_GOSSIP_MENU(10197,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(9479.46, -6879.16, 6, 6, 0, "Kanaria");
- player->SEND_GOSSIP_MENU(10198,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
- player->SEND_GOSSIP_MENU(10199,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
- player->SEND_POI(8678.92, -6329.09, 6, 6, 0, "Botanist Tyniarrel");
- player->SEND_GOSSIP_MENU(10200,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
- player->SEND_POI(9484.32, -6874.98, 6, 6, 0, "Aleinia");
- player->SEND_GOSSIP_MENU(10203,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Sathein");
- player->SEND_GOSSIP_MENU(10204,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_GOSSIP_MENU(10205,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Mathreyn");
- player->SEND_GOSSIP_MENU(10206,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(8680.36, -6327.51, 6, 6, 0, "Sempstress Ambershine");
- player->SEND_GOSSIP_MENU(10207,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_eversong(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_eversong(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_eversong(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_eversong(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_eversong end
- *******************************************************/
-
-CreatureAI* GetAI_guard_eversong(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_exodar start
- *******************************************************/
-
-bool GossipHello_guard_exodar(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(9551, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
- player->SEND_POI(-4023.6, -11739.3, 6, 6, 0, "Exodar Auction House");
- player->SEND_GOSSIP_MENU(9528, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-3923.89, -11544.5, 6, 6, 0, "Exodar Bank");
- player->SEND_GOSSIP_MENU(9529, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(-4092.57, -11626.5, 6, 6, 0, "Exodar Guild Master");
- player->SEND_GOSSIP_MENU(9539, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Hippogryph master
- player->SEND_POI(-4060.46, -11787.1, 6, 6, 0, "Exodar Hippogryph Master");
- player->SEND_GOSSIP_MENU(9530, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Inn
- player->SEND_POI(-3741.87, -11695.1, 6, 6, 0, "Exodar Inn");
- player->SEND_GOSSIP_MENU(9545, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox
- player->SEND_POI(-3972.5, -11696.0, 6, 6, 0, "Mailbox");
- player->SEND_GOSSIP_MENU(10254, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Stable master
- player->SEND_POI(-3786.5, -11702.5, 6, 6, 0, "Stable Master Arthaid");
- player->SEND_GOSSIP_MENU(9558, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer
- player->SEND_POI(-4215.68, -11628.9, 6, 6, 0, "Weapon Master Handiir");
- player->SEND_GOSSIP_MENU(9565, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_EYEOFTHESTORM , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(9533, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(9555, _Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Alterac Valley Battlemaster");
- player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-3998.9, -11345.2, 6, 6, 0, "Arathi Basin Battlemaster");
- player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //A
- player->SEND_POI(-3759.27, -11695.63, 6, 6, 0, "Miglik Blotstrom");
- player->SEND_GOSSIP_MENU(10223, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //EOS
- player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Eye Of The Storm Battlemaster");
- player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //WSG
- player->SEND_POI(-3977.5, -11381.2, 6, 6, 0, "Warsong Gulch Battlemaster");
- player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-4276.0, -11495, 6, 6, 0, "Exodar Druid Trainer");
- player->SEND_GOSSIP_MENU(9534, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-4210.6, -11575.2, 6, 6, 0, "Exodar Hunter Trainer");
- player->SEND_GOSSIP_MENU(9544, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-4057.32, -11556.5, 6, 6, 0, "Exodar Mage Trainer");
- player->SEND_GOSSIP_MENU(9550, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(-4191.2, -11470.4, 6, 6, 0, "Exodar Paladin Trainer");
- player->SEND_GOSSIP_MENU(9553, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-3969.63, -11482.8, 6, 6, 0, "Exodar Priest Trainer");
- player->SEND_GOSSIP_MENU(9554, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Shaman
- player->SEND_POI(-3805.5, -11380.7, 6, 6, 0, "Exodar Shaman Trainer");
- player->SEND_GOSSIP_MENU(9556, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-4189.43, -11653.7, 6, 6, 0, "Exodar Warrior Trainer");
- player->SEND_GOSSIP_MENU(9562, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Alchemy Trainer");
- player->SEND_GOSSIP_MENU(9527, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-4229.5, -11706, 6, 6, 0, "Exodar Blacksmithing Trainer");
- player->SEND_GOSSIP_MENU(9532, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-3798.3, -11651.7, 6, 6, 0, "Exodar Cooking Trainer");
- player->SEND_GOSSIP_MENU(9551, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-3889.3, -11495, 6, 6, 0, "Exodar Enchanting Trainer");
- player->SEND_GOSSIP_MENU(9535, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-4257.68, -11640.3, 6, 6, 0, "Exodar Engineering Trainer");
- player->SEND_GOSSIP_MENU(9536, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-3769.5, -11479.6, 6, 6, 0, "Exodar First Aid Trainer");
- player->SEND_GOSSIP_MENU(9537, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-3725.5, -11385.2, 6, 6, 0, "Exodar Fishing Trainer");
- player->SEND_GOSSIP_MENU(9538, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
- player->SEND_POI(-3783, -11546, 6, 6, 0, "Exodar Jewelcrafting Trainer");
- player->SEND_GOSSIP_MENU(9547, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism
- player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Herbalist Trainer");
- player->SEND_GOSSIP_MENU(9543, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
- player->SEND_POI(-4140.6, -11776.7, 6, 6, 0, "Exodar Leatherworking Trainer");
- player->SEND_GOSSIP_MENU(9549, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Mining
- player->SEND_POI(-4228, -11697, 6, 6, 0, "Exodar Mining Trainer");
- player->SEND_GOSSIP_MENU(9552, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
- player->SEND_POI(-4134.97, -11760.5, 6, 6, 0, "Exodar Skinning Trainer");
- player->SEND_GOSSIP_MENU(9557, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
- player->SEND_POI(-4092.5, -11744.5, 6, 6, 0, "Exodar Tailor Trainer");
- player->SEND_GOSSIP_MENU(9559, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_exodar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_exodar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_exodar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_exodar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_exodar(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_exodar end
- *******************************************************/
-
-CreatureAI* GetAI_guard_exodar(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_ironforge start
- *******************************************************/
-
-bool GossipHello_guard_ironforge(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_IRONFORGE_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DEEPRUNTRAM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(2760, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Auction House
- player->SEND_POI(-4957.39, -911.6, 6, 6, 0, "Ironforge Auction House");
- player->SEND_GOSSIP_MENU(3014, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-4891.91, -991.47, 6, 6, 0, "The Vault");
- player->SEND_GOSSIP_MENU(2761, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Tram
- player->SEND_POI(-4835.27, -1294.69, 6, 6, 0, "Deeprun Tram");
- player->SEND_GOSSIP_MENU(3814, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Gryphon Master
- player->SEND_POI(-4821.52, -1152.3, 6, 6, 0, "Ironforge Gryphon Master");
- player->SEND_GOSSIP_MENU(2762, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Guild Master
- player->SEND_POI(-5021, -996.45, 6, 6, 0, "Ironforge Visitor's Center");
- player->SEND_GOSSIP_MENU(2764, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Inn
- player->SEND_POI(-4850.47, -872.57, 6, 6, 0, "Stonefire Tavern");
- player->SEND_GOSSIP_MENU(2768, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox
- player->SEND_POI(-4845.7, -880.55, 6, 6, 0, "Ironforge Mailbox");
- player->SEND_GOSSIP_MENU(2769, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master
- player->SEND_POI(-5010.2, -1262, 6, 6, 0, "Ulbrek Firehand");
- player->SEND_GOSSIP_MENU(5986, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Weapons Trainer
- player->SEND_POI(-5040, -1201.88, 6, 6, 0, "Bixi and Buliwyf");
- player->SEND_GOSSIP_MENU(4518, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7529, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Class Trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(2766, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Profession Trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(2793, _Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-5047.87, -1263.77, 6, 6, 0, "Glordrum Steelbeard");
- player->SEND_GOSSIP_MENU(7483, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-5038.37, -1266.39, 6, 6, 0, "Donal Osgood");
- player->SEND_GOSSIP_MENU(7649, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(-5037.24, -1274.82, 6, 6, 0, "Lylandris");
- player->SEND_GOSSIP_MENU(7528, _Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(-5023, -1253.68, 6, 6, 0, "Hall of Arms");
- player->SEND_GOSSIP_MENU(2770, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries");
- player->SEND_GOSSIP_MENU(2771, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Paladin
- player->SEND_POI(-4627.02, -926.45, 6, 6, 0, "Hall of Mysteries");
- player->SEND_GOSSIP_MENU(2773, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Priest
- player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries");
- player->SEND_GOSSIP_MENU(2772, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
- player->SEND_POI(-4647.83, -1124, 6, 6, 0, "Ironforge Rogue Trainer");
- player->SEND_GOSSIP_MENU(2774, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(-4605, -1110.45, 6, 6, 0, "Ironforge Warlock Trainer");
- player->SEND_GOSSIP_MENU(2775, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-5023.08, -1253.68, 6, 6, 0, "Hall of Arms");
- player->SEND_GOSSIP_MENU(2776, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Shaman
- player->SEND_POI(-4732, -1147, 6, 6, 0, "Ironforge Shaman Trainer");
- //incorrect id
- player->SEND_GOSSIP_MENU(2766, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-4858.5, -1241.83, 6, 6, 0, "Berryfizz's Potions and Mixed Drinks");
- player->SEND_GOSSIP_MENU(2794, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-4796.97, -1110.17, 6, 6, 0, "The Great Forge");
- player->SEND_GOSSIP_MENU(2795, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-4767.83, -1184.59, 6, 6, 0, "The Bronze Kettle");
- player->SEND_GOSSIP_MENU(2796, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-4803.72, -1196.53, 6, 6, 0, "Thistlefuzz Arcanery");
- player->SEND_GOSSIP_MENU(2797, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-4799.56, -1250.23, 6, 6, 0, "Springspindle's Gadgets");
- player->SEND_GOSSIP_MENU(2798, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-4881.6, -1153.13, 6, 6, 0, "Ironforge Physician");
- player->SEND_GOSSIP_MENU(2799, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-4597.91, -1091.93, 6, 6, 0, "Traveling Fisherman");
- player->SEND_GOSSIP_MENU(2800, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-4876.9, -1151.92, 6, 6, 0, "Ironforge Physician");
- player->SEND_GOSSIP_MENU(2801, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods");
- player->SEND_GOSSIP_MENU(2802, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Minning
- player->SEND_POI(-4705.06, -1116.43, 6, 6, 0, "Deepmountain Mining Guild");
- player->SEND_GOSSIP_MENU(2804, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods");
- player->SEND_GOSSIP_MENU(2805, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(-4719.60, -1056.96, 6, 6, 0, "Stonebrow's Clothier");
- player->SEND_GOSSIP_MENU(2807, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_ironforge(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_ironforge(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_ironforge(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_ironforge(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_ironforge(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_ironforge end
- *******************************************************/
-
-CreatureAI* GetAI_guard_ironforge(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_mulgore start
- *******************************************************/
-
-bool GossipHello_guard_mulgore(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4051,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Wind rider
- player->SEND_GOSSIP_MENU(4052,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(-2361.38, -349.19, 6, 6, 0, "Bloodhoof Village Inn");
- player->SEND_GOSSIP_MENU(4053,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Stable master
- player->SEND_POI(-2338.86, -357.56, 6, 6, 0, "Seikwa");
- player->SEND_GOSSIP_MENU(5976,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(4069,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(4070,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-2312.15, -443.69, 6, 6, 0, "Gennia Runetotem");
- player->SEND_GOSSIP_MENU(4054,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-2178.14, -406.14, 6, 6, 0, "Yaw Sharpmane");
- player->SEND_GOSSIP_MENU(4055,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Shaman
- player->SEND_POI(-2301.5, -439.87, 6, 6, 0, "Narm Skychaser");
- player->SEND_GOSSIP_MENU(4056,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Warrior
- player->SEND_POI(-2345.43, -494.11, 6, 6, 0, "Krang Stonehoof");
- player->SEND_GOSSIP_MENU(4057,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_GOSSIP_MENU(4058,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_GOSSIP_MENU(4059,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2263.34, -287.91, 6, 6, 0, "Pyall Silentstride");
- player->SEND_GOSSIP_MENU(4060,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_GOSSIP_MENU(4061,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-2353.52, -355.82, 6, 6, 0, "Vira Younghoof");
- player->SEND_GOSSIP_MENU(4062,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
- player->SEND_POI(-2349.21, -241.37, 6, 6, 0, "Uthan Stillwater");
- player->SEND_GOSSIP_MENU(4063,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
- player->SEND_GOSSIP_MENU(4064,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking
- player->SEND_POI(-2257.12, -288.63, 6, 6, 0, "Chaw Stronghide");
- player->SEND_GOSSIP_MENU(4065,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Mining
- player->SEND_GOSSIP_MENU(4066,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Skinning
- player->SEND_POI(-2252.94, -291.32, 6, 6, 0, "Yonn Deepcut");
- player->SEND_GOSSIP_MENU(4067,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring
- player->SEND_GOSSIP_MENU(4068,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_mulgore(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_mulgore(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_mulgore(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_mulgore(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_mulgore end
- *******************************************************/
-
-CreatureAI* GetAI_guard_mulgore(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_orgrimmar start
- *******************************************************/
-
-bool GossipHello_guard_orgrimmar(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ZEPPLINMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_OFFICERS , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(2593,_Creature->GetGUID());
-
- return true;
-}
-
-void SendDefaultMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(1631.51, -4375.33, 6, 6, 0, "Bank of Orgrimmar");
- player->SEND_GOSSIP_MENU(2554,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //wind rider
- player->SEND_POI(1676.6, -4332.72, 6, 6, 0, "The Sky Tower");
- player->SEND_GOSSIP_MENU(2555,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //guild master
- player->SEND_POI(1576.93, -4294.75, 6, 6, 0, "Horde Embassy");
- player->SEND_GOSSIP_MENU(2556,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(1644.51, -4447.27, 6, 6, 0, "Orgrimmar Inn");
- player->SEND_GOSSIP_MENU(2557,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //mailbox
- player->SEND_POI(1622.53, -4388.79, 6, 6, 0, "Orgrimmar Mailbox");
- player->SEND_GOSSIP_MENU(2558,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //auction house
- player->SEND_POI(1679.21, -4450.1, 6, 6, 0, "Orgrimmar Auction House");
- player->SEND_GOSSIP_MENU(3075,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //zeppelin
- player->SEND_POI(1337.36, -4632.7, 6, 6, 0, "Orgrimmar Zeppelin Tower");
- player->SEND_GOSSIP_MENU(3173,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //weapon master
- player->SEND_POI(2092.56, -4823.95, 6, 6, 0, "Sayoc & Hanashi");
- player->SEND_GOSSIP_MENU(4519,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //stable master
- player->SEND_POI(2133.12, -4663.93, 6, 6, 0, "Xon'cha");
- player->SEND_GOSSIP_MENU(5974,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //officers lounge
- player->SEND_POI(1633.56, -4249.37, 6, 6, 0, "Hall of Legends");
- player->SEND_GOSSIP_MENU(7046,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7521,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(2599,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13: //profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(2594,_Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
- player->SEND_GOSSIP_MENU(7484,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
- player->SEND_GOSSIP_MENU(7644,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
- player->SEND_GOSSIP_MENU(7520,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(2114.84, -4625.31, 6, 6, 0, "Orgrimmar Hunter's Hall");
- player->SEND_GOSSIP_MENU(2559,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(1451.26, -4223.33, 6, 6, 0, "Darkbriar Lodge");
- player->SEND_GOSSIP_MENU(2560,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(1442.21, -4183.24, 6, 6, 0, "Spirit Lodge");
- player->SEND_GOSSIP_MENU(2561,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Shaman
- player->SEND_POI(1925.34, -4181.89, 6, 6, 0, "Thrall's Fortress");
- player->SEND_GOSSIP_MENU(2562,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
- player->SEND_POI(1773.39, -4278.97, 6, 6, 0, "Shadowswift Brotherhood");
- player->SEND_GOSSIP_MENU(2563,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(1849.57, -4359.68, 6, 6, 0, "Darkfire Enclave");
- player->SEND_GOSSIP_MENU(2564,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
- player->SEND_GOSSIP_MENU(2565,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Paladin
- player->SEND_POI(1906.65, -4134.26, 6, 6, 0, "Valley of Wisdom");
- player->SEND_GOSSIP_MENU(10843,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(1955.17, -4475.79, 6, 6, 0, "Yelmak's Alchemy and Potions");
- player->SEND_GOSSIP_MENU(2497,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(2054.34, -4831.85, 6, 6, 0, "The Burning Anvil");
- player->SEND_GOSSIP_MENU(2499,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(1780.96, -4481.31, 6, 6, 0, "Borstan's Firepit");
- player->SEND_GOSSIP_MENU(2500,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(1917.5, -4434.95, 6, 6, 0, "Godan's Runeworks");
- player->SEND_GOSSIP_MENU(2501,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(2038.45, -4744.75, 6, 6, 0, "Nogg's Machine Shop");
- player->SEND_GOSSIP_MENU(2653,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(1485.21, -4160.91, 6, 6, 0, "Survival of the Fittest");
- player->SEND_GOSSIP_MENU(2502,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(1994.15, -4655.7, 6, 6, 0, "Lumak's Fishing");
- player->SEND_GOSSIP_MENU(2503,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(1898.61, -4454.93, 6, 6, 0, "Jandi's Arboretum");
- player->SEND_GOSSIP_MENU(2504,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers");
- player->SEND_GOSSIP_MENU(2513,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(2029.79, -4704, 6, 6, 0, "Red Canyon Mining");
- player->SEND_GOSSIP_MENU(2515,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers");
- player->SEND_GOSSIP_MENU(2516,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(1802.66, -4560.66, 6, 6, 0, "Magar's Cloth Goods");
- player->SEND_GOSSIP_MENU(2518,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_orgrimmar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_orgrimmar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_orgrimmar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_orgrimmar(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_orgrimmar(player, _Creature, action); break;
- }
- return true;
-}
-
-bool ReceiveEmote_guard_orgrimmar(Player *player, Creature *_Creature, uint32 emote)
-{
- if( player->GetTeam() == HORDE )
- DoReplyToTextEmote(_Creature,emote);
- return true;
-}
-
-/*******************************************************
- * guard_orgrimmar end
- *******************************************************/
-
-CreatureAI* GetAI_guard_orgrimmar(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_shattrath start
- *******************************************************/
-
-bool GossipHello_guard_shattrath(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
-
- return true;
-}
-
-void SendDefaultMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
- player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
- player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKALDOR , GOSSIP_SENDER_SEC_BANK, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKSCYERS , GOSSIP_SENDER_SEC_BANK, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(10379, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNALDOR , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNSCYERS , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(10382, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
- player->SEND_POI(-1832, 5299, 6, 6, 0, "Flight Master");
- player->SEND_GOSSIP_MENU(10385, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKALDOR , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNALDOR , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKSCYERS , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNSCYERS , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(10386, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEALDOR , GOSSIP_SENDER_SEC_STABLEMASTER, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLESCYERS , GOSSIP_SENDER_SEC_STABLEMASTER, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(10387, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(10388, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
- player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
- player->SEND_GOSSIP_MENU(10503, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
- player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
- player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMALDOR , GOSSIP_SENDER_SEC_GEMMERCHANT, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMSCYERS , GOSSIP_SENDER_SEC_GEMMERCHANT, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(10697, _Creature->GetGUID());
- break;
- }
-}
-
-void SendBankMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
- player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank");
- player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID());
- }
-}
-
-void SendInnMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
- player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn");
- player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID());
- }
-}
-
-void SendMailboxMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
- player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
- player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank");
- player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn");
- player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID());
- break;
- }
-}
-
-void SendStableMasterMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable");
- player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(-2170, 5404, 6, 6, 0, "Scyers Stable");
- player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
- }
-}
-
-void SendBattleMasterMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->SEND_POI(-1774, 5251, 6, 6, 0, "Alliance Battlemasters");
- player->SEND_GOSSIP_MENU(10389, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_POI(-1963, 5263, 6, 6, 0, "Horde Battlemasters");
- player->SEND_GOSSIP_MENU(10390, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_POI(-1960, 5175, 6, 6, 0, "Arena Battlemasters");
- player->SEND_GOSSIP_MENU(12510, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
- player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
- player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
- player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
- player->SEND_GOSSIP_MENU(10395, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
- player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
- player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
- player->SEND_GOSSIP_MENU(10397, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
- player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
- player->SEND_GOSSIP_MENU(10398, _Creature->GetGUID());
- break;
- }
-}
-
-void SendGemMerchantMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant");
- player->SEND_GOSSIP_MENU(10698, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(-2193, 5424.5, 6, 6, 0, "Scyers Gem Merchant");
- player->SEND_GOSSIP_MENU(10699, _Creature->GetGUID());
- }
-}
-
-bool GossipSelect_guard_shattrath(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BANK: SendBankMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_INN: SendInnMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_STABLEMASTER: SendStableMasterMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_GEMMERCHANT: SendGemMerchantMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_MAILBOX: SendMailboxMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_shattrath end
- *******************************************************/
-
-CreatureAI* GetAI_guard_shattrath(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_shattrath_aldor
- *******************************************************/
-
-#define SPELL_BANISHED_SHATTRATH_A 36642
-#define SPELL_BANISHED_SHATTRATH_S 36671
-#define SPELL_BANISH_TELEPORT 36643
-#define SPELL_EXILE 39533
-
-struct TRINITY_DLL_DECL guard_shattrath_aldorAI : public guardAI
-{
- guard_shattrath_aldorAI(Creature *c) : guardAI(c) { Reset(); }
-
- uint32 Exile_Timer;
- uint32 Banish_Timer;
- uint64 playerGUID;
- bool CanTeleport;
-
- void Reset()
- {
- Banish_Timer = 5000;
- Exile_Timer = 8500;
- playerGUID = 0;
- CanTeleport = false;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( CanTeleport )
- {
- if( Exile_Timer < diff )
- {
- if( Unit* temp = Unit::GetUnit(*m_creature,playerGUID) )
- {
- temp->CastSpell(temp,SPELL_EXILE,true);
- temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
- }
- playerGUID = 0;
- Exile_Timer = 8500;
- CanTeleport = false;
- }else Exile_Timer -= diff;
- }
- else if( Banish_Timer < diff )
- {
- Unit* temp = m_creature->getVictim();
- if( temp && temp->GetTypeId() == TYPEID_PLAYER )
- {
- DoCast(temp,SPELL_BANISHED_SHATTRATH_A);
- Banish_Timer = 9000;
- playerGUID = temp->GetGUID();
- if( playerGUID )
- CanTeleport = true;
- }
- }else Banish_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-bool GossipHello_guard_shattrath_aldor(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(10524, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
- player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
- player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
- player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
- player->SEND_GOSSIP_MENU(10525, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
- player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master");
- player->SEND_GOSSIP_MENU(10402, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(0, 0, 6, 6, 0, "Aldor Mailbox");
- //unknown
- player->SEND_GOSSIP_MENU(10524, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable Master");
- player->SEND_GOSSIP_MENU(10527, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(10388, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
- player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
- player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
- player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
- player->SEND_GOSSIP_MENU(10696, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
- player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant");
- player->SEND_GOSSIP_MENU(10411, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
- player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
- player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
- player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
- player->SEND_GOSSIP_MENU(10528, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
- player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
- player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
- player->SEND_GOSSIP_MENU(10529, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
- player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
- player->SEND_GOSSIP_MENU(10419, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath_aldor(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath_aldor(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_shattrath_aldor end
- *******************************************************/
-
-CreatureAI* GetAI_guard_shattrath_aldor(Creature *_Creature)
-{
- return new guard_shattrath_aldorAI (_Creature);
-}
-
-/*******************************************************
- * guard_shattrath_scryer
- *******************************************************/
-
-struct TRINITY_DLL_DECL guard_shattrath_scryerAI : public guardAI
-{
- guard_shattrath_scryerAI(Creature *c) : guardAI(c) { Reset(); }
-
- uint32 Exile_Timer;
- uint32 Banish_Timer;
- uint64 playerGUID;
- bool CanTeleport;
-
- void Reset()
- {
- Banish_Timer = 5000;
- Exile_Timer = 8500;
- playerGUID = 0;
- CanTeleport = false;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( CanTeleport )
- {
- if( Exile_Timer < diff )
- {
- if( Unit* temp = Unit::GetUnit(*m_creature,playerGUID) )
- {
- temp->CastSpell(temp,SPELL_EXILE,true);
- temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
- }
- playerGUID = 0;
- Exile_Timer = 8500;
- CanTeleport = false;
- }else Exile_Timer -= diff;
- }
- else if( Banish_Timer < diff )
- {
- Unit* temp = m_creature->getVictim();
- if( temp && temp->GetTypeId() == TYPEID_PLAYER )
- {
- DoCast(temp,SPELL_BANISHED_SHATTRATH_S);
- Banish_Timer = 9000;
- playerGUID = temp->GetGUID();
- if( playerGUID )
- CanTeleport = true;
- }
- }else Banish_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-bool GossipHello_guard_shattrath_scryer(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(10430, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
- player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
- player->SEND_GOSSIP_MENU(10431, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-1996.6, 5363.7, 6, 6, 0, "Scryer Bank");
- player->SEND_GOSSIP_MENU(10432, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(-2176.6, 5405.8, 6, 6, 0, "Scryer Inn");
- player->SEND_GOSSIP_MENU(10433, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
- player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master");
- player->SEND_GOSSIP_MENU(10435, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(-2174.3, 5411.4, 6, 6, 0, "Scryer Mailbox");
- player->SEND_GOSSIP_MENU(10436, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->SEND_POI(-2169.9, 5405.1, 6, 6, 0, "Scryer Stable Master");
- player->SEND_GOSSIP_MENU(10437, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(10438, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(10504, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
- player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
- player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
- player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
- player->SEND_GOSSIP_MENU(10701, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
- player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Scryer Gem Merchant");
- player->SEND_GOSSIP_MENU(10702, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
- player->SEND_GOSSIP_MENU(10516, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
- player->SEND_GOSSIP_MENU(10517, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
- player->SEND_GOSSIP_MENU(10518, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
- player->SEND_GOSSIP_MENU(10519, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
- player->SEND_GOSSIP_MENU(10520, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
- player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
- player->SEND_GOSSIP_MENU(10521, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
- player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
- player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath_scryer(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath_scryer(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_shattrath_scryer end
- *******************************************************/
-
-CreatureAI* GetAI_guard_shattrath_scryer(Creature *_Creature)
-{
- return new guard_shattrath_scryerAI (_Creature);
-}
-
-/*******************************************************
- * guard_silvermoon start
- *******************************************************/
-
-bool GossipHello_guard_silvermoon(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AH_SILVERMOON_1 , GOSSIP_SENDER_SEC_AUCTIONHOUSE, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AH_SILVERMOON_2 , GOSSIP_SENDER_SEC_AUCTIONHOUSE, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(9317, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(9808.4, -7488.16, 6, 6, 0, "Silvermoon Bank");
- player->SEND_GOSSIP_MENU(9322, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(9474.97, -7345.21, 6, 6, 0, "Tandrine");
- player->SEND_GOSSIP_MENU(9324, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN_SILVERMOON_1 , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN_SILVERMOON_2 , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(9602, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(9658.33, -7492.17, 6, 6, 0, "Silvermoon Mailbox");
- player->SEND_GOSSIP_MENU(9326, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->SEND_POI(9904.95, -7404.31, 6, 6, 0, "Shalenn");
- player->SEND_GOSSIP_MENU(9327, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Weapon trainer
- player->SEND_POI(9841.17, -7505.13, 6, 6, 0, "Ileda");
- player->SEND_GOSSIP_MENU(9328, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Wind master
- player->SEND_POI(9378.45, -7163.94, 6, 6, 0, "Silvermoon Wind Master");
- player->SEND_GOSSIP_MENU(10181, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_EYEOFTHESTORM , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(9331, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(9338, _Creature->GetGUID());
- break;
- }
-}
-
-void SendAuctionhouseMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(9644.47, -7140.22, 6, 6, 0, "Western Auction House");
- player->SEND_GOSSIP_MENU(9318, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(9683.27, -7521.22, 6, 6, 0, "Royal Exchange Auction House");
- player->SEND_GOSSIP_MENU(9319, _Creature->GetGUID());
- }
-}
-
-void SendInnMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->SEND_POI(9677.7, -7368, 6, 6, 0, "Silvermoon City Inn");
- player->SEND_GOSSIP_MENU(9325, _Creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_INFO_DEF + 2)
- {
- player->SEND_POI(9561.1, -7517.5, 6, 6, 0, "Wayfarer's Rest tavern");
- player->SEND_GOSSIP_MENU(9603, _Creature->GetGUID());
- }
-}
-
-void SendBattleMasterMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(9850.49, -7572.26, 6, 6, 0, "Gurak");
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth");
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //A
- player->SEND_POI(9850.6, -7559.25, 6, 6, 0, "Bipp Glizzitor");
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //EOS
- player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth");
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //WSG
- player->SEND_POI(9845.45, -7562.58, 6, 6, 0, "Krukk");
- player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(9700.55, -7262.57, 6, 6, 0, "Harene Plainwalker");
- player->SEND_GOSSIP_MENU(9330, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(9927.48, -7426.14, 6, 6, 0, "Zandine");
- player->SEND_GOSSIP_MENU(9332, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(9995.07, -7118.17, 6, 6, 0, "Quithas");
- player->SEND_GOSSIP_MENU(9333, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(9850.22, -7516.93, 6, 6, 0, "Champion Bachi");
- player->SEND_GOSSIP_MENU(9334, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(9926.79, -7066.66, 6, 6, 0, "Belestra");
- player->SEND_GOSSIP_MENU(9335, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
- player->SEND_POI(9739.88, -7374.33, 6, 6, 0, "Zelanis");
- player->SEND_GOSSIP_MENU(9336, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
- player->SEND_POI(9787.57, -7284.63, 6, 6, 0, "Alamma");
- player->SEND_GOSSIP_MENU(9337, _Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(9998.09, -7214.36, 6, 6, 0, "Silvermoon Alchemy Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(9841.43, -7361.53, 6, 6, 0, "Silvermoon Blacksmithing Trainer");
- player->SEND_GOSSIP_MENU(9340, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(9577.26, -7243.6, 6, 6, 0, "Silvermoon Cooking Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(9962.57, -7246.18, 6, 6, 0, "Silvermoon Enchanting Trainer");
- player->SEND_GOSSIP_MENU(9341, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(9820.18, -7329.56, 6, 6, 0, "Silvermoon Engineering Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(9579.8, -7343.71, 6, 6, 0, "Silvermoon First Aid Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(9602.73, -7328.3, 6, 6, 0, "Silvermoon Fishing Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
- player->SEND_POI(9553.54, -7506.43, 6, 6, 0, "Silvermoon Jewelcrafting Trainer");
- player->SEND_GOSSIP_MENU(9346, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism
- player->SEND_POI(10004.4, -7216.86, 6, 6, 0, "Silvermoon Herbalism Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
- player->SEND_POI(9503.72, -7430.16, 6, 6, 0, "Silvermoon Leatherworking Trainer");
- player->SEND_GOSSIP_MENU(9347, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Mining
- player->SEND_POI(9805.1, -7355.56, 6, 6, 0, "Silvermoon Mining Trainer");
- player->SEND_GOSSIP_MENU(9348, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
- player->SEND_POI(9513.37, -7429.4, 6, 6, 0, "Silvermoon Skinning Trainer");
- player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
- player->SEND_POI(9750.55, -7095.28, 6, 6, 0, "Silvermoon Tailor");
- player->SEND_GOSSIP_MENU(9350, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_silvermoon(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_silvermoon(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_AUCTIONHOUSE: SendAuctionhouseMenu_guard_silvermoon(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_INN: SendInnMenu_guard_silvermoon(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_silvermoon(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_silvermoon(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_silvermoon(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_silvermoon end
- *******************************************************/
-
-CreatureAI* GetAI_guard_silvermoon(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_stormwind start
- *******************************************************/
-
-bool GossipHello_guard_stormwind(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STORMWIND_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DEEPRUNTRAM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_OFFICERS , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(933,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Auction House
- player->SEND_POI(-8811.46, 667.46, 6, 6, 0, "Stormwind Auction House");
- player->SEND_GOSSIP_MENU(3834,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-8916.87, 622.87, 6, 6, 0, "Stormwind Bank");
- player->SEND_GOSSIP_MENU(764,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Deeprun tram
- player->SEND_POI(-8378.88, 554.23, 6, 6, 0, "The Deeprun Tram");
- player->SEND_GOSSIP_MENU(3813,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-8869.0, 675.4, 6, 6, 0, "The Gilded Rose");
- player->SEND_GOSSIP_MENU(3860,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Gryphon Master
- player->SEND_POI(-8837.0, 493.5, 6, 6, 0, "Stormwind Gryphon Master");
- player->SEND_GOSSIP_MENU(879,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Guild Master
- player->SEND_POI(-8894.0, 611.2, 6, 6, 0, "Stormwind Vistor`s Center");
- player->SEND_GOSSIP_MENU(882,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox
- player->SEND_POI(-8876.48, 649.18, 6, 6, 0, "Stormwind Mailbox");
- player->SEND_GOSSIP_MENU(3861,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master
- player->SEND_POI(-8433.0, 554.7, 6, 6, 0, "Jenova Stoneshield");
- player->SEND_GOSSIP_MENU(5984,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Weapon Trainer
- player->SEND_POI(-8797.0, 612.8, 6, 6, 0, "Woo Ping");
- player->SEND_GOSSIP_MENU(4516,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Officers Lounge
- player->SEND_POI(-8759.92, 399.69, 6, 6, 0, "Champions` Hall");
- player->SEND_GOSSIP_MENU(7047,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Battlemasters
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7499,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Class trainers
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->SEND_GOSSIP_MENU(898,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13: //Profession trainers
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(918,_Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Thelman Slatefist");
- player->SEND_GOSSIP_MENU(7500, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Lady Hoteshem");
- player->SEND_GOSSIP_MENU(7650, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Elfarran");
- player->SEND_GOSSIP_MENU(7501, _Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Mage
- player->SEND_POI(-9012.0, 867.6, 6, 6, 0, "Wizard`s Sanctum");
- player->SEND_GOSSIP_MENU(899,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Rogue
- player->SEND_POI(-8753.0, 367.8, 6, 6, 0, "Stormwind - Rogue House");
- player->SEND_GOSSIP_MENU(900,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Warrior
- player->SEND_POI(-8624.54, 402.61, 6, 6, 0, "Pig and Whistle Tavern");
- player->SEND_GOSSIP_MENU(901,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Druid
- player->SEND_POI(-8751.0, 1124.5, 6, 6, 0, "The Park");
- player->SEND_GOSSIP_MENU(902,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-8512.0, 862.4, 6, 6, 0, "Catedral Of Light");
- player->SEND_GOSSIP_MENU(903,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Paladin
- player->SEND_POI(-8577.0, 881.7, 6, 6, 0, "Catedral Of Light");
- player->SEND_GOSSIP_MENU(904,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Hunter
- player->SEND_POI(-8413.0, 541.5, 6, 6, 0, "Hunter Lodge");
- player->SEND_GOSSIP_MENU(905,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Warlock
- player->SEND_POI(-8948.91, 998.35, 6, 6, 0, "The Slaughtered Lamb");
- player->SEND_GOSSIP_MENU(906,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Shaman
- player->SEND_POI(-9033, 550, 6, 6, 0, "Valley Of Heroes");
- //incorrect id
- player->SEND_GOSSIP_MENU(2593,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-8988.0, 759.60, 6, 6, 0, "Alchemy Needs");
- player->SEND_GOSSIP_MENU(919,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-8424.0, 616.9, 6, 6, 0, "Therum Deepforge");
- player->SEND_GOSSIP_MENU(920,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-8611.0, 364.6, 6, 6, 0, "Pig and Whistle Tavern");
- player->SEND_GOSSIP_MENU(921,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-8858.0, 803.7, 6, 6, 0, "Lucan Cordell");
- player->SEND_GOSSIP_MENU(941,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-8347.0, 644.1, 6, 6, 0, "Lilliam Sparkspindle");
- player->SEND_GOSSIP_MENU(922,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-8513.0, 801.8, 6, 6, 0, "Shaina Fuller");
- player->SEND_GOSSIP_MENU(923,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-8803.0, 767.5, 6, 6, 0, "Arnold Leland");
- player->SEND_GOSSIP_MENU(940,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-8967.0, 779.5, 6, 6, 0, "Alchemy Needs");
- player->SEND_GOSSIP_MENU(924,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(-8726.0, 477.4, 6, 6, 0, "The Protective Hide");
- player->SEND_GOSSIP_MENU(925,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(-8434.0, 692.8, 6, 6, 0, "Gelman Stonehand");
- player->SEND_GOSSIP_MENU(927,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(-8716.0, 469.4, 6, 6, 0, "The Protective Hide");
- player->SEND_GOSSIP_MENU(928,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(-8938.0, 800.7, 6, 6, 0, "Duncan`s Textiles");
- player->SEND_GOSSIP_MENU(929,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_stormwind(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_stormwind(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_stormwind(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_stormwind(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_stormwind(player, _Creature, action); break;
- }
- return true;
-}
-
-bool ReceiveEmote_guard_stormwind(Player *player, Creature *_Creature, uint32 emote)
-{
- if( player->GetTeam() == ALLIANCE )
- DoReplyToTextEmote(_Creature,emote);
- return true;
-}
-
-/*******************************************************
- * guard_stormwind end
- *******************************************************/
-
-CreatureAI* GetAI_guard_stormwind(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_teldrassil start
- *******************************************************/
-
-bool GossipHello_guard_teldrassil(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FERRY , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(4316,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4317,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Rut`theran
- player->SEND_GOSSIP_MENU(4318,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_GOSSIP_MENU(4319,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(9821.49, 960.13, 6, 6, 0, "Dolanaar Inn");
- player->SEND_GOSSIP_MENU(4320,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //stable master
- player->SEND_POI(9808.37, 931.1, 6, 6, 0, "Seriadne");
- player->SEND_GOSSIP_MENU(5982,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(4264,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->SEND_GOSSIP_MENU(4273,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(9741.58, 963.7, 6, 6, 0, "Kal");
- player->SEND_GOSSIP_MENU(4323,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(9815.12, 926.28, 6, 6, 0, "Dazalar");
- player->SEND_GOSSIP_MENU(4324,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(9906.16, 986.63, 6, 6, 0, "Laurna Morninglight");
- player->SEND_GOSSIP_MENU(4325,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
- player->SEND_POI(9789, 942.86, 6, 6, 0, "Jannok Breezesong");
- player->SEND_GOSSIP_MENU(4326,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(9821.96, 950.61, 6, 6, 0, "Kyra Windblade");
- player->SEND_GOSSIP_MENU(4327,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(9767.59, 878.81, 6, 6, 0, "Cyndra Kindwhisper");
- player->SEND_GOSSIP_MENU(4329,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Cooking
- player->SEND_POI(9751.19, 906.13, 6, 6, 0, "Zarrin");
- player->SEND_GOSSIP_MENU(4330,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting
- player->SEND_POI(10677.59, 1946.56, 6, 6, 0, "Alanna Raveneye");
- player->SEND_GOSSIP_MENU(4331,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //First Aid
- player->SEND_POI(9903.12, 999, 6, 6, 0, "Byancie");
- player->SEND_GOSSIP_MENU(4332,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Fishing
- player->SEND_GOSSIP_MENU(4333,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism
- player->SEND_POI(9773.78, 875.88, 6, 6, 0, "Malorne Bladeleaf");
- player->SEND_GOSSIP_MENU(4334,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(10152.59, 1681.46, 6, 6, 0, "Nadyia Maneweaver");
- player->SEND_GOSSIP_MENU(4335,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(10135.59, 1673.18, 6, 6, 0, "Radnaal Maneweaver");
- player->SEND_GOSSIP_MENU(4336,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring
- player->SEND_GOSSIP_MENU(4337,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_teldrassil(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_teldrassil(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_teldrassil(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_teldrassil(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_teldrassil end
- *******************************************************/
-
-CreatureAI* GetAI_guard_teldrassil(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_tirisfal start
- *******************************************************/
-
-bool GossipHello_guard_tirisfal(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(4097,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_GOSSIP_MENU(4074,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //bat handler
- player->SEND_GOSSIP_MENU(4075,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Gallows` End Tavern");
- player->SEND_GOSSIP_MENU(4076,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master
- player->SEND_POI(2267.66, 319.32, 6, 6, 0, "Morganus");
- player->SEND_GOSSIP_MENU(5978,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(4292,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(4096,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Mage
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Cain Firesong");
- player->SEND_GOSSIP_MENU(4077,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Priest
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Dark Cleric Beryl");
- player->SEND_GOSSIP_MENU(4078,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Rogue
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Marion Call");
- player->SEND_GOSSIP_MENU(4079,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Warlock
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Rupert Boch");
- player->SEND_GOSSIP_MENU(4080,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(2256.48, 240.32, 6, 6, 0, "Austil de Mon");
- player->SEND_GOSSIP_MENU(4081,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(2263.25, 344.23, 6, 6, 0, "Carolai Anise");
- player->SEND_GOSSIP_MENU(4082,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_GOSSIP_MENU(4083,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_GOSSIP_MENU(4084,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(2250.35, 249.12, 6, 6, 0, "Vance Undergloom");
- player->SEND_GOSSIP_MENU(4085,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_GOSSIP_MENU(4086,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Nurse Neela");
- player->SEND_GOSSIP_MENU(4087,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(2292.37, -10.72, 6, 6, 0, "Clyde Kellen");
- player->SEND_GOSSIP_MENU(4088,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(2268.21, 331.69, 6, 6, 0, "Faruza");
- player->SEND_GOSSIP_MENU(4089,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(2027, 78.72, 6, 6, 0, "Shelene Rhobart");
- player->SEND_GOSSIP_MENU(4090,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_GOSSIP_MENU(4091,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(2027, 78.72, 6, 6, 0, "Rand Rhobart");
- player->SEND_GOSSIP_MENU(4092,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(2160.45, 659.93, 6, 6, 0, "Bowen Brisboise");
- player->SEND_GOSSIP_MENU(4093,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_tirisfal(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_tirisfal(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_tirisfal(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_tirisfal(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_tirisfal end
- *******************************************************/
-
-CreatureAI* GetAI_guard_tirisfal(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * guard_undercity start
- *******************************************************/
-
-bool GossipHello_guard_undercity(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ZEPPLINMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
- return true;
-}
-
-void SendDefaultMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(1595.64, 232.45, 6, 6, 0, "Undercity Bank");
- player->SEND_GOSSIP_MENU(3514,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Bat handler
- player->SEND_POI(1565.9, 271.43, 6, 6, 0, "Undercity Bat Handler");
- player->SEND_GOSSIP_MENU(3515,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(1594.17, 205.57, 6, 6, 0, "Undercity Guild Master");
- player->SEND_GOSSIP_MENU(3516,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(1639.43, 220.99, 6, 6, 0, "Undercity Inn");
- player->SEND_GOSSIP_MENU(3517,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(1632.68, 219.4, 6, 6, 0, "Undercity Mailbox");
- player->SEND_GOSSIP_MENU(3518,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //Auction House
- player->SEND_POI(1647.9, 258.49, 6, 6, 0, "Undercity Auction House");
- player->SEND_GOSSIP_MENU(3519,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Zeppelin
- player->SEND_POI(2059, 274.86, 6, 6, 0, "Undercity Zeppelin");
- player->SEND_GOSSIP_MENU(3520,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Weapon Master
- player->SEND_POI(1670.31, 324.66, 6, 6, 0, "Archibald");
- player->SEND_GOSSIP_MENU(4521,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Stable master
- player->SEND_POI(1634.18, 226.76, 6, 6, 0, "Anya Maulray");
- player->SEND_GOSSIP_MENU(5979,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7527,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Class trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(3542,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Profession trainer
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(3541,_Creature->GetGUID());
- break;
- }
-}
-
-void SendBattleMasterMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(1329, 333.92, 6, 6, 0, "Grizzle Halfmane");
- player->SEND_GOSSIP_MENU(7525,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(1283.3, 287.16, 6, 6, 0, "Sir Malory Wheeler");
- player->SEND_GOSSIP_MENU(7646,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(1265, 351.18, 6, 6, 0, "Kurden Bloodclaw");
- player->SEND_GOSSIP_MENU(7526,_Creature->GetGUID());
- break;
- }
-}
-
-void SendClassTrainerMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Mage
- player->SEND_POI(1781, 53, 6, 6, 0, "Undercity Mage Trainers");
- player->SEND_GOSSIP_MENU(3513,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Priest
- player->SEND_POI(1758.33, 401.5, 6, 6, 0, "Undercity Priest Trainers");
- player->SEND_GOSSIP_MENU(3521,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Rogue
- player->SEND_POI(1418.56, 65, 6, 6, 0, "Undercity Rogue Trainers");
- player->SEND_GOSSIP_MENU(3524,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Warlock
- player->SEND_POI(1780.92, 53.16, 6, 6, 0, "Undercity Warlock Trainers");
- player->SEND_GOSSIP_MENU(3526,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(1775.59, 418.19, 6, 6, 0, "Undercity Warrior Trainers");
- player->SEND_GOSSIP_MENU(3527,_Creature->GetGUID());
- break;
- }
-}
-
-void SendProfTrainerMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(1419.82, 417.19, 6, 6, 0, "The Apothecarium");
- player->SEND_GOSSIP_MENU(3528,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(1696, 285, 6, 6, 0, "Undercity Blacksmithing Trainer");
- player->SEND_GOSSIP_MENU(3529,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(1596.34, 274.68, 6, 6, 0, "Undercity Cooking Trainer");
- player->SEND_GOSSIP_MENU(3530,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(1488.54, 280.19, 6, 6, 0, "Undercity Enchanting Trainer");
- player->SEND_GOSSIP_MENU(3531,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(1408.58, 143.43, 6, 6, 0, "Undercity Engineering Trainer");
- player->SEND_GOSSIP_MENU(3532,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(1519.65, 167.19, 6, 6, 0, "Undercity First Aid Trainer");
- player->SEND_GOSSIP_MENU(3533,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(1679.9, 89, 6, 6, 0, "Undercity Fishing Trainer");
- player->SEND_GOSSIP_MENU(3534,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(1558, 349.36, 6, 6, 0, "Undercity Herbalism Trainer");
- player->SEND_GOSSIP_MENU(3535,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(1498.76, 196.43, 6, 6, 0, "Undercity Leatherworking Trainer");
- player->SEND_GOSSIP_MENU(3536,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(1642.88, 335.58, 6, 6, 0, "Undercity Mining Trainer");
- player->SEND_GOSSIP_MENU(3537,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(1498.6, 196.46, 6, 6, 0, "Undercity Skinning Trainer");
- player->SEND_GOSSIP_MENU(3538,_Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(1689.55, 193, 6, 6, 0, "Undercity Tailoring Trainer");
- player->SEND_GOSSIP_MENU(3539,_Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_guard_undercity(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (sender)
- {
- case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_undercity(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_undercity(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_undercity(player, _Creature, action); break;
- case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_undercity(player, _Creature, action); break;
- }
- return true;
-}
-
-/*******************************************************
- * guard_undercity end
- *******************************************************/
-
-CreatureAI* GetAI_guard_undercity(Creature *_Creature)
-{
- return new guardAI (_Creature);
-}
-
-/*******************************************************
- * AddSC
- *******************************************************/
-
-void AddSC_guards()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="guard_azuremyst";
- newscript->pGossipHello = &GossipHello_guard_azuremyst;
- newscript->pGossipSelect = &GossipSelect_guard_azuremyst;
- newscript->GetAI = GetAI_guard_azuremyst;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_bluffwatcher";
- newscript->pGossipHello = &GossipHello_guard_bluffwatcher;
- newscript->pGossipSelect = &GossipSelect_guard_bluffwatcher;
- newscript->GetAI = GetAI_guard_bluffwatcher;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_contested";
- newscript->GetAI = GetAI_guard_contested;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_darnassus";
- newscript->pGossipHello = &GossipHello_guard_darnassus;
- newscript->pGossipSelect = &GossipSelect_guard_darnassus;
- newscript->GetAI = GetAI_guard_darnassus;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_dunmorogh";
- newscript->pGossipHello = &GossipHello_guard_dunmorogh;
- newscript->pGossipSelect = &GossipSelect_guard_dunmorogh;
- newscript->GetAI = GetAI_guard_dunmorogh;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_durotar";
- newscript->pGossipHello = &GossipHello_guard_durotar;
- newscript->pGossipSelect = &GossipSelect_guard_durotar;
- newscript->GetAI = GetAI_guard_durotar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_elwynnforest";
- newscript->pGossipHello = &GossipHello_guard_elwynnforest;
- newscript->pGossipSelect = &GossipSelect_guard_elwynnforest;
- newscript->GetAI = GetAI_guard_elwynnforest;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_eversong";
- newscript->pGossipHello = &GossipHello_guard_eversong;
- newscript->pGossipSelect = &GossipSelect_guard_eversong;
- newscript->GetAI = GetAI_guard_eversong;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_exodar";
- newscript->pGossipHello = &GossipHello_guard_exodar;
- newscript->pGossipSelect = &GossipSelect_guard_exodar;
- newscript->GetAI = GetAI_guard_exodar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_ironforge";
- newscript->pGossipHello = &GossipHello_guard_ironforge;
- newscript->pGossipSelect = &GossipSelect_guard_ironforge;
- newscript->GetAI = GetAI_guard_ironforge;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_mulgore";
- newscript->pGossipHello = &GossipHello_guard_mulgore;
- newscript->pGossipSelect = &GossipSelect_guard_mulgore;
- newscript->GetAI = GetAI_guard_mulgore;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_orgrimmar";
- newscript->pGossipHello = &GossipHello_guard_orgrimmar;
- newscript->pGossipSelect = &GossipSelect_guard_orgrimmar;
- newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar;
- newscript->GetAI = GetAI_guard_orgrimmar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_shattrath";
- newscript->pGossipHello = &GossipHello_guard_shattrath;
- newscript->pGossipSelect = &GossipSelect_guard_shattrath;
- newscript->GetAI = GetAI_guard_shattrath;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_shattrath_aldor";
- newscript->GetAI = GetAI_guard_shattrath_aldor;
- newscript->pGossipHello = &GossipHello_guard_shattrath_aldor;
- newscript->pGossipSelect = &GossipSelect_guard_shattrath_aldor;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_shattrath_scryer";
- newscript->GetAI = GetAI_guard_shattrath_scryer;
- newscript->pGossipHello = &GossipHello_guard_shattrath_scryer;
- newscript->pGossipSelect = &GossipSelect_guard_shattrath_scryer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_silvermoon";
- newscript->pGossipHello = &GossipHello_guard_silvermoon;
- newscript->pGossipSelect = &GossipSelect_guard_silvermoon;
- newscript->GetAI = GetAI_guard_silvermoon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_stormwind";
- newscript->pGossipHello = &GossipHello_guard_stormwind;
- newscript->pGossipSelect = &GossipSelect_guard_stormwind;
- newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind;
- newscript->GetAI = GetAI_guard_stormwind;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_teldrassil";
- newscript->pGossipHello = &GossipHello_guard_teldrassil;
- newscript->pGossipSelect = &GossipSelect_guard_teldrassil;
- newscript->GetAI = GetAI_guard_teldrassil;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_tirisfal";
- newscript->pGossipHello = &GossipHello_guard_tirisfal;
- newscript->pGossipSelect = &GossipSelect_guard_tirisfal;
- newscript->GetAI = GetAI_guard_tirisfal;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="guard_undercity";
- newscript->pGossipHello = &GossipHello_guard_undercity;
- newscript->pGossipSelect = &GossipSelect_guard_undercity;
- newscript->GetAI = GetAI_guard_undercity;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Guards
+SD%Complete: 100
+SDComment: All Guard gossip data, quite some npc_text-id's still missing, adding constantly as new id's are known. CombatAI should be organized better for future.
+SDCategory: Guards
+EndScriptData */
+
+/* ContentData
+guard_azuremyst
+guard_bluffwatcher
+guard_contested
+guard_darnassus
+guard_dunmorogh
+guard_durotar
+guard_elwynnforest
+guard_eversong
+guard_exodar
+guard_ironforge
+guard_mulgore
+guard_orgrimmar
+guard_shattrath
+guard_shattrath_aldor
+guard_shattrath_scryer
+guard_silvermoon
+guard_stormwind
+guard_teldrassil
+guard_tirisfal
+guard_undercity
+EndContentData */
+
+#include "precompiled.h"
+#include "guard_ai.h"
+
+//script spesific action
+#define GOSSIP_ACTION_TAVERN 101
+#define GOSSIP_ACTION_GEMMERCHANT 102
+#define GOSSIP_ACTION_MANALOOM 103
+
+//script spesific sender
+#define GOSSIP_SENDER_SEC_GEMMERCHANT 101
+#define GOSSIP_SENDER_SEC_AUCTIONHOUSE 102
+
+//script spesific gossip text
+#define GOSSIP_TEXT_TAVERN "Worlds End Tavern"
+#define GOSSIP_TEXT_BANKSCYERS "Scyers bank"
+#define GOSSIP_TEXT_BANKALDOR "Aldor Bank"
+#define GOSSIP_TEXT_INNSCYERS "Scyers Inn"
+#define GOSSIP_TEXT_INNALDOR "Aldor Inn"
+#define GOSSIP_TEXT_STABLESCYERS "Scyers Stable"
+#define GOSSIP_TEXT_STABLEALDOR "Aldor Stable"
+#define GOSSIP_TEXT_BATTLEMASTERALLIANCE "Alliance Battlemasters"
+#define GOSSIP_TEXT_BATTLEMASTERHORDE "Horde Battlemasters"
+#define GOSSIP_TEXT_BATTLEMASTERARENA "Arena Battlemasters"
+#define GOSSIP_TEXT_MANALOOM "Mana Loom"
+#define GOSSIP_TEXT_ALCHEMYLAB "Alchemy Lab"
+#define GOSSIP_TEXT_GEMMERCHANT "Gem Merchant"
+#define GOSSIP_TEXT_GEMSCYERS "Scyers Gem Merchant"
+#define GOSSIP_TEXT_GEMALDOR "Aldor Gem Merchant"
+
+#define GOSSIP_TEXT_AH_SILVERMOON_1 "Western Auction House"
+#define GOSSIP_TEXT_AH_SILVERMOON_2 "Royal Exchange Auction House"
+
+#define GOSSIP_TEXT_INN_SILVERMOON_1 "Silvermoon City Inn"
+#define GOSSIP_TEXT_INN_SILVERMOON_2 "Wayfarer's Rest tavern"
+
+//common used for guards in main cities
+void DoReplyToTextEmote(Creature *_Creature,uint32 em)
+{
+ switch(em)
+ {
+ case TEXTEMOTE_KISS: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
+ case TEXTEMOTE_WAVE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
+ case TEXTEMOTE_SALUTE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break;
+ case TEXTEMOTE_SHY: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break;
+ case TEXTEMOTE_RUDE:
+ case TEXTEMOTE_CHICKEN: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
+ }
+}
+
+/*******************************************************
+ * guard_azuremyst start
+ *******************************************************/
+
+bool GossipHello_guard_azuremyst(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(10066,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_POI(-3918.95, -11544.7, 6, 6, 0, "Bank");
+ player->SEND_GOSSIP_MENU(10067,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hippogryph Master
+ player->SEND_POI(-4057.15, -11788.6, 6, 6, 0, "Stephanos");
+ player->SEND_GOSSIP_MENU(10071,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_POI(-4092.43, -11626.6, 6, 6, 0, "Funaam");
+ player->SEND_GOSSIP_MENU(10073,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(-4129.43, -12469, 6, 6, 0, "Caregiver Chellan");
+ player->SEND_GOSSIP_MENU(10074,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
+ player->SEND_POI(-4146.42, -12492.7, 6, 6, 0, "Esbina");
+ player->SEND_GOSSIP_MENU(10075,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(10076,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(10087,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(-4274.81, -11495.3, 6, 6, 0, "Shalannius");
+ player->SEND_GOSSIP_MENU(10077,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(-4203.65, -12526.5, 6, 6, 0, "Acteon");
+ player->SEND_GOSSIP_MENU(10078,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(-4149.62, -12530.1, 6, 6, 0, "Semid");
+ player->SEND_GOSSIP_MENU(10081,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
+ player->SEND_POI(-4138.98, -12468.5, 6, 6, 0, "Tullas");
+ player->SEND_GOSSIP_MENU(10083,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(-4131.66, -12478.6, 6, 6, 0, "Guvan");
+ player->SEND_GOSSIP_MENU(10084,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Shaman
+ player->SEND_POI(-4162.33, -12456.1, 6, 6, 0, "Tuluun");
+ player->SEND_GOSSIP_MENU(10085,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(-4165.05, -12536.4, 6, 6, 0, "Ruada");
+ player->SEND_GOSSIP_MENU(10086,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-4191.15, -12470, 6, 6, 0, "Daedal");
+ player->SEND_GOSSIP_MENU(10088,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-4726.29, -12387, 6, 6, 0, "Blacksmith Calypso");
+ player->SEND_GOSSIP_MENU(10089,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-4710.87, -12400.6, 6, 6, 0, "'Cookie' McWeaksauce");
+ player->SEND_GOSSIP_MENU(10090,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-3882.85, -11496.7, 6, 6, 0, "Nahogg");
+ player->SEND_GOSSIP_MENU(10091,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(-4157.57, -12470.2, 6, 6, 0, "Artificer Daelo");
+ player->SEND_GOSSIP_MENU(10092,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-4199.11, -12469.9, 6, 6, 0, "Anchorite Fateema");
+ player->SEND_GOSSIP_MENU(10093,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-4266.38, -12985.1, 6, 6, 0, "Diktynna");
+ player->SEND_GOSSIP_MENU(10094,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_GOSSIP_MENU(10095,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Jewelcrafting
+ player->SEND_POI(-3781.55, -11541.8, 6, 6, 0, "Farii");
+ player->SEND_GOSSIP_MENU(10097,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
+ player->SEND_POI(-3442.68, -12322.2, 6, 6, 0, "Moordo");
+ player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Mining
+ player->SEND_POI(-4179.89, -12493.1, 6, 6, 0, "Dulvi");
+ player->SEND_GOSSIP_MENU(10097,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
+ player->SEND_POI(-3431.17, -12316.5, 6, 6, 0, "Gurf");
+ player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
+ player->SEND_POI(-4711.54, -12386.7, 6, 6, 0, "Erin Kelly");
+ player->SEND_GOSSIP_MENU(10099,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_azuremyst(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_azuremyst(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_azuremyst(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_azuremyst(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_azuremyst end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_azuremyst(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_bluffwatcher start
+ *******************************************************/
+
+bool GossipHello_guard_bluffwatcher(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_POI(-1257.8, 24.14, 6, 6, 0, "Thunder Bluff Bank");
+ player->SEND_GOSSIP_MENU(1292,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Wind master
+ player->SEND_POI(-1196.43, 28.26, 6, 6, 0, "Wind Rider Roost");
+ player->SEND_GOSSIP_MENU(1293,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_POI(-1296.5, 127.57, 6, 6, 0, "Thunder Bluff Civic Information");
+ player->SEND_GOSSIP_MENU(1291,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(-1296, 39.7, 6, 6, 0, "Thunder Bluff Inn");
+ player->SEND_GOSSIP_MENU(3153,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->SEND_POI(-1263.59, 44.36, 6, 6, 0, "Thunder Bluff Mailbox");
+ player->SEND_GOSSIP_MENU(3154,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Auction House
+ player->SEND_POI(1381.77, -4371.16, 6, 6, 0, GOSSIP_TEXT_AUCTIONHOUSE);
+ player->SEND_GOSSIP_MENU(3155,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Weapon master
+ player->SEND_POI(-1282.31, 89.56, 6, 6, 0, "Ansekhwa");
+ player->SEND_GOSSIP_MENU(4520,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Stable master
+ player->SEND_POI(-1270.19, 48.84, 6, 6, 0, "Bulrug");
+ player->SEND_GOSSIP_MENU(5977,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7527,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(3542,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(3541,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(-1387.82, -97.55, 6, 6, 0, "Taim Ragetotem");
+ player->SEND_GOSSIP_MENU(7522,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(-997, 214.12, 6, 6, 0, "Martin Lindsey");
+ player->SEND_GOSSIP_MENU(7648,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(-1384.94, -75.91, 6, 6, 0, "Kergul Bloodaxe");
+ player->SEND_GOSSIP_MENU(7523,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(-1054.47, -285, 6, 6, 0, "Hall of Elders");
+ player->SEND_GOSSIP_MENU(1294,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall");
+ player->SEND_GOSSIP_MENU(1295,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision");
+ player->SEND_GOSSIP_MENU(1296,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Priest
+ player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision");
+ player->SEND_GOSSIP_MENU(1297,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Shaman
+ player->SEND_POI(-989.54, 278.25, 6, 6, 0, "Hall of Spirits");
+ player->SEND_GOSSIP_MENU(1298,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Warrior
+ player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall");
+ player->SEND_GOSSIP_MENU(1299,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-1085.56, 27.29, 6, 6, 0, "Bena's Alchemy");
+ player->SEND_GOSSIP_MENU(1332,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-1239.75, 104.88, 6, 6, 0, "Karn's Smithy");
+ player->SEND_GOSSIP_MENU(1333,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-1214.5, -21.23, 6, 6, 0, "Aska's Kitchen");
+ player->SEND_GOSSIP_MENU(1334,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-1112.65, 48.26, 6, 6, 0, "Dawnstrider Enchanters");
+ player->SEND_GOSSIP_MENU(1335,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(-996.58, 200.5, 6, 6, 0, "Spiritual Healing");
+ player->SEND_GOSSIP_MENU(1336,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
+ player->SEND_POI(-1169.35, -68.87, 6, 6, 0, "Mountaintop Bait & Tackle");
+ player->SEND_GOSSIP_MENU(1337,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
+ player->SEND_POI(-1137.7, -1.51, 6, 6, 0, "Holistic Herbalism");
+ player->SEND_GOSSIP_MENU(1338,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking
+ player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers");
+ player->SEND_GOSSIP_MENU(1339,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Mining
+ player->SEND_POI(-1249.17, 155, 6, 6, 0, "Stonehoof Geology");
+ player->SEND_GOSSIP_MENU(1340,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Skinning
+ player->SEND_POI(-1148.56, 51.18, 6, 6, 0, "Mooranta");
+ player->SEND_GOSSIP_MENU(1343,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring
+ player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers");
+ player->SEND_GOSSIP_MENU(1341,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_bluffwatcher(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_bluffwatcher(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_bluffwatcher(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_bluffwatcher(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_bluffwatcher(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_bluffwatcher end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_bluffwatcher(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_contested start
+ *******************************************************/
+
+struct TRINITY_DLL_DECL guard_contested : public guardAI
+{
+ guard_contested(Creature *c) : guardAI(c) {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if ( who->isAttackingPlayer() )
+ {
+ if(who->GetTypeId() == TYPEID_PLAYER || who->GetOwnerGUID() && GUID_HIPART(who->GetOwnerGUID())==HIGHGUID_PLAYER)
+ {
+ m_creature->AddThreat(who, 0.0f);
+ if(Unit* owner = who->GetOwner())
+ m_creature->AddThreat(owner, 0.0f);
+
+ if(!m_creature->isInCombat())
+ {
+ if (m_creature->GetEntry() == 15184) //Cenarion Hold Infantry
+ {
+ srand (time(NULL));
+ if (rand()%100 <= 30)
+ {
+ DoSay("Taste blade, mongrel!", LANG_UNIVERSAL,NULL);
+ }
+ else if (rand()%100 > 30 && rand()%100 < 50)
+ {
+ DoSay("Please tell me that you didn`t just do what I think you just did. Please tell me that I`m not going to have to hurt you...", LANG_UNIVERSAL,NULL);
+ }
+ else if (rand()%100 >= 50)
+ {
+ DoSay("As if we don`t have enough problems, you go and create more!", LANG_UNIVERSAL,NULL);
+ }
+ }
+ else
+ {
+ SpellEntry const *spell = m_creature->reachWithSpellAttack(who);
+ DoCastSpell(who, spell);
+ }
+ }
+ DoStartAttackAndMovement(who);
+ }
+ }
+ }
+};
+/*******************************************************
+ * guard_contested end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_contested(Creature *_Creature)
+{
+ return new guard_contested (_Creature);
+}
+
+/*******************************************************
+ * guard_darnassus start
+ *******************************************************/
+
+bool GossipHello_guard_darnassus(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(3016, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
+ player->SEND_POI(9861.23, 2334.55, 6, 6, 0, "Darnassus Auction House");
+ player->SEND_GOSSIP_MENU(3833, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(9938.45, 2512.35, 6, 6, 0, "Darnassus Bank");
+ player->SEND_GOSSIP_MENU(3017, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Wind master
+ player->SEND_POI(9945.65, 2618.94, 6, 6, 0, "Rut'theran Village");
+ player->SEND_GOSSIP_MENU(3018, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Guild master
+ player->SEND_POI(10076.40, 2199.59, 6, 6, 0, "Darnassus Guild Master");
+ player->SEND_GOSSIP_MENU(3019, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Inn
+ player->SEND_POI(10133.29, 2222.52, 6, 6, 0, "Darnassus Inn");
+ player->SEND_GOSSIP_MENU(3020, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox
+ player->SEND_POI(9942.17, 2495.48, 6, 6, 0, "Darnassus Mailbox");
+ player->SEND_GOSSIP_MENU(3021, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Stable master
+ player->SEND_POI(10167.20, 2522.66, 6, 6, 0, "Alassin");
+ player->SEND_GOSSIP_MENU(5980, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer
+ player->SEND_POI(9907.11, 2329.70, 6, 6, 0, "Ilyenia Moonfire");
+ player->SEND_GOSSIP_MENU(4517, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7519, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(4264, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->SEND_GOSSIP_MENU(4273, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(9923.61, 2327.43, 6, 6, 0, "Brogun Stoneshield");
+ player->SEND_GOSSIP_MENU(7518, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(9977.37, 2324.39, 6, 6, 0, "Keras Wolfheart");
+ player->SEND_GOSSIP_MENU(7651, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(9979.84, 2315.79, 6, 6, 0, "Aethalas");
+ player->SEND_GOSSIP_MENU(7482, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(10186, 2570.46, 6, 6, 0, "Darnassus Druid Trainer");
+ player->SEND_GOSSIP_MENU(3024, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(10177.29, 2511.10, 6, 6, 0, "Darnassus Hunter Trainer");
+ player->SEND_GOSSIP_MENU(3023, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Priest
+ player->SEND_POI(9659.12, 2524.88, 6, 6, 0, "Temple of the Moon");
+ player->SEND_GOSSIP_MENU(3025, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
+ player->SEND_POI(10122, 2599.12, 6, 6, 0, "Darnassus Rogue Trainer");
+ player->SEND_GOSSIP_MENU(3026, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
+ player->SEND_POI(9951.91, 2280.38, 6, 6, 0, "Warrior's Terrace");
+ player->SEND_GOSSIP_MENU(3033, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(10075.90, 2356.76, 6, 6, 0, "Darnassus Alchemy Trainer");
+ player->SEND_GOSSIP_MENU(3035, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Cooking
+ player->SEND_POI(10088.59, 2419.21, 6, 6, 0, "Darnassus Cooking Trainer");
+ player->SEND_GOSSIP_MENU(3036, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting
+ player->SEND_POI(10146.09, 2313.42, 6, 6, 0, "Darnassus Enchanting Trainer");
+ player->SEND_GOSSIP_MENU(3337, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //First Aid
+ player->SEND_POI(10150.09, 2390.43, 6, 6, 0, "Darnassus First Aid Trainer");
+ player->SEND_GOSSIP_MENU(3037, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Fishing
+ player->SEND_POI(9836.20, 2432.17, 6, 6, 0, "Darnassus Fishing Trainer");
+ player->SEND_GOSSIP_MENU(3038, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism
+ player->SEND_POI(9757.17, 2430.16, 6, 6, 0, "Darnassus Herbalism Trainer");
+ player->SEND_GOSSIP_MENU(3039, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
+ player->SEND_POI(10086.59, 2255.77, 6, 6, 0, "Darnassus Leatherworking Trainer");
+ player->SEND_GOSSIP_MENU(3040, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
+ player->SEND_POI(10081.40, 2257.18, 6, 6, 0, "Darnassus Skinning Trainer");
+ player->SEND_GOSSIP_MENU(3042, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring
+ player->SEND_POI(10079.70, 2268.19, 6, 6, 0, "Darnassus Tailor");
+ player->SEND_GOSSIP_MENU(3044, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_darnassus(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_darnassus(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_darnassus(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_darnassus(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_darnassus(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_darnassus end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_darnassus(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_dunmorogh start
+ *******************************************************/
+
+bool GossipHello_guard_dunmorogh(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(4287,_Creature->GetGUID());
+
+ return true;
+}
+
+void SendDefaultMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4288,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Gryphon master
+ player->SEND_GOSSIP_MENU(4289,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_GOSSIP_MENU(4290,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(-5582.66, -525.89, 6, 6, 0, "Thunderbrew Distillery");
+ player->SEND_GOSSIP_MENU(4291,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
+ player->SEND_POI(-5604, -509.58, 6, 6, 0, "Shelby Stoneflint");
+ player->SEND_GOSSIP_MENU(5985,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(4292,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(4300,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
+ player->SEND_POI(-5618.29, -454.25, 6, 6, 0, "Grif Wildheart");
+ player->SEND_GOSSIP_MENU(4293,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Mage
+ player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Magis Sparkmantle");
+ player->SEND_GOSSIP_MENU(4294,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Paladin
+ player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Azar Stronghammer");
+ player->SEND_GOSSIP_MENU(4295,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Priest
+ player->SEND_POI(-5591.74, -525.61, 6, 6, 0, "Maxan Anvol");
+ player->SEND_GOSSIP_MENU(4296,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
+ player->SEND_POI(-5602.75, -542.4, 6, 6, 0, "Hogral Bakkan");
+ player->SEND_GOSSIP_MENU(4297,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
+ player->SEND_POI(-5641.97, -523.76, 6, 6, 0, "Gimrizz Shadowcog");
+ player->SEND_GOSSIP_MENU(4298,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(-5604.79, -529.38, 6, 6, 0, "Granis Swiftaxe");
+ player->SEND_GOSSIP_MENU(4299,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_GOSSIP_MENU(4301,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-5584.72, -428.41, 6, 6, 0, "Tognus Flintfire");
+ player->SEND_GOSSIP_MENU(4302,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-5596.85, -541.43, 6, 6, 0, "Gremlock Pilsnor");
+ player->SEND_GOSSIP_MENU(4303,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_GOSSIP_MENU(4304,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(-5531, -666.53, 6, 6, 0, "Bronk Guzzlegear");
+ player->SEND_GOSSIP_MENU(4305,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-5603.67, -523.57, 6, 6, 0, "Thamner Pol");
+ player->SEND_GOSSIP_MENU(4306,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-5199.9, 58.58, 6, 6, 0, "Paxton Ganter");
+ player->SEND_GOSSIP_MENU(4307,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_GOSSIP_MENU(4308,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_GOSSIP_MENU(4310,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_POI(-5531, -666.53, 6, 6, 0, "Yarr Hamerstone");
+ player->SEND_GOSSIP_MENU(4311,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_GOSSIP_MENU(4312,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_GOSSIP_MENU(4313,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_dunmorogh(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_dunmorogh(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_dunmorogh(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_dunmorogh(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_dunmorogh end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_dunmorogh(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_durotar start
+ *******************************************************/
+
+bool GossipHello_guard_durotar(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(4037,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4032,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Wind rider
+ player->SEND_GOSSIP_MENU(4033,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(338.7, -4688.87, 6, 6, 0, "Razor Hill Inn");
+ player->SEND_GOSSIP_MENU(4034,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Stable master
+ player->SEND_POI(330.31, -4710.66, 6, 6, 0, "Shoja'my");
+ player->SEND_GOSSIP_MENU(5973,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(4035,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(4036,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
+ player->SEND_POI(276, -4706.72, 6, 6, 0, "Thotar");
+ player->SEND_GOSSIP_MENU(4013,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Mage
+ player->SEND_POI(-839.33, -4935.6, 6, 6, 0, "Un'Thuwa");
+ player->SEND_GOSSIP_MENU(4014,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Priest
+ player->SEND_POI(296.22, -4828.1, 6, 6, 0, "Tai'jin");
+ player->SEND_GOSSIP_MENU(4015,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
+ player->SEND_POI(265.76, -4709, 6, 6, 0, "Kaplak");
+ player->SEND_GOSSIP_MENU(4016,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Shaman
+ player->SEND_POI(307.79, -4836.97, 6, 6, 0, "Swart");
+ player->SEND_GOSSIP_MENU(4017,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
+ player->SEND_POI(355.88, -4836.45, 6, 6, 0, "Dhugru Gorelust");
+ player->SEND_GOSSIP_MENU(4018,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(312.3, -4824.66, 6, 6, 0, "Tarshaw Jaggedscar");
+ player->SEND_GOSSIP_MENU(4019,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-800.25, -4894.33, 6, 6, 0, "Miao'zan");
+ player->SEND_GOSSIP_MENU(4020,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(373.24, -4716.45, 6, 6, 0, "Dwukk");
+ player->SEND_GOSSIP_MENU(4021,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_GOSSIP_MENU(4022,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_GOSSIP_MENU(4023,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(368.95, -4723.95, 6, 6, 0, "Mukdrak");
+ player->SEND_GOSSIP_MENU(4024,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(327.17, -4825.62, 6, 6, 0, "Rawrk");
+ player->SEND_GOSSIP_MENU(4025,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-1065.48, -4777.43, 6, 6, 0, "Lau'Tiki");
+ player->SEND_GOSSIP_MENU(4026,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(-836.25, -4896.89, 6, 6, 0, "Mishiki");
+ player->SEND_GOSSIP_MENU(4027,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_GOSSIP_MENU(4028,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_POI(366.94, -4705, 6, 6, 0, "Krunn");
+ player->SEND_GOSSIP_MENU(4029,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_GOSSIP_MENU(4030,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_GOSSIP_MENU(4031,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_durotar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_durotar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_durotar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_durotar(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_durotar end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_durotar(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_elwynnforest start
+ *******************************************************/
+
+bool GossipHello_guard_elwynnforest(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(933,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4260,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Gryphon master
+ player->SEND_GOSSIP_MENU(4261,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_GOSSIP_MENU(4262,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(-9459.34, 42.08, 6, 6, 0, "Lion's Pride Inn");
+ player->SEND_GOSSIP_MENU(4263,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
+ player->SEND_POI(-9466.62, 45.87, 6, 6, 0, "Erma");
+ player->SEND_GOSSIP_MENU(5983,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(4264,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(4273,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_GOSSIP_MENU(4265,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_GOSSIP_MENU(4266,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(-9471.12, 33.44, 6, 6, 0, "Zaldimar Wefhellt");
+ player->SEND_GOSSIP_MENU(4268,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
+ player->SEND_POI(-9469, 108.05, 6, 6, 0, "Brother Wilhelm");
+ player->SEND_GOSSIP_MENU(4269,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(-9461.07, 32.6, 6, 6, 0, "Priestess Josetta");
+ player->SEND_GOSSIP_MENU(4267,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
+ player->SEND_POI(-9465.13, 13.29, 6, 6, 0, "Keryn Sylvius");
+ player->SEND_GOSSIP_MENU(4270,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
+ player->SEND_POI(-9473.21, -4.08, 6, 6, 0, "Maximillian Crowe");
+ player->SEND_GOSSIP_MENU(4272,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Warrior
+ player->SEND_POI(-9461.82, 109.50, 6, 6, 0, "Lyria Du Lac");
+ player->SEND_GOSSIP_MENU(4271,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-9057.04, 153.63, 6, 6, 0, "Alchemist Mallory");
+ player->SEND_GOSSIP_MENU(4274,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-9456.58, 87.90, 6, 6, 0, "Smith Argus");
+ player->SEND_GOSSIP_MENU(4275,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-9467.54, -3.16, 6, 6, 0, "Tomas");
+ player->SEND_GOSSIP_MENU(4276,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_GOSSIP_MENU(4277,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_GOSSIP_MENU(4278,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-9456.82, 30.49, 6, 6, 0, "Michelle Belle");
+ player->SEND_GOSSIP_MENU(4279,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-9386.54, -118.73, 6, 6, 0, "Lee Brown");
+ player->SEND_GOSSIP_MENU(4280,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(-9060.70, 149.23, 6, 6, 0, "Herbalist Pomeroy");
+ player->SEND_GOSSIP_MENU(4281,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Adele Fielder");
+ player->SEND_GOSSIP_MENU(4282,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_GOSSIP_MENU(4283,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(-9536.91, -1212.76, 6, 6, 0, "Helene Peltskinner");
+ player->SEND_GOSSIP_MENU(4284,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Eldrin");
+ player->SEND_GOSSIP_MENU(4285,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_elwynnforest(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_elwynnforest(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_elwynnforest(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_elwynnforest(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_elwynnforest end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_elwynnforest(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_eversong start
+ *******************************************************/
+
+bool GossipHello_guard_eversong(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bat Handler
+ player->SEND_POI(9371.93, -7164.80, 6, 6, 0, "Skymistress Gloaming");
+ player->SEND_GOSSIP_MENU(10181,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Guild master
+ player->SEND_GOSSIP_MENU(10182,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(9483.74, -6844.58, 6, 6, 0, "Delaniel's inn");
+ player->SEND_GOSSIP_MENU(10183,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master
+ player->SEND_POI(9489.62, -6829.93, 6, 6, 0, "Anathos");
+ player->SEND_GOSSIP_MENU(10184,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(10180,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_GOSSIP_MENU(10185,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(9527.44, -6865.25, 6, 6, 0, "Hannovia");
+ player->SEND_GOSSIP_MENU(10186,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(9464.24, -6855.52, 6, 6, 0, "Garridel");
+ player->SEND_GOSSIP_MENU(10187,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
+ player->SEND_POI(9517.61, -6871.04, 6, 6, 0, "Noellene");
+ player->SEND_GOSSIP_MENU(10189,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(9467.39, -6845.72, 6, 6, 0, "Ponaris");
+ player->SEND_GOSSIP_MENU(10190,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
+ player->SEND_POI(9533.67, -6877.39, 6, 6, 0, "Tannaria");
+ player->SEND_GOSSIP_MENU(10191,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
+ player->SEND_POI(9468.99, -6865.60, 6, 6, 0, "Celoenus");
+ player->SEND_GOSSIP_MENU(10192,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_eversong(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(8659.90, -6368.12, 6, 6, 0, "Arcanist Sheynathren");
+ player->SEND_GOSSIP_MENU(10193,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(8984.21, -7419.21, 6, 6, 0, "Arathel Sunforge");
+ player->SEND_GOSSIP_MENU(10194,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(9494.04, -6881.51, 6, 6, 0, "Quarelestra");
+ player->SEND_GOSSIP_MENU(10195,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Engineering
+ player->SEND_GOSSIP_MENU(10197,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(9479.46, -6879.16, 6, 6, 0, "Kanaria");
+ player->SEND_GOSSIP_MENU(10198,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
+ player->SEND_GOSSIP_MENU(10199,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
+ player->SEND_POI(8678.92, -6329.09, 6, 6, 0, "Botanist Tyniarrel");
+ player->SEND_GOSSIP_MENU(10200,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
+ player->SEND_POI(9484.32, -6874.98, 6, 6, 0, "Aleinia");
+ player->SEND_GOSSIP_MENU(10203,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Sathein");
+ player->SEND_GOSSIP_MENU(10204,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_GOSSIP_MENU(10205,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Mathreyn");
+ player->SEND_GOSSIP_MENU(10206,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(8680.36, -6327.51, 6, 6, 0, "Sempstress Ambershine");
+ player->SEND_GOSSIP_MENU(10207,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_eversong(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_eversong(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_eversong(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_eversong(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_eversong end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_eversong(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_exodar start
+ *******************************************************/
+
+bool GossipHello_guard_exodar(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HIPPOGRYPH , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(9551, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
+ player->SEND_POI(-4023.6, -11739.3, 6, 6, 0, "Exodar Auction House");
+ player->SEND_GOSSIP_MENU(9528, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(-3923.89, -11544.5, 6, 6, 0, "Exodar Bank");
+ player->SEND_GOSSIP_MENU(9529, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_POI(-4092.57, -11626.5, 6, 6, 0, "Exodar Guild Master");
+ player->SEND_GOSSIP_MENU(9539, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Hippogryph master
+ player->SEND_POI(-4060.46, -11787.1, 6, 6, 0, "Exodar Hippogryph Master");
+ player->SEND_GOSSIP_MENU(9530, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Inn
+ player->SEND_POI(-3741.87, -11695.1, 6, 6, 0, "Exodar Inn");
+ player->SEND_GOSSIP_MENU(9545, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox
+ player->SEND_POI(-3972.5, -11696.0, 6, 6, 0, "Mailbox");
+ player->SEND_GOSSIP_MENU(10254, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Stable master
+ player->SEND_POI(-3786.5, -11702.5, 6, 6, 0, "Stable Master Arthaid");
+ player->SEND_GOSSIP_MENU(9558, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer
+ player->SEND_POI(-4215.68, -11628.9, 6, 6, 0, "Weapon Master Handiir");
+ player->SEND_GOSSIP_MENU(9565, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_EYEOFTHESTORM , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(9533, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(9555, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Alterac Valley Battlemaster");
+ player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(-3998.9, -11345.2, 6, 6, 0, "Arathi Basin Battlemaster");
+ player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //A
+ player->SEND_POI(-3759.27, -11695.63, 6, 6, 0, "Miglik Blotstrom");
+ player->SEND_GOSSIP_MENU(10223, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //EOS
+ player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Eye Of The Storm Battlemaster");
+ player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //WSG
+ player->SEND_POI(-3977.5, -11381.2, 6, 6, 0, "Warsong Gulch Battlemaster");
+ player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(-4276.0, -11495, 6, 6, 0, "Exodar Druid Trainer");
+ player->SEND_GOSSIP_MENU(9534, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(-4210.6, -11575.2, 6, 6, 0, "Exodar Hunter Trainer");
+ player->SEND_GOSSIP_MENU(9544, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(-4057.32, -11556.5, 6, 6, 0, "Exodar Mage Trainer");
+ player->SEND_GOSSIP_MENU(9550, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
+ player->SEND_POI(-4191.2, -11470.4, 6, 6, 0, "Exodar Paladin Trainer");
+ player->SEND_GOSSIP_MENU(9553, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(-3969.63, -11482.8, 6, 6, 0, "Exodar Priest Trainer");
+ player->SEND_GOSSIP_MENU(9554, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Shaman
+ player->SEND_POI(-3805.5, -11380.7, 6, 6, 0, "Exodar Shaman Trainer");
+ player->SEND_GOSSIP_MENU(9556, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(-4189.43, -11653.7, 6, 6, 0, "Exodar Warrior Trainer");
+ player->SEND_GOSSIP_MENU(9562, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Alchemy Trainer");
+ player->SEND_GOSSIP_MENU(9527, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-4229.5, -11706, 6, 6, 0, "Exodar Blacksmithing Trainer");
+ player->SEND_GOSSIP_MENU(9532, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-3798.3, -11651.7, 6, 6, 0, "Exodar Cooking Trainer");
+ player->SEND_GOSSIP_MENU(9551, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-3889.3, -11495, 6, 6, 0, "Exodar Enchanting Trainer");
+ player->SEND_GOSSIP_MENU(9535, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(-4257.68, -11640.3, 6, 6, 0, "Exodar Engineering Trainer");
+ player->SEND_GOSSIP_MENU(9536, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-3769.5, -11479.6, 6, 6, 0, "Exodar First Aid Trainer");
+ player->SEND_GOSSIP_MENU(9537, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-3725.5, -11385.2, 6, 6, 0, "Exodar Fishing Trainer");
+ player->SEND_GOSSIP_MENU(9538, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
+ player->SEND_POI(-3783, -11546, 6, 6, 0, "Exodar Jewelcrafting Trainer");
+ player->SEND_GOSSIP_MENU(9547, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism
+ player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Herbalist Trainer");
+ player->SEND_GOSSIP_MENU(9543, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
+ player->SEND_POI(-4140.6, -11776.7, 6, 6, 0, "Exodar Leatherworking Trainer");
+ player->SEND_GOSSIP_MENU(9549, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Mining
+ player->SEND_POI(-4228, -11697, 6, 6, 0, "Exodar Mining Trainer");
+ player->SEND_GOSSIP_MENU(9552, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
+ player->SEND_POI(-4134.97, -11760.5, 6, 6, 0, "Exodar Skinning Trainer");
+ player->SEND_GOSSIP_MENU(9557, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
+ player->SEND_POI(-4092.5, -11744.5, 6, 6, 0, "Exodar Tailor Trainer");
+ player->SEND_GOSSIP_MENU(9559, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_exodar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_exodar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_exodar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_exodar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_exodar(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_exodar end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_exodar(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_ironforge start
+ *******************************************************/
+
+bool GossipHello_guard_ironforge(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_IRONFORGE_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DEEPRUNTRAM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(2760, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Auction House
+ player->SEND_POI(-4957.39, -911.6, 6, 6, 0, "Ironforge Auction House");
+ player->SEND_GOSSIP_MENU(3014, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(-4891.91, -991.47, 6, 6, 0, "The Vault");
+ player->SEND_GOSSIP_MENU(2761, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Tram
+ player->SEND_POI(-4835.27, -1294.69, 6, 6, 0, "Deeprun Tram");
+ player->SEND_GOSSIP_MENU(3814, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Gryphon Master
+ player->SEND_POI(-4821.52, -1152.3, 6, 6, 0, "Ironforge Gryphon Master");
+ player->SEND_GOSSIP_MENU(2762, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Guild Master
+ player->SEND_POI(-5021, -996.45, 6, 6, 0, "Ironforge Visitor's Center");
+ player->SEND_GOSSIP_MENU(2764, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Inn
+ player->SEND_POI(-4850.47, -872.57, 6, 6, 0, "Stonefire Tavern");
+ player->SEND_GOSSIP_MENU(2768, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox
+ player->SEND_POI(-4845.7, -880.55, 6, 6, 0, "Ironforge Mailbox");
+ player->SEND_GOSSIP_MENU(2769, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master
+ player->SEND_POI(-5010.2, -1262, 6, 6, 0, "Ulbrek Firehand");
+ player->SEND_GOSSIP_MENU(5986, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Weapons Trainer
+ player->SEND_POI(-5040, -1201.88, 6, 6, 0, "Bixi and Buliwyf");
+ player->SEND_GOSSIP_MENU(4518, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7529, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Class Trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(2766, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Profession Trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(2793, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(-5047.87, -1263.77, 6, 6, 0, "Glordrum Steelbeard");
+ player->SEND_GOSSIP_MENU(7483, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(-5038.37, -1266.39, 6, 6, 0, "Donal Osgood");
+ player->SEND_GOSSIP_MENU(7649, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(-5037.24, -1274.82, 6, 6, 0, "Lylandris");
+ player->SEND_GOSSIP_MENU(7528, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
+ player->SEND_POI(-5023, -1253.68, 6, 6, 0, "Hall of Arms");
+ player->SEND_GOSSIP_MENU(2770, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Mage
+ player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries");
+ player->SEND_GOSSIP_MENU(2771, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Paladin
+ player->SEND_POI(-4627.02, -926.45, 6, 6, 0, "Hall of Mysteries");
+ player->SEND_GOSSIP_MENU(2773, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Priest
+ player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries");
+ player->SEND_GOSSIP_MENU(2772, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
+ player->SEND_POI(-4647.83, -1124, 6, 6, 0, "Ironforge Rogue Trainer");
+ player->SEND_GOSSIP_MENU(2774, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
+ player->SEND_POI(-4605, -1110.45, 6, 6, 0, "Ironforge Warlock Trainer");
+ player->SEND_GOSSIP_MENU(2775, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(-5023.08, -1253.68, 6, 6, 0, "Hall of Arms");
+ player->SEND_GOSSIP_MENU(2776, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Shaman
+ player->SEND_POI(-4732, -1147, 6, 6, 0, "Ironforge Shaman Trainer");
+ //incorrect id
+ player->SEND_GOSSIP_MENU(2766, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-4858.5, -1241.83, 6, 6, 0, "Berryfizz's Potions and Mixed Drinks");
+ player->SEND_GOSSIP_MENU(2794, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-4796.97, -1110.17, 6, 6, 0, "The Great Forge");
+ player->SEND_GOSSIP_MENU(2795, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-4767.83, -1184.59, 6, 6, 0, "The Bronze Kettle");
+ player->SEND_GOSSIP_MENU(2796, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-4803.72, -1196.53, 6, 6, 0, "Thistlefuzz Arcanery");
+ player->SEND_GOSSIP_MENU(2797, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(-4799.56, -1250.23, 6, 6, 0, "Springspindle's Gadgets");
+ player->SEND_GOSSIP_MENU(2798, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-4881.6, -1153.13, 6, 6, 0, "Ironforge Physician");
+ player->SEND_GOSSIP_MENU(2799, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-4597.91, -1091.93, 6, 6, 0, "Traveling Fisherman");
+ player->SEND_GOSSIP_MENU(2800, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(-4876.9, -1151.92, 6, 6, 0, "Ironforge Physician");
+ player->SEND_GOSSIP_MENU(2801, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods");
+ player->SEND_GOSSIP_MENU(2802, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Minning
+ player->SEND_POI(-4705.06, -1116.43, 6, 6, 0, "Deepmountain Mining Guild");
+ player->SEND_GOSSIP_MENU(2804, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods");
+ player->SEND_GOSSIP_MENU(2805, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(-4719.60, -1056.96, 6, 6, 0, "Stonebrow's Clothier");
+ player->SEND_GOSSIP_MENU(2807, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_ironforge(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_ironforge(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_ironforge(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_ironforge(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_ironforge(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_ironforge end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_ironforge(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_mulgore start
+ *******************************************************/
+
+bool GossipHello_guard_mulgore(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4051,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Wind rider
+ player->SEND_GOSSIP_MENU(4052,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(-2361.38, -349.19, 6, 6, 0, "Bloodhoof Village Inn");
+ player->SEND_GOSSIP_MENU(4053,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Stable master
+ player->SEND_POI(-2338.86, -357.56, 6, 6, 0, "Seikwa");
+ player->SEND_GOSSIP_MENU(5976,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(4069,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(4070,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(-2312.15, -443.69, 6, 6, 0, "Gennia Runetotem");
+ player->SEND_GOSSIP_MENU(4054,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(-2178.14, -406.14, 6, 6, 0, "Yaw Sharpmane");
+ player->SEND_GOSSIP_MENU(4055,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Shaman
+ player->SEND_POI(-2301.5, -439.87, 6, 6, 0, "Narm Skychaser");
+ player->SEND_GOSSIP_MENU(4056,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Warrior
+ player->SEND_POI(-2345.43, -494.11, 6, 6, 0, "Krang Stonehoof");
+ player->SEND_GOSSIP_MENU(4057,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_GOSSIP_MENU(4058,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_GOSSIP_MENU(4059,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-2263.34, -287.91, 6, 6, 0, "Pyall Silentstride");
+ player->SEND_GOSSIP_MENU(4060,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_GOSSIP_MENU(4061,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(-2353.52, -355.82, 6, 6, 0, "Vira Younghoof");
+ player->SEND_GOSSIP_MENU(4062,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
+ player->SEND_POI(-2349.21, -241.37, 6, 6, 0, "Uthan Stillwater");
+ player->SEND_GOSSIP_MENU(4063,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
+ player->SEND_GOSSIP_MENU(4064,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking
+ player->SEND_POI(-2257.12, -288.63, 6, 6, 0, "Chaw Stronghide");
+ player->SEND_GOSSIP_MENU(4065,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Mining
+ player->SEND_GOSSIP_MENU(4066,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Skinning
+ player->SEND_POI(-2252.94, -291.32, 6, 6, 0, "Yonn Deepcut");
+ player->SEND_GOSSIP_MENU(4067,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring
+ player->SEND_GOSSIP_MENU(4068,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_mulgore(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_mulgore(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_mulgore(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_mulgore(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_mulgore end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_mulgore(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_orgrimmar start
+ *******************************************************/
+
+bool GossipHello_guard_orgrimmar(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ZEPPLINMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_OFFICERS , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(2593,_Creature->GetGUID());
+
+ return true;
+}
+
+void SendDefaultMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_POI(1631.51, -4375.33, 6, 6, 0, "Bank of Orgrimmar");
+ player->SEND_GOSSIP_MENU(2554,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //wind rider
+ player->SEND_POI(1676.6, -4332.72, 6, 6, 0, "The Sky Tower");
+ player->SEND_GOSSIP_MENU(2555,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //guild master
+ player->SEND_POI(1576.93, -4294.75, 6, 6, 0, "Horde Embassy");
+ player->SEND_GOSSIP_MENU(2556,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(1644.51, -4447.27, 6, 6, 0, "Orgrimmar Inn");
+ player->SEND_GOSSIP_MENU(2557,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //mailbox
+ player->SEND_POI(1622.53, -4388.79, 6, 6, 0, "Orgrimmar Mailbox");
+ player->SEND_GOSSIP_MENU(2558,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //auction house
+ player->SEND_POI(1679.21, -4450.1, 6, 6, 0, "Orgrimmar Auction House");
+ player->SEND_GOSSIP_MENU(3075,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //zeppelin
+ player->SEND_POI(1337.36, -4632.7, 6, 6, 0, "Orgrimmar Zeppelin Tower");
+ player->SEND_GOSSIP_MENU(3173,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //weapon master
+ player->SEND_POI(2092.56, -4823.95, 6, 6, 0, "Sayoc & Hanashi");
+ player->SEND_GOSSIP_MENU(4519,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //stable master
+ player->SEND_POI(2133.12, -4663.93, 6, 6, 0, "Xon'cha");
+ player->SEND_GOSSIP_MENU(5974,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //officers lounge
+ player->SEND_POI(1633.56, -4249.37, 6, 6, 0, "Hall of Legends");
+ player->SEND_GOSSIP_MENU(7046,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7521,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(2599,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13: //profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(2594,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_GOSSIP_MENU(7484,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_GOSSIP_MENU(7644,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_GOSSIP_MENU(7520,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
+ player->SEND_POI(2114.84, -4625.31, 6, 6, 0, "Orgrimmar Hunter's Hall");
+ player->SEND_GOSSIP_MENU(2559,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Mage
+ player->SEND_POI(1451.26, -4223.33, 6, 6, 0, "Darkbriar Lodge");
+ player->SEND_GOSSIP_MENU(2560,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Priest
+ player->SEND_POI(1442.21, -4183.24, 6, 6, 0, "Spirit Lodge");
+ player->SEND_GOSSIP_MENU(2561,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Shaman
+ player->SEND_POI(1925.34, -4181.89, 6, 6, 0, "Thrall's Fortress");
+ player->SEND_GOSSIP_MENU(2562,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
+ player->SEND_POI(1773.39, -4278.97, 6, 6, 0, "Shadowswift Brotherhood");
+ player->SEND_GOSSIP_MENU(2563,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
+ player->SEND_POI(1849.57, -4359.68, 6, 6, 0, "Darkfire Enclave");
+ player->SEND_GOSSIP_MENU(2564,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
+ player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_GOSSIP_MENU(2565,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Paladin
+ player->SEND_POI(1906.65, -4134.26, 6, 6, 0, "Valley of Wisdom");
+ player->SEND_GOSSIP_MENU(10843,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(1955.17, -4475.79, 6, 6, 0, "Yelmak's Alchemy and Potions");
+ player->SEND_GOSSIP_MENU(2497,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(2054.34, -4831.85, 6, 6, 0, "The Burning Anvil");
+ player->SEND_GOSSIP_MENU(2499,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(1780.96, -4481.31, 6, 6, 0, "Borstan's Firepit");
+ player->SEND_GOSSIP_MENU(2500,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(1917.5, -4434.95, 6, 6, 0, "Godan's Runeworks");
+ player->SEND_GOSSIP_MENU(2501,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(2038.45, -4744.75, 6, 6, 0, "Nogg's Machine Shop");
+ player->SEND_GOSSIP_MENU(2653,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(1485.21, -4160.91, 6, 6, 0, "Survival of the Fittest");
+ player->SEND_GOSSIP_MENU(2502,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(1994.15, -4655.7, 6, 6, 0, "Lumak's Fishing");
+ player->SEND_GOSSIP_MENU(2503,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(1898.61, -4454.93, 6, 6, 0, "Jandi's Arboretum");
+ player->SEND_GOSSIP_MENU(2504,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers");
+ player->SEND_GOSSIP_MENU(2513,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_POI(2029.79, -4704, 6, 6, 0, "Red Canyon Mining");
+ player->SEND_GOSSIP_MENU(2515,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers");
+ player->SEND_GOSSIP_MENU(2516,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(1802.66, -4560.66, 6, 6, 0, "Magar's Cloth Goods");
+ player->SEND_GOSSIP_MENU(2518,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_orgrimmar(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_orgrimmar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_orgrimmar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_orgrimmar(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_orgrimmar(player, _Creature, action); break;
+ }
+ return true;
+}
+
+bool ReceiveEmote_guard_orgrimmar(Player *player, Creature *_Creature, uint32 emote)
+{
+ if( player->GetTeam() == HORDE )
+ DoReplyToTextEmote(_Creature,emote);
+ return true;
+}
+
+/*******************************************************
+ * guard_orgrimmar end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_orgrimmar(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_shattrath start
+ *******************************************************/
+
+bool GossipHello_guard_shattrath(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
+
+ return true;
+}
+
+void SendDefaultMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
+ player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
+ player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKALDOR , GOSSIP_SENDER_SEC_BANK, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKSCYERS , GOSSIP_SENDER_SEC_BANK, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(10379, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNALDOR , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNSCYERS , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(10382, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
+ player->SEND_POI(-1832, 5299, 6, 6, 0, "Flight Master");
+ player->SEND_GOSSIP_MENU(10385, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKALDOR , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNALDOR , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANKSCYERS , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INNSCYERS , GOSSIP_SENDER_SEC_MAILBOX, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(10386, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEALDOR , GOSSIP_SENDER_SEC_STABLEMASTER, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLESCYERS , GOSSIP_SENDER_SEC_STABLEMASTER, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(10387, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(10388, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
+ player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
+ player->SEND_GOSSIP_MENU(10503, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
+ player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
+ player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMALDOR , GOSSIP_SENDER_SEC_GEMMERCHANT, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMSCYERS , GOSSIP_SENDER_SEC_GEMMERCHANT, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(10697, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBankMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
+ player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank");
+ player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID());
+ }
+}
+
+void SendInnMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
+ player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn");
+ player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID());
+ }
+}
+
+void SendMailboxMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
+ player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
+ player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank");
+ player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn");
+ player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendStableMasterMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable");
+ player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(-2170, 5404, 6, 6, 0, "Scyers Stable");
+ player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
+ }
+}
+
+void SendBattleMasterMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ player->SEND_POI(-1774, 5251, 6, 6, 0, "Alliance Battlemasters");
+ player->SEND_GOSSIP_MENU(10389, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ player->SEND_POI(-1963, 5263, 6, 6, 0, "Horde Battlemasters");
+ player->SEND_GOSSIP_MENU(10390, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->SEND_POI(-1960, 5175, 6, 6, 0, "Arena Battlemasters");
+ player->SEND_GOSSIP_MENU(12510, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
+ player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
+ player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
+ player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
+ player->SEND_GOSSIP_MENU(10395, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
+ player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
+ player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
+ player->SEND_GOSSIP_MENU(10397, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
+ player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
+ player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
+ player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
+ player->SEND_GOSSIP_MENU(10398, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendGemMerchantMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant");
+ player->SEND_GOSSIP_MENU(10698, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(-2193, 5424.5, 6, 6, 0, "Scyers Gem Merchant");
+ player->SEND_GOSSIP_MENU(10699, _Creature->GetGUID());
+ }
+}
+
+bool GossipSelect_guard_shattrath(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BANK: SendBankMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_INN: SendInnMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_STABLEMASTER: SendStableMasterMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_GEMMERCHANT: SendGemMerchantMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_MAILBOX: SendMailboxMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_shattrath end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_shattrath(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_shattrath_aldor
+ *******************************************************/
+
+#define SPELL_BANISHED_SHATTRATH_A 36642
+#define SPELL_BANISHED_SHATTRATH_S 36671
+#define SPELL_BANISH_TELEPORT 36643
+#define SPELL_EXILE 39533
+
+struct TRINITY_DLL_DECL guard_shattrath_aldorAI : public guardAI
+{
+ guard_shattrath_aldorAI(Creature *c) : guardAI(c) { Reset(); }
+
+ uint32 Exile_Timer;
+ uint32 Banish_Timer;
+ uint64 playerGUID;
+ bool CanTeleport;
+
+ void Reset()
+ {
+ Banish_Timer = 5000;
+ Exile_Timer = 8500;
+ playerGUID = 0;
+ CanTeleport = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( CanTeleport )
+ {
+ if( Exile_Timer < diff )
+ {
+ if( Unit* temp = Unit::GetUnit(*m_creature,playerGUID) )
+ {
+ temp->CastSpell(temp,SPELL_EXILE,true);
+ temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
+ }
+ playerGUID = 0;
+ Exile_Timer = 8500;
+ CanTeleport = false;
+ }else Exile_Timer -= diff;
+ }
+ else if( Banish_Timer < diff )
+ {
+ Unit* temp = m_creature->getVictim();
+ if( temp && temp->GetTypeId() == TYPEID_PLAYER )
+ {
+ DoCast(temp,SPELL_BANISHED_SHATTRATH_A);
+ Banish_Timer = 9000;
+ playerGUID = temp->GetGUID();
+ if( playerGUID )
+ CanTeleport = true;
+ }
+ }else Banish_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+bool GossipHello_guard_shattrath_aldor(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(10524, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
+ player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
+ player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
+ player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
+ player->SEND_GOSSIP_MENU(10525, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
+ player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master");
+ player->SEND_GOSSIP_MENU(10402, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->SEND_POI(0, 0, 6, 6, 0, "Aldor Mailbox");
+ //unknown
+ player->SEND_GOSSIP_MENU(10524, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
+ player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable Master");
+ player->SEND_GOSSIP_MENU(10527, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(10388, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
+ player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
+ player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
+ player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
+ player->SEND_GOSSIP_MENU(10696, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
+ player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant");
+ player->SEND_GOSSIP_MENU(10411, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
+ player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
+ player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
+ player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
+ player->SEND_GOSSIP_MENU(10528, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
+ player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
+ player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
+ player->SEND_GOSSIP_MENU(10529, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
+ player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
+ player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
+ player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
+ player->SEND_GOSSIP_MENU(10419, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_shattrath_aldor(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath_aldor(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath_aldor(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_shattrath_aldor end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_shattrath_aldor(Creature *_Creature)
+{
+ return new guard_shattrath_aldorAI (_Creature);
+}
+
+/*******************************************************
+ * guard_shattrath_scryer
+ *******************************************************/
+
+struct TRINITY_DLL_DECL guard_shattrath_scryerAI : public guardAI
+{
+ guard_shattrath_scryerAI(Creature *c) : guardAI(c) { Reset(); }
+
+ uint32 Exile_Timer;
+ uint32 Banish_Timer;
+ uint64 playerGUID;
+ bool CanTeleport;
+
+ void Reset()
+ {
+ Banish_Timer = 5000;
+ Exile_Timer = 8500;
+ playerGUID = 0;
+ CanTeleport = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( CanTeleport )
+ {
+ if( Exile_Timer < diff )
+ {
+ if( Unit* temp = Unit::GetUnit(*m_creature,playerGUID) )
+ {
+ temp->CastSpell(temp,SPELL_EXILE,true);
+ temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
+ }
+ playerGUID = 0;
+ Exile_Timer = 8500;
+ CanTeleport = false;
+ }else Exile_Timer -= diff;
+ }
+ else if( Banish_Timer < diff )
+ {
+ Unit* temp = m_creature->getVictim();
+ if( temp && temp->GetTypeId() == TYPEID_PLAYER )
+ {
+ DoCast(temp,SPELL_BANISHED_SHATTRATH_S);
+ Banish_Timer = 9000;
+ playerGUID = temp->GetGUID();
+ if( playerGUID )
+ CanTeleport = true;
+ }
+ }else Banish_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+bool GossipHello_guard_shattrath_scryer(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAVERN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FLIGHTMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MANALOOM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMYLAB , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GEMMERCHANT , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(10430, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
+ player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
+ player->SEND_GOSSIP_MENU(10431, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(-1996.6, 5363.7, 6, 6, 0, "Scryer Bank");
+ player->SEND_GOSSIP_MENU(10432, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(-2176.6, 5405.8, 6, 6, 0, "Scryer Inn");
+ player->SEND_GOSSIP_MENU(10433, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
+ player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master");
+ player->SEND_GOSSIP_MENU(10435, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->SEND_POI(-2174.3, 5411.4, 6, 6, 0, "Scryer Mailbox");
+ player->SEND_GOSSIP_MENU(10436, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
+ player->SEND_POI(-2169.9, 5405.1, 6, 6, 0, "Scryer Stable Master");
+ player->SEND_GOSSIP_MENU(10437, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERALLIANCE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERHORDE , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTERARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(10438, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Profession master
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(10504, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
+ player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
+ player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
+ player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
+ player->SEND_GOSSIP_MENU(10701, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
+ player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Scryer Gem Merchant");
+ player->SEND_GOSSIP_MENU(10702, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
+ player->SEND_GOSSIP_MENU(10516, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
+ player->SEND_GOSSIP_MENU(10517, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
+ player->SEND_GOSSIP_MENU(10518, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
+ player->SEND_GOSSIP_MENU(10519, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
+ player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
+ player->SEND_GOSSIP_MENU(10520, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
+ player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
+ player->SEND_GOSSIP_MENU(10521, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
+ player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
+ player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
+ player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
+ player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_shattrath_scryer(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_shattrath_scryer(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_shattrath_scryer(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_shattrath(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_shattrath_scryer end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_shattrath_scryer(Creature *_Creature)
+{
+ return new guard_shattrath_scryerAI (_Creature);
+}
+
+/*******************************************************
+ * guard_silvermoon start
+ *******************************************************/
+
+bool GossipHello_guard_silvermoon(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WINDRIDER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AH_SILVERMOON_1 , GOSSIP_SENDER_SEC_AUCTIONHOUSE, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AH_SILVERMOON_2 , GOSSIP_SENDER_SEC_AUCTIONHOUSE, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(9317, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(9808.4, -7488.16, 6, 6, 0, "Silvermoon Bank");
+ player->SEND_GOSSIP_MENU(9322, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_POI(9474.97, -7345.21, 6, 6, 0, "Tandrine");
+ player->SEND_GOSSIP_MENU(9324, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN_SILVERMOON_1 , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN_SILVERMOON_2 , GOSSIP_SENDER_SEC_INN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(9602, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->SEND_POI(9658.33, -7492.17, 6, 6, 0, "Silvermoon Mailbox");
+ player->SEND_GOSSIP_MENU(9326, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
+ player->SEND_POI(9904.95, -7404.31, 6, 6, 0, "Shalenn");
+ player->SEND_GOSSIP_MENU(9327, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Weapon trainer
+ player->SEND_POI(9841.17, -7505.13, 6, 6, 0, "Ileda");
+ player->SEND_GOSSIP_MENU(9328, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Wind master
+ player->SEND_POI(9378.45, -7163.94, 6, 6, 0, "Silvermoon Wind Master");
+ player->SEND_GOSSIP_MENU(10181, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARENA , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_EYEOFTHESTORM , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(9331, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_JEWELCRAFTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(9338, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendAuctionhouseMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(9644.47, -7140.22, 6, 6, 0, "Western Auction House");
+ player->SEND_GOSSIP_MENU(9318, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(9683.27, -7521.22, 6, 6, 0, "Royal Exchange Auction House");
+ player->SEND_GOSSIP_MENU(9319, _Creature->GetGUID());
+ }
+}
+
+void SendInnMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->SEND_POI(9677.7, -7368, 6, 6, 0, "Silvermoon City Inn");
+ player->SEND_GOSSIP_MENU(9325, _Creature->GetGUID());
+ }
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->SEND_POI(9561.1, -7517.5, 6, 6, 0, "Wayfarer's Rest tavern");
+ player->SEND_GOSSIP_MENU(9603, _Creature->GetGUID());
+ }
+}
+
+void SendBattleMasterMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(9850.49, -7572.26, 6, 6, 0, "Gurak");
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth");
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //A
+ player->SEND_POI(9850.6, -7559.25, 6, 6, 0, "Bipp Glizzitor");
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //EOS
+ player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth");
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //WSG
+ player->SEND_POI(9845.45, -7562.58, 6, 6, 0, "Krukk");
+ player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(9700.55, -7262.57, 6, 6, 0, "Harene Plainwalker");
+ player->SEND_GOSSIP_MENU(9330, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(9927.48, -7426.14, 6, 6, 0, "Zandine");
+ player->SEND_GOSSIP_MENU(9332, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Mage
+ player->SEND_POI(9995.07, -7118.17, 6, 6, 0, "Quithas");
+ player->SEND_GOSSIP_MENU(9333, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
+ player->SEND_POI(9850.22, -7516.93, 6, 6, 0, "Champion Bachi");
+ player->SEND_GOSSIP_MENU(9334, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(9926.79, -7066.66, 6, 6, 0, "Belestra");
+ player->SEND_GOSSIP_MENU(9335, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
+ player->SEND_POI(9739.88, -7374.33, 6, 6, 0, "Zelanis");
+ player->SEND_GOSSIP_MENU(9336, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
+ player->SEND_POI(9787.57, -7284.63, 6, 6, 0, "Alamma");
+ player->SEND_GOSSIP_MENU(9337, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(9998.09, -7214.36, 6, 6, 0, "Silvermoon Alchemy Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(9841.43, -7361.53, 6, 6, 0, "Silvermoon Blacksmithing Trainer");
+ player->SEND_GOSSIP_MENU(9340, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(9577.26, -7243.6, 6, 6, 0, "Silvermoon Cooking Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(9962.57, -7246.18, 6, 6, 0, "Silvermoon Enchanting Trainer");
+ player->SEND_GOSSIP_MENU(9341, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(9820.18, -7329.56, 6, 6, 0, "Silvermoon Engineering Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(9579.8, -7343.71, 6, 6, 0, "Silvermoon First Aid Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(9602.73, -7328.3, 6, 6, 0, "Silvermoon Fishing Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
+ player->SEND_POI(9553.54, -7506.43, 6, 6, 0, "Silvermoon Jewelcrafting Trainer");
+ player->SEND_GOSSIP_MENU(9346, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism
+ player->SEND_POI(10004.4, -7216.86, 6, 6, 0, "Silvermoon Herbalism Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
+ player->SEND_POI(9503.72, -7430.16, 6, 6, 0, "Silvermoon Leatherworking Trainer");
+ player->SEND_GOSSIP_MENU(9347, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Mining
+ player->SEND_POI(9805.1, -7355.56, 6, 6, 0, "Silvermoon Mining Trainer");
+ player->SEND_GOSSIP_MENU(9348, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
+ player->SEND_POI(9513.37, -7429.4, 6, 6, 0, "Silvermoon Skinning Trainer");
+ player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
+ player->SEND_POI(9750.55, -7095.28, 6, 6, 0, "Silvermoon Tailor");
+ player->SEND_GOSSIP_MENU(9350, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_silvermoon(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_silvermoon(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_AUCTIONHOUSE: SendAuctionhouseMenu_guard_silvermoon(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_INN: SendInnMenu_guard_silvermoon(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_silvermoon(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_silvermoon(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_silvermoon(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_silvermoon end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_silvermoon(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_stormwind start
+ *******************************************************/
+
+bool GossipHello_guard_stormwind(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STORMWIND_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DEEPRUNTRAM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GRYPHON , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_OFFICERS , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->SEND_GOSSIP_MENU(933,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Auction House
+ player->SEND_POI(-8811.46, 667.46, 6, 6, 0, "Stormwind Auction House");
+ player->SEND_GOSSIP_MENU(3834,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bank
+ player->SEND_POI(-8916.87, 622.87, 6, 6, 0, "Stormwind Bank");
+ player->SEND_GOSSIP_MENU(764,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Deeprun tram
+ player->SEND_POI(-8378.88, 554.23, 6, 6, 0, "The Deeprun Tram");
+ player->SEND_GOSSIP_MENU(3813,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(-8869.0, 675.4, 6, 6, 0, "The Gilded Rose");
+ player->SEND_GOSSIP_MENU(3860,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Gryphon Master
+ player->SEND_POI(-8837.0, 493.5, 6, 6, 0, "Stormwind Gryphon Master");
+ player->SEND_GOSSIP_MENU(879,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Guild Master
+ player->SEND_POI(-8894.0, 611.2, 6, 6, 0, "Stormwind Vistor`s Center");
+ player->SEND_GOSSIP_MENU(882,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox
+ player->SEND_POI(-8876.48, 649.18, 6, 6, 0, "Stormwind Mailbox");
+ player->SEND_GOSSIP_MENU(3861,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master
+ player->SEND_POI(-8433.0, 554.7, 6, 6, 0, "Jenova Stoneshield");
+ player->SEND_GOSSIP_MENU(5984,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Weapon Trainer
+ player->SEND_POI(-8797.0, 612.8, 6, 6, 0, "Woo Ping");
+ player->SEND_GOSSIP_MENU(4516,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Officers Lounge
+ player->SEND_POI(-8759.92, 399.69, 6, 6, 0, "Champions` Hall");
+ player->SEND_GOSSIP_MENU(7047,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Battlemasters
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7499,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Class trainers
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PALADIN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SHAMAN , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->SEND_GOSSIP_MENU(898,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 13: //Profession trainers
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(918,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Thelman Slatefist");
+ player->SEND_GOSSIP_MENU(7500, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Lady Hoteshem");
+ player->SEND_GOSSIP_MENU(7650, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Elfarran");
+ player->SEND_GOSSIP_MENU(7501, _Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Mage
+ player->SEND_POI(-9012.0, 867.6, 6, 6, 0, "Wizard`s Sanctum");
+ player->SEND_GOSSIP_MENU(899,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Rogue
+ player->SEND_POI(-8753.0, 367.8, 6, 6, 0, "Stormwind - Rogue House");
+ player->SEND_GOSSIP_MENU(900,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Warrior
+ player->SEND_POI(-8624.54, 402.61, 6, 6, 0, "Pig and Whistle Tavern");
+ player->SEND_GOSSIP_MENU(901,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Druid
+ player->SEND_POI(-8751.0, 1124.5, 6, 6, 0, "The Park");
+ player->SEND_GOSSIP_MENU(902,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Priest
+ player->SEND_POI(-8512.0, 862.4, 6, 6, 0, "Catedral Of Light");
+ player->SEND_GOSSIP_MENU(903,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Paladin
+ player->SEND_POI(-8577.0, 881.7, 6, 6, 0, "Catedral Of Light");
+ player->SEND_GOSSIP_MENU(904,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Hunter
+ player->SEND_POI(-8413.0, 541.5, 6, 6, 0, "Hunter Lodge");
+ player->SEND_GOSSIP_MENU(905,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Warlock
+ player->SEND_POI(-8948.91, 998.35, 6, 6, 0, "The Slaughtered Lamb");
+ player->SEND_GOSSIP_MENU(906,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Shaman
+ player->SEND_POI(-9033, 550, 6, 6, 0, "Valley Of Heroes");
+ //incorrect id
+ player->SEND_GOSSIP_MENU(2593,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(-8988.0, 759.60, 6, 6, 0, "Alchemy Needs");
+ player->SEND_GOSSIP_MENU(919,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(-8424.0, 616.9, 6, 6, 0, "Therum Deepforge");
+ player->SEND_GOSSIP_MENU(920,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(-8611.0, 364.6, 6, 6, 0, "Pig and Whistle Tavern");
+ player->SEND_GOSSIP_MENU(921,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(-8858.0, 803.7, 6, 6, 0, "Lucan Cordell");
+ player->SEND_GOSSIP_MENU(941,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(-8347.0, 644.1, 6, 6, 0, "Lilliam Sparkspindle");
+ player->SEND_GOSSIP_MENU(922,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(-8513.0, 801.8, 6, 6, 0, "Shaina Fuller");
+ player->SEND_GOSSIP_MENU(923,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(-8803.0, 767.5, 6, 6, 0, "Arnold Leland");
+ player->SEND_GOSSIP_MENU(940,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(-8967.0, 779.5, 6, 6, 0, "Alchemy Needs");
+ player->SEND_GOSSIP_MENU(924,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(-8726.0, 477.4, 6, 6, 0, "The Protective Hide");
+ player->SEND_GOSSIP_MENU(925,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_POI(-8434.0, 692.8, 6, 6, 0, "Gelman Stonehand");
+ player->SEND_GOSSIP_MENU(927,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(-8716.0, 469.4, 6, 6, 0, "The Protective Hide");
+ player->SEND_GOSSIP_MENU(928,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(-8938.0, 800.7, 6, 6, 0, "Duncan`s Textiles");
+ player->SEND_GOSSIP_MENU(929,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_stormwind(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_stormwind(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_stormwind(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_stormwind(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_stormwind(player, _Creature, action); break;
+ }
+ return true;
+}
+
+bool ReceiveEmote_guard_stormwind(Player *player, Creature *_Creature, uint32 emote)
+{
+ if( player->GetTeam() == ALLIANCE )
+ DoReplyToTextEmote(_Creature,emote);
+ return true;
+}
+
+/*******************************************************
+ * guard_stormwind end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_stormwind(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_teldrassil start
+ *******************************************************/
+
+bool GossipHello_guard_teldrassil(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FERRY , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(4316,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4317,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Rut`theran
+ player->SEND_GOSSIP_MENU(4318,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_GOSSIP_MENU(4319,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(9821.49, 960.13, 6, 6, 0, "Dolanaar Inn");
+ player->SEND_GOSSIP_MENU(4320,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //stable master
+ player->SEND_POI(9808.37, 931.1, 6, 6, 0, "Seriadne");
+ player->SEND_GOSSIP_MENU(5982,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_DRUID , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HUNTER , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(4264,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->SEND_GOSSIP_MENU(4273,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Druid
+ player->SEND_POI(9741.58, 963.7, 6, 6, 0, "Kal");
+ player->SEND_GOSSIP_MENU(4323,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
+ player->SEND_POI(9815.12, 926.28, 6, 6, 0, "Dazalar");
+ player->SEND_GOSSIP_MENU(4324,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Priest
+ player->SEND_POI(9906.16, 986.63, 6, 6, 0, "Laurna Morninglight");
+ player->SEND_GOSSIP_MENU(4325,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
+ player->SEND_POI(9789, 942.86, 6, 6, 0, "Jannok Breezesong");
+ player->SEND_GOSSIP_MENU(4326,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
+ player->SEND_POI(9821.96, 950.61, 6, 6, 0, "Kyra Windblade");
+ player->SEND_GOSSIP_MENU(4327,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(9767.59, 878.81, 6, 6, 0, "Cyndra Kindwhisper");
+ player->SEND_GOSSIP_MENU(4329,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Cooking
+ player->SEND_POI(9751.19, 906.13, 6, 6, 0, "Zarrin");
+ player->SEND_GOSSIP_MENU(4330,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting
+ player->SEND_POI(10677.59, 1946.56, 6, 6, 0, "Alanna Raveneye");
+ player->SEND_GOSSIP_MENU(4331,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //First Aid
+ player->SEND_POI(9903.12, 999, 6, 6, 0, "Byancie");
+ player->SEND_GOSSIP_MENU(4332,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Fishing
+ player->SEND_GOSSIP_MENU(4333,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism
+ player->SEND_POI(9773.78, 875.88, 6, 6, 0, "Malorne Bladeleaf");
+ player->SEND_GOSSIP_MENU(4334,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
+ player->SEND_POI(10152.59, 1681.46, 6, 6, 0, "Nadyia Maneweaver");
+ player->SEND_GOSSIP_MENU(4335,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
+ player->SEND_POI(10135.59, 1673.18, 6, 6, 0, "Radnaal Maneweaver");
+ player->SEND_GOSSIP_MENU(4336,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring
+ player->SEND_GOSSIP_MENU(4337,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_teldrassil(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_teldrassil(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_teldrassil(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_teldrassil(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_teldrassil end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_teldrassil(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_tirisfal start
+ *******************************************************/
+
+bool GossipHello_guard_tirisfal(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(4097,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_GOSSIP_MENU(4074,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //bat handler
+ player->SEND_GOSSIP_MENU(4075,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Inn
+ player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Gallows` End Tavern");
+ player->SEND_GOSSIP_MENU(4076,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master
+ player->SEND_POI(2267.66, 319.32, 6, 6, 0, "Morganus");
+ player->SEND_GOSSIP_MENU(5978,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(4292,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(4096,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Mage
+ player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Cain Firesong");
+ player->SEND_GOSSIP_MENU(4077,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Priest
+ player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Dark Cleric Beryl");
+ player->SEND_GOSSIP_MENU(4078,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Rogue
+ player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Marion Call");
+ player->SEND_GOSSIP_MENU(4079,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Warlock
+ player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Rupert Boch");
+ player->SEND_GOSSIP_MENU(4080,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
+ player->SEND_POI(2256.48, 240.32, 6, 6, 0, "Austil de Mon");
+ player->SEND_GOSSIP_MENU(4081,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(2263.25, 344.23, 6, 6, 0, "Carolai Anise");
+ player->SEND_GOSSIP_MENU(4082,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_GOSSIP_MENU(4083,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_GOSSIP_MENU(4084,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(2250.35, 249.12, 6, 6, 0, "Vance Undergloom");
+ player->SEND_GOSSIP_MENU(4085,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_GOSSIP_MENU(4086,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Nurse Neela");
+ player->SEND_GOSSIP_MENU(4087,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(2292.37, -10.72, 6, 6, 0, "Clyde Kellen");
+ player->SEND_GOSSIP_MENU(4088,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(2268.21, 331.69, 6, 6, 0, "Faruza");
+ player->SEND_GOSSIP_MENU(4089,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(2027, 78.72, 6, 6, 0, "Shelene Rhobart");
+ player->SEND_GOSSIP_MENU(4090,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_GOSSIP_MENU(4091,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(2027, 78.72, 6, 6, 0, "Rand Rhobart");
+ player->SEND_GOSSIP_MENU(4092,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(2160.45, 659.93, 6, 6, 0, "Bowen Brisboise");
+ player->SEND_GOSSIP_MENU(4093,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_tirisfal(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_tirisfal(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_tirisfal(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_tirisfal(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_tirisfal end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_tirisfal(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * guard_undercity start
+ *******************************************************/
+
+bool GossipHello_guard_undercity(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BANK , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATHANDLER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_GUILDMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_INN , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAILBOX , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_AUCTIONHOUSE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ZEPPLINMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WEAPONMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_STABLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BATTLEMASTER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_CLASSTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PROFTRAINER , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(3543,_Creature->GetGUID());
+ return true;
+}
+
+void SendDefaultMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Bank
+ player->SEND_POI(1595.64, 232.45, 6, 6, 0, "Undercity Bank");
+ player->SEND_GOSSIP_MENU(3514,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Bat handler
+ player->SEND_POI(1565.9, 271.43, 6, 6, 0, "Undercity Bat Handler");
+ player->SEND_GOSSIP_MENU(3515,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
+ player->SEND_POI(1594.17, 205.57, 6, 6, 0, "Undercity Guild Master");
+ player->SEND_GOSSIP_MENU(3516,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Inn
+ player->SEND_POI(1639.43, 220.99, 6, 6, 0, "Undercity Inn");
+ player->SEND_GOSSIP_MENU(3517,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
+ player->SEND_POI(1632.68, 219.4, 6, 6, 0, "Undercity Mailbox");
+ player->SEND_GOSSIP_MENU(3518,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //Auction House
+ player->SEND_POI(1647.9, 258.49, 6, 6, 0, "Undercity Auction House");
+ player->SEND_GOSSIP_MENU(3519,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Zeppelin
+ player->SEND_POI(2059, 274.86, 6, 6, 0, "Undercity Zeppelin");
+ player->SEND_GOSSIP_MENU(3520,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Weapon Master
+ player->SEND_POI(1670.31, 324.66, 6, 6, 0, "Archibald");
+ player->SEND_GOSSIP_MENU(4521,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Stable master
+ player->SEND_POI(1634.18, 226.76, 6, 6, 0, "Anya Maulray");
+ player->SEND_GOSSIP_MENU(5979,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALTERACVALLEY , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ARATHIBASIN , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARSONGULCH , GOSSIP_SENDER_SEC_BATTLEINFO, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(7527,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Class trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MAGE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_PRIEST , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ROGUE , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARLOCK , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_WARRIOR , GOSSIP_SENDER_SEC_CLASSTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(3542,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Profession trainer
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ALCHEMY , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_BLACKSMITHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_COOKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENCHANTING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_ENGINEERING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FIRSTAID , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_FISHING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_HERBALISM , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_LEATHERWORKING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_MINING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_SKINNING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_TEXT_TAILORING , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->SEND_GOSSIP_MENU(3541,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendBattleMasterMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //AV
+ player->SEND_POI(1329, 333.92, 6, 6, 0, "Grizzle Halfmane");
+ player->SEND_GOSSIP_MENU(7525,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //AB
+ player->SEND_POI(1283.3, 287.16, 6, 6, 0, "Sir Malory Wheeler");
+ player->SEND_GOSSIP_MENU(7646,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //WSG
+ player->SEND_POI(1265, 351.18, 6, 6, 0, "Kurden Bloodclaw");
+ player->SEND_GOSSIP_MENU(7526,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendClassTrainerMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Mage
+ player->SEND_POI(1781, 53, 6, 6, 0, "Undercity Mage Trainers");
+ player->SEND_GOSSIP_MENU(3513,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Priest
+ player->SEND_POI(1758.33, 401.5, 6, 6, 0, "Undercity Priest Trainers");
+ player->SEND_GOSSIP_MENU(3521,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Rogue
+ player->SEND_POI(1418.56, 65, 6, 6, 0, "Undercity Rogue Trainers");
+ player->SEND_GOSSIP_MENU(3524,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Warlock
+ player->SEND_POI(1780.92, 53.16, 6, 6, 0, "Undercity Warlock Trainers");
+ player->SEND_GOSSIP_MENU(3526,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
+ player->SEND_POI(1775.59, 418.19, 6, 6, 0, "Undercity Warrior Trainers");
+ player->SEND_GOSSIP_MENU(3527,_Creature->GetGUID());
+ break;
+ }
+}
+
+void SendProfTrainerMenu_guard_undercity(Player *player, Creature *_Creature, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
+ player->SEND_POI(1419.82, 417.19, 6, 6, 0, "The Apothecarium");
+ player->SEND_GOSSIP_MENU(3528,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
+ player->SEND_POI(1696, 285, 6, 6, 0, "Undercity Blacksmithing Trainer");
+ player->SEND_GOSSIP_MENU(3529,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
+ player->SEND_POI(1596.34, 274.68, 6, 6, 0, "Undercity Cooking Trainer");
+ player->SEND_GOSSIP_MENU(3530,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
+ player->SEND_POI(1488.54, 280.19, 6, 6, 0, "Undercity Enchanting Trainer");
+ player->SEND_GOSSIP_MENU(3531,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
+ player->SEND_POI(1408.58, 143.43, 6, 6, 0, "Undercity Engineering Trainer");
+ player->SEND_GOSSIP_MENU(3532,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
+ player->SEND_POI(1519.65, 167.19, 6, 6, 0, "Undercity First Aid Trainer");
+ player->SEND_GOSSIP_MENU(3533,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
+ player->SEND_POI(1679.9, 89, 6, 6, 0, "Undercity Fishing Trainer");
+ player->SEND_GOSSIP_MENU(3534,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
+ player->SEND_POI(1558, 349.36, 6, 6, 0, "Undercity Herbalism Trainer");
+ player->SEND_GOSSIP_MENU(3535,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
+ player->SEND_POI(1498.76, 196.43, 6, 6, 0, "Undercity Leatherworking Trainer");
+ player->SEND_GOSSIP_MENU(3536,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10: //Mining
+ player->SEND_POI(1642.88, 335.58, 6, 6, 0, "Undercity Mining Trainer");
+ player->SEND_GOSSIP_MENU(3537,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
+ player->SEND_POI(1498.6, 196.46, 6, 6, 0, "Undercity Skinning Trainer");
+ player->SEND_GOSSIP_MENU(3538,_Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
+ player->SEND_POI(1689.55, 193, 6, 6, 0, "Undercity Tailoring Trainer");
+ player->SEND_GOSSIP_MENU(3539,_Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_guard_undercity(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendDefaultMenu_guard_undercity(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_CLASSTRAIN: SendClassTrainerMenu_guard_undercity(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_PROFTRAIN: SendProfTrainerMenu_guard_undercity(player, _Creature, action); break;
+ case GOSSIP_SENDER_SEC_BATTLEINFO: SendBattleMasterMenu_guard_undercity(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*******************************************************
+ * guard_undercity end
+ *******************************************************/
+
+CreatureAI* GetAI_guard_undercity(Creature *_Creature)
+{
+ return new guardAI (_Creature);
+}
+
+/*******************************************************
+ * AddSC
+ *******************************************************/
+
+void AddSC_guards()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_azuremyst";
+ newscript->pGossipHello = &GossipHello_guard_azuremyst;
+ newscript->pGossipSelect = &GossipSelect_guard_azuremyst;
+ newscript->GetAI = GetAI_guard_azuremyst;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_bluffwatcher";
+ newscript->pGossipHello = &GossipHello_guard_bluffwatcher;
+ newscript->pGossipSelect = &GossipSelect_guard_bluffwatcher;
+ newscript->GetAI = GetAI_guard_bluffwatcher;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_contested";
+ newscript->GetAI = GetAI_guard_contested;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_darnassus";
+ newscript->pGossipHello = &GossipHello_guard_darnassus;
+ newscript->pGossipSelect = &GossipSelect_guard_darnassus;
+ newscript->GetAI = GetAI_guard_darnassus;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_dunmorogh";
+ newscript->pGossipHello = &GossipHello_guard_dunmorogh;
+ newscript->pGossipSelect = &GossipSelect_guard_dunmorogh;
+ newscript->GetAI = GetAI_guard_dunmorogh;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_durotar";
+ newscript->pGossipHello = &GossipHello_guard_durotar;
+ newscript->pGossipSelect = &GossipSelect_guard_durotar;
+ newscript->GetAI = GetAI_guard_durotar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_elwynnforest";
+ newscript->pGossipHello = &GossipHello_guard_elwynnforest;
+ newscript->pGossipSelect = &GossipSelect_guard_elwynnforest;
+ newscript->GetAI = GetAI_guard_elwynnforest;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_eversong";
+ newscript->pGossipHello = &GossipHello_guard_eversong;
+ newscript->pGossipSelect = &GossipSelect_guard_eversong;
+ newscript->GetAI = GetAI_guard_eversong;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_exodar";
+ newscript->pGossipHello = &GossipHello_guard_exodar;
+ newscript->pGossipSelect = &GossipSelect_guard_exodar;
+ newscript->GetAI = GetAI_guard_exodar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_ironforge";
+ newscript->pGossipHello = &GossipHello_guard_ironforge;
+ newscript->pGossipSelect = &GossipSelect_guard_ironforge;
+ newscript->GetAI = GetAI_guard_ironforge;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_mulgore";
+ newscript->pGossipHello = &GossipHello_guard_mulgore;
+ newscript->pGossipSelect = &GossipSelect_guard_mulgore;
+ newscript->GetAI = GetAI_guard_mulgore;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_orgrimmar";
+ newscript->pGossipHello = &GossipHello_guard_orgrimmar;
+ newscript->pGossipSelect = &GossipSelect_guard_orgrimmar;
+ newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar;
+ newscript->GetAI = GetAI_guard_orgrimmar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_shattrath";
+ newscript->pGossipHello = &GossipHello_guard_shattrath;
+ newscript->pGossipSelect = &GossipSelect_guard_shattrath;
+ newscript->GetAI = GetAI_guard_shattrath;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_shattrath_aldor";
+ newscript->GetAI = GetAI_guard_shattrath_aldor;
+ newscript->pGossipHello = &GossipHello_guard_shattrath_aldor;
+ newscript->pGossipSelect = &GossipSelect_guard_shattrath_aldor;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_shattrath_scryer";
+ newscript->GetAI = GetAI_guard_shattrath_scryer;
+ newscript->pGossipHello = &GossipHello_guard_shattrath_scryer;
+ newscript->pGossipSelect = &GossipSelect_guard_shattrath_scryer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_silvermoon";
+ newscript->pGossipHello = &GossipHello_guard_silvermoon;
+ newscript->pGossipSelect = &GossipSelect_guard_silvermoon;
+ newscript->GetAI = GetAI_guard_silvermoon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_stormwind";
+ newscript->pGossipHello = &GossipHello_guard_stormwind;
+ newscript->pGossipSelect = &GossipSelect_guard_stormwind;
+ newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind;
+ newscript->GetAI = GetAI_guard_stormwind;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_teldrassil";
+ newscript->pGossipHello = &GossipHello_guard_teldrassil;
+ newscript->pGossipSelect = &GossipSelect_guard_teldrassil;
+ newscript->GetAI = GetAI_guard_teldrassil;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_tirisfal";
+ newscript->pGossipHello = &GossipHello_guard_tirisfal;
+ newscript->pGossipSelect = &GossipSelect_guard_tirisfal;
+ newscript->GetAI = GetAI_guard_tirisfal;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="guard_undercity";
+ newscript->pGossipHello = &GossipHello_guard_undercity;
+ newscript->pGossipSelect = &GossipSelect_guard_undercity;
+ newscript->GetAI = GetAI_guard_undercity;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/item/item_scripts.cpp b/src/bindings/scripts/scripts/item/item_scripts.cpp
index 435f313b0c1..730f1aee52d 100644
--- a/src/bindings/scripts/scripts/item/item_scripts.cpp
+++ b/src/bindings/scripts/scripts/item/item_scripts.cpp
@@ -1,529 +1,529 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Item_Scripts
-SD%Complete: 100
-SDComment: Items for a range of different items. See content below (in script)
-SDCategory: Items
-EndScriptData */
-
-/* ContentData
-item_area_52_special(i28132) Prevents abuse of this item
-item_attuned_crystal_cores(i34368) Prevent abuse(quest 11524 & 11525)
-item_blackwhelp_net(i31129) Quest Whelps of the Wyrmcult (q10747). Prevents abuse
-item_draenei_fishing_net(i23654) Hacklike implements chance to spawn item or creature
-item_disciplinary_rod Prevents abuse
-item_nether_wraith_beacon(i31742) Summons creatures for quest Becoming a Spellfire Tailor (q10832)
-item_flying_machine(i34060,i34061) Engineering crafted flying machines
-item_gor_dreks_ointment(i30175) Protecting Our Own(q10488)
-item_muiseks_vessel Cast on creature, they must be dead(q 3123,3124,3125,3126,3127)
-item_protovoltaic_magneto_collector Prevents abuse
-item_razorthorn_flayer_gland Quest Discovering Your Roots (q11520) and Rediscovering Your Roots (q11521). Prevents abuse
-item_tame_beast_rods(many) Prevent cast on any other creature than the intended (for all tame beast quests)
-item_soul_cannon(i32825) Prevents abuse of this item
-item_sparrowhawk_net(i32321) Quest To Catch A Sparrowhawk (q10987). Prevents abuse
-item_voodoo_charm Provide proper error message and target(q2561)
-item_vorenthals_presence(i30259) Prevents abuse of this item
-item_yehkinyas_bramble(i10699) Allow cast spell on vale screecher only and remove corpse if cast sucessful (q3520)
-item_zezzak_shard(i31463) Quest The eyes of Grillok (q10813). Prevents abuse
-EndContentData */
-
-#include "precompiled.h"
-#include "SpellMgr.h"
-#include "Spell.h"
-#include "WorldPacket.h"
-
-/*#####
-# item_area_52_special
-#####*/
-
-bool ItemUse_item_area_52_special(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if ( player->GetAreaId() == 3803 )
- {
- return false;
- }
- else
- {
- player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE,_Item,NULL);
- return true;
- }
-}
-
-/*#####
-# item_attuned_crystal_cores
-#####*/
-
-bool ItemUse_item_attuned_crystal_cores(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 24972 && targets.getUnitTarget()->isDead() )
- return false;
-
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_blackwhelp_net
-#####*/
-
-bool ItemUse_item_blackwhelp_net(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 21387 )
- return false;
-
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_draenei_fishing_net
-#####*/
-
-//This is just a hack and should be removed from here.
-//Creature/Item are in fact created before spell are sucessfully casted, without any checks at all to ensure proper/expected behavior.
-bool ItemUse_item_draenei_fishing_net(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- //if( targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT &&
- //targets.getGOTarget()->GetGOInfo()->type == GAMEOBJECT_TYPE_SPELL_FOCUS && targets.getGOTarget()->GetEntry() == 181616 )
- //{
- if( player->GetQuestStatus(9452) == QUEST_STATUS_INCOMPLETE )
- {
- if( rand()%100 < 35 )
- {
- Creature *Murloc = player->SummonCreature(17102,player->GetPositionX() ,player->GetPositionY()+20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
- if( Murloc )
- Murloc->AI()->AttackStart(player);
- }
- else
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 23614, 1);
- if( msg == EQUIP_ERR_OK )
- {
- Item* item = player->StoreNewItem(dest,23614,true);
- if( item )
- player->SendNewItem(item,1,false,true);
- }else
- player->SendEquipError(msg,NULL,NULL);
- }
- }
- //}
- return false;
-}
-
-/*#####
-# item_disciplinary_rod
-#####*/
-
-bool ItemUse_item_disciplinary_rod(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- (targets.getUnitTarget()->GetEntry() == 15941 || targets.getUnitTarget()->GetEntry() == 15945) )
- return false;
-
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_nether_wraith_beacon
-#####*/
-
-bool ItemUse_item_nether_wraith_beacon(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if (player->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE)
- {
- Creature *Nether;
- Nether = player->SummonCreature(22408,player->GetPositionX() ,player->GetPositionY()+20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,180000);
- Nether = player->SummonCreature(22408,player->GetPositionX() ,player->GetPositionY()-20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,180000);
- if (Nether)
- ((CreatureAI*)Nether->AI())->AttackStart(player);
- }
- return false;
-}
-
-/*#####
-# item_flying_machine
-#####*/
-
-bool ItemUse_item_flying_machine(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- uint32 itemId = _Item->GetEntry();
- if( itemId == 34060 )
- if( player->GetBaseSkillValue(SKILL_RIDING) >= 225 )
- return false;
-
- if( itemId == 34061 )
- if( player->GetBaseSkillValue(SKILL_RIDING) == 300 )
- return false;
-
- debug_log("SD2: Player attempt to use item %u, but did not meet riding requirement",itemId);
- player->SendEquipError(EQUIP_ERR_ERR_CANT_EQUIP_SKILL,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_gor_dreks_ointment
-#####*/
-
-bool ItemUse_item_gor_dreks_ointment(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578,0) )
- return false;
-
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_muiseks_vessel
-#####*/
-
-bool ItemUse_item_muiseks_vessel(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- Unit* uTarget = targets.getUnitTarget();
- uint32 itemSpell = _Item->GetProto()->Spells[0].SpellId;
- uint32 cEntry = 0;
- uint32 cEntry2 = 0;
- uint32 cEntry3 = 0;
- uint32 cEntry4 = 0;
-
- if(itemSpell)
- {
- switch(itemSpell)
- {
- case 11885: //Wandering Forest Walker
- cEntry = 7584;
- break;
- case 11886: //Owlbeasts
- cEntry = 2927;
- cEntry2 = 2928;
- cEntry3 = 2929;
- cEntry4 = 7808;
- break;
- case 11887: //Freyfeather Hippogryphs
- cEntry = 5300;
- cEntry2 = 5304;
- cEntry3 = 5305;
- cEntry4 = 5306;
- break;
- case 11888: //Sprite Dragon Sprite Darters
- cEntry = 5276;
- cEntry2 = 5278;
- break;
- case 11889: //Zapped Land Walker Land Walker Zapped Cliff Giant Cliff Giant
- cEntry = 5357;
- cEntry2 = 5358;
- cEntry3 = 14640;
- cEntry4 = 14604;
- break;
- }
- if( uTarget && uTarget->GetTypeId()==TYPEID_UNIT && uTarget->isDead() &&
- (uTarget->GetEntry()==cEntry || uTarget->GetEntry()==cEntry2 || uTarget->GetEntry()==cEntry3 || uTarget->GetEntry()==cEntry4) )
- {
- ((Creature*)uTarget)->RemoveCorpse();
- return false;
- }
- }
-
- WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
- data << uint32(_Item->GetEntry()); // itemId
- data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
- player->GetSession()->SendPacket(&data); // send message: Invalid target
-
- player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
- return true;
-}
-
-/*#####
-# item_razorthorn_flayer_gland
-#####*/
-
-bool ItemUse_item_razorthorn_flayer_gland(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 24922 )
- return false;
-
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_tame_beast_rods
-#####*/
-
-bool ItemUse_item_tame_beast_rods(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- uint32 itemSpell = _Item->GetProto()->Spells[0].SpellId;
- uint32 cEntry = 0;
-
- if(itemSpell)
- {
- switch(itemSpell)
- {
- case 19548: cEntry = 1196; break; //Ice Claw Bear
- case 19674: cEntry = 1126; break; //Large Crag Boar
- case 19687: cEntry = 1201; break; //Snow Leopard
- case 19688: cEntry = 2956; break; //Adult Plainstrider
- case 19689: cEntry = 2959; break; //Prairie Stalker
- case 19692: cEntry = 2970; break; //Swoop
- case 19693: cEntry = 1998; break; //Webwood Lurker
- case 19694: cEntry = 3099; break; //Dire Mottled Boar
- case 19696: cEntry = 3107; break; //Surf Crawler
- case 19697: cEntry = 3126; break; //Armored Scorpid
- case 19699: cEntry = 2043; break; //Nightsaber Stalker
- case 19700: cEntry = 1996; break; //Strigid Screecher
- case 30646: cEntry = 17217; break; //Barbed Crawler
- case 30653: cEntry = 17374; break; //Greater Timberstrider
- case 30654: cEntry = 17203; break; //Nightstalker
- case 30099: cEntry = 15650; break; //Crazed Dragonhawk
- case 30102: cEntry = 15652; break; //Elder Springpaw
- case 30105: cEntry = 16353; break; //Mistbat
- }
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == cEntry )
- return false;
- }
-
- WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
- data << uint32(_Item->GetEntry()); // itemId
- data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
- player->GetSession()->SendPacket(&data); // send message: Invalid target
-
- player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
- return true;
-}
-
-/*#####
-# item_protovoltaic_magneto_collector
-#####*/
-
-bool ItemUse_item_protovoltaic_magneto_collector(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 21729 )
- return false;
-
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_soul_cannon
-#####*/
-
-bool ItemUse_item_soul_cannon(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- // allow use
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 22357 )
- return false;
-
- // error
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_sparrowhawk_net
-#####*/
-
-bool ItemUse_item_sparrowhawk_net(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 22979 )
- return false;
-
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_voodoo_charm
-#####*/
-
-bool ItemUse_item_voodoo_charm(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT && targets.getUnitTarget()->isDead() &&
- targets.getUnitTarget()->GetEntry()==7318 )
- return false;
-
- WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
- data << uint32(_Item->GetEntry()); // itemId
- data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
- player->GetSession()->SendPacket(&data); // send message: Invalid target
-
- player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
- return true;
-}
-
-/*#####
-# item_vorenthals_presence
-#####*/
-
-bool ItemUse_item_vorenthals_presence(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- // allow use
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 20132 )
- return false;
-
- // error
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-/*#####
-# item_yehkinyas_bramble
-#####*/
-
-bool ItemUse_item_yehkinyas_bramble(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if (player->GetQuestStatus(3520) == QUEST_STATUS_INCOMPLETE)
- {
- Unit * unit_target = targets.getUnitTarget();
- if( unit_target &&
- unit_target->GetTypeId()==TYPEID_UNIT &&
- unit_target->isDead() &&
- // cast only on corpse 5307 or 5308
- (unit_target->GetEntry()==5307 || unit_target->GetEntry()==5308) )
- {
- ((Creature*)unit_target)->RemoveCorpse(); // remove corpse for cancelling second use
- return false; // all ok
- }
- }
- WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
- data << uint32(10699); // itemId
- data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
- player->GetSession()->SendPacket(&data); // send message: Bad target
- player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
- return true;
-}
-
-/*#####
-# item_zezzak_shard
-#####*/
-
-bool ItemUse_item_zezzak_shard(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 19440 )
- return false;
-
- player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
- return true;
-}
-
-void AddSC_item_scripts()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="item_area_52_special";
- newscript->pItemUse = ItemUse_item_area_52_special;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_attuned_crystal_cores";
- newscript->pItemUse = ItemUse_item_attuned_crystal_cores;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_blackwhelp_net";
- newscript->pItemUse = ItemUse_item_blackwhelp_net;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_disciplinary_rod";
- newscript->pItemUse = ItemUse_item_disciplinary_rod;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_draenei_fishing_net";
- newscript->pItemUse = ItemUse_item_draenei_fishing_net;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_nether_wraith_beacon";
- newscript->pItemUse = ItemUse_item_nether_wraith_beacon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_flying_machine";
- newscript->pItemUse = ItemUse_item_flying_machine;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_gor_dreks_ointment";
- newscript->pItemUse = ItemUse_item_gor_dreks_ointment;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_muiseks_vessel";
- newscript->pItemUse = ItemUse_item_muiseks_vessel;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_razorthorn_flayer_gland";
- newscript->pItemUse = ItemUse_item_razorthorn_flayer_gland;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_tame_beast_rods";
- newscript->pItemUse = ItemUse_item_tame_beast_rods;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_protovoltaic_magneto_collector";
- newscript->pItemUse = ItemUse_item_protovoltaic_magneto_collector;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_soul_cannon";
- newscript->pItemUse = ItemUse_item_soul_cannon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_sparrowhawk_net";
- newscript->pItemUse = ItemUse_item_sparrowhawk_net;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_voodoo_charm";
- newscript->pItemUse = ItemUse_item_voodoo_charm;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_vorenthals_presence";
- newscript->pItemUse = ItemUse_item_vorenthals_presence;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_yehkinyas_bramble";
- newscript->pItemUse = ItemUse_item_yehkinyas_bramble;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="item_zezzaks_shard";
- newscript->pItemUse = ItemUse_item_zezzak_shard;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Item_Scripts
+SD%Complete: 100
+SDComment: Items for a range of different items. See content below (in script)
+SDCategory: Items
+EndScriptData */
+
+/* ContentData
+item_area_52_special(i28132) Prevents abuse of this item
+item_attuned_crystal_cores(i34368) Prevent abuse(quest 11524 & 11525)
+item_blackwhelp_net(i31129) Quest Whelps of the Wyrmcult (q10747). Prevents abuse
+item_draenei_fishing_net(i23654) Hacklike implements chance to spawn item or creature
+item_disciplinary_rod Prevents abuse
+item_nether_wraith_beacon(i31742) Summons creatures for quest Becoming a Spellfire Tailor (q10832)
+item_flying_machine(i34060,i34061) Engineering crafted flying machines
+item_gor_dreks_ointment(i30175) Protecting Our Own(q10488)
+item_muiseks_vessel Cast on creature, they must be dead(q 3123,3124,3125,3126,3127)
+item_protovoltaic_magneto_collector Prevents abuse
+item_razorthorn_flayer_gland Quest Discovering Your Roots (q11520) and Rediscovering Your Roots (q11521). Prevents abuse
+item_tame_beast_rods(many) Prevent cast on any other creature than the intended (for all tame beast quests)
+item_soul_cannon(i32825) Prevents abuse of this item
+item_sparrowhawk_net(i32321) Quest To Catch A Sparrowhawk (q10987). Prevents abuse
+item_voodoo_charm Provide proper error message and target(q2561)
+item_vorenthals_presence(i30259) Prevents abuse of this item
+item_yehkinyas_bramble(i10699) Allow cast spell on vale screecher only and remove corpse if cast sucessful (q3520)
+item_zezzak_shard(i31463) Quest The eyes of Grillok (q10813). Prevents abuse
+EndContentData */
+
+#include "precompiled.h"
+#include "SpellMgr.h"
+#include "Spell.h"
+#include "WorldPacket.h"
+
+/*#####
+# item_area_52_special
+#####*/
+
+bool ItemUse_item_area_52_special(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if ( player->GetAreaId() == 3803 )
+ {
+ return false;
+ }
+ else
+ {
+ player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE,_Item,NULL);
+ return true;
+ }
+}
+
+/*#####
+# item_attuned_crystal_cores
+#####*/
+
+bool ItemUse_item_attuned_crystal_cores(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 24972 && targets.getUnitTarget()->isDead() )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_blackwhelp_net
+#####*/
+
+bool ItemUse_item_blackwhelp_net(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 21387 )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_draenei_fishing_net
+#####*/
+
+//This is just a hack and should be removed from here.
+//Creature/Item are in fact created before spell are sucessfully casted, without any checks at all to ensure proper/expected behavior.
+bool ItemUse_item_draenei_fishing_net(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ //if( targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT &&
+ //targets.getGOTarget()->GetGOInfo()->type == GAMEOBJECT_TYPE_SPELL_FOCUS && targets.getGOTarget()->GetEntry() == 181616 )
+ //{
+ if( player->GetQuestStatus(9452) == QUEST_STATUS_INCOMPLETE )
+ {
+ if( rand()%100 < 35 )
+ {
+ Creature *Murloc = player->SummonCreature(17102,player->GetPositionX() ,player->GetPositionY()+20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if( Murloc )
+ Murloc->AI()->AttackStart(player);
+ }
+ else
+ {
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 23614, 1);
+ if( msg == EQUIP_ERR_OK )
+ {
+ Item* item = player->StoreNewItem(dest,23614,true);
+ if( item )
+ player->SendNewItem(item,1,false,true);
+ }else
+ player->SendEquipError(msg,NULL,NULL);
+ }
+ }
+ //}
+ return false;
+}
+
+/*#####
+# item_disciplinary_rod
+#####*/
+
+bool ItemUse_item_disciplinary_rod(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ (targets.getUnitTarget()->GetEntry() == 15941 || targets.getUnitTarget()->GetEntry() == 15945) )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_nether_wraith_beacon
+#####*/
+
+bool ItemUse_item_nether_wraith_beacon(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if (player->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE)
+ {
+ Creature *Nether;
+ Nether = player->SummonCreature(22408,player->GetPositionX() ,player->GetPositionY()+20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,180000);
+ Nether = player->SummonCreature(22408,player->GetPositionX() ,player->GetPositionY()-20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,180000);
+ if (Nether)
+ ((CreatureAI*)Nether->AI())->AttackStart(player);
+ }
+ return false;
+}
+
+/*#####
+# item_flying_machine
+#####*/
+
+bool ItemUse_item_flying_machine(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ uint32 itemId = _Item->GetEntry();
+ if( itemId == 34060 )
+ if( player->GetBaseSkillValue(SKILL_RIDING) >= 225 )
+ return false;
+
+ if( itemId == 34061 )
+ if( player->GetBaseSkillValue(SKILL_RIDING) == 300 )
+ return false;
+
+ debug_log("SD2: Player attempt to use item %u, but did not meet riding requirement",itemId);
+ player->SendEquipError(EQUIP_ERR_ERR_CANT_EQUIP_SKILL,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_gor_dreks_ointment
+#####*/
+
+bool ItemUse_item_gor_dreks_ointment(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578,0) )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_muiseks_vessel
+#####*/
+
+bool ItemUse_item_muiseks_vessel(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ Unit* uTarget = targets.getUnitTarget();
+ uint32 itemSpell = _Item->GetProto()->Spells[0].SpellId;
+ uint32 cEntry = 0;
+ uint32 cEntry2 = 0;
+ uint32 cEntry3 = 0;
+ uint32 cEntry4 = 0;
+
+ if(itemSpell)
+ {
+ switch(itemSpell)
+ {
+ case 11885: //Wandering Forest Walker
+ cEntry = 7584;
+ break;
+ case 11886: //Owlbeasts
+ cEntry = 2927;
+ cEntry2 = 2928;
+ cEntry3 = 2929;
+ cEntry4 = 7808;
+ break;
+ case 11887: //Freyfeather Hippogryphs
+ cEntry = 5300;
+ cEntry2 = 5304;
+ cEntry3 = 5305;
+ cEntry4 = 5306;
+ break;
+ case 11888: //Sprite Dragon Sprite Darters
+ cEntry = 5276;
+ cEntry2 = 5278;
+ break;
+ case 11889: //Zapped Land Walker Land Walker Zapped Cliff Giant Cliff Giant
+ cEntry = 5357;
+ cEntry2 = 5358;
+ cEntry3 = 14640;
+ cEntry4 = 14604;
+ break;
+ }
+ if( uTarget && uTarget->GetTypeId()==TYPEID_UNIT && uTarget->isDead() &&
+ (uTarget->GetEntry()==cEntry || uTarget->GetEntry()==cEntry2 || uTarget->GetEntry()==cEntry3 || uTarget->GetEntry()==cEntry4) )
+ {
+ ((Creature*)uTarget)->RemoveCorpse();
+ return false;
+ }
+ }
+
+ WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
+ data << uint32(_Item->GetEntry()); // itemId
+ data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
+ player->GetSession()->SendPacket(&data); // send message: Invalid target
+
+ player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
+ return true;
+}
+
+/*#####
+# item_razorthorn_flayer_gland
+#####*/
+
+bool ItemUse_item_razorthorn_flayer_gland(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 24922 )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_tame_beast_rods
+#####*/
+
+bool ItemUse_item_tame_beast_rods(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ uint32 itemSpell = _Item->GetProto()->Spells[0].SpellId;
+ uint32 cEntry = 0;
+
+ if(itemSpell)
+ {
+ switch(itemSpell)
+ {
+ case 19548: cEntry = 1196; break; //Ice Claw Bear
+ case 19674: cEntry = 1126; break; //Large Crag Boar
+ case 19687: cEntry = 1201; break; //Snow Leopard
+ case 19688: cEntry = 2956; break; //Adult Plainstrider
+ case 19689: cEntry = 2959; break; //Prairie Stalker
+ case 19692: cEntry = 2970; break; //Swoop
+ case 19693: cEntry = 1998; break; //Webwood Lurker
+ case 19694: cEntry = 3099; break; //Dire Mottled Boar
+ case 19696: cEntry = 3107; break; //Surf Crawler
+ case 19697: cEntry = 3126; break; //Armored Scorpid
+ case 19699: cEntry = 2043; break; //Nightsaber Stalker
+ case 19700: cEntry = 1996; break; //Strigid Screecher
+ case 30646: cEntry = 17217; break; //Barbed Crawler
+ case 30653: cEntry = 17374; break; //Greater Timberstrider
+ case 30654: cEntry = 17203; break; //Nightstalker
+ case 30099: cEntry = 15650; break; //Crazed Dragonhawk
+ case 30102: cEntry = 15652; break; //Elder Springpaw
+ case 30105: cEntry = 16353; break; //Mistbat
+ }
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == cEntry )
+ return false;
+ }
+
+ WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
+ data << uint32(_Item->GetEntry()); // itemId
+ data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
+ player->GetSession()->SendPacket(&data); // send message: Invalid target
+
+ player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
+ return true;
+}
+
+/*#####
+# item_protovoltaic_magneto_collector
+#####*/
+
+bool ItemUse_item_protovoltaic_magneto_collector(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 21729 )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_soul_cannon
+#####*/
+
+bool ItemUse_item_soul_cannon(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ // allow use
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 22357 )
+ return false;
+
+ // error
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_sparrowhawk_net
+#####*/
+
+bool ItemUse_item_sparrowhawk_net(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 22979 )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_voodoo_charm
+#####*/
+
+bool ItemUse_item_voodoo_charm(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT && targets.getUnitTarget()->isDead() &&
+ targets.getUnitTarget()->GetEntry()==7318 )
+ return false;
+
+ WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
+ data << uint32(_Item->GetEntry()); // itemId
+ data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
+ player->GetSession()->SendPacket(&data); // send message: Invalid target
+
+ player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
+ return true;
+}
+
+/*#####
+# item_vorenthals_presence
+#####*/
+
+bool ItemUse_item_vorenthals_presence(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ // allow use
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 20132 )
+ return false;
+
+ // error
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+/*#####
+# item_yehkinyas_bramble
+#####*/
+
+bool ItemUse_item_yehkinyas_bramble(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if (player->GetQuestStatus(3520) == QUEST_STATUS_INCOMPLETE)
+ {
+ Unit * unit_target = targets.getUnitTarget();
+ if( unit_target &&
+ unit_target->GetTypeId()==TYPEID_UNIT &&
+ unit_target->isDead() &&
+ // cast only on corpse 5307 or 5308
+ (unit_target->GetEntry()==5307 || unit_target->GetEntry()==5308) )
+ {
+ ((Creature*)unit_target)->RemoveCorpse(); // remove corpse for cancelling second use
+ return false; // all ok
+ }
+ }
+ WorldPacket data(SMSG_CAST_FAILED, (4+2)); // prepare packet error message
+ data << uint32(10699); // itemId
+ data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
+ player->GetSession()->SendPacket(&data); // send message: Bad target
+ player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
+ return true;
+}
+
+/*#####
+# item_zezzak_shard
+#####*/
+
+bool ItemUse_item_zezzak_shard(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
+ targets.getUnitTarget()->GetEntry() == 19440 )
+ return false;
+
+ player->SendEquipError(EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM,_Item,NULL);
+ return true;
+}
+
+void AddSC_item_scripts()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="item_area_52_special";
+ newscript->pItemUse = ItemUse_item_area_52_special;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_attuned_crystal_cores";
+ newscript->pItemUse = ItemUse_item_attuned_crystal_cores;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_blackwhelp_net";
+ newscript->pItemUse = ItemUse_item_blackwhelp_net;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_disciplinary_rod";
+ newscript->pItemUse = ItemUse_item_disciplinary_rod;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_draenei_fishing_net";
+ newscript->pItemUse = ItemUse_item_draenei_fishing_net;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_nether_wraith_beacon";
+ newscript->pItemUse = ItemUse_item_nether_wraith_beacon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_flying_machine";
+ newscript->pItemUse = ItemUse_item_flying_machine;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_gor_dreks_ointment";
+ newscript->pItemUse = ItemUse_item_gor_dreks_ointment;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_muiseks_vessel";
+ newscript->pItemUse = ItemUse_item_muiseks_vessel;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_razorthorn_flayer_gland";
+ newscript->pItemUse = ItemUse_item_razorthorn_flayer_gland;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_tame_beast_rods";
+ newscript->pItemUse = ItemUse_item_tame_beast_rods;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_protovoltaic_magneto_collector";
+ newscript->pItemUse = ItemUse_item_protovoltaic_magneto_collector;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_soul_cannon";
+ newscript->pItemUse = ItemUse_item_soul_cannon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_sparrowhawk_net";
+ newscript->pItemUse = ItemUse_item_sparrowhawk_net;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_voodoo_charm";
+ newscript->pItemUse = ItemUse_item_voodoo_charm;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_vorenthals_presence";
+ newscript->pItemUse = ItemUse_item_vorenthals_presence;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_yehkinyas_bramble";
+ newscript->pItemUse = ItemUse_item_yehkinyas_bramble;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="item_zezzaks_shard";
+ newscript->pItemUse = ItemUse_item_zezzak_shard;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/item/item_test.cpp b/src/bindings/scripts/scripts/item/item_test.cpp
index 2841f3bed64..a1e3b6c13c1 100644
--- a/src/bindings/scripts/scripts/item/item_test.cpp
+++ b/src/bindings/scripts/scripts/item/item_test.cpp
@@ -1,42 +1,42 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Item_Test
-SD%Complete: 100
-SDComment: Used for Testing Item Scripts
-SDCategory: Items
-EndScriptData */
-
-#include "precompiled.h"
-
-extern void LoadDatabase();
-
-bool ItemUse_item_test(Player *player, Item* _Item, SpellCastTargets const& targets)
-{
- LoadDatabase();
- return true;
-}
-
-void AddSC_item_test()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="item_test";
- newscript->pItemUse = ItemUse_item_test;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Item_Test
+SD%Complete: 100
+SDComment: Used for Testing Item Scripts
+SDCategory: Items
+EndScriptData */
+
+#include "precompiled.h"
+
+extern void LoadDatabase();
+
+bool ItemUse_item_test(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ LoadDatabase();
+ return true;
+}
+
+void AddSC_item_test()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="item_test";
+ newscript->pItemUse = ItemUse_item_test;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
index 9be59296dbb..44ffae1784d 100644
--- a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
@@ -1,304 +1,304 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-/* ScriptData
-SDName: Npc_EscortAI
-SD%Complete: 100
-SDComment:
-SDCategory: Npc
-EndScriptData */
-
-#include "precompiled.h"
-#include "npc_escortAI.h"
-
-#define WP_LAST_POINT -1
-#define MAX_PLAYER_DISTANCE 50
-
-bool npc_escortAI::IsVisible(Unit* who) const
-{
- if (!who)
- return false;
-
- return (m_creature->GetDistance(who) < VISIBLE_RANGE) && who->isVisibleForOrDetect(m_creature,true);
-}
-
-void npc_escortAI::AttackStart(Unit *who)
-{
- if (!who)
- return;
-
- if (IsBeingEscorted && !Defend)
- return;
-
- if (who->isTargetableForAttack())
- {
- //Begin attack
- if ( m_creature->Attack(who, true) )
- {
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MoveChase(who);
- m_creature->AddThreat(who, 0.0f);
- }
-
- if (!InCombat)
- {
- InCombat = true;
-
- //Store last position
- m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
-
- debug_log("SD2: EscortAI has entered combat via Attack and stored last location");
-
- Aggro(who);
- }
- }
-}
-
-void npc_escortAI::MoveInLineOfSight(Unit *who)
-{
- if (IsBeingEscorted && !Attack)
- return;
-
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- //Begin attack
- if ( m_creature->Attack(who, true) )
- {
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MoveChase(who);
- m_creature->AddThreat(who, 0.0f);
- }
-
- if (!InCombat)
- {
- InCombat = true;
-
- //Store last position
- m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
- debug_log("SD2: EscortAI has entered combat via LOS and stored last location");
-
- Aggro(who);
- }
- }
- }
-}
-
-void npc_escortAI::JustRespawned()
-{
- InCombat = false;
- IsBeingEscorted = false;
- IsOnHold = false;
-
- //Re-Enable gossip
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- Reset();
-}
-
-void npc_escortAI::EnterEvadeMode()
-{
- InCombat = false;
-
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- m_creature->SetLootRecipient(NULL);
-
- if (IsBeingEscorted)
- {
- debug_log("SD2: EscortAI has left combat and is now returning to last point");
- Returning = true;
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, LastPos.x, LastPos.y, LastPos.z);
-
- }else
- {
- m_creature->GetMotionMaster()->MovementExpired();
- m_creature->GetMotionMaster()->MoveTargetedHome();
- }
-
- Reset();
-}
-
-void npc_escortAI::UpdateAI(const uint32 diff)
-{
- //Waypoint Updating
- if (IsBeingEscorted && !InCombat && WaitTimer && !Returning)
- if (WaitTimer <= diff)
- {
- if (ReconnectWP)
- {
- //Correct movement speed
- if (Run)
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
-
- //Continue with waypoints
- if( !IsOnHold )
- {
- m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
- debug_log("SD2: EscortAI Reconnect WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
- WaitTimer = 0;
- ReconnectWP = false;
- return;
- }
- }
-
- //End of the line, Despawn self then immediatly respawn
- if (CurrentWP == WaypointList.end())
- {
- debug_log("SD2: EscortAI reached end of waypoints");
-
- m_creature->setDeathState(JUST_DIED);
- m_creature->SetHealth(0);
- m_creature->CombatStop();
- m_creature->DeleteThreatList();
- m_creature->Respawn();
- m_creature->GetMotionMaster()->Clear(true);
-
- //Re-Enable gossip
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- IsBeingEscorted = false;
- WaitTimer = 0;
- return;
- }
-
- if( !IsOnHold )
- {
- m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
- debug_log("SD2: EscortAI Next WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
- WaitTimer = 0;
- }
- }else WaitTimer -= diff;
-
- //Check if player is within range
- if (IsBeingEscorted && !InCombat && PlayerGUID)
- if (PlayerTimer < diff)
- {
- Unit* p = Unit::GetUnit(*m_creature, PlayerGUID);
-
- if (!p || m_creature->GetDistance(p) > MAX_PLAYER_DISTANCE)
- {
- JustDied(m_creature);
- IsBeingEscorted = false;
-
- debug_log("SD2: EscortAI Evaded back to spawn point because player was to far away or not found");
-
- m_creature->setDeathState(JUST_DIED);
- m_creature->SetHealth(0);
- m_creature->CombatStop();
- m_creature->DeleteThreatList();
- m_creature->Respawn();
- m_creature->GetMotionMaster()->Clear(true);
-
- //Re-Enable gossip
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
-
- PlayerTimer = 1000;
- }else PlayerTimer -= diff;
-
- //Check if we have a current target
- if( m_creature->isAlive() && m_creature->SelectHostilTarget() && m_creature->getVictim())
- {
- //If we are within range melee the target
- if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- if( m_creature->isAttackReady() )
- {
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- }
- }
-}
-
-void npc_escortAI::MovementInform(uint32 type, uint32 id)
-{
- if (type != POINT_MOTION_TYPE || !IsBeingEscorted)
- return;
-
- //Original position reached, continue waypoint movement
- if (id == WP_LAST_POINT)
- {
- debug_log("SD2: EscortAI has returned to original position before combat");
- ReconnectWP = true;
- Returning = false;
- WaitTimer = 1;
-
- }else
- {
- //Make sure that we are still on the right waypoint
- if (CurrentWP->id != id)
- {
- debug_log("SD2 ERROR: EscortAI reached waypoint out of order %d, expected %d", id, CurrentWP->id);
- return;
- }
-
- debug_log("SD2: EscortAI Waypoint %d reached", CurrentWP->id);
-
- //Call WP function
- WaypointReached(CurrentWP->id);
-
- WaitTimer = CurrentWP->WaitTimeMs + 1;
-
- ++CurrentWP;
- }
-}
-
-void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs)
-{
- Escort_Waypoint t(id, x, y, z, WaitTimeMs);
-
- WaypointList.push_back(t);
-}
-
-void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
-{
- if (InCombat)
- {
- debug_log("SD2 ERROR: EscortAI attempt to Start while in combat");
- return;
- }
-
- if (WaypointList.empty())
- {
- debug_log("SD2 ERROR: Call to escortAI::Start with 0 waypoints");
- return;
- }
-
- Attack = bAttack;
- Defend = bDefend;
- Run = bRun;
- PlayerGUID = pGUID;
-
- debug_log("SD2: EscortAI started with %d waypoints. Attack = %d, Defend = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), Attack, Defend, Run, PlayerGUID);
-
- CurrentWP = WaypointList.begin();
-
- //Set initial speed
- if (Run)
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
-
- //Start WP
- m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
- debug_log("SD2: EscortAI Next WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
- IsBeingEscorted = true;
- ReconnectWP = false;
- Returning = false;
- IsOnHold = false;
-
- //Disable gossip
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+/* ScriptData
+SDName: Npc_EscortAI
+SD%Complete: 100
+SDComment:
+SDCategory: Npc
+EndScriptData */
+
+#include "precompiled.h"
+#include "npc_escortAI.h"
+
+#define WP_LAST_POINT -1
+#define MAX_PLAYER_DISTANCE 50
+
+bool npc_escortAI::IsVisible(Unit* who) const
+{
+ if (!who)
+ return false;
+
+ return (m_creature->GetDistance(who) < VISIBLE_RANGE) && who->isVisibleForOrDetect(m_creature,true);
+}
+
+void npc_escortAI::AttackStart(Unit *who)
+{
+ if (!who)
+ return;
+
+ if (IsBeingEscorted && !Defend)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ //Begin attack
+ if ( m_creature->Attack(who, true) )
+ {
+ m_creature->GetMotionMaster()->MovementExpired();
+ m_creature->GetMotionMaster()->MoveChase(who);
+ m_creature->AddThreat(who, 0.0f);
+ }
+
+ if (!InCombat)
+ {
+ InCombat = true;
+
+ //Store last position
+ m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
+
+ debug_log("SD2: EscortAI has entered combat via Attack and stored last location");
+
+ Aggro(who);
+ }
+ }
+}
+
+void npc_escortAI::MoveInLineOfSight(Unit *who)
+{
+ if (IsBeingEscorted && !Attack)
+ return;
+
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ //Begin attack
+ if ( m_creature->Attack(who, true) )
+ {
+ m_creature->GetMotionMaster()->MovementExpired();
+ m_creature->GetMotionMaster()->MoveChase(who);
+ m_creature->AddThreat(who, 0.0f);
+ }
+
+ if (!InCombat)
+ {
+ InCombat = true;
+
+ //Store last position
+ m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
+ debug_log("SD2: EscortAI has entered combat via LOS and stored last location");
+
+ Aggro(who);
+ }
+ }
+ }
+}
+
+void npc_escortAI::JustRespawned()
+{
+ InCombat = false;
+ IsBeingEscorted = false;
+ IsOnHold = false;
+
+ //Re-Enable gossip
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ Reset();
+}
+
+void npc_escortAI::EnterEvadeMode()
+{
+ InCombat = false;
+
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ m_creature->SetLootRecipient(NULL);
+
+ if (IsBeingEscorted)
+ {
+ debug_log("SD2: EscortAI has left combat and is now returning to last point");
+ Returning = true;
+ m_creature->GetMotionMaster()->MovementExpired();
+ m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, LastPos.x, LastPos.y, LastPos.z);
+
+ }else
+ {
+ m_creature->GetMotionMaster()->MovementExpired();
+ m_creature->GetMotionMaster()->MoveTargetedHome();
+ }
+
+ Reset();
+}
+
+void npc_escortAI::UpdateAI(const uint32 diff)
+{
+ //Waypoint Updating
+ if (IsBeingEscorted && !InCombat && WaitTimer && !Returning)
+ if (WaitTimer <= diff)
+ {
+ if (ReconnectWP)
+ {
+ //Correct movement speed
+ if (Run)
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+
+ //Continue with waypoints
+ if( !IsOnHold )
+ {
+ m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
+ debug_log("SD2: EscortAI Reconnect WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+ WaitTimer = 0;
+ ReconnectWP = false;
+ return;
+ }
+ }
+
+ //End of the line, Despawn self then immediatly respawn
+ if (CurrentWP == WaypointList.end())
+ {
+ debug_log("SD2: EscortAI reached end of waypoints");
+
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->SetHealth(0);
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
+ m_creature->Respawn();
+ m_creature->GetMotionMaster()->Clear(true);
+
+ //Re-Enable gossip
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ IsBeingEscorted = false;
+ WaitTimer = 0;
+ return;
+ }
+
+ if( !IsOnHold )
+ {
+ m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
+ debug_log("SD2: EscortAI Next WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+ WaitTimer = 0;
+ }
+ }else WaitTimer -= diff;
+
+ //Check if player is within range
+ if (IsBeingEscorted && !InCombat && PlayerGUID)
+ if (PlayerTimer < diff)
+ {
+ Unit* p = Unit::GetUnit(*m_creature, PlayerGUID);
+
+ if (!p || m_creature->GetDistance(p) > MAX_PLAYER_DISTANCE)
+ {
+ JustDied(m_creature);
+ IsBeingEscorted = false;
+
+ debug_log("SD2: EscortAI Evaded back to spawn point because player was to far away or not found");
+
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->SetHealth(0);
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
+ m_creature->Respawn();
+ m_creature->GetMotionMaster()->Clear(true);
+
+ //Re-Enable gossip
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ }
+
+ PlayerTimer = 1000;
+ }else PlayerTimer -= diff;
+
+ //Check if we have a current target
+ if( m_creature->isAlive() && m_creature->SelectHostilTarget() && m_creature->getVictim())
+ {
+ //If we are within range melee the target
+ if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ if( m_creature->isAttackReady() )
+ {
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ }
+ }
+}
+
+void npc_escortAI::MovementInform(uint32 type, uint32 id)
+{
+ if (type != POINT_MOTION_TYPE || !IsBeingEscorted)
+ return;
+
+ //Original position reached, continue waypoint movement
+ if (id == WP_LAST_POINT)
+ {
+ debug_log("SD2: EscortAI has returned to original position before combat");
+ ReconnectWP = true;
+ Returning = false;
+ WaitTimer = 1;
+
+ }else
+ {
+ //Make sure that we are still on the right waypoint
+ if (CurrentWP->id != id)
+ {
+ debug_log("SD2 ERROR: EscortAI reached waypoint out of order %d, expected %d", id, CurrentWP->id);
+ return;
+ }
+
+ debug_log("SD2: EscortAI Waypoint %d reached", CurrentWP->id);
+
+ //Call WP function
+ WaypointReached(CurrentWP->id);
+
+ WaitTimer = CurrentWP->WaitTimeMs + 1;
+
+ ++CurrentWP;
+ }
+}
+
+void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs)
+{
+ Escort_Waypoint t(id, x, y, z, WaitTimeMs);
+
+ WaypointList.push_back(t);
+}
+
+void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
+{
+ if (InCombat)
+ {
+ debug_log("SD2 ERROR: EscortAI attempt to Start while in combat");
+ return;
+ }
+
+ if (WaypointList.empty())
+ {
+ debug_log("SD2 ERROR: Call to escortAI::Start with 0 waypoints");
+ return;
+ }
+
+ Attack = bAttack;
+ Defend = bDefend;
+ Run = bRun;
+ PlayerGUID = pGUID;
+
+ debug_log("SD2: EscortAI started with %d waypoints. Attack = %d, Defend = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), Attack, Defend, Run, PlayerGUID);
+
+ CurrentWP = WaypointList.begin();
+
+ //Set initial speed
+ if (Run)
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+
+ //Start WP
+ m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
+ debug_log("SD2: EscortAI Next WP is: %d, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+ IsBeingEscorted = true;
+ ReconnectWP = false;
+ Returning = false;
+ IsOnHold = false;
+
+ //Disable gossip
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+}
diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.h b/src/bindings/scripts/scripts/npc/npc_escortAI.h
index aa6dd553992..73928f7e2f8 100644
--- a/src/bindings/scripts/scripts/npc/npc_escortAI.h
+++ b/src/bindings/scripts/scripts/npc/npc_escortAI.h
@@ -1,85 +1,85 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef SC_ESCORTAI_H
-#define SC_ESCORTAI_H
-
-struct Escort_Waypoint
-{
- Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w)
- {
- id = _id;
- x = _x;
- y = _y;
- z = _z;
- WaitTimeMs = _w;
- }
-
- uint32 id;
- float x;
- float y;
- float z;
- uint32 WaitTimeMs;
-};
-
-struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
-{
- public:
-
- // Pure Virtual Functions
- virtual void WaypointReached(uint32) = 0;
-
- virtual void Aggro(Unit*) = 0;
-
- virtual void Reset() = 0;
-
- // CreatureAI functions
- npc_escortAI(Creature *c) : ScriptedAI(c), IsBeingEscorted(false), PlayerTimer(1000) {m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);}
-
- bool IsVisible(Unit*) const;
-
- void AttackStart(Unit*);
-
- void MoveInLineOfSight(Unit*);
-
- void JustRespawned();
-
- void EnterEvadeMode();
-
- void UpdateAI(const uint32);
-
- void MovementInform(uint32, uint32);
-
- // EscortAI functions
- void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0);
-
- void Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID = 0);
-
- // EscortAI variables
- protected:
- uint64 PlayerGUID;
- bool IsBeingEscorted;
- bool IsOnHold;
-
- private:
- uint32 WaitTimer;
- uint32 PlayerTimer;
-
- struct
- {
- float x;
- float y;
- float z;
- }LastPos;
-
- std::list WaypointList;
- std::list::iterator CurrentWP;
-
- bool Attack;
- bool Defend;
- bool Returning;
- bool ReconnectWP;
- bool Run;
-};
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef SC_ESCORTAI_H
+#define SC_ESCORTAI_H
+
+struct Escort_Waypoint
+{
+ Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w)
+ {
+ id = _id;
+ x = _x;
+ y = _y;
+ z = _z;
+ WaitTimeMs = _w;
+ }
+
+ uint32 id;
+ float x;
+ float y;
+ float z;
+ uint32 WaitTimeMs;
+};
+
+struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
+{
+ public:
+
+ // Pure Virtual Functions
+ virtual void WaypointReached(uint32) = 0;
+
+ virtual void Aggro(Unit*) = 0;
+
+ virtual void Reset() = 0;
+
+ // CreatureAI functions
+ npc_escortAI(Creature *c) : ScriptedAI(c), IsBeingEscorted(false), PlayerTimer(1000) {m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);}
+
+ bool IsVisible(Unit*) const;
+
+ void AttackStart(Unit*);
+
+ void MoveInLineOfSight(Unit*);
+
+ void JustRespawned();
+
+ void EnterEvadeMode();
+
+ void UpdateAI(const uint32);
+
+ void MovementInform(uint32, uint32);
+
+ // EscortAI functions
+ void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0);
+
+ void Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID = 0);
+
+ // EscortAI variables
+ protected:
+ uint64 PlayerGUID;
+ bool IsBeingEscorted;
+ bool IsOnHold;
+
+ private:
+ uint32 WaitTimer;
+ uint32 PlayerTimer;
+
+ struct
+ {
+ float x;
+ float y;
+ float z;
+ }LastPos;
+
+ std::list WaypointList;
+ std::list::iterator CurrentWP;
+
+ bool Attack;
+ bool Defend;
+ bool Returning;
+ bool ReconnectWP;
+ bool Run;
+};
+#endif
diff --git a/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp b/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp
index e7bb90caad4..d0faf45c792 100644
--- a/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp
@@ -1,144 +1,144 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Npc_Innkeeper
-SD%Complete: 50
-SDComment: This script are currently not in use. EventSystem cannot be used on Windows build of SD2
-SDCategory: NPCs
-EndScriptData */
-
-#include "precompiled.h"
-
-#define HALLOWEEN_EVENTID 12
-#define SPELL_TRICK_OR_TREATED 24755
-#define SPELL_TREAT 24715
-
-#define LOCALE_TRICK_OR_TREAT_0 "Trick or Treat!"
-#define LOCALE_TRICK_OR_TREAT_2 "Des bonbons ou des blagues!"
-#define LOCALE_TRICK_OR_TREAT_3 "Süßes oder Saures!"
-#define LOCALE_TRICK_OR_TREAT_6 "¡Truco o trato!"
-
-bool isEventActive()
-{
- /*
- const GameEvent::ActiveEvents *ActiveEventsList = gameeventmgr.GetActiveEventList();
- GameEvent::ActiveEvents::const_iterator itr;
- for (itr = ActiveEventsList->begin(); itr != ActiveEventsList->end(); ++itr)
- {
- if (*itr==HALLOWEEN_EVENTID)
- {
- return true;
- }
- }*/
- return false;
-}
-
-bool GossipHello_npc_innkeeper(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (isEventActive()&& !player->GetAura(SPELL_TRICK_OR_TREATED,0))
- {
- char* localizedEntry;
- switch (player->GetSession()->GetSessionDbLocaleIndex())
- {
- case 0:
- localizedEntry=LOCALE_TRICK_OR_TREAT_0;
- break;
- case 2:
- localizedEntry=LOCALE_TRICK_OR_TREAT_2;
- break;
- case 3:
- localizedEntry=LOCALE_TRICK_OR_TREAT_3;
- break;
- case 6:
- localizedEntry=LOCALE_TRICK_OR_TREAT_6;
- break;
- default:
- localizedEntry=LOCALE_TRICK_OR_TREAT_0;
- }
-
- player->ADD_GOSSIP_ITEM(0, localizedEntry, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID);
- }
-
- player->TalkedToCreature(_Creature->GetEntry(),_Creature->GetGUID());
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_innkeeper(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && isEventActive() && !player->GetAura(SPELL_TRICK_OR_TREATED,0))
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_TRICK_OR_TREATED, true);
-
- // either trick or treat, 50% chance
- if(rand()%2)
- {
- player->CastSpell(player, SPELL_TREAT, true);
- }
- else
- {
- int32 trickspell=0;
- switch (rand()%9) // note that female characters can get male costumes and vice versa
- {
- case 0:
- trickspell=24753; // cannot cast, random 30sec
- break;
- case 1:
- trickspell=24713; // lepper gnome costume
- break;
- case 2:
- trickspell=24735; // male ghost costume
- break;
- case 3:
- trickspell=24736; // female ghostcostume
- break;
- case 4:
- trickspell=24710; // male ninja costume
- break;
- case 5:
- trickspell=24711; // female ninja costume
- break;
- case 6:
- trickspell=24708; // male pirate costume
- break;
- case 7:
- trickspell=24709; // female pirate costume
- break;
- case 8:
- trickspell=24723; // skeleton costume
- break;
- }
- player->CastSpell(player, trickspell, true);
- }
- return true; // prevent Trinity core handling
- }
- return false; // the player didn't select "trick or treat" or cheated, normal core handling
-}
-
-void AddSC_npc_innkeeper()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="npc_innkeeper";
- newscript->pGossipHello = &GossipHello_npc_innkeeper;
- newscript->pGossipSelect = &GossipSelect_npc_innkeeper;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Npc_Innkeeper
+SD%Complete: 50
+SDComment: This script are currently not in use. EventSystem cannot be used on Windows build of SD2
+SDCategory: NPCs
+EndScriptData */
+
+#include "precompiled.h"
+
+#define HALLOWEEN_EVENTID 12
+#define SPELL_TRICK_OR_TREATED 24755
+#define SPELL_TREAT 24715
+
+#define LOCALE_TRICK_OR_TREAT_0 "Trick or Treat!"
+#define LOCALE_TRICK_OR_TREAT_2 "Des bonbons ou des blagues!"
+#define LOCALE_TRICK_OR_TREAT_3 "Süßes oder Saures!"
+#define LOCALE_TRICK_OR_TREAT_6 "¡Truco o trato!"
+
+bool isEventActive()
+{
+ /*
+ const GameEvent::ActiveEvents *ActiveEventsList = gameeventmgr.GetActiveEventList();
+ GameEvent::ActiveEvents::const_iterator itr;
+ for (itr = ActiveEventsList->begin(); itr != ActiveEventsList->end(); ++itr)
+ {
+ if (*itr==HALLOWEEN_EVENTID)
+ {
+ return true;
+ }
+ }*/
+ return false;
+}
+
+bool GossipHello_npc_innkeeper(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (isEventActive()&& !player->GetAura(SPELL_TRICK_OR_TREATED,0))
+ {
+ char* localizedEntry;
+ switch (player->GetSession()->GetSessionDbLocaleIndex())
+ {
+ case 0:
+ localizedEntry=LOCALE_TRICK_OR_TREAT_0;
+ break;
+ case 2:
+ localizedEntry=LOCALE_TRICK_OR_TREAT_2;
+ break;
+ case 3:
+ localizedEntry=LOCALE_TRICK_OR_TREAT_3;
+ break;
+ case 6:
+ localizedEntry=LOCALE_TRICK_OR_TREAT_6;
+ break;
+ default:
+ localizedEntry=LOCALE_TRICK_OR_TREAT_0;
+ }
+
+ player->ADD_GOSSIP_ITEM(0, localizedEntry, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID);
+ }
+
+ player->TalkedToCreature(_Creature->GetEntry(),_Creature->GetGUID());
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_innkeeper(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && isEventActive() && !player->GetAura(SPELL_TRICK_OR_TREATED,0))
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player, SPELL_TRICK_OR_TREATED, true);
+
+ // either trick or treat, 50% chance
+ if(rand()%2)
+ {
+ player->CastSpell(player, SPELL_TREAT, true);
+ }
+ else
+ {
+ int32 trickspell=0;
+ switch (rand()%9) // note that female characters can get male costumes and vice versa
+ {
+ case 0:
+ trickspell=24753; // cannot cast, random 30sec
+ break;
+ case 1:
+ trickspell=24713; // lepper gnome costume
+ break;
+ case 2:
+ trickspell=24735; // male ghost costume
+ break;
+ case 3:
+ trickspell=24736; // female ghostcostume
+ break;
+ case 4:
+ trickspell=24710; // male ninja costume
+ break;
+ case 5:
+ trickspell=24711; // female ninja costume
+ break;
+ case 6:
+ trickspell=24708; // male pirate costume
+ break;
+ case 7:
+ trickspell=24709; // female pirate costume
+ break;
+ case 8:
+ trickspell=24723; // skeleton costume
+ break;
+ }
+ player->CastSpell(player, trickspell, true);
+ }
+ return true; // prevent Trinity core handling
+ }
+ return false; // the player didn't select "trick or treat" or cheated, normal core handling
+}
+
+void AddSC_npc_innkeeper()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="npc_innkeeper";
+ newscript->pGossipHello = &GossipHello_npc_innkeeper;
+ newscript->pGossipSelect = &GossipSelect_npc_innkeeper;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/npc/npc_professions.cpp b/src/bindings/scripts/scripts/npc/npc_professions.cpp
index 579b53ad139..c06d65b0462 100644
--- a/src/bindings/scripts/scripts/npc/npc_professions.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_professions.cpp
@@ -1,1205 +1,1205 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Npc_Professions
-SD%Complete: 80
-SDComment: Provides learn/unlearn/relearn-options for professions. Not supported: Unlearn engineering, re-learn engineering, re-learn leatherworking.
-SDCategory: NPCs
-EndScriptData */
-
-#include "precompiled.h"
-
-/*
-A few notes for future developement:
-- A full implementation of gossip for GO's is required. They must have the same scripting capabilities as creatures. Basically,
-there is no difference here (except that default text is chosen with `gameobject_template`.`data3` (for GO type2, different dataN for a few others)
-- It's possible blacksmithing still require some tweaks and adjustments due to the way we _have_ to use reputation.
-*/
-
-/*
--- UPDATE `gameobject_template` SET `ScriptName` = 'go_soothsaying_for_dummies' WHERE `entry` = 177226;
-*/
-
-/*###
-# to be removed from here (->ncp_text). This is data for database projects.
-###*/
-#define TALK_MUST_UNLEARN_WEAPON "You must forget your weapon type specialty before I can help you. Go to Everlook in Winterspring and seek help there."
-
-#define TALK_HAMMER_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the hammersmith."
-#define TALK_AXE_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the axesmith."
-#define TALK_SWORD_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the swordsmith."
-
-#define TALK_HAMMER_UNLEARN "Forgetting your Hammersmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Hammersmithing to create!"
-#define TALK_AXE_UNLEARN "Forgetting your Axesmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Axesmithing to create!"
-#define TALK_SWORD_UNLEARN "Forgetting your Swordsmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Swordsmithing to create!"
-
-/*###
-# generic defines
-###*/
-
-#define GOSSIP_SENDER_LEARN 50
-#define GOSSIP_SENDER_UNLEARN 51
-#define GOSSIP_SENDER_CHECK 52
-
-/*###
-# gossip item and box texts
-###*/
-
-#define GOSSIP_LEARN_POTION "Please teach me how to become a Master of Potions, Lauranna"
-#define GOSSIP_UNLEARN_POTION "I wish to unlearn Potion Mastery"
-#define GOSSIP_LEARN_TRANSMUTE "Please teach me how to become a Master of Transmutations, Zarevhi"
-#define GOSSIP_UNLEARN_TRANSMUTE "I wish to unlearn Transmutation Mastery"
-#define GOSSIP_LEARN_ELIXIR "Please teach me how to become a Master of Elixirs, Lorokeem"
-#define GOSSIP_UNLEARN_ELIXIR "I wish to unlearn Elixir Mastery"
-
-#define BOX_UNLEARN_ALCHEMY_SPEC "Do you really want to unlearn your alchemy specialty and lose all associated recipes? \n Cost: "
-
-#define GOSSIP_WEAPON_LEARN "Please teach me how to become a Weaponsmith"
-#define GOSSIP_WEAPON_UNLEARN "I wish to unlearn the art of Weaponsmithing"
-#define GOSSIP_ARMOR_LEARN "Please teach me how to become a Armorsmith"
-#define GOSSIP_ARMOR_UNLEARN "I wish to unlearn the art of Armorsmithing"
-
-#define GOSSIP_UNLEARN_SMITH_SPEC "I wish to unlearn my blacksmith specialty"
-#define BOX_UNLEARN_ARMORORWEAPON "Do you really want to unlearn your blacksmith specialty and lose all associated recipes? \n Cost: "
-
-#define GOSSIP_LEARN_HAMMER "Please teach me how to become a Hammersmith, Lilith"
-#define GOSSIP_UNLEARN_HAMMER "I wish to unlearn Hammersmithing"
-#define GOSSIP_LEARN_AXE "Please teach me how to become a Axesmith, Kilram"
-#define GOSSIP_UNLEARN_AXE "I wish to unlearn Axesmithing"
-#define GOSSIP_LEARN_SWORD "Please teach me how to become a Swordsmith, Seril"
-#define GOSSIP_UNLEARN_SWORD "I wish to unlearn Swordsmithing"
-
-#define BOX_UNLEARN_WEAPON_SPEC "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: "
-
-#define GOSSIP_LEARN_DRAGON "I am absolutely certain that i want to learn dragonscale leatherworking"
-#define GOSSIP_UNLEARN_DRAGON "I wish to unlearn Dragonscale Leatherworking"
-#define GOSSIP_LEARN_ELEMENTAL "I am absolutely certain that i want to learn elemental leatherworking"
-#define GOSSIP_UNLEARN_ELEMENTAL "I wish to unlearn Elemental Leatherworking"
-#define GOSSIP_LEARN_TRIBAL "I am absolutely certain that i want to learn tribal leatherworking"
-#define GOSSIP_UNLEARN_TRIBAL "I wish to unlearn Tribal Leatherworking"
-
-#define BOX_UNLEARN_LEATHER_SPEC "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: "
-
-#define GOSSIP_LEARN_SPELLFIRE "Please teach me how to become a Spellcloth tailor"
-#define GOSSIP_UNLEARN_SPELLFIRE "I wish to unlearn Spellfire Tailoring"
-#define GOSSIP_LEARN_MOONCLOTH "Please teach me how to become a Mooncloth tailor"
-#define GOSSIP_UNLEARN_MOONCLOTH "I wish to unlearn Mooncloth Tailoring"
-#define GOSSIP_LEARN_SHADOWEAVE "Please teach me how to become a Shadoweave tailor"
-#define GOSSIP_UNLEARN_SHADOWEAVE "I wish to unlearn Shadoweave Tailoring"
-
-#define BOX_UNLEARN_TAILOR_SPEC "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: "
-
-#define GOSSIP_LEARN_GOBLIN "I am absolutely certain that i want to learn Goblin engineering"
-#define GOSSIP_LEARN_GNOMISH "I am absolutely certain that i want to learn Gnomish engineering"
-
-/*###
-# spells defines
-###*/
-
-#define S_WEAPON 9787
-#define S_ARMOR 9788
-#define S_HAMMER 17040
-#define S_AXE 17041
-#define S_SWORD 17039
-
-#define S_LEARN_WEAPON 9789
-#define S_LEARN_ARMOR 9790
-#define S_LEARN_HAMMER 39099
-#define S_LEARN_AXE 39098
-#define S_LEARN_SWORD 39097
-
-#define S_UNLEARN_WEAPON 36436
-#define S_UNLEARN_ARMOR 36435
-#define S_UNLEARN_HAMMER 36441
-#define S_UNLEARN_AXE 36439
-#define S_UNLEARN_SWORD 36438
-
-#define S_REP_ARMOR 17451
-#define S_REP_WEAPON 17452
-
-#define REP_ARMOR 46
-#define REP_WEAPON 289
-#define REP_HAMMER 569
-#define REP_AXE 570
-#define REP_SWORD 571
-
-#define S_DRAGON 10656
-#define S_ELEMENTAL 10658
-#define S_TRIBAL 10660
-
-#define S_LEARN_DRAGON 10657
-#define S_LEARN_ELEMENTAL 10659
-#define S_LEARN_TRIBAL 10661
-
-#define S_UNLEARN_DRAGON 36434
-#define S_UNLEARN_ELEMENTAL 36328
-#define S_UNLEARN_TRIBAL 36433
-
-#define S_GOBLIN 20222
-#define S_GNOMISH 20219
-
-#define S_LEARN_GOBLIN 20221
-#define S_LEARN_GNOMISH 20220
-
-#define S_SPELLFIRE 26797
-#define S_MOONCLOTH 26798
-#define S_SHADOWEAVE 26801
-
-#define S_LEARN_SPELLFIRE 26796
-#define S_LEARN_MOONCLOTH 26799
-#define S_LEARN_SHADOWEAVE 26800
-
-#define S_UNLEARN_SPELLFIRE 41299
-#define S_UNLEARN_MOONCLOTH 41558
-#define S_UNLEARN_SHADOWEAVE 41559
-
-#define S_TRANSMUTE 28672
-#define S_ELIXIR 28677
-#define S_POTION 28675
-
-#define S_LEARN_TRANSMUTE 28674
-#define S_LEARN_ELIXIR 28678
-#define S_LEARN_POTION 28676
-
-#define S_UNLEARN_TRANSMUTE 41565
-#define S_UNLEARN_ELIXIR 41564
-#define S_UNLEARN_POTION 41563
-
-/*###
-# formulas to calculate unlearning cost
-###*/
-
-int32 DoLearnCost(Player *player) //tailor, alchemy
-{
- return 200000;
-}
-
-int32 DoHighUnlearnCost(Player *player) //tailor, alchemy
-{
- return 1500000;
-}
-
-int32 DoMedUnlearnCost(Player *player) //blacksmith, leatherwork
-{
- uint32 level = player->getLevel();
- if(level < 51)
- return 250000;
- else if (level < 66)
- return 500000;
- else
- return 1000000;
-}
-
-int32 DoLowUnlearnCost(Player *player) //blacksmith
-{
- uint32 level = player->getLevel();
- if (level < 66)
- return 50000;
- else
- return 100000;
-}
-
-/*###
-# unlearning related profession spells
-###*/
-
-bool EquippedOk(Player* player, uint32 spellId)
-{
- SpellEntry const* spell = GetSpellStore()->LookupEntry(spellId);
-
- if( !spell )
- return false;
-
- for(int i=0; i<3; i++)
- {
- uint32 reqSpell = spell->EffectTriggerSpell[i];
- if( !reqSpell )
- continue;
-
- Item* pItem;
- for(int j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; j++)
- {
- pItem = player->GetItemByPos( INVENTORY_SLOT_BAG_0, j );
- if( pItem )
- if( pItem->GetProto()->RequiredSpell == reqSpell )
- {
- //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
- debug_log("SD2: player attempt to unlearn spell %u, but item %u is equipped.",reqSpell,pItem->GetProto()->ItemId);
- return false;
- }
- }
- }
- return true;
-}
-
-void ProfessionUnlearnSpells(Player *player, uint32 type)
-{
- switch (type)
- {
- case 36436: // S_UNLEARN_WEAPON
- player->removeSpell(36125); // Light Earthforged Blade
- player->removeSpell(36128); // Light Emberforged Hammer
- player->removeSpell(36126); // Light Skyforged Axe
- break;
- case 36435: // S_UNLEARN_ARMOR
- player->removeSpell(36122); // Earthforged Leggings
- player->removeSpell(36129); // Heavy Earthforged Breastplate
- player->removeSpell(36130); // Stormforged Hauberk
- player->removeSpell(34533); // Breastplate of Kings
- player->removeSpell(34529); // Nether Chain Shirt
- player->removeSpell(34534); // Bulwark of Kings
- player->removeSpell(36257); // Bulwark of the Ancient Kings
- player->removeSpell(36256); // Embrace of the Twisting Nether
- player->removeSpell(34530); // Twisting Nether Chain Shirt
- player->removeSpell(36124); // Windforged Leggings
- break;
- case 36441: // S_UNLEARN_HAMMER
- player->removeSpell(36262); // Dragonstrike
- player->removeSpell(34546); // Dragonmaw
- player->removeSpell(34545); // Drakefist Hammer
- player->removeSpell(36136); // Lavaforged Warhammer
- player->removeSpell(34547); // Thunder
- player->removeSpell(34567); // Deep Thunder
- player->removeSpell(36263); // Stormherald
- player->removeSpell(36137); // Great Earthforged Hammer
- break;
- case 36439: // S_UNLEARN_AXE
- player->removeSpell(36260); // Wicked Edge of the Planes
- player->removeSpell(34562); // Black Planar Edge
- player->removeSpell(34541); // The Planar Edge
- player->removeSpell(36134); // Stormforged Axe
- player->removeSpell(36135); // Skyforged Great Axe
- player->removeSpell(36261); // Bloodmoon
- player->removeSpell(34543); // Lunar Crescent
- player->removeSpell(34544); // Mooncleaver
- break;
- case 36438: // S_UNLEARN_SWORD
- player->removeSpell(36258); // Blazefury
- player->removeSpell(34537); // Blazeguard
- player->removeSpell(34535); // Fireguard
- player->removeSpell(36131); // Windforged Rapier
- player->removeSpell(36133); // Stoneforged Claymore
- player->removeSpell(34538); // Lionheart Blade
- player->removeSpell(34540); // Lionheart Champion
- player->removeSpell(36259); // Lionheart Executioner
- break;
- case 36434: // S_UNLEARN_DRAGON
- player->removeSpell(36076); // Dragonstrike Leggings
- player->removeSpell(36079); // Golden Dragonstrike Breastplate
- player->removeSpell(35576); // Ebon Netherscale Belt
- player->removeSpell(35577); // Ebon Netherscale Bracers
- player->removeSpell(35575); // Ebon Netherscale Breastplate
- player->removeSpell(35582); // Netherstrike Belt
- player->removeSpell(35584); // Netherstrike Bracers
- player->removeSpell(35580); // Netherstrike Breastplate
- break;
- case 36328: // S_UNLEARN_ELEMENTAL
- player->removeSpell(36074); // Blackstorm Leggings
- player->removeSpell(36077); // Primalstorm Breastplate
- player->removeSpell(35590); // Primalstrike Belt
- player->removeSpell(35591); // Primalstrike Bracers
- player->removeSpell(35589); // Primalstrike Vest
- break;
- case 36433: // S_UNLEARN_TRIBAL
- player->removeSpell(35585); // Windhawk Hauberk
- player->removeSpell(35587); // Windhawk Belt
- player->removeSpell(35588); // Windhawk Bracers
- player->removeSpell(36075); // Wildfeather Leggings
- player->removeSpell(36078); // Living Crystal Breastplate
- break;
- case 41299: // S_UNLEARN_SPELLFIRE
- player->removeSpell(26752); // Spellfire Belt
- player->removeSpell(26753); // Spellfire Gloves
- player->removeSpell(26754); // Spellfire Robe
- break;
- case 41558: // S_UNLEARN_MOONCLOTH
- player->removeSpell(26760); // Primal Mooncloth Belt
- player->removeSpell(26761); // Primal Mooncloth Shoulders
- player->removeSpell(26762); // Primal Mooncloth Robe
- break;
- case 41559: // S_UNLEARN_SHADOWEAVE
- player->removeSpell(26756); // Frozen Shadoweave Shoulders
- player->removeSpell(26757); // Frozen Shadoweave Boots
- player->removeSpell(26758); // Frozen Shadoweave Robe
- break;
- }
-}
-
-/*###
-# start menues alchemy
-###*/
-
-bool HasAlchemySpell(Player *player)
-{
- if(player->HasSpell(S_TRANSMUTE) || player->HasSpell(S_ELIXIR) || player->HasSpell(S_POTION))
- return true;
- return false;
-}
-
-bool GossipHello_npc_prof_alchemy(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- if(_Creature->isTrainer())
- player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- uint32 eCreature = _Creature->GetEntry();
-
- if (player->HasSkill(SKILL_ALCHEMY) && player->GetBaseSkillValue(SKILL_ALCHEMY)>=350 && player->getLevel() > 67)
- {
- if (player->GetQuestRewardStatus(10899) || player->GetQuestRewardStatus(10902) || player->GetQuestRewardStatus(10897))
- {
- switch (eCreature)
- {
- case 22427: //Zarevhi
- if (!HasAlchemySpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 1);
- if (player->HasSpell(S_TRANSMUTE))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
- break;
- case 19052: //Lorokeem
- if (!HasAlchemySpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 2);
- if (player->HasSpell(S_ELIXIR))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 5);
- break;
- case 17909: //Lauranna Thar'well
- if (!HasAlchemySpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_POTION, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 3);
- if (player->HasSpell(S_POTION))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 6);
- break;
- }
- }
- }
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-void SendActionMenu_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_TRADE:
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_ACTION_TRAIN:
- player->SEND_TRAINERLIST( _Creature->GetGUID() );
- break;
- //Learn Alchemy
- case GOSSIP_ACTION_INFO_DEF + 1:
- if(!player->HasSpell(S_TRANSMUTE) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_TRANSMUTE, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- if(!player->HasSpell(S_ELIXIR) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_ELIXIR, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- if(!player->HasSpell(S_POTION) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_POTION, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- //Unlearn Alchemy
- case GOSSIP_ACTION_INFO_DEF + 4:
- if(player->GetMoney() >= DoHighUnlearnCost(player))
- {
- _Creature->CastSpell(player, S_UNLEARN_TRANSMUTE, true);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
- if(player->GetMoney() >= DoHighUnlearnCost(player))
- {
- _Creature->CastSpell(player, S_UNLEARN_ELIXIR, true);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- if(player->GetMoney() >= DoHighUnlearnCost(player))
- {
- _Creature->CastSpell(player, S_UNLEARN_POTION, true);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
-}
-
-void SendConfirmLearn_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 22427:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 19052:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 17909:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_POTION, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-void SendConfirmUnlearn_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 22427: //Zarevhi
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 19052: //Lorokeem
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 17909: //Lauranna Thar'well
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-bool GossipSelect_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(sender)
- {
- case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_alchemy(player, _Creature, action); break;
- case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_alchemy(player, _Creature, action); break;
- case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_alchemy(player, _Creature, action); break;
- case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_alchemy(player, _Creature, action); break;
- }
- return true;
-}
-
-/*###
-# start menues blacksmith
-###*/
-
-bool HasWeaponSub(Player *player)
-{
- if (player->HasSpell(S_HAMMER) || player->HasSpell(S_AXE) || player->HasSpell(S_SWORD))
- return true;
- return false;
-}
-
-bool GossipHello_npc_prof_blacksmith(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- if(_Creature->isTrainer())
- player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- uint32 eCreature = _Creature->GetEntry();
- //WEAPONSMITH & ARMORSMITH
- if(player->GetBaseSkillValue(SKILL_BLACKSMITHING)>=225)
- {
- switch (eCreature)
- {
- case 11145: //Myolor Sunderfury
- case 11176: //Krathok Moltenfist
- if(!player->HasSpell(S_ARMOR) && !player->HasSpell(S_WEAPON) && player->GetReputationRank(REP_ARMOR) == REP_FRIENDLY)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ARMOR_LEARN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- if(!player->HasSpell(S_WEAPON) && !player->HasSpell(S_ARMOR) && player->GetReputationRank(REP_WEAPON) == REP_FRIENDLY)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_WEAPON_LEARN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- break;
- case 11146: //Ironus Coldsteel
- case 11178: //Borgosh Corebender
- if(player->HasSpell(S_WEAPON))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_WEAPON_UNLEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 3);
- break;
- case 5164: //Grumnus Steelshaper
- case 11177: //Okothos Ironrager
- if(player->HasSpell(S_ARMOR))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ARMOR_UNLEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
- break;
- }
- }
- //WEAPONSMITH SPEC
- if(player->HasSpell(S_WEAPON) && player->getLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING)>=250)
- {
- switch (eCreature)
- {
- case 11191: //Lilith the Lithe
- if(!HasWeaponSub(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 5);
- if(player->HasSpell(S_HAMMER))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 8);
- break;
- case 11192: //Kilram
- if(!HasWeaponSub(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_AXE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 6);
- if(player->HasSpell(S_AXE))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 9);
- break;
- case 11193: //Seril Scourgebane
- if(!HasWeaponSub(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 7);
- if(player->HasSpell(S_SWORD))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 10);
- break;
- }
- }
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-void SendActionMenu_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_TRADE:
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_ACTION_TRAIN:
- player->SEND_TRAINERLIST( _Creature->GetGUID() );
- break;
- //Learn Armor/Weapon
- case GOSSIP_ACTION_INFO_DEF + 1:
- if(!player->HasSpell(S_ARMOR))
- {
- player->CastSpell(player, S_LEARN_ARMOR, true);
- //_Creature->CastSpell(player, S_REP_ARMOR, true);
- }
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- if(!player->HasSpell(S_WEAPON))
- {
- player->CastSpell(player, S_LEARN_WEAPON, true);
- //_Creature->CastSpell(player, S_REP_WEAPON, true);
- }
- player->CLOSE_GOSSIP_MENU();
- break;
- //Unlearn Armor/Weapon
- case GOSSIP_ACTION_INFO_DEF + 3:
- if(HasWeaponSub(player))
- {
- //unknown textID (TALK_MUST_UNLEARN_WEAPON)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- //Temporary, not offilike
- _Creature->MonsterSay(TALK_MUST_UNLEARN_WEAPON,0,player->GetGUID());
- }
- else if( EquippedOk(player,S_UNLEARN_WEAPON) )
- {
- if( player->GetMoney() >= DoLowUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_WEAPON, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_WEAPON);
- player->ModifyMoney(-DoLowUnlearnCost(player));
- _Creature->CastSpell(player, S_REP_ARMOR, true);
- player->CLOSE_GOSSIP_MENU();
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- }
- else
- {
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- }
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- if( EquippedOk(player,S_UNLEARN_ARMOR) )
- {
- if( player->GetMoney() >= DoLowUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_ARMOR, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_ARMOR);
- player->ModifyMoney(-DoLowUnlearnCost(player));
- _Creature->CastSpell(player, S_REP_WEAPON, true);
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- //Learn Hammer/Axe/Sword
- case GOSSIP_ACTION_INFO_DEF + 5:
- player->CastSpell(player, S_LEARN_HAMMER, true);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- player->CastSpell(player, S_LEARN_AXE, true);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 7:
- player->CastSpell(player, S_LEARN_SWORD, true);
- player->CLOSE_GOSSIP_MENU();
- break;
- //Unlearn Hammer/Axe/Sword
- case GOSSIP_ACTION_INFO_DEF + 8:
- if( EquippedOk(player,S_UNLEARN_HAMMER) )
- {
- if( player->GetMoney() >= DoMedUnlearnCost(player))
- {
- player->CastSpell(player, S_UNLEARN_HAMMER, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_HAMMER);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 9:
- if( EquippedOk(player,S_UNLEARN_AXE) )
- {
- if( player->GetMoney() >= DoMedUnlearnCost(player))
- {
- player->CastSpell(player, S_UNLEARN_AXE, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_AXE);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 10:
- if( EquippedOk(player,S_UNLEARN_SWORD) )
- {
- if( player->GetMoney() >= DoMedUnlearnCost(player))
- {
- player->CastSpell(player, S_UNLEARN_SWORD, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_SWORD);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
-}
-
-void SendConfirmLearn_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 11191:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_CHECK, action);
- //unknown textID (TALK_HAMMER_LEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 11192:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_AXE, GOSSIP_SENDER_CHECK, action);
- //unknown textID (TALK_AXE_LEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 11193:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_CHECK, action);
- //unknown textID (TALK_SWORD_LEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-void SendConfirmUnlearn_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 11146: //Ironus Coldsteel
- case 11178: //Borgosh Corebender
- case 5164: //Grumnus Steelshaper
- case 11177: //Okothos Ironrager
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SMITH_SPEC, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ARMORORWEAPON, DoLowUnlearnCost(player),false);
- //unknown textID (TALK_UNLEARN_AXEORWEAPON)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
-
- case 11191:
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID (TALK_HAMMER_UNLEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 11192:
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID (TALK_AXE_UNLEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 11193:
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID (TALK_SWORD_UNLEARN)
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-bool GossipSelect_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(sender)
- {
- case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_blacksmith(player, _Creature, action); break;
- case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_blacksmith(player, _Creature, action); break;
- case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_blacksmith(player, _Creature, action); break;
- case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_blacksmith(player, _Creature, action); break;
- }
- return true;
-}
-
-/*bool QuestComplete_npc_prof_blacksmith( Player *player, Creature *_Creature, Quest const *_Quest )
-{
- if ( (_Quest->GetQuestId() == 5283) || (_Quest->GetQuestId() == 5301) ) //armorsmith
- _Creature->CastSpell(player, 17451, true);
-
- if ( (_Quest->GetQuestId() == 5284) || (_Quest->GetQuestId() == 5302) ) //weaponsmith
- _Creature->CastSpell(player, 17452, true);
-
- return true;
-}*/
-
-/*###
-# start menues leatherworking
-###*/
-
-bool GossipHello_npc_prof_leather(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- if(_Creature->isTrainer())
- player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- uint32 eCreature = _Creature->GetEntry();
-
- if(player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING)>=250 && player->getLevel() > 49 )
- {
- switch (eCreature)
- {
- case 7866: //Peter Galen
- case 7867: //Thorkaf Dragoneye
- if(player->HasSpell(S_DRAGON))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 1);
- break;
- case 7868: //Sarah Tanner
- case 7869: //Brumn Winterhoof
- if(player->HasSpell(S_ELEMENTAL))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 2);
- break;
- case 7870: //Caryssia Moonhunter
- case 7871: //Se'Jib
- if(player->HasSpell(S_TRIBAL))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 3);
- break;
- }
- }
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-void SendActionMenu_npc_prof_leather(Player *player, Creature *_Creature, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_TRADE:
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_ACTION_TRAIN:
- player->SEND_TRAINERLIST( _Creature->GetGUID() );
- break;
- //Unlearn Leather
- case GOSSIP_ACTION_INFO_DEF + 1:
- if( EquippedOk(player,S_UNLEARN_DRAGON) )
- {
- if( player->GetMoney() >= DoMedUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_DRAGON, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_DRAGON);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- if( EquippedOk(player,S_UNLEARN_ELEMENTAL) )
- {
- if( player->GetMoney() >= DoMedUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_ELEMENTAL, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_ELEMENTAL);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- if( EquippedOk(player,S_UNLEARN_TRIBAL) )
- {
- if(player->GetMoney() >= DoMedUnlearnCost(player))
- {
- player->CastSpell(player, S_UNLEARN_TRIBAL, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_TRIBAL);
- player->ModifyMoney(-DoMedUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
-}
-
-void SendConfirmUnlearn_npc_prof_leather(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 7866: //Peter Galen
- case 7867: //Thorkaf Dragoneye
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 7868: //Sarah Tanner
- case 7869: //Brumn Winterhoof
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 7870: //Caryssia Moonhunter
- case 7871: //Se'Jib
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-bool GossipSelect_npc_prof_leather(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(sender)
- {
- case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_leather(player, _Creature, action); break;
- case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_leather(player, _Creature, action); break;
- case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_leather(player, _Creature, action); break;
- }
- return true;
-}
-
-/*###
-# start menues tailoring
-###*/
-
-bool HasTailorSpell(Player *player)
-{
- if (player->HasSpell(S_MOONCLOTH) || player->HasSpell(S_SHADOWEAVE) || player->HasSpell(S_SPELLFIRE))
- return true;
- return false;
-}
-
-bool GossipHello_npc_prof_tailor(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- if (_Creature->isTrainer())
- player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- uint32 eCreature = _Creature->GetEntry();
- //TAILORING SPEC
- if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING)>=350 && player->getLevel() > 59)
- {
- if (player->GetQuestRewardStatus(10831) || player->GetQuestRewardStatus(10832) || player->GetQuestRewardStatus(10833))
- {
- switch (eCreature)
- {
- case 22213: //Gidge Spellweaver
- if (!HasTailorSpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 1);
- if (player->HasSpell(S_SPELLFIRE))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
- break;
- case 22208: //Nasmara Moonsong
- if (!HasTailorSpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 2);
- if (player->HasSpell(S_MOONCLOTH))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 5);
- break;
- case 22212: //Andrion Darkspinner
- if (!HasTailorSpell(player))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 3);
- if (player->HasSpell(S_SHADOWEAVE))
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 6);
- break;
- }
- }
- }
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-void SendActionMenu_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_TRADE:
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_ACTION_TRAIN:
- player->SEND_TRAINERLIST( _Creature->GetGUID() );
- break;
- //Learn Tailor
- case GOSSIP_ACTION_INFO_DEF + 1:
- if(!player->HasSpell(S_SPELLFIRE) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_SPELLFIRE, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- if(!player->HasSpell(S_MOONCLOTH) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_MOONCLOTH, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- if(!player->HasSpell(S_SHADOWEAVE) && player->GetMoney() >= DoLearnCost(player))
- {
- player->CastSpell(player, S_LEARN_SHADOWEAVE, true);
- player->ModifyMoney(-DoLearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- player->CLOSE_GOSSIP_MENU();
- break;
- //Unlearn Tailor
- case GOSSIP_ACTION_INFO_DEF + 4:
- if( EquippedOk(player,S_UNLEARN_SPELLFIRE) )
- {
- if( player->GetMoney() >= DoHighUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_SPELLFIRE, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_SPELLFIRE);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
- if( EquippedOk(player,S_UNLEARN_MOONCLOTH) )
- {
- if( player->GetMoney() >= DoHighUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_MOONCLOTH, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_MOONCLOTH);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- if( EquippedOk(player,S_UNLEARN_SHADOWEAVE) )
- {
- if( player->GetMoney() >= DoHighUnlearnCost(player) )
- {
- player->CastSpell(player, S_UNLEARN_SHADOWEAVE, true);
- ProfessionUnlearnSpells(player, S_UNLEARN_SHADOWEAVE);
- player->ModifyMoney(-DoHighUnlearnCost(player));
- } else
- player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
- } else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
-}
-
-void SendConfirmLearn_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 22213:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 22208:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 22212:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-void SendConfirmUnlearn_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
-{
- if(action)
- {
- uint32 eCreature = _Creature->GetEntry();
- switch(eCreature)
- {
- case 22213: //Gidge Spellweaver
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 22208: //Nasmara Moonsong
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- case 22212: //Andrion Darkspinner
- player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action,BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
- //unknown textID ()
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- break;
- }
- }
-}
-
-bool GossipSelect_npc_prof_tailor(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(sender)
- {
- case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_tailor(player, _Creature, action); break;
- case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_tailor(player, _Creature, action); break;
- case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_tailor(player, _Creature, action); break;
- case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_tailor(player, _Creature, action); break;
- }
- return true;
-}
-
-/*###
-# start menues for GO (engineering and leatherworking)
-###*/
-
-/*bool GOHello_go_soothsaying_for_dummies(Player *player, GameObject* _GO)
-{
- player->PlayerTalkClass->GetGossipMenu()->AddMenuItem(0,GOSSIP_LEARN_DRAGON, GOSSIP_SENDER_INFO, GOSSIP_ACTION_INFO_DEF, "", 0);
-
- player->SEND_GOSSIP_MENU(5584, _GO->GetGUID());
-
- return true;
-}*/
-
-/*###
-#
-###*/
-
-void AddSC_npc_professions()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_prof_alchemy";
- newscript->pGossipHello = &GossipHello_npc_prof_alchemy;
- newscript->pGossipSelect = &GossipSelect_npc_prof_alchemy;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_prof_blacksmith";
- newscript->pGossipHello = &GossipHello_npc_prof_blacksmith;
- newscript->pGossipSelect = &GossipSelect_npc_prof_blacksmith;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_prof_leather";
- newscript->pGossipHello = &GossipHello_npc_prof_leather;
- newscript->pGossipSelect = &GossipSelect_npc_prof_leather;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_prof_tailor";
- newscript->pGossipHello = &GossipHello_npc_prof_tailor;
- newscript->pGossipSelect = &GossipSelect_npc_prof_tailor;
- m_scripts[nrscripts++] = newscript;
-
- /*newscript = new Script;
- newscript->Name="go_soothsaying_for_dummies";
- newscript->pGOHello = &GOHello_go_soothsaying_for_dummies;
- //newscript->pGossipSelect = &GossipSelect_go_soothsaying_for_dummies;
- m_scripts[nrscripts++] = newscript;*/
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Npc_Professions
+SD%Complete: 80
+SDComment: Provides learn/unlearn/relearn-options for professions. Not supported: Unlearn engineering, re-learn engineering, re-learn leatherworking.
+SDCategory: NPCs
+EndScriptData */
+
+#include "precompiled.h"
+
+/*
+A few notes for future developement:
+- A full implementation of gossip for GO's is required. They must have the same scripting capabilities as creatures. Basically,
+there is no difference here (except that default text is chosen with `gameobject_template`.`data3` (for GO type2, different dataN for a few others)
+- It's possible blacksmithing still require some tweaks and adjustments due to the way we _have_ to use reputation.
+*/
+
+/*
+-- UPDATE `gameobject_template` SET `ScriptName` = 'go_soothsaying_for_dummies' WHERE `entry` = 177226;
+*/
+
+/*###
+# to be removed from here (->ncp_text). This is data for database projects.
+###*/
+#define TALK_MUST_UNLEARN_WEAPON "You must forget your weapon type specialty before I can help you. Go to Everlook in Winterspring and seek help there."
+
+#define TALK_HAMMER_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the hammersmith."
+#define TALK_AXE_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the axesmith."
+#define TALK_SWORD_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the swordsmith."
+
+#define TALK_HAMMER_UNLEARN "Forgetting your Hammersmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Hammersmithing to create!"
+#define TALK_AXE_UNLEARN "Forgetting your Axesmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Axesmithing to create!"
+#define TALK_SWORD_UNLEARN "Forgetting your Swordsmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Swordsmithing to create!"
+
+/*###
+# generic defines
+###*/
+
+#define GOSSIP_SENDER_LEARN 50
+#define GOSSIP_SENDER_UNLEARN 51
+#define GOSSIP_SENDER_CHECK 52
+
+/*###
+# gossip item and box texts
+###*/
+
+#define GOSSIP_LEARN_POTION "Please teach me how to become a Master of Potions, Lauranna"
+#define GOSSIP_UNLEARN_POTION "I wish to unlearn Potion Mastery"
+#define GOSSIP_LEARN_TRANSMUTE "Please teach me how to become a Master of Transmutations, Zarevhi"
+#define GOSSIP_UNLEARN_TRANSMUTE "I wish to unlearn Transmutation Mastery"
+#define GOSSIP_LEARN_ELIXIR "Please teach me how to become a Master of Elixirs, Lorokeem"
+#define GOSSIP_UNLEARN_ELIXIR "I wish to unlearn Elixir Mastery"
+
+#define BOX_UNLEARN_ALCHEMY_SPEC "Do you really want to unlearn your alchemy specialty and lose all associated recipes? \n Cost: "
+
+#define GOSSIP_WEAPON_LEARN "Please teach me how to become a Weaponsmith"
+#define GOSSIP_WEAPON_UNLEARN "I wish to unlearn the art of Weaponsmithing"
+#define GOSSIP_ARMOR_LEARN "Please teach me how to become a Armorsmith"
+#define GOSSIP_ARMOR_UNLEARN "I wish to unlearn the art of Armorsmithing"
+
+#define GOSSIP_UNLEARN_SMITH_SPEC "I wish to unlearn my blacksmith specialty"
+#define BOX_UNLEARN_ARMORORWEAPON "Do you really want to unlearn your blacksmith specialty and lose all associated recipes? \n Cost: "
+
+#define GOSSIP_LEARN_HAMMER "Please teach me how to become a Hammersmith, Lilith"
+#define GOSSIP_UNLEARN_HAMMER "I wish to unlearn Hammersmithing"
+#define GOSSIP_LEARN_AXE "Please teach me how to become a Axesmith, Kilram"
+#define GOSSIP_UNLEARN_AXE "I wish to unlearn Axesmithing"
+#define GOSSIP_LEARN_SWORD "Please teach me how to become a Swordsmith, Seril"
+#define GOSSIP_UNLEARN_SWORD "I wish to unlearn Swordsmithing"
+
+#define BOX_UNLEARN_WEAPON_SPEC "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: "
+
+#define GOSSIP_LEARN_DRAGON "I am absolutely certain that i want to learn dragonscale leatherworking"
+#define GOSSIP_UNLEARN_DRAGON "I wish to unlearn Dragonscale Leatherworking"
+#define GOSSIP_LEARN_ELEMENTAL "I am absolutely certain that i want to learn elemental leatherworking"
+#define GOSSIP_UNLEARN_ELEMENTAL "I wish to unlearn Elemental Leatherworking"
+#define GOSSIP_LEARN_TRIBAL "I am absolutely certain that i want to learn tribal leatherworking"
+#define GOSSIP_UNLEARN_TRIBAL "I wish to unlearn Tribal Leatherworking"
+
+#define BOX_UNLEARN_LEATHER_SPEC "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: "
+
+#define GOSSIP_LEARN_SPELLFIRE "Please teach me how to become a Spellcloth tailor"
+#define GOSSIP_UNLEARN_SPELLFIRE "I wish to unlearn Spellfire Tailoring"
+#define GOSSIP_LEARN_MOONCLOTH "Please teach me how to become a Mooncloth tailor"
+#define GOSSIP_UNLEARN_MOONCLOTH "I wish to unlearn Mooncloth Tailoring"
+#define GOSSIP_LEARN_SHADOWEAVE "Please teach me how to become a Shadoweave tailor"
+#define GOSSIP_UNLEARN_SHADOWEAVE "I wish to unlearn Shadoweave Tailoring"
+
+#define BOX_UNLEARN_TAILOR_SPEC "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: "
+
+#define GOSSIP_LEARN_GOBLIN "I am absolutely certain that i want to learn Goblin engineering"
+#define GOSSIP_LEARN_GNOMISH "I am absolutely certain that i want to learn Gnomish engineering"
+
+/*###
+# spells defines
+###*/
+
+#define S_WEAPON 9787
+#define S_ARMOR 9788
+#define S_HAMMER 17040
+#define S_AXE 17041
+#define S_SWORD 17039
+
+#define S_LEARN_WEAPON 9789
+#define S_LEARN_ARMOR 9790
+#define S_LEARN_HAMMER 39099
+#define S_LEARN_AXE 39098
+#define S_LEARN_SWORD 39097
+
+#define S_UNLEARN_WEAPON 36436
+#define S_UNLEARN_ARMOR 36435
+#define S_UNLEARN_HAMMER 36441
+#define S_UNLEARN_AXE 36439
+#define S_UNLEARN_SWORD 36438
+
+#define S_REP_ARMOR 17451
+#define S_REP_WEAPON 17452
+
+#define REP_ARMOR 46
+#define REP_WEAPON 289
+#define REP_HAMMER 569
+#define REP_AXE 570
+#define REP_SWORD 571
+
+#define S_DRAGON 10656
+#define S_ELEMENTAL 10658
+#define S_TRIBAL 10660
+
+#define S_LEARN_DRAGON 10657
+#define S_LEARN_ELEMENTAL 10659
+#define S_LEARN_TRIBAL 10661
+
+#define S_UNLEARN_DRAGON 36434
+#define S_UNLEARN_ELEMENTAL 36328
+#define S_UNLEARN_TRIBAL 36433
+
+#define S_GOBLIN 20222
+#define S_GNOMISH 20219
+
+#define S_LEARN_GOBLIN 20221
+#define S_LEARN_GNOMISH 20220
+
+#define S_SPELLFIRE 26797
+#define S_MOONCLOTH 26798
+#define S_SHADOWEAVE 26801
+
+#define S_LEARN_SPELLFIRE 26796
+#define S_LEARN_MOONCLOTH 26799
+#define S_LEARN_SHADOWEAVE 26800
+
+#define S_UNLEARN_SPELLFIRE 41299
+#define S_UNLEARN_MOONCLOTH 41558
+#define S_UNLEARN_SHADOWEAVE 41559
+
+#define S_TRANSMUTE 28672
+#define S_ELIXIR 28677
+#define S_POTION 28675
+
+#define S_LEARN_TRANSMUTE 28674
+#define S_LEARN_ELIXIR 28678
+#define S_LEARN_POTION 28676
+
+#define S_UNLEARN_TRANSMUTE 41565
+#define S_UNLEARN_ELIXIR 41564
+#define S_UNLEARN_POTION 41563
+
+/*###
+# formulas to calculate unlearning cost
+###*/
+
+int32 DoLearnCost(Player *player) //tailor, alchemy
+{
+ return 200000;
+}
+
+int32 DoHighUnlearnCost(Player *player) //tailor, alchemy
+{
+ return 1500000;
+}
+
+int32 DoMedUnlearnCost(Player *player) //blacksmith, leatherwork
+{
+ uint32 level = player->getLevel();
+ if(level < 51)
+ return 250000;
+ else if (level < 66)
+ return 500000;
+ else
+ return 1000000;
+}
+
+int32 DoLowUnlearnCost(Player *player) //blacksmith
+{
+ uint32 level = player->getLevel();
+ if (level < 66)
+ return 50000;
+ else
+ return 100000;
+}
+
+/*###
+# unlearning related profession spells
+###*/
+
+bool EquippedOk(Player* player, uint32 spellId)
+{
+ SpellEntry const* spell = GetSpellStore()->LookupEntry(spellId);
+
+ if( !spell )
+ return false;
+
+ for(int i=0; i<3; i++)
+ {
+ uint32 reqSpell = spell->EffectTriggerSpell[i];
+ if( !reqSpell )
+ continue;
+
+ Item* pItem;
+ for(int j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; j++)
+ {
+ pItem = player->GetItemByPos( INVENTORY_SLOT_BAG_0, j );
+ if( pItem )
+ if( pItem->GetProto()->RequiredSpell == reqSpell )
+ {
+ //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
+ debug_log("SD2: player attempt to unlearn spell %u, but item %u is equipped.",reqSpell,pItem->GetProto()->ItemId);
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+void ProfessionUnlearnSpells(Player *player, uint32 type)
+{
+ switch (type)
+ {
+ case 36436: // S_UNLEARN_WEAPON
+ player->removeSpell(36125); // Light Earthforged Blade
+ player->removeSpell(36128); // Light Emberforged Hammer
+ player->removeSpell(36126); // Light Skyforged Axe
+ break;
+ case 36435: // S_UNLEARN_ARMOR
+ player->removeSpell(36122); // Earthforged Leggings
+ player->removeSpell(36129); // Heavy Earthforged Breastplate
+ player->removeSpell(36130); // Stormforged Hauberk
+ player->removeSpell(34533); // Breastplate of Kings
+ player->removeSpell(34529); // Nether Chain Shirt
+ player->removeSpell(34534); // Bulwark of Kings
+ player->removeSpell(36257); // Bulwark of the Ancient Kings
+ player->removeSpell(36256); // Embrace of the Twisting Nether
+ player->removeSpell(34530); // Twisting Nether Chain Shirt
+ player->removeSpell(36124); // Windforged Leggings
+ break;
+ case 36441: // S_UNLEARN_HAMMER
+ player->removeSpell(36262); // Dragonstrike
+ player->removeSpell(34546); // Dragonmaw
+ player->removeSpell(34545); // Drakefist Hammer
+ player->removeSpell(36136); // Lavaforged Warhammer
+ player->removeSpell(34547); // Thunder
+ player->removeSpell(34567); // Deep Thunder
+ player->removeSpell(36263); // Stormherald
+ player->removeSpell(36137); // Great Earthforged Hammer
+ break;
+ case 36439: // S_UNLEARN_AXE
+ player->removeSpell(36260); // Wicked Edge of the Planes
+ player->removeSpell(34562); // Black Planar Edge
+ player->removeSpell(34541); // The Planar Edge
+ player->removeSpell(36134); // Stormforged Axe
+ player->removeSpell(36135); // Skyforged Great Axe
+ player->removeSpell(36261); // Bloodmoon
+ player->removeSpell(34543); // Lunar Crescent
+ player->removeSpell(34544); // Mooncleaver
+ break;
+ case 36438: // S_UNLEARN_SWORD
+ player->removeSpell(36258); // Blazefury
+ player->removeSpell(34537); // Blazeguard
+ player->removeSpell(34535); // Fireguard
+ player->removeSpell(36131); // Windforged Rapier
+ player->removeSpell(36133); // Stoneforged Claymore
+ player->removeSpell(34538); // Lionheart Blade
+ player->removeSpell(34540); // Lionheart Champion
+ player->removeSpell(36259); // Lionheart Executioner
+ break;
+ case 36434: // S_UNLEARN_DRAGON
+ player->removeSpell(36076); // Dragonstrike Leggings
+ player->removeSpell(36079); // Golden Dragonstrike Breastplate
+ player->removeSpell(35576); // Ebon Netherscale Belt
+ player->removeSpell(35577); // Ebon Netherscale Bracers
+ player->removeSpell(35575); // Ebon Netherscale Breastplate
+ player->removeSpell(35582); // Netherstrike Belt
+ player->removeSpell(35584); // Netherstrike Bracers
+ player->removeSpell(35580); // Netherstrike Breastplate
+ break;
+ case 36328: // S_UNLEARN_ELEMENTAL
+ player->removeSpell(36074); // Blackstorm Leggings
+ player->removeSpell(36077); // Primalstorm Breastplate
+ player->removeSpell(35590); // Primalstrike Belt
+ player->removeSpell(35591); // Primalstrike Bracers
+ player->removeSpell(35589); // Primalstrike Vest
+ break;
+ case 36433: // S_UNLEARN_TRIBAL
+ player->removeSpell(35585); // Windhawk Hauberk
+ player->removeSpell(35587); // Windhawk Belt
+ player->removeSpell(35588); // Windhawk Bracers
+ player->removeSpell(36075); // Wildfeather Leggings
+ player->removeSpell(36078); // Living Crystal Breastplate
+ break;
+ case 41299: // S_UNLEARN_SPELLFIRE
+ player->removeSpell(26752); // Spellfire Belt
+ player->removeSpell(26753); // Spellfire Gloves
+ player->removeSpell(26754); // Spellfire Robe
+ break;
+ case 41558: // S_UNLEARN_MOONCLOTH
+ player->removeSpell(26760); // Primal Mooncloth Belt
+ player->removeSpell(26761); // Primal Mooncloth Shoulders
+ player->removeSpell(26762); // Primal Mooncloth Robe
+ break;
+ case 41559: // S_UNLEARN_SHADOWEAVE
+ player->removeSpell(26756); // Frozen Shadoweave Shoulders
+ player->removeSpell(26757); // Frozen Shadoweave Boots
+ player->removeSpell(26758); // Frozen Shadoweave Robe
+ break;
+ }
+}
+
+/*###
+# start menues alchemy
+###*/
+
+bool HasAlchemySpell(Player *player)
+{
+ if(player->HasSpell(S_TRANSMUTE) || player->HasSpell(S_ELIXIR) || player->HasSpell(S_POTION))
+ return true;
+ return false;
+}
+
+bool GossipHello_npc_prof_alchemy(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ if(_Creature->isTrainer())
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
+
+ uint32 eCreature = _Creature->GetEntry();
+
+ if (player->HasSkill(SKILL_ALCHEMY) && player->GetBaseSkillValue(SKILL_ALCHEMY)>=350 && player->getLevel() > 67)
+ {
+ if (player->GetQuestRewardStatus(10899) || player->GetQuestRewardStatus(10902) || player->GetQuestRewardStatus(10897))
+ {
+ switch (eCreature)
+ {
+ case 22427: //Zarevhi
+ if (!HasAlchemySpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 1);
+ if (player->HasSpell(S_TRANSMUTE))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
+ break;
+ case 19052: //Lorokeem
+ if (!HasAlchemySpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 2);
+ if (player->HasSpell(S_ELIXIR))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 5);
+ break;
+ case 17909: //Lauranna Thar'well
+ if (!HasAlchemySpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_POTION, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 3);
+ if (player->HasSpell(S_POTION))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 6);
+ break;
+ }
+ }
+ }
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+void SendActionMenu_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_TRADE:
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_ACTION_TRAIN:
+ player->SEND_TRAINERLIST( _Creature->GetGUID() );
+ break;
+ //Learn Alchemy
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if(!player->HasSpell(S_TRANSMUTE) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_TRANSMUTE, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ if(!player->HasSpell(S_ELIXIR) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_ELIXIR, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ if(!player->HasSpell(S_POTION) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_POTION, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ //Unlearn Alchemy
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ if(player->GetMoney() >= DoHighUnlearnCost(player))
+ {
+ _Creature->CastSpell(player, S_UNLEARN_TRANSMUTE, true);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5:
+ if(player->GetMoney() >= DoHighUnlearnCost(player))
+ {
+ _Creature->CastSpell(player, S_UNLEARN_ELIXIR, true);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6:
+ if(player->GetMoney() >= DoHighUnlearnCost(player))
+ {
+ _Creature->CastSpell(player, S_UNLEARN_POTION, true);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+}
+
+void SendConfirmLearn_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 22427:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 19052:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 17909:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_POTION, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+void SendConfirmUnlearn_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 22427: //Zarevhi
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 19052: //Lorokeem
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 17909: //Lauranna Thar'well
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+bool GossipSelect_npc_prof_alchemy(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_alchemy(player, _Creature, action); break;
+ case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_alchemy(player, _Creature, action); break;
+ case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_alchemy(player, _Creature, action); break;
+ case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_alchemy(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*###
+# start menues blacksmith
+###*/
+
+bool HasWeaponSub(Player *player)
+{
+ if (player->HasSpell(S_HAMMER) || player->HasSpell(S_AXE) || player->HasSpell(S_SWORD))
+ return true;
+ return false;
+}
+
+bool GossipHello_npc_prof_blacksmith(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ if(_Creature->isTrainer())
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
+
+ uint32 eCreature = _Creature->GetEntry();
+ //WEAPONSMITH & ARMORSMITH
+ if(player->GetBaseSkillValue(SKILL_BLACKSMITHING)>=225)
+ {
+ switch (eCreature)
+ {
+ case 11145: //Myolor Sunderfury
+ case 11176: //Krathok Moltenfist
+ if(!player->HasSpell(S_ARMOR) && !player->HasSpell(S_WEAPON) && player->GetReputationRank(REP_ARMOR) == REP_FRIENDLY)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ARMOR_LEARN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ if(!player->HasSpell(S_WEAPON) && !player->HasSpell(S_ARMOR) && player->GetReputationRank(REP_WEAPON) == REP_FRIENDLY)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_WEAPON_LEARN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ break;
+ case 11146: //Ironus Coldsteel
+ case 11178: //Borgosh Corebender
+ if(player->HasSpell(S_WEAPON))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_WEAPON_UNLEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 3);
+ break;
+ case 5164: //Grumnus Steelshaper
+ case 11177: //Okothos Ironrager
+ if(player->HasSpell(S_ARMOR))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ARMOR_UNLEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
+ break;
+ }
+ }
+ //WEAPONSMITH SPEC
+ if(player->HasSpell(S_WEAPON) && player->getLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING)>=250)
+ {
+ switch (eCreature)
+ {
+ case 11191: //Lilith the Lithe
+ if(!HasWeaponSub(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 5);
+ if(player->HasSpell(S_HAMMER))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 8);
+ break;
+ case 11192: //Kilram
+ if(!HasWeaponSub(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_AXE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 6);
+ if(player->HasSpell(S_AXE))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 9);
+ break;
+ case 11193: //Seril Scourgebane
+ if(!HasWeaponSub(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 7);
+ if(player->HasSpell(S_SWORD))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 10);
+ break;
+ }
+ }
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+void SendActionMenu_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_TRADE:
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_ACTION_TRAIN:
+ player->SEND_TRAINERLIST( _Creature->GetGUID() );
+ break;
+ //Learn Armor/Weapon
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if(!player->HasSpell(S_ARMOR))
+ {
+ player->CastSpell(player, S_LEARN_ARMOR, true);
+ //_Creature->CastSpell(player, S_REP_ARMOR, true);
+ }
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ if(!player->HasSpell(S_WEAPON))
+ {
+ player->CastSpell(player, S_LEARN_WEAPON, true);
+ //_Creature->CastSpell(player, S_REP_WEAPON, true);
+ }
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ //Unlearn Armor/Weapon
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ if(HasWeaponSub(player))
+ {
+ //unknown textID (TALK_MUST_UNLEARN_WEAPON)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ //Temporary, not offilike
+ _Creature->MonsterSay(TALK_MUST_UNLEARN_WEAPON,0,player->GetGUID());
+ }
+ else if( EquippedOk(player,S_UNLEARN_WEAPON) )
+ {
+ if( player->GetMoney() >= DoLowUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_WEAPON, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_WEAPON);
+ player->ModifyMoney(-DoLowUnlearnCost(player));
+ _Creature->CastSpell(player, S_REP_ARMOR, true);
+ player->CLOSE_GOSSIP_MENU();
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ }
+ else
+ {
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ }
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ if( EquippedOk(player,S_UNLEARN_ARMOR) )
+ {
+ if( player->GetMoney() >= DoLowUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_ARMOR, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_ARMOR);
+ player->ModifyMoney(-DoLowUnlearnCost(player));
+ _Creature->CastSpell(player, S_REP_WEAPON, true);
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ //Learn Hammer/Axe/Sword
+ case GOSSIP_ACTION_INFO_DEF + 5:
+ player->CastSpell(player, S_LEARN_HAMMER, true);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6:
+ player->CastSpell(player, S_LEARN_AXE, true);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 7:
+ player->CastSpell(player, S_LEARN_SWORD, true);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ //Unlearn Hammer/Axe/Sword
+ case GOSSIP_ACTION_INFO_DEF + 8:
+ if( EquippedOk(player,S_UNLEARN_HAMMER) )
+ {
+ if( player->GetMoney() >= DoMedUnlearnCost(player))
+ {
+ player->CastSpell(player, S_UNLEARN_HAMMER, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_HAMMER);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 9:
+ if( EquippedOk(player,S_UNLEARN_AXE) )
+ {
+ if( player->GetMoney() >= DoMedUnlearnCost(player))
+ {
+ player->CastSpell(player, S_UNLEARN_AXE, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_AXE);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 10:
+ if( EquippedOk(player,S_UNLEARN_SWORD) )
+ {
+ if( player->GetMoney() >= DoMedUnlearnCost(player))
+ {
+ player->CastSpell(player, S_UNLEARN_SWORD, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_SWORD);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+}
+
+void SendConfirmLearn_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 11191:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_CHECK, action);
+ //unknown textID (TALK_HAMMER_LEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 11192:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_AXE, GOSSIP_SENDER_CHECK, action);
+ //unknown textID (TALK_AXE_LEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 11193:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_CHECK, action);
+ //unknown textID (TALK_SWORD_LEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+void SendConfirmUnlearn_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 11146: //Ironus Coldsteel
+ case 11178: //Borgosh Corebender
+ case 5164: //Grumnus Steelshaper
+ case 11177: //Okothos Ironrager
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SMITH_SPEC, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ARMORORWEAPON, DoLowUnlearnCost(player),false);
+ //unknown textID (TALK_UNLEARN_AXEORWEAPON)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+
+ case 11191:
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID (TALK_HAMMER_UNLEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 11192:
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID (TALK_AXE_UNLEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 11193:
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID (TALK_SWORD_UNLEARN)
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+bool GossipSelect_npc_prof_blacksmith(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_blacksmith(player, _Creature, action); break;
+ case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_blacksmith(player, _Creature, action); break;
+ case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_blacksmith(player, _Creature, action); break;
+ case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_blacksmith(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*bool QuestComplete_npc_prof_blacksmith( Player *player, Creature *_Creature, Quest const *_Quest )
+{
+ if ( (_Quest->GetQuestId() == 5283) || (_Quest->GetQuestId() == 5301) ) //armorsmith
+ _Creature->CastSpell(player, 17451, true);
+
+ if ( (_Quest->GetQuestId() == 5284) || (_Quest->GetQuestId() == 5302) ) //weaponsmith
+ _Creature->CastSpell(player, 17452, true);
+
+ return true;
+}*/
+
+/*###
+# start menues leatherworking
+###*/
+
+bool GossipHello_npc_prof_leather(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ if(_Creature->isTrainer())
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
+
+ uint32 eCreature = _Creature->GetEntry();
+
+ if(player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING)>=250 && player->getLevel() > 49 )
+ {
+ switch (eCreature)
+ {
+ case 7866: //Peter Galen
+ case 7867: //Thorkaf Dragoneye
+ if(player->HasSpell(S_DRAGON))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 1);
+ break;
+ case 7868: //Sarah Tanner
+ case 7869: //Brumn Winterhoof
+ if(player->HasSpell(S_ELEMENTAL))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 2);
+ break;
+ case 7870: //Caryssia Moonhunter
+ case 7871: //Se'Jib
+ if(player->HasSpell(S_TRIBAL))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 3);
+ break;
+ }
+ }
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+void SendActionMenu_npc_prof_leather(Player *player, Creature *_Creature, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_TRADE:
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_ACTION_TRAIN:
+ player->SEND_TRAINERLIST( _Creature->GetGUID() );
+ break;
+ //Unlearn Leather
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if( EquippedOk(player,S_UNLEARN_DRAGON) )
+ {
+ if( player->GetMoney() >= DoMedUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_DRAGON, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_DRAGON);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ if( EquippedOk(player,S_UNLEARN_ELEMENTAL) )
+ {
+ if( player->GetMoney() >= DoMedUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_ELEMENTAL, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_ELEMENTAL);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ if( EquippedOk(player,S_UNLEARN_TRIBAL) )
+ {
+ if(player->GetMoney() >= DoMedUnlearnCost(player))
+ {
+ player->CastSpell(player, S_UNLEARN_TRIBAL, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_TRIBAL);
+ player->ModifyMoney(-DoMedUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+}
+
+void SendConfirmUnlearn_npc_prof_leather(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 7866: //Peter Galen
+ case 7867: //Thorkaf Dragoneye
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 7868: //Sarah Tanner
+ case 7869: //Brumn Winterhoof
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 7870: //Caryssia Moonhunter
+ case 7871: //Se'Jib
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+bool GossipSelect_npc_prof_leather(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_leather(player, _Creature, action); break;
+ case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_leather(player, _Creature, action); break;
+ case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_leather(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*###
+# start menues tailoring
+###*/
+
+bool HasTailorSpell(Player *player)
+{
+ if (player->HasSpell(S_MOONCLOTH) || player->HasSpell(S_SHADOWEAVE) || player->HasSpell(S_SPELLFIRE))
+ return true;
+ return false;
+}
+
+bool GossipHello_npc_prof_tailor(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM(1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ if (_Creature->isTrainer())
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
+
+ uint32 eCreature = _Creature->GetEntry();
+ //TAILORING SPEC
+ if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING)>=350 && player->getLevel() > 59)
+ {
+ if (player->GetQuestRewardStatus(10831) || player->GetQuestRewardStatus(10832) || player->GetQuestRewardStatus(10833))
+ {
+ switch (eCreature)
+ {
+ case 22213: //Gidge Spellweaver
+ if (!HasTailorSpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 1);
+ if (player->HasSpell(S_SPELLFIRE))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4);
+ break;
+ case 22208: //Nasmara Moonsong
+ if (!HasTailorSpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 2);
+ if (player->HasSpell(S_MOONCLOTH))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 5);
+ break;
+ case 22212: //Andrion Darkspinner
+ if (!HasTailorSpell(player))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 3);
+ if (player->HasSpell(S_SHADOWEAVE))
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 6);
+ break;
+ }
+ }
+ }
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+void SendActionMenu_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_TRADE:
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_ACTION_TRAIN:
+ player->SEND_TRAINERLIST( _Creature->GetGUID() );
+ break;
+ //Learn Tailor
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if(!player->HasSpell(S_SPELLFIRE) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_SPELLFIRE, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ if(!player->HasSpell(S_MOONCLOTH) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_MOONCLOTH, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ if(!player->HasSpell(S_SHADOWEAVE) && player->GetMoney() >= DoLearnCost(player))
+ {
+ player->CastSpell(player, S_LEARN_SHADOWEAVE, true);
+ player->ModifyMoney(-DoLearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ //Unlearn Tailor
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ if( EquippedOk(player,S_UNLEARN_SPELLFIRE) )
+ {
+ if( player->GetMoney() >= DoHighUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_SPELLFIRE, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_SPELLFIRE);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5:
+ if( EquippedOk(player,S_UNLEARN_MOONCLOTH) )
+ {
+ if( player->GetMoney() >= DoHighUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_MOONCLOTH, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_MOONCLOTH);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6:
+ if( EquippedOk(player,S_UNLEARN_SHADOWEAVE) )
+ {
+ if( player->GetMoney() >= DoHighUnlearnCost(player) )
+ {
+ player->CastSpell(player, S_UNLEARN_SHADOWEAVE, true);
+ ProfessionUnlearnSpells(player, S_UNLEARN_SHADOWEAVE);
+ player->ModifyMoney(-DoHighUnlearnCost(player));
+ } else
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, _Creature, 0, 0);
+ } else
+ player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+}
+
+void SendConfirmLearn_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 22213:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 22208:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 22212:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+void SendConfirmUnlearn_npc_prof_tailor(Player *player, Creature *_Creature, uint32 action)
+{
+ if(action)
+ {
+ uint32 eCreature = _Creature->GetEntry();
+ switch(eCreature)
+ {
+ case 22213: //Gidge Spellweaver
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 22208: //Nasmara Moonsong
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ case 22212: //Andrion Darkspinner
+ player->ADD_GOSSIP_ITEM_EXTENDED( 0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action,BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player),false);
+ //unknown textID ()
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ break;
+ }
+ }
+}
+
+bool GossipSelect_npc_prof_tailor(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(sender)
+ {
+ case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_tailor(player, _Creature, action); break;
+ case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_tailor(player, _Creature, action); break;
+ case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_tailor(player, _Creature, action); break;
+ case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_tailor(player, _Creature, action); break;
+ }
+ return true;
+}
+
+/*###
+# start menues for GO (engineering and leatherworking)
+###*/
+
+/*bool GOHello_go_soothsaying_for_dummies(Player *player, GameObject* _GO)
+{
+ player->PlayerTalkClass->GetGossipMenu()->AddMenuItem(0,GOSSIP_LEARN_DRAGON, GOSSIP_SENDER_INFO, GOSSIP_ACTION_INFO_DEF, "", 0);
+
+ player->SEND_GOSSIP_MENU(5584, _GO->GetGUID());
+
+ return true;
+}*/
+
+/*###
+#
+###*/
+
+void AddSC_npc_professions()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_prof_alchemy";
+ newscript->pGossipHello = &GossipHello_npc_prof_alchemy;
+ newscript->pGossipSelect = &GossipSelect_npc_prof_alchemy;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_prof_blacksmith";
+ newscript->pGossipHello = &GossipHello_npc_prof_blacksmith;
+ newscript->pGossipSelect = &GossipSelect_npc_prof_blacksmith;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_prof_leather";
+ newscript->pGossipHello = &GossipHello_npc_prof_leather;
+ newscript->pGossipSelect = &GossipSelect_npc_prof_leather;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_prof_tailor";
+ newscript->pGossipHello = &GossipHello_npc_prof_tailor;
+ newscript->pGossipSelect = &GossipSelect_npc_prof_tailor;
+ m_scripts[nrscripts++] = newscript;
+
+ /*newscript = new Script;
+ newscript->Name="go_soothsaying_for_dummies";
+ newscript->pGOHello = &GOHello_go_soothsaying_for_dummies;
+ //newscript->pGossipSelect = &GossipSelect_go_soothsaying_for_dummies;
+ m_scripts[nrscripts++] = newscript;*/
+}
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp
index e97bb4b52ef..3e1cb0a9165 100644
--- a/src/bindings/scripts/scripts/npc/npcs_special.cpp
+++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp
@@ -1,878 +1,878 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Npcs_Special
-SD%Complete: 100
-SDComment: To be used for special NPCs that are located globally. Support for quest 3861 (Cluck!), 6622 and 6624 (Triage)
-SDCategory: NPCs
-EndScriptData
-*/
-
-/* ContentData
-npc_chicken_cluck 100% support for quest 3861 (Cluck!)
-npc_dancing_flames 100% midsummer event NPC
-npc_guardian 100% guardianAI used to prevent players from accessing off-limits areas. Not in use by SD2
-npc_injured_patient 100% patients for triage-quests (6622 and 6624)
-npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage)
-npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy
-npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681
-npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given
-EndContentData */
-
-#include "precompiled.h"
-
-/*########
-# npc_chicken_cluck
-#########*/
-
-#define QUEST_CLUCK 3861
-#define EMOTE_A_HELLO "looks up at you quizzically. Maybe you should inspect it?"
-#define EMOTE_H_HELLO "looks at you unexpectadly."
-#define CLUCK_TEXT2 "starts pecking at the feed."
-#define FACTION_FRIENDLY 84
-#define FACTION_CHICKEN 31
-
-struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI
-{
- npc_chicken_cluckAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ResetFlagTimer;
-
- void Reset()
- {
- ResetFlagTimer = 120000;
-
- m_creature->setFaction(FACTION_CHICKEN);
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- // Reset flags after a certain time has passed so that the next player has to start the 'event' again
- if(m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
- {
- if(ResetFlagTimer < diff)
- EnterEvadeMode();
- else ResetFlagTimer -= diff;
- }
-
- if(m_creature->SelectHostilTarget() && m_creature->getVictim())
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_npc_chicken_cluck(Creature *_Creature)
-{
- return new npc_chicken_cluckAI(_Creature);
-}
-
-bool ReceiveEmote_npc_chicken_cluck( Player *player, Creature *_Creature, uint32 emote )
-{
- if( emote == TEXTEMOTE_CHICKEN )
- {
- if( player->GetTeam() == ALLIANCE )
- {
- if( rand()%30 == 1 )
- {
- if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE )
- {
- _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- _Creature->setFaction(FACTION_FRIENDLY);
- _Creature->MonsterTextEmote(EMOTE_A_HELLO, 0);
- }
- }
- } else
- _Creature->MonsterTextEmote(EMOTE_H_HELLO,0);
- }
- if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE )
- if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
- {
- _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- _Creature->setFaction(FACTION_FRIENDLY);
- _Creature->MonsterTextEmote(CLUCK_TEXT2, 0);
- }
-
- return true;
-}
-
-bool QuestAccept_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest )
-{
- if(_Quest->GetQuestId() == QUEST_CLUCK)
- ((npc_chicken_cluckAI*)_Creature->AI())->Reset();
-
- return true;
-}
-
-bool QuestComplete_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest)
-{
- if(_Quest->GetQuestId() == QUEST_CLUCK)
- ((npc_chicken_cluckAI*)_Creature->AI())->Reset();
-
- return true;
-}
-
-/*######
-## npc_dancing_flames
-######*/
-
-bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *_Creature, uint32 emote )
-{
- if( emote == TEXTEMOTE_DANCE )
- _Creature->CastSpell(player,47057,false);
-
- return true;
-}
-
-/*######
-## Triage quest
-######*/
-
-#define SAY_DOC1 "I'm saved! Thank you, doctor!"
-#define SAY_DOC2 "HOORAY! I AM SAVED!"
-#define SAY_DOC3 "Sweet, sweet embrace... take me..."
-
-struct Location
-{
- float x, y, z, o;
-};
-
-#define DOCTOR_ALLIANCE 12939
-
-static Location AllianceCoords[]=
-{
- { // Top-far-right bunk as seen from entrance
- -3757.38, -4533.05, 14.16, 3.62
- },
- { // Top-far-left bunk
- -3754.36, -4539.13, 14.16, 5.13
- },
- { // Far-right bunk
- -3749.54, -4540.25, 14.28, 3.34
- },
- { // Right bunk near entrance
- -3742.10, -4536.85, 14.28, 3.64
- },
- { // Far-left bunk
- -3755.89, -4529.07, 14.05, 0.57
- },
- { // Mid-left bunk
- -3749.51, -4527.08, 14.07, 5.26
- },
- { // Left bunk near entrance
- -3746.37, -4525.35, 14.16, 5.22
- },
-};
-
-#define ALLIANCE_COORDS 7
-
-//alliance run to where
-#define A_RUNTOX -3742.96
-#define A_RUNTOY -4531.52
-#define A_RUNTOZ 11.91
-
-#define DOCTOR_HORDE 12920
-
-static Location HordeCoords[]=
-{
- { // Left, Behind
- -1013.75, -3492.59, 62.62, 4.34
- },
- { // Right, Behind
- -1017.72, -3490.92, 62.62, 4.34
- },
- { // Left, Mid
- -1015.77, -3497.15, 62.82, 4.34
- },
- { // Right, Mid
- -1019.51, -3495.49, 62.82, 4.34
- },
- { // Left, front
- -1017.25, -3500.85, 62.98, 4.34
- },
- { // Right, Front
- -1020.95, -3499.21, 62.98, 4.34
- }
-};
-
-#define HORDE_COORDS 6
-
-//horde run to where
-#define H_RUNTOX -1016.44
-#define H_RUNTOY -3508.48
-#define H_RUNTOZ 62.96
-
-const uint32 AllianceSoldierId[3] =
-{
- 12938, // 12938 Injured Alliance Soldier
- 12936, // 12936 Badly injured Alliance Soldier
- 12937 // 12937 Critically injured Alliance Soldier
-};
-
-const uint32 HordeSoldierId[3] =
-{
- 12923, //12923 Injured Soldier
- 12924, //12924 Badly injured Soldier
- 12925 //12925 Critically injured Soldier
-};
-
-/*######
-## npc_doctor (handles both Gustaf Vanhowzen and Gregory Victor)
-######*/
-
-struct TRINITY_DLL_DECL npc_doctorAI : public ScriptedAI
-{
- uint64 Playerguid;
-
- uint32 SummonPatient_Timer;
- uint32 SummonPatientCount;
- uint32 PatientDiedCount;
- uint32 PatientSavedCount;
-
- bool Event;
-
- std::list Patients;
- std::vector Coordinates;
-
- npc_doctorAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset(){}
-
- void BeginEvent(Player* player);
- void PatientDied(Location* Point);
- void PatientSaved(Creature* soldier, Player* player, Location* Point);
- void UpdateAI(const uint32 diff);
-
- void Aggro(Unit* who){}
-};
-
-/*#####
-## npc_injured_patient (handles all the patients, no matter Horde or Alliance)
-#####*/
-
-struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
-{
- npc_injured_patientAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 Doctorguid;
-
- Location* Coord;
-
- void Reset()
- {
- Doctorguid = 0;
-
- Coord = NULL;
- //no select
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //no regen health
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //to make them lay with face down
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD);
-
- uint32 mobId = m_creature->GetEntry();
-
- switch (mobId)
- { //lower max health
- case 12923:
- case 12938: //Injured Soldier
- m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.75));
- break;
- case 12924:
- case 12936: //Badly injured Soldier
- m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.50));
- break;
- case 12925:
- case 12937: //Critically injured Soldier
- m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.25));
- break;
- }
- }
-
- void Aggro(Unit* who){}
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == 20804)
- {
- if( (((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
- {
- if(Doctorguid)
- {
- Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid));
- if(Doctor)
- ((npc_doctorAI*)Doctor->AI())->PatientSaved(m_creature, ((Player*)caster), Coord);
- }
- }
- //make not selectable
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //regen health
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //stand up
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
- DoSay(SAY_DOC1,LANG_UNIVERSAL,NULL);
-
- uint32 mobId = m_creature->GetEntry();
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- switch (mobId)
- {
- case 12923:
- case 12924:
- case 12925:
- m_creature->GetMotionMaster()->MovePoint(0, H_RUNTOX, H_RUNTOY, H_RUNTOZ);
- break;
- case 12936:
- case 12937:
- case 12938:
- m_creature->GetMotionMaster()->MovePoint(0, A_RUNTOX, A_RUNTOY, A_RUNTOZ);
- break;
- }
- }
- return;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (m_creature->isAlive() && m_creature->GetHealth() > 6)
- { //lower HP on every world tick makes it a useful counter, not officlone though
- m_creature->SetHealth(uint32(m_creature->GetHealth()-5) );
- }
-
- if (m_creature->isAlive() && m_creature->GetHealth() <= 6)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->setDeathState(JUST_DIED);
- m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, 32);
-
- if(Doctorguid)
- {
- Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid));
- if(Doctor)
- ((npc_doctorAI*)Doctor->AI())->PatientDied(Coord);
- }
- }
- }
-};
-
-CreatureAI* GetAI_npc_injured_patient(Creature *_Creature)
-{
- return new npc_injured_patientAI (_Creature);
-}
-
-/*
-npc_doctor (continue)
-*/
-
-void npc_doctorAI::BeginEvent(Player* player)
-{
- Playerguid = player->GetGUID();
-
- SummonPatient_Timer = 10000;
- SummonPatientCount = 0;
- PatientDiedCount = 0;
- PatientSavedCount = 0;
-
- switch(m_creature->GetEntry())
- {
- case DOCTOR_ALLIANCE:
- for(uint8 i = 0; i < ALLIANCE_COORDS; ++i)
- Coordinates.push_back(&AllianceCoords[i]);
- break;
-
- case DOCTOR_HORDE:
- for(uint8 i = 0; i < HORDE_COORDS; ++i)
- Coordinates.push_back(&HordeCoords[i]);
- break;
- }
-
- Event = true;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-}
-
-void npc_doctorAI::PatientDied(Location* Point)
-{
- Player* player = ((Player*)Unit::GetUnit((*m_creature), Playerguid));
- if(player && ((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)))
- {
- PatientDiedCount++;
- if (PatientDiedCount > 5 && Event)
- {
- if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
- player->FailQuest(6624);
- else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
- player->FailQuest(6622);
-
- Event = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- Coordinates.push_back(Point);
- }
-}
-
-void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Point)
-{
- if(player && Playerguid == player->GetGUID())
- {
- if((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
- {
- PatientSavedCount++;
- if(PatientSavedCount == 15)
- {
- if(!Patients.empty())
- {
- std::list::iterator itr;
- for(itr = Patients.begin(); itr != Patients.end(); ++itr)
- {
- Creature* Patient = ((Creature*)Unit::GetUnit((*m_creature), *itr));
- if( Patient )
- Patient->setDeathState(JUST_DIED);
- }
- }
-
- if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(6624);
- else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(6622);
-
- Event = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- Coordinates.push_back(Point);
- }
- }
-}
-
-void npc_doctorAI::UpdateAI(const uint32 diff)
-{
- if(Event && SummonPatientCount >= 20)
- {
- Event = false;
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- if(Event)
- if(SummonPatient_Timer < diff)
- {
- Creature* Patient = NULL;
- Location* Point = NULL;
-
- if(Coordinates.empty())
- return;
-
- std::vector::iterator itr = Coordinates.begin()+rand()%Coordinates.size();
- uint32 patientEntry = 0;
-
- switch(m_creature->GetEntry())
- {
- case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break;
- case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break;
- default:
- error_log("SD2: Invalid entry for Triage doctor. Please check your database");
- return;
- }
-
- Point = *itr;
-
- Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
-
- if(Patient)
- {
- Patients.push_back(Patient->GetGUID());
- ((npc_injured_patientAI*)Patient->AI())->Doctorguid = m_creature->GetGUID();
- if(Point)
- ((npc_injured_patientAI*)Patient->AI())->Coord = Point;
- Coordinates.erase(itr);
- }
- SummonPatient_Timer = 10000;
- SummonPatientCount++;
- }else SummonPatient_Timer -= diff;
-}
-
-bool QuestAccept_npc_doctor(Player *player, Creature *creature, Quest const *quest )
-{
- if((quest->GetQuestId() == 6624) || (quest->GetQuestId() == 6622))
- ((npc_doctorAI*)creature->AI())->BeginEvent(player);
-
- return true;
-}
-
-CreatureAI* GetAI_npc_doctor(Creature *_Creature)
-{
- return new npc_doctorAI (_Creature);
-}
-
-/*######
-## npc_guardian
-######*/
-
-#define SPELL_DEATHTOUCH 5
-#define SAY_AGGRO "This area is closed!"
-
-struct TRINITY_DLL_DECL npc_guardianAI : public ScriptedAI
-{
- npc_guardianAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (m_creature->isAttackReady())
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_DEATHTOUCH, true);
- m_creature->resetAttackTimer();
- }
- }
-};
-
-CreatureAI* GetAI_npc_guardian(Creature *_Creature)
-{
- return new npc_guardianAI (_Creature);
-}
-
-/*######
-## npc_mount_vendor
-######*/
-
-bool GossipHello_npc_mount_vendor(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- bool canBuy;
- canBuy = false;
- uint32 vendor = _Creature->GetEntry();
- uint8 race = player->getRace();
-
- switch (vendor)
- {
- case 384: //Katie Hunter
- case 1460: //Unger Statforth
- case 2357: //Merideth Carlson
- case 4885: //Gregor MacVince
- if (player->GetReputationRank(72) != REP_EXALTED && race != RACE_HUMAN)
- player->SEND_GOSSIP_MENU(5855, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 1261: //Veron Amberstill
- if (player->GetReputationRank(47) != REP_EXALTED && race != RACE_DWARF)
- player->SEND_GOSSIP_MENU(5856, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 3362: //Ogunaro Wolfrunner
- if (player->GetReputationRank(76) != REP_EXALTED && race != RACE_ORC)
- player->SEND_GOSSIP_MENU(5841, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 3685: //Harb Clawhoof
- if (player->GetReputationRank(81) != REP_EXALTED && race != RACE_TAUREN)
- player->SEND_GOSSIP_MENU(5843, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 4730: //Lelanai
- if (player->GetReputationRank(69) != REP_EXALTED && race != RACE_NIGHTELF)
- player->SEND_GOSSIP_MENU(5844, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 4731: //Zachariah Post
- if (player->GetReputationRank(68) != REP_EXALTED && race != RACE_UNDEAD_PLAYER)
- player->SEND_GOSSIP_MENU(5840, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 7952: //Zjolnir
- if (player->GetReputationRank(530) != REP_EXALTED && race != RACE_TROLL)
- player->SEND_GOSSIP_MENU(5842, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 7955: //Milli Featherwhistle
- if (player->GetReputationRank(54) != REP_EXALTED && race != RACE_GNOME)
- player->SEND_GOSSIP_MENU(5857, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 16264: //Winaestra
- if (player->GetReputationRank(911) != REP_EXALTED && race != RACE_BLOODELF)
- player->SEND_GOSSIP_MENU(10305, _Creature->GetGUID());
- else canBuy = true;
- break;
- case 17584: //Torallius the Pack Handler
- if (player->GetReputationRank(930) != REP_EXALTED && race != RACE_DRAENEI)
- player->SEND_GOSSIP_MENU(10239, _Creature->GetGUID());
- else canBuy = true;
- break;
- }
-
- if (canBuy)
- {
- if (_Creature->isVendor())
- player->ADD_GOSSIP_ITEM( 1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- }
- return true;
-}
-
-bool GossipSelect_npc_mount_vendor(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_TRADE)
- player->SEND_VENDORLIST( _Creature->GetGUID() );
-
- return true;
-}
-
-/*######
-## npc_rogue_trainer
-######*/
-
-bool GossipHello_npc_rogue_trainer(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( _Creature->isTrainer() )
- player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- if( _Creature->isCanTrainingAndResetTalentsOf(player) )
- player->ADD_GOSSIP_ITEM(2, "I wish to unlearn my talents", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_UNLEARNTALENTS);
-
- if( player->getClass() == CLASS_ROGUE && player->getLevel() >= 24 && !player->HasItemCount(17126,1) && !player->GetQuestRewardStatus(6681) )
- {
- player->ADD_GOSSIP_ITEM(0, "", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(5996, _Creature->GetGUID());
- } else
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_rogue_trainer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch( action )
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,21100,false);
- break;
- case GOSSIP_ACTION_TRAIN:
- player->SEND_TRAINERLIST( _Creature->GetGUID() );
- break;
- case GOSSIP_OPTION_UNLEARNTALENTS:
- player->CLOSE_GOSSIP_MENU();
- player->SendTalentWipeConfirm( _Creature->GetGUID() );
- break;
- }
- return true;
-}
-
-/*######
-## npc_sayge
-######*/
-
-#define SPELL_DMG 23768 //dmg
-#define SPELL_RES 23769 //res
-#define SPELL_ARM 23767 //arm
-#define SPELL_SPI 23738 //spi
-#define SPELL_INT 23766 //int
-#define SPELL_STM 23737 //stm
-#define SPELL_STR 23735 //str
-#define SPELL_AGI 23736 //agi
-#define SPELL_FORTUNE 23765 //faire fortune
-
-bool GossipHello_npc_sayge(Player *player, Creature *_Creature)
-{
- if(_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->HasSpellCooldown(SPELL_INT) ||
- player->HasSpellCooldown(SPELL_ARM) ||
- player->HasSpellCooldown(SPELL_DMG) ||
- player->HasSpellCooldown(SPELL_RES) ||
- player->HasSpellCooldown(SPELL_STR) ||
- player->HasSpellCooldown(SPELL_AGI) ||
- player->HasSpellCooldown(SPELL_STM) ||
- player->HasSpellCooldown(SPELL_SPI) )
- player->SEND_GOSSIP_MENU(7393, _Creature->GetGUID());
- else
- {
- player->ADD_GOSSIP_ITEM(0, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(7339, _Creature->GetGUID());
- }
-
- return true;
-}
-
-void SendAction_npc_sayge(Player *player, Creature *_Creature, uint32 action)
-{
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, "Slay the Man", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->ADD_GOSSIP_ITEM(0, "Turn him over to liege", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->ADD_GOSSIP_ITEM(0, "Confiscate the corn", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->ADD_GOSSIP_ITEM(0, "Let him go and have the corn", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(7340, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(0, "Execute your friend painfully", GOSSIP_SENDER_MAIN+1, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Execute your friend painlessly", GOSSIP_SENDER_MAIN+2, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Let your friend go", GOSSIP_SENDER_MAIN+3, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7341, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(0, "Confront the diplomat", GOSSIP_SENDER_MAIN+4, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Show not so quiet defiance", GOSSIP_SENDER_MAIN+5, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Remain quiet", GOSSIP_SENDER_MAIN+2, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7361, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(0, "Speak against your brother openly", GOSSIP_SENDER_MAIN+6, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Help your brother in", GOSSIP_SENDER_MAIN+7, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Keep your brother out without letting him know", GOSSIP_SENDER_MAIN+8, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7362, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(0, "Take credit, keep gold", GOSSIP_SENDER_MAIN+5, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Take credit, share the gold", GOSSIP_SENDER_MAIN+4, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(0, "Let the knight take credit", GOSSIP_SENDER_MAIN+3, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7363, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(0, "Thanks", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(7364, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- _Creature->CastSpell(player, SPELL_FORTUNE, false);
- player->SEND_GOSSIP_MENU(7365, _Creature->GetGUID());
- break;
- }
-}
-
-bool GossipSelect_npc_sayge(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch(sender)
- {
- case GOSSIP_SENDER_MAIN:
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+1:
- _Creature->CastSpell(player, SPELL_DMG, false);
- player->AddSpellCooldown(SPELL_DMG,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+2:
- _Creature->CastSpell(player, SPELL_RES, false);
- player->AddSpellCooldown(SPELL_RES,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+3:
- _Creature->CastSpell(player, SPELL_ARM, false);
- player->AddSpellCooldown(SPELL_ARM,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+4:
- _Creature->CastSpell(player, SPELL_SPI, false);
- player->AddSpellCooldown(SPELL_SPI,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+5:
- _Creature->CastSpell(player, SPELL_INT, false);
- player->AddSpellCooldown(SPELL_INT,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+6:
- _Creature->CastSpell(player, SPELL_STM, false);
- player->AddSpellCooldown(SPELL_STM,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+7:
- _Creature->CastSpell(player, SPELL_STR, false);
- player->AddSpellCooldown(SPELL_STR,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- case GOSSIP_SENDER_MAIN+8:
- _Creature->CastSpell(player, SPELL_AGI, false);
- player->AddSpellCooldown(SPELL_AGI,0,time(NULL) + 7200);
- SendAction_npc_sayge(player, _Creature, action);
- break;
- }
- return true;
-}
-
-void AddSC_npcs_special()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_chicken_cluck";
- newscript->GetAI = GetAI_npc_chicken_cluck;
- newscript->pReceiveEmote = &ReceiveEmote_npc_chicken_cluck;
- newscript->pQuestAccept = &QuestAccept_npc_chicken_cluck;
- newscript->pQuestComplete = &QuestComplete_npc_chicken_cluck;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_dancing_flames";
- newscript->pReceiveEmote = &ReceiveEmote_npc_dancing_flames;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_injured_patient";
- newscript->GetAI = GetAI_npc_injured_patient;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_doctor";
- newscript->GetAI = GetAI_npc_doctor;
- newscript->pQuestAccept = &QuestAccept_npc_doctor;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_guardian";
- newscript->GetAI = GetAI_npc_guardian;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_mount_vendor";
- newscript->pGossipHello = &GossipHello_npc_mount_vendor;
- newscript->pGossipSelect = &GossipSelect_npc_mount_vendor;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_rogue_trainer";
- newscript->pGossipHello = &GossipHello_npc_rogue_trainer;
- newscript->pGossipSelect = &GossipSelect_npc_rogue_trainer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_sayge";
- newscript->pGossipHello = &GossipHello_npc_sayge;
- newscript->pGossipSelect = &GossipSelect_npc_sayge;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Npcs_Special
+SD%Complete: 100
+SDComment: To be used for special NPCs that are located globally. Support for quest 3861 (Cluck!), 6622 and 6624 (Triage)
+SDCategory: NPCs
+EndScriptData
+*/
+
+/* ContentData
+npc_chicken_cluck 100% support for quest 3861 (Cluck!)
+npc_dancing_flames 100% midsummer event NPC
+npc_guardian 100% guardianAI used to prevent players from accessing off-limits areas. Not in use by SD2
+npc_injured_patient 100% patients for triage-quests (6622 and 6624)
+npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage)
+npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy
+npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681
+npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given
+EndContentData */
+
+#include "precompiled.h"
+
+/*########
+# npc_chicken_cluck
+#########*/
+
+#define QUEST_CLUCK 3861
+#define EMOTE_A_HELLO "looks up at you quizzically. Maybe you should inspect it?"
+#define EMOTE_H_HELLO "looks at you unexpectadly."
+#define CLUCK_TEXT2 "starts pecking at the feed."
+#define FACTION_FRIENDLY 84
+#define FACTION_CHICKEN 31
+
+struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI
+{
+ npc_chicken_cluckAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ResetFlagTimer;
+
+ void Reset()
+ {
+ ResetFlagTimer = 120000;
+
+ m_creature->setFaction(FACTION_CHICKEN);
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ // Reset flags after a certain time has passed so that the next player has to start the 'event' again
+ if(m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
+ {
+ if(ResetFlagTimer < diff)
+ EnterEvadeMode();
+ else ResetFlagTimer -= diff;
+ }
+
+ if(m_creature->SelectHostilTarget() && m_creature->getVictim())
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_chicken_cluck(Creature *_Creature)
+{
+ return new npc_chicken_cluckAI(_Creature);
+}
+
+bool ReceiveEmote_npc_chicken_cluck( Player *player, Creature *_Creature, uint32 emote )
+{
+ if( emote == TEXTEMOTE_CHICKEN )
+ {
+ if( player->GetTeam() == ALLIANCE )
+ {
+ if( rand()%30 == 1 )
+ {
+ if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE )
+ {
+ _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ _Creature->setFaction(FACTION_FRIENDLY);
+ _Creature->MonsterTextEmote(EMOTE_A_HELLO, 0);
+ }
+ }
+ } else
+ _Creature->MonsterTextEmote(EMOTE_H_HELLO,0);
+ }
+ if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE )
+ if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
+ {
+ _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ _Creature->setFaction(FACTION_FRIENDLY);
+ _Creature->MonsterTextEmote(CLUCK_TEXT2, 0);
+ }
+
+ return true;
+}
+
+bool QuestAccept_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest )
+{
+ if(_Quest->GetQuestId() == QUEST_CLUCK)
+ ((npc_chicken_cluckAI*)_Creature->AI())->Reset();
+
+ return true;
+}
+
+bool QuestComplete_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest)
+{
+ if(_Quest->GetQuestId() == QUEST_CLUCK)
+ ((npc_chicken_cluckAI*)_Creature->AI())->Reset();
+
+ return true;
+}
+
+/*######
+## npc_dancing_flames
+######*/
+
+bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *_Creature, uint32 emote )
+{
+ if( emote == TEXTEMOTE_DANCE )
+ _Creature->CastSpell(player,47057,false);
+
+ return true;
+}
+
+/*######
+## Triage quest
+######*/
+
+#define SAY_DOC1 "I'm saved! Thank you, doctor!"
+#define SAY_DOC2 "HOORAY! I AM SAVED!"
+#define SAY_DOC3 "Sweet, sweet embrace... take me..."
+
+struct Location
+{
+ float x, y, z, o;
+};
+
+#define DOCTOR_ALLIANCE 12939
+
+static Location AllianceCoords[]=
+{
+ { // Top-far-right bunk as seen from entrance
+ -3757.38, -4533.05, 14.16, 3.62
+ },
+ { // Top-far-left bunk
+ -3754.36, -4539.13, 14.16, 5.13
+ },
+ { // Far-right bunk
+ -3749.54, -4540.25, 14.28, 3.34
+ },
+ { // Right bunk near entrance
+ -3742.10, -4536.85, 14.28, 3.64
+ },
+ { // Far-left bunk
+ -3755.89, -4529.07, 14.05, 0.57
+ },
+ { // Mid-left bunk
+ -3749.51, -4527.08, 14.07, 5.26
+ },
+ { // Left bunk near entrance
+ -3746.37, -4525.35, 14.16, 5.22
+ },
+};
+
+#define ALLIANCE_COORDS 7
+
+//alliance run to where
+#define A_RUNTOX -3742.96
+#define A_RUNTOY -4531.52
+#define A_RUNTOZ 11.91
+
+#define DOCTOR_HORDE 12920
+
+static Location HordeCoords[]=
+{
+ { // Left, Behind
+ -1013.75, -3492.59, 62.62, 4.34
+ },
+ { // Right, Behind
+ -1017.72, -3490.92, 62.62, 4.34
+ },
+ { // Left, Mid
+ -1015.77, -3497.15, 62.82, 4.34
+ },
+ { // Right, Mid
+ -1019.51, -3495.49, 62.82, 4.34
+ },
+ { // Left, front
+ -1017.25, -3500.85, 62.98, 4.34
+ },
+ { // Right, Front
+ -1020.95, -3499.21, 62.98, 4.34
+ }
+};
+
+#define HORDE_COORDS 6
+
+//horde run to where
+#define H_RUNTOX -1016.44
+#define H_RUNTOY -3508.48
+#define H_RUNTOZ 62.96
+
+const uint32 AllianceSoldierId[3] =
+{
+ 12938, // 12938 Injured Alliance Soldier
+ 12936, // 12936 Badly injured Alliance Soldier
+ 12937 // 12937 Critically injured Alliance Soldier
+};
+
+const uint32 HordeSoldierId[3] =
+{
+ 12923, //12923 Injured Soldier
+ 12924, //12924 Badly injured Soldier
+ 12925 //12925 Critically injured Soldier
+};
+
+/*######
+## npc_doctor (handles both Gustaf Vanhowzen and Gregory Victor)
+######*/
+
+struct TRINITY_DLL_DECL npc_doctorAI : public ScriptedAI
+{
+ uint64 Playerguid;
+
+ uint32 SummonPatient_Timer;
+ uint32 SummonPatientCount;
+ uint32 PatientDiedCount;
+ uint32 PatientSavedCount;
+
+ bool Event;
+
+ std::list Patients;
+ std::vector Coordinates;
+
+ npc_doctorAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset(){}
+
+ void BeginEvent(Player* player);
+ void PatientDied(Location* Point);
+ void PatientSaved(Creature* soldier, Player* player, Location* Point);
+ void UpdateAI(const uint32 diff);
+
+ void Aggro(Unit* who){}
+};
+
+/*#####
+## npc_injured_patient (handles all the patients, no matter Horde or Alliance)
+#####*/
+
+struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
+{
+ npc_injured_patientAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 Doctorguid;
+
+ Location* Coord;
+
+ void Reset()
+ {
+ Doctorguid = 0;
+
+ Coord = NULL;
+ //no select
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //no regen health
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ //to make them lay with face down
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD);
+
+ uint32 mobId = m_creature->GetEntry();
+
+ switch (mobId)
+ { //lower max health
+ case 12923:
+ case 12938: //Injured Soldier
+ m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.75));
+ break;
+ case 12924:
+ case 12936: //Badly injured Soldier
+ m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.50));
+ break;
+ case 12925:
+ case 12937: //Critically injured Soldier
+ m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.25));
+ break;
+ }
+ }
+
+ void Aggro(Unit* who){}
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == 20804)
+ {
+ if( (((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
+ {
+ if(Doctorguid)
+ {
+ Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid));
+ if(Doctor)
+ ((npc_doctorAI*)Doctor->AI())->PatientSaved(m_creature, ((Player*)caster), Coord);
+ }
+ }
+ //make not selectable
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //regen health
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ //stand up
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
+ DoSay(SAY_DOC1,LANG_UNIVERSAL,NULL);
+
+ uint32 mobId = m_creature->GetEntry();
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ switch (mobId)
+ {
+ case 12923:
+ case 12924:
+ case 12925:
+ m_creature->GetMotionMaster()->MovePoint(0, H_RUNTOX, H_RUNTOY, H_RUNTOZ);
+ break;
+ case 12936:
+ case 12937:
+ case 12938:
+ m_creature->GetMotionMaster()->MovePoint(0, A_RUNTOX, A_RUNTOY, A_RUNTOZ);
+ break;
+ }
+ }
+ return;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (m_creature->isAlive() && m_creature->GetHealth() > 6)
+ { //lower HP on every world tick makes it a useful counter, not officlone though
+ m_creature->SetHealth(uint32(m_creature->GetHealth()-5) );
+ }
+
+ if (m_creature->isAlive() && m_creature->GetHealth() <= 6)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, 32);
+
+ if(Doctorguid)
+ {
+ Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid));
+ if(Doctor)
+ ((npc_doctorAI*)Doctor->AI())->PatientDied(Coord);
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_injured_patient(Creature *_Creature)
+{
+ return new npc_injured_patientAI (_Creature);
+}
+
+/*
+npc_doctor (continue)
+*/
+
+void npc_doctorAI::BeginEvent(Player* player)
+{
+ Playerguid = player->GetGUID();
+
+ SummonPatient_Timer = 10000;
+ SummonPatientCount = 0;
+ PatientDiedCount = 0;
+ PatientSavedCount = 0;
+
+ switch(m_creature->GetEntry())
+ {
+ case DOCTOR_ALLIANCE:
+ for(uint8 i = 0; i < ALLIANCE_COORDS; ++i)
+ Coordinates.push_back(&AllianceCoords[i]);
+ break;
+
+ case DOCTOR_HORDE:
+ for(uint8 i = 0; i < HORDE_COORDS; ++i)
+ Coordinates.push_back(&HordeCoords[i]);
+ break;
+ }
+
+ Event = true;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+}
+
+void npc_doctorAI::PatientDied(Location* Point)
+{
+ Player* player = ((Player*)Unit::GetUnit((*m_creature), Playerguid));
+ if(player && ((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)))
+ {
+ PatientDiedCount++;
+ if (PatientDiedCount > 5 && Event)
+ {
+ if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
+ player->FailQuest(6624);
+ else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
+ player->FailQuest(6622);
+
+ Event = false;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ Coordinates.push_back(Point);
+ }
+}
+
+void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Point)
+{
+ if(player && Playerguid == player->GetGUID())
+ {
+ if((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
+ {
+ PatientSavedCount++;
+ if(PatientSavedCount == 15)
+ {
+ if(!Patients.empty())
+ {
+ std::list::iterator itr;
+ for(itr = Patients.begin(); itr != Patients.end(); ++itr)
+ {
+ Creature* Patient = ((Creature*)Unit::GetUnit((*m_creature), *itr));
+ if( Patient )
+ Patient->setDeathState(JUST_DIED);
+ }
+ }
+
+ if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(6624);
+ else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(6622);
+
+ Event = false;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ Coordinates.push_back(Point);
+ }
+ }
+}
+
+void npc_doctorAI::UpdateAI(const uint32 diff)
+{
+ if(Event && SummonPatientCount >= 20)
+ {
+ Event = false;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ if(Event)
+ if(SummonPatient_Timer < diff)
+ {
+ Creature* Patient = NULL;
+ Location* Point = NULL;
+
+ if(Coordinates.empty())
+ return;
+
+ std::vector::iterator itr = Coordinates.begin()+rand()%Coordinates.size();
+ uint32 patientEntry = 0;
+
+ switch(m_creature->GetEntry())
+ {
+ case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break;
+ case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break;
+ default:
+ error_log("SD2: Invalid entry for Triage doctor. Please check your database");
+ return;
+ }
+
+ Point = *itr;
+
+ Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+
+ if(Patient)
+ {
+ Patients.push_back(Patient->GetGUID());
+ ((npc_injured_patientAI*)Patient->AI())->Doctorguid = m_creature->GetGUID();
+ if(Point)
+ ((npc_injured_patientAI*)Patient->AI())->Coord = Point;
+ Coordinates.erase(itr);
+ }
+ SummonPatient_Timer = 10000;
+ SummonPatientCount++;
+ }else SummonPatient_Timer -= diff;
+}
+
+bool QuestAccept_npc_doctor(Player *player, Creature *creature, Quest const *quest )
+{
+ if((quest->GetQuestId() == 6624) || (quest->GetQuestId() == 6622))
+ ((npc_doctorAI*)creature->AI())->BeginEvent(player);
+
+ return true;
+}
+
+CreatureAI* GetAI_npc_doctor(Creature *_Creature)
+{
+ return new npc_doctorAI (_Creature);
+}
+
+/*######
+## npc_guardian
+######*/
+
+#define SPELL_DEATHTOUCH 5
+#define SAY_AGGRO "This area is closed!"
+
+struct TRINITY_DLL_DECL npc_guardianAI : public ScriptedAI
+{
+ npc_guardianAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (m_creature->isAttackReady())
+ {
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_DEATHTOUCH, true);
+ m_creature->resetAttackTimer();
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_guardian(Creature *_Creature)
+{
+ return new npc_guardianAI (_Creature);
+}
+
+/*######
+## npc_mount_vendor
+######*/
+
+bool GossipHello_npc_mount_vendor(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ bool canBuy;
+ canBuy = false;
+ uint32 vendor = _Creature->GetEntry();
+ uint8 race = player->getRace();
+
+ switch (vendor)
+ {
+ case 384: //Katie Hunter
+ case 1460: //Unger Statforth
+ case 2357: //Merideth Carlson
+ case 4885: //Gregor MacVince
+ if (player->GetReputationRank(72) != REP_EXALTED && race != RACE_HUMAN)
+ player->SEND_GOSSIP_MENU(5855, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 1261: //Veron Amberstill
+ if (player->GetReputationRank(47) != REP_EXALTED && race != RACE_DWARF)
+ player->SEND_GOSSIP_MENU(5856, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 3362: //Ogunaro Wolfrunner
+ if (player->GetReputationRank(76) != REP_EXALTED && race != RACE_ORC)
+ player->SEND_GOSSIP_MENU(5841, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 3685: //Harb Clawhoof
+ if (player->GetReputationRank(81) != REP_EXALTED && race != RACE_TAUREN)
+ player->SEND_GOSSIP_MENU(5843, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 4730: //Lelanai
+ if (player->GetReputationRank(69) != REP_EXALTED && race != RACE_NIGHTELF)
+ player->SEND_GOSSIP_MENU(5844, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 4731: //Zachariah Post
+ if (player->GetReputationRank(68) != REP_EXALTED && race != RACE_UNDEAD_PLAYER)
+ player->SEND_GOSSIP_MENU(5840, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 7952: //Zjolnir
+ if (player->GetReputationRank(530) != REP_EXALTED && race != RACE_TROLL)
+ player->SEND_GOSSIP_MENU(5842, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 7955: //Milli Featherwhistle
+ if (player->GetReputationRank(54) != REP_EXALTED && race != RACE_GNOME)
+ player->SEND_GOSSIP_MENU(5857, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 16264: //Winaestra
+ if (player->GetReputationRank(911) != REP_EXALTED && race != RACE_BLOODELF)
+ player->SEND_GOSSIP_MENU(10305, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ case 17584: //Torallius the Pack Handler
+ if (player->GetReputationRank(930) != REP_EXALTED && race != RACE_DRAENEI)
+ player->SEND_GOSSIP_MENU(10239, _Creature->GetGUID());
+ else canBuy = true;
+ break;
+ }
+
+ if (canBuy)
+ {
+ if (_Creature->isVendor())
+ player->ADD_GOSSIP_ITEM( 1, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ }
+ return true;
+}
+
+bool GossipSelect_npc_mount_vendor(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_TRADE)
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+
+ return true;
+}
+
+/*######
+## npc_rogue_trainer
+######*/
+
+bool GossipHello_npc_rogue_trainer(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( _Creature->isTrainer() )
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
+
+ if( _Creature->isCanTrainingAndResetTalentsOf(player) )
+ player->ADD_GOSSIP_ITEM(2, "I wish to unlearn my talents", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_UNLEARNTALENTS);
+
+ if( player->getClass() == CLASS_ROGUE && player->getLevel() >= 24 && !player->HasItemCount(17126,1) && !player->GetQuestRewardStatus(6681) )
+ {
+ player->ADD_GOSSIP_ITEM(0, "", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(5996, _Creature->GetGUID());
+ } else
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_rogue_trainer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch( action )
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,21100,false);
+ break;
+ case GOSSIP_ACTION_TRAIN:
+ player->SEND_TRAINERLIST( _Creature->GetGUID() );
+ break;
+ case GOSSIP_OPTION_UNLEARNTALENTS:
+ player->CLOSE_GOSSIP_MENU();
+ player->SendTalentWipeConfirm( _Creature->GetGUID() );
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_sayge
+######*/
+
+#define SPELL_DMG 23768 //dmg
+#define SPELL_RES 23769 //res
+#define SPELL_ARM 23767 //arm
+#define SPELL_SPI 23738 //spi
+#define SPELL_INT 23766 //int
+#define SPELL_STM 23737 //stm
+#define SPELL_STR 23735 //str
+#define SPELL_AGI 23736 //agi
+#define SPELL_FORTUNE 23765 //faire fortune
+
+bool GossipHello_npc_sayge(Player *player, Creature *_Creature)
+{
+ if(_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->HasSpellCooldown(SPELL_INT) ||
+ player->HasSpellCooldown(SPELL_ARM) ||
+ player->HasSpellCooldown(SPELL_DMG) ||
+ player->HasSpellCooldown(SPELL_RES) ||
+ player->HasSpellCooldown(SPELL_STR) ||
+ player->HasSpellCooldown(SPELL_AGI) ||
+ player->HasSpellCooldown(SPELL_STM) ||
+ player->HasSpellCooldown(SPELL_SPI) )
+ player->SEND_GOSSIP_MENU(7393, _Creature->GetGUID());
+ else
+ {
+ player->ADD_GOSSIP_ITEM(0, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(7339, _Creature->GetGUID());
+ }
+
+ return true;
+}
+
+void SendAction_npc_sayge(Player *player, Creature *_Creature, uint32 action)
+{
+ switch(action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, "Slay the Man", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->ADD_GOSSIP_ITEM(0, "Turn him over to liege", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->ADD_GOSSIP_ITEM(0, "Confiscate the corn", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->ADD_GOSSIP_ITEM(0, "Let him go and have the corn", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(7340, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM(0, "Execute your friend painfully", GOSSIP_SENDER_MAIN+1, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Execute your friend painlessly", GOSSIP_SENDER_MAIN+2, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Let your friend go", GOSSIP_SENDER_MAIN+3, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(7341, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM(0, "Confront the diplomat", GOSSIP_SENDER_MAIN+4, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Show not so quiet defiance", GOSSIP_SENDER_MAIN+5, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Remain quiet", GOSSIP_SENDER_MAIN+2, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(7361, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM(0, "Speak against your brother openly", GOSSIP_SENDER_MAIN+6, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Help your brother in", GOSSIP_SENDER_MAIN+7, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Keep your brother out without letting him know", GOSSIP_SENDER_MAIN+8, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(7362, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM(0, "Take credit, keep gold", GOSSIP_SENDER_MAIN+5, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Take credit, share the gold", GOSSIP_SENDER_MAIN+4, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM(0, "Let the knight take credit", GOSSIP_SENDER_MAIN+3, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(7363, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM(0, "Thanks", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ player->SEND_GOSSIP_MENU(7364, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ _Creature->CastSpell(player, SPELL_FORTUNE, false);
+ player->SEND_GOSSIP_MENU(7365, _Creature->GetGUID());
+ break;
+ }
+}
+
+bool GossipSelect_npc_sayge(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch(sender)
+ {
+ case GOSSIP_SENDER_MAIN:
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+1:
+ _Creature->CastSpell(player, SPELL_DMG, false);
+ player->AddSpellCooldown(SPELL_DMG,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+2:
+ _Creature->CastSpell(player, SPELL_RES, false);
+ player->AddSpellCooldown(SPELL_RES,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+3:
+ _Creature->CastSpell(player, SPELL_ARM, false);
+ player->AddSpellCooldown(SPELL_ARM,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+4:
+ _Creature->CastSpell(player, SPELL_SPI, false);
+ player->AddSpellCooldown(SPELL_SPI,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+5:
+ _Creature->CastSpell(player, SPELL_INT, false);
+ player->AddSpellCooldown(SPELL_INT,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+6:
+ _Creature->CastSpell(player, SPELL_STM, false);
+ player->AddSpellCooldown(SPELL_STM,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+7:
+ _Creature->CastSpell(player, SPELL_STR, false);
+ player->AddSpellCooldown(SPELL_STR,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ case GOSSIP_SENDER_MAIN+8:
+ _Creature->CastSpell(player, SPELL_AGI, false);
+ player->AddSpellCooldown(SPELL_AGI,0,time(NULL) + 7200);
+ SendAction_npc_sayge(player, _Creature, action);
+ break;
+ }
+ return true;
+}
+
+void AddSC_npcs_special()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_chicken_cluck";
+ newscript->GetAI = GetAI_npc_chicken_cluck;
+ newscript->pReceiveEmote = &ReceiveEmote_npc_chicken_cluck;
+ newscript->pQuestAccept = &QuestAccept_npc_chicken_cluck;
+ newscript->pQuestComplete = &QuestComplete_npc_chicken_cluck;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_dancing_flames";
+ newscript->pReceiveEmote = &ReceiveEmote_npc_dancing_flames;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_injured_patient";
+ newscript->GetAI = GetAI_npc_injured_patient;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_doctor";
+ newscript->GetAI = GetAI_npc_doctor;
+ newscript->pQuestAccept = &QuestAccept_npc_doctor;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_guardian";
+ newscript->GetAI = GetAI_npc_guardian;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_mount_vendor";
+ newscript->pGossipHello = &GossipHello_npc_mount_vendor;
+ newscript->pGossipSelect = &GossipSelect_npc_mount_vendor;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_rogue_trainer";
+ newscript->pGossipHello = &GossipHello_npc_rogue_trainer;
+ newscript->pGossipSelect = &GossipSelect_npc_rogue_trainer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_sayge";
+ newscript->pGossipHello = &GossipHello_npc_sayge;
+ newscript->pGossipSelect = &GossipSelect_npc_sayge;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
index 0577c1ddbdf..98597afae3a 100644
--- a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
+++ b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
@@ -1,62 +1,62 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Alterac_Mountains
-SD%Complete: 100
-SDComment: Quest support: 6681
-SDCategory: Alterac Mountains
-EndScriptData */
-
-/* ContentData
-npc_ravenholdt
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_ravenholdt
-######*/
-
-struct TRINITY_DLL_DECL npc_ravenholdtAI : public ScriptedAI
-{
- npc_ravenholdtAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- void Reset() { }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( who->GetTypeId() == TYPEID_PLAYER )
- if( ((Player*)who)->GetQuestStatus(6681) == QUEST_STATUS_INCOMPLETE )
- ((Player*)who)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID() );
- }
-
- void Aggro(Unit* who) { }
-};
-CreatureAI* GetAI_npc_ravenholdt(Creature *_Creature)
-{
- return new npc_ravenholdtAI (_Creature);
-}
-
-void AddSC_alterac_mountains()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_ravenholdt";
- newscript->GetAI = GetAI_npc_ravenholdt;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Alterac_Mountains
+SD%Complete: 100
+SDComment: Quest support: 6681
+SDCategory: Alterac Mountains
+EndScriptData */
+
+/* ContentData
+npc_ravenholdt
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_ravenholdt
+######*/
+
+struct TRINITY_DLL_DECL npc_ravenholdtAI : public ScriptedAI
+{
+ npc_ravenholdtAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ void Reset() { }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( who->GetTypeId() == TYPEID_PLAYER )
+ if( ((Player*)who)->GetQuestStatus(6681) == QUEST_STATUS_INCOMPLETE )
+ ((Player*)who)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID() );
+ }
+
+ void Aggro(Unit* who) { }
+};
+CreatureAI* GetAI_npc_ravenholdt(Creature *_Creature)
+{
+ return new npc_ravenholdtAI (_Creature);
+}
+
+void AddSC_alterac_mountains()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_ravenholdt";
+ newscript->GetAI = GetAI_npc_ravenholdt;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
index 782e89ce9d9..6be5a32ef2b 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
@@ -1,403 +1,403 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Exarch_Maladaar
-SD%Complete: 95
-SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player.
-SDCategory: Auchindoun, Auchenai Crypts
-EndScriptData */
-
-/* ContentData
-mob_stolen_soul
-boss_exarch_maladaar
-mob_avatar_of_martyred
-EndContentData */
-
-#include "precompiled.h"
-
-#define SPELL_MOONFIRE 37328
-#define SPELL_FIREBALL 37329
-#define SPELL_MIND_FLAY 37330
-#define SPELL_HEMORRHAGE 37331
-#define SPELL_FROSTSHOCK 37332
-#define SPELL_CURSE_OF_AGONY 37334
-#define SPELL_MORTAL_STRIKE 37335
-#define SPELL_FREEZING_TRAP 37368
-#define SPELL_HAMMER_OF_JUSTICE 37369
-
-struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI
-{
- mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint8 myClass;
- uint32 Class_Timer;
-
- void Reset()
- {
- Class_Timer = 1000;
- }
-
- void Aggro(Unit *who)
- { }
-
- void SetMyClass(uint8 myclass)
- {
- myClass = myclass;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( Class_Timer < diff )
- {
- switch( myClass )
- {
- case CLASS_WARRIOR:
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
- Class_Timer = 6000;
- break;
- case CLASS_PALADIN:
- DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE);
- Class_Timer = 6000;
- break;
- case CLASS_HUNTER:
- DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP);
- Class_Timer = 20000;
- break;
- case CLASS_ROGUE:
- DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE);
- Class_Timer = 10000;
- break;
- case CLASS_PRIEST:
- DoCast(m_creature->getVictim(), SPELL_MIND_FLAY);
- Class_Timer = 5000;
- break;
- case CLASS_SHAMAN:
- DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK);
- Class_Timer = 8000;
- break;
- case CLASS_MAGE:
- DoCast(m_creature->getVictim(), SPELL_FIREBALL);
- Class_Timer = 5000;
- break;
- case CLASS_WARLOCK:
- DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY);
- Class_Timer = 20000;
- break;
- case CLASS_DRUID:
- DoCast(m_creature->getVictim(), SPELL_MOONFIRE);
- Class_Timer = 10000;
- break;
- }
- }else Class_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_stolen_soul(Creature *_Creature)
-{
- return new mob_stolen_soulAI (_Creature);
-}
-
-#define SAY_INTRO "You have defiled the resting place of our ancestors. For this offense, there can be but one punishment. It is fitting that you have come to a place of the dead... for you will soon be joining them."
-#define SOUND_INTRO 10509
-#define SAY_SUMMON "Rise my fallen brothers. Take form and fight!"
-#define SOUND_SUMMON 10512
-
-#define SAY_AGGRO_1 "You will pay with your life!"
-#define SOUND_AGGRO_1 10513
-#define SAY_AGGRO_2 "There's no turning back now!"
-#define SOUND_AGGRO_2 10514
-#define SAY_AGGRO_3 "Serve your penitence!"
-#define SOUND_AGGRO_3 10515
-
-#define SAY_ROAR "Let your mind be clouded."
-#define SOUND_ROAR 10510
-#define SAY_SOUL_CLEAVE "Stare into the darkness of your soul."
-#define SOUND_SOUL_CLEAVE 10511
-
-#define SAY_SLAY_1 "These walls will be your doom."
-#define SOUND_SLAY_1 10516
-#define SAY_SLAY_2 " Now, you'll stay for eternity!"
-#define SOUND_SLAY_2 10517
-
-#define SAY_DEATH "This is... where.. I belong..."
-#define SOUND_DEATH 10518
-
-#define SPELL_RIBBON_OF_SOULS 32422
-#define SPELL_SOUL_SCREAM 32421
-
-#define SPELL_STOLEN_SOUL 32346
-#define SPELL_STOLEN_SOUL_VISUAL 32395
-
-#define SPELL_SUMMON_AVATAR 32424
-
-#define ENTRY_STOLEN_SOUL 18441
-
-struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI
-{
- boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 soulmodel;
- uint64 soulholder;
- uint8 soulclass;
-
- uint32 Fear_timer;
- uint32 Ribbon_of_Souls_timer;
- uint32 StolenSoul_Timer;
-
- bool HasTaunted;
- bool Avatar_summoned;
-
- void Reset()
- {
- soulmodel = 0;
- soulholder = 0;
- soulclass = 0;
-
- Fear_timer = 20000;
- Ribbon_of_Souls_timer = 5000;
- StolenSoul_Timer = 30000;
-
- HasTaunted = false;
- Avatar_summoned = false;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if( !HasTaunted && m_creature->IsWithinDistInMap(who, 150.0) )
- {
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO);
- HasTaunted = true;
- }
-
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- 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->SetDisplayId(soulmodel);
- summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false);
-
- if( Unit *target = Unit::GetUnit(*m_creature,soulholder) )
- summoned->AI()->AttackStart(target);
-
- ((mob_stolen_soulAI*)summoned->AI())->SetMyClass(soulclass);
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- if (rand()%2)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- //When Exarch Maladar is defeated D'ore appear.
- DoSpawnCreature(19412,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN, 600000);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( !Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25) )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON);
-
- DoCast(m_creature, SPELL_SUMMON_AVATAR);
- Avatar_summoned = true;
- StolenSoul_Timer = 45000;
- }
-
- if( StolenSoul_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- {
- if( target->GetTypeId() == TYPEID_PLAYER )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- uint32 i = urand(1,2);
- if( i == 1 )
- {
- DoYell(SAY_ROAR, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_ROAR);
- }
- else
- {
- DoYell(SAY_SOUL_CLEAVE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SOUL_CLEAVE);
- }
-
- soulmodel = target->GetDisplayId();
- soulholder = target->GetGUID();
- soulclass = target->getClass();
-
- DoCast(target,SPELL_STOLEN_SOUL);
- DoSpawnCreature(ENTRY_STOLEN_SOUL,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
-
- StolenSoul_Timer = 45000;
- } else StolenSoul_Timer = 1000;
- }
- }else StolenSoul_Timer -= diff;
-
- if( Ribbon_of_Souls_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_RIBBON_OF_SOULS);
-
- Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000);
- }else Ribbon_of_Souls_timer -= diff;
-
- if( Fear_timer < diff )
- {
- DoCast(m_creature,SPELL_SOUL_SCREAM);
- Fear_timer = 25000 + rand()% 10000;
- }else Fear_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_exarch_maladaar(Creature *_Creature)
-{
- return new boss_exarch_maladaarAI (_Creature);
-}
-
-#define SPELL_MORTAL_STRIKE 16856
-#define SPELL_SUNDER_ARMOR 16145
-
-struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI
-{
- mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Mortal_Strike_timer;
-
- void Reset()
- {
- Mortal_Strike_timer = 10000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(Mortal_Strike_timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
- Mortal_Strike_timer = 10000 + rand()%20 * 1000;
- }else Mortal_Strike_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_avatar_of_martyred(Creature *_Creature)
-{
- return new mob_avatar_of_martyredAI (_Creature);
-}
-
-void AddSC_boss_exarch_maladaar()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_exarch_maladaar";
- newscript->GetAI = GetAI_boss_exarch_maladaar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_avatar_of_martyred";
- newscript->GetAI = GetAI_mob_avatar_of_martyred;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_stolen_soul";
- newscript->GetAI = GetAI_mob_stolen_soul;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Exarch_Maladaar
+SD%Complete: 95
+SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player.
+SDCategory: Auchindoun, Auchenai Crypts
+EndScriptData */
+
+/* ContentData
+mob_stolen_soul
+boss_exarch_maladaar
+mob_avatar_of_martyred
+EndContentData */
+
+#include "precompiled.h"
+
+#define SPELL_MOONFIRE 37328
+#define SPELL_FIREBALL 37329
+#define SPELL_MIND_FLAY 37330
+#define SPELL_HEMORRHAGE 37331
+#define SPELL_FROSTSHOCK 37332
+#define SPELL_CURSE_OF_AGONY 37334
+#define SPELL_MORTAL_STRIKE 37335
+#define SPELL_FREEZING_TRAP 37368
+#define SPELL_HAMMER_OF_JUSTICE 37369
+
+struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI
+{
+ mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint8 myClass;
+ uint32 Class_Timer;
+
+ void Reset()
+ {
+ Class_Timer = 1000;
+ }
+
+ void Aggro(Unit *who)
+ { }
+
+ void SetMyClass(uint8 myclass)
+ {
+ myClass = myclass;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( Class_Timer < diff )
+ {
+ switch( myClass )
+ {
+ case CLASS_WARRIOR:
+ DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ Class_Timer = 6000;
+ break;
+ case CLASS_PALADIN:
+ DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE);
+ Class_Timer = 6000;
+ break;
+ case CLASS_HUNTER:
+ DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP);
+ Class_Timer = 20000;
+ break;
+ case CLASS_ROGUE:
+ DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE);
+ Class_Timer = 10000;
+ break;
+ case CLASS_PRIEST:
+ DoCast(m_creature->getVictim(), SPELL_MIND_FLAY);
+ Class_Timer = 5000;
+ break;
+ case CLASS_SHAMAN:
+ DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK);
+ Class_Timer = 8000;
+ break;
+ case CLASS_MAGE:
+ DoCast(m_creature->getVictim(), SPELL_FIREBALL);
+ Class_Timer = 5000;
+ break;
+ case CLASS_WARLOCK:
+ DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY);
+ Class_Timer = 20000;
+ break;
+ case CLASS_DRUID:
+ DoCast(m_creature->getVictim(), SPELL_MOONFIRE);
+ Class_Timer = 10000;
+ break;
+ }
+ }else Class_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_stolen_soul(Creature *_Creature)
+{
+ return new mob_stolen_soulAI (_Creature);
+}
+
+#define SAY_INTRO "You have defiled the resting place of our ancestors. For this offense, there can be but one punishment. It is fitting that you have come to a place of the dead... for you will soon be joining them."
+#define SOUND_INTRO 10509
+#define SAY_SUMMON "Rise my fallen brothers. Take form and fight!"
+#define SOUND_SUMMON 10512
+
+#define SAY_AGGRO_1 "You will pay with your life!"
+#define SOUND_AGGRO_1 10513
+#define SAY_AGGRO_2 "There's no turning back now!"
+#define SOUND_AGGRO_2 10514
+#define SAY_AGGRO_3 "Serve your penitence!"
+#define SOUND_AGGRO_3 10515
+
+#define SAY_ROAR "Let your mind be clouded."
+#define SOUND_ROAR 10510
+#define SAY_SOUL_CLEAVE "Stare into the darkness of your soul."
+#define SOUND_SOUL_CLEAVE 10511
+
+#define SAY_SLAY_1 "These walls will be your doom."
+#define SOUND_SLAY_1 10516
+#define SAY_SLAY_2 " Now, you'll stay for eternity!"
+#define SOUND_SLAY_2 10517
+
+#define SAY_DEATH "This is... where.. I belong..."
+#define SOUND_DEATH 10518
+
+#define SPELL_RIBBON_OF_SOULS 32422
+#define SPELL_SOUL_SCREAM 32421
+
+#define SPELL_STOLEN_SOUL 32346
+#define SPELL_STOLEN_SOUL_VISUAL 32395
+
+#define SPELL_SUMMON_AVATAR 32424
+
+#define ENTRY_STOLEN_SOUL 18441
+
+struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI
+{
+ boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 soulmodel;
+ uint64 soulholder;
+ uint8 soulclass;
+
+ uint32 Fear_timer;
+ uint32 Ribbon_of_Souls_timer;
+ uint32 StolenSoul_Timer;
+
+ bool HasTaunted;
+ bool Avatar_summoned;
+
+ void Reset()
+ {
+ soulmodel = 0;
+ soulholder = 0;
+ soulclass = 0;
+
+ Fear_timer = 20000;
+ Ribbon_of_Souls_timer = 5000;
+ StolenSoul_Timer = 30000;
+
+ HasTaunted = false;
+ Avatar_summoned = false;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if( !HasTaunted && m_creature->IsWithinDistInMap(who, 150.0) )
+ {
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO);
+ HasTaunted = true;
+ }
+
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ 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->SetDisplayId(soulmodel);
+ summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false);
+
+ if( Unit *target = Unit::GetUnit(*m_creature,soulholder) )
+ summoned->AI()->AttackStart(target);
+
+ ((mob_stolen_soulAI*)summoned->AI())->SetMyClass(soulclass);
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (rand()%2)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ //When Exarch Maladar is defeated D'ore appear.
+ DoSpawnCreature(19412,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN, 600000);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( !Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25) )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON);
+
+ DoCast(m_creature, SPELL_SUMMON_AVATAR);
+ Avatar_summoned = true;
+ StolenSoul_Timer = 45000;
+ }
+
+ if( StolenSoul_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ {
+ if( target->GetTypeId() == TYPEID_PLAYER )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ uint32 i = urand(1,2);
+ if( i == 1 )
+ {
+ DoYell(SAY_ROAR, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ROAR);
+ }
+ else
+ {
+ DoYell(SAY_SOUL_CLEAVE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SOUL_CLEAVE);
+ }
+
+ soulmodel = target->GetDisplayId();
+ soulholder = target->GetGUID();
+ soulclass = target->getClass();
+
+ DoCast(target,SPELL_STOLEN_SOUL);
+ DoSpawnCreature(ENTRY_STOLEN_SOUL,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+
+ StolenSoul_Timer = 45000;
+ } else StolenSoul_Timer = 1000;
+ }
+ }else StolenSoul_Timer -= diff;
+
+ if( Ribbon_of_Souls_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_RIBBON_OF_SOULS);
+
+ Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000);
+ }else Ribbon_of_Souls_timer -= diff;
+
+ if( Fear_timer < diff )
+ {
+ DoCast(m_creature,SPELL_SOUL_SCREAM);
+ Fear_timer = 25000 + rand()% 10000;
+ }else Fear_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_exarch_maladaar(Creature *_Creature)
+{
+ return new boss_exarch_maladaarAI (_Creature);
+}
+
+#define SPELL_MORTAL_STRIKE 16856
+#define SPELL_SUNDER_ARMOR 16145
+
+struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI
+{
+ mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Mortal_Strike_timer;
+
+ void Reset()
+ {
+ Mortal_Strike_timer = 10000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(Mortal_Strike_timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
+ Mortal_Strike_timer = 10000 + rand()%20 * 1000;
+ }else Mortal_Strike_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_avatar_of_martyred(Creature *_Creature)
+{
+ return new mob_avatar_of_martyredAI (_Creature);
+}
+
+void AddSC_boss_exarch_maladaar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_exarch_maladaar";
+ newscript->GetAI = GetAI_boss_exarch_maladaar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_avatar_of_martyred";
+ newscript->GetAI = GetAI_mob_avatar_of_martyred;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_stolen_soul";
+ newscript->GetAI = GetAI_mob_stolen_soul;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
index 3e4d96f9fc0..71ad1e8ffc2 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
@@ -1,313 +1,313 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_NexusPrince_Shaffar
-SD%Complete: 80
-SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro.
-SDCategory: Auchindoun, Mana Tombs
-EndScriptData */
-
-/* ContentData
-boss_nexusprince_shaffar
-mob_ethereal_beacon
-EndContentData */
-
-#include "precompiled.h"
-
-#define SAY_INTRO "What is this? You must forgive me, but I was not expecting company. As you can see, we are somewhat preoccupied right now. But no matter. As I am a gracious host, I will tend to you... personally."
-#define SOUND_INTRO 10539
-
-#define SAY_AGGRO_1 "We have not yet been properly introduced."
-#define SOUND_AGGRO_1 10541
-#define SAY_AGGRO_2 "An epic battle. How exciting!"
-#define SOUND_AGGRO_2 10542
-#define SAY_AGGRO_3 "I have longed for a good adventure."
-#define SOUND_AGGRO_3 10543
-
-#define SAY_SLAY_1 "It has been... entertaining."
-#define SOUND_SLAY_1 10544
-#define SAY_SLAY_2 "And now we part company."
-#define SOUND_SLAY_2 10545
-
-#define SAY_SUMMON "I have such fascinating things to show you."
-#define SOUND_SUMMON 10540
-
-#define SAY_DEAD "I must bid you... farewell."
-#define SOUND_DEAD 10546
-
-#define SPELL_BLINK 34605
-#define SPELL_FROSTBOLT 32364
-#define SPELL_FIREBALL 32363
-#define SPELL_FROSTNOVA 32365
-
-#define SPELL_ETHEREAL_BEACON 32371 // Summon 18431
-#define SPELL_ETHEREAL_BEACON_VISUAL 32368
-
-#define ENTRY_BEACON 18431
-
-struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
-{
- boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Blink_Timer;
- uint32 Beacon_Timer;
- uint32 FireBall_Timer;
- uint32 Frostbolt_Timer;
- uint32 FrostNova_Timer;
-
- bool HasTaunted;
- bool CanBlink;
-
- void Reset()
- {
- Blink_Timer = 1500;
- Beacon_Timer = 10000;
- FireBall_Timer = 8000;
- Frostbolt_Timer = 4000;
- FrostNova_Timer = 15000;
-
- HasTaunted = false;
- CanBlink = false;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if( !HasTaunted && m_creature->IsWithinDistInMap(who, 100.0) )
- {
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO);
- HasTaunted = true;
- }
-
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- void JustSummoned(Creature *summoned)
- {
- if( summoned->GetEntry() == ENTRY_BEACON )
- {
- summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false);
-
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- summoned->AI()->AttackStart(target);
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEAD, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEAD);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( FrostNova_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- DoCast(m_creature,SPELL_FROSTNOVA);
- FrostNova_Timer = 17500 + rand()%7500;
- CanBlink = true;
- }else FrostNova_Timer -= diff;
-
- if( Frostbolt_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
- Frostbolt_Timer = 4500 + rand()%1500;
- }else Frostbolt_Timer -= diff;
-
- if( FireBall_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_FIREBALL);
- FireBall_Timer = 4500 + rand()%1500;
- }else FireBall_Timer -= diff;
-
- if( CanBlink )
- {
- if( Blink_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- DoCast(m_creature,SPELL_BLINK);
- Blink_Timer = 1000 + rand()%1500;
- CanBlink = false;
- }else Blink_Timer -= diff;
- }
-
- if( Beacon_Timer < diff)
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- if( !urand(0,3) )
- {
- DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON);
- }
- DoCast(m_creature,SPELL_ETHEREAL_BEACON);
-
- Beacon_Timer = 10000;
- }else Beacon_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_nexusprince_shaffar(Creature *_Creature)
-{
- return new boss_nexusprince_shaffarAI (_Creature);
-}
-
-#define SPELL_ARCANE_BOLT 15254
-#define SPELL_ETHEREAL_APPRENTICE 32372 // Summon 18430
-
-struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
-{
- mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c)
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Reset();
- }
-
- bool HeroicMode;
- bool CanEvade;
- uint32 Apprentice_Timer;
- uint32 ArcaneBolt_Timer;
-
- void Reset()
- {
- if( CanEvade )
- m_creature->SetVisibility(VISIBILITY_OFF);
-
- CanEvade = false;
- Apprentice_Timer = (HeroicMode ? 10000 : 20000);
- ArcaneBolt_Timer = 1000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void JustSummoned(Creature *summoned)
- {
- summoned->AI()->AttackStart(m_creature->getVictim());
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( ArcaneBolt_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT);
- ArcaneBolt_Timer = 2000 + rand()%2500;
- }else ArcaneBolt_Timer -= diff;
-
- if( Apprentice_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true);
- if( m_creature->GetOwner() )
- ((Pet*)m_creature)->SetDuration(0);
- CanEvade = true;
- }else Apprentice_Timer -= diff;
-
- if( CanEvade )
- EnterEvadeMode();
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_ethereal_beacon(Creature *_Creature)
-{
- return new mob_ethereal_beaconAI (_Creature);
-}
-
-void AddSC_boss_nexusprince_shaffar()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_nexusprince_shaffar";
- newscript->GetAI = GetAI_boss_nexusprince_shaffar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_ethereal_beacon";
- newscript->GetAI = GetAI_mob_ethereal_beacon;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_NexusPrince_Shaffar
+SD%Complete: 80
+SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro.
+SDCategory: Auchindoun, Mana Tombs
+EndScriptData */
+
+/* ContentData
+boss_nexusprince_shaffar
+mob_ethereal_beacon
+EndContentData */
+
+#include "precompiled.h"
+
+#define SAY_INTRO "What is this? You must forgive me, but I was not expecting company. As you can see, we are somewhat preoccupied right now. But no matter. As I am a gracious host, I will tend to you... personally."
+#define SOUND_INTRO 10539
+
+#define SAY_AGGRO_1 "We have not yet been properly introduced."
+#define SOUND_AGGRO_1 10541
+#define SAY_AGGRO_2 "An epic battle. How exciting!"
+#define SOUND_AGGRO_2 10542
+#define SAY_AGGRO_3 "I have longed for a good adventure."
+#define SOUND_AGGRO_3 10543
+
+#define SAY_SLAY_1 "It has been... entertaining."
+#define SOUND_SLAY_1 10544
+#define SAY_SLAY_2 "And now we part company."
+#define SOUND_SLAY_2 10545
+
+#define SAY_SUMMON "I have such fascinating things to show you."
+#define SOUND_SUMMON 10540
+
+#define SAY_DEAD "I must bid you... farewell."
+#define SOUND_DEAD 10546
+
+#define SPELL_BLINK 34605
+#define SPELL_FROSTBOLT 32364
+#define SPELL_FIREBALL 32363
+#define SPELL_FROSTNOVA 32365
+
+#define SPELL_ETHEREAL_BEACON 32371 // Summon 18431
+#define SPELL_ETHEREAL_BEACON_VISUAL 32368
+
+#define ENTRY_BEACON 18431
+
+struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
+{
+ boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Blink_Timer;
+ uint32 Beacon_Timer;
+ uint32 FireBall_Timer;
+ uint32 Frostbolt_Timer;
+ uint32 FrostNova_Timer;
+
+ bool HasTaunted;
+ bool CanBlink;
+
+ void Reset()
+ {
+ Blink_Timer = 1500;
+ Beacon_Timer = 10000;
+ FireBall_Timer = 8000;
+ Frostbolt_Timer = 4000;
+ FrostNova_Timer = 15000;
+
+ HasTaunted = false;
+ CanBlink = false;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if( !HasTaunted && m_creature->IsWithinDistInMap(who, 100.0) )
+ {
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO);
+ HasTaunted = true;
+ }
+
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ if( summoned->GetEntry() == ENTRY_BEACON )
+ {
+ summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false);
+
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ summoned->AI()->AttackStart(target);
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEAD, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEAD);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( FrostNova_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ DoCast(m_creature,SPELL_FROSTNOVA);
+ FrostNova_Timer = 17500 + rand()%7500;
+ CanBlink = true;
+ }else FrostNova_Timer -= diff;
+
+ if( Frostbolt_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
+ Frostbolt_Timer = 4500 + rand()%1500;
+ }else Frostbolt_Timer -= diff;
+
+ if( FireBall_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREBALL);
+ FireBall_Timer = 4500 + rand()%1500;
+ }else FireBall_Timer -= diff;
+
+ if( CanBlink )
+ {
+ if( Blink_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ DoCast(m_creature,SPELL_BLINK);
+ Blink_Timer = 1000 + rand()%1500;
+ CanBlink = false;
+ }else Blink_Timer -= diff;
+ }
+
+ if( Beacon_Timer < diff)
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ if( !urand(0,3) )
+ {
+ DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON);
+ }
+ DoCast(m_creature,SPELL_ETHEREAL_BEACON);
+
+ Beacon_Timer = 10000;
+ }else Beacon_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_nexusprince_shaffar(Creature *_Creature)
+{
+ return new boss_nexusprince_shaffarAI (_Creature);
+}
+
+#define SPELL_ARCANE_BOLT 15254
+#define SPELL_ETHEREAL_APPRENTICE 32372 // Summon 18430
+
+struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
+{
+ mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c)
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ bool HeroicMode;
+ bool CanEvade;
+ uint32 Apprentice_Timer;
+ uint32 ArcaneBolt_Timer;
+
+ void Reset()
+ {
+ if( CanEvade )
+ m_creature->SetVisibility(VISIBILITY_OFF);
+
+ CanEvade = false;
+ Apprentice_Timer = (HeroicMode ? 10000 : 20000);
+ ArcaneBolt_Timer = 1000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ summoned->AI()->AttackStart(m_creature->getVictim());
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( ArcaneBolt_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT);
+ ArcaneBolt_Timer = 2000 + rand()%2500;
+ }else ArcaneBolt_Timer -= diff;
+
+ if( Apprentice_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true);
+ if( m_creature->GetOwner() )
+ ((Pet*)m_creature)->SetDuration(0);
+ CanEvade = true;
+ }else Apprentice_Timer -= diff;
+
+ if( CanEvade )
+ EnterEvadeMode();
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_ethereal_beacon(Creature *_Creature)
+{
+ return new mob_ethereal_beaconAI (_Creature);
+}
+
+void AddSC_boss_nexusprince_shaffar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_nexusprince_shaffar";
+ newscript->GetAI = GetAI_boss_nexusprince_shaffar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_ethereal_beacon";
+ newscript->GetAI = GetAI_mob_ethereal_beacon;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp
index bc54a420617..fc245d20222 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp
@@ -1,159 +1,159 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Pandemonius
-SD%Complete: 75
-SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged.
-SDCategory: Auchindoun, Mana Tombs
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO_1 "I will feed on your soul."
-#define SOUND_AGGRO_1 10561
-#define SAY_AGGRO_2 "So... full of life!"
-#define SOUND_AGGRO_2 10562
-#define SAY_AGGRO_3 "Do not... resist."
-#define SOUND_AGGRO_3 10563
-
-#define SAY_KILL_1 "Yes! I am... empowered!"
-#define SOUND_KILL_1 10564
-#define SAY_KILL_2 "More... I must have more!"
-#define SOUND_KILL_2 10565
-
-#define SAY_DEATH "To the void... once... more.."
-#define SOUND_DEATH 10566
-
-#define EMOTE_DARK_SHELL "shifts into the void..."
-
-#define SPELL_VOID_BLAST 32325
-#define H_SPELL_VOID_BLAST 38760
-#define SPELL_DARK_SHELL 32358
-#define H_SPELL_DARK_SHELL 38759
-
-struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI
-{
- boss_pandemoniusAI(Creature *c) : ScriptedAI(c)
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- Reset();
- }
-
- bool HeroicMode;
- uint32 VoidBlast_Timer;
- uint32 DarkShell_Timer;
- uint32 VoidBlast_Counter;
-
- void Reset()
- {
- VoidBlast_Timer = 30000;
- DarkShell_Timer = 20000;
- VoidBlast_Counter = 0;
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_1);
- break;
- case 1:
- DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_KILL_2);
- break;
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
-
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( VoidBlast_Timer < diff )
- {
- if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0) )
- {
- DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST);
- VoidBlast_Timer = 500;
- ++VoidBlast_Counter;
- }
-
- if( VoidBlast_Counter == 5 )
- {
- VoidBlast_Timer = 25000+rand()%10000;
- VoidBlast_Counter = 0;
- }
- }else VoidBlast_Timer -= diff;
-
- if( !VoidBlast_Counter )
- {
- if( DarkShell_Timer < diff )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(true);
-
- DoTextEmote(EMOTE_DARK_SHELL,NULL,true);
- DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL);
- DarkShell_Timer = 20000;
- }else DarkShell_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_pandemonius(Creature *_Creature)
-{
- return new boss_pandemoniusAI (_Creature);
-}
-
-void AddSC_boss_pandemonius()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_pandemonius";
- newscript->GetAI = GetAI_boss_pandemonius;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Pandemonius
+SD%Complete: 75
+SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged.
+SDCategory: Auchindoun, Mana Tombs
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO_1 "I will feed on your soul."
+#define SOUND_AGGRO_1 10561
+#define SAY_AGGRO_2 "So... full of life!"
+#define SOUND_AGGRO_2 10562
+#define SAY_AGGRO_3 "Do not... resist."
+#define SOUND_AGGRO_3 10563
+
+#define SAY_KILL_1 "Yes! I am... empowered!"
+#define SOUND_KILL_1 10564
+#define SAY_KILL_2 "More... I must have more!"
+#define SOUND_KILL_2 10565
+
+#define SAY_DEATH "To the void... once... more.."
+#define SOUND_DEATH 10566
+
+#define EMOTE_DARK_SHELL "shifts into the void..."
+
+#define SPELL_VOID_BLAST 32325
+#define H_SPELL_VOID_BLAST 38760
+#define SPELL_DARK_SHELL 32358
+#define H_SPELL_DARK_SHELL 38759
+
+struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI
+{
+ boss_pandemoniusAI(Creature *c) : ScriptedAI(c)
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ bool HeroicMode;
+ uint32 VoidBlast_Timer;
+ uint32 DarkShell_Timer;
+ uint32 VoidBlast_Counter;
+
+ void Reset()
+ {
+ VoidBlast_Timer = 30000;
+ DarkShell_Timer = 20000;
+ VoidBlast_Counter = 0;
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_1);
+ break;
+ case 1:
+ DoYell(SAY_KILL_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_2);
+ break;
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( VoidBlast_Timer < diff )
+ {
+ if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0) )
+ {
+ DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST);
+ VoidBlast_Timer = 500;
+ ++VoidBlast_Counter;
+ }
+
+ if( VoidBlast_Counter == 5 )
+ {
+ VoidBlast_Timer = 25000+rand()%10000;
+ VoidBlast_Counter = 0;
+ }
+ }else VoidBlast_Timer -= diff;
+
+ if( !VoidBlast_Counter )
+ {
+ if( DarkShell_Timer < diff )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+
+ DoTextEmote(EMOTE_DARK_SHELL,NULL,true);
+ DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL);
+ DarkShell_Timer = 20000;
+ }else DarkShell_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_pandemonius(Creature *_Creature)
+{
+ return new boss_pandemoniusAI (_Creature);
+}
+
+void AddSC_boss_pandemonius()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_pandemonius";
+ newscript->GetAI = GetAI_boss_pandemonius;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
index 6065a1a75c0..2832816a2d6 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
@@ -1,441 +1,441 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Darkweaver_Syth
-SD%Complete: 85
-SDComment: Shock spells/times need more work. Heroic not implemented.
-SDCategory: Auchindoun, Sethekk Halls
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_SUMMON "I have pets....of my own!"
-#define SOUND_SUMMON 10502
-
-#define SAY_AGGRO_1 "Hrrmm.. Time to.. hrrm.. make my move."
-#define SOUND_AGGRO_1 10503
-#define SAY_AGGRO_2 "Nice pets..hrm.. Yes! "
-#define SOUND_AGGRO_2 10504
-#define SAY_AGGRO_3 "Nice pets have.. weapons. No so....nice."
-#define SOUND_AGGRO_3 10505
-
-#define SAY_SLAY_1 "Death.. meeting life is.. "
-#define SOUND_SLAY_1 10506
-#define SAY_SLAY_2 "Uhn.. Be free.."
-#define SOUND_SLAY_2 10507
-
-#define SAY_DEATH "No more life..hrm. No more pain. "
-#define SOUND_DEATH 10508
-
-#define SPELL_FROST_SHOCK 37865
-#define SPELL_FLAME_SHOCK 34354
-#define SPELL_SHADOW_SHOCK 30138
-#define SPELL_ARCANE_SHOCK 37132
-
-#define SPELL_CHAIN_LIGHTNING 39945
-
-#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203
-#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205
-#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204
-#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206
-
-#define SPELL_FLAME_BUFFET 33526
-#define H_SPELL_FLAME_BUFFET 38141
-#define SPELL_ARCANE_BUFFET 33527
-#define H_SPELL_ARCANE_BUFFET 38138
-#define SPELL_FROST_BUFFET 33528
-#define H_SPELL_FROST_BUFFET 38142
-#define SPELL_SHADOW_BUFFET 33529
-#define H_SPELL_SHADOW_BUFFET 38143
-
-struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI
-{
- boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- 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 Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void KilledUnit(Unit* victim)
- {
- if (rand()%2)
- return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- }
- }
-
- void JustSummoned(Creature *summoned)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- summoned->AI()->AttackStart(target);
-
- }
-
- void SythSummoning()
- {
- DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SUMMON);
-
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(false);
-
- DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front
- DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back
- DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left
- DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90)
- {
- SythSummoning();
- summon90 = true;
- }
-
- if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50)
- {
- SythSummoning();
- summon50 = true;
- }
-
- if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10)
- {
- SythSummoning();
- summon10 = true;
- }
-
- if( flameshock_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FLAME_SHOCK);
-
- flameshock_timer = 10000 + rand()%5000;
- }else flameshock_timer -= diff;
-
- if( arcaneshock_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_ARCANE_SHOCK);
-
- arcaneshock_timer = 10000 + rand()%5000;
- }else arcaneshock_timer -= diff;
-
- if( frostshock_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FROST_SHOCK);
-
- frostshock_timer = 10000 + rand()%5000;
- }else frostshock_timer -= diff;
-
- if( shadowshock_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SHADOW_SHOCK);
-
- shadowshock_timer = 10000 + rand()%5000;
- }else shadowshock_timer -= diff;
-
- if( chainlightning_timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_CHAIN_LIGHTNING);
-
- chainlightning_timer = 25000;
- }else chainlightning_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_darkweaver_syth(Creature *_Creature)
-{
- return new boss_darkweaver_sythAI (_Creature);
-}
-
-/* ELEMENTALS */
-
-struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI
-{
- mob_syth_fireAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 flameshock_timer;
- uint32 flamebuffet_timer;
-
- void Reset()
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
- flameshock_timer = 2500;
- flamebuffet_timer = 5000;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(flameshock_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FLAME_SHOCK);
-
- flameshock_timer = 5000;
- }else flameshock_timer -= diff;
-
- if(flamebuffet_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FLAME_BUFFET);
-
- flamebuffet_timer = 5000;
- }else flamebuffet_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_syth_fire(Creature *_Creature)
-{
- return new mob_syth_fireAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI
-{
- mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 arcaneshock_timer;
- uint32 arcanebuffet_timer;
-
- void Reset()
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
- arcaneshock_timer = 2500;
- arcanebuffet_timer = 5000;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(arcaneshock_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_ARCANE_SHOCK);
-
- arcaneshock_timer = 5000;
- }else arcaneshock_timer -= diff;
-
- if(arcanebuffet_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_ARCANE_BUFFET);
-
- arcanebuffet_timer = 5000;
- }else arcanebuffet_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_syth_arcane(Creature *_Creature)
-{
- return new mob_syth_arcaneAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI
-{
- mob_syth_frostAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 frostshock_timer;
- uint32 frostbuffet_timer;
-
- void Reset()
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
- frostshock_timer = 2500;
- frostbuffet_timer = 5000;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(frostshock_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FROST_SHOCK);
-
- frostshock_timer = 5000;
- }else frostshock_timer -= diff;
-
- if(frostbuffet_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_FROST_BUFFET);
-
- frostbuffet_timer = 5000;
- }else frostbuffet_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_syth_frost(Creature *_Creature)
-{
- return new mob_syth_frostAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI
-{
- mob_syth_shadowAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 shadowshock_timer;
- uint32 shadowbuffet_timer;
-
- void Reset()
- {
- m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
- shadowshock_timer = 2500;
- shadowbuffet_timer = 5000;
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(shadowshock_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SHADOW_SHOCK);
-
- shadowshock_timer = 5000;
- }else shadowshock_timer -= diff;
-
- if(shadowbuffet_timer < diff)
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- DoCast(target,SPELL_SHADOW_BUFFET);
-
- shadowbuffet_timer = 5000;
- }else shadowbuffet_timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_syth_shadow(Creature *_Creature)
-{
- return new mob_syth_shadowAI (_Creature);
-}
-
-void AddSC_boss_darkweaver_syth()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_darkweaver_syth";
- newscript->GetAI = GetAI_boss_darkweaver_syth;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_syth_fire";
- newscript->GetAI = GetAI_mob_syth_arcane;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_syth_arcane";
- newscript->GetAI = GetAI_mob_syth_arcane;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_syth_frost";
- newscript->GetAI = GetAI_mob_syth_frost;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_syth_shadow";
- newscript->GetAI = GetAI_mob_syth_shadow;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Darkweaver_Syth
+SD%Complete: 85
+SDComment: Shock spells/times need more work. Heroic not implemented.
+SDCategory: Auchindoun, Sethekk Halls
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_SUMMON "I have pets....of my own!"
+#define SOUND_SUMMON 10502
+
+#define SAY_AGGRO_1 "Hrrmm.. Time to.. hrrm.. make my move."
+#define SOUND_AGGRO_1 10503
+#define SAY_AGGRO_2 "Nice pets..hrm.. Yes! "
+#define SOUND_AGGRO_2 10504
+#define SAY_AGGRO_3 "Nice pets have.. weapons. No so....nice."
+#define SOUND_AGGRO_3 10505
+
+#define SAY_SLAY_1 "Death.. meeting life is.. "
+#define SOUND_SLAY_1 10506
+#define SAY_SLAY_2 "Uhn.. Be free.."
+#define SOUND_SLAY_2 10507
+
+#define SAY_DEATH "No more life..hrm. No more pain. "
+#define SOUND_DEATH 10508
+
+#define SPELL_FROST_SHOCK 37865
+#define SPELL_FLAME_SHOCK 34354
+#define SPELL_SHADOW_SHOCK 30138
+#define SPELL_ARCANE_SHOCK 37132
+
+#define SPELL_CHAIN_LIGHTNING 39945
+
+#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203
+#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205
+#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204
+#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206
+
+#define SPELL_FLAME_BUFFET 33526
+#define H_SPELL_FLAME_BUFFET 38141
+#define SPELL_ARCANE_BUFFET 33527
+#define H_SPELL_ARCANE_BUFFET 38138
+#define SPELL_FROST_BUFFET 33528
+#define H_SPELL_FROST_BUFFET 38142
+#define SPELL_SHADOW_BUFFET 33529
+#define H_SPELL_SHADOW_BUFFET 38143
+
+struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI
+{
+ boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ 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 Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ if (rand()%2)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ summoned->AI()->AttackStart(target);
+
+ }
+
+ void SythSummoning()
+ {
+ DoYell(SAY_SUMMON, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SUMMON);
+
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(false);
+
+ DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front
+ DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back
+ DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left
+ DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90)
+ {
+ SythSummoning();
+ summon90 = true;
+ }
+
+ if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50)
+ {
+ SythSummoning();
+ summon50 = true;
+ }
+
+ if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10)
+ {
+ SythSummoning();
+ summon10 = true;
+ }
+
+ if( flameshock_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FLAME_SHOCK);
+
+ flameshock_timer = 10000 + rand()%5000;
+ }else flameshock_timer -= diff;
+
+ if( arcaneshock_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_ARCANE_SHOCK);
+
+ arcaneshock_timer = 10000 + rand()%5000;
+ }else arcaneshock_timer -= diff;
+
+ if( frostshock_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FROST_SHOCK);
+
+ frostshock_timer = 10000 + rand()%5000;
+ }else frostshock_timer -= diff;
+
+ if( shadowshock_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SHADOW_SHOCK);
+
+ shadowshock_timer = 10000 + rand()%5000;
+ }else shadowshock_timer -= diff;
+
+ if( chainlightning_timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_CHAIN_LIGHTNING);
+
+ chainlightning_timer = 25000;
+ }else chainlightning_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_darkweaver_syth(Creature *_Creature)
+{
+ return new boss_darkweaver_sythAI (_Creature);
+}
+
+/* ELEMENTALS */
+
+struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI
+{
+ mob_syth_fireAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 flameshock_timer;
+ uint32 flamebuffet_timer;
+
+ void Reset()
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ flameshock_timer = 2500;
+ flamebuffet_timer = 5000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(flameshock_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FLAME_SHOCK);
+
+ flameshock_timer = 5000;
+ }else flameshock_timer -= diff;
+
+ if(flamebuffet_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FLAME_BUFFET);
+
+ flamebuffet_timer = 5000;
+ }else flamebuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_syth_fire(Creature *_Creature)
+{
+ return new mob_syth_fireAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI
+{
+ mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 arcaneshock_timer;
+ uint32 arcanebuffet_timer;
+
+ void Reset()
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true);
+ arcaneshock_timer = 2500;
+ arcanebuffet_timer = 5000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(arcaneshock_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_ARCANE_SHOCK);
+
+ arcaneshock_timer = 5000;
+ }else arcaneshock_timer -= diff;
+
+ if(arcanebuffet_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_ARCANE_BUFFET);
+
+ arcanebuffet_timer = 5000;
+ }else arcanebuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_syth_arcane(Creature *_Creature)
+{
+ return new mob_syth_arcaneAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI
+{
+ mob_syth_frostAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 frostshock_timer;
+ uint32 frostbuffet_timer;
+
+ void Reset()
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
+ frostshock_timer = 2500;
+ frostbuffet_timer = 5000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(frostshock_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FROST_SHOCK);
+
+ frostshock_timer = 5000;
+ }else frostshock_timer -= diff;
+
+ if(frostbuffet_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_FROST_BUFFET);
+
+ frostbuffet_timer = 5000;
+ }else frostbuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_syth_frost(Creature *_Creature)
+{
+ return new mob_syth_frostAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI
+{
+ mob_syth_shadowAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 shadowshock_timer;
+ uint32 shadowbuffet_timer;
+
+ void Reset()
+ {
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true);
+ shadowshock_timer = 2500;
+ shadowbuffet_timer = 5000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(shadowshock_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SHADOW_SHOCK);
+
+ shadowshock_timer = 5000;
+ }else shadowshock_timer -= diff;
+
+ if(shadowbuffet_timer < diff)
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ DoCast(target,SPELL_SHADOW_BUFFET);
+
+ shadowbuffet_timer = 5000;
+ }else shadowbuffet_timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_syth_shadow(Creature *_Creature)
+{
+ return new mob_syth_shadowAI (_Creature);
+}
+
+void AddSC_boss_darkweaver_syth()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_darkweaver_syth";
+ newscript->GetAI = GetAI_boss_darkweaver_syth;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_syth_fire";
+ newscript->GetAI = GetAI_mob_syth_arcane;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_syth_arcane";
+ newscript->GetAI = GetAI_mob_syth_arcane;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_syth_frost";
+ newscript->GetAI = GetAI_mob_syth_frost;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_syth_shadow";
+ newscript->GetAI = GetAI_mob_syth_shadow;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
index 5a5ae7edd06..8c5f5157d25 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
@@ -1,256 +1,256 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Talon_King_Ikiss
-SD%Complete: 80
-SDComment: Heroic supported. Some details missing, but most are spell related.
-SDCategory: Auchindoun, Sethekk Halls
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_sethekk_halls.h"
-
-#define SAY_INTRO "..Trinkets yes pretty Trinkets....power, great power...power in Trinkets.."
-#define SOUND_INTRO 10557
-
-#define SAY_AGGRO_1 "You make war on Ikiss?.."
-#define SOUND_AGGRO_1 10554
-#define SAY_AGGRO_2 "Ikiss cut you pretty....slice you. Yes!"
-#define SOUND_AGGRO_2 10555
-#define SAY_AGGRO_3 "No escape for....for you"
-#define SOUND_AGGRO_3 10556
-
-#define SAY_SLAY_1 "You die....stay away from Trinkets"
-#define SOUND_SLAY_1 10558
-#define SAY_SLAY_2 ""
-#define SOUND_SLAY_2 10559
-
-#define SAY_DEATH "Ikiss will not....die"
-#define SOUND_DEATH 10560
-
-#define EMOTE_ARCANE_EXP "begins to channel arcane energy..."
-
-#define SPELL_BLINK 38194
-#define SPELL_BLINK_TELEPORT 38203
-#define SPELL_MANA_SHIELD 38151
-#define SPELL_ARCANE_BUBBLE 9438
-#define H_SPELL_SLOW 35032
-
-#define SPELL_POLYMORPH 38245
-#define H_SPELL_POLYMORPH 43309
-
-#define SPELL_ARCANE_VOLLEY 35059
-#define H_SPELL_ARCANE_VOLLEY 40424
-
-#define SPELL_ARCANE_EXPLOSION 38197
-#define H_SPELL_ARCANE_EXPLOSION 40425
-
-struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
-{
- boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- bool HeroicMode;
-
- uint32 ArcaneVolley_Timer;
- uint32 Sheep_Timer;
- uint32 Blink_Timer;
- uint32 Slow_Timer;
-
- bool ManaShield;
- bool Blink;
- bool Intro;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
-
- ArcaneVolley_Timer = 5000;
- Sheep_Timer = 8000;
- Blink_Timer = 35000;
- Slow_Timer = 15000+rand()%15000;
- Blink = false;
- Intro = false;
- ManaShield = false;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if(!Intro && m_creature->IsWithinDistInMap(who, 100))
- {
- Intro = true;
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_INTRO);
- }
-
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
- break;
-
- case 1:
- DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
- break;
-
- case 2:
- DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
- break;
- }
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- if( pInstance )
- pInstance->SetData(DATA_IKISSDOOREVENT, DONE);
- }
-
- void KilledUnit(Unit* victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
- break;
-
- case 1:
- DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if( Blink )
- {
- DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION);
- m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true);
- Blink = false;
- }
-
- if( ArcaneVolley_Timer < diff )
- {
- DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY);
- ArcaneVolley_Timer = 10000+rand()%5000;
- }else ArcaneVolley_Timer -= diff;
-
- if( Sheep_Timer < diff )
- {
- //second top aggro target in normal, random target in heroic correct?
- Unit *target = NULL;
- if( HeroicMode ? target = SelectUnit(SELECT_TARGET_RANDOM,0) : target = SelectUnit(SELECT_TARGET_TOPAGGRO,1) )
- DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH);
- Sheep_Timer = 15000+rand()%2500;
- }else Sheep_Timer -= diff;
-
- //may not be correct time to cast
- if( !ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) )
- {
- DoCast(m_creature,SPELL_MANA_SHIELD);
- ManaShield = true;
- }
-
- if( HeroicMode )
- {
- if( Slow_Timer < diff )
- {
- DoCast(m_creature,H_SPELL_SLOW);
- Slow_Timer = 15000+rand()%25000;
- }else Slow_Timer -= diff;
- }
-
- if( Blink_Timer < diff )
- {
- DoTextEmote(EMOTE_ARCANE_EXP,NULL,true);
-
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
- {
- if( m_creature->IsNonMeleeSpellCasted(false) )
- m_creature->InterruptNonMeleeSpells(false);
-
- //Spell doesn't work, but we use for visual effect at least
- DoCast(target,SPELL_BLINK);
-
- float X = target->GetPositionX();
- float Y = target->GetPositionY();
- float Z = target->GetPositionZ();
-
- m_creature->Relocate(X,Y,Z);
- m_creature->SendMonsterMove(X, Y, Z, 0, 0, 0);
-
- DoCast(target,SPELL_BLINK_TELEPORT);
- Blink = true;
- }
- Blink_Timer = 35000+rand()%5000;
- }else Blink_Timer -= diff;
-
- if( !Blink )
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_talon_king_ikiss(Creature *_Creature)
-{
- return new boss_talon_king_ikissAI (_Creature);
-}
-
-void AddSC_boss_talon_king_ikiss()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_talon_king_ikiss";
- newscript->GetAI = GetAI_boss_talon_king_ikiss;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Talon_King_Ikiss
+SD%Complete: 80
+SDComment: Heroic supported. Some details missing, but most are spell related.
+SDCategory: Auchindoun, Sethekk Halls
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_sethekk_halls.h"
+
+#define SAY_INTRO "..Trinkets yes pretty Trinkets....power, great power...power in Trinkets.."
+#define SOUND_INTRO 10557
+
+#define SAY_AGGRO_1 "You make war on Ikiss?.."
+#define SOUND_AGGRO_1 10554
+#define SAY_AGGRO_2 "Ikiss cut you pretty....slice you. Yes!"
+#define SOUND_AGGRO_2 10555
+#define SAY_AGGRO_3 "No escape for....for you"
+#define SOUND_AGGRO_3 10556
+
+#define SAY_SLAY_1 "You die....stay away from Trinkets"
+#define SOUND_SLAY_1 10558
+#define SAY_SLAY_2 ""
+#define SOUND_SLAY_2 10559
+
+#define SAY_DEATH "Ikiss will not....die"
+#define SOUND_DEATH 10560
+
+#define EMOTE_ARCANE_EXP "begins to channel arcane energy..."
+
+#define SPELL_BLINK 38194
+#define SPELL_BLINK_TELEPORT 38203
+#define SPELL_MANA_SHIELD 38151
+#define SPELL_ARCANE_BUBBLE 9438
+#define H_SPELL_SLOW 35032
+
+#define SPELL_POLYMORPH 38245
+#define H_SPELL_POLYMORPH 43309
+
+#define SPELL_ARCANE_VOLLEY 35059
+#define H_SPELL_ARCANE_VOLLEY 40424
+
+#define SPELL_ARCANE_EXPLOSION 38197
+#define H_SPELL_ARCANE_EXPLOSION 40425
+
+struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
+{
+ boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ bool HeroicMode;
+
+ uint32 ArcaneVolley_Timer;
+ uint32 Sheep_Timer;
+ uint32 Blink_Timer;
+ uint32 Slow_Timer;
+
+ bool ManaShield;
+ bool Blink;
+ bool Intro;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+
+ ArcaneVolley_Timer = 5000;
+ Sheep_Timer = 8000;
+ Blink_Timer = 35000;
+ Slow_Timer = 15000+rand()%15000;
+ Blink = false;
+ Intro = false;
+ ManaShield = false;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if(!Intro && m_creature->IsWithinDistInMap(who, 100))
+ {
+ Intro = true;
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_INTRO);
+ }
+
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+ break;
+
+ case 1:
+ DoYell(SAY_AGGRO_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ break;
+
+ case 2:
+ DoYell(SAY_AGGRO_3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_3);
+ break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ if( pInstance )
+ pInstance->SetData(DATA_IKISSDOOREVENT, DONE);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_1);
+ break;
+
+ case 1:
+ DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SLAY_2);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if( Blink )
+ {
+ DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION);
+ m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true);
+ Blink = false;
+ }
+
+ if( ArcaneVolley_Timer < diff )
+ {
+ DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY);
+ ArcaneVolley_Timer = 10000+rand()%5000;
+ }else ArcaneVolley_Timer -= diff;
+
+ if( Sheep_Timer < diff )
+ {
+ //second top aggro target in normal, random target in heroic correct?
+ Unit *target = NULL;
+ if( HeroicMode ? target = SelectUnit(SELECT_TARGET_RANDOM,0) : target = SelectUnit(SELECT_TARGET_TOPAGGRO,1) )
+ DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH);
+ Sheep_Timer = 15000+rand()%2500;
+ }else Sheep_Timer -= diff;
+
+ //may not be correct time to cast
+ if( !ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) )
+ {
+ DoCast(m_creature,SPELL_MANA_SHIELD);
+ ManaShield = true;
+ }
+
+ if( HeroicMode )
+ {
+ if( Slow_Timer < diff )
+ {
+ DoCast(m_creature,H_SPELL_SLOW);
+ Slow_Timer = 15000+rand()%25000;
+ }else Slow_Timer -= diff;
+ }
+
+ if( Blink_Timer < diff )
+ {
+ DoTextEmote(EMOTE_ARCANE_EXP,NULL,true);
+
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(false);
+
+ //Spell doesn't work, but we use for visual effect at least
+ DoCast(target,SPELL_BLINK);
+
+ float X = target->GetPositionX();
+ float Y = target->GetPositionY();
+ float Z = target->GetPositionZ();
+
+ m_creature->Relocate(X,Y,Z);
+ m_creature->SendMonsterMove(X, Y, Z, 0, 0, 0);
+
+ DoCast(target,SPELL_BLINK_TELEPORT);
+ Blink = true;
+ }
+ Blink_Timer = 35000+rand()%5000;
+ }else Blink_Timer -= diff;
+
+ if( !Blink )
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_talon_king_ikiss(Creature *_Creature)
+{
+ return new boss_talon_king_ikissAI (_Creature);
+}
+
+void AddSC_boss_talon_king_ikiss()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_talon_king_ikiss";
+ newscript->GetAI = GetAI_boss_talon_king_ikiss;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h
index 73aafca29f7..f609ecac1f2 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h
@@ -1,9 +1,9 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_SETHEKK_HALLS_H
-#define DEF_SETHEKK_HALLS_H
-
-#define DATA_IKISSDOOREVENT 1
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_SETHEKK_HALLS_H
+#define DEF_SETHEKK_HALLS_H
+
+#define DATA_IKISSDOOREVENT 1
+#endif
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp
index 59906713f34..b49d18445c2 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp
@@ -1,74 +1,74 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance - Sethekk Halls
-SD%Complete: 50
-SDComment: Instance Data for Sethekk Halls instance
-SDCategory: Auchindoun, Sethekk Halls
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_sethekk_halls.h"
-
-#define IKISS_DOOR 177203
-
-struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance
-{
- instance_sethekk_halls(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- GameObject *IkissDoor;
-
- void Initialize()
- {
- IkissDoor = NULL;
- }
-
- void OnObjectCreate(GameObject *go)
- {
- switch(go->GetEntry())
- {
- case IKISS_DOOR:
- IkissDoor = go;
- break;
- }
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_IKISSDOOREVENT:
- if( IkissDoor )
- IkissDoor->SetGoState(0);
- break;
- }
- }
-};
-
-InstanceData* GetInstanceData_instance_sethekk_halls(Map* map)
-{
- return new instance_sethekk_halls(map);
-}
-
-void AddSC_instance_sethekk_halls()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_sethekk_halls";
- newscript->GetInstanceData = GetInstanceData_instance_sethekk_halls;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance - Sethekk Halls
+SD%Complete: 50
+SDComment: Instance Data for Sethekk Halls instance
+SDCategory: Auchindoun, Sethekk Halls
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_sethekk_halls.h"
+
+#define IKISS_DOOR 177203
+
+struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance
+{
+ instance_sethekk_halls(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ GameObject *IkissDoor;
+
+ void Initialize()
+ {
+ IkissDoor = NULL;
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch(go->GetEntry())
+ {
+ case IKISS_DOOR:
+ IkissDoor = go;
+ break;
+ }
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_IKISSDOOREVENT:
+ if( IkissDoor )
+ IkissDoor->SetGoState(0);
+ break;
+ }
+ }
+};
+
+InstanceData* GetInstanceData_instance_sethekk_halls(Map* map)
+{
+ return new instance_sethekk_halls(map);
+}
+
+void AddSC_instance_sethekk_halls()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_sethekk_halls";
+ newscript->GetInstanceData = GetInstanceData_instance_sethekk_halls;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
index e8116c0c946..afa7b996915 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
@@ -1,223 +1,223 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ambassador_Hellmaw
-SD%Complete: 75
-SDComment: Waypoints after Intro not implemented. Enrage spell missing/not known
-SDCategory: Auchindoun, Shadow Labyrinth
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_shadow_labyrinth.h"
-
-#define SAY_INTRO "Infidels have invaded the sanctuary! Sniveling pests...You have yet to learn the true meaning of agony!"
-#define SOUND_INTRO 10473
-
-#define SAY_AGGRO1 "Pathetic mortals! You will pay dearly!"
-#define SOUND_AGGRO1 10475
-#define SAY_AGGRO2 "I will break you!"
-#define SOUND_AGGRO2 10476
-#define SAY_AGGRO3 "Finally! Something to relieve the tedium!"
-#define SOUND_AGGRO3 10477
-
-#define SAY_HELP "Aid me, you fools, before it's too late!"
-#define SOUND_HELP 10474
-
-#define SAY_SLAY1 "Do you fear death?"
-#define SOUND_SLAY1 10478
-#define SAY_SLAY2 "This is the part I enjoy most."
-#define SOUND_SLAY2 10479
-
-#define SAY_DEATH "Do not...grow...overconfident, mortal."
-#define SOUND_DEATH 10480
-
-#define SPELL_BANISH 30231
-#define SPELL_CORROSIVE_ACID 23313
-#define SPELL_FEAR 33547
-#define SPELL_ENRAGE 0 //need to find proper spell
-
-struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
-{
- boss_ambassador_hellmawAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
- bool HeroicMode;
-
- uint32 EventCheck_Timer;
- uint32 CorrosiveAcid_Timer;
- uint32 Fear_Timer;
- uint32 Enrage_Timer;
- bool Intro;
- bool IsBanished;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
-
- EventCheck_Timer = 5000;
- CorrosiveAcid_Timer = 25000;
- Fear_Timer = 40000;
- Enrage_Timer = 180000;
- Intro = false;
- IsBanished = false;
-
- if( pInstance )
- {
- if( pInstance->GetData(TYPE_HELLMAW) == NOT_STARTED )
- {
- DoCast(m_creature,SPELL_BANISH);
- IsBanished = true;
- }
- else pInstance->SetData(TYPE_HELLMAW,FAIL);
-
- if( pInstance->GetData(TYPE_OVERSEER) == DONE )
- {
- if( m_creature->HasAura(SPELL_BANISH,0) )
- m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
- Intro = true;
- }
- }
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if( type != POINT_MOTION_TYPE )
- return;
- }
-
- void DoIntro()
- {
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_INTRO);
-
- if( m_creature->HasAura(SPELL_BANISH,0) )
- m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
-
- IsBanished = false;
- Intro = true;
-
- if( pInstance )
- pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS);
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- break;
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if( pInstance )
- pInstance->SetData(TYPE_HELLMAW, DONE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( !Intro )
- {
- if( EventCheck_Timer < diff )
- {
- if( pInstance )
- {
- if( pInstance->GetData(TYPE_OVERSEER) == DONE )
- DoIntro();
- }
- EventCheck_Timer = 5000;
- }else EventCheck_Timer -= diff;
- }
-
- if( !InCombat && !IsBanished )
- {
- //this is where we add MovePoint()
- //DoWhine("I haz no mount!", LANG_UNIVERSAL, NULL);
- }
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( CorrosiveAcid_Timer < diff )
- {
- DoCast(m_creature,SPELL_CORROSIVE_ACID);
- CorrosiveAcid_Timer = 25000;
- }else CorrosiveAcid_Timer -= diff;
-
- if( Fear_Timer < diff )
- {
- DoCast(m_creature,SPELL_FEAR);
- Fear_Timer = 35000;
- }else Fear_Timer -= diff;
-
- /*if( HeroicMode )
- {
- if( Enrage_Timer < diff )
- {
- DoCast(m_creature,SPELL_ENRAGE);
- }else Enrage_Timer -= diff;
- }*/
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_ambassador_hellmaw(Creature *_Creature)
-{
- return new boss_ambassador_hellmawAI (_Creature);
-}
-
-void AddSC_boss_ambassador_hellmaw()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ambassador_hellmaw";
- newscript->GetAI = GetAI_boss_ambassador_hellmaw;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ambassador_Hellmaw
+SD%Complete: 75
+SDComment: Waypoints after Intro not implemented. Enrage spell missing/not known
+SDCategory: Auchindoun, Shadow Labyrinth
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_shadow_labyrinth.h"
+
+#define SAY_INTRO "Infidels have invaded the sanctuary! Sniveling pests...You have yet to learn the true meaning of agony!"
+#define SOUND_INTRO 10473
+
+#define SAY_AGGRO1 "Pathetic mortals! You will pay dearly!"
+#define SOUND_AGGRO1 10475
+#define SAY_AGGRO2 "I will break you!"
+#define SOUND_AGGRO2 10476
+#define SAY_AGGRO3 "Finally! Something to relieve the tedium!"
+#define SOUND_AGGRO3 10477
+
+#define SAY_HELP "Aid me, you fools, before it's too late!"
+#define SOUND_HELP 10474
+
+#define SAY_SLAY1 "Do you fear death?"
+#define SOUND_SLAY1 10478
+#define SAY_SLAY2 "This is the part I enjoy most."
+#define SOUND_SLAY2 10479
+
+#define SAY_DEATH "Do not...grow...overconfident, mortal."
+#define SOUND_DEATH 10480
+
+#define SPELL_BANISH 30231
+#define SPELL_CORROSIVE_ACID 23313
+#define SPELL_FEAR 33547
+#define SPELL_ENRAGE 0 //need to find proper spell
+
+struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
+{
+ boss_ambassador_hellmawAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ bool HeroicMode;
+
+ uint32 EventCheck_Timer;
+ uint32 CorrosiveAcid_Timer;
+ uint32 Fear_Timer;
+ uint32 Enrage_Timer;
+ bool Intro;
+ bool IsBanished;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+
+ EventCheck_Timer = 5000;
+ CorrosiveAcid_Timer = 25000;
+ Fear_Timer = 40000;
+ Enrage_Timer = 180000;
+ Intro = false;
+ IsBanished = false;
+
+ if( pInstance )
+ {
+ if( pInstance->GetData(TYPE_HELLMAW) == NOT_STARTED )
+ {
+ DoCast(m_creature,SPELL_BANISH);
+ IsBanished = true;
+ }
+ else pInstance->SetData(TYPE_HELLMAW,FAIL);
+
+ if( pInstance->GetData(TYPE_OVERSEER) == DONE )
+ {
+ if( m_creature->HasAura(SPELL_BANISH,0) )
+ m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
+ Intro = true;
+ }
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if( type != POINT_MOTION_TYPE )
+ return;
+ }
+
+ void DoIntro()
+ {
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_INTRO);
+
+ if( m_creature->HasAura(SPELL_BANISH,0) )
+ m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
+
+ IsBanished = false;
+ Intro = true;
+
+ if( pInstance )
+ pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS);
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ break;
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if( pInstance )
+ pInstance->SetData(TYPE_HELLMAW, DONE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !Intro )
+ {
+ if( EventCheck_Timer < diff )
+ {
+ if( pInstance )
+ {
+ if( pInstance->GetData(TYPE_OVERSEER) == DONE )
+ DoIntro();
+ }
+ EventCheck_Timer = 5000;
+ }else EventCheck_Timer -= diff;
+ }
+
+ if( !InCombat && !IsBanished )
+ {
+ //this is where we add MovePoint()
+ //DoWhine("I haz no mount!", LANG_UNIVERSAL, NULL);
+ }
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( CorrosiveAcid_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_CORROSIVE_ACID);
+ CorrosiveAcid_Timer = 25000;
+ }else CorrosiveAcid_Timer -= diff;
+
+ if( Fear_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_FEAR);
+ Fear_Timer = 35000;
+ }else Fear_Timer -= diff;
+
+ /*if( HeroicMode )
+ {
+ if( Enrage_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ }else Enrage_Timer -= diff;
+ }*/
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_ambassador_hellmaw(Creature *_Creature)
+{
+ return new boss_ambassador_hellmawAI (_Creature);
+}
+
+void AddSC_boss_ambassador_hellmaw()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ambassador_hellmaw";
+ newscript->GetAI = GetAI_boss_ambassador_hellmaw;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
index 86f4aae1381..41cafdf49b1 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
@@ -1,191 +1,191 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Blackheart_the_Inciter
-SD%Complete: 75
-SDComment: Incite Chaos not functional since core lacks Mind Control support
-SDCategory: Auchindoun, Shadow Labyrinth
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_shadow_labyrinth.h"
-
-#define SPELL_INCITE_CHAOS 33676
-#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party
-#define SPELL_CHARGE 33709
-#define SPELL_WAR_STOMP 33707
-
-#define SAY_AGGRO1 "You be dead people!"
-#define SAY_AGGRO2 "Time to kill!"
-#define SAY_AGGRO3 "I see dead people!"
-#define SAY_SLAY1 "No coming back for you!"
-#define SAY_SLAY2 "Nice try!"
-#define SAY_SLAY3 "Now you gone for good!"
-#define SAY_DEATH "This...no...good.."
-
-#define SOUND_AGGRO1 10498
-#define SOUND_AGGRO2 10497
-#define SOUND_AGGRO3 10488
-#define SOUND_SLAY1 10489
-#define SOUND_SLAY2 10490
-#define SOUND_SLAY3 10499
-#define SOUND_DEATH 10491
-
-struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI
-{
- boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
-
- bool InciteChaos;
- uint32 InciteChaos_Timer;
- uint32 InciteChaosWait_Timer;
- uint32 Charge_Timer;
- uint32 Knockback_Timer;
-
- void Reset()
- {
- InciteChaos = false;
- InciteChaos_Timer = 20000;
- InciteChaosWait_Timer = 15000;
- Charge_Timer = 5000;
- Knockback_Timer = 15000;
-
- if( pInstance )
- pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- case 2:
- DoYell(SAY_SLAY3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY3);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
-
- if( pInstance )
- pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE);
- }
-
- void Aggro(Unit *who)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- break;
- }
-
- if( pInstance )
- pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( InciteChaos )
- {
- if( InciteChaosWait_Timer < diff )
- {
- InciteChaos = false;
- InciteChaosWait_Timer = 15000;
- }else InciteChaosWait_Timer -= diff;
-
- return;
- }
-
- if( InciteChaos_Timer < diff )
- {
- DoCast(m_creature, SPELL_INCITE_CHAOS);
-
- std::list t_list = m_creature->getThreatManager().getThreatList();
- for( std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr )
- {
- Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- if( target && target->GetTypeId() == TYPEID_PLAYER )
- target->CastSpell(target,SPELL_INCITE_CHAOS_B,true);
- }
-
- DoResetThreat();
- InciteChaos = true;
- InciteChaos_Timer = 40000;
- return;
- }else InciteChaos_Timer -= diff;
-
- //Charge_Timer
- if( Charge_Timer < diff )
- {
- if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0) )
- DoCast(target, SPELL_CHARGE);
- Charge_Timer = 25000;
- }else Charge_Timer -= diff;
-
- //Knockback_Timer
- if( Knockback_Timer < diff )
- {
- DoCast(m_creature, SPELL_WAR_STOMP);
- Knockback_Timer = 20000;
- }else Knockback_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_blackheart_the_inciter(Creature *_Creature)
-{
- return new boss_blackheart_the_inciterAI (_Creature);
-}
-
-void AddSC_boss_blackheart_the_inciter()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_blackheart_the_inciter";
- newscript->GetAI = GetAI_boss_blackheart_the_inciter;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Blackheart_the_Inciter
+SD%Complete: 75
+SDComment: Incite Chaos not functional since core lacks Mind Control support
+SDCategory: Auchindoun, Shadow Labyrinth
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_shadow_labyrinth.h"
+
+#define SPELL_INCITE_CHAOS 33676
+#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party
+#define SPELL_CHARGE 33709
+#define SPELL_WAR_STOMP 33707
+
+#define SAY_AGGRO1 "You be dead people!"
+#define SAY_AGGRO2 "Time to kill!"
+#define SAY_AGGRO3 "I see dead people!"
+#define SAY_SLAY1 "No coming back for you!"
+#define SAY_SLAY2 "Nice try!"
+#define SAY_SLAY3 "Now you gone for good!"
+#define SAY_DEATH "This...no...good.."
+
+#define SOUND_AGGRO1 10498
+#define SOUND_AGGRO2 10497
+#define SOUND_AGGRO3 10488
+#define SOUND_SLAY1 10489
+#define SOUND_SLAY2 10490
+#define SOUND_SLAY3 10499
+#define SOUND_DEATH 10491
+
+struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI
+{
+ boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ bool InciteChaos;
+ uint32 InciteChaos_Timer;
+ uint32 InciteChaosWait_Timer;
+ uint32 Charge_Timer;
+ uint32 Knockback_Timer;
+
+ void Reset()
+ {
+ InciteChaos = false;
+ InciteChaos_Timer = 20000;
+ InciteChaosWait_Timer = 15000;
+ Charge_Timer = 5000;
+ Knockback_Timer = 15000;
+
+ if( pInstance )
+ pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ case 2:
+ DoYell(SAY_SLAY3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY3);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+
+ if( pInstance )
+ pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE);
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+ case 2:
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ break;
+ }
+
+ if( pInstance )
+ pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( InciteChaos )
+ {
+ if( InciteChaosWait_Timer < diff )
+ {
+ InciteChaos = false;
+ InciteChaosWait_Timer = 15000;
+ }else InciteChaosWait_Timer -= diff;
+
+ return;
+ }
+
+ if( InciteChaos_Timer < diff )
+ {
+ DoCast(m_creature, SPELL_INCITE_CHAOS);
+
+ std::list t_list = m_creature->getThreatManager().getThreatList();
+ for( std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr )
+ {
+ Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ if( target && target->GetTypeId() == TYPEID_PLAYER )
+ target->CastSpell(target,SPELL_INCITE_CHAOS_B,true);
+ }
+
+ DoResetThreat();
+ InciteChaos = true;
+ InciteChaos_Timer = 40000;
+ return;
+ }else InciteChaos_Timer -= diff;
+
+ //Charge_Timer
+ if( Charge_Timer < diff )
+ {
+ if( Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0) )
+ DoCast(target, SPELL_CHARGE);
+ Charge_Timer = 25000;
+ }else Charge_Timer -= diff;
+
+ //Knockback_Timer
+ if( Knockback_Timer < diff )
+ {
+ DoCast(m_creature, SPELL_WAR_STOMP);
+ Knockback_Timer = 20000;
+ }else Knockback_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_blackheart_the_inciter(Creature *_Creature)
+{
+ return new boss_blackheart_the_inciterAI (_Creature);
+}
+
+void AddSC_boss_blackheart_the_inciter()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_blackheart_the_inciter";
+ newscript->GetAI = GetAI_boss_blackheart_the_inciter;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
index cdea78ce916..af8c2807a1e 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
@@ -1,414 +1,414 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Grandmaster_Vorpil
-SD%Complete: 100
-SDComment:
-SDCategory: Auchindoun, Shadow Labyrinth
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_shadow_labyrinth.h"
-
-#define SAY_INTRO "Keep your minds focused for the days of reckoning are close at hand. Soon, the destroyer of worlds will return to make good on his promise. Soon the destruction of all that is will begin!"
-#define SAY_AGGRO1 "I'll make an offering of your blood!"
-#define SAY_AGGRO2 "You'll be a fine example, for the others."
-#define SAY_AGGRO3 "Good, a worthy sacrifice."
-#define SAY_HELP "Come to my aid, heed your master now!"
-#define SAY_SLAY1 "I serve with pride."
-#define SAY_SLAY2 "Your death is for the greater cause!"
-#define SAY_DEATH "I give my life... Gladly."
-
-#define SOUND_INTRO 10522
-#define SOUND_AGGRO1 10524
-#define SOUND_AGGRO2 10525
-#define SOUND_AGGRO3 10526
-#define SOUND_HELP 10523
-#define SOUND_SLAY1 10527
-#define SOUND_SLAY2 10528
-#define SOUND_DEATH 10529
-
-#define SPELL_RAIN_OF_FIRE 33617
-#define H_SPELL_RAIN_OF_FIRE 39363
-
-#define SPELL_DRAWN_SHADOWS 33563
-#define SPELL_SHADOWBOLT_VOLLEY 33841
-
-#define MOB_VOID_TRAVELER 19226
-#define SPELL_SACRIFICE 33587
-#define SPELL_SHADOW_NOVA 33846
-#define SPELL_HEALVORPIL 33783
-#define H_SPELL_HEALVORPIL 39364
-
-#define MOB_VOID_PORTAL 19224
-#define SPELL_VOID_PORTAL_VISUAL 33569
-
-float VorpilPosition[1][3] =
-{
- {-252.8820,-264.3030,17.1}
-};
-
-float VoidPortalCoords[5][3] =
-{
- {-283.5894, -239.5718, 12.7},
- {-306.5853, -258.4539, 12.7},
- {-295.8789, -269.0899, 12.7},
- {-209.3401, -262.7564, 17.1},
- {-261.4533, -297.3298, 17.1}
-};
-
-struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
-{
- boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Intro = false;
- Reset();
- }
-
- ScriptedInstance *pInstance;
- bool Intro;
- bool sumportals;
- bool HeroicMode;
-
- uint32 ShadowBoltVolley_Timer;
- uint32 DrawnShadows_Timer;
- uint32 sumportals_Timer;
- uint32 summonTraveler_Timer;
- uint64 PortalsGuid[5];
-
- void summonPortals()
- {
- for (int i = 0;i<5;i++)
- {
- Creature *Portal = NULL;
- Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000);
- PortalsGuid[i] = Portal->GetGUID();
- Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false);
- }
- sumportals = true;
- summonTraveler_Timer = 5000;
- }
-
- void destroyPortals()
- {
- for (int i = 0;i < 5; i ++)
- {
- Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]);
- if (Portal)
- if (Portal->isAlive())
- Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- PortalsGuid[i] = 0;
- }
- }
-
- void spawnVoidTraveler()
- {
- srand( (unsigned) time(NULL) ) ;
- int pos = rand()%5;
- Creature *traveler;
- traveler = m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
- }
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- if( HeroicMode )
- debug_log("SD2: creature %u is in heroic mode",m_creature->GetEntry());
-
- ShadowBoltVolley_Timer = 15000;
- DrawnShadows_Timer = 45000;
- sumportals_Timer = 10000;
- summonTraveler_Timer = 90000;
-
- InCombat = false;
- sumportals = false;
- destroyPortals();
-
- if(pInstance)
- pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
-
- case 1:
- DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- destroyPortals();
- if(pInstance)
- pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE);
- }
-
- void StartEvent()
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
- break;
-
- case 1:
- DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
- break;
-
- case 2:
- DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
- break;
- }
-
- if(pInstance)
- pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS);
- }
-
- void Aggro(Unit *who)
- {
- if(!InCombat)
- {
- InCombat = true;
- StartEvent();
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || m_creature->getVictim())
- return;
-
- if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- DoStartAttackAndMovement(who);
- Aggro(who);
- }
- }
- else if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) ) //not sure about right radius
- {
- DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_INTRO);
- Intro = true;
- }
-
- }
-
- void UpdateAI(const uint32 diff)
- {
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (!sumportals)
- if (sumportals_Timer < diff)
- {
- DoYell(SAY_HELP, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_HELP);
- summonPortals();
- sumportals_Timer = 1000000;
-
- }else sumportals_Timer -= diff;
-
- if (ShadowBoltVolley_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY);
- ShadowBoltVolley_Timer = 15000;
- }else ShadowBoltVolley_Timer -= diff;
-
- if ( DrawnShadows_Timer < diff)
- {
- Map *map = m_creature->GetMap();
- if(map->IsDungeon())
- {
- InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers();
- for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if((*i)->isAlive())
- {
- (*i)->TeleportTo(555,VorpilPosition[0][0],VorpilPosition[0][1],VorpilPosition[0][2],0);
- }
- }
- }
- m_creature->Relocate(VorpilPosition[0][0],VorpilPosition[0][1],VorpilPosition[0][2],0);
- DoCast(m_creature,SPELL_DRAWN_SHADOWS,true);
-
- if(!HeroicMode) DoCast(m_creature,SPELL_RAIN_OF_FIRE);
- else DoCast(m_creature,H_SPELL_RAIN_OF_FIRE);
-
- ShadowBoltVolley_Timer = 6000;
- DrawnShadows_Timer = 45000;
- }else DrawnShadows_Timer -= diff;
-
- if ( summonTraveler_Timer < diff)
- {
- spawnVoidTraveler();
- summonTraveler_Timer = 10000;
- }else summonTraveler_Timer -=diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_grandmaster_vorpil(Creature *_Creature)
-{
- return new boss_grandmaster_vorpilAI (_Creature);
-}
-
-struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI
-{
- mob_voidtravelerAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance *pInstance;
- uint32 VorpilCheck_Timer;
- uint32 eventCheck_Timer;
- bool sacrifice;
- bool sacrificed;
- bool oneTarget;
- bool HeroicMode;
-
- uint32 target_timer;
-
- void Reset()
- {
- HeroicMode = m_creature->GetMap()->IsHeroic();
- if( HeroicMode )
- debug_log("SD2: creature %u is in heroic mode",m_creature->GetEntry());
-
- VorpilCheck_Timer = 5000;
- eventCheck_Timer = 1000;
- target_timer = 2000;
- oneTarget = false;
- sacrificed = false;
- sacrifice = false;
- }
- void EnterEvadeMode(){}
- void Aggro(Unit *who) {}
- void AttackStart(Unit *who){}
- void MoveInLineOfSight(Unit *who){}
-
- void UpdateAI(const uint32 diff)
- {
- if (eventCheck_Timer < diff)
- {
- if(pInstance)
- {
- Unit *Vorpil = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_GRANDMASTERVORPIL));
- if (Vorpil)
- {
- if (Vorpil->isDead())
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- if (Vorpil->getVictim())
- {
- if((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
- (*m_creature).GetMotionMaster()->MoveFollow(Vorpil,1,0);
- }
- }
- if(pInstance->GetData(DATA_GRANDMASTERVORPILEVENT) != IN_PROGRESS)
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
- eventCheck_Timer = 5000;
- }else eventCheck_Timer -=diff;
-
- if (VorpilCheck_Timer < diff)
- {
- if (pInstance)
- {
- if (!sacrificed)
- {
- if (!sacrifice)
- {
- Unit *Vorpil = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_GRANDMASTERVORPIL));
- if (Vorpil)
- if (Vorpil->isAlive())
- {
- if (m_creature->IsWithinDistInMap(Vorpil, 2))
- {
- sacrifice = true;
- DoCast(m_creature,SPELL_SACRIFICE);
- VorpilCheck_Timer = 2000;
- }
- }
-
- if (!sacrifice)
- VorpilCheck_Timer = 3000;
- }
- else
- {
- Unit *Vorpil = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_GRANDMASTERVORPIL));
- if (Vorpil)
- if (Vorpil->isAlive())
- {
- if(!HeroicMode) Vorpil->CastSpell(Vorpil,SPELL_HEALVORPIL,true);
- else Vorpil->CastSpell(Vorpil,H_SPELL_HEALVORPIL,true);
- };
- DoCast(m_creature,SPELL_SHADOW_NOVA);
- sacrificed = true;
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- VorpilCheck_Timer = 100000;
- }
- }
- }
- }else VorpilCheck_Timer -= diff;
- }
-};
-
-CreatureAI* GetAI_mob_voidtraveler(Creature *_Creature)
-{
- return new mob_voidtravelerAI (_Creature);
-}
-
-void AddSC_boss_grandmaster_vorpil()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_grandmaster_vorpil";
- newscript->GetAI = GetAI_boss_grandmaster_vorpil;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_voidtraveler";
- newscript->GetAI = GetAI_mob_voidtraveler;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Grandmaster_Vorpil
+SD%Complete: 100
+SDComment:
+SDCategory: Auchindoun, Shadow Labyrinth
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_shadow_labyrinth.h"
+
+#define SAY_INTRO "Keep your minds focused for the days of reckoning are close at hand. Soon, the destroyer of worlds will return to make good on his promise. Soon the destruction of all that is will begin!"
+#define SAY_AGGRO1 "I'll make an offering of your blood!"
+#define SAY_AGGRO2 "You'll be a fine example, for the others."
+#define SAY_AGGRO3 "Good, a worthy sacrifice."
+#define SAY_HELP "Come to my aid, heed your master now!"
+#define SAY_SLAY1 "I serve with pride."
+#define SAY_SLAY2 "Your death is for the greater cause!"
+#define SAY_DEATH "I give my life... Gladly."
+
+#define SOUND_INTRO 10522
+#define SOUND_AGGRO1 10524
+#define SOUND_AGGRO2 10525
+#define SOUND_AGGRO3 10526
+#define SOUND_HELP 10523
+#define SOUND_SLAY1 10527
+#define SOUND_SLAY2 10528
+#define SOUND_DEATH 10529
+
+#define SPELL_RAIN_OF_FIRE 33617
+#define H_SPELL_RAIN_OF_FIRE 39363
+
+#define SPELL_DRAWN_SHADOWS 33563
+#define SPELL_SHADOWBOLT_VOLLEY 33841
+
+#define MOB_VOID_TRAVELER 19226
+#define SPELL_SACRIFICE 33587
+#define SPELL_SHADOW_NOVA 33846
+#define SPELL_HEALVORPIL 33783
+#define H_SPELL_HEALVORPIL 39364
+
+#define MOB_VOID_PORTAL 19224
+#define SPELL_VOID_PORTAL_VISUAL 33569
+
+float VorpilPosition[1][3] =
+{
+ {-252.8820,-264.3030,17.1}
+};
+
+float VoidPortalCoords[5][3] =
+{
+ {-283.5894, -239.5718, 12.7},
+ {-306.5853, -258.4539, 12.7},
+ {-295.8789, -269.0899, 12.7},
+ {-209.3401, -262.7564, 17.1},
+ {-261.4533, -297.3298, 17.1}
+};
+
+struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
+{
+ boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Intro = false;
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ bool Intro;
+ bool sumportals;
+ bool HeroicMode;
+
+ uint32 ShadowBoltVolley_Timer;
+ uint32 DrawnShadows_Timer;
+ uint32 sumportals_Timer;
+ uint32 summonTraveler_Timer;
+ uint64 PortalsGuid[5];
+
+ void summonPortals()
+ {
+ for (int i = 0;i<5;i++)
+ {
+ Creature *Portal = NULL;
+ Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000);
+ PortalsGuid[i] = Portal->GetGUID();
+ Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false);
+ }
+ sumportals = true;
+ summonTraveler_Timer = 5000;
+ }
+
+ void destroyPortals()
+ {
+ for (int i = 0;i < 5; i ++)
+ {
+ Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]);
+ if (Portal)
+ if (Portal->isAlive())
+ Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ PortalsGuid[i] = 0;
+ }
+ }
+
+ void spawnVoidTraveler()
+ {
+ srand( (unsigned) time(NULL) ) ;
+ int pos = rand()%5;
+ Creature *traveler;
+ traveler = m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
+ }
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ if( HeroicMode )
+ debug_log("SD2: creature %u is in heroic mode",m_creature->GetEntry());
+
+ ShadowBoltVolley_Timer = 15000;
+ DrawnShadows_Timer = 45000;
+ sumportals_Timer = 10000;
+ summonTraveler_Timer = 90000;
+
+ InCombat = false;
+ sumportals = false;
+ destroyPortals();
+
+ if(pInstance)
+ pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+
+ case 1:
+ DoYell(SAY_SLAY2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ destroyPortals();
+ if(pInstance)
+ pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE);
+ }
+
+ void StartEvent()
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO1);
+ break;
+
+ case 1:
+ DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO2);
+ break;
+
+ case 2:
+ DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO3);
+ break;
+ }
+
+ if(pInstance)
+ pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(!InCombat)
+ {
+ InCombat = true;
+ StartEvent();
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || m_creature->getVictim())
+ return;
+
+ if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ DoStartAttackAndMovement(who);
+ Aggro(who);
+ }
+ }
+ else if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) ) //not sure about right radius
+ {
+ DoYell(SAY_INTRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_INTRO);
+ Intro = true;
+ }
+
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (!sumportals)
+ if (sumportals_Timer < diff)
+ {
+ DoYell(SAY_HELP, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_HELP);
+ summonPortals();
+ sumportals_Timer = 1000000;
+
+ }else sumportals_Timer -= diff;
+
+ if (ShadowBoltVolley_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY);
+ ShadowBoltVolley_Timer = 15000;
+ }else ShadowBoltVolley_Timer -= diff;
+
+ if ( DrawnShadows_Timer < diff)
+ {
+ Map *map = m_creature->GetMap();
+ if(map->IsDungeon())
+ {
+ InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers();
+ for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ if((*i)->isAlive())
+ {
+ (*i)->TeleportTo(555,VorpilPosition[0][0],VorpilPosition[0][1],VorpilPosition[0][2],0);
+ }
+ }
+ }
+ m_creature->Relocate(VorpilPosition[0][0],VorpilPosition[0][1],VorpilPosition[0][2],0);
+ DoCast(m_creature,SPELL_DRAWN_SHADOWS,true);
+
+ if(!HeroicMode) DoCast(m_creature,SPELL_RAIN_OF_FIRE);
+ else DoCast(m_creature,H_SPELL_RAIN_OF_FIRE);
+
+ ShadowBoltVolley_Timer = 6000;
+ DrawnShadows_Timer = 45000;
+ }else DrawnShadows_Timer -= diff;
+
+ if ( summonTraveler_Timer < diff)
+ {
+ spawnVoidTraveler();
+ summonTraveler_Timer = 10000;
+ }else summonTraveler_Timer -=diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_grandmaster_vorpil(Creature *_Creature)
+{
+ return new boss_grandmaster_vorpilAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI
+{
+ mob_voidtravelerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ uint32 VorpilCheck_Timer;
+ uint32 eventCheck_Timer;
+ bool sacrifice;
+ bool sacrificed;
+ bool oneTarget;
+ bool HeroicMode;
+
+ uint32 target_timer;
+
+ void Reset()
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ if( HeroicMode )
+ debug_log("SD2: creature %u is in heroic mode",m_creature->GetEntry());
+
+ VorpilCheck_Timer = 5000;
+ eventCheck_Timer = 1000;
+ target_timer = 2000;
+ oneTarget = false;
+ sacrificed = false;
+ sacrifice = false;
+ }
+ void EnterEvadeMode(){}
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit *who){}
+ void MoveInLineOfSight(Unit *who){}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (eventCheck_Timer < diff)
+ {
+ if(pInstance)
+ {
+ Unit *Vorpil = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_GRANDMASTERVORPIL));
+ if (Vorpil)
+ {
+ if (Vorpil->isDead())
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ if (Vorpil->getVictim())
+ {
+ if((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ (*m_creature).GetMotionMaster()->MoveFollow(Vorpil,1,0);
+ }
+ }
+ if(pInstance->GetData(DATA_GRANDMASTERVORPILEVENT) != IN_PROGRESS)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+ eventCheck_Timer = 5000;
+ }else eventCheck_Timer -=diff;
+
+ if (VorpilCheck_Timer < diff)
+ {
+ if (pInstance)
+ {
+ if (!sacrificed)
+ {
+ if (!sacrifice)
+ {
+ Unit *Vorpil = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_GRANDMASTERVORPIL));
+ if (Vorpil)
+ if (Vorpil->isAlive())
+ {
+ if (m_creature->IsWithinDistInMap(Vorpil, 2))
+ {
+ sacrifice = true;
+ DoCast(m_creature,SPELL_SACRIFICE);
+ VorpilCheck_Timer = 2000;
+ }
+ }
+
+ if (!sacrifice)
+ VorpilCheck_Timer = 3000;
+ }
+ else
+ {
+ Unit *Vorpil = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_GRANDMASTERVORPIL));
+ if (Vorpil)
+ if (Vorpil->isAlive())
+ {
+ if(!HeroicMode) Vorpil->CastSpell(Vorpil,SPELL_HEALVORPIL,true);
+ else Vorpil->CastSpell(Vorpil,H_SPELL_HEALVORPIL,true);
+ };
+ DoCast(m_creature,SPELL_SHADOW_NOVA);
+ sacrificed = true;
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ VorpilCheck_Timer = 100000;
+ }
+ }
+ }
+ }else VorpilCheck_Timer -= diff;
+ }
+};
+
+CreatureAI* GetAI_mob_voidtraveler(Creature *_Creature)
+{
+ return new mob_voidtravelerAI (_Creature);
+}
+
+void AddSC_boss_grandmaster_vorpil()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_grandmaster_vorpil";
+ newscript->GetAI = GetAI_boss_grandmaster_vorpil;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_voidtraveler";
+ newscript->GetAI = GetAI_mob_voidtraveler;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
index c176b2056cd..55456c86286 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
@@ -1,192 +1,192 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Murmur
-SD%Complete: 75
-SDComment: Database should have `RegenHealth`=0 to prevent regen. Also, his shockwave triggered after magnetic pull may be incorrect. Murmur's Touch does not work properly.
-SDCategory: Auchindoun, Shadow Labyrinth
-EndScriptData */
-
-#include "precompiled.h"
-
-#define EMOTE_SONIC_BOOM "draws energy from the air."
-
-#define SPELL_MAGNETIC_PULL 33689
-#define SPELL_SONIC_BOOM_PRE 33923
-#define SPELL_SONIC_BOOM_CAST 38795
-#define SPELL_MURMURS_TOUCH 33711
-#define SPELL_RESONANCE 33657
-#define SPELL_SHOCKWAVE 33686
-
-struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI
-{
- boss_murmurAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SonicBoom_Timer;
- uint32 MurmursTouch_Timer;
- uint32 Resonance_Timer;
- uint32 MagneticPull_Timer;
- bool CanSonicBoom;
- bool CanShockWave;
- uint64 pTarget;
-
- void Reset()
- {
- SonicBoom_Timer = 30000;
- MurmursTouch_Timer = 20000;
- Resonance_Timer = 10000;
- MagneticPull_Timer = 45000;
- CanSonicBoom = false;
- CanShockWave = false;
- pTarget = 0;
-
- //database should have `RegenHealth`=0 to prevent regen
- uint32 hp = m_creature->GetMaxHealth()*0.4;
- if( hp )
- m_creature->SetHealth(hp);
- }
-
- void Aggro(Unit *who) { }
-
- void AttackStart(Unit* who)
- {
- if (!who)
- return;
-
- if (who->isTargetableForAttack())
- {
- //Begin attack
- DoStartAttackNoMovement(who);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- DoStartAttackNoMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //SonicBoom_Timer
- if(SonicBoom_Timer < diff)
- {
- if(CanSonicBoom)
- {
- DoCast(m_creature, SPELL_SONIC_BOOM_CAST,true);
- CanSonicBoom = false;
- SonicBoom_Timer = 30000;
- }
- else
- {
- DoTextEmote(EMOTE_SONIC_BOOM,NULL);
- DoCast(m_creature,SPELL_SONIC_BOOM_PRE);
- CanSonicBoom = true;
- SonicBoom_Timer = 5000;
- }
- }else SonicBoom_Timer -= diff;
-
- //MurmursTouch_Timer
- if(MurmursTouch_Timer < diff)
- {
- /*Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if(target)
- DoCast(target, SPELL_MURMURS_TOUCH);*/
- DoCast(m_creature, SPELL_MURMURS_TOUCH);
- MurmursTouch_Timer = 30000;
- }else MurmursTouch_Timer -= diff;
-
- //Resonance_Timer
- if(Resonance_Timer < diff)
- {
- if( !m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE) )
- DoCast(m_creature->getVictim(), SPELL_RESONANCE);
- Resonance_Timer = 5000;
- }else Resonance_Timer -= diff;
-
- //MagneticPull_Timer
- if(MagneticPull_Timer < diff)
- {
- if( !CanShockWave )
- {
- if( Unit* temp = SelectUnit(SELECT_TARGET_RANDOM,0) )
- {
- if( temp->GetTypeId() == TYPEID_PLAYER )
- {
- DoCast(temp, SPELL_MAGNETIC_PULL);
- pTarget = temp->GetGUID();
- CanShockWave = true;
- }
- MagneticPull_Timer = 2500;
- }
- }
- else
- {
- if( Unit* target = Unit::GetUnit(*m_creature,pTarget) )
- target->CastSpell(target,SPELL_SHOCKWAVE,true);
-
- MagneticPull_Timer = 35000;
- CanShockWave = false;
- pTarget = 0;
- }
- }else MagneticPull_Timer -= diff;
-
- //no meele if preparing for sonic boom
- if(!CanSonicBoom)
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_murmur(Creature *_Creature)
-{
- return new boss_murmurAI (_Creature);
-}
-
-void AddSC_boss_murmur()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_murmur";
- newscript->GetAI = GetAI_boss_murmur;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Murmur
+SD%Complete: 75
+SDComment: Database should have `RegenHealth`=0 to prevent regen. Also, his shockwave triggered after magnetic pull may be incorrect. Murmur's Touch does not work properly.
+SDCategory: Auchindoun, Shadow Labyrinth
+EndScriptData */
+
+#include "precompiled.h"
+
+#define EMOTE_SONIC_BOOM "draws energy from the air."
+
+#define SPELL_MAGNETIC_PULL 33689
+#define SPELL_SONIC_BOOM_PRE 33923
+#define SPELL_SONIC_BOOM_CAST 38795
+#define SPELL_MURMURS_TOUCH 33711
+#define SPELL_RESONANCE 33657
+#define SPELL_SHOCKWAVE 33686
+
+struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI
+{
+ boss_murmurAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SonicBoom_Timer;
+ uint32 MurmursTouch_Timer;
+ uint32 Resonance_Timer;
+ uint32 MagneticPull_Timer;
+ bool CanSonicBoom;
+ bool CanShockWave;
+ uint64 pTarget;
+
+ void Reset()
+ {
+ SonicBoom_Timer = 30000;
+ MurmursTouch_Timer = 20000;
+ Resonance_Timer = 10000;
+ MagneticPull_Timer = 45000;
+ CanSonicBoom = false;
+ CanShockWave = false;
+ pTarget = 0;
+
+ //database should have `RegenHealth`=0 to prevent regen
+ uint32 hp = m_creature->GetMaxHealth()*0.4;
+ if( hp )
+ m_creature->SetHealth(hp);
+ }
+
+ void Aggro(Unit *who) { }
+
+ void AttackStart(Unit* who)
+ {
+ if (!who)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ //Begin attack
+ DoStartAttackNoMovement(who);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ DoStartAttackNoMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //SonicBoom_Timer
+ if(SonicBoom_Timer < diff)
+ {
+ if(CanSonicBoom)
+ {
+ DoCast(m_creature, SPELL_SONIC_BOOM_CAST,true);
+ CanSonicBoom = false;
+ SonicBoom_Timer = 30000;
+ }
+ else
+ {
+ DoTextEmote(EMOTE_SONIC_BOOM,NULL);
+ DoCast(m_creature,SPELL_SONIC_BOOM_PRE);
+ CanSonicBoom = true;
+ SonicBoom_Timer = 5000;
+ }
+ }else SonicBoom_Timer -= diff;
+
+ //MurmursTouch_Timer
+ if(MurmursTouch_Timer < diff)
+ {
+ /*Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if(target)
+ DoCast(target, SPELL_MURMURS_TOUCH);*/
+ DoCast(m_creature, SPELL_MURMURS_TOUCH);
+ MurmursTouch_Timer = 30000;
+ }else MurmursTouch_Timer -= diff;
+
+ //Resonance_Timer
+ if(Resonance_Timer < diff)
+ {
+ if( !m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE) )
+ DoCast(m_creature->getVictim(), SPELL_RESONANCE);
+ Resonance_Timer = 5000;
+ }else Resonance_Timer -= diff;
+
+ //MagneticPull_Timer
+ if(MagneticPull_Timer < diff)
+ {
+ if( !CanShockWave )
+ {
+ if( Unit* temp = SelectUnit(SELECT_TARGET_RANDOM,0) )
+ {
+ if( temp->GetTypeId() == TYPEID_PLAYER )
+ {
+ DoCast(temp, SPELL_MAGNETIC_PULL);
+ pTarget = temp->GetGUID();
+ CanShockWave = true;
+ }
+ MagneticPull_Timer = 2500;
+ }
+ }
+ else
+ {
+ if( Unit* target = Unit::GetUnit(*m_creature,pTarget) )
+ target->CastSpell(target,SPELL_SHOCKWAVE,true);
+
+ MagneticPull_Timer = 35000;
+ CanShockWave = false;
+ pTarget = 0;
+ }
+ }else MagneticPull_Timer -= diff;
+
+ //no meele if preparing for sonic boom
+ if(!CanSonicBoom)
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_murmur(Creature *_Creature)
+{
+ return new boss_murmurAI (_Creature);
+}
+
+void AddSC_boss_murmur()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_murmur";
+ newscript->GetAI = GetAI_boss_murmur;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h
index 38b30fcd6fa..3331999c83a 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h
@@ -1,14 +1,14 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_SHADOW_LABYRINTH_H
-#define DEF_SHADOW_LABYRINTH_H
-
-#define TYPE_HELLMAW 1
-#define TYPE_OVERSEER 2
-#define DATA_BLACKHEARTTHEINCITEREVENT 3
-#define DATA_GRANDMASTERVORPILEVENT 4
-#define DATA_MURMUREVENT 5
-#define DATA_GRANDMASTERVORPIL 6
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_SHADOW_LABYRINTH_H
+#define DEF_SHADOW_LABYRINTH_H
+
+#define TYPE_HELLMAW 1
+#define TYPE_OVERSEER 2
+#define DATA_BLACKHEARTTHEINCITEREVENT 3
+#define DATA_GRANDMASTERVORPILEVENT 4
+#define DATA_MURMUREVENT 5
+#define DATA_GRANDMASTERVORPIL 6
+#endif
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
index 643887d64fb..1d482754cbc 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
@@ -1,178 +1,178 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Shadow_Labyrinth
-SD%Complete: 85
-SDComment: Some cleanup left along with save
-SDCategory: Auchindoun, Shadow Labyrinth
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_shadow_labyrinth.h"
-
-#define ENCOUNTERS 5
-
-#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies
-#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies
-
-/* Shadow Labyrinth encounters:
-1 - Ambassador Hellmaw event
-2 - Blackheart the Inciter event
-3 - Grandmaster Vorpil event
-4 - Murmur event
-*/
-
-struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
-{
- instance_shadow_labyrinth(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- uint32 Encounter[ENCOUNTERS];
-
- GameObject *RefectoryDoor;
- GameObject *ScreamingHallDoor;
- uint64 GrandmasterVorpil;
- uint32 FelOverseerCount;
-
- void Initialize()
- {
- RefectoryDoor = NULL;
- ScreamingHallDoor = NULL;
- GrandmasterVorpil = 0;
- FelOverseerCount = 0;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounter[i] = false;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if(Encounter[i]) return true;
-
- return false;
- }
-
- void OnObjectCreate(GameObject *go)
- {
- switch(go->GetEntry())
- {
- case REFECTORY_DOOR:
- RefectoryDoor = go;
- break;
- case SCREAMING_HALL_DOOR:
- ScreamingHallDoor = go;
- break;
- }
- }
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case 18732:
- GrandmasterVorpil = creature->GetGUID();
- break;
- case 18796:
- ++FelOverseerCount;
- debug_log("SD2: Shadow Labyrinth: counting %u Fel Overseers.",FelOverseerCount);
- break;
- }
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case TYPE_HELLMAW:
- Encounter[0] = data;
- break;
-
- case TYPE_OVERSEER:
- if( data != DONE )
- error_log("SD2: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE");
- if( FelOverseerCount )
- {
- --FelOverseerCount;
- debug_log("SD2: Shadow Labyrinth: %u Fel Overseers left to kill.",FelOverseerCount);
- }
- if( FelOverseerCount == 0 )
- {
- Encounter[1] = DONE;
- debug_log("SD2: Shadow Labyrinth: TYPE_OVERSEER == DONE");
- }
- break;
-
- case DATA_BLACKHEARTTHEINCITEREVENT:
- if( data == DONE )
- {
- if( RefectoryDoor )
- RefectoryDoor->UseDoorOrButton();
- }
- Encounter[2] = data;
- break;
-
- case DATA_GRANDMASTERVORPILEVENT:
- if( data == DONE )
- {
- if( ScreamingHallDoor )
- ScreamingHallDoor->UseDoorOrButton();
- }
- Encounter[3] = data;
- break;
-
- case DATA_MURMUREVENT:
- Encounter[4] = data;
- break;
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch( type )
- {
- case TYPE_HELLMAW:
- return Encounter[0];
- case TYPE_OVERSEER:
- return Encounter[1];
- case DATA_GRANDMASTERVORPILEVENT:
- return Encounter[3];
- }
- return false;
- }
-
- uint64 GetData64(uint32 identifier)
- {
- if(identifier == DATA_GRANDMASTERVORPIL)
- return GrandmasterVorpil;
-
- return 0;
- }
-};
-
-InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* map)
-{
- return new instance_shadow_labyrinth(map);
-}
-
-void AddSC_instance_shadow_labyrinth()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_shadow_labyrinth";
- newscript->GetInstanceData = GetInstanceData_instance_shadow_labyrinth;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Shadow_Labyrinth
+SD%Complete: 85
+SDComment: Some cleanup left along with save
+SDCategory: Auchindoun, Shadow Labyrinth
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_shadow_labyrinth.h"
+
+#define ENCOUNTERS 5
+
+#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies
+#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies
+
+/* Shadow Labyrinth encounters:
+1 - Ambassador Hellmaw event
+2 - Blackheart the Inciter event
+3 - Grandmaster Vorpil event
+4 - Murmur event
+*/
+
+struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
+{
+ instance_shadow_labyrinth(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint32 Encounter[ENCOUNTERS];
+
+ GameObject *RefectoryDoor;
+ GameObject *ScreamingHallDoor;
+ uint64 GrandmasterVorpil;
+ uint32 FelOverseerCount;
+
+ void Initialize()
+ {
+ RefectoryDoor = NULL;
+ ScreamingHallDoor = NULL;
+ GrandmasterVorpil = 0;
+ FelOverseerCount = 0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounter[i] = false;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if(Encounter[i]) return true;
+
+ return false;
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch(go->GetEntry())
+ {
+ case REFECTORY_DOOR:
+ RefectoryDoor = go;
+ break;
+ case SCREAMING_HALL_DOOR:
+ ScreamingHallDoor = go;
+ break;
+ }
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 18732:
+ GrandmasterVorpil = creature->GetGUID();
+ break;
+ case 18796:
+ ++FelOverseerCount;
+ debug_log("SD2: Shadow Labyrinth: counting %u Fel Overseers.",FelOverseerCount);
+ break;
+ }
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case TYPE_HELLMAW:
+ Encounter[0] = data;
+ break;
+
+ case TYPE_OVERSEER:
+ if( data != DONE )
+ error_log("SD2: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE");
+ if( FelOverseerCount )
+ {
+ --FelOverseerCount;
+ debug_log("SD2: Shadow Labyrinth: %u Fel Overseers left to kill.",FelOverseerCount);
+ }
+ if( FelOverseerCount == 0 )
+ {
+ Encounter[1] = DONE;
+ debug_log("SD2: Shadow Labyrinth: TYPE_OVERSEER == DONE");
+ }
+ break;
+
+ case DATA_BLACKHEARTTHEINCITEREVENT:
+ if( data == DONE )
+ {
+ if( RefectoryDoor )
+ RefectoryDoor->UseDoorOrButton();
+ }
+ Encounter[2] = data;
+ break;
+
+ case DATA_GRANDMASTERVORPILEVENT:
+ if( data == DONE )
+ {
+ if( ScreamingHallDoor )
+ ScreamingHallDoor->UseDoorOrButton();
+ }
+ Encounter[3] = data;
+ break;
+
+ case DATA_MURMUREVENT:
+ Encounter[4] = data;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch( type )
+ {
+ case TYPE_HELLMAW:
+ return Encounter[0];
+ case TYPE_OVERSEER:
+ return Encounter[1];
+ case DATA_GRANDMASTERVORPILEVENT:
+ return Encounter[3];
+ }
+ return false;
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ if(identifier == DATA_GRANDMASTERVORPIL)
+ return GrandmasterVorpil;
+
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* map)
+{
+ return new instance_shadow_labyrinth(map);
+}
+
+void AddSC_instance_shadow_labyrinth()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_shadow_labyrinth";
+ newscript->GetInstanceData = GetInstanceData_instance_shadow_labyrinth;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
index b9ec3538637..101345850d6 100644
--- a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
+++ b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
@@ -1,164 +1,164 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Azshara
-SD%Complete: 90
-SDComment: Quest support: 2744, 3141, 9364
-SDCategory: Azshara
-EndScriptData */
-
-/* ContentData
-mobs_spitelashes
-npc_loramus_thalipedes
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mobs_spitelashes
-######*/
-
-struct TRINITY_DLL_DECL mobs_spitelashesAI : public ScriptedAI
-{
- mobs_spitelashesAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 morphtimer;
- bool spellhit;
-
- void Reset()
- {
- morphtimer = 0;
- spellhit = false;
- }
-
- void Aggro(Unit *who) { }
-
- void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
- {
- if( !spellhit &&
- Hitter->GetTypeId() == TYPEID_PLAYER &&
- ((Player*)Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE &&
- (Spellkind->Id==118 || Spellkind->Id== 12824 || Spellkind->Id== 12825 || Spellkind->Id== 12826) )
- {
- spellhit=true;
- DoCast(m_creature,29124); //become a sheep
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- // we mustn't remove the creature in the same round in which we cast the summon spell, otherwise there will be no summons
- if( spellhit && morphtimer>=5000 )
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse(); //you don't see any corpse on off.
- EnterEvadeMode(); //spellhit will be set to false
- }
- // walk 5 seconds before summoning
- if( spellhit && morphtimer<5000 )
- {
- morphtimer+=diff;
- if( morphtimer>=5000 )
- {
- DoCast(m_creature,28406); //summon copies
- DoCast(m_creature,6924); //visual explosion
- }
- }
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //TODO: add abilities for the different creatures
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mobs_spitelashes(Creature *_Creature)
-{
- return new mobs_spitelashesAI (_Creature);
-}
-
-/*######
-## npc_loramus_thalipedes
-######*/
-
-bool GossipHello_npc_loramus_thalipedes(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Can you help me?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- if (player->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_loramus_thalipedes(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(2744);
- break;
-
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "Please continue", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
- player->SEND_GOSSIP_MENU(1813, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+21:
- player->ADD_GOSSIP_ITEM( 0, "I do not understand", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
- player->SEND_GOSSIP_MENU(1814, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+22:
- player->ADD_GOSSIP_ITEM( 0, "Indeed", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
- player->SEND_GOSSIP_MENU(1815, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+23:
- player->ADD_GOSSIP_ITEM( 0, "I will do this with or your help, Loramus", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
- player->SEND_GOSSIP_MENU(1816, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+24:
- player->ADD_GOSSIP_ITEM( 0, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25);
- player->SEND_GOSSIP_MENU(1817, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+25:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(3141);
- break;
- }
- return true;
-}
-
-void AddSC_azshara()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mobs_spitelashes";
- newscript->GetAI = GetAI_mobs_spitelashes;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_loramus_thalipedes";
- newscript->pGossipHello = &GossipHello_npc_loramus_thalipedes;
- newscript->pGossipSelect = &GossipSelect_npc_loramus_thalipedes;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Azshara
+SD%Complete: 90
+SDComment: Quest support: 2744, 3141, 9364
+SDCategory: Azshara
+EndScriptData */
+
+/* ContentData
+mobs_spitelashes
+npc_loramus_thalipedes
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mobs_spitelashes
+######*/
+
+struct TRINITY_DLL_DECL mobs_spitelashesAI : public ScriptedAI
+{
+ mobs_spitelashesAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 morphtimer;
+ bool spellhit;
+
+ void Reset()
+ {
+ morphtimer = 0;
+ spellhit = false;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
+ {
+ if( !spellhit &&
+ Hitter->GetTypeId() == TYPEID_PLAYER &&
+ ((Player*)Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE &&
+ (Spellkind->Id==118 || Spellkind->Id== 12824 || Spellkind->Id== 12825 || Spellkind->Id== 12826) )
+ {
+ spellhit=true;
+ DoCast(m_creature,29124); //become a sheep
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ // we mustn't remove the creature in the same round in which we cast the summon spell, otherwise there will be no summons
+ if( spellhit && morphtimer>=5000 )
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse(); //you don't see any corpse on off.
+ EnterEvadeMode(); //spellhit will be set to false
+ }
+ // walk 5 seconds before summoning
+ if( spellhit && morphtimer<5000 )
+ {
+ morphtimer+=diff;
+ if( morphtimer>=5000 )
+ {
+ DoCast(m_creature,28406); //summon copies
+ DoCast(m_creature,6924); //visual explosion
+ }
+ }
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //TODO: add abilities for the different creatures
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mobs_spitelashes(Creature *_Creature)
+{
+ return new mobs_spitelashesAI (_Creature);
+}
+
+/*######
+## npc_loramus_thalipedes
+######*/
+
+bool GossipHello_npc_loramus_thalipedes(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Can you help me?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ if (player->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_loramus_thalipedes(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(2744);
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "Please continue", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
+ player->SEND_GOSSIP_MENU(1813, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+21:
+ player->ADD_GOSSIP_ITEM( 0, "I do not understand", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
+ player->SEND_GOSSIP_MENU(1814, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+22:
+ player->ADD_GOSSIP_ITEM( 0, "Indeed", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
+ player->SEND_GOSSIP_MENU(1815, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+23:
+ player->ADD_GOSSIP_ITEM( 0, "I will do this with or your help, Loramus", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
+ player->SEND_GOSSIP_MENU(1816, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+24:
+ player->ADD_GOSSIP_ITEM( 0, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25);
+ player->SEND_GOSSIP_MENU(1817, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+25:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(3141);
+ break;
+ }
+ return true;
+}
+
+void AddSC_azshara()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mobs_spitelashes";
+ newscript->GetAI = GetAI_mobs_spitelashes;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_loramus_thalipedes";
+ newscript->pGossipHello = &GossipHello_npc_loramus_thalipedes;
+ newscript->pGossipSelect = &GossipSelect_npc_loramus_thalipedes;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp
index 5705c9a44fb..2908dc04285 100644
--- a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp
+++ b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp
@@ -1,153 +1,153 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Azuregos
-SD%Complete: 90
-SDComment: Teleport not included, spell reflect not effecting dots (Core problem)
-SDCategory: Azshara
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_MARKOFFROST 23182
-#define SPELL_MANASTORM 21097
-#define SPELL_CHILL 21098
-#define SPELL_FROSTBREATH 21099
-#define SPELL_REFLECT 22067 //Old one was 30969
-#define SPELL_CLEAVE 8255 //Perhaps not right ID
-#define SPELL_ENRAGE 23537
-
-struct TRINITY_DLL_DECL boss_azuregosAI : public ScriptedAI
-{
- boss_azuregosAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MarkOfFrost_Timer;
- uint32 ManaStorm_Timer;
- uint32 Chill_Timer;
- uint32 Breath_Timer;
- uint32 Teleport_Timer;
- uint32 Reflect_Timer;
- uint32 Cleave_Timer;
- uint32 Enrage_Timer;
- bool Enraged;
-
- void Reset()
- {
- MarkOfFrost_Timer = 35000;
- ManaStorm_Timer = 5000 + rand()%12000;
- Chill_Timer = 10000 + rand()%20000;
- Breath_Timer = 2000 + rand()%6000;
- Teleport_Timer = 30000;
- Reflect_Timer = 15000 + rand()%15000;
- Cleave_Timer = 7000;
- Enrage_Timer = 0;
- Enraged = false;
- }
-
- void Aggro(Unit *who) {}
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if(Teleport_Timer < diff)
- {
- std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
- std::list::iterator i = m_threatlist.begin();
- for (i = m_threatlist.begin(); i!= m_threatlist.end();++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
- {
- DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+3, pUnit->GetOrientation());
- }
- }
-
- DoResetThreat();
- Teleport_Timer = 30000;
- }else Teleport_Timer -= diff;
-
- // //MarkOfFrost_Timer
- // if (MarkOfFrost_Timer < diff)
- // {
- // DoCast(m_creature->getVictim(),SPELL_MARKOFFROST);
- // MarkOfFrost_Timer = 25000;
- // }else MarkOfFrost_Timer -= diff;
-
- //Chill_Timer
- if (Chill_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CHILL);
- Chill_Timer = 13000 + rand()%12000;
- }else Chill_Timer -= diff;
-
- //Breath_Timer
- if (Breath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTBREATH);
- Breath_Timer = 10000 + rand()%5000;
- }else Breath_Timer -= diff;
-
- //ManaStorm_Timer
- if (ManaStorm_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- DoCast(target,SPELL_MANASTORM);
- ManaStorm_Timer = 7500 + rand()%5000;
- }else ManaStorm_Timer -= diff;
-
- //Reflect_Timer
- if (Reflect_Timer < diff)
- {
- DoCast(m_creature,SPELL_REFLECT);
- Reflect_Timer = 20000 + rand()%15000;
- }else Reflect_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- //Enrage_Timer
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 && !Enraged)
- {
- DoCast(m_creature, SPELL_ENRAGE);
- Enraged = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_azuregos(Creature *_Creature)
-{
- return new boss_azuregosAI (_Creature);
-}
-
-void AddSC_boss_azuregos()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_azuregos";
- newscript->GetAI = GetAI_boss_azuregos;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Azuregos
+SD%Complete: 90
+SDComment: Teleport not included, spell reflect not effecting dots (Core problem)
+SDCategory: Azshara
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_MARKOFFROST 23182
+#define SPELL_MANASTORM 21097
+#define SPELL_CHILL 21098
+#define SPELL_FROSTBREATH 21099
+#define SPELL_REFLECT 22067 //Old one was 30969
+#define SPELL_CLEAVE 8255 //Perhaps not right ID
+#define SPELL_ENRAGE 23537
+
+struct TRINITY_DLL_DECL boss_azuregosAI : public ScriptedAI
+{
+ boss_azuregosAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MarkOfFrost_Timer;
+ uint32 ManaStorm_Timer;
+ uint32 Chill_Timer;
+ uint32 Breath_Timer;
+ uint32 Teleport_Timer;
+ uint32 Reflect_Timer;
+ uint32 Cleave_Timer;
+ uint32 Enrage_Timer;
+ bool Enraged;
+
+ void Reset()
+ {
+ MarkOfFrost_Timer = 35000;
+ ManaStorm_Timer = 5000 + rand()%12000;
+ Chill_Timer = 10000 + rand()%20000;
+ Breath_Timer = 2000 + rand()%6000;
+ Teleport_Timer = 30000;
+ Reflect_Timer = 15000 + rand()%15000;
+ Cleave_Timer = 7000;
+ Enrage_Timer = 0;
+ Enraged = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if(Teleport_Timer < diff)
+ {
+ std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list::iterator i = m_threatlist.begin();
+ for (i = m_threatlist.begin(); i!= m_threatlist.end();++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
+ {
+ DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+3, pUnit->GetOrientation());
+ }
+ }
+
+ DoResetThreat();
+ Teleport_Timer = 30000;
+ }else Teleport_Timer -= diff;
+
+ // //MarkOfFrost_Timer
+ // if (MarkOfFrost_Timer < diff)
+ // {
+ // DoCast(m_creature->getVictim(),SPELL_MARKOFFROST);
+ // MarkOfFrost_Timer = 25000;
+ // }else MarkOfFrost_Timer -= diff;
+
+ //Chill_Timer
+ if (Chill_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CHILL);
+ Chill_Timer = 13000 + rand()%12000;
+ }else Chill_Timer -= diff;
+
+ //Breath_Timer
+ if (Breath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTBREATH);
+ Breath_Timer = 10000 + rand()%5000;
+ }else Breath_Timer -= diff;
+
+ //ManaStorm_Timer
+ if (ManaStorm_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ DoCast(target,SPELL_MANASTORM);
+ ManaStorm_Timer = 7500 + rand()%5000;
+ }else ManaStorm_Timer -= diff;
+
+ //Reflect_Timer
+ if (Reflect_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_REFLECT);
+ Reflect_Timer = 20000 + rand()%15000;
+ }else Reflect_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ //Enrage_Timer
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 && !Enraged)
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ Enraged = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_azuregos(Creature *_Creature)
+{
+ return new boss_azuregosAI (_Creature);
+}
+
+void AddSC_boss_azuregos()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_azuregos";
+ newscript->GetAI = GetAI_boss_azuregos;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
index 285d73fa574..43209b64ba8 100644
--- a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
+++ b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
@@ -1,372 +1,372 @@
-/* Copyright (C) 2006,2007 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Azuremyst_Isle
-SD%Complete: 75
-SDComment: Quest support: 9283, 9537, 9554(special flight path, proper model for mount missing). Injured Draenei cosmetic only
-SDCategory: Azuremyst Isle
-EndScriptData */
-
-/* ContentData
-npc_draenei_survivor
-npc_engineer_spark_overgrind
-npc_injured_draenei
-npc_susurrus
-EndContentData */
-
-#include "precompiled.h"
-#include
-
-/*######
-## npc_draenei_survivor
-######*/
-
-#define HEAL1 "The last thing I remember is the ship falling and us getting into the pods. I'll go see how I can help. Thank you!"
-#define HEAL2 "$C, Where am I? Who are you? Oh no! What happened to the ship?."
-#define HEAL3 "$C You saved me! I owe you a debt that I can never repay. I'll go see if I can help the others."
-#define HEAL4 "Ugh... what is this place? Is that all that's left of the ship over there?"
-
-#define HELP1 "Oh, the pain..."
-#define HELP2 "Everything hurts, Please make it stop..."
-#define HELP3 "Ughhh... I hurt. Can you help me?"
-#define HELP4 "I don't know if I can make it, please help me..."
-
-struct TRINITY_DLL_DECL npc_draenei_survivorAI : public ScriptedAI
-{
- npc_draenei_survivorAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 UnSpawnTimer;
- uint32 ResetlifeTimer;
- uint32 SayingTimer;
- uint32 HealSayTimer;
- bool UnSpawn;
- bool say;
- bool HealSay;
- bool isRun;
- bool isMove;
-
- void Reset()
- {
- UnSpawnTimer = 2500;
- ResetlifeTimer= 60000;
- SayingTimer = 5000;
- HealSayTimer = 6000;
- say = false;
- isRun = false;
- isMove = false;
- UnSpawn = false;
- HealSay = false;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //cast red shining
- m_creature->CastSpell(m_creature, 29152, false, NULL);
- //set creature health
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
- }
-
- void Aggro(Unit *who) {}
-
- void MoveInLineOfSight(Unit *who) //MoveInLineOfSight is called if creature could see you, updated all 100 ms
- {
- if (!who)
- return;
-
- if(who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 15) && say && !isRun)
- {
- switch (rand()%4) //Random switch between 4 texts
- {
- case 0:
- DoSay(HELP1, LANG_UNIVERSAL, NULL);
- SayingTimer = 15000;
- say = false;
- break;
- case 1:
- DoSay(HELP2, LANG_UNIVERSAL, NULL);
- SayingTimer = 15000;
- say = false;
- break;
- case 2:
- DoSay(HELP3, LANG_UNIVERSAL, NULL);
- SayingTimer = 15000;
- say = false;
- break;
- case 3:
- DoSay(HELP4, LANG_UNIVERSAL, NULL);
- SayingTimer = 15000;
- say = false;
- break;
- }
- }
- else
- {
- isRun = false;
- }
- }
-
- void UpdateAI(const uint32 diff) //Is also called each ms for Creature AI Updates...
- {
- if (m_creature->GetHealth() > 50)
- {
- if(ResetlifeTimer < diff)
- {
- ResetlifeTimer = 60000;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //set creature health
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
- // ley down
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,3);
- }
- else ResetlifeTimer -= diff;
- }
-
- if(HealSay)
- {
- if (HealSayTimer < diff)
- {
- UnSpawn = true;
- isRun = true;
- isMove = true;
- }else HealSayTimer -= diff;
- }
-
- if(UnSpawn)
- {
- if(isMove)
- {
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f);
- isMove = false;
- }
-
- if (UnSpawnTimer < diff)
- {
- m_creature->StopMoving();
- EnterEvadeMode();
- //set creature health
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
-
- }else UnSpawnTimer -= diff;
- }
-
- if(SayingTimer < diff)
- {
- say = true;
- }else SayingTimer -= diff;
- }
-
- void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)//Called if you cast a spell and do some things if Specified spell is true!
- {
- if (Hitter && Spellkind->Id == 28880)
- {
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
- m_creature->HandleEmoteCommand(ANIM_RISE);
- switch (rand()%4) //This switch doesn't work at all, creature say nothing!
- {
- case 0: DoSay(HEAL1, LANG_UNIVERSAL, Hitter); break;
- case 1: DoSay(HEAL2, LANG_UNIVERSAL, Hitter); break;
- case 2: DoSay(HEAL3, LANG_UNIVERSAL, Hitter); break;
- case 3: DoSay(HEAL4, LANG_UNIVERSAL, Hitter); break;
- }
- HealSay = true;
- }
- }
-};
-CreatureAI* GetAI_npc_draenei_survivor(Creature *_Creature)
-{
- return new npc_draenei_survivorAI (_Creature);
-}
-
-/*######
-## npc_engineer_spark_overgrind
-######*/
-
-#define SAY_TEXT "Yes Master, all goes along as planned."
-#define SAY_EMOTE "puts the shell to his ear."
-#define GOSSIP_FIGHT "Traitor! You will be brought to justice!"
-#define ATTACK_YELL "Now I cut you!"
-#define SPELL_DYNAMITE 7978
-
-struct TRINITY_DLL_DECL npc_engineer_spark_overgrindAI : public ScriptedAI
-{
- npc_engineer_spark_overgrindAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Dynamite_Timer;
- uint32 Emote_Timer;
-
- void Reset()
- {
- Dynamite_Timer = 8000;
- Emote_Timer = 120000 + rand()%30000;
- m_creature->setFaction(875);
- }
-
- void Aggro(Unit *who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if( !InCombat )
- {
- if (Emote_Timer < diff)
- {
- DoSay(SAY_TEXT,LANG_UNIVERSAL,NULL);
- DoTextEmote(SAY_EMOTE,NULL);
- Emote_Timer = 120000 + rand()%30000;
- }else Emote_Timer -= diff;
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if (Dynamite_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_DYNAMITE);
- Dynamite_Timer = 8000;
- } else Dynamite_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_npc_engineer_spark_overgrind(Creature *_Creature)
-{
- return new npc_engineer_spark_overgrindAI (_Creature);
-}
-
-bool GossipHello_npc_engineer_spark_overgrind(Player *player, Creature *_Creature)
-{
- if( player->GetQuestStatus(9537) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM(0, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_engineer_spark_overgrind(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if( action == GOSSIP_ACTION_INFO_DEF )
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->setFaction(14);
- _Creature->Yell(ATTACK_YELL, LANG_UNIVERSAL, player->GetGUID());
- ((npc_engineer_spark_overgrindAI*)_Creature->AI())->AttackStart(player);
- }
- return true;
-}
-
-/*######
-## npc_injured_draenei
-######*/
-
-struct TRINITY_DLL_DECL npc_injured_draeneiAI : public ScriptedAI
-{
- npc_injured_draeneiAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15));
- switch (rand()%2)
- {
- case 0: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1); break;
- case 1: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); break;
- }
- }
-
- void Aggro(Unit *who) {}
-
- void MoveInLineOfSight(Unit *who)
- {
- return; //ignore everyone around them (won't aggro anything)
- }
-
- void UpdateAI(const uint32 diff)
- {
- return;
- }
-
-};
-CreatureAI* GetAI_npc_injured_draenei(Creature *_Creature)
-{
- return new npc_injured_draeneiAI (_Creature);
-}
-
-/*######
-## npc_susurrus
-######*/
-
-bool GossipHello_npc_susurrus(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->HasItemCount(23843,1,true))
- player->ADD_GOSSIP_ITEM(0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_susurrus(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player,32474,true); //apparently correct spell, possible not correct place to cast, or correct caster
-
- std::vector nodes;
-
- nodes.resize(2);
- nodes[0] = 92; //from susurrus
- nodes[1] = 91; //end at exodar
- player->ActivateTaxiPathTo(nodes,11686); //TaxiPath 506. Using invisible model, possible Trinity must allow 0(from dbc) for cases like this.
- }
- return true;
-}
-
-/*######
-##
-######*/
-
-void AddSC_azuremyst_isle()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_draenei_survivor";
- newscript->GetAI = GetAI_npc_draenei_survivor;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_engineer_spark_overgrind";
- newscript->GetAI = GetAI_npc_engineer_spark_overgrind;
- newscript->pGossipHello = &GossipHello_npc_engineer_spark_overgrind;
- newscript->pGossipSelect = &GossipSelect_npc_engineer_spark_overgrind;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_injured_draenei";
- newscript->GetAI = GetAI_npc_injured_draenei;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_susurrus";
- newscript->pGossipHello = &GossipHello_npc_susurrus;
- newscript->pGossipSelect = &GossipSelect_npc_susurrus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Azuremyst_Isle
+SD%Complete: 75
+SDComment: Quest support: 9283, 9537, 9554(special flight path, proper model for mount missing). Injured Draenei cosmetic only
+SDCategory: Azuremyst Isle
+EndScriptData */
+
+/* ContentData
+npc_draenei_survivor
+npc_engineer_spark_overgrind
+npc_injured_draenei
+npc_susurrus
+EndContentData */
+
+#include "precompiled.h"
+#include
+
+/*######
+## npc_draenei_survivor
+######*/
+
+#define HEAL1 "The last thing I remember is the ship falling and us getting into the pods. I'll go see how I can help. Thank you!"
+#define HEAL2 "$C, Where am I? Who are you? Oh no! What happened to the ship?."
+#define HEAL3 "$C You saved me! I owe you a debt that I can never repay. I'll go see if I can help the others."
+#define HEAL4 "Ugh... what is this place? Is that all that's left of the ship over there?"
+
+#define HELP1 "Oh, the pain..."
+#define HELP2 "Everything hurts, Please make it stop..."
+#define HELP3 "Ughhh... I hurt. Can you help me?"
+#define HELP4 "I don't know if I can make it, please help me..."
+
+struct TRINITY_DLL_DECL npc_draenei_survivorAI : public ScriptedAI
+{
+ npc_draenei_survivorAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 UnSpawnTimer;
+ uint32 ResetlifeTimer;
+ uint32 SayingTimer;
+ uint32 HealSayTimer;
+ bool UnSpawn;
+ bool say;
+ bool HealSay;
+ bool isRun;
+ bool isMove;
+
+ void Reset()
+ {
+ UnSpawnTimer = 2500;
+ ResetlifeTimer= 60000;
+ SayingTimer = 5000;
+ HealSayTimer = 6000;
+ say = false;
+ isRun = false;
+ isMove = false;
+ UnSpawn = false;
+ HealSay = false;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ //cast red shining
+ m_creature->CastSpell(m_creature, 29152, false, NULL);
+ //set creature health
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void MoveInLineOfSight(Unit *who) //MoveInLineOfSight is called if creature could see you, updated all 100 ms
+ {
+ if (!who)
+ return;
+
+ if(who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 15) && say && !isRun)
+ {
+ switch (rand()%4) //Random switch between 4 texts
+ {
+ case 0:
+ DoSay(HELP1, LANG_UNIVERSAL, NULL);
+ SayingTimer = 15000;
+ say = false;
+ break;
+ case 1:
+ DoSay(HELP2, LANG_UNIVERSAL, NULL);
+ SayingTimer = 15000;
+ say = false;
+ break;
+ case 2:
+ DoSay(HELP3, LANG_UNIVERSAL, NULL);
+ SayingTimer = 15000;
+ say = false;
+ break;
+ case 3:
+ DoSay(HELP4, LANG_UNIVERSAL, NULL);
+ SayingTimer = 15000;
+ say = false;
+ break;
+ }
+ }
+ else
+ {
+ isRun = false;
+ }
+ }
+
+ void UpdateAI(const uint32 diff) //Is also called each ms for Creature AI Updates...
+ {
+ if (m_creature->GetHealth() > 50)
+ {
+ if(ResetlifeTimer < diff)
+ {
+ ResetlifeTimer = 60000;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ //set creature health
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
+ // ley down
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,3);
+ }
+ else ResetlifeTimer -= diff;
+ }
+
+ if(HealSay)
+ {
+ if (HealSayTimer < diff)
+ {
+ UnSpawn = true;
+ isRun = true;
+ isMove = true;
+ }else HealSayTimer -= diff;
+ }
+
+ if(UnSpawn)
+ {
+ if(isMove)
+ {
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f);
+ isMove = false;
+ }
+
+ if (UnSpawnTimer < diff)
+ {
+ m_creature->StopMoving();
+ EnterEvadeMode();
+ //set creature health
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
+
+ }else UnSpawnTimer -= diff;
+ }
+
+ if(SayingTimer < diff)
+ {
+ say = true;
+ }else SayingTimer -= diff;
+ }
+
+ void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)//Called if you cast a spell and do some things if Specified spell is true!
+ {
+ if (Hitter && Spellkind->Id == 28880)
+ {
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
+ m_creature->HandleEmoteCommand(ANIM_RISE);
+ switch (rand()%4) //This switch doesn't work at all, creature say nothing!
+ {
+ case 0: DoSay(HEAL1, LANG_UNIVERSAL, Hitter); break;
+ case 1: DoSay(HEAL2, LANG_UNIVERSAL, Hitter); break;
+ case 2: DoSay(HEAL3, LANG_UNIVERSAL, Hitter); break;
+ case 3: DoSay(HEAL4, LANG_UNIVERSAL, Hitter); break;
+ }
+ HealSay = true;
+ }
+ }
+};
+CreatureAI* GetAI_npc_draenei_survivor(Creature *_Creature)
+{
+ return new npc_draenei_survivorAI (_Creature);
+}
+
+/*######
+## npc_engineer_spark_overgrind
+######*/
+
+#define SAY_TEXT "Yes Master, all goes along as planned."
+#define SAY_EMOTE "puts the shell to his ear."
+#define GOSSIP_FIGHT "Traitor! You will be brought to justice!"
+#define ATTACK_YELL "Now I cut you!"
+#define SPELL_DYNAMITE 7978
+
+struct TRINITY_DLL_DECL npc_engineer_spark_overgrindAI : public ScriptedAI
+{
+ npc_engineer_spark_overgrindAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Dynamite_Timer;
+ uint32 Emote_Timer;
+
+ void Reset()
+ {
+ Dynamite_Timer = 8000;
+ Emote_Timer = 120000 + rand()%30000;
+ m_creature->setFaction(875);
+ }
+
+ void Aggro(Unit *who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( !InCombat )
+ {
+ if (Emote_Timer < diff)
+ {
+ DoSay(SAY_TEXT,LANG_UNIVERSAL,NULL);
+ DoTextEmote(SAY_EMOTE,NULL);
+ Emote_Timer = 120000 + rand()%30000;
+ }else Emote_Timer -= diff;
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if (Dynamite_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_DYNAMITE);
+ Dynamite_Timer = 8000;
+ } else Dynamite_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_engineer_spark_overgrind(Creature *_Creature)
+{
+ return new npc_engineer_spark_overgrindAI (_Creature);
+}
+
+bool GossipHello_npc_engineer_spark_overgrind(Player *player, Creature *_Creature)
+{
+ if( player->GetQuestStatus(9537) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_engineer_spark_overgrind(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if( action == GOSSIP_ACTION_INFO_DEF )
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->setFaction(14);
+ _Creature->Yell(ATTACK_YELL, LANG_UNIVERSAL, player->GetGUID());
+ ((npc_engineer_spark_overgrindAI*)_Creature->AI())->AttackStart(player);
+ }
+ return true;
+}
+
+/*######
+## npc_injured_draenei
+######*/
+
+struct TRINITY_DLL_DECL npc_injured_draeneiAI : public ScriptedAI
+{
+ npc_injured_draeneiAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15));
+ switch (rand()%2)
+ {
+ case 0: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1); break;
+ case 1: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); break;
+ }
+ }
+
+ void Aggro(Unit *who) {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ return; //ignore everyone around them (won't aggro anything)
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ return;
+ }
+
+};
+CreatureAI* GetAI_npc_injured_draenei(Creature *_Creature)
+{
+ return new npc_injured_draeneiAI (_Creature);
+}
+
+/*######
+## npc_susurrus
+######*/
+
+bool GossipHello_npc_susurrus(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->HasItemCount(23843,1,true))
+ player->ADD_GOSSIP_ITEM(0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_susurrus(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,32474,true); //apparently correct spell, possible not correct place to cast, or correct caster
+
+ std::vector nodes;
+
+ nodes.resize(2);
+ nodes[0] = 92; //from susurrus
+ nodes[1] = 91; //end at exodar
+ player->ActivateTaxiPathTo(nodes,11686); //TaxiPath 506. Using invisible model, possible Trinity must allow 0(from dbc) for cases like this.
+ }
+ return true;
+}
+
+/*######
+##
+######*/
+
+void AddSC_azuremyst_isle()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_draenei_survivor";
+ newscript->GetAI = GetAI_npc_draenei_survivor;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_engineer_spark_overgrind";
+ newscript->GetAI = GetAI_npc_engineer_spark_overgrind;
+ newscript->pGossipHello = &GossipHello_npc_engineer_spark_overgrind;
+ newscript->pGossipSelect = &GossipSelect_npc_engineer_spark_overgrind;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_injured_draenei";
+ newscript->GetAI = GetAI_npc_injured_draenei;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_susurrus";
+ newscript->pGossipHello = &GossipHello_npc_susurrus;
+ newscript->pGossipSelect = &GossipSelect_npc_susurrus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
index 3f1ebd4803b..fda28d32999 100644
--- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
+++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
@@ -1,386 +1,386 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: The_Barrens
-SD%Complete: 90
-SDComment: Quest support: 2458, 4921, 6981
-SDCategory: Barrens
-EndScriptData */
-
-/* ContentData
-npc_beaten_corpse
-npc_sputtervalve
-npc_taskmaster_fizzule remove hack when Trinity implement feature/detect spell kind to not aggro
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_beaten_corpse
-######*/
-
-bool GossipHello_npc_beaten_corpse(Player *player, Creature *_Creature)
-{
- if( player->GetQuestStatus(4921) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(4921) == QUEST_STATUS_COMPLETE)
- player->ADD_GOSSIP_ITEM(0,"Examine corpse in detail...",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(3557,_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_beaten_corpse(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if(action == GOSSIP_ACTION_INFO_DEF +1)
- {
- player->SEND_GOSSIP_MENU(3558,_Creature->GetGUID());
- player->KilledMonster( 10668,_Creature->GetGUID() );
- }
- return true;
-}
-
-/*######
-## npc_sputtervalve
-######*/
-
-bool GossipHello_npc_sputtervalve(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(0,"Can you tell me about this shard?",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_sputtervalve(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if(action == GOSSIP_ACTION_INFO_DEF)
- {
- player->SEND_GOSSIP_MENU(2013,_Creature->GetGUID());
- player->AreaExploredOrEventHappens(6981);
- }
- return true;
-}
-
-/*######
-## npc_taskmaster_fizzule
-######*/
-
-//#define FACTION_HOSTILE_F 430
-#define FACTION_HOSTILE_F 16
-#define FACTION_FRIENDLY_F 35
-
-#define SPELL_FLARE 10113
-#define SPELL_FOLLY 10137
-
-struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
-{
- npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- bool IsFriend;
- uint32 Reset_Timer;
- uint32 FlareCount;
-
- void Reset()
- {
- IsFriend = false;
- Reset_Timer = 120000;
- FlareCount = 0;
- m_creature->setFaction(FACTION_HOSTILE_F);
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- }
-
- //This is a hack. Spellcast will make creature aggro but that is not
- //supposed to happen (Trinity not implemented/not found way to detect this spell kind)
- void DoUglyHack()
- {
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if( spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY )
- {
- DoUglyHack();
- ++FlareCount;
- if( FlareCount >= 2 )
- {
- m_creature->setFaction(FACTION_FRIENDLY_F);
- IsFriend = true;
- }
- }
- }
-
- void Aggro(Unit* who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if( IsFriend )
- {
- if( Reset_Timer < diff )
- {
- EnterEvadeMode();
- } else Reset_Timer -= diff;
- }
-
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_npc_taskmaster_fizzule(Creature *_Creature)
-{
- return new npc_taskmaster_fizzuleAI (_Creature);
-}
-
-bool ReciveEmote_npc_taskmaster_fizzule(Player *player, Creature *_Creature, uint32 emote)
-{
- if( emote == TEXTEMOTE_SALUTE )
- {
- if( ((npc_taskmaster_fizzuleAI*)_Creature->AI())->FlareCount >= 2 )
- {
- _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- }
- }
- return true;
-}
-/*#####
-## npc_twiggy_flathead
-#####*/
-
-#define BIG_WILL 6238
-#define AFFRAY_CHALLENGER 6240
-#define SAY_BIG_WILL_READY "Ready when you are, warrior"
-#define SAY_TWIGGY_FLATHEAD_BEGIN "The Affray has begun, get ready to fight!"
-#define SAY_TWIGGY_FLATHEAD_FRAY "You! Enter the fray!"
-#define SAY_TWIGGY_FLATHEAD_DOWN "Challenger is down!"
-#define SAY_TWIGGY_FLATHEAD_OVER "The Affray is over"
-
-float AffrayChallengerLoc[6][4]=
-{
- {-1683, -4326, 2.79, 0},
- {-1682, -4329, 2.79, 0},
- {-1683, -4330, 2.79, 0},
- {-1680, -4334, 2.79, 1.49},
- {-1674, -4326, 2.79, 3.49},
- {-1677, -4334, 2.79, 1.66}
-};
-
-struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
-{
- npc_twiggy_flatheadAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- bool EventInProgress;
- bool EventGrate;
- bool EventBigWill;
- bool Challenger_down[6];
- uint32 Wave;
- uint32 Wave_Timer;
- uint32 Challenger_checker;
- uint64 PlayerGUID;
- uint64 AffrayChallenger[6];
- uint64 BigWill;
-
- void Reset()
- {
- EventInProgress = false;
- EventGrate = false;
- EventBigWill = false;
- Wave_Timer = 600000;
- Challenger_checker = 0;
- Wave = 0;
- PlayerGUID = 0;
-
- for(uint8 i = 0; i < 6; i++) {
- AffrayChallenger[i] = 0;
- Challenger_down[i] = false;
- }
- BigWill = 0;
- }
-
- void Aggro(Unit *who) { }
-
- void MoveInLineOfSight(Unit *who)
- {
- if(!who || (!who->isAlive())) return;
-
- if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && ((Player*)who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
- {
- PlayerGUID = who->GetGUID();
- EventInProgress = true;
- }
- }
-
- void KilledUnit(Unit *victim) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (EventInProgress) {
- Player* pWarrior = NULL;
-
- if(PlayerGUID)
- pWarrior = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
-
- if(!pWarrior)
- return;
-
- if(!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) {
- EventInProgress = false;
- DoYell(SAY_TWIGGY_FLATHEAD_DOWN,LANG_UNIVERSAL,NULL);
- pWarrior->FailQuest(1719);
-
- for(uint8 i = 0; i < 6; i++) {
- if (AffrayChallenger[i]) {
- Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
- if(pCreature) {
- if(pCreature->isAlive()) {
- pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pCreature->setDeathState(JUST_DIED);
- }
- }
- }
- AffrayChallenger[i] = 0;
- Challenger_down[i] = false;
- }
-
- if (BigWill) {
- Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
- if(pCreature) {
- if(pCreature->isAlive()) {
- pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pCreature->setDeathState(JUST_DIED);
- }
- }
- }
- BigWill = 0;
- }
-
- if (!EventGrate && EventInProgress) {
- float x,y,z;
- pWarrior->GetPosition(x, y, z);
-
- if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) {
- pWarrior->AreaExploredOrEventHappens(1719);
- DoYell(SAY_TWIGGY_FLATHEAD_BEGIN,LANG_UNIVERSAL,NULL);
-
- for(uint8 i = 0; i < 6; i++) {
- Creature* pCreature = m_creature->SummonCreature(AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
- pCreature->setFaction(35);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pCreature->HandleEmoteCommand(15);
- AffrayChallenger[i] = pCreature->GetGUID();
- }
- Wave_Timer = 5000;
- Challenger_checker = 1000;
- EventGrate = true;
- }
- }
- else if (EventInProgress) {
- if (Challenger_checker < diff) {
- for(uint8 i = 0; i < 6; i++) {
- if (AffrayChallenger[i]) {
- Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
- if((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i]) {
- DoYell(SAY_TWIGGY_FLATHEAD_DOWN,LANG_UNIVERSAL,NULL);
- Challenger_down[i] = true;
- }
- }
- }
- Challenger_checker = 1000;
- } else Challenger_checker -= diff;
-
- if(Wave_Timer < diff) {
- if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill) {
- DoYell(SAY_TWIGGY_FLATHEAD_FRAY,LANG_UNIVERSAL,NULL);
- Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[Wave]);
- if(pCreature || (pCreature->isAlive())) {
- pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pCreature->HandleEmoteCommand(15);
- pCreature->setFaction(14);
- ((CreatureAI*)pCreature->AI())->AttackStart(pWarrior);
- Wave++;
- Wave_Timer = 20000;
- }
- }
- else if (Wave >= 6 && !EventBigWill) {
- Creature* pCreature = m_creature->SummonCreature(BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000);
- BigWill = pCreature->GetGUID();
- //pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32);
- //pCreature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78);
- pCreature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79);
- //pCreature->HandleEmoteCommand(15);
- pCreature->HandleEmoteCommand(27);
- EventBigWill = true;
- Wave_Timer = 1000;
- }
- else if (Wave >= 6 && EventBigWill && BigWill) {
- Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
- if (!pCreature->isAlive()) {
- DoYell(SAY_TWIGGY_FLATHEAD_OVER,LANG_UNIVERSAL,NULL);
- EventInProgress = false;
- EventBigWill = false;
- EventGrate = false;
- PlayerGUID = 0;
- Wave = 0;
- }
- }
- } else Wave_Timer -= diff;
- }
- }
- }
-};
-CreatureAI* GetAI_npc_twiggy_flathead(Creature *_Creature)
-{
- return new npc_twiggy_flatheadAI (_Creature);
-}
-void AddSC_the_barrens()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_beaten_corpse";
- newscript->pGossipHello = &GossipHello_npc_beaten_corpse;
- newscript->pGossipSelect = &GossipSelect_npc_beaten_corpse;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_sputtervalve";
- newscript->pGossipHello = &GossipHello_npc_sputtervalve;
- newscript->pGossipSelect = &GossipSelect_npc_sputtervalve;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_taskmaster_fizzule";
- newscript->GetAI = GetAI_npc_taskmaster_fizzule;
- newscript->pReceiveEmote = &ReciveEmote_npc_taskmaster_fizzule;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_twiggy_flathead";
- newscript->GetAI = GetAI_npc_twiggy_flathead;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: The_Barrens
+SD%Complete: 90
+SDComment: Quest support: 2458, 4921, 6981
+SDCategory: Barrens
+EndScriptData */
+
+/* ContentData
+npc_beaten_corpse
+npc_sputtervalve
+npc_taskmaster_fizzule remove hack when Trinity implement feature/detect spell kind to not aggro
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_beaten_corpse
+######*/
+
+bool GossipHello_npc_beaten_corpse(Player *player, Creature *_Creature)
+{
+ if( player->GetQuestStatus(4921) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(4921) == QUEST_STATUS_COMPLETE)
+ player->ADD_GOSSIP_ITEM(0,"Examine corpse in detail...",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(3557,_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_beaten_corpse(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if(action == GOSSIP_ACTION_INFO_DEF +1)
+ {
+ player->SEND_GOSSIP_MENU(3558,_Creature->GetGUID());
+ player->KilledMonster( 10668,_Creature->GetGUID() );
+ }
+ return true;
+}
+
+/*######
+## npc_sputtervalve
+######*/
+
+bool GossipHello_npc_sputtervalve(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(0,"Can you tell me about this shard?",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_sputtervalve(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if(action == GOSSIP_ACTION_INFO_DEF)
+ {
+ player->SEND_GOSSIP_MENU(2013,_Creature->GetGUID());
+ player->AreaExploredOrEventHappens(6981);
+ }
+ return true;
+}
+
+/*######
+## npc_taskmaster_fizzule
+######*/
+
+//#define FACTION_HOSTILE_F 430
+#define FACTION_HOSTILE_F 16
+#define FACTION_FRIENDLY_F 35
+
+#define SPELL_FLARE 10113
+#define SPELL_FOLLY 10137
+
+struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
+{
+ npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ bool IsFriend;
+ uint32 Reset_Timer;
+ uint32 FlareCount;
+
+ void Reset()
+ {
+ IsFriend = false;
+ Reset_Timer = 120000;
+ FlareCount = 0;
+ m_creature->setFaction(FACTION_HOSTILE_F);
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ }
+
+ //This is a hack. Spellcast will make creature aggro but that is not
+ //supposed to happen (Trinity not implemented/not found way to detect this spell kind)
+ void DoUglyHack()
+ {
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if( spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY )
+ {
+ DoUglyHack();
+ ++FlareCount;
+ if( FlareCount >= 2 )
+ {
+ m_creature->setFaction(FACTION_FRIENDLY_F);
+ IsFriend = true;
+ }
+ }
+ }
+
+ void Aggro(Unit* who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( IsFriend )
+ {
+ if( Reset_Timer < diff )
+ {
+ EnterEvadeMode();
+ } else Reset_Timer -= diff;
+ }
+
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_npc_taskmaster_fizzule(Creature *_Creature)
+{
+ return new npc_taskmaster_fizzuleAI (_Creature);
+}
+
+bool ReciveEmote_npc_taskmaster_fizzule(Player *player, Creature *_Creature, uint32 emote)
+{
+ if( emote == TEXTEMOTE_SALUTE )
+ {
+ if( ((npc_taskmaster_fizzuleAI*)_Creature->AI())->FlareCount >= 2 )
+ {
+ _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ }
+ }
+ return true;
+}
+/*#####
+## npc_twiggy_flathead
+#####*/
+
+#define BIG_WILL 6238
+#define AFFRAY_CHALLENGER 6240
+#define SAY_BIG_WILL_READY "Ready when you are, warrior"
+#define SAY_TWIGGY_FLATHEAD_BEGIN "The Affray has begun, get ready to fight!"
+#define SAY_TWIGGY_FLATHEAD_FRAY "You! Enter the fray!"
+#define SAY_TWIGGY_FLATHEAD_DOWN "Challenger is down!"
+#define SAY_TWIGGY_FLATHEAD_OVER "The Affray is over"
+
+float AffrayChallengerLoc[6][4]=
+{
+ {-1683, -4326, 2.79, 0},
+ {-1682, -4329, 2.79, 0},
+ {-1683, -4330, 2.79, 0},
+ {-1680, -4334, 2.79, 1.49},
+ {-1674, -4326, 2.79, 3.49},
+ {-1677, -4334, 2.79, 1.66}
+};
+
+struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
+{
+ npc_twiggy_flatheadAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ bool EventInProgress;
+ bool EventGrate;
+ bool EventBigWill;
+ bool Challenger_down[6];
+ uint32 Wave;
+ uint32 Wave_Timer;
+ uint32 Challenger_checker;
+ uint64 PlayerGUID;
+ uint64 AffrayChallenger[6];
+ uint64 BigWill;
+
+ void Reset()
+ {
+ EventInProgress = false;
+ EventGrate = false;
+ EventBigWill = false;
+ Wave_Timer = 600000;
+ Challenger_checker = 0;
+ Wave = 0;
+ PlayerGUID = 0;
+
+ for(uint8 i = 0; i < 6; i++) {
+ AffrayChallenger[i] = 0;
+ Challenger_down[i] = false;
+ }
+ BigWill = 0;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!who || (!who->isAlive())) return;
+
+ if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && ((Player*)who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
+ {
+ PlayerGUID = who->GetGUID();
+ EventInProgress = true;
+ }
+ }
+
+ void KilledUnit(Unit *victim) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (EventInProgress) {
+ Player* pWarrior = NULL;
+
+ if(PlayerGUID)
+ pWarrior = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
+
+ if(!pWarrior)
+ return;
+
+ if(!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) {
+ EventInProgress = false;
+ DoYell(SAY_TWIGGY_FLATHEAD_DOWN,LANG_UNIVERSAL,NULL);
+ pWarrior->FailQuest(1719);
+
+ for(uint8 i = 0; i < 6; i++) {
+ if (AffrayChallenger[i]) {
+ Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
+ if(pCreature) {
+ if(pCreature->isAlive()) {
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pCreature->setDeathState(JUST_DIED);
+ }
+ }
+ }
+ AffrayChallenger[i] = 0;
+ Challenger_down[i] = false;
+ }
+
+ if (BigWill) {
+ Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
+ if(pCreature) {
+ if(pCreature->isAlive()) {
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pCreature->setDeathState(JUST_DIED);
+ }
+ }
+ }
+ BigWill = 0;
+ }
+
+ if (!EventGrate && EventInProgress) {
+ float x,y,z;
+ pWarrior->GetPosition(x, y, z);
+
+ if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) {
+ pWarrior->AreaExploredOrEventHappens(1719);
+ DoYell(SAY_TWIGGY_FLATHEAD_BEGIN,LANG_UNIVERSAL,NULL);
+
+ for(uint8 i = 0; i < 6; i++) {
+ Creature* pCreature = m_creature->SummonCreature(AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
+ pCreature->setFaction(35);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ pCreature->HandleEmoteCommand(15);
+ AffrayChallenger[i] = pCreature->GetGUID();
+ }
+ Wave_Timer = 5000;
+ Challenger_checker = 1000;
+ EventGrate = true;
+ }
+ }
+ else if (EventInProgress) {
+ if (Challenger_checker < diff) {
+ for(uint8 i = 0; i < 6; i++) {
+ if (AffrayChallenger[i]) {
+ Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
+ if((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i]) {
+ DoYell(SAY_TWIGGY_FLATHEAD_DOWN,LANG_UNIVERSAL,NULL);
+ Challenger_down[i] = true;
+ }
+ }
+ }
+ Challenger_checker = 1000;
+ } else Challenger_checker -= diff;
+
+ if(Wave_Timer < diff) {
+ if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill) {
+ DoYell(SAY_TWIGGY_FLATHEAD_FRAY,LANG_UNIVERSAL,NULL);
+ Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[Wave]);
+ if(pCreature || (pCreature->isAlive())) {
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ pCreature->HandleEmoteCommand(15);
+ pCreature->setFaction(14);
+ ((CreatureAI*)pCreature->AI())->AttackStart(pWarrior);
+ Wave++;
+ Wave_Timer = 20000;
+ }
+ }
+ else if (Wave >= 6 && !EventBigWill) {
+ Creature* pCreature = m_creature->SummonCreature(BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000);
+ BigWill = pCreature->GetGUID();
+ //pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32);
+ //pCreature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78);
+ pCreature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79);
+ //pCreature->HandleEmoteCommand(15);
+ pCreature->HandleEmoteCommand(27);
+ EventBigWill = true;
+ Wave_Timer = 1000;
+ }
+ else if (Wave >= 6 && EventBigWill && BigWill) {
+ Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
+ if (!pCreature->isAlive()) {
+ DoYell(SAY_TWIGGY_FLATHEAD_OVER,LANG_UNIVERSAL,NULL);
+ EventInProgress = false;
+ EventBigWill = false;
+ EventGrate = false;
+ PlayerGUID = 0;
+ Wave = 0;
+ }
+ }
+ } else Wave_Timer -= diff;
+ }
+ }
+ }
+};
+CreatureAI* GetAI_npc_twiggy_flathead(Creature *_Creature)
+{
+ return new npc_twiggy_flatheadAI (_Creature);
+}
+void AddSC_the_barrens()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_beaten_corpse";
+ newscript->pGossipHello = &GossipHello_npc_beaten_corpse;
+ newscript->pGossipSelect = &GossipSelect_npc_beaten_corpse;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_sputtervalve";
+ newscript->pGossipHello = &GossipHello_npc_sputtervalve;
+ newscript->pGossipSelect = &GossipSelect_npc_sputtervalve;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_taskmaster_fizzule";
+ newscript->GetAI = GetAI_npc_taskmaster_fizzule;
+ newscript->pReceiveEmote = &ReciveEmote_npc_taskmaster_fizzule;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_twiggy_flathead";
+ newscript->GetAI = GetAI_npc_twiggy_flathead;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp
index b4b3404a878..757f6acef06 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp
@@ -1,68 +1,68 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Black_Temple
-SD%Complete: 95
-SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip.
-SDCategory: Black Temple
-EndScriptData */
-
-/* ContentData
-npc_spirit_of_olum
-EndContentData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-/*###
-# npc_spirit_of_olum
-####*/
-
-#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* player, Creature* _Creature)
-{
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
-
- if(pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE))
- player->ADD_GOSSIP_ITEM(0, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_spirit_of_olum(Player* player, Creature* _Creature, uint32 sender, uint32 action)
-{
- if(action == GOSSIP_ACTION_INFO_DEF + 1)
- player->CLOSE_GOSSIP_MENU();
-
- player->InterruptNonMeleeSpells(false);
- player->CastSpell(player, 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;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Black_Temple
+SD%Complete: 95
+SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip.
+SDCategory: Black Temple
+EndScriptData */
+
+/* ContentData
+npc_spirit_of_olum
+EndContentData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+/*###
+# npc_spirit_of_olum
+####*/
+
+#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* player, Creature* _Creature)
+{
+ ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+
+ if(pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE))
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_spirit_of_olum(Player* player, Creature* _Creature, uint32 sender, uint32 action)
+{
+ if(action == GOSSIP_ACTION_INFO_DEF + 1)
+ player->CLOSE_GOSSIP_MENU();
+
+ player->InterruptNonMeleeSpells(false);
+ player->CastSpell(player, 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;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp
index 86d823bd3af..44bf36cad93 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp
@@ -1,365 +1,365 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Bloodboil
-SD%Complete: 80
-SDComment: Bloodboil not working correctly, missing enrage
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-//Spells
-#define SPELL_ACID_GEYSER 40630
-#define SPELL_ACIDIC_WOUND 40481
-#define SPELL_ARCING_SMASH 40599
-#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be
-#define SPELL_FEL_ACID 40508
-#define SPELL_FEL_RAGE_SELF 40594
-#define SPELL_FEL_RAGE_TARGET 40604
-#define SPELL_FEL_RAGE_2 40616
-#define SPELL_FEL_RAGE_3 41625
-#define SPELL_BEWILDERING_STRIKE 40491
-#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think)
-#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?)
-#define SPELL_TAUNT_GURTOGG 40603
-#define SPELL_INSIGNIFIGANCE 40618
-#define SPELL_BERSERK 45078
-
-//Speech'n'Sound
-#define SAY_AGGRO "Horde will crush you!"
-#define SOUND_AGGRO 11432
-
-#define SAY_SLAY1 "Time to feast!"
-#define SOUND_SLAY1 11433
-
-#define SAY_SLAY2 "More! I want more!"
-#define SOUND_SLAY2 11434
-
-#define SAY_SPECIAL1 "Drink your blood! Eat your flesh!"
-#define SOUND_SPECIAL1 11435
-
-#define SAY_SPECIAL2 "I hunger!"
-#define SOUND_SPECIAL2 11436
-
-#define SAY_ENRAGE "I'll rip the meat from your bones!"
-#define SOUND_ENRAGE 11437
-
-#define SOUND_DEATH 11439
-
-//This is used to sort the players by distance in preparation for the Bloodboil cast.
-struct TargetDistanceOrder : public std::binary_function
-{
- const Unit* MainTarget;
- TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
- // functor for operator ">"
- bool operator()(const Unit* _Left, const Unit* _Right) const
- {
- return (MainTarget->GetDistance(_Left) > MainTarget->GetDistance(_Right));
- }
-};
-
-struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI
-{
- boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- 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()
- {
- if(pInstance)
- pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED);
-
- TargetGUID = 0;
-
- TargetThreat = 0;
-
- BloodboilTimer = 10000;
- BloodboilCount = 0;
- AcidGeyserTimer = 1000;
- AcidicWoundTimer = 6000;
- ArcingSmashTimer = 19000;
- EnrageTimer = 600000;
- FelAcidTimer = 25000;
- EjectTimer = 10000;
- BewilderingStrikeTimer = 15000;
- PhaseChangeTimer = 60000;
-
- Phase1 = true;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- if(pInstance)
- pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE);
-
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- // 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 m_threatlist = m_creature->getThreatManager().getThreatList();
-
- if(!m_threatlist.size()) return; // He doesn't have anyone in his threatlist, useless to continue
-
- std::list targets;
- std::list::iterator itr = m_threatlist.begin();
- for( ; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
- {
- Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- //only on alive players
- if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER )
- targets.push_back( target);
- }
-
- //Sort the list of players
- targets.sort(TargetDistanceOrder(m_creature));
- //Resize so we only get top 5
- targets.resize(5);
-
- //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)
- {
- for(std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr)
- {
- Unit* target = *itr;
- if(!target) 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, NULL, target);
- target->AddAura(Aur);
- }
- }
- }*/
- }
-
- void RevertThreatOnTarget(uint64 guid)
- {
- Unit* pUnit = NULL;
- pUnit = Unit::GetUnit((*m_creature), guid);
- if(pUnit)
- {
- if(m_creature->getThreatManager().getThreat(pUnit))
- m_creature->getThreatManager().modifyThreatPercent(pUnit, -100);
- if(TargetThreat)
- m_creature->AddThreat(pUnit, TargetThreat);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(ArcingSmashTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH);
- ArcingSmashTimer = 10000;
- }else ArcingSmashTimer -= diff;
-
- if(FelAcidTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FEL_ACID);
- FelAcidTimer = 25000;
- }else FelAcidTimer -= diff;
-
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
- if(EnrageTimer < diff)
- {
- DoCast(m_creature, SPELL_BERSERK);
- DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }else EnrageTimer -= diff;
-
- if(Phase1)
- {
- if(BewilderingStrikeTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE);
- float mt_threat = m_creature->getThreatManager().getThreat(m_creature->getVictim());
- Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
- m_creature->AddThreat(target, mt_threat);
- BewilderingStrikeTimer = 20000;
- }else BewilderingStrikeTimer -= diff;
-
- if(EjectTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_EJECT1);
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(), -40);
- EjectTimer = 15000;
- }else EjectTimer -= diff;
-
- if(AcidicWoundTimer < diff)
- {
- DoCast(m_creature->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(m_creature->getVictim(), SPELL_BLOODBOIL);
- ++BloodboilCount;
- BloodboilTimer = 10000*BloodboilCount;
- }
- }else BloodboilTimer -= diff;
- }
-
- if(!Phase1)
- {
- if(AcidGeyserTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ACID_GEYSER);
- AcidGeyserTimer = 30000;
- }else AcidGeyserTimer -= diff;
-
- if(EjectTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_EJECT2);
- EjectTimer = 15000;
- }else EjectTimer -= diff;
- }
-
- if(PhaseChangeTimer < diff)
- {
- if(Phase1)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && target->isAlive())
- {
- Phase1 = false;
-
- TargetThreat = m_creature->getThreatManager().getThreat(target);
- TargetGUID = target->GetGUID();
- target->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true);
- if(m_creature->getThreatManager().getThreat(target))
- m_creature->getThreatManager().modifyThreatPercent(target, -100);
- m_creature->AddThreat(target, 50000000.0f);
- // If VMaps are disabled, this spell can call the whole instance
- DoCast(m_creature, SPELL_INSIGNIFIGANCE, true);
- DoCast(target, SPELL_FEL_RAGE_TARGET, true);
- DoCast(target,SPELL_FEL_RAGE_2, true);
- /* These spells do not work, comment them out for now.
- DoCast(target, SPELL_FEL_RAGE_2, true);
- DoCast(target, SPELL_FEL_RAGE_3, true);*/
-
- //Cast this without triggered so that it appears in combat logs and shows visual.
- DoCast(m_creature, SPELL_FEL_RAGE_SELF);
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPECIAL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
- break;
- case 1:
- DoYell(SAY_SPECIAL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
- break;
- }
-
- 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;
- }
- }else PhaseChangeTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature *_Creature)
-{
- return new boss_gurtogg_bloodboilAI (_Creature);
-}
-
-void AddSC_boss_gurtogg_bloodboil()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gurtogg_bloodboil";
- newscript->GetAI = GetAI_boss_gurtogg_bloodboil;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Bloodboil
+SD%Complete: 80
+SDComment: Bloodboil not working correctly, missing enrage
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+//Spells
+#define SPELL_ACID_GEYSER 40630
+#define SPELL_ACIDIC_WOUND 40481
+#define SPELL_ARCING_SMASH 40599
+#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be
+#define SPELL_FEL_ACID 40508
+#define SPELL_FEL_RAGE_SELF 40594
+#define SPELL_FEL_RAGE_TARGET 40604
+#define SPELL_FEL_RAGE_2 40616
+#define SPELL_FEL_RAGE_3 41625
+#define SPELL_BEWILDERING_STRIKE 40491
+#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think)
+#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?)
+#define SPELL_TAUNT_GURTOGG 40603
+#define SPELL_INSIGNIFIGANCE 40618
+#define SPELL_BERSERK 45078
+
+//Speech'n'Sound
+#define SAY_AGGRO "Horde will crush you!"
+#define SOUND_AGGRO 11432
+
+#define SAY_SLAY1 "Time to feast!"
+#define SOUND_SLAY1 11433
+
+#define SAY_SLAY2 "More! I want more!"
+#define SOUND_SLAY2 11434
+
+#define SAY_SPECIAL1 "Drink your blood! Eat your flesh!"
+#define SOUND_SPECIAL1 11435
+
+#define SAY_SPECIAL2 "I hunger!"
+#define SOUND_SPECIAL2 11436
+
+#define SAY_ENRAGE "I'll rip the meat from your bones!"
+#define SOUND_ENRAGE 11437
+
+#define SOUND_DEATH 11439
+
+//This is used to sort the players by distance in preparation for the Bloodboil cast.
+struct TargetDistanceOrder : public std::binary_function
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator ">"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) > MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI
+{
+ boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ 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()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED);
+
+ TargetGUID = 0;
+
+ TargetThreat = 0;
+
+ BloodboilTimer = 10000;
+ BloodboilCount = 0;
+ AcidGeyserTimer = 1000;
+ AcidicWoundTimer = 6000;
+ ArcingSmashTimer = 19000;
+ EnrageTimer = 600000;
+ FelAcidTimer = 25000;
+ EjectTimer = 10000;
+ BewilderingStrikeTimer = 15000;
+ PhaseChangeTimer = 60000;
+
+ Phase1 = true;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ if(pInstance)
+ pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE);
+
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ // 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 m_threatlist = m_creature->getThreatManager().getThreatList();
+
+ if(!m_threatlist.size()) return; // He doesn't have anyone in his threatlist, useless to continue
+
+ std::list targets;
+ std::list::iterator itr = m_threatlist.begin();
+ for( ; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
+ {
+ Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ //only on alive players
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER )
+ targets.push_back( target);
+ }
+
+ //Sort the list of players
+ targets.sort(TargetDistanceOrder(m_creature));
+ //Resize so we only get top 5
+ targets.resize(5);
+
+ //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)
+ {
+ for(std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr)
+ {
+ Unit* target = *itr;
+ if(!target) 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, NULL, target);
+ target->AddAura(Aur);
+ }
+ }
+ }*/
+ }
+
+ void RevertThreatOnTarget(uint64 guid)
+ {
+ Unit* pUnit = NULL;
+ pUnit = Unit::GetUnit((*m_creature), guid);
+ if(pUnit)
+ {
+ if(m_creature->getThreatManager().getThreat(pUnit))
+ m_creature->getThreatManager().modifyThreatPercent(pUnit, -100);
+ if(TargetThreat)
+ m_creature->AddThreat(pUnit, TargetThreat);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(ArcingSmashTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH);
+ ArcingSmashTimer = 10000;
+ }else ArcingSmashTimer -= diff;
+
+ if(FelAcidTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FEL_ACID);
+ FelAcidTimer = 25000;
+ }else FelAcidTimer -= diff;
+
+ if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(EnrageTimer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }else EnrageTimer -= diff;
+
+ if(Phase1)
+ {
+ if(BewilderingStrikeTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE);
+ float mt_threat = m_creature->getThreatManager().getThreat(m_creature->getVictim());
+ Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
+ m_creature->AddThreat(target, mt_threat);
+ BewilderingStrikeTimer = 20000;
+ }else BewilderingStrikeTimer -= diff;
+
+ if(EjectTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_EJECT1);
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(), -40);
+ EjectTimer = 15000;
+ }else EjectTimer -= diff;
+
+ if(AcidicWoundTimer < diff)
+ {
+ DoCast(m_creature->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(m_creature->getVictim(), SPELL_BLOODBOIL);
+ ++BloodboilCount;
+ BloodboilTimer = 10000*BloodboilCount;
+ }
+ }else BloodboilTimer -= diff;
+ }
+
+ if(!Phase1)
+ {
+ if(AcidGeyserTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ACID_GEYSER);
+ AcidGeyserTimer = 30000;
+ }else AcidGeyserTimer -= diff;
+
+ if(EjectTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_EJECT2);
+ EjectTimer = 15000;
+ }else EjectTimer -= diff;
+ }
+
+ if(PhaseChangeTimer < diff)
+ {
+ if(Phase1)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && target->isAlive())
+ {
+ Phase1 = false;
+
+ TargetThreat = m_creature->getThreatManager().getThreat(target);
+ TargetGUID = target->GetGUID();
+ target->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true);
+ if(m_creature->getThreatManager().getThreat(target))
+ m_creature->getThreatManager().modifyThreatPercent(target, -100);
+ m_creature->AddThreat(target, 50000000.0f);
+ // If VMaps are disabled, this spell can call the whole instance
+ DoCast(m_creature, SPELL_INSIGNIFIGANCE, true);
+ DoCast(target, SPELL_FEL_RAGE_TARGET, true);
+ DoCast(target,SPELL_FEL_RAGE_2, true);
+ /* These spells do not work, comment them out for now.
+ DoCast(target, SPELL_FEL_RAGE_2, true);
+ DoCast(target, SPELL_FEL_RAGE_3, true);*/
+
+ //Cast this without triggered so that it appears in combat logs and shows visual.
+ DoCast(m_creature, SPELL_FEL_RAGE_SELF);
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPECIAL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
+ break;
+ case 1:
+ DoYell(SAY_SPECIAL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
+ break;
+ }
+
+ 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;
+ }
+ }else PhaseChangeTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature *_Creature)
+{
+ return new boss_gurtogg_bloodboilAI (_Creature);
+}
+
+void AddSC_boss_gurtogg_bloodboil()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gurtogg_bloodboil";
+ newscript->GetAI = GetAI_boss_gurtogg_bloodboil;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
index 48e0bc86ab2..11b97c5913e 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
@@ -1,2500 +1,2500 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: boss_illidan_stormrage
-SD%Complete: 90
-SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon GOs for Cage Trap.
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-#define GETGO(obj, guid) GameObject* obj = GameObject::GetGameObject(*m_creature, guid)
-#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*m_creature, guid)
-#define GETCRE(cre, guid) Creature* cre = (Creature*)Unit::GetUnit(*m_creature, guid)
-#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth()
-
-/************* Quotes and Sounds ***********************/
-// Gossip for when a player clicks Akama
-#define GOSSIP_ITEM "We are ready to face Illidan"
-
-// Yells for/by Akama
-#define SAY_AKAMA_BEWARE "Be wary friends, The Betrayer meditates in the court just beyond."
-#define SOUND_AKAMA_BEWARE 11388
-#define SAY_AKAMA_MINION "Come, my minions. Deal with this traitor as he deserves!"
-#define SOUND_AKAMA_MINION 11465
-#define SAY_AKAMA_LEAVE "I'll deal with these mongrels. Strike now, friends! Strike at the betrayer!"
-#define SOUND_AKAMA_LEAVE 11390
-
-// Self explanatory
-#define SAY_KILL1 "Who shall be next to taste my blades?!"
-#define SOUND_KILL1 11473
-#define SAY_KILL2 "This is too easy!"
-#define SOUND_KILL2 11472
-
-// I think I'll fly now and let my subordinates take you on
-#define SAY_TAKEOFF "I will not be touched by rabble such as you!"
-#define SOUND_TAKEOFF 11479
-#define SAY_SUMMONFLAMES "Behold the flames of Azzinoth!"
-#define SOUND_SUMMONFLAMES 11480
-
-// When casting Eye Blast. Demon Fire will be appear on places that he casts this
-#define SAY_EYE_BLAST "Stare into the eyes of the Betrayer!"
-#define SOUND_EYE_BLAST 11481
-
-// kk, I go big, dark and demon on you.
-#define SAY_MORPH "Behold the power... of the demon within!"
-#define SOUND_MORPH 11475
-
-// I KILL!
-#define SAY_ENRAGE "You've wasted too much time mortals, now you shall fall!"
-#define SOUND_ENRAGE 11474
-
-/************** Spells *************/
-// Normal Form
-#define SPELL_SHEAR 37335 // 41032 is bugged, cannot be block/dodge/parry// Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast
-#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him.
-#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect)
-#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off)
-#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :(
-#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY
-#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY
-// Flying (Phase 2)
-#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground
-#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell
-#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan
-#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time.
-#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second.
-// Demon Form
-#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground)
-#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel)
-#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar)
-#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him.
-#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target.
-#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect)
-#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Have each player cast it on itself (workaround)
-// Other Illidan spells
-#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to skully).
-#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev.
-#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees.
-#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150%
-#define SPELL_DUAL_WIELD 42459
-//Phase Normal spells
-#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons
-#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends
-#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons.
-#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them
-#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target
-#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target
-//Phase Flight spells
-#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell.
-#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius
-#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation.
-#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds
-#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature
-#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it.
-#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage.
-#define SPELL_CHARGE 41581 //40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan.
-#define SPELL_FLAME_ENRAGE 45078
-//Akama spells
-#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit
-#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit
-#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used...
-#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full.
-#define SPELL_CHAIN_LIGHTNING 40536 // 6938 to 8062 for 5 targets
-//Maiev spells
-#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO.
-#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards
-#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working)
-#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him'
-#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev
-#define SPELL_SHADOW_STRIKE 40685 // 4375 to 5625 every 3 seconds for 12 seconds
-#define SPELL_THROW_DAGGER 41152 // 5400 to 6600 damage, need dagger
-#define SPELL_FAN_BLADES 39954 // bugged visual
-
-// Other defines
-#define CENTER_X 676.740
-#define CENTER_Y 305.297
-#define CENTER_Z 353.192
-
-#define FLAME_ENRAGE_DISTANCE 30
-#define FLAME_CHARGE_DISTANCE 50
-
-/**** Creature Summon and Recognition IDs ****/
-enum CreatureEntry
-{
- EMPTY = 0,
- AKAMA = 22990,
- ILLIDAN_STORMRAGE = 22917,
- BLADE_OF_AZZINOTH = 22996,
- FLAME_OF_AZZINOTH = 22997,
- MAIEV_SHADOWSONG = 23197,
- SHADOW_DEMON = 23375,
- DEMON_FIRE = 23069,
- FLAME_CRASH = 23336,
- ILLIDAN_DOOR_TRIGGER = 23412,
- SPIRIT_OF_OLUM = 23411,
- SPIRIT_OF_UDALO = 23410,
- ILLIDARI_ELITE = 23226,
- PARASITIC_SHADOWFIEND = 23498,
- CAGE_TRAP_TRIGGER = 23292,
-};
-
-/*** Phase Names ***/
-enum PhaseIllidan
-{
- PHASE_NULL = 0,
- PHASE_NORMAL = 1,
- PHASE_FLIGHT = 2,
- PHASE_NORMAL_2 = 3,
- PHASE_DEMON = 4,
- PHASE_NORMAL_MAIEV = 5,
- PHASE_TALK_SEQUENCE = 6,
- PHASE_FLIGHT_SEQUENCE = 7,
- PHASE_TRANSFORM_SEQUENCE = 8,
-};//Maiev uses the same phase
-
-enum PhaseAkama
-{
- PHASE_AKAMA_NULL = 0,
- PHASE_CHANNEL = 1,
- PHASE_WALK = 2,
- PHASE_TALK = 3,
- PHASE_FIGHT_ILLIDAN = 4,
- PHASE_FIGHT_MINIONS = 5,
- PHASE_RETURN = 6,
-};
-
-enum EventIllidan
-{
- EVENT_NULL = 0,
- EVENT_BERSERK = 1,
- //normal phase
- EVENT_TAUNT = 2,
- EVENT_SHEAR = 3,
- EVENT_FLAME_CRASH = 4,
- EVENT_PARASITIC_SHADOWFIEND = 5,
- EVENT_PARASITE_CHECK = 6,
- EVENT_DRAW_SOUL = 7,
- EVENT_AGONIZING_FLAMES = 8,
- EVENT_TRANSFORM_NORMAL = 9,
- EVENT_ENRAGE = 10,
- //flight phase
- EVENT_FIREBALL = 2,
- EVENT_DARK_BARRAGE = 3,
- EVENT_EYE_BLAST = 4,
- EVENT_MOVE_POINT = 5,
- //demon phase
- EVENT_SHADOW_BLAST = 2,
- EVENT_FLAME_BURST = 3,
- EVENT_SHADOWDEMON = 4,
- EVENT_TRANSFORM_DEMON = 5,
- //sequence phase
- EVENT_TALK_SEQUENCE = 2,
- EVENT_FLIGHT_SEQUENCE = 2,
- EVENT_TRANSFORM_SEQUENCE = 2,
-};
-
-enum EventMaiev
-{
- EVENT_MAIEV_NULL = 0,
- EVENT_MAIEV_STEALTH = 1,
- EVENT_MAIEV_TAUNT = 2,
- EVENT_MAIEV_SHADOW_STRIKE = 3,
- EVENT_MAIEV_THROW_DAGGER = 4,
- EVENT_MAIEV_TRAP = 5,
-};
-
-static EventIllidan MaxTimer[]=
-{
- EVENT_NULL,
- EVENT_DRAW_SOUL,
- EVENT_MOVE_POINT,
- EVENT_TRANSFORM_NORMAL,
- EVENT_TRANSFORM_DEMON,
- EVENT_ENRAGE,
- EVENT_TALK_SEQUENCE,
- EVENT_FLIGHT_SEQUENCE,
- EVENT_TRANSFORM_SEQUENCE
-};
-
-struct Yells
-{
- uint32 sound;
- char* text;
- uint32 creature, timer, emote;
- bool Talk;
-};
-
-static Yells Conversation[]=
-{
- {11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true},
- {0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true},
- {11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true},
- {0, NULL, AKAMA, 5000, 66, true},
- {11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true},
- {11380, "The time has come! The moment is at hand!", AKAMA, 3000, 22, true},
- {0, NULL, AKAMA, 2000, 15, true},
- {11466, "You are not prepared!", ILLIDAN_STORMRAGE, 3000, 406, true},
- {0, NULL, EMPTY, 1000, 0, true},
- {0, NULL, EMPTY, 0, 0, false},//9
- {11476, "Is this it, mortals? Is this all the fury you can muster?", ILLIDAN_STORMRAGE, 8000, 0, true},
- {11491, "Their fury pales before mine, Illidan. We have some unsettled business between us.", MAIEV_SHADOWSONG, 8000, 5, true},
- {11477, "Maiev... How is this even possible?", ILLIDAN_STORMRAGE, 5000, 1, true},
- {11492, "Ah... my long hunt is finally over. Today, Justice will be done!", MAIEV_SHADOWSONG, 8000, 15, true},
- {11470, "Feel the hatred of ten thousand years!", ILLIDAN_STORMRAGE, 1000, 0, false},//14
- {11496, "Ahh... It is finished. You are beaten.", MAIEV_SHADOWSONG, 6000, 0, true},//15
- {11478, "You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..", ILLIDAN_STORMRAGE, 30000, 65, true}, // Emote dead for now. Kill him later
- {11497, "He is right. I feel nothing... I am nothing... Farewell, champions.", MAIEV_SHADOWSONG, 9000, 0, true},
- {11498, NULL, MAIEV_SHADOWSONG, 5000, 0, true},
- {11498, NULL, EMPTY, 1000, 0, true},//19 Maiev disappear
- {11387, "The Light will fill these dismal halls once again. I swear it.", AKAMA, 8000, 0, true},
- {0, NULL, EMPTY, 1000, 0, false}//21
-};
-
-static Yells RandomTaunts[]=
-{
- {11467, "I can feel your hatred.", ILLIDAN_STORMRAGE, 0, 0, false},
- {11468, "Give in to your fear!", ILLIDAN_STORMRAGE, 0, 0, false},
- {11469, "You know nothing of power!", ILLIDAN_STORMRAGE, 0, 0, false},
- {11471, "Such... arrogance!", ILLIDAN_STORMRAGE, 0, 0, false}
-};
-
-static Yells MaievTaunts[]=
-{
- {11493, "That is for Naisha!", MAIEV_SHADOWSONG, 0, false},
- {11494, "Bleed as I have bled!", MAIEV_SHADOWSONG, 0, 0, false},
- {11495, "There shall be no prison for you this time!", MAIEV_SHADOWSONG, 0, 0, false},
- {11500, "Meet your end, demon!", MAIEV_SHADOWSONG, 0, 0, false}
-};
-
-struct Locations
-{
- float x, y, z;
-};
-
-static Locations HoverPosition[]=
-{
- {657, 340, 355},
- {657, 275, 355},
- {705, 275, 355},
- {705, 340, 355}
-};
-
-static Locations GlaivePosition[]=
-{
- {695.105, 305.303, 354.256},
- {659.338, 305.303, 354.256},//the distance between two glaives is 36
- {700.105, 305.303, 354.256},
- {664.338, 305.303, 354.256}
-};
-
-static Locations EyeBlast[]=
-{
- {677, 350, 354},//start point, pass through glaive point
- {677, 260, 354}
-};
-
-static Locations AkamaWP[]=
-{
- {770.01, 304.50, 312.29}, // Bottom of the first stairs, at the doors
- {780.66, 304.50, 319.74}, // Top of the first stairs
- {790.13, 319.68, 319.76}, // Bottom of the second stairs (left from the entrance)
- {787.17, 347.38, 341.42}, // Top of the second stairs
- {781.34, 350.31, 341.44}, // Bottom of the third stairs
- {762.60, 361.06, 353.60}, // Top of the third stairs
- {756.35, 360.52, 353.27}, // Before the door-thingy
- {743.82, 342.21, 353.00}, // Somewhere further
- {732.69, 305.13, 353.00}, // In front of Illidan - (8)
- {738.11, 365.44, 353.00}, // in front of the door-thingy (the other one!)
- {792.18, 366.62, 341.42}, // Down the first flight of stairs
- {796.84, 304.89, 319.76}, // Down the second flight of stairs
- {782.01, 304.55, 319.76} // Final location - back at the initial gates. This is where he will fight the minions! (12)
-};
-// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned
-static Locations SpiritSpawns[]=
-{
- {755.5426, 309.9156, 312.2129},
- {755.5426, 298.7923, 312.0834}
-};
-
-struct Animation // For the demon transformation
-{
- uint32 aura, unaura, timer, size, displayid, phase;
- bool equip;
-};
-
-static Animation DemonTransformation[]=
-{
- {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, true},
- {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true},
- {0, 0, 3000, 1073741824, 21322, 6, false},//stunned, cannot cast demon form
- {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false},
- {SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 4, false},
- {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, false},
- {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false},
- {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false},
- {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true},
- {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true}
-};
-
-
-
-/************************************** Illidan's AI ***************************************/
-struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
-{
- boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- 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];
-
- std::list ParasiteTargets; // for safety, do not use Unit*
-
- void Reset();
-
- void JustSummoned(Creature* summon)//, TempSummonType type)
- {
- if(summon->GetCreatureInfo()->Entry == FLAME_CRASH)
- {
- // type = TEMPSUMMON_TIMED_DESPAWN;
- }
- //error_log("justsummoned %d %d", summon->GetCreatureInfo()->Entry, summon->GetGUID());
- }
-
- void SummonedCreatureDespawn(Creature* summon)
- {
- if(summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH)
- {
- for(uint8 i = 0; i < 2; i++)
- if(summon->GetGUID() == FlameGUID[i])
- FlameGUID[i] = 0;
-
- if(!FlameGUID[0] && !FlameGUID[1])
- {
- m_creature->InterruptNonMeleeSpells(true);
- EnterPhase(PHASE_FLIGHT_SEQUENCE);
- }
- }
- }
-
- void MovementInform(uint32 MovementType, uint32 Data)
- {
- if(FlightCount == 7) //change hover point
- {
- if(m_creature->getVictim())
- {
- m_creature->SetInFront(m_creature->getVictim());
- m_creature->StopMoving();
- }
- EnterPhase(PHASE_FLIGHT);
- }
- else
- Timer[EVENT_FLIGHT_SEQUENCE] = 1000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void AttackStart(Unit *who)
- {
- if(!who || Phase >= PHASE_TALK_SEQUENCE)
- return;
-
- if (who->isTargetableForAttack())
- {
- if(Phase == PHASE_FLIGHT || Phase == PHASE_DEMON)
- m_creature->Attack(who, false);
- else
- DoStartAttackAndMovement(who);
-
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
-
- void MoveInLineOfSight(Unit *who) {}
-
- void JustDied(Unit *killer)
- {
- m_creature->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)
- {
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(i));
- if(Door)
- Door->SetUInt32Value(GAMEOBJECT_STATE, 0); // Open Doors
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- if(victim == m_creature) return;
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_KILL1, LANG_UNIVERSAL, victim);
- DoPlaySoundToSet(m_creature, SOUND_KILL1);
- break;
- case 1:
- DoYell(SAY_KILL2, LANG_UNIVERSAL, victim);
- DoPlaySoundToSet(m_creature, SOUND_KILL2);
- break;
- }
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(damage >= m_creature->GetHealth() && done_by != m_creature)
- damage = 0;
- if(done_by->GetGUID() == MaievGUID)
- done_by->AddThreat(m_creature, -(3*(float)damage)/4); // do not let maiev tank him
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades!
- {
- if(!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY))
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479);
- else
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- }
- }
-
- void AddParasiteTarget(uint64 targetGUID)
- {
- for(std::list::iterator tIter = ParasiteTargets.begin(); tIter != ParasiteTargets.end(); tIter++)
- {
- if(*tIter == targetGUID)
- return;
- }
- ParasiteTargets.push_back(targetGUID);
-
- if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV)
- Timer[EVENT_PARASITE_CHECK] += 1000;
- }
-
- void DeleteFromThreatList(uint64 TargetGUID)
- {
- for(std::list::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
- {
- if((*itr)->getUnitGuid() == TargetGUID)
- {
- (*itr)->removeReference();
- break;
- }
- }
- }
-
- void Talk(uint32 count)
- {
- Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer;
-
- Creature* creature = NULL;
- if(Conversation[count].creature == ILLIDAN_STORMRAGE)
- creature = m_creature;
- else if(Conversation[count].creature == AKAMA)
- creature = ((Creature*)Unit::GetUnit((*m_creature), AkamaGUID));
- else if(Conversation[count].creature == MAIEV_SHADOWSONG)
- creature = ((Creature*)Unit::GetUnit((*m_creature), MaievGUID));
-
- if(creature)
- {
- if(Conversation[count].emote)
- creature->HandleEmoteCommand(Conversation[count].emote); // Make the creature do some animation!
- if(Conversation[count].text)
- creature->Yell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the creature yell out some text
- if(Conversation[count].sound)
- DoPlaySoundToSet(creature, Conversation[count].sound); // Play some sound on the creature
- }
- }
-
- void EnterPhase(PhaseIllidan NextPhase);
- void CastEyeBlast();
- void SummonFlamesOfAzzinoth();
- void SummonMaiev();
- void SummonShadowDemon()
- {
- Creature* ShadowDemon = NULL;
- Unit* target = NULL;
- for(uint8 i = 0; i < 4; i++)
- {
- ShadowDemon = DoSpawnCreature(SHADOW_DEMON, 0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000);
- if(ShadowDemon)
- {
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && target->GetTypeId() == TYPEID_PLAYER) // only on players.
- {
- ShadowDemon->AddThreat(target, 5000000.0f);
- ShadowDemon->AI()->AttackStart(target);
- }
- DoZoneInCombat(ShadowDemon);
- }
- }
- }
- void HandleTalkSequence();
- void HandleFlightSequence()
- {
- switch(FlightCount)
- {
- case 1://lift off
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- //m_creature->GetMotionMaster()->Clear(false);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
- m_creature->StopMoving();
- DoYell(SAY_TAKEOFF, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAKEOFF);
- Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
- break;
- case 2://move to center
- //m_creature->GetMotionMaster()->Clear(false);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 3://throw one glaive
- {
- uint8 i=1;
- Creature* Glaive = m_creature->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_NON_ATTACKABLE);
- Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- Glaive->setFaction(m_creature->getFaction());
- DoCast(Glaive, SPELL_THROW_GLAIVE2);
- }
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 700;
- break;
- case 4://throw another
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
- {
- uint8 i=0;
- Creature* Glaive = m_creature->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_NON_ATTACKABLE);
- Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- Glaive->setFaction(m_creature->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
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 7://return to center
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 8://glaive return
- for(uint8 i = 0; i < 2; i++)
- {
- if(GlaiveGUID[i])
- {
- Unit* Glaive = Unit::GetUnit((*m_creature), GlaiveGUID[i]);
- if(Glaive)
- {
- Glaive->CastSpell(m_creature, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us
- Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); // disappear but not die for now
- }
- }
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- break;
- case 9://land
- //m_creature->GetMotionMaster()->Clear(false);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
- m_creature->StopMoving();
- m_creature->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();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- //m_creature->GetMotionMaster()->Clear();
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- EnterPhase(PHASE_NORMAL_2);
- break;
- default:
- break;
- }
- FlightCount++;
- }
-
- void HandleTransformSequence()
- {
- if(DemonTransformation[TransformCount].unaura)
- m_creature->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura);
-
- if(DemonTransformation[TransformCount].aura)
- DoCast(m_creature, DemonTransformation[TransformCount].aura, true);
-
- if(DemonTransformation[TransformCount].displayid)
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, DemonTransformation[TransformCount].displayid); // It's morphin time!
-
- if(DemonTransformation[TransformCount].equip)
- {
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Requip warglaives if needed
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- }
- else
- {
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); // Unequip warglaives if needed
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
- }
-
- switch(TransformCount)
- {
- 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(Phase == PHASE_TRANSFORM_SEQUENCE)
- Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer;
- TransformCount++;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if((!m_creature->SelectHostilTarget() || !m_creature->getVictim()) && Phase < PHASE_TALK_SEQUENCE)
- return;
-
- Event = EVENT_NULL;
- for(uint32 i = 1; i <= MaxTimer[Phase]; i++)
- if(Timer[i])
- if(Timer[i] <= diff)
- {
- if(!Event)
- Event = (EventIllidan)i;
- }
- else Timer[i] -= diff;
-
- switch(Phase)
- {
- case PHASE_NORMAL:
- if(HPPCT(m_creature) < 65)
- EnterPhase(PHASE_FLIGHT_SEQUENCE);
- break;
-
- case PHASE_NORMAL_2:
- if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
- EnterPhase(PHASE_TALK_SEQUENCE);
- break;
-
- case PHASE_NORMAL_MAIEV:
- if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 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(m_creature->IsNonMeleeSpellCasted(false))
- return;
-
- if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED, 0))
- {
- switch(Event)
- {
- //PHASE_NORMAL
- case EVENT_BERSERK:
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- DoCast(m_creature, 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)
- DoYell(yell, LANG_UNIVERSAL, NULL);
- if(soundid)
- DoPlaySoundToSet(m_creature, soundid);
- }
- Timer[EVENT_TAUNT] = 32000;
- break;
-
- case EVENT_SHEAR:
- DoCast(m_creature->getVictim(), SPELL_SHEAR);
- Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000);
- break;
-
- case EVENT_FLAME_CRASH:
- DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH);
- Timer[EVENT_FLAME_CRASH] = 35000;
- break;
-
- case EVENT_PARASITIC_SHADOWFIEND:
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target) target = m_creature->getVictim();
- if(target->GetTypeId() == TYPEID_PLAYER && !target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
- {
- target->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); // do not miss
- ParasiteTargets.push_back(target->GetGUID());
- Timer[EVENT_PARASITE_CHECK] += 1000; // do not check immediately
- }
- Timer[EVENT_PARASITIC_SHADOWFIEND] = 40000;
- }
- break;
-
- case EVENT_PARASITE_CHECK:
- for(std::list::iterator tIter = ParasiteTargets.begin(); tIter != ParasiteTargets.end();)
- {
- Unit* target = Unit::GetUnit((*m_creature), *tIter);
- if(!target || !target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
- {
- if(target && target->isAlive())
- target->CastSpell(target, SPELL_SUMMON_PARASITICS, true);
- std::list::iterator tIter2 = tIter;
- ++tIter;
- ParasiteTargets.erase(tIter2);
- }
- else
- ++tIter;
- }
- if(ParasiteTargets.empty())
- Timer[EVENT_PARASITE_CHECK] = 0;
- else
- Timer[EVENT_PARASITE_CHECK] = 1000;
- break;
-
- case EVENT_DRAW_SOUL:
- DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL);
- Timer[EVENT_DRAW_SOUL] = 55000;
- 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(m_creature, SPELL_ENRAGE);
- Timer[EVENT_ENRAGE] = 0;
- break;
-
- default:
- break;
- }
- DoMeleeAttackIfReady();
- }
-
- if(Phase == PHASE_FLIGHT)
- {
- 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
- for (uint8 i = 0; i <= rand()%3; i++)
- {
- HoverPoint++;
- if(HoverPoint > 3)
- HoverPoint = 0;
- }
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- break;
-
- default:
- break;
- }
- }
-
- if(Phase == PHASE_DEMON)
- {
- switch(Event)
- {
- case EVENT_SHADOW_BLAST:
- m_creature->GetMotionMaster()->Clear(false);
- if(!m_creature->IsWithinDistInMap(m_creature->getVictim(), 50)||!m_creature->IsWithinLOSInMap(m_creature->getVictim()))
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30);
- else
- m_creature->GetMotionMaster()->MoveIdle();
- DoCast(m_creature->getVictim(), SPELL_SHADOW_BLAST);
- Timer[EVENT_SHADOW_BLAST] = 4000;
- break;
- case EVENT_SHADOWDEMON:
- SummonShadowDemon();
- Timer[EVENT_SHADOWDEMON] = 0;
- Timer[EVENT_FLAME_BURST] += 10000;
- break;
- case EVENT_FLAME_BURST:
- DoCast(m_creature, SPELL_FLAME_BURST);
- Timer[EVENT_FLAME_BURST] = 15000;
- break;
- case EVENT_TRANSFORM_DEMON:
- EnterPhase(PHASE_TRANSFORM_SEQUENCE);
- break;
- default:
- break;
- }
- }
- }
-};
-
-/********************************** End of Illidan AI ******************************************/
-
-//This is used to sort the players by distance in preparation for being charged by the flames.
-struct TargetDistanceOrder : public std::binary_function
-{
- const Unit* MainTarget;
- TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
- // functor for operator ">"
- bool operator()(const Unit* _Left, const Unit* _Right) const
- {
- return (MainTarget->GetDistance(_Left) > MainTarget->GetDistance(_Right));
- }
-};
-
-struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI
-{
- flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FlameBlastTimer;
- uint32 CheckTimer;
- uint64 GlaiveGUID;
-
- void Reset()
- {
- FlameBlastTimer = 15000;
- CheckTimer = 5000;
- GlaiveGUID = 0;
- }
-
- void Aggro(Unit *who) {}
-
- void ChargeCheck()
- {
- // Get the Threat List
- std::list m_threatlist = m_creature->getThreatManager().getThreatList();
-
- if(!m_threatlist.size()) return; // He doesn't have anyone in his threatlist, useless to continue
-
- std::list targets;
- std::list::iterator itr = m_threatlist.begin();
- for( ; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
- {
- Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER && target->GetPositionZ()>350) //only on alive players
- targets.push_back(target);
- }
-
- if (!targets.size())
- return;
-
- //Sort the list of players
- targets.sort(TargetDistanceOrder(m_creature));
- //Resize so we only get the furthest target
- targets.resize(1);
-
- Unit* target = (*targets.begin());
- if(target && (!m_creature->IsWithinDistInMap(target, FLAME_CHARGE_DISTANCE)))
- {
- m_creature->AttackStop();
- m_creature->GetMotionMaster()->Clear(false);
- float x, y, z; // is it possible to fix charge?
- target->GetContactPoint(m_creature, x, y, z);
- m_creature->Relocate(x,y,z);
- m_creature->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_WALK_MODE, 1);
- //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
- m_creature->StopMoving();
- //DoCast(target, SPELL_CHARGE);
- m_creature->AddThreat(target, 5000000.0f);
- DoTextEmote("sets its gaze on $N!", target);
- }
- }
-
- void EnrageCheck()
- {
- if(GETUNIT(Glaive, GlaiveGUID))
- {
- if(!m_creature->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE))
- {
- Glaive->InterruptNonMeleeSpells(true);
- DoCast(m_creature, SPELL_FLAME_ENRAGE, true);
- DoResetThreat();
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && target->isAlive())
- {
- m_creature->AddThreat(m_creature->getVictim(), 5000000.0f);
- AttackStart(m_creature->getVictim());
- }
- }
- else if(!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL, 0))
- {
- Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false);
- m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE);
- }
- }
- }
-
- void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(FlameBlastTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim
- DoCast(m_creature->getVictim(), SPELL_FLAME_BLAST);
- FlameBlastTimer = 15000; //10000 is official-like?
- DoZoneInCombat(); //in case someone is revived
- }else FlameBlastTimer -= diff;
-
- if(CheckTimer < diff)
- {
- ChargeCheck();
- EnrageCheck();
- CheckTimer = 5000;
- }else CheckTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-
-
-/******* Functions and vars for Akama's AI ******/
-struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
-{
- npc_akama_illidanAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- PhaseAkama Phase;
- bool Event;
- uint32 Timer;
-
- uint64 IllidanGUID;
- uint64 ChannelGUID;
- uint64 SpiritGUID[2];
- uint64 GateGUID;
- uint64 DoorGUID[2];
-
- uint32 ChannelCount;
- uint32 WalkCount;
- uint32 TalkCount;
-
- void Reset()
- {
- if(pInstance)
- {
- pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
-
- 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);
-
- if(GETGO(Gate, GateGUID))
- Gate->SetUInt32Value(GAMEOBJECT_STATE, 1);
- for(uint8 i = 0; i < 2; i++)
- if(GETGO(Door, DoorGUID[i]))
- Door->SetUInt32Value(GAMEOBJECT_STATE, 1);
- }
- 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;
- WalkCount = 0;
- TalkCount = 0;
-
- KillAllElites();
-
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values..
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
-
- // 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()
- {
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- InCombat = false;
- }
-
- void Aggro(Unit *who) {}
-
- void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;}
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(damage > m_creature->GetHealth() || done_by->GetGUID() != IllidanGUID)
- damage = 0;
- }
-
- void KillAllElites()
- {
- std::list::iterator itr;
- for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
- if(pUnit && (pUnit->GetTypeId() == TYPEID_UNIT) && (pUnit->GetEntry() == ILLIDARI_ELITE))
- pUnit->setDeathState(JUST_DIED);
- }
- EnterEvadeMode();
- }
-
- void BeginTalk()
- {
- pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS);
-
- for(uint8 i = 0; i < 2; i++)
- if(GETGO(Door, DoorGUID[i]))
- Door->SetUInt32Value(GAMEOBJECT_STATE, 1);
-
- if(GETCRE(Illidan, IllidanGUID))
- {
- Illidan->RemoveAurasDueToSpell(SPELL_KNEEL);
- m_creature->SetInFront(Illidan);
- Illidan->SetInFront(m_creature);
- m_creature->StopMoving();
- Illidan->StopMoving();
- ((boss_illidan_stormrageAI*)Illidan->AI())->AkamaGUID = m_creature->GetGUID();
- ((boss_illidan_stormrageAI*)Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
- }
- }
-
- void BeginChannel()
- {
- float x, y, z;
- if(GETGO(Gate, GateGUID))
- Gate->GetPosition(x, y, z);
-
- if(Creature* Channel = m_creature->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
- {
- ChannelGUID = Channel->GetGUID();
- Channel->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); // Invisible but spell visuals can still be seen.
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DoCast(Channel, SPELL_AKAMA_DOOR_FAIL);
- }
-
- for(uint8 i = 0; i < 2; ++i)
- if(Creature* Spirit = m_creature->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
- {
- Spirit->SetVisibility(VISIBILITY_OFF);
- SpiritGUID[i] = Spirit->GetGUID();
- }
- }
-
- void BeginWalk()
- {
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->SetSpeed(MOVE_RUN, 1.0f);
- m_creature->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 PHASE_WALK:
- if(Phase == PHASE_CHANNEL)
- WalkCount = 0;
- else if(Phase == PHASE_TALK)
- {
- if(GETCRE(Illidan, IllidanGUID))
- ((boss_illidan_stormrageAI*)Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID());
- EnterEvadeMode();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- WalkCount++;
- }
- 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))
- {
- m_creature->AddThreat(Illidan, 10000000.0f);
- m_creature->GetMotionMaster()->MoveChase(Illidan);
- }
- Timer = 30000; //chain lightning
- break;
- case PHASE_FIGHT_MINIONS:
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- Timer = 10000 + rand()%6000;//summon minion
- break;
- case PHASE_RETURN:
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- KillAllElites();
- WalkCount = 0;
- BeginWalk();
- Timer = 1;
- break;
- default:
- break;
- }
- Phase = NextPhase;
- Event = false;
- }
-
- void HandleTalkSequence()
- {
- switch(TalkCount)
- {
- case 0:
- if(GETCRE(Illidan, IllidanGUID))
- {
- ((boss_illidan_stormrageAI*)Illidan->AI())->Timer[EVENT_TAUNT] += 30000;
- Illidan->Yell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION);
- }
- Timer = 8000;
- break;
- case 1:
- DoYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AKAMA_LEAVE);
- Timer = 3000;
- break;
- case 2:
- EnterPhase(PHASE_WALK);
- break;
- }
- TalkCount++;
- }
-
- void HandleChannelSequence()
- {
- Unit* Channel, *Spirit[2];
- if(ChannelCount <= 5)
- {
- Channel = Unit::GetUnit((*m_creature), ChannelGUID);
- Spirit[0] = Unit::GetUnit((*m_creature), SpiritGUID[0]);
- Spirit[1] = Unit::GetUnit((*m_creature), SpiritGUID[1]);
- if(!Channel || !Spirit[0] || !Spirit[1])
- return;
- }
-
- switch(ChannelCount)
- {
- case 0: // channel failed
- m_creature->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
- m_creature->InterruptNonMeleeSpells(true);
- Spirit[0]->InterruptNonMeleeSpells(true);
- Spirit[1]->InterruptNonMeleeSpells(true);
- if(GETGO(Gate, GateGUID))
- Gate->SetUInt32Value(GAMEOBJECT_STATE, 0);
- Timer = 2000;
- break;
- case 4:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- Timer = 2000;
- break;
- case 5:
- DoYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AKAMA_BEWARE);
- Channel->setDeathState(JUST_DIED);
- Spirit[0]->setDeathState(JUST_DIED);
- Spirit[1]->setDeathState(JUST_DIED);
- Timer = 3000;
- break;
- case 6:
- EnterPhase(PHASE_WALK);
- break;
- default:
- break;
- }
- ChannelCount++;
- }
-
- void HandleWalkSequence()
- {
- switch(WalkCount)
- {
- case 6:
- for(uint8 i = 0; i < 2; i++)
- if(GETGO(Door, DoorGUID[i]))
- Door->SetUInt32Value(GAMEOBJECT_STATE, 0);
- break;
- case 8:
- if(Phase == PHASE_WALK)
- EnterPhase(PHASE_TALK);
- else
- EnterPhase(PHASE_FIGHT_ILLIDAN);
- break;
- case 12:
- EnterPhase(PHASE_FIGHT_MINIONS);
- break;
- }
-
- if(Phase == PHASE_WALK)
- {
- Timer = 0;
- WalkCount++;
- m_creature->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- Event = false;
- if(Timer)
- {
- if(Timer <= diff)
- Event = true;
- else Timer -= diff;
- }
-
- if(Event)
- {
- switch(Phase)
- {
- case PHASE_CHANNEL:
- HandleChannelSequence();
- 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(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
- Timer = 30000;
- }
- }break;
- case PHASE_FIGHT_MINIONS:
- {
- float x, y, z;
- m_creature->GetPosition(x, y, z);
- Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
- //Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
- if(Elite)
- {
- Elite->AI()->AttackStart(m_creature);
- Elite->AddThreat(m_creature, 1000000.0f);
- AttackStart(Elite);
- }
- Timer = 10000 + rand()%6000;
- GETUNIT(Illidan, IllidanGUID);
- if(Illidan && HPPCT(Illidan) < 10)
- EnterPhase(PHASE_RETURN);
- }
- break;
- default:
- break;
- }
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20)
- DoCast(m_creature, SPELL_HEALING_POTION);
-
- DoMeleeAttackIfReady();
- }
-};
-
-
-struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI
-{
- boss_maievAI(Creature *c) : ScriptedAI(c) { Reset(); };
-
- uint64 IllidanGUID;
-
- PhaseIllidan Phase;
- EventMaiev Event;
- uint32 Timer[5];
- uint32 MaxTimer;
-
- 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;
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 44850);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 2, 45738);
- }
-
- void Aggro(Unit *who) {}
- void MoveInLineOfSight(Unit *who) {}
- void EnterEvadeMode() {}
- void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(done_by->GetGUID() != IllidanGUID )
- damage = 0;
- else
- {
- GETUNIT(Illidan, IllidanGUID);
- if(Illidan && Illidan->getVictim() == m_creature)
- damage = m_creature->GetMaxHealth()/10;
- if(damage >= m_creature->GetHealth())
- damage = 0;
- }
- }
-
- void AttackStart(Unit *who)
- {
- if(!who || Timer[EVENT_MAIEV_STEALTH])
- return;
-
- if (who->isTargetableForAttack())
- {
- if(Phase == PHASE_TALK_SEQUENCE)
- m_creature->Attack(who, false);
- else if(Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE )
- {
- GETUNIT(Illidan, IllidanGUID);
- if(Illidan && m_creature->IsWithinDistInMap(Illidan, 25))
- BlinkToPlayer();//Do not let dread aura hurt her.
- m_creature->Attack(who, false);
- }
- else
- DoStartAttackAndMovement(who);
-
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
-
- void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase.
- {
- switch(NextPhase)
- {
- case PHASE_TALK_SEQUENCE:
- if(Timer[EVENT_MAIEV_STEALTH])
- {
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetVisibility(VISIBILITY_ON);
- Timer[EVENT_MAIEV_STEALTH] = 0;
- }
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->GetMotionMaster()->Clear(false);
- //m_creature->GetMotionMaster()->MoveIdle();
- m_creature->AttackStop();
- m_creature->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)
- {
- m_creature->AttackStop();
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->GetMotionMaster()->Clear(false);
- //m_creature->GetMotionMaster()->MoveIdle();
- m_creature->Relocate(x, y, z);
- m_creature->SendMonsterMove(x, y, z, 0, 0, 0);
- DoCast(m_creature, SPELL_TELEPORT_VISUAL, true);
- }
-
- void BlinkToPlayer()
- {
- if(GETCRE(Illidan, IllidanGUID))
- {
- Unit* target = ((boss_illidan_stormrageAI*)Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0);
-
- if(!target || !m_creature->IsWithinDistInMap(target, 80) || Illidan->IsWithinDistInMap(target, 20))
- {
- uint8 pos = rand()%4;
- BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z);
- }
- else
- {
- float x, y, z;
- target->GetPosition(x, y, z);
- BlinkTo(x, y, z);
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if((!m_creature->SelectHostilTarget() || !m_creature->getVictim()) && !Timer[1])
- 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;
- }
-
- switch(Event)
- {
- case EVENT_MAIEV_STEALTH:
- {
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->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;
- DoYell(text, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, sound);
- Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
- }break;
- case EVENT_MAIEV_SHADOW_STRIKE:
- DoCast(m_creature->getVictim(), SPELL_SHADOW_STRIKE);
- Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000;
- break;
- case EVENT_MAIEV_TRAP:
- if(Phase == PHASE_NORMAL_MAIEV)
- {
- BlinkToPlayer();
- DoCast(m_creature, SPELL_CAGE_TRAP_SUMMON);
- Timer[EVENT_MAIEV_TRAP] = 22000;
- }
- else
- {
- if(!m_creature->IsWithinDistInMap(m_creature->getVictim(), 40))
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30);
- DoCast(m_creature->getVictim(), SPELL_THROW_DAGGER);
- Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
- }
- break;
- default:
- break;
- }
-
- if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if(GETCRE(Illidan, IllidanGUID))
- ((boss_illidan_stormrageAI*)Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID());
- m_creature->AttackStop();
- Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute
- MaxTimer = 1;
- }
-
- if(Phase == PHASE_NORMAL_MAIEV)
- DoMeleeAttackIfReady();
- }
-};
-
-
-bool GossipSelect_npc_akama_at_illidan(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if(action == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_akama_illidanAI*)_Creature->AI())->EnterPhase(PHASE_CHANNEL);
- }
- return true;
-}
-
-bool GossipHello_npc_akama_at_illidan(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(10465, _Creature->GetGUID());
-
- return true;
-}
-
-struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI
-{
- cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 IllidanGUID;
- uint32 DespawnTimer;
-
- bool Active;
- bool SummonedBeams;
-
- void Reset()
- {
- IllidanGUID = 0;
-
- Active = false;
- SummonedBeams = false;
-
- DespawnTimer = 0;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who){}
-
- void MoveInLineOfSight(Unit *who)
- {
- if(!Active)
- return;
-
- if(who && (who->GetTypeId() != TYPEID_PLAYER))
- {
- if(who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan
- {
- if(!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED, 0)))
- {
- IllidanGUID = who->GetGUID();
- who->CastSpell(who, SPELL_CAGED, true);
- DespawnTimer = 5000;
- if(who->HasAura(SPELL_ENRAGE, 0))
- who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage
- //if(GameObject* CageTrap = GameObject::GetGameObject(*m_creature, CageTrapGUID))
- // CageTrap->SetLootState(GO_JUST_DEACTIVATED);
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(DespawnTimer)
- if(DespawnTimer < diff)
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- else DespawnTimer -= diff;
-
- //if(IllidanGUID && !SummonedBeams)
- //{
- // if(Unit* Illidan = Unit::GetUnit(*m_creature, IllidanGUID)
- // {
- // //TODO: Find proper spells and properly apply 'caged' Illidan effect
- // }
- //}
- }
-};
-
-bool GOHello_cage_trap(Player* plr, GameObject* go)
-{
- float x, y, z;
- plr->GetPosition(x, y, z);
-
- Creature* trigger = NULL;
-
- CellPair pair(Trinity::ComputeCellPair(x, y));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- // Grid search for nearest live creature of entry 23304 within 10 yards
- Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck check(*plr, 23304, true, 10);
- Trinity::CreatureLastSearcher searcher(trigger, check);
-
- TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher);
-
- CellLock cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(plr->GetMap()));
-
- ((cage_trap_triggerAI*)trigger->AI())->Active = true;
- go->SetUInt32Value(GAMEOBJECT_STATE, 0);
- return true;
-}
-
-struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI
-{
- shadow_demonAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 TargetGUID;
-
- void Aggro(Unit *who) {}
-
- void Reset()
- {
- TargetGUID = 0;
- DoCast(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true);
- }
-
- void JustDied(Unit *killer)
- {
- Unit* target = Unit::GetUnit((*m_creature), TargetGUID);
- if(target)
- target->RemoveAurasDueToSpell(SPELL_PARALYZE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim()) return;
-
- if(m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
-
- if(!m_creature->getVictim()->HasAura(SPELL_PARALYZE, 0))
- {
- TargetGUID = m_creature->getVictim()->GetGUID();
- m_creature->AddThreat(m_creature->getVictim(), 10000000.0f);
- DoCast(m_creature->getVictim(), SPELL_PURPLE_BEAM, true);
- DoCast(m_creature->getVictim(), SPELL_PARALYZE, true);
- }
- // Kill our target if we're very close.
- if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 3))
- DoCast(m_creature->getVictim(), SPELL_CONSUME_SOUL);
- }
-};
-
-// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap
-struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
-{
- mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
- uint64 IllidanGUID;
- uint32 CheckTimer;
-
- void Reset()
- {
- if(pInstance)
- IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
- else
- IllidanGUID = 0;
-
- CheckTimer = 5000;
- DoCast(m_creature, SPELL_SHADOWFIEND_PASSIVE, true);
- }
-
- void Aggro(Unit* who) {}
- void MoveInLineOfSight(Unit *who){}
-
- void DoMeleeAttackIfReady()
- {
- if( m_creature->isAttackReady() && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
- {
- if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
- {
- m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND, true); //do not stack
- if(GETCRE(Illidan, IllidanGUID))
- ((boss_illidan_stormrageAI*)Illidan->AI())->AddParasiteTarget(m_creature->getVictim()->GetGUID());
- }
- m_creature->AttackerStateUpdate(m_creature->getVictim());
- m_creature->resetAttackTimer();
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->getVictim())
- {
- if(GETCRE(Illidan, IllidanGUID))
- {
- if(Illidan->getVictim() && !Illidan->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
- AttackStart(Illidan->getVictim());
- else
- AttackStart(((boss_illidan_stormrageAI*)Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 1));
- }
- }
- else
- DoMeleeAttackIfReady();
-
- if(CheckTimer < diff)
- {
- GETUNIT(Illidan, IllidanGUID);
- if(!Illidan || ((Creature*)Illidan)->IsInEvadeMode())
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- return;
- }else CheckTimer = 5000;
- }else CheckTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL demonfireAI : public ScriptedAI
-{
- demonfireAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
- uint64 IllidanGUID;
- bool IsTrigger;
- bool DemonFire;
- uint32 CheckTimer;
- uint32 DespawnTimer;
-
- void Reset()
- {
- if(pInstance)
- IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
- else
- IllidanGUID = 0;
-
- IsTrigger = false;
- DemonFire = false;
-
- CheckTimer = 5000;
- DespawnTimer = 78000; //spell duration, core bug, cannot despawn self
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit *who){}
-
- void UpdateAI(const uint32 diff)
- {
- if(IsTrigger)
- return;
-
- if(!DemonFire)
- DoCast(m_creature, SPELL_DEMON_FIRE); //duration 60s
-
- if(CheckTimer < diff)
- {
- GETUNIT(Illidan, IllidanGUID);
- if(!Illidan || !Illidan->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING))
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- return;
- }else CheckTimer = 5000;
- }else CheckTimer -= diff;
-
- if(DespawnTimer < diff)
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- }else DespawnTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL blazeAI : public ScriptedAI
-{
- blazeAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 BlazeTimer;
- uint32 DespawnTimer;
-
- void Reset()
- {
- BlazeTimer = 3000;
- DespawnTimer = 60000; // Spell duration = 1 min
- //((TemporarySummon*)m_creature)->Summon(TEMPSUMMON_TIMED_DESPAWN, 0, false);
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) { }
- void MoveInLineOfSight(Unit *who){ }
-
- void UpdateAI(const uint32 diff)
- {
- if(BlazeTimer)
- if(BlazeTimer <= diff)
- {
- DoCast(m_creature, SPELL_BLAZE_EFFECT);//duration 60s
- BlazeTimer = 0;
- }else BlazeTimer -= diff;
-
- if(DespawnTimer < diff)
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- }else DespawnTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL flamecrashAI : public ScriptedAI
-{
- flamecrashAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 DespawnTimer;
-
- void Reset()
- {
- DoCast(m_creature, SPELL_FLAME_CRASH_EFFECT);//duration inf
- DespawnTimer = 120000; // summon spell duration
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit *who) { }
- void MoveInLineOfSight(Unit *who){ }
-
- void UpdateAI(const uint32 diff)
- {
- if(DespawnTimer < diff)
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setDeathState(JUST_DIED);
- }else DespawnTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL blade_of_azzinothAI : public ScriptedAI
-{
- blade_of_azzinothAI(Creature* c) : ScriptedAI(c) {}
- void Reset() {}
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) { }
- void MoveInLineOfSight(Unit* who) { }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE)
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21431);//appear when hit by Illidan's glaive
- }
-};
-
-void boss_illidan_stormrageAI::Reset()
-{
- if(pInstance)
- pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
-
- for(uint8 i = 0; i < 2; i++)
- {
- if(FlameGUID[i])
- {
- if(GETUNIT(Flame, FlameGUID[i]))
- Flame->setDeathState(JUST_DIED);
- FlameGUID[i] = 0;
- }
-
- if(GlaiveGUID[i])
- {
- if(GETUNIT(Glaive, GlaiveGUID[i]))
- Glaive->setDeathState(JUST_DIED);
- GlaiveGUID[i] = 0;
- }
- }
-
- if(AkamaGUID)
- {
- if(GETCRE(Akama, AkamaGUID))
- {
- if(!Akama->isAlive())
- Akama->Respawn();
- else
- {
- ((npc_akama_illidanAI*)Akama->AI())->EnterEvadeMode();
- Akama->GetMotionMaster()->MoveTargetedHome();
- ((npc_akama_illidanAI*)Akama->AI())->Reset();
- }
- }
- AkamaGUID = 0;
- }
-
- if(MaievGUID)
- {
- GETUNIT(Maiev, MaievGUID);
- if(Maiev && Maiev->isAlive())
- {
- Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
- Maiev->setDeathState(JUST_DIED);
- }
- MaievGUID = 0;
- }
-
- Phase = PHASE_NULL;
- Event = EVENT_NULL;
- Timer[EVENT_BERSERK] = 1500000;
-
- HoverPoint = 0;
- TalkCount = 0;
- FlightCount = 0;
- TransformCount = 0;
-
- ParasiteTargets.clear();
-
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21135);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
-
- DoCast(m_creature, SPELL_DUAL_WIELD, true);
-}
-
-void boss_illidan_stormrageAI::HandleTalkSequence()
-{
- switch(TalkCount)
- {
- case 0:
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- break;
- case 8:
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Equip our warglaives!
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- break;
- case 9:
- if(GETCRE(Akama, AkamaGUID))
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- m_creature->AddThreat(Akama, 100.0f);
- ((npc_akama_illidanAI*)Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN);
- EnterPhase(PHASE_NORMAL);
- }
- break;
- case 10:
- SummonMaiev();
- break;
- case 11:
- if(GETUNIT(Maiev, MaievGUID))
- {
- Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible
- Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported!
- Maiev->SetInFront(m_creature); // Have her face us
- m_creature->SetInFront(Maiev); // Face her, so it's not rude =P
- Maiev->StopMoving();
- m_creature->StopMoving();
- }break;
- case 14:
- if(GETCRE(Maiev, MaievGUID))
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- Maiev->AddThreat(m_creature, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE
- Maiev->AI()->AttackStart(m_creature); // Force Maiev to attack us.
- EnterPhase(PHASE_NORMAL_MAIEV);
- }break;
- case 15:
- DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him
- break;
- case 17:
- if(GETUNIT(Akama, AkamaGUID))
- {
- if(!m_creature->IsWithinDistInMap(Akama, 15))
- {
- float x, y, z;
- m_creature->GetPosition(x, y, z);
- x += 10; y += 10;
- Akama->GetMotionMaster()->Clear(false);
- //Akama->GetMotionMaster()->MoveIdle();
- Akama->Relocate(x, y, z);
- Akama->SendMonsterMove(x, y, z, 0, 0, 0);//Illidan must not die until Akama arrives.
- Akama->GetMotionMaster()->MoveChase(m_creature);
- }
- }
- break;
- case 19: // Make Maiev leave
- if(GETUNIT(Maiev, MaievGUID))
- {
- Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
- Maiev->setDeathState(JUST_DIED);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
- }
- break;
- case 21: // Kill ourself.
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- break;
- default:
- break;
- }
- if(Phase == PHASE_TALK_SEQUENCE)
- Talk(TalkCount); // This function does most of the talking
- TalkCount++;
-}
-
-
-void boss_illidan_stormrageAI::CastEyeBlast()
-{
- m_creature->InterruptNonMeleeSpells(false);
-
- DoYell(SAY_EYE_BLAST, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, 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;
-
- for(uint8 i = 0; i < 2; ++i)//core bug, two buff do not coexist
- {
- Creature* Trigger = NULL;
- Trigger = m_creature->SummonCreature(DEMON_FIRE, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000);
- if(Trigger)
- {
- ((demonfireAI*)Trigger->AI())->IsTrigger = true;
- Trigger->SetSpeed(MOVE_WALK, 3);
- Trigger->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
- Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
-
- if(!i)
- Trigger->CastSpell(Trigger, SPELL_EYE_BLAST_TRIGGER, true);
- else
- {
- Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID());
- DoCast(Trigger, SPELL_EYE_BLAST);
- }
- }
- }
-}
-
-void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth()
-{
- DoYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMONFLAMES);
-
- for(uint8 i = 0; i < 2; ++i)
- {
- if(GETUNIT(Glaive, GlaiveGUID[i]))
- {
- Creature* Flame = m_creature->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(m_creature->getFaction()); // Just in case the database has it as a different faction
- Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE);
- Flame->AI()->AttackStart(m_creature->getVictim()); // Attack our target!
- FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase
- ((flame_of_azzinothAI*)Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]);
- DoZoneInCombat(Flame);
- Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it.
- }
- }
- }
-}
-
-void boss_illidan_stormrageAI::SummonMaiev()
-{
- DoCast(m_creature, SPELL_SHADOW_PRISON, true);
- Creature* Maiev = m_creature->SummonCreature(MAIEV_SHADOWSONG, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(Maiev)
- {
- Maiev->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk
- Maiev->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- MaievGUID = Maiev->GetGUID();
- ((boss_maievAI*)Maiev->AI())->GetIllidanGUID(m_creature->GetGUID());
- ((boss_maievAI*)Maiev->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
- }
- else // If Maiev cannot be summoned, reset the encounter and post some errors to the console.
- {
- EnterEvadeMode();
- DoTextEmote("is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter.", NULL);
- error_log("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 boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase)
-{
- DoZoneInCombat();
- switch(NextPhase)
- {
- case PHASE_NORMAL:
- case PHASE_NORMAL_2:
- case PHASE_NORMAL_MAIEV:
- AttackStart(m_creature->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(m_creature->getVictim());
- break;
- case PHASE_TALK_SEQUENCE:
- Timer[EVENT_TALK_SEQUENCE] = 100;
- m_creature->RemoveAllAuras();
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- m_creature->GetMotionMaster()->Clear(false);
- //m_creature->GetMotionMaster()->MoveIdle();
- m_creature->AttackStop();
- break;
- case PHASE_FLIGHT_SEQUENCE:
- if(Phase == PHASE_FLIGHT) //land
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- else //lift off
- {
- FlightCount = 1;
- Timer[EVENT_FLIGHT_SEQUENCE] = 1;
- m_creature->RemoveAllAuras();
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- m_creature->GetMotionMaster()->Clear(false);
- //m_creature->GetMotionMaster()->MoveIdle();
- m_creature->AttackStop();
- }
- break;
- case PHASE_TRANSFORM_SEQUENCE:
- if(Phase == PHASE_DEMON)
- Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
- else
- {
- TransformCount = 0;
- Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
- DoYell(SAY_MORPH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_MORPH);
- }
- m_creature->GetMotionMaster()->Clear();
- //m_creature->GetMotionMaster()->MoveIdle();
- m_creature->AttackStop();
- break;
- default:
- break;
- }
- if(MaievGUID)
- {
- GETCRE(Maiev, MaievGUID);
- if(Maiev && Maiev->isAlive())
- ((boss_maievAI*)Maiev->AI())->EnterPhase(NextPhase);
- }
- Phase = NextPhase;
- Event = EVENT_NULL;
-}
-
-CreatureAI* GetAI_boss_illidan_stormrage(Creature *_Creature)
-{
- return new boss_illidan_stormrageAI (_Creature);
-}
-
-CreatureAI* GetAI_npc_akama_at_illidan(Creature *_Creature)
-{
- return new npc_akama_illidanAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_maiev(Creature *_Creature)
-{
- return new boss_maievAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_flame_of_azzinoth(Creature *_Creature)
-{
- return new flame_of_azzinothAI (_Creature);
-}
-
-CreatureAI* GetAI_cage_trap_trigger(Creature *_Creature)
-{
- return new cage_trap_triggerAI (_Creature);
-}
-
-CreatureAI* GetAI_shadow_demon(Creature *_Creature)
-{
- return new shadow_demonAI (_Creature);
-}
-
-CreatureAI* GetAI_flamecrash(Creature *_Creature)
-{
- return new flamecrashAI (_Creature);
-}
-
-CreatureAI* GetAI_demonfire(Creature *_Creature)
-{
- return new demonfireAI (_Creature);
-}
-
-CreatureAI* GetAI_blaze(Creature *_Creature)
-{
- return new blazeAI (_Creature);
-}
-
-CreatureAI* GetAI_blade_of_azzinoth(Creature *_Creature)
-{
- return new blade_of_azzinothAI (_Creature);
-}
-
-CreatureAI* GetAI_parasitic_shadowfiend(Creature *_Creature)
-{
- return new mob_parasitic_shadowfiendAI (_Creature);
-}
-
-void AddSC_boss_illidan()
-{
- Script* newscript;
-
- newscript = new Script;
- newscript->Name = "boss_illidan_stormrage";
- newscript->GetAI = GetAI_boss_illidan_stormrage;
- m_scripts[nrscripts++] = newscript;
-
- 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;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "boss_maiev_shadowsong";
- newscript->GetAI = GetAI_boss_maiev;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_flame_of_azzinoth";
- newscript->GetAI = GetAI_mob_flame_of_azzinoth;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_blade_of_azzinoth";
- newscript->GetAI = GetAI_blade_of_azzinoth;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "gameobject_cage_trap";
- newscript->pGOHello = GOHello_cage_trap;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_cage_trap_trigger";
- newscript->GetAI = GetAI_cage_trap_trigger;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_shadow_demon";
- newscript->GetAI = GetAI_shadow_demon;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_flame_crash";
- newscript->GetAI = GetAI_flamecrash;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_demon_fire";
- newscript->GetAI = GetAI_demonfire;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_blaze";
- newscript->GetAI = GetAI_blaze;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_parasitic_shadowfiend";
- newscript->GetAI = GetAI_parasitic_shadowfiend;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_illidan_stormrage
+SD%Complete: 90
+SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon GOs for Cage Trap.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+#define GETGO(obj, guid) GameObject* obj = GameObject::GetGameObject(*m_creature, guid)
+#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*m_creature, guid)
+#define GETCRE(cre, guid) Creature* cre = (Creature*)Unit::GetUnit(*m_creature, guid)
+#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth()
+
+/************* Quotes and Sounds ***********************/
+// Gossip for when a player clicks Akama
+#define GOSSIP_ITEM "We are ready to face Illidan"
+
+// Yells for/by Akama
+#define SAY_AKAMA_BEWARE "Be wary friends, The Betrayer meditates in the court just beyond."
+#define SOUND_AKAMA_BEWARE 11388
+#define SAY_AKAMA_MINION "Come, my minions. Deal with this traitor as he deserves!"
+#define SOUND_AKAMA_MINION 11465
+#define SAY_AKAMA_LEAVE "I'll deal with these mongrels. Strike now, friends! Strike at the betrayer!"
+#define SOUND_AKAMA_LEAVE 11390
+
+// Self explanatory
+#define SAY_KILL1 "Who shall be next to taste my blades?!"
+#define SOUND_KILL1 11473
+#define SAY_KILL2 "This is too easy!"
+#define SOUND_KILL2 11472
+
+// I think I'll fly now and let my subordinates take you on
+#define SAY_TAKEOFF "I will not be touched by rabble such as you!"
+#define SOUND_TAKEOFF 11479
+#define SAY_SUMMONFLAMES "Behold the flames of Azzinoth!"
+#define SOUND_SUMMONFLAMES 11480
+
+// When casting Eye Blast. Demon Fire will be appear on places that he casts this
+#define SAY_EYE_BLAST "Stare into the eyes of the Betrayer!"
+#define SOUND_EYE_BLAST 11481
+
+// kk, I go big, dark and demon on you.
+#define SAY_MORPH "Behold the power... of the demon within!"
+#define SOUND_MORPH 11475
+
+// I KILL!
+#define SAY_ENRAGE "You've wasted too much time mortals, now you shall fall!"
+#define SOUND_ENRAGE 11474
+
+/************** Spells *************/
+// Normal Form
+#define SPELL_SHEAR 37335 // 41032 is bugged, cannot be block/dodge/parry// Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast
+#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him.
+#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect)
+#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off)
+#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :(
+#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY
+#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY
+// Flying (Phase 2)
+#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground
+#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell
+#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan
+#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time.
+#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second.
+// Demon Form
+#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground)
+#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel)
+#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar)
+#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him.
+#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target.
+#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect)
+#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Have each player cast it on itself (workaround)
+// Other Illidan spells
+#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to skully).
+#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev.
+#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees.
+#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150%
+#define SPELL_DUAL_WIELD 42459
+//Phase Normal spells
+#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons
+#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends
+#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons.
+#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them
+#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target
+#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target
+//Phase Flight spells
+#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell.
+#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius
+#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation.
+#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds
+#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature
+#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it.
+#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage.
+#define SPELL_CHARGE 41581 //40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan.
+#define SPELL_FLAME_ENRAGE 45078
+//Akama spells
+#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit
+#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit
+#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used...
+#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full.
+#define SPELL_CHAIN_LIGHTNING 40536 // 6938 to 8062 for 5 targets
+//Maiev spells
+#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO.
+#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards
+#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working)
+#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him'
+#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev
+#define SPELL_SHADOW_STRIKE 40685 // 4375 to 5625 every 3 seconds for 12 seconds
+#define SPELL_THROW_DAGGER 41152 // 5400 to 6600 damage, need dagger
+#define SPELL_FAN_BLADES 39954 // bugged visual
+
+// Other defines
+#define CENTER_X 676.740
+#define CENTER_Y 305.297
+#define CENTER_Z 353.192
+
+#define FLAME_ENRAGE_DISTANCE 30
+#define FLAME_CHARGE_DISTANCE 50
+
+/**** Creature Summon and Recognition IDs ****/
+enum CreatureEntry
+{
+ EMPTY = 0,
+ AKAMA = 22990,
+ ILLIDAN_STORMRAGE = 22917,
+ BLADE_OF_AZZINOTH = 22996,
+ FLAME_OF_AZZINOTH = 22997,
+ MAIEV_SHADOWSONG = 23197,
+ SHADOW_DEMON = 23375,
+ DEMON_FIRE = 23069,
+ FLAME_CRASH = 23336,
+ ILLIDAN_DOOR_TRIGGER = 23412,
+ SPIRIT_OF_OLUM = 23411,
+ SPIRIT_OF_UDALO = 23410,
+ ILLIDARI_ELITE = 23226,
+ PARASITIC_SHADOWFIEND = 23498,
+ CAGE_TRAP_TRIGGER = 23292,
+};
+
+/*** Phase Names ***/
+enum PhaseIllidan
+{
+ PHASE_NULL = 0,
+ PHASE_NORMAL = 1,
+ PHASE_FLIGHT = 2,
+ PHASE_NORMAL_2 = 3,
+ PHASE_DEMON = 4,
+ PHASE_NORMAL_MAIEV = 5,
+ PHASE_TALK_SEQUENCE = 6,
+ PHASE_FLIGHT_SEQUENCE = 7,
+ PHASE_TRANSFORM_SEQUENCE = 8,
+};//Maiev uses the same phase
+
+enum PhaseAkama
+{
+ PHASE_AKAMA_NULL = 0,
+ PHASE_CHANNEL = 1,
+ PHASE_WALK = 2,
+ PHASE_TALK = 3,
+ PHASE_FIGHT_ILLIDAN = 4,
+ PHASE_FIGHT_MINIONS = 5,
+ PHASE_RETURN = 6,
+};
+
+enum EventIllidan
+{
+ EVENT_NULL = 0,
+ EVENT_BERSERK = 1,
+ //normal phase
+ EVENT_TAUNT = 2,
+ EVENT_SHEAR = 3,
+ EVENT_FLAME_CRASH = 4,
+ EVENT_PARASITIC_SHADOWFIEND = 5,
+ EVENT_PARASITE_CHECK = 6,
+ EVENT_DRAW_SOUL = 7,
+ EVENT_AGONIZING_FLAMES = 8,
+ EVENT_TRANSFORM_NORMAL = 9,
+ EVENT_ENRAGE = 10,
+ //flight phase
+ EVENT_FIREBALL = 2,
+ EVENT_DARK_BARRAGE = 3,
+ EVENT_EYE_BLAST = 4,
+ EVENT_MOVE_POINT = 5,
+ //demon phase
+ EVENT_SHADOW_BLAST = 2,
+ EVENT_FLAME_BURST = 3,
+ EVENT_SHADOWDEMON = 4,
+ EVENT_TRANSFORM_DEMON = 5,
+ //sequence phase
+ EVENT_TALK_SEQUENCE = 2,
+ EVENT_FLIGHT_SEQUENCE = 2,
+ EVENT_TRANSFORM_SEQUENCE = 2,
+};
+
+enum EventMaiev
+{
+ EVENT_MAIEV_NULL = 0,
+ EVENT_MAIEV_STEALTH = 1,
+ EVENT_MAIEV_TAUNT = 2,
+ EVENT_MAIEV_SHADOW_STRIKE = 3,
+ EVENT_MAIEV_THROW_DAGGER = 4,
+ EVENT_MAIEV_TRAP = 5,
+};
+
+static EventIllidan MaxTimer[]=
+{
+ EVENT_NULL,
+ EVENT_DRAW_SOUL,
+ EVENT_MOVE_POINT,
+ EVENT_TRANSFORM_NORMAL,
+ EVENT_TRANSFORM_DEMON,
+ EVENT_ENRAGE,
+ EVENT_TALK_SEQUENCE,
+ EVENT_FLIGHT_SEQUENCE,
+ EVENT_TRANSFORM_SEQUENCE
+};
+
+struct Yells
+{
+ uint32 sound;
+ char* text;
+ uint32 creature, timer, emote;
+ bool Talk;
+};
+
+static Yells Conversation[]=
+{
+ {11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true},
+ {0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true},
+ {11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true},
+ {0, NULL, AKAMA, 5000, 66, true},
+ {11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true},
+ {11380, "The time has come! The moment is at hand!", AKAMA, 3000, 22, true},
+ {0, NULL, AKAMA, 2000, 15, true},
+ {11466, "You are not prepared!", ILLIDAN_STORMRAGE, 3000, 406, true},
+ {0, NULL, EMPTY, 1000, 0, true},
+ {0, NULL, EMPTY, 0, 0, false},//9
+ {11476, "Is this it, mortals? Is this all the fury you can muster?", ILLIDAN_STORMRAGE, 8000, 0, true},
+ {11491, "Their fury pales before mine, Illidan. We have some unsettled business between us.", MAIEV_SHADOWSONG, 8000, 5, true},
+ {11477, "Maiev... How is this even possible?", ILLIDAN_STORMRAGE, 5000, 1, true},
+ {11492, "Ah... my long hunt is finally over. Today, Justice will be done!", MAIEV_SHADOWSONG, 8000, 15, true},
+ {11470, "Feel the hatred of ten thousand years!", ILLIDAN_STORMRAGE, 1000, 0, false},//14
+ {11496, "Ahh... It is finished. You are beaten.", MAIEV_SHADOWSONG, 6000, 0, true},//15
+ {11478, "You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..", ILLIDAN_STORMRAGE, 30000, 65, true}, // Emote dead for now. Kill him later
+ {11497, "He is right. I feel nothing... I am nothing... Farewell, champions.", MAIEV_SHADOWSONG, 9000, 0, true},
+ {11498, NULL, MAIEV_SHADOWSONG, 5000, 0, true},
+ {11498, NULL, EMPTY, 1000, 0, true},//19 Maiev disappear
+ {11387, "The Light will fill these dismal halls once again. I swear it.", AKAMA, 8000, 0, true},
+ {0, NULL, EMPTY, 1000, 0, false}//21
+};
+
+static Yells RandomTaunts[]=
+{
+ {11467, "I can feel your hatred.", ILLIDAN_STORMRAGE, 0, 0, false},
+ {11468, "Give in to your fear!", ILLIDAN_STORMRAGE, 0, 0, false},
+ {11469, "You know nothing of power!", ILLIDAN_STORMRAGE, 0, 0, false},
+ {11471, "Such... arrogance!", ILLIDAN_STORMRAGE, 0, 0, false}
+};
+
+static Yells MaievTaunts[]=
+{
+ {11493, "That is for Naisha!", MAIEV_SHADOWSONG, 0, false},
+ {11494, "Bleed as I have bled!", MAIEV_SHADOWSONG, 0, 0, false},
+ {11495, "There shall be no prison for you this time!", MAIEV_SHADOWSONG, 0, 0, false},
+ {11500, "Meet your end, demon!", MAIEV_SHADOWSONG, 0, 0, false}
+};
+
+struct Locations
+{
+ float x, y, z;
+};
+
+static Locations HoverPosition[]=
+{
+ {657, 340, 355},
+ {657, 275, 355},
+ {705, 275, 355},
+ {705, 340, 355}
+};
+
+static Locations GlaivePosition[]=
+{
+ {695.105, 305.303, 354.256},
+ {659.338, 305.303, 354.256},//the distance between two glaives is 36
+ {700.105, 305.303, 354.256},
+ {664.338, 305.303, 354.256}
+};
+
+static Locations EyeBlast[]=
+{
+ {677, 350, 354},//start point, pass through glaive point
+ {677, 260, 354}
+};
+
+static Locations AkamaWP[]=
+{
+ {770.01, 304.50, 312.29}, // Bottom of the first stairs, at the doors
+ {780.66, 304.50, 319.74}, // Top of the first stairs
+ {790.13, 319.68, 319.76}, // Bottom of the second stairs (left from the entrance)
+ {787.17, 347.38, 341.42}, // Top of the second stairs
+ {781.34, 350.31, 341.44}, // Bottom of the third stairs
+ {762.60, 361.06, 353.60}, // Top of the third stairs
+ {756.35, 360.52, 353.27}, // Before the door-thingy
+ {743.82, 342.21, 353.00}, // Somewhere further
+ {732.69, 305.13, 353.00}, // In front of Illidan - (8)
+ {738.11, 365.44, 353.00}, // in front of the door-thingy (the other one!)
+ {792.18, 366.62, 341.42}, // Down the first flight of stairs
+ {796.84, 304.89, 319.76}, // Down the second flight of stairs
+ {782.01, 304.55, 319.76} // Final location - back at the initial gates. This is where he will fight the minions! (12)
+};
+// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned
+static Locations SpiritSpawns[]=
+{
+ {755.5426, 309.9156, 312.2129},
+ {755.5426, 298.7923, 312.0834}
+};
+
+struct Animation // For the demon transformation
+{
+ uint32 aura, unaura, timer, size, displayid, phase;
+ bool equip;
+};
+
+static Animation DemonTransformation[]=
+{
+ {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, true},
+ {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true},
+ {0, 0, 3000, 1073741824, 21322, 6, false},//stunned, cannot cast demon form
+ {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false},
+ {SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 4, false},
+ {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, false},
+ {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false},
+ {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false},
+ {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true},
+ {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true}
+};
+
+
+
+/************************************** Illidan's AI ***************************************/
+struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
+{
+ boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ 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];
+
+ std::list ParasiteTargets; // for safety, do not use Unit*
+
+ void Reset();
+
+ void JustSummoned(Creature* summon)//, TempSummonType type)
+ {
+ if(summon->GetCreatureInfo()->Entry == FLAME_CRASH)
+ {
+ // type = TEMPSUMMON_TIMED_DESPAWN;
+ }
+ //error_log("justsummoned %d %d", summon->GetCreatureInfo()->Entry, summon->GetGUID());
+ }
+
+ void SummonedCreatureDespawn(Creature* summon)
+ {
+ if(summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH)
+ {
+ for(uint8 i = 0; i < 2; i++)
+ if(summon->GetGUID() == FlameGUID[i])
+ FlameGUID[i] = 0;
+
+ if(!FlameGUID[0] && !FlameGUID[1])
+ {
+ m_creature->InterruptNonMeleeSpells(true);
+ EnterPhase(PHASE_FLIGHT_SEQUENCE);
+ }
+ }
+ }
+
+ void MovementInform(uint32 MovementType, uint32 Data)
+ {
+ if(FlightCount == 7) //change hover point
+ {
+ if(m_creature->getVictim())
+ {
+ m_creature->SetInFront(m_creature->getVictim());
+ m_creature->StopMoving();
+ }
+ EnterPhase(PHASE_FLIGHT);
+ }
+ else
+ Timer[EVENT_FLIGHT_SEQUENCE] = 1000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if(!who || Phase >= PHASE_TALK_SEQUENCE)
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ if(Phase == PHASE_FLIGHT || Phase == PHASE_DEMON)
+ m_creature->Attack(who, false);
+ else
+ DoStartAttackAndMovement(who);
+
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who) {}
+
+ void JustDied(Unit *killer)
+ {
+ m_creature->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)
+ {
+ GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(i));
+ if(Door)
+ Door->SetUInt32Value(GAMEOBJECT_STATE, 0); // Open Doors
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature) return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_KILL1, LANG_UNIVERSAL, victim);
+ DoPlaySoundToSet(m_creature, SOUND_KILL1);
+ break;
+ case 1:
+ DoYell(SAY_KILL2, LANG_UNIVERSAL, victim);
+ DoPlaySoundToSet(m_creature, SOUND_KILL2);
+ break;
+ }
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(damage >= m_creature->GetHealth() && done_by != m_creature)
+ damage = 0;
+ if(done_by->GetGUID() == MaievGUID)
+ done_by->AddThreat(m_creature, -(3*(float)damage)/4); // do not let maiev tank him
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades!
+ {
+ if(!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY))
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479);
+ else
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
+ m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
+ }
+ }
+
+ void AddParasiteTarget(uint64 targetGUID)
+ {
+ for(std::list::iterator tIter = ParasiteTargets.begin(); tIter != ParasiteTargets.end(); tIter++)
+ {
+ if(*tIter == targetGUID)
+ return;
+ }
+ ParasiteTargets.push_back(targetGUID);
+
+ if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV)
+ Timer[EVENT_PARASITE_CHECK] += 1000;
+ }
+
+ void DeleteFromThreatList(uint64 TargetGUID)
+ {
+ for(std::list::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
+ {
+ if((*itr)->getUnitGuid() == TargetGUID)
+ {
+ (*itr)->removeReference();
+ break;
+ }
+ }
+ }
+
+ void Talk(uint32 count)
+ {
+ Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer;
+
+ Creature* creature = NULL;
+ if(Conversation[count].creature == ILLIDAN_STORMRAGE)
+ creature = m_creature;
+ else if(Conversation[count].creature == AKAMA)
+ creature = ((Creature*)Unit::GetUnit((*m_creature), AkamaGUID));
+ else if(Conversation[count].creature == MAIEV_SHADOWSONG)
+ creature = ((Creature*)Unit::GetUnit((*m_creature), MaievGUID));
+
+ if(creature)
+ {
+ if(Conversation[count].emote)
+ creature->HandleEmoteCommand(Conversation[count].emote); // Make the creature do some animation!
+ if(Conversation[count].text)
+ creature->Yell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the creature yell out some text
+ if(Conversation[count].sound)
+ DoPlaySoundToSet(creature, Conversation[count].sound); // Play some sound on the creature
+ }
+ }
+
+ void EnterPhase(PhaseIllidan NextPhase);
+ void CastEyeBlast();
+ void SummonFlamesOfAzzinoth();
+ void SummonMaiev();
+ void SummonShadowDemon()
+ {
+ Creature* ShadowDemon = NULL;
+ Unit* target = NULL;
+ for(uint8 i = 0; i < 4; i++)
+ {
+ ShadowDemon = DoSpawnCreature(SHADOW_DEMON, 0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000);
+ if(ShadowDemon)
+ {
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && target->GetTypeId() == TYPEID_PLAYER) // only on players.
+ {
+ ShadowDemon->AddThreat(target, 5000000.0f);
+ ShadowDemon->AI()->AttackStart(target);
+ }
+ DoZoneInCombat(ShadowDemon);
+ }
+ }
+ }
+ void HandleTalkSequence();
+ void HandleFlightSequence()
+ {
+ switch(FlightCount)
+ {
+ case 1://lift off
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ //m_creature->GetMotionMaster()->Clear(false);
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
+ //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
+ m_creature->StopMoving();
+ DoYell(SAY_TAKEOFF, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAKEOFF);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
+ break;
+ case 2://move to center
+ //m_creature->GetMotionMaster()->Clear(false);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 3://throw one glaive
+ {
+ uint8 i=1;
+ Creature* Glaive = m_creature->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_NON_ATTACKABLE);
+ Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ Glaive->setFaction(m_creature->getFaction());
+ DoCast(Glaive, SPELL_THROW_GLAIVE2);
+ }
+ }
+ Timer[EVENT_FLIGHT_SEQUENCE] = 700;
+ break;
+ case 4://throw another
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ {
+ uint8 i=0;
+ Creature* Glaive = m_creature->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_NON_ATTACKABLE);
+ Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ Glaive->setFaction(m_creature->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
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 7://return to center
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 8://glaive return
+ for(uint8 i = 0; i < 2; i++)
+ {
+ if(GlaiveGUID[i])
+ {
+ Unit* Glaive = Unit::GetUnit((*m_creature), GlaiveGUID[i]);
+ if(Glaive)
+ {
+ Glaive->CastSpell(m_creature, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us
+ Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); // disappear but not die for now
+ }
+ }
+ }
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
+ break;
+ case 9://land
+ //m_creature->GetMotionMaster()->Clear(false);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
+ m_creature->StopMoving();
+ m_creature->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();
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ //m_creature->GetMotionMaster()->Clear();
+ m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
+ EnterPhase(PHASE_NORMAL_2);
+ break;
+ default:
+ break;
+ }
+ FlightCount++;
+ }
+
+ void HandleTransformSequence()
+ {
+ if(DemonTransformation[TransformCount].unaura)
+ m_creature->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura);
+
+ if(DemonTransformation[TransformCount].aura)
+ DoCast(m_creature, DemonTransformation[TransformCount].aura, true);
+
+ if(DemonTransformation[TransformCount].displayid)
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, DemonTransformation[TransformCount].displayid); // It's morphin time!
+
+ if(DemonTransformation[TransformCount].equip)
+ {
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Requip warglaives if needed
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
+ m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
+ }
+ else
+ {
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); // Unequip warglaives if needed
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ }
+
+ switch(TransformCount)
+ {
+ 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(Phase == PHASE_TRANSFORM_SEQUENCE)
+ Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer;
+ TransformCount++;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if((!m_creature->SelectHostilTarget() || !m_creature->getVictim()) && Phase < PHASE_TALK_SEQUENCE)
+ return;
+
+ Event = EVENT_NULL;
+ for(uint32 i = 1; i <= MaxTimer[Phase]; i++)
+ if(Timer[i])
+ if(Timer[i] <= diff)
+ {
+ if(!Event)
+ Event = (EventIllidan)i;
+ }
+ else Timer[i] -= diff;
+
+ switch(Phase)
+ {
+ case PHASE_NORMAL:
+ if(HPPCT(m_creature) < 65)
+ EnterPhase(PHASE_FLIGHT_SEQUENCE);
+ break;
+
+ case PHASE_NORMAL_2:
+ if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
+ EnterPhase(PHASE_TALK_SEQUENCE);
+ break;
+
+ case PHASE_NORMAL_MAIEV:
+ if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 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(m_creature->IsNonMeleeSpellCasted(false))
+ return;
+
+ if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED, 0))
+ {
+ switch(Event)
+ {
+ //PHASE_NORMAL
+ case EVENT_BERSERK:
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ DoCast(m_creature, 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)
+ DoYell(yell, LANG_UNIVERSAL, NULL);
+ if(soundid)
+ DoPlaySoundToSet(m_creature, soundid);
+ }
+ Timer[EVENT_TAUNT] = 32000;
+ break;
+
+ case EVENT_SHEAR:
+ DoCast(m_creature->getVictim(), SPELL_SHEAR);
+ Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000);
+ break;
+
+ case EVENT_FLAME_CRASH:
+ DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH);
+ Timer[EVENT_FLAME_CRASH] = 35000;
+ break;
+
+ case EVENT_PARASITIC_SHADOWFIEND:
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target) target = m_creature->getVictim();
+ if(target->GetTypeId() == TYPEID_PLAYER && !target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
+ {
+ target->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); // do not miss
+ ParasiteTargets.push_back(target->GetGUID());
+ Timer[EVENT_PARASITE_CHECK] += 1000; // do not check immediately
+ }
+ Timer[EVENT_PARASITIC_SHADOWFIEND] = 40000;
+ }
+ break;
+
+ case EVENT_PARASITE_CHECK:
+ for(std::list::iterator tIter = ParasiteTargets.begin(); tIter != ParasiteTargets.end();)
+ {
+ Unit* target = Unit::GetUnit((*m_creature), *tIter);
+ if(!target || !target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
+ {
+ if(target && target->isAlive())
+ target->CastSpell(target, SPELL_SUMMON_PARASITICS, true);
+ std::list::iterator tIter2 = tIter;
+ ++tIter;
+ ParasiteTargets.erase(tIter2);
+ }
+ else
+ ++tIter;
+ }
+ if(ParasiteTargets.empty())
+ Timer[EVENT_PARASITE_CHECK] = 0;
+ else
+ Timer[EVENT_PARASITE_CHECK] = 1000;
+ break;
+
+ case EVENT_DRAW_SOUL:
+ DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL);
+ Timer[EVENT_DRAW_SOUL] = 55000;
+ 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(m_creature, SPELL_ENRAGE);
+ Timer[EVENT_ENRAGE] = 0;
+ break;
+
+ default:
+ break;
+ }
+ DoMeleeAttackIfReady();
+ }
+
+ if(Phase == PHASE_FLIGHT)
+ {
+ 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
+ for (uint8 i = 0; i <= rand()%3; i++)
+ {
+ HoverPoint++;
+ if(HoverPoint > 3)
+ HoverPoint = 0;
+ }
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if(Phase == PHASE_DEMON)
+ {
+ switch(Event)
+ {
+ case EVENT_SHADOW_BLAST:
+ m_creature->GetMotionMaster()->Clear(false);
+ if(!m_creature->IsWithinDistInMap(m_creature->getVictim(), 50)||!m_creature->IsWithinLOSInMap(m_creature->getVictim()))
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30);
+ else
+ m_creature->GetMotionMaster()->MoveIdle();
+ DoCast(m_creature->getVictim(), SPELL_SHADOW_BLAST);
+ Timer[EVENT_SHADOW_BLAST] = 4000;
+ break;
+ case EVENT_SHADOWDEMON:
+ SummonShadowDemon();
+ Timer[EVENT_SHADOWDEMON] = 0;
+ Timer[EVENT_FLAME_BURST] += 10000;
+ break;
+ case EVENT_FLAME_BURST:
+ DoCast(m_creature, SPELL_FLAME_BURST);
+ Timer[EVENT_FLAME_BURST] = 15000;
+ break;
+ case EVENT_TRANSFORM_DEMON:
+ EnterPhase(PHASE_TRANSFORM_SEQUENCE);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+};
+
+/********************************** End of Illidan AI ******************************************/
+
+//This is used to sort the players by distance in preparation for being charged by the flames.
+struct TargetDistanceOrder : public std::binary_function
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator ">"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) > MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI
+{
+ flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FlameBlastTimer;
+ uint32 CheckTimer;
+ uint64 GlaiveGUID;
+
+ void Reset()
+ {
+ FlameBlastTimer = 15000;
+ CheckTimer = 5000;
+ GlaiveGUID = 0;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void ChargeCheck()
+ {
+ // Get the Threat List
+ std::list m_threatlist = m_creature->getThreatManager().getThreatList();
+
+ if(!m_threatlist.size()) return; // He doesn't have anyone in his threatlist, useless to continue
+
+ std::list targets;
+ std::list::iterator itr = m_threatlist.begin();
+ for( ; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
+ {
+ Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER && target->GetPositionZ()>350) //only on alive players
+ targets.push_back(target);
+ }
+
+ if (!targets.size())
+ return;
+
+ //Sort the list of players
+ targets.sort(TargetDistanceOrder(m_creature));
+ //Resize so we only get the furthest target
+ targets.resize(1);
+
+ Unit* target = (*targets.begin());
+ if(target && (!m_creature->IsWithinDistInMap(target, FLAME_CHARGE_DISTANCE)))
+ {
+ m_creature->AttackStop();
+ m_creature->GetMotionMaster()->Clear(false);
+ float x, y, z; // is it possible to fix charge?
+ target->GetContactPoint(m_creature, x, y, z);
+ m_creature->Relocate(x,y,z);
+ m_creature->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_WALK_MODE, 1);
+ //m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+ m_creature->StopMoving();
+ //DoCast(target, SPELL_CHARGE);
+ m_creature->AddThreat(target, 5000000.0f);
+ DoTextEmote("sets its gaze on $N!", target);
+ }
+ }
+
+ void EnrageCheck()
+ {
+ if(GETUNIT(Glaive, GlaiveGUID))
+ {
+ if(!m_creature->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE))
+ {
+ Glaive->InterruptNonMeleeSpells(true);
+ DoCast(m_creature, SPELL_FLAME_ENRAGE, true);
+ DoResetThreat();
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && target->isAlive())
+ {
+ m_creature->AddThreat(m_creature->getVictim(), 5000000.0f);
+ AttackStart(m_creature->getVictim());
+ }
+ }
+ else if(!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL, 0))
+ {
+ Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false);
+ m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE);
+ }
+ }
+ }
+
+ void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(FlameBlastTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim
+ DoCast(m_creature->getVictim(), SPELL_FLAME_BLAST);
+ FlameBlastTimer = 15000; //10000 is official-like?
+ DoZoneInCombat(); //in case someone is revived
+ }else FlameBlastTimer -= diff;
+
+ if(CheckTimer < diff)
+ {
+ ChargeCheck();
+ EnrageCheck();
+ CheckTimer = 5000;
+ }else CheckTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+
+
+/******* Functions and vars for Akama's AI ******/
+struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
+{
+ npc_akama_illidanAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ PhaseAkama Phase;
+ bool Event;
+ uint32 Timer;
+
+ uint64 IllidanGUID;
+ uint64 ChannelGUID;
+ uint64 SpiritGUID[2];
+ uint64 GateGUID;
+ uint64 DoorGUID[2];
+
+ uint32 ChannelCount;
+ uint32 WalkCount;
+ uint32 TalkCount;
+
+ void Reset()
+ {
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
+
+ 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);
+
+ if(GETGO(Gate, GateGUID))
+ Gate->SetUInt32Value(GAMEOBJECT_STATE, 1);
+ for(uint8 i = 0; i < 2; i++)
+ if(GETGO(Door, DoorGUID[i]))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, 1);
+ }
+ 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;
+ WalkCount = 0;
+ TalkCount = 0;
+
+ KillAllElites();
+
+ m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values..
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ }
+
+ // 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()
+ {
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ InCombat = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;}
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(damage > m_creature->GetHealth() || done_by->GetGUID() != IllidanGUID)
+ damage = 0;
+ }
+
+ void KillAllElites()
+ {
+ std::list::iterator itr;
+ for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ if(pUnit && (pUnit->GetTypeId() == TYPEID_UNIT) && (pUnit->GetEntry() == ILLIDARI_ELITE))
+ pUnit->setDeathState(JUST_DIED);
+ }
+ EnterEvadeMode();
+ }
+
+ void BeginTalk()
+ {
+ pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS);
+
+ for(uint8 i = 0; i < 2; i++)
+ if(GETGO(Door, DoorGUID[i]))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, 1);
+
+ if(GETCRE(Illidan, IllidanGUID))
+ {
+ Illidan->RemoveAurasDueToSpell(SPELL_KNEEL);
+ m_creature->SetInFront(Illidan);
+ Illidan->SetInFront(m_creature);
+ m_creature->StopMoving();
+ Illidan->StopMoving();
+ ((boss_illidan_stormrageAI*)Illidan->AI())->AkamaGUID = m_creature->GetGUID();
+ ((boss_illidan_stormrageAI*)Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
+ }
+ }
+
+ void BeginChannel()
+ {
+ float x, y, z;
+ if(GETGO(Gate, GateGUID))
+ Gate->GetPosition(x, y, z);
+
+ if(Creature* Channel = m_creature->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
+ {
+ ChannelGUID = Channel->GetGUID();
+ Channel->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); // Invisible but spell visuals can still be seen.
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ DoCast(Channel, SPELL_AKAMA_DOOR_FAIL);
+ }
+
+ for(uint8 i = 0; i < 2; ++i)
+ if(Creature* Spirit = m_creature->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
+ {
+ Spirit->SetVisibility(VISIBILITY_OFF);
+ SpiritGUID[i] = Spirit->GetGUID();
+ }
+ }
+
+ void BeginWalk()
+ {
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ m_creature->SetSpeed(MOVE_RUN, 1.0f);
+ m_creature->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 PHASE_WALK:
+ if(Phase == PHASE_CHANNEL)
+ WalkCount = 0;
+ else if(Phase == PHASE_TALK)
+ {
+ if(GETCRE(Illidan, IllidanGUID))
+ ((boss_illidan_stormrageAI*)Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID());
+ EnterEvadeMode();
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ WalkCount++;
+ }
+ 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))
+ {
+ m_creature->AddThreat(Illidan, 10000000.0f);
+ m_creature->GetMotionMaster()->MoveChase(Illidan);
+ }
+ Timer = 30000; //chain lightning
+ break;
+ case PHASE_FIGHT_MINIONS:
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Timer = 10000 + rand()%6000;//summon minion
+ break;
+ case PHASE_RETURN:
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ KillAllElites();
+ WalkCount = 0;
+ BeginWalk();
+ Timer = 1;
+ break;
+ default:
+ break;
+ }
+ Phase = NextPhase;
+ Event = false;
+ }
+
+ void HandleTalkSequence()
+ {
+ switch(TalkCount)
+ {
+ case 0:
+ if(GETCRE(Illidan, IllidanGUID))
+ {
+ ((boss_illidan_stormrageAI*)Illidan->AI())->Timer[EVENT_TAUNT] += 30000;
+ Illidan->Yell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION);
+ }
+ Timer = 8000;
+ break;
+ case 1:
+ DoYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AKAMA_LEAVE);
+ Timer = 3000;
+ break;
+ case 2:
+ EnterPhase(PHASE_WALK);
+ break;
+ }
+ TalkCount++;
+ }
+
+ void HandleChannelSequence()
+ {
+ Unit* Channel, *Spirit[2];
+ if(ChannelCount <= 5)
+ {
+ Channel = Unit::GetUnit((*m_creature), ChannelGUID);
+ Spirit[0] = Unit::GetUnit((*m_creature), SpiritGUID[0]);
+ Spirit[1] = Unit::GetUnit((*m_creature), SpiritGUID[1]);
+ if(!Channel || !Spirit[0] || !Spirit[1])
+ return;
+ }
+
+ switch(ChannelCount)
+ {
+ case 0: // channel failed
+ m_creature->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
+ m_creature->InterruptNonMeleeSpells(true);
+ Spirit[0]->InterruptNonMeleeSpells(true);
+ Spirit[1]->InterruptNonMeleeSpells(true);
+ if(GETGO(Gate, GateGUID))
+ Gate->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ Timer = 2000;
+ break;
+ case 4:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ Timer = 2000;
+ break;
+ case 5:
+ DoYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AKAMA_BEWARE);
+ Channel->setDeathState(JUST_DIED);
+ Spirit[0]->setDeathState(JUST_DIED);
+ Spirit[1]->setDeathState(JUST_DIED);
+ Timer = 3000;
+ break;
+ case 6:
+ EnterPhase(PHASE_WALK);
+ break;
+ default:
+ break;
+ }
+ ChannelCount++;
+ }
+
+ void HandleWalkSequence()
+ {
+ switch(WalkCount)
+ {
+ case 6:
+ for(uint8 i = 0; i < 2; i++)
+ if(GETGO(Door, DoorGUID[i]))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ break;
+ case 8:
+ if(Phase == PHASE_WALK)
+ EnterPhase(PHASE_TALK);
+ else
+ EnterPhase(PHASE_FIGHT_ILLIDAN);
+ break;
+ case 12:
+ EnterPhase(PHASE_FIGHT_MINIONS);
+ break;
+ }
+
+ if(Phase == PHASE_WALK)
+ {
+ Timer = 0;
+ WalkCount++;
+ m_creature->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ Event = false;
+ if(Timer)
+ {
+ if(Timer <= diff)
+ Event = true;
+ else Timer -= diff;
+ }
+
+ if(Event)
+ {
+ switch(Phase)
+ {
+ case PHASE_CHANNEL:
+ HandleChannelSequence();
+ 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(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
+ Timer = 30000;
+ }
+ }break;
+ case PHASE_FIGHT_MINIONS:
+ {
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+ Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ //Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ if(Elite)
+ {
+ Elite->AI()->AttackStart(m_creature);
+ Elite->AddThreat(m_creature, 1000000.0f);
+ AttackStart(Elite);
+ }
+ Timer = 10000 + rand()%6000;
+ GETUNIT(Illidan, IllidanGUID);
+ if(Illidan && HPPCT(Illidan) < 10)
+ EnterPhase(PHASE_RETURN);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20)
+ DoCast(m_creature, SPELL_HEALING_POTION);
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+
+struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI
+{
+ boss_maievAI(Creature *c) : ScriptedAI(c) { Reset(); };
+
+ uint64 IllidanGUID;
+
+ PhaseIllidan Phase;
+ EventMaiev Event;
+ uint32 Timer[5];
+ uint32 MaxTimer;
+
+ 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;
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 44850);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 2, 45738);
+ }
+
+ void Aggro(Unit *who) {}
+ void MoveInLineOfSight(Unit *who) {}
+ void EnterEvadeMode() {}
+ void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(done_by->GetGUID() != IllidanGUID )
+ damage = 0;
+ else
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if(Illidan && Illidan->getVictim() == m_creature)
+ damage = m_creature->GetMaxHealth()/10;
+ if(damage >= m_creature->GetHealth())
+ damage = 0;
+ }
+ }
+
+ void AttackStart(Unit *who)
+ {
+ if(!who || Timer[EVENT_MAIEV_STEALTH])
+ return;
+
+ if (who->isTargetableForAttack())
+ {
+ if(Phase == PHASE_TALK_SEQUENCE)
+ m_creature->Attack(who, false);
+ else if(Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE )
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if(Illidan && m_creature->IsWithinDistInMap(Illidan, 25))
+ BlinkToPlayer();//Do not let dread aura hurt her.
+ m_creature->Attack(who, false);
+ }
+ else
+ DoStartAttackAndMovement(who);
+
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+
+ void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase.
+ {
+ switch(NextPhase)
+ {
+ case PHASE_TALK_SEQUENCE:
+ if(Timer[EVENT_MAIEV_STEALTH])
+ {
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ m_creature->SetVisibility(VISIBILITY_ON);
+ Timer[EVENT_MAIEV_STEALTH] = 0;
+ }
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->GetMotionMaster()->Clear(false);
+ //m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->AttackStop();
+ m_creature->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)
+ {
+ m_creature->AttackStop();
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->GetMotionMaster()->Clear(false);
+ //m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->Relocate(x, y, z);
+ m_creature->SendMonsterMove(x, y, z, 0, 0, 0);
+ DoCast(m_creature, SPELL_TELEPORT_VISUAL, true);
+ }
+
+ void BlinkToPlayer()
+ {
+ if(GETCRE(Illidan, IllidanGUID))
+ {
+ Unit* target = ((boss_illidan_stormrageAI*)Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ if(!target || !m_creature->IsWithinDistInMap(target, 80) || Illidan->IsWithinDistInMap(target, 20))
+ {
+ uint8 pos = rand()%4;
+ BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z);
+ }
+ else
+ {
+ float x, y, z;
+ target->GetPosition(x, y, z);
+ BlinkTo(x, y, z);
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if((!m_creature->SelectHostilTarget() || !m_creature->getVictim()) && !Timer[1])
+ 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;
+ }
+
+ switch(Event)
+ {
+ case EVENT_MAIEV_STEALTH:
+ {
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ m_creature->SetVisibility(VISIBILITY_ON);
+ m_creature->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;
+ DoYell(text, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, sound);
+ Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
+ }break;
+ case EVENT_MAIEV_SHADOW_STRIKE:
+ DoCast(m_creature->getVictim(), SPELL_SHADOW_STRIKE);
+ Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000;
+ break;
+ case EVENT_MAIEV_TRAP:
+ if(Phase == PHASE_NORMAL_MAIEV)
+ {
+ BlinkToPlayer();
+ DoCast(m_creature, SPELL_CAGE_TRAP_SUMMON);
+ Timer[EVENT_MAIEV_TRAP] = 22000;
+ }
+ else
+ {
+ if(!m_creature->IsWithinDistInMap(m_creature->getVictim(), 40))
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30);
+ DoCast(m_creature->getVictim(), SPELL_THROW_DAGGER);
+ Timer[EVENT_MAIEV_THROW_DAGGER] = 2000;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if(GETCRE(Illidan, IllidanGUID))
+ ((boss_illidan_stormrageAI*)Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID());
+ m_creature->AttackStop();
+ Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute
+ MaxTimer = 1;
+ }
+
+ if(Phase == PHASE_NORMAL_MAIEV)
+ DoMeleeAttackIfReady();
+ }
+};
+
+
+bool GossipSelect_npc_akama_at_illidan(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if(action == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_akama_illidanAI*)_Creature->AI())->EnterPhase(PHASE_CHANNEL);
+ }
+ return true;
+}
+
+bool GossipHello_npc_akama_at_illidan(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(10465, _Creature->GetGUID());
+
+ return true;
+}
+
+struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI
+{
+ cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 IllidanGUID;
+ uint32 DespawnTimer;
+
+ bool Active;
+ bool SummonedBeams;
+
+ void Reset()
+ {
+ IllidanGUID = 0;
+
+ Active = false;
+ SummonedBeams = false;
+
+ DespawnTimer = 0;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who){}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!Active)
+ return;
+
+ if(who && (who->GetTypeId() != TYPEID_PLAYER))
+ {
+ if(who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan
+ {
+ if(!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED, 0)))
+ {
+ IllidanGUID = who->GetGUID();
+ who->CastSpell(who, SPELL_CAGED, true);
+ DespawnTimer = 5000;
+ if(who->HasAura(SPELL_ENRAGE, 0))
+ who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage
+ //if(GameObject* CageTrap = GameObject::GetGameObject(*m_creature, CageTrapGUID))
+ // CageTrap->SetLootState(GO_JUST_DEACTIVATED);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(DespawnTimer)
+ if(DespawnTimer < diff)
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ else DespawnTimer -= diff;
+
+ //if(IllidanGUID && !SummonedBeams)
+ //{
+ // if(Unit* Illidan = Unit::GetUnit(*m_creature, IllidanGUID)
+ // {
+ // //TODO: Find proper spells and properly apply 'caged' Illidan effect
+ // }
+ //}
+ }
+};
+
+bool GOHello_cage_trap(Player* plr, GameObject* go)
+{
+ float x, y, z;
+ plr->GetPosition(x, y, z);
+
+ Creature* trigger = NULL;
+
+ CellPair pair(Trinity::ComputeCellPair(x, y));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ // Grid search for nearest live creature of entry 23304 within 10 yards
+ Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck check(*plr, 23304, true, 10);
+ Trinity::CreatureLastSearcher searcher(trigger, check);
+
+ TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher);
+
+ CellLock cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, cSearcher, *(plr->GetMap()));
+
+ ((cage_trap_triggerAI*)trigger->AI())->Active = true;
+ go->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ return true;
+}
+
+struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI
+{
+ shadow_demonAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 TargetGUID;
+
+ void Aggro(Unit *who) {}
+
+ void Reset()
+ {
+ TargetGUID = 0;
+ DoCast(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true);
+ }
+
+ void JustDied(Unit *killer)
+ {
+ Unit* target = Unit::GetUnit((*m_creature), TargetGUID);
+ if(target)
+ target->RemoveAurasDueToSpell(SPELL_PARALYZE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim()) return;
+
+ if(m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
+
+ if(!m_creature->getVictim()->HasAura(SPELL_PARALYZE, 0))
+ {
+ TargetGUID = m_creature->getVictim()->GetGUID();
+ m_creature->AddThreat(m_creature->getVictim(), 10000000.0f);
+ DoCast(m_creature->getVictim(), SPELL_PURPLE_BEAM, true);
+ DoCast(m_creature->getVictim(), SPELL_PARALYZE, true);
+ }
+ // Kill our target if we're very close.
+ if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 3))
+ DoCast(m_creature->getVictim(), SPELL_CONSUME_SOUL);
+ }
+};
+
+// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap
+struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
+{
+ mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ uint64 IllidanGUID;
+ uint32 CheckTimer;
+
+ void Reset()
+ {
+ if(pInstance)
+ IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
+ else
+ IllidanGUID = 0;
+
+ CheckTimer = 5000;
+ DoCast(m_creature, SPELL_SHADOWFIEND_PASSIVE, true);
+ }
+
+ void Aggro(Unit* who) {}
+ void MoveInLineOfSight(Unit *who){}
+
+ void DoMeleeAttackIfReady()
+ {
+ if( m_creature->isAttackReady() && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
+ {
+ m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND, true); //do not stack
+ if(GETCRE(Illidan, IllidanGUID))
+ ((boss_illidan_stormrageAI*)Illidan->AI())->AddParasiteTarget(m_creature->getVictim()->GetGUID());
+ }
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->getVictim())
+ {
+ if(GETCRE(Illidan, IllidanGUID))
+ {
+ if(Illidan->getVictim() && !Illidan->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
+ AttackStart(Illidan->getVictim());
+ else
+ AttackStart(((boss_illidan_stormrageAI*)Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 1));
+ }
+ }
+ else
+ DoMeleeAttackIfReady();
+
+ if(CheckTimer < diff)
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if(!Illidan || ((Creature*)Illidan)->IsInEvadeMode())
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ return;
+ }else CheckTimer = 5000;
+ }else CheckTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL demonfireAI : public ScriptedAI
+{
+ demonfireAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ uint64 IllidanGUID;
+ bool IsTrigger;
+ bool DemonFire;
+ uint32 CheckTimer;
+ uint32 DespawnTimer;
+
+ void Reset()
+ {
+ if(pInstance)
+ IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
+ else
+ IllidanGUID = 0;
+
+ IsTrigger = false;
+ DemonFire = false;
+
+ CheckTimer = 5000;
+ DespawnTimer = 78000; //spell duration, core bug, cannot despawn self
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit *who){}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(IsTrigger)
+ return;
+
+ if(!DemonFire)
+ DoCast(m_creature, SPELL_DEMON_FIRE); //duration 60s
+
+ if(CheckTimer < diff)
+ {
+ GETUNIT(Illidan, IllidanGUID);
+ if(!Illidan || !Illidan->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING))
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ return;
+ }else CheckTimer = 5000;
+ }else CheckTimer -= diff;
+
+ if(DespawnTimer < diff)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ }else DespawnTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL blazeAI : public ScriptedAI
+{
+ blazeAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 BlazeTimer;
+ uint32 DespawnTimer;
+
+ void Reset()
+ {
+ BlazeTimer = 3000;
+ DespawnTimer = 60000; // Spell duration = 1 min
+ //((TemporarySummon*)m_creature)->Summon(TEMPSUMMON_TIMED_DESPAWN, 0, false);
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) { }
+ void MoveInLineOfSight(Unit *who){ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(BlazeTimer)
+ if(BlazeTimer <= diff)
+ {
+ DoCast(m_creature, SPELL_BLAZE_EFFECT);//duration 60s
+ BlazeTimer = 0;
+ }else BlazeTimer -= diff;
+
+ if(DespawnTimer < diff)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ }else DespawnTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL flamecrashAI : public ScriptedAI
+{
+ flamecrashAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 DespawnTimer;
+
+ void Reset()
+ {
+ DoCast(m_creature, SPELL_FLAME_CRASH_EFFECT);//duration inf
+ DespawnTimer = 120000; // summon spell duration
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit *who) { }
+ void MoveInLineOfSight(Unit *who){ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(DespawnTimer < diff)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ }else DespawnTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL blade_of_azzinothAI : public ScriptedAI
+{
+ blade_of_azzinothAI(Creature* c) : ScriptedAI(c) {}
+ void Reset() {}
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) { }
+ void MoveInLineOfSight(Unit* who) { }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE)
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21431);//appear when hit by Illidan's glaive
+ }
+};
+
+void boss_illidan_stormrageAI::Reset()
+{
+ if(pInstance)
+ pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
+
+ for(uint8 i = 0; i < 2; i++)
+ {
+ if(FlameGUID[i])
+ {
+ if(GETUNIT(Flame, FlameGUID[i]))
+ Flame->setDeathState(JUST_DIED);
+ FlameGUID[i] = 0;
+ }
+
+ if(GlaiveGUID[i])
+ {
+ if(GETUNIT(Glaive, GlaiveGUID[i]))
+ Glaive->setDeathState(JUST_DIED);
+ GlaiveGUID[i] = 0;
+ }
+ }
+
+ if(AkamaGUID)
+ {
+ if(GETCRE(Akama, AkamaGUID))
+ {
+ if(!Akama->isAlive())
+ Akama->Respawn();
+ else
+ {
+ ((npc_akama_illidanAI*)Akama->AI())->EnterEvadeMode();
+ Akama->GetMotionMaster()->MoveTargetedHome();
+ ((npc_akama_illidanAI*)Akama->AI())->Reset();
+ }
+ }
+ AkamaGUID = 0;
+ }
+
+ if(MaievGUID)
+ {
+ GETUNIT(Maiev, MaievGUID);
+ if(Maiev && Maiev->isAlive())
+ {
+ Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
+ Maiev->setDeathState(JUST_DIED);
+ }
+ MaievGUID = 0;
+ }
+
+ Phase = PHASE_NULL;
+ Event = EVENT_NULL;
+ Timer[EVENT_BERSERK] = 1500000;
+
+ HoverPoint = 0;
+ TalkCount = 0;
+ FlightCount = 0;
+ TransformCount = 0;
+
+ ParasiteTargets.clear();
+
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21135);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+
+ DoCast(m_creature, SPELL_DUAL_WIELD, true);
+}
+
+void boss_illidan_stormrageAI::HandleTalkSequence()
+{
+ switch(TalkCount)
+ {
+ case 0:
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ break;
+ case 8:
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Equip our warglaives!
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
+ m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ break;
+ case 9:
+ if(GETCRE(Akama, AkamaGUID))
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->AddThreat(Akama, 100.0f);
+ ((npc_akama_illidanAI*)Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN);
+ EnterPhase(PHASE_NORMAL);
+ }
+ break;
+ case 10:
+ SummonMaiev();
+ break;
+ case 11:
+ if(GETUNIT(Maiev, MaievGUID))
+ {
+ Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible
+ Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported!
+ Maiev->SetInFront(m_creature); // Have her face us
+ m_creature->SetInFront(Maiev); // Face her, so it's not rude =P
+ Maiev->StopMoving();
+ m_creature->StopMoving();
+ }break;
+ case 14:
+ if(GETCRE(Maiev, MaievGUID))
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ Maiev->AddThreat(m_creature, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE
+ Maiev->AI()->AttackStart(m_creature); // Force Maiev to attack us.
+ EnterPhase(PHASE_NORMAL_MAIEV);
+ }break;
+ case 15:
+ DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him
+ break;
+ case 17:
+ if(GETUNIT(Akama, AkamaGUID))
+ {
+ if(!m_creature->IsWithinDistInMap(Akama, 15))
+ {
+ float x, y, z;
+ m_creature->GetPosition(x, y, z);
+ x += 10; y += 10;
+ Akama->GetMotionMaster()->Clear(false);
+ //Akama->GetMotionMaster()->MoveIdle();
+ Akama->Relocate(x, y, z);
+ Akama->SendMonsterMove(x, y, z, 0, 0, 0);//Illidan must not die until Akama arrives.
+ Akama->GetMotionMaster()->MoveChase(m_creature);
+ }
+ }
+ break;
+ case 19: // Make Maiev leave
+ if(GETUNIT(Maiev, MaievGUID))
+ {
+ Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
+ Maiev->setDeathState(JUST_DIED);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+ }
+ break;
+ case 21: // Kill ourself.
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ break;
+ default:
+ break;
+ }
+ if(Phase == PHASE_TALK_SEQUENCE)
+ Talk(TalkCount); // This function does most of the talking
+ TalkCount++;
+}
+
+
+void boss_illidan_stormrageAI::CastEyeBlast()
+{
+ m_creature->InterruptNonMeleeSpells(false);
+
+ DoYell(SAY_EYE_BLAST, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, 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;
+
+ for(uint8 i = 0; i < 2; ++i)//core bug, two buff do not coexist
+ {
+ Creature* Trigger = NULL;
+ Trigger = m_creature->SummonCreature(DEMON_FIRE, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000);
+ if(Trigger)
+ {
+ ((demonfireAI*)Trigger->AI())->IsTrigger = true;
+ Trigger->SetSpeed(MOVE_WALK, 3);
+ Trigger->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
+ Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
+
+ if(!i)
+ Trigger->CastSpell(Trigger, SPELL_EYE_BLAST_TRIGGER, true);
+ else
+ {
+ Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID());
+ DoCast(Trigger, SPELL_EYE_BLAST);
+ }
+ }
+ }
+}
+
+void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth()
+{
+ DoYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SUMMONFLAMES);
+
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ if(GETUNIT(Glaive, GlaiveGUID[i]))
+ {
+ Creature* Flame = m_creature->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(m_creature->getFaction()); // Just in case the database has it as a different faction
+ Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE);
+ Flame->AI()->AttackStart(m_creature->getVictim()); // Attack our target!
+ FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase
+ ((flame_of_azzinothAI*)Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]);
+ DoZoneInCombat(Flame);
+ Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it.
+ }
+ }
+ }
+}
+
+void boss_illidan_stormrageAI::SummonMaiev()
+{
+ DoCast(m_creature, SPELL_SHADOW_PRISON, true);
+ Creature* Maiev = m_creature->SummonCreature(MAIEV_SHADOWSONG, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(Maiev)
+ {
+ Maiev->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk
+ Maiev->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ MaievGUID = Maiev->GetGUID();
+ ((boss_maievAI*)Maiev->AI())->GetIllidanGUID(m_creature->GetGUID());
+ ((boss_maievAI*)Maiev->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
+ }
+ else // If Maiev cannot be summoned, reset the encounter and post some errors to the console.
+ {
+ EnterEvadeMode();
+ DoTextEmote("is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter.", NULL);
+ error_log("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 boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase)
+{
+ DoZoneInCombat();
+ switch(NextPhase)
+ {
+ case PHASE_NORMAL:
+ case PHASE_NORMAL_2:
+ case PHASE_NORMAL_MAIEV:
+ AttackStart(m_creature->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(m_creature->getVictim());
+ break;
+ case PHASE_TALK_SEQUENCE:
+ Timer[EVENT_TALK_SEQUENCE] = 100;
+ m_creature->RemoveAllAuras();
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->GetMotionMaster()->Clear(false);
+ //m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->AttackStop();
+ break;
+ case PHASE_FLIGHT_SEQUENCE:
+ if(Phase == PHASE_FLIGHT) //land
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
+ else //lift off
+ {
+ FlightCount = 1;
+ Timer[EVENT_FLIGHT_SEQUENCE] = 1;
+ m_creature->RemoveAllAuras();
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->GetMotionMaster()->Clear(false);
+ //m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->AttackStop();
+ }
+ break;
+ case PHASE_TRANSFORM_SEQUENCE:
+ if(Phase == PHASE_DEMON)
+ Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
+ else
+ {
+ TransformCount = 0;
+ Timer[EVENT_TRANSFORM_SEQUENCE] = 500;
+ DoYell(SAY_MORPH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_MORPH);
+ }
+ m_creature->GetMotionMaster()->Clear();
+ //m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->AttackStop();
+ break;
+ default:
+ break;
+ }
+ if(MaievGUID)
+ {
+ GETCRE(Maiev, MaievGUID);
+ if(Maiev && Maiev->isAlive())
+ ((boss_maievAI*)Maiev->AI())->EnterPhase(NextPhase);
+ }
+ Phase = NextPhase;
+ Event = EVENT_NULL;
+}
+
+CreatureAI* GetAI_boss_illidan_stormrage(Creature *_Creature)
+{
+ return new boss_illidan_stormrageAI (_Creature);
+}
+
+CreatureAI* GetAI_npc_akama_at_illidan(Creature *_Creature)
+{
+ return new npc_akama_illidanAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_maiev(Creature *_Creature)
+{
+ return new boss_maievAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_flame_of_azzinoth(Creature *_Creature)
+{
+ return new flame_of_azzinothAI (_Creature);
+}
+
+CreatureAI* GetAI_cage_trap_trigger(Creature *_Creature)
+{
+ return new cage_trap_triggerAI (_Creature);
+}
+
+CreatureAI* GetAI_shadow_demon(Creature *_Creature)
+{
+ return new shadow_demonAI (_Creature);
+}
+
+CreatureAI* GetAI_flamecrash(Creature *_Creature)
+{
+ return new flamecrashAI (_Creature);
+}
+
+CreatureAI* GetAI_demonfire(Creature *_Creature)
+{
+ return new demonfireAI (_Creature);
+}
+
+CreatureAI* GetAI_blaze(Creature *_Creature)
+{
+ return new blazeAI (_Creature);
+}
+
+CreatureAI* GetAI_blade_of_azzinoth(Creature *_Creature)
+{
+ return new blade_of_azzinothAI (_Creature);
+}
+
+CreatureAI* GetAI_parasitic_shadowfiend(Creature *_Creature)
+{
+ return new mob_parasitic_shadowfiendAI (_Creature);
+}
+
+void AddSC_boss_illidan()
+{
+ Script* newscript;
+
+ newscript = new Script;
+ newscript->Name = "boss_illidan_stormrage";
+ newscript->GetAI = GetAI_boss_illidan_stormrage;
+ m_scripts[nrscripts++] = newscript;
+
+ 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;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "boss_maiev_shadowsong";
+ newscript->GetAI = GetAI_boss_maiev;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_flame_of_azzinoth";
+ newscript->GetAI = GetAI_mob_flame_of_azzinoth;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_blade_of_azzinoth";
+ newscript->GetAI = GetAI_blade_of_azzinoth;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "gameobject_cage_trap";
+ newscript->pGOHello = GOHello_cage_trap;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_cage_trap_trigger";
+ newscript->GetAI = GetAI_cage_trap_trigger;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_shadow_demon";
+ newscript->GetAI = GetAI_shadow_demon;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_flame_crash";
+ newscript->GetAI = GetAI_flamecrash;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_demon_fire";
+ newscript->GetAI = GetAI_demonfire;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_blaze";
+ newscript->GetAI = GetAI_blaze;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_parasitic_shadowfiend";
+ newscript->GetAI = GetAI_parasitic_shadowfiend;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
index 3c7345fa477..0f5d2af3c22 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
@@ -1,361 +1,361 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Mother_Shahraz
-SD%Complete: 80
-SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-//Spells
-#define SPELL_BEAM_SINISTER 40859
-#define SPELL_BEAM_VILE 40860
-#define SPELL_BEAM_WICKED 40861
-#define SPELL_BEAM_SINFUL 40827
-#define SPELL_ATTRACTION 40871
-#define SPELL_SILENCING_SHRIEK 40823
-#define SPELL_ENRAGE 23537
-#define SPELL_SABER_LASH 40810//43267
-#define SPELL_SABER_LASH_IMM 43690
-#define SPELL_TELEPORT_VISUAL 40869
-#define SPELL_BERSERK 45078
-
-uint32 PrismaticAuras[]=
-{
- 40880, // Shadow
- 40882, // Fire
- 40883, // Nature
- 40891, // Arcane
- 40896, // Frost
- 40897, // Holy
-};
-
-//Speech'n'Sounds
-#define SAY_TAUNT1 "You play, you pay."
-#define SOUND_TAUNT1 11501
-
-#define SAY_TAUNT2 "I'm not impressed."
-#define SOUND_TAUNT2 11502
-
-#define SAY_TAUNT3 "Enjoying yourselves?"
-#define SOUND_TAUNT3 11503
-
-#define SAY_AGGRO "So, business... Or pleasure?"
-#define SOUND_AGGRO 11504
-
-#define SAY_SPELL1 "You seem a little tense."
-#define SOUND_SPELL1 11505
-
-#define SAY_SPELL2 "Don't be shy."
-#define SOUND_SPELL2 11506
-
-#define SAY_SPELL3 "I'm all... yours."
-#define SOUND_SPELL3 11507
-
-#define SAY_SLAY1 "Easy come, easy go."
-#define SOUND_SLAY1 11508
-
-#define SAY_SLAY2 "So much for a happy ending."
-#define SOUND_SLAY2 11509
-
-#define SAY_ENRAGE "Stop toying with my emotions!"
-#define SOUND_ENRAGE 11510
-
-#define SAY_DEATH "I wasn't... finished."
-#define SOUND_DEATH 11511
-
-struct Locations
-{
- float x,y,z;
-};
-
-static Locations TeleportPoint[]=
-{
- {959.996, 212.576, 193.843},
- {932.537, 231.813, 193.838},
- {958.675, 254.767, 193.822},
- {946.955, 201.316, 192.535},
- {944.294, 149.676, 197.551},
- {930.548, 284.888, 193.367},
- {965.997, 278.398, 195.777}
-};
-
-struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI
-{
- boss_shahrazAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- 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;
-
- bool Enraged;
-
- 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;
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS);
-
- DoZoneInCombat();
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE);
-
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- 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++)
- {
- 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());
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged)
- {
- Enraged = true;
- DoCast(m_creature, SPELL_ENRAGE, true);
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }
-
- //Randomly cast one beam.
- if(BeamTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(!target || !target->isAlive())
- return;
-
- BeamTimer = 9000;
-
- switch(CurrentBeam)
- {
- case 0:
- DoCast(target, SPELL_BEAM_SINISTER);
- break;
- case 1:
- DoCast(target, SPELL_BEAM_VILE);
- break;
- case 2:
- DoCast(target, SPELL_BEAM_WICKED);
- break;
- case 3:
- DoCast(target, SPELL_BEAM_SINFUL);
- break;
- }
- BeamCount++;
- uint32 Beam = CurrentBeam;
- if(BeamCount > 3)
- while(CurrentBeam == Beam)
- CurrentBeam = rand()%3;
-
- }else BeamTimer -= diff;
-
- // Random Prismatic Shield every 15 seconds.
- if(PrismaticShieldTimer < diff)
- {
- uint32 random = rand()%6;
- if(PrismaticAuras[random])
- DoCast(m_creature, 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;
-
- TeleportPlayers();
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPELL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPELL2);
- break;
- case 1:
- DoYell(SAY_SPELL3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPELL3);
- break;
- }
- 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)
- {
- for(uint8 i = 0; i < 4; i++)
- {
- Unit* pUnit = NULL;
- if(TargetGUID[i])
- {
- pUnit = Unit::GetUnit((*m_creature), 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;
-
- if(ShriekTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SILENCING_SHRIEK);
- ShriekTimer = 25000+rand()%10 * 1000;
- }else ShriekTimer -= diff;
-
- if(SaberTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SABER_LASH);
- SaberTimer = 25000+rand()%10 * 1000;
- }else SaberTimer -= diff;
-
- //Enrage
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
- if(EnrageTimer < diff)
- {
- DoCast(m_creature, SPELL_BERSERK);
- DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }else EnrageTimer -= diff;
-
- //Random taunts
- if(RandomYellTimer < diff)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(SAY_TAUNT1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAUNT1);
- break;
- case 1:
- DoYell(SAY_TAUNT2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAUNT2);
- break;
- case 2:
- DoYell(SAY_TAUNT3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_TAUNT3);
- break;
- }
- RandomYellTimer = 60000 + rand()%91 * 1000;
- }else RandomYellTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_shahraz(Creature *_Creature)
-{
- return new boss_shahrazAI (_Creature);
-}
-
-void AddSC_boss_mother_shahraz()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_mother_shahraz";
- newscript->GetAI = GetAI_boss_shahraz;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Mother_Shahraz
+SD%Complete: 80
+SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+//Spells
+#define SPELL_BEAM_SINISTER 40859
+#define SPELL_BEAM_VILE 40860
+#define SPELL_BEAM_WICKED 40861
+#define SPELL_BEAM_SINFUL 40827
+#define SPELL_ATTRACTION 40871
+#define SPELL_SILENCING_SHRIEK 40823
+#define SPELL_ENRAGE 23537
+#define SPELL_SABER_LASH 40810//43267
+#define SPELL_SABER_LASH_IMM 43690
+#define SPELL_TELEPORT_VISUAL 40869
+#define SPELL_BERSERK 45078
+
+uint32 PrismaticAuras[]=
+{
+ 40880, // Shadow
+ 40882, // Fire
+ 40883, // Nature
+ 40891, // Arcane
+ 40896, // Frost
+ 40897, // Holy
+};
+
+//Speech'n'Sounds
+#define SAY_TAUNT1 "You play, you pay."
+#define SOUND_TAUNT1 11501
+
+#define SAY_TAUNT2 "I'm not impressed."
+#define SOUND_TAUNT2 11502
+
+#define SAY_TAUNT3 "Enjoying yourselves?"
+#define SOUND_TAUNT3 11503
+
+#define SAY_AGGRO "So, business... Or pleasure?"
+#define SOUND_AGGRO 11504
+
+#define SAY_SPELL1 "You seem a little tense."
+#define SOUND_SPELL1 11505
+
+#define SAY_SPELL2 "Don't be shy."
+#define SOUND_SPELL2 11506
+
+#define SAY_SPELL3 "I'm all... yours."
+#define SOUND_SPELL3 11507
+
+#define SAY_SLAY1 "Easy come, easy go."
+#define SOUND_SLAY1 11508
+
+#define SAY_SLAY2 "So much for a happy ending."
+#define SOUND_SLAY2 11509
+
+#define SAY_ENRAGE "Stop toying with my emotions!"
+#define SOUND_ENRAGE 11510
+
+#define SAY_DEATH "I wasn't... finished."
+#define SOUND_DEATH 11511
+
+struct Locations
+{
+ float x,y,z;
+};
+
+static Locations TeleportPoint[]=
+{
+ {959.996, 212.576, 193.843},
+ {932.537, 231.813, 193.838},
+ {958.675, 254.767, 193.822},
+ {946.955, 201.316, 192.535},
+ {944.294, 149.676, 197.551},
+ {930.548, 284.888, 193.367},
+ {965.997, 278.398, 195.777}
+};
+
+struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI
+{
+ boss_shahrazAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ 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;
+
+ bool Enraged;
+
+ 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;
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS);
+
+ DoZoneInCombat();
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE);
+
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ 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++)
+ {
+ 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());
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged)
+ {
+ Enraged = true;
+ DoCast(m_creature, SPELL_ENRAGE, true);
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }
+
+ //Randomly cast one beam.
+ if(BeamTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(!target || !target->isAlive())
+ return;
+
+ BeamTimer = 9000;
+
+ switch(CurrentBeam)
+ {
+ case 0:
+ DoCast(target, SPELL_BEAM_SINISTER);
+ break;
+ case 1:
+ DoCast(target, SPELL_BEAM_VILE);
+ break;
+ case 2:
+ DoCast(target, SPELL_BEAM_WICKED);
+ break;
+ case 3:
+ DoCast(target, SPELL_BEAM_SINFUL);
+ break;
+ }
+ BeamCount++;
+ uint32 Beam = CurrentBeam;
+ if(BeamCount > 3)
+ while(CurrentBeam == Beam)
+ CurrentBeam = rand()%3;
+
+ }else BeamTimer -= diff;
+
+ // Random Prismatic Shield every 15 seconds.
+ if(PrismaticShieldTimer < diff)
+ {
+ uint32 random = rand()%6;
+ if(PrismaticAuras[random])
+ DoCast(m_creature, 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;
+
+ TeleportPlayers();
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPELL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPELL2);
+ break;
+ case 1:
+ DoYell(SAY_SPELL3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPELL3);
+ break;
+ }
+ 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)
+ {
+ for(uint8 i = 0; i < 4; i++)
+ {
+ Unit* pUnit = NULL;
+ if(TargetGUID[i])
+ {
+ pUnit = Unit::GetUnit((*m_creature), 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;
+
+ if(ShriekTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SILENCING_SHRIEK);
+ ShriekTimer = 25000+rand()%10 * 1000;
+ }else ShriekTimer -= diff;
+
+ if(SaberTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SABER_LASH);
+ SaberTimer = 25000+rand()%10 * 1000;
+ }else SaberTimer -= diff;
+
+ //Enrage
+ if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(EnrageTimer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }else EnrageTimer -= diff;
+
+ //Random taunts
+ if(RandomYellTimer < diff)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(SAY_TAUNT1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAUNT1);
+ break;
+ case 1:
+ DoYell(SAY_TAUNT2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAUNT2);
+ break;
+ case 2:
+ DoYell(SAY_TAUNT3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_TAUNT3);
+ break;
+ }
+ RandomYellTimer = 60000 + rand()%91 * 1000;
+ }else RandomYellTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_shahraz(Creature *_Creature)
+{
+ return new boss_shahrazAI (_Creature);
+}
+
+void AddSC_boss_mother_shahraz()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_mother_shahraz";
+ newscript->GetAI = GetAI_boss_shahraz;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp
index dc7539442f4..50a0a4de3ac 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp
@@ -1,802 +1,802 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* ScriptData
-SDName: Boss_Reliquary_of_Souls
-SD%Complete: 90
-SDComment:
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-#include "Spell.h"
-
-//Sound'n'speech
-//Suffering
-#define SUFF_SAY_FREED "Pain and suffering are all that await you!"
-#define SUFF_SOUND_FREED 11415
-#define SUFF_SAY_AGGRO "Don't leave me alone!"
-#define SUFF_SOUND_AGGRO 11416
-#define SUFF_SAY_SLAY1 "Look at what you make me do!"
-#define SUFF_SOUND_SLAY1 11417
-#define SUFF_SAY_SLAY2 "I didn't ask for this!"
-#define SUFF_SOUND_SLAY2 11418
-#define SUFF_SAY_ENRAGE "The pain is only beginning!"
-#define SUFF_SOUND_ENRAGE 11419
-#define SUFF_SAY_RECAP "I don't want to go back!"
-#define SUFF_SOUND_RECAP 11420
-#define SUFF_SAY_AFTER "Now what do I do?"
-#define SUFF_SOUND_AFTER 11421
-
-//Desire
-#define DESI_SAY_FREED "You can have anything you desire... for a price."
-#define DESI_SOUND_FREED 11408
-#define DESI_SAY_SLAY1 "Fulfilment is at hand!"
-#define DESI_SOUND_SLAY1 11409
-#define DESI_SAY_SLAY2 "Yes... you'll stay with us now..."
-#define DESI_SOUND_SLAY2 11410
-#define DESI_SAY_SLAY3 "Your reach exceeds your grasp."
-#define DESI_SOUND_SLAY3 11412
-#define DESI_SAY_SPEC "Be careful what you wish for..."
-#define DESI_SOUND_SPEC 11411
-#define DESI_SAY_RECAP "I'll be waiting..."
-#define DESI_SOUND_RECAP 11413
-#define DESI_SAY_AFTER "I won't be far..."
-#define DESI_SOUND_AFTER 11414
-
-//Anger
-#define ANGER_SAY_FREED "Beware... I live."
-#define ANGER_SOUND_FREED 11399
-#define ANGER_SAY_SCREAM "So... foolish."
-#define ANGER_SOUND_SCREAM 11400
-#define ANGER_SOUND_SLAY1 11401
-#define ANGER_SAY_SLAY2 "Enough. No more."
-#define ANGER_SOUND_SLAY2 11402
-#define ANGER_SAY_SPEC "On your knees!"
-#define ANGER_SOUND_SPEC 11403
-#define ANGER_SAY_BEFORE "Beware, coward."
-#define ANGER_SOUND_BEFORE 11405
-#define ANGER_SAY_DEATH "I won't... be... ignored."
-#define ANGER_SOUND_DEATH 11404
-
-//Spells
-#define AURA_OF_SUFFERING 41292
-#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support
-#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294
-#define ESSENCE_OF_SUFFERING_PASSIVE2 41623
-#define SPELL_FIXATE_TARGET 41294 // dummy, select target
-#define SPELL_FIXATE_TAUNT 41295 // force taunt
-#define SPELL_ENRAGE 41305
-#define SPELL_SOUL_DRAIN 41303
-
-#define AURA_OF_DESIRE 41350
-#define AURA_OF_DESIRE_DAMAGE 41352
-#define SPELL_RUNE_SHIELD 41431
-#define SPELL_DEADEN 41410
-#define SPELL_SOUL_SHOCK 41426
-
-#define AURA_OF_ANGER 41337
-#define SPELL_SELF_SEETHE 41364 // force cast 41520
-#define SPELL_ENEMY_SEETHE 41520
-#define SPELL_SOUL_SCREAM 41545
-#define SPELL_SPITE_TARGET 41376 // cast 41377 after 6 sec
-#define SPELL_SPITE_DAMAGE 41377
-
-#define ENSLAVED_SOUL_PASSIVE 41535
-#define SPELL_SOUL_RELEASE 41542
-
-#define CREATURE_ENSLAVED_SOUL 23469
-#define NUMBER_ENSLAVED_SOUL 8
-
-struct Position
-{
- float x,y;
-};
-
-static Position Coords[]=
-{
- {450.4, 212.3},
- {542.1, 212.3},
- {542.1, 168.3},
- {542.1, 137.4},
- {450.4, 137.4},
- {450.4, 168.3}
-};
-
-struct TRINITY_DLL_DECL npc_enslaved_soulAI : public ScriptedAI
-{
- npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 ReliquaryGUID;
-
- void Reset() {ReliquaryGUID = 0;}
-
- void Aggro(Unit* who)
- {
- m_creature->CastSpell(m_creature, ENSLAVED_SOUL_PASSIVE, true);
- DoZoneInCombat();
- }
-
- void JustDied(Unit *killer);
-};
-
-struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
-{
- boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- EssenceGUID = 0;
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 EssenceGUID;
-
- uint32 Phase;
- uint32 Counter;
- uint32 Timer;
-
- uint32 SoulCount;
- uint32 SoulDeathCount;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED);
-
- if(EssenceGUID)
- {
- if(Unit* Essence = Unit::GetUnit(*m_creature, EssenceGUID))
- {
- Essence->SetVisibility(VISIBILITY_OFF);
- Essence->setDeathState(DEAD);
- }
- EssenceGUID = 0;
- }
-
- Phase = 0;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
- }
-
- void Aggro(Unit* who)
- {
- m_creature->AddThreat(who, 10000.0f);
- DoZoneInCombat();
- if(pInstance)
- pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS);
-
- Phase = 1;
- Counter = 0;
- Timer = 0;
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- Aggro(who);
- InCombat = true;
- }
- }
- }
- }
-
- void AttackStart(Unit*) {}
-
- bool SummonSoul()
- {
- uint32 random = rand()%6;
- float x = Coords[random].x;
- float y = Coords[random].y;
- Creature* Soul = m_creature->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(!Soul) return false;
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- ((npc_enslaved_soulAI*)Soul->AI())->ReliquaryGUID = m_creature->GetGUID();
- Soul->AI()->AttackStart(target);
- }else EnterEvadeMode();
- return true;
- }
-
- void JustDied(Unit* killer)
- {
- if(pInstance)
- pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE);
-
- InCombat = false;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!Phase)
- return;
-
- if(m_creature->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist
- {
- EnterEvadeMode();
- return;
- }
-
- Creature* Essence;
- if(EssenceGUID)
- {
- Essence = (Creature*)Unit::GetUnit(*m_creature, EssenceGUID);
- if(!Essence)
- {
- EnterEvadeMode();
- return;
- }
- }
-
- if(Timer < diff)
- {
- switch(Counter)
- {
- case 0:
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,375); // I R ANNNGRRRY!
- Timer = 3000;
- break;
- case 1:
- Timer = 2800;
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); // Release the cube
- break;
- case 2:
- Timer = 5000;
- if(Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0))
- {
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,373); // Ribs: open
- Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
- EssenceGUID = Summon->GetGUID();
- }else EnterEvadeMode();
- break;
- case 3:
- Timer = 1000;
- if(Phase == 3)
- {
- if(!Essence->isAlive())
- m_creature->CastSpell(m_creature, 7, true);
- else return;
- }
- else
- {
- if(Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
- {
- Essence->AI()->EnterEvadeMode();
- Essence->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
- }else return;
- }
- break;
- case 4:
- Timer = 1500;
- if(Essence->IsWithinDistInMap(m_creature, 10))
- Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE, 374); //rotate and disappear
- else
- return;
- break;
- case 5:
- if(Phase == 1)
- {
- Essence->Yell(SUFF_SAY_AFTER,LANG_UNIVERSAL,0);
- DoPlaySoundToSet(Essence, SUFF_SOUND_AFTER);
- }
- else
- {
- Essence->Yell(DESI_SAY_AFTER,LANG_UNIVERSAL,0);
- DoPlaySoundToSet(Essence, DESI_SOUND_AFTER);
- }
- Essence->SetVisibility(VISIBILITY_OFF);
- Essence->setDeathState(DEAD);
- m_creature->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;
- }
- Counter++;
- }else Timer -= diff;
- }
-};
-
-//This is used to sort the players by distance in preparation for the Fixate cast.
-struct TargetDistanceOrder : public std::binary_function
-{
- const Unit* MainTarget;
- TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
- // functor for operator "<"
- bool operator()(const Unit* _Left, const Unit* _Right) const
- {
- return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
- }
-};
-
-struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI
-{
- boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 StatAuraGUID;
-
- uint32 AggroYellTimer;
- uint32 FixateTimer;
- uint32 EnrageTimer;
- uint32 SoulDrainTimer;
- uint32 AuraTimer;
-
- void Reset()
- {
- StatAuraGUID = 0;
-
- AggroYellTimer = 5000;
- FixateTimer = 8000;
- EnrageTimer = 30000;
- SoulDrainTimer = 45000;
- AuraTimer = 5000;
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(damage >= m_creature->GetHealth())
- {
- damage = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_RECAP);
- }
- }
-
- void Aggro(Unit *who)
- {
- m_creature->Yell(SUFF_SAY_FREED, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_FREED);
- DoZoneInCombat();
- m_creature->CastSpell(m_creature, AURA_OF_SUFFERING, true); // linked aura need core support
- m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, true);
- m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE2, true);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SUFF_SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_SLAY1);
- break;
- case 1:
- DoYell(SUFF_SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_SLAY2);
- break;
- }
- }
-
- void CastFixate()
- {
- std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
- if(m_threatlist.empty())
- return; // No point continuing if empty threatlist.
- std::list targets;
- std::list::iterator itr = m_threatlist.begin();
- for( ; itr != m_threatlist.end(); ++itr)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*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(TargetDistanceOrder(m_creature)); // Sort players by distance.
- targets.resize(1); // Only need closest target.
- Unit* target = targets.front(); // Get the first target.
- target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- //Supposed to be cast on nearest target
- if(FixateTimer < diff)
- {
- CastFixate();
- FixateTimer = 5000;
- if(!(rand()%16))
- {
- DoYell(SUFF_SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_AGGRO);
- }
- }else FixateTimer -= diff;
-
- if(EnrageTimer < diff)
- {
- DoCast(m_creature, SPELL_ENRAGE);
- EnrageTimer = 60000;
- DoYell(SUFF_SAY_ENRAGE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SUFF_SOUND_ENRAGE);
- }else EnrageTimer -= diff;
-
- if(SoulDrainTimer < diff)
- {
- DoCast(m_creature, SPELL_SOUL_DRAIN);
- SoulDrainTimer = 60000;
- }else SoulDrainTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI
-{
- boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 RuneShieldTimer;
- uint32 DeadenTimer;
- uint32 SoulShockTimer;
-
- void Reset()
- {
- RuneShieldTimer = 60000;
- DeadenTimer = 30000;
- SoulShockTimer = 5000;
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if(done_by == m_creature)
- return;
-
- if(damage >= m_creature->GetHealth())
- {
- damage = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->Yell(DESI_SAY_RECAP,LANG_UNIVERSAL,0);
- DoPlaySoundToSet(m_creature, DESI_SOUND_RECAP);
- }
- else
- {
- int32 bp0 = damage / 2;
- m_creature->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true);
- }
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL])
- for(uint8 i = 0; i < 3; ++i)
- if(spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST)
- if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK
- || m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_DEADEN)
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false);
- }
-
- void Aggro(Unit *who)
- {
- m_creature->Yell(DESI_SAY_FREED, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, DESI_SOUND_FREED);
- DoZoneInCombat();
- DoCast(m_creature, AURA_OF_DESIRE, true);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%3)
- {
- case 0:
- DoYell(DESI_SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY1);
- break;
- case 1:
- DoYell(DESI_SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY2);
- break;
- case 2:
- DoYell(DESI_SAY_SLAY3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY3);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(RuneShieldTimer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->CastSpell(m_creature, SPELL_RUNE_SHIELD, true);
- SoulShockTimer += 2000;
- DeadenTimer += 2000;
- RuneShieldTimer = 60000;
- }else RuneShieldTimer -= diff;
-
- if(SoulShockTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SOUL_SHOCK);
- SoulShockTimer = 5000;
- }else SoulShockTimer -= diff;
-
- if(DeadenTimer < diff)
- {
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature->getVictim(), SPELL_DEADEN);
- DeadenTimer = 25000 + rand()%10000;
- if(!(rand()%2))
- {
- DoYell(DESI_SAY_SPEC,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, DESI_SOUND_SPEC);
- }
- }else DeadenTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI
-{
- boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint64 AggroTargetGUID;
-
- uint32 CheckTankTimer;
- uint32 SoulScreamTimer;
- uint32 SpiteTimer;
-
- std::list SpiteTargetGUID;
-
- bool CheckedAggro;
-
- void Reset()
- {
- AggroTargetGUID = 0;
-
- CheckTankTimer = 5000;
- SoulScreamTimer = 10000;
- SpiteTimer = 30000;
-
- SpiteTargetGUID.clear();
-
- CheckedAggro = false;
- }
-
- void Aggro(Unit *who)
- {
- m_creature->Yell(ANGER_SAY_FREED, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(m_creature, ANGER_SOUND_FREED);
- DoZoneInCombat();
- DoCast(m_creature, AURA_OF_ANGER, true);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(ANGER_SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,ANGER_SOUND_DEATH);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature, ANGER_SOUND_SLAY1);
- break;
- case 1:
- DoYell(ANGER_SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, ANGER_SOUND_SLAY2);
- break;
- }
- }
-
- void SelectSpiteTarget(uint32 num, float max_range = 999)
- {
- if(!num) return;
-
- CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- std::list tempUnitMap;
-
- {
- Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, max_range);
- Trinity::UnitListSearcher searcher(tempUnitMap, u_check);
-
- TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher);
- TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher);
-
- CellLock cell_lock(cell, p);
- cell_lock->Visit(cell_lock, world_unit_searcher, *(m_creature->GetMap()));
- cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap()));
- }
-
- std::list::iterator itr;
- while(tempUnitMap.size() && SpiteTargetGUID.size() < num)
- {
- itr = tempUnitMap.begin();
- advance(itr, rand()%tempUnitMap.size());
- SpiteTargetGUID.push_back((*itr)->GetGUID());
- tempUnitMap.erase(itr);
- }
-
- for(itr = tempUnitMap.begin(); itr != tempUnitMap.end(); ++itr)
- (*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->CastSpell(m_creature, SPELL_SPITE_TARGET, true); // must true
- for(itr = tempUnitMap.begin(); itr != tempUnitMap.end(); ++itr)
- (*itr)->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
- return;
-
- if(!CheckedAggro)
- {
- AggroTargetGUID = m_creature->getVictim()->GetGUID();
- CheckedAggro = true;
- }
-
- if(CheckTankTimer < diff)
- {
- if(m_creature->getVictim()->GetGUID() != AggroTargetGUID)
- {
- DoYell(ANGER_SAY_BEFORE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, ANGER_SOUND_BEFORE);
- DoCast(m_creature, SPELL_SELF_SEETHE, true);
- AggroTargetGUID = m_creature->getVictim()->GetGUID();
- }
- CheckTankTimer = 2000;
- }else CheckTankTimer -= diff;
-
- if(SoulScreamTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_SOUL_SCREAM);
- SoulScreamTimer = 10000;
- if(!(rand()%3))
- {
- DoYell(ANGER_SAY_SCREAM,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, ANGER_SOUND_SCREAM);
- }
- }else SoulScreamTimer -= diff;
-
- if(SpiteTimer < diff)
- {
- if(!SpiteTargetGUID.empty())
- {
- for (std::list::iterator itr = SpiteTargetGUID.begin(); itr != SpiteTargetGUID.end(); ++itr)
- {
- if(Unit* target = Unit::GetUnit(*m_creature, *itr))
- {
- target->RemoveAurasDueToSpell(SPELL_SPITE_TARGET);
- m_creature->CastSpell(target, SPELL_SPITE_DAMAGE, true);
- }
- }
- SpiteTargetGUID.clear();
- SpiteTimer = 24000;
- }
- else
- {
- SelectSpiteTarget(3);
- SpiteTimer = 6000;
- DoYell(ANGER_SAY_SPEC,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, ANGER_SOUND_SPEC);
- }
- }else SpiteTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-void npc_enslaved_soulAI::JustDied(Unit *killer)
-{
- if(ReliquaryGUID)
- {
- Creature* Reliquary = ((Creature*)Unit::GetUnit((*m_creature), ReliquaryGUID));
- if(Reliquary)
- ((boss_reliquary_of_soulsAI*)Reliquary->AI())->SoulDeathCount++;
- }
- DoCast(m_creature, SPELL_SOUL_RELEASE, true);
-}
-
-CreatureAI* GetAI_boss_reliquary_of_souls(Creature *_Creature)
-{
- return new boss_reliquary_of_soulsAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_essence_of_suffering(Creature *_Creature)
-{
- return new boss_essence_of_sufferingAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_essence_of_desire(Creature *_Creature)
-{
- return new boss_essence_of_desireAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_essence_of_anger(Creature *_Creature)
-{
- return new boss_essence_of_angerAI (_Creature);
-}
-
-CreatureAI* GetAI_npc_enslaved_soul(Creature *_Creature)
-{
- return new npc_enslaved_soulAI (_Creature);
-}
-
-void AddSC_boss_reliquary_of_souls()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_reliquary_of_souls";
- newscript->GetAI = GetAI_boss_reliquary_of_souls;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_essence_of_suffering";
- newscript->GetAI = GetAI_boss_essence_of_suffering;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_essence_of_desire";
- newscript->GetAI = GetAI_boss_essence_of_desire;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_essence_of_anger";
- newscript->GetAI = GetAI_boss_essence_of_anger;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_enslaved_soul";
- newscript->GetAI = GetAI_npc_enslaved_soul;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Boss_Reliquary_of_Souls
+SD%Complete: 90
+SDComment:
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+#include "Spell.h"
+
+//Sound'n'speech
+//Suffering
+#define SUFF_SAY_FREED "Pain and suffering are all that await you!"
+#define SUFF_SOUND_FREED 11415
+#define SUFF_SAY_AGGRO "Don't leave me alone!"
+#define SUFF_SOUND_AGGRO 11416
+#define SUFF_SAY_SLAY1 "Look at what you make me do!"
+#define SUFF_SOUND_SLAY1 11417
+#define SUFF_SAY_SLAY2 "I didn't ask for this!"
+#define SUFF_SOUND_SLAY2 11418
+#define SUFF_SAY_ENRAGE "The pain is only beginning!"
+#define SUFF_SOUND_ENRAGE 11419
+#define SUFF_SAY_RECAP "I don't want to go back!"
+#define SUFF_SOUND_RECAP 11420
+#define SUFF_SAY_AFTER "Now what do I do?"
+#define SUFF_SOUND_AFTER 11421
+
+//Desire
+#define DESI_SAY_FREED "You can have anything you desire... for a price."
+#define DESI_SOUND_FREED 11408
+#define DESI_SAY_SLAY1 "Fulfilment is at hand!"
+#define DESI_SOUND_SLAY1 11409
+#define DESI_SAY_SLAY2 "Yes... you'll stay with us now..."
+#define DESI_SOUND_SLAY2 11410
+#define DESI_SAY_SLAY3 "Your reach exceeds your grasp."
+#define DESI_SOUND_SLAY3 11412
+#define DESI_SAY_SPEC "Be careful what you wish for..."
+#define DESI_SOUND_SPEC 11411
+#define DESI_SAY_RECAP "I'll be waiting..."
+#define DESI_SOUND_RECAP 11413
+#define DESI_SAY_AFTER "I won't be far..."
+#define DESI_SOUND_AFTER 11414
+
+//Anger
+#define ANGER_SAY_FREED "Beware... I live."
+#define ANGER_SOUND_FREED 11399
+#define ANGER_SAY_SCREAM "So... foolish."
+#define ANGER_SOUND_SCREAM 11400
+#define ANGER_SOUND_SLAY1 11401
+#define ANGER_SAY_SLAY2 "Enough. No more."
+#define ANGER_SOUND_SLAY2 11402
+#define ANGER_SAY_SPEC "On your knees!"
+#define ANGER_SOUND_SPEC 11403
+#define ANGER_SAY_BEFORE "Beware, coward."
+#define ANGER_SOUND_BEFORE 11405
+#define ANGER_SAY_DEATH "I won't... be... ignored."
+#define ANGER_SOUND_DEATH 11404
+
+//Spells
+#define AURA_OF_SUFFERING 41292
+#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support
+#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294
+#define ESSENCE_OF_SUFFERING_PASSIVE2 41623
+#define SPELL_FIXATE_TARGET 41294 // dummy, select target
+#define SPELL_FIXATE_TAUNT 41295 // force taunt
+#define SPELL_ENRAGE 41305
+#define SPELL_SOUL_DRAIN 41303
+
+#define AURA_OF_DESIRE 41350
+#define AURA_OF_DESIRE_DAMAGE 41352
+#define SPELL_RUNE_SHIELD 41431
+#define SPELL_DEADEN 41410
+#define SPELL_SOUL_SHOCK 41426
+
+#define AURA_OF_ANGER 41337
+#define SPELL_SELF_SEETHE 41364 // force cast 41520
+#define SPELL_ENEMY_SEETHE 41520
+#define SPELL_SOUL_SCREAM 41545
+#define SPELL_SPITE_TARGET 41376 // cast 41377 after 6 sec
+#define SPELL_SPITE_DAMAGE 41377
+
+#define ENSLAVED_SOUL_PASSIVE 41535
+#define SPELL_SOUL_RELEASE 41542
+
+#define CREATURE_ENSLAVED_SOUL 23469
+#define NUMBER_ENSLAVED_SOUL 8
+
+struct Position
+{
+ float x,y;
+};
+
+static Position Coords[]=
+{
+ {450.4, 212.3},
+ {542.1, 212.3},
+ {542.1, 168.3},
+ {542.1, 137.4},
+ {450.4, 137.4},
+ {450.4, 168.3}
+};
+
+struct TRINITY_DLL_DECL npc_enslaved_soulAI : public ScriptedAI
+{
+ npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 ReliquaryGUID;
+
+ void Reset() {ReliquaryGUID = 0;}
+
+ void Aggro(Unit* who)
+ {
+ m_creature->CastSpell(m_creature, ENSLAVED_SOUL_PASSIVE, true);
+ DoZoneInCombat();
+ }
+
+ void JustDied(Unit *killer);
+};
+
+struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
+{
+ boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ EssenceGUID = 0;
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 EssenceGUID;
+
+ uint32 Phase;
+ uint32 Counter;
+ uint32 Timer;
+
+ uint32 SoulCount;
+ uint32 SoulDeathCount;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED);
+
+ if(EssenceGUID)
+ {
+ if(Unit* Essence = Unit::GetUnit(*m_creature, EssenceGUID))
+ {
+ Essence->SetVisibility(VISIBILITY_OFF);
+ Essence->setDeathState(DEAD);
+ }
+ EssenceGUID = 0;
+ }
+
+ Phase = 0;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
+ }
+
+ void Aggro(Unit* who)
+ {
+ m_creature->AddThreat(who, 10000.0f);
+ DoZoneInCombat();
+ if(pInstance)
+ pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS);
+
+ Phase = 1;
+ Counter = 0;
+ Timer = 0;
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ Aggro(who);
+ InCombat = true;
+ }
+ }
+ }
+ }
+
+ void AttackStart(Unit*) {}
+
+ bool SummonSoul()
+ {
+ uint32 random = rand()%6;
+ float x = Coords[random].x;
+ float y = Coords[random].y;
+ Creature* Soul = m_creature->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(!Soul) return false;
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ ((npc_enslaved_soulAI*)Soul->AI())->ReliquaryGUID = m_creature->GetGUID();
+ Soul->AI()->AttackStart(target);
+ }else EnterEvadeMode();
+ return true;
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE);
+
+ InCombat = false;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!Phase)
+ return;
+
+ if(m_creature->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist
+ {
+ EnterEvadeMode();
+ return;
+ }
+
+ Creature* Essence;
+ if(EssenceGUID)
+ {
+ Essence = (Creature*)Unit::GetUnit(*m_creature, EssenceGUID);
+ if(!Essence)
+ {
+ EnterEvadeMode();
+ return;
+ }
+ }
+
+ if(Timer < diff)
+ {
+ switch(Counter)
+ {
+ case 0:
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,375); // I R ANNNGRRRY!
+ Timer = 3000;
+ break;
+ case 1:
+ Timer = 2800;
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); // Release the cube
+ break;
+ case 2:
+ Timer = 5000;
+ if(Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0))
+ {
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,373); // Ribs: open
+ Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0));
+ EssenceGUID = Summon->GetGUID();
+ }else EnterEvadeMode();
+ break;
+ case 3:
+ Timer = 1000;
+ if(Phase == 3)
+ {
+ if(!Essence->isAlive())
+ m_creature->CastSpell(m_creature, 7, true);
+ else return;
+ }
+ else
+ {
+ if(Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
+ {
+ Essence->AI()->EnterEvadeMode();
+ Essence->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
+ }else return;
+ }
+ break;
+ case 4:
+ Timer = 1500;
+ if(Essence->IsWithinDistInMap(m_creature, 10))
+ Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE, 374); //rotate and disappear
+ else
+ return;
+ break;
+ case 5:
+ if(Phase == 1)
+ {
+ Essence->Yell(SUFF_SAY_AFTER,LANG_UNIVERSAL,0);
+ DoPlaySoundToSet(Essence, SUFF_SOUND_AFTER);
+ }
+ else
+ {
+ Essence->Yell(DESI_SAY_AFTER,LANG_UNIVERSAL,0);
+ DoPlaySoundToSet(Essence, DESI_SOUND_AFTER);
+ }
+ Essence->SetVisibility(VISIBILITY_OFF);
+ Essence->setDeathState(DEAD);
+ m_creature->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;
+ }
+ Counter++;
+ }else Timer -= diff;
+ }
+};
+
+//This is used to sort the players by distance in preparation for the Fixate cast.
+struct TargetDistanceOrder : public std::binary_function
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator "<"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI
+{
+ boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 StatAuraGUID;
+
+ uint32 AggroYellTimer;
+ uint32 FixateTimer;
+ uint32 EnrageTimer;
+ uint32 SoulDrainTimer;
+ uint32 AuraTimer;
+
+ void Reset()
+ {
+ StatAuraGUID = 0;
+
+ AggroYellTimer = 5000;
+ FixateTimer = 8000;
+ EnrageTimer = 30000;
+ SoulDrainTimer = 45000;
+ AuraTimer = 5000;
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(damage >= m_creature->GetHealth())
+ {
+ damage = 0;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_RECAP);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ m_creature->Yell(SUFF_SAY_FREED, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_FREED);
+ DoZoneInCombat();
+ m_creature->CastSpell(m_creature, AURA_OF_SUFFERING, true); // linked aura need core support
+ m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, true);
+ m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE2, true);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SUFF_SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SUFF_SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void CastFixate()
+ {
+ std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
+ if(m_threatlist.empty())
+ return; // No point continuing if empty threatlist.
+ std::list targets;
+ std::list::iterator itr = m_threatlist.begin();
+ for( ; itr != m_threatlist.end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*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(TargetDistanceOrder(m_creature)); // Sort players by distance.
+ targets.resize(1); // Only need closest target.
+ Unit* target = targets.front(); // Get the first target.
+ target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ //Supposed to be cast on nearest target
+ if(FixateTimer < diff)
+ {
+ CastFixate();
+ FixateTimer = 5000;
+ if(!(rand()%16))
+ {
+ DoYell(SUFF_SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_AGGRO);
+ }
+ }else FixateTimer -= diff;
+
+ if(EnrageTimer < diff)
+ {
+ DoCast(m_creature, SPELL_ENRAGE);
+ EnrageTimer = 60000;
+ DoYell(SUFF_SAY_ENRAGE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SUFF_SOUND_ENRAGE);
+ }else EnrageTimer -= diff;
+
+ if(SoulDrainTimer < diff)
+ {
+ DoCast(m_creature, SPELL_SOUL_DRAIN);
+ SoulDrainTimer = 60000;
+ }else SoulDrainTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI
+{
+ boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 RuneShieldTimer;
+ uint32 DeadenTimer;
+ uint32 SoulShockTimer;
+
+ void Reset()
+ {
+ RuneShieldTimer = 60000;
+ DeadenTimer = 30000;
+ SoulShockTimer = 5000;
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(done_by == m_creature)
+ return;
+
+ if(damage >= m_creature->GetHealth())
+ {
+ damage = 0;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->Yell(DESI_SAY_RECAP,LANG_UNIVERSAL,0);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_RECAP);
+ }
+ else
+ {
+ int32 bp0 = damage / 2;
+ m_creature->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true);
+ }
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL])
+ for(uint8 i = 0; i < 3; ++i)
+ if(spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST)
+ if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK
+ || m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_DEADEN)
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false);
+ }
+
+ void Aggro(Unit *who)
+ {
+ m_creature->Yell(DESI_SAY_FREED, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_FREED);
+ DoZoneInCombat();
+ DoCast(m_creature, AURA_OF_DESIRE, true);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoYell(DESI_SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(DESI_SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY2);
+ break;
+ case 2:
+ DoYell(DESI_SAY_SLAY3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_SLAY3);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(RuneShieldTimer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->CastSpell(m_creature, SPELL_RUNE_SHIELD, true);
+ SoulShockTimer += 2000;
+ DeadenTimer += 2000;
+ RuneShieldTimer = 60000;
+ }else RuneShieldTimer -= diff;
+
+ if(SoulShockTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SOUL_SHOCK);
+ SoulShockTimer = 5000;
+ }else SoulShockTimer -= diff;
+
+ if(DeadenTimer < diff)
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature->getVictim(), SPELL_DEADEN);
+ DeadenTimer = 25000 + rand()%10000;
+ if(!(rand()%2))
+ {
+ DoYell(DESI_SAY_SPEC,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, DESI_SOUND_SPEC);
+ }
+ }else DeadenTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI
+{
+ boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 AggroTargetGUID;
+
+ uint32 CheckTankTimer;
+ uint32 SoulScreamTimer;
+ uint32 SpiteTimer;
+
+ std::list SpiteTargetGUID;
+
+ bool CheckedAggro;
+
+ void Reset()
+ {
+ AggroTargetGUID = 0;
+
+ CheckTankTimer = 5000;
+ SoulScreamTimer = 10000;
+ SpiteTimer = 30000;
+
+ SpiteTargetGUID.clear();
+
+ CheckedAggro = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ m_creature->Yell(ANGER_SAY_FREED, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_FREED);
+ DoZoneInCombat();
+ DoCast(m_creature, AURA_OF_ANGER, true);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(ANGER_SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,ANGER_SOUND_DEATH);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(ANGER_SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void SelectSpiteTarget(uint32 num, float max_range = 999)
+ {
+ if(!num) return;
+
+ CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ std::list tempUnitMap;
+
+ {
+ Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, max_range);
+ Trinity::UnitListSearcher searcher(tempUnitMap, u_check);
+
+ TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher);
+ TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher);
+
+ CellLock cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, world_unit_searcher, *(m_creature->GetMap()));
+ cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap()));
+ }
+
+ std::list::iterator itr;
+ while(tempUnitMap.size() && SpiteTargetGUID.size() < num)
+ {
+ itr = tempUnitMap.begin();
+ advance(itr, rand()%tempUnitMap.size());
+ SpiteTargetGUID.push_back((*itr)->GetGUID());
+ tempUnitMap.erase(itr);
+ }
+
+ for(itr = tempUnitMap.begin(); itr != tempUnitMap.end(); ++itr)
+ (*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->CastSpell(m_creature, SPELL_SPITE_TARGET, true); // must true
+ for(itr = tempUnitMap.begin(); itr != tempUnitMap.end(); ++itr)
+ (*itr)->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() && !m_creature->getVictim())
+ return;
+
+ if(!CheckedAggro)
+ {
+ AggroTargetGUID = m_creature->getVictim()->GetGUID();
+ CheckedAggro = true;
+ }
+
+ if(CheckTankTimer < diff)
+ {
+ if(m_creature->getVictim()->GetGUID() != AggroTargetGUID)
+ {
+ DoYell(ANGER_SAY_BEFORE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_BEFORE);
+ DoCast(m_creature, SPELL_SELF_SEETHE, true);
+ AggroTargetGUID = m_creature->getVictim()->GetGUID();
+ }
+ CheckTankTimer = 2000;
+ }else CheckTankTimer -= diff;
+
+ if(SoulScreamTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SOUL_SCREAM);
+ SoulScreamTimer = 10000;
+ if(!(rand()%3))
+ {
+ DoYell(ANGER_SAY_SCREAM,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_SCREAM);
+ }
+ }else SoulScreamTimer -= diff;
+
+ if(SpiteTimer < diff)
+ {
+ if(!SpiteTargetGUID.empty())
+ {
+ for (std::list::iterator itr = SpiteTargetGUID.begin(); itr != SpiteTargetGUID.end(); ++itr)
+ {
+ if(Unit* target = Unit::GetUnit(*m_creature, *itr))
+ {
+ target->RemoveAurasDueToSpell(SPELL_SPITE_TARGET);
+ m_creature->CastSpell(target, SPELL_SPITE_DAMAGE, true);
+ }
+ }
+ SpiteTargetGUID.clear();
+ SpiteTimer = 24000;
+ }
+ else
+ {
+ SelectSpiteTarget(3);
+ SpiteTimer = 6000;
+ DoYell(ANGER_SAY_SPEC,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, ANGER_SOUND_SPEC);
+ }
+ }else SpiteTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+void npc_enslaved_soulAI::JustDied(Unit *killer)
+{
+ if(ReliquaryGUID)
+ {
+ Creature* Reliquary = ((Creature*)Unit::GetUnit((*m_creature), ReliquaryGUID));
+ if(Reliquary)
+ ((boss_reliquary_of_soulsAI*)Reliquary->AI())->SoulDeathCount++;
+ }
+ DoCast(m_creature, SPELL_SOUL_RELEASE, true);
+}
+
+CreatureAI* GetAI_boss_reliquary_of_souls(Creature *_Creature)
+{
+ return new boss_reliquary_of_soulsAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_essence_of_suffering(Creature *_Creature)
+{
+ return new boss_essence_of_sufferingAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_essence_of_desire(Creature *_Creature)
+{
+ return new boss_essence_of_desireAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_essence_of_anger(Creature *_Creature)
+{
+ return new boss_essence_of_angerAI (_Creature);
+}
+
+CreatureAI* GetAI_npc_enslaved_soul(Creature *_Creature)
+{
+ return new npc_enslaved_soulAI (_Creature);
+}
+
+void AddSC_boss_reliquary_of_souls()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_reliquary_of_souls";
+ newscript->GetAI = GetAI_boss_reliquary_of_souls;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_essence_of_suffering";
+ newscript->GetAI = GetAI_boss_essence_of_suffering;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_essence_of_desire";
+ newscript->GetAI = GetAI_boss_essence_of_desire;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_essence_of_anger";
+ newscript->GetAI = GetAI_boss_essence_of_anger;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_enslaved_soul";
+ newscript->GetAI = GetAI_npc_enslaved_soul;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
index 599a8a1e09d..590f1f71216 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
@@ -1,812 +1,812 @@
-/* Copyright (C) 2006,2007 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Shade_of_Akama
-SD%Complete: 99
-SDComment: Seems to be complete.
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-struct Location
-{
- float x, y, o, z;
-};
-
-static Location ChannelerLocations[]=
-{
- {463.161285, 401.219757, 3.141592},
- {457.377625, 391.227661, 2.106461},
- {446.012421, 391.227661, 1.071904},
- {439.533783, 401.219757, 0.000000},
- {446.012421, 411.211853, 5.210546},
- {457.377625, 411.211853, 4.177494}
-};
-
-static Location SpawnLocations[]=
-{
- {498.652740, 461.728119, 0},
- {498.505003, 339.619324, 0}
-};
-
-static Location AkamaWP[]=
-{
- {482.352448, 401.162720, 0, 112.783928},
- {469.597443, 402.264404, 0, 118.537910}
-};
-
-static Location BrokenCoords[]=
-{
- {541.375916, 401.439575, M_PI, 112.783997}, // The place where Akama channels
- {534.130005, 352.394531, 2.164150, 112.783737}, // Behind a 'pillar' which is behind the east alcove
- {499.621185, 341.534729, 1.652856, 112.783730}, // East Alcove
- {499.151093, 461.036438, 4.770888, 112.78370}, // West Alcove
-};
-
-static Location BrokenWP[]=
-{
- {492.491638, 400.744690, 3.122336, 112.783737},
- {494.335724, 382.221771, 2.676230, 112.783737},
- {489.555939, 373.507202, 2.416263, 112.783737},
- {491.136353, 427.868774, 3.519748, 112.783737},
-};
-
-// Locations
-#define Z1 118.543144
-#define Z2 120.783768
-#define Z_SPAWN 113.537949
-#define AGGRO_X 482.793182
-#define AGGRO_Y 401.270172
-#define AGGRO_Z 112.783928
-#define AKAMA_X 514.583984
-#define AKAMA_Y 400.601013
-#define AKAMA_Z 112.783997
-
-// Texts
-#define SOUND_DEATH 11386
-#define SAY_DEATH "No! Not yet..."
-#define SOUND_LOW_HEALTH 11385
-#define SAY_LOW_HEALTH "I will not last much longer..."
-
-// Ending cinematic text
-#define SAY_FREE "Come out from the shadows! I've returned to lead you against our true enemy! Shed your chains and raise your weapons against your Illidari masters!"
-#define SAY_BROKEN_FREE_01 "Hail our leader! Hail Akama!"
-#define SAY_BROKEN_FREE_02 "Hail Akama!"
-
-// Gossips
-#define GOSSIP_ITEM "We are ready to fight alongside you, Akama"
-
-// Spells
-#define SPELL_VERTEX_SHADE_BLACK 39833
-#define SPELL_SHADE_SOUL_CHANNEL 40401
-#define SPELL_DESTRUCTIVE_POISON 40874
-#define SPELL_LIGHTNING_BOLT 42024
-#define SPELL_AKAMA_SOUL_CHANNEL 40447
-#define SPELL_AKAMA_SOUL_RETRIEVE 40902
-#define AKAMA_SOUL_EXPEL 40855
-#define SPELL_SHADE_SOUL_CHANNEL_2 40520
-
-// Channeler entry
-#define CREATURE_CHANNELER 23421
-#define CREATURE_SORCERER 23215
-#define CREATURE_DEFENDER 23216
-#define CREATURE_BROKEN 23319
-
-const uint32 spawnEntries[4]= { 23523, 23318, 23524 };
-
-struct TRINITY_DLL_DECL mob_ashtongue_channelerAI : public ScriptedAI
-{
- mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- uint64 ShadeGUID;
-
- void Reset() { ShadeGUID = 0; }
- void JustDied(Unit* killer);
- void Aggro(Unit* who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
- void UpdateAI(const uint32 diff) {}
-};
-
-struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI
-{
- mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) { Reset(); }
-
- uint64 ShadeGUID;
- uint32 CheckTimer;
- bool StartBanishing;
-
- void Reset()
- {
- StartBanishing = false;
- CheckTimer = 5000;
- ShadeGUID = 0;
- }
-
- void JustDied(Unit* killer);
- void Aggro(Unit* who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
- void UpdateAI(const uint32 diff)
- {
- if(StartBanishing)
- return;
-
- if(CheckTimer < diff)
- {
- Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID);
- if(Shade && Shade->isAlive() && m_creature->isAlive())
- {
- if(m_creature->GetDistance2d(Shade) < 20)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true);
- DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true);
-
- StartBanishing = true;
- }
- }
- CheckTimer = 2000;
- }else CheckTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
-{
- boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0;
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- std::list Channelers;
- std::list Sorcerers;
- uint64 AkamaGUID;
-
- uint32 SorcererCount;
- uint32 DeathCount;
-
- uint32 ReduceHealthTimer;
- uint32 SummonTimer;
- uint32 ResetTimer;
- uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon creature timer.
-
- bool IsBanished;
- bool HasKilledAkama;
-
- void Reset()
- {
- FindChannelers();
-
- if(!Channelers.empty())
- for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- {
- Creature* Channeler = NULL;
- Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr));
- if(Channeler)
- {
- if(Channeler->isDead())
- {
- Channeler->RemoveCorpse();
- Channeler->Respawn();
- }
- Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true);
- Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true);
- Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- }
- else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
-
- if(!Sorcerers.empty())
- for(std::list::iterator itr = Sorcerers.begin(); itr != Sorcerers.end(); ++itr)
- if(Creature* Sorcerer = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
- if(Sorcerer->isAlive())
- {
- Sorcerer->SetVisibility(VISIBILITY_OFF);
- Sorcerer->DealDamage(Sorcerer, Sorcerer->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- Sorcerers.clear();
-
- if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
- Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- SorcererCount = 0;
- DeathCount = 0;
-
- SummonTimer = 10000;
- ReduceHealthTimer = 0;
- ResetTimer = 60000;
- DefenderTimer = 15000;
-
- IsBanished = true;
- HasKilledAkama = false;
-
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
-
- if(pInstance && m_creature->isAlive())
- pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
- }
-
- void Aggro(Unit* who) { }
-
- void AttackStart(Unit* who)
- {
- if(!who || IsBanished) return;
-
- if(who->isTargetableForAttack() && who != m_creature)
- DoStartAttackAndMovement(who);
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if(IsBanished) return;
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer
- {
- debug_log("SD2: Increasing Death Count for Shade of Akama encounter");
- ++DeathCount;
- m_creature->RemoveSingleAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2, 0);
- if(guid)
- {
- if(Sorcerers.empty())
- error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid);
- else Sorcerers.remove(guid);
- }
- }
-
- 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))
- {
- Creature* Sorcerer = m_creature->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
- if(Sorcerer)
- {
- ((mob_ashtongue_sorcererAI*)Sorcerer->AI())->ShadeGUID = m_creature->GetGUID();
- Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- Sorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
- Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
- Sorcerers.push_back(Sorcerer->GetGUID());
- --DeathCount;
- ++SorcererCount;
- }
- }
- else
- {
- for(uint8 i = 0; i < 3; ++i)
- {
- Creature* Spawn = m_creature->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
- if(Spawn)
- {
- Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z);
- }
- }
- }
- }
-
- void FindChannelers()
- {
- CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- std::list ChannelerList;
-
- Trinity::AllCreaturesOfEntryInRange check(m_creature, CREATURE_CHANNELER, 50);
- Trinity::CreatureListSearcher searcher(ChannelerList, check);
- TypeContainerVisitor, GridTypeMapContainer> visitor(searcher);
-
- CellLock cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap()));
-
- if(!ChannelerList.empty())
- {
- Channelers.clear();
- for(std::list::iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
- {
- ((mob_ashtongue_channelerAI*)(*itr)->AI())->ShadeGUID = m_creature->GetGUID();
- Channelers.push_back((*itr)->GetGUID());
- debug_log("SD2: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID());
- }
- }
- else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy");
- }
-
- void SetSelectableChannelers()
- {
- if(Channelers.empty())
- {
- error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy");
- return;
- }
-
- for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- if(Creature* Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
- Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; }
-
- void UpdateAI(const uint32 diff)
- {
- if(!InCombat)
- return;
-
- if(IsBanished)
- {
- // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check
- if(m_creature->getThreatManager().getThreatList().size() < 2)
- EnterEvadeMode();
-
- if(DefenderTimer < diff)
- {
- uint32 ran = rand()%2;
- Creature* Defender = m_creature->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
- if(Defender)
- {
- Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- bool move = true;
- if(AkamaGUID)
- {
- if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
- {
- float x, y, z;
- Akama->GetPosition(x,y,z);
- // They move towards AKama
- Defender->GetMotionMaster()->MovePoint(0, x, y, z);
- }else move = false;
- }else move = false;
- 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(DeathCount >= 6)
- {
- if(AkamaGUID)
- {
- Unit* Akama = Unit::GetUnit((*m_creature), AkamaGUID);
- if(Akama && Akama->isAlive())
- {
- IsBanished = false;
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveChase(Akama);
- Akama->GetMotionMaster()->Clear();
- // Shade should move to Akama, not the other way around
- Akama->GetMotionMaster()->MoveIdle();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Crazy amount of threat
- m_creature->AddThreat(Akama, 10000000.0f);
- Akama->AddThreat(m_creature, 10000000.0f);
- m_creature->Attack(Akama, true);
- Akama->Attack(m_creature, true);
- }
- }
- }
- }
- else // No longer banished, let's fight Akama now
- {
- if(ReduceHealthTimer < diff)
- {
- if(AkamaGUID)
- {
- Unit* Akama = Unit::GetUnit((*m_creature), AkamaGUID);
- if(Akama && Akama->isAlive())
- {
- //10 % less health every few seconds.
- m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- ReduceHealthTimer = 12000;
- }
- else
- {
- HasKilledAkama = true; // Akama is dead or missing, we stop fighting and disappear
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetHealth(m_creature->GetMaxHealth());
- m_creature->RemoveAllAuras();
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- }
- }else ReduceHealthTimer -= diff;
-
- if(HasKilledAkama)
- {
- if(ResetTimer < diff)
- {
- InCombat = false;
- EnterEvadeMode(); // Reset a little while after killing Akama
- }
- else ResetTimer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
- }
-};
-
-void mob_ashtongue_channelerAI::JustDied(Unit* killer)
-{
- Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
- if(Shade && Shade->isAlive())
- ((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount();
- else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama.");
-}
-
-void mob_ashtongue_sorcererAI::JustDied(Unit* killer)
-{
- Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
- if(Shade && Shade->isAlive())
- ((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount(m_creature->GetGUID());
- else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama.");
-}
-
-struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
-{
- npc_akamaAI(Creature* c) : ScriptedAI(c)
- {
- ShadeHasDied = false;
- StartCombat = false;
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : 0;
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 ShadeGUID;
-
- uint32 DestructivePoisonTimer;
- uint32 LightningBoltTimer;
- uint32 CheckTimer;
- uint32 CastSoulRetrieveTimer;
- uint32 SoulRetrieveTimer;
- uint32 SummonBrokenTimer;
- uint32 EndingTalkCount;
- uint32 WayPointId;
- uint32 BrokenSummonIndex;
-
- std::list BrokenList;
-
- bool EventBegun;
- bool ShadeHasDied;
- bool StartCombat;
- bool HasYelledOnce;
-
- void Reset()
- {
- DestructivePoisonTimer = 15000;
- LightningBoltTimer = 10000;
- CheckTimer = 2000;
- CastSoulRetrieveTimer = 0;
- SoulRetrieveTimer = 0;
- SummonBrokenTimer = 0;
- EndingTalkCount = 0;
- WayPointId = 0;
- BrokenSummonIndex = 0;
-
- BrokenList.clear();
-
- EventBegun = false;
- HasYelledOnce = false;
-
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
-
- void Aggro(Unit* who) {}
-
- void BeginEvent(Player* pl)
- {
- if(!pInstance)
- return;
-
- ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA);
- if(!ShadeGUID)
- return;
-
- Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
- if(Shade)
- {
- pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS);
- // Prevent players from trying to restart event
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- ((boss_shade_of_akamaAI*)Shade->AI())->SetAkamaGUID(m_creature->GetGUID());
- ((boss_shade_of_akamaAI*)Shade->AI())->SetSelectableChannelers();
- ((boss_shade_of_akamaAI*)Shade->AI())->InCombat = true;
- Shade->AddThreat(m_creature, 1000000.0f);
- Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
- Shade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
- if(pl) Shade->AddThreat(pl, 1.0f);
- DoZoneInCombat(Shade);
- EventBegun = true;
- }
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if(type != POINT_MOTION_TYPE)
- return;
-
- switch(id)
- {
- case 0: ++WayPointId; break;
-
- case 1:
- if(Unit* Shade = Unit::GetUnit(*m_creature, ShadeGUID))
- {
- m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID);
- DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE);
- EndingTalkCount = 0;
- SoulRetrieveTimer = 16000;
- }
- break;
- }
- }
-
- void JustDied(Unit* killer)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!EventBegun)
- return;
-
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15 && !HasYelledOnce)
- {
- DoYell(SAY_LOW_HEALTH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_LOW_HEALTH);
- HasYelledOnce = true;
- }
-
- if(ShadeGUID && !StartCombat)
- {
- Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
- if(Shade && Shade->isAlive())
- {
- if(((boss_shade_of_akamaAI*)Shade->AI())->IsBanished)
- {
- if(CastSoulRetrieveTimer < diff)
- {
- DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL);
- CastSoulRetrieveTimer = 500;
- }else CastSoulRetrieveTimer -= diff;
- }
- else
- {
- m_creature->InterruptNonMeleeSpells(false);
- StartCombat = true;
- }
- }
- }
-
- if(ShadeHasDied && (WayPointId == 1))
- {
- if(pInstance) pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE);
- m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z);
- ++WayPointId;
- }
-
- if(!ShadeHasDied && StartCombat)
- {
- if(CheckTimer < diff)
- {
- if(ShadeGUID)
- {
- Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID);
- if(Shade && !Shade->isAlive())
- {
- ShadeHasDied = true;
- WayPointId = 0;
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
- m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
- }
- }
- CheckTimer = 5000;
- }else CheckTimer -= diff;
- }
-
- if(SummonBrokenTimer && BrokenSummonIndex < 4)
- if(SummonBrokenTimer <= diff)
- {
- for(uint8 i = 0; i < 4; ++i)
- {
- 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 = m_creature->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());
- }
- }
- ++BrokenSummonIndex;
- SummonBrokenTimer = 1000;
- }else SummonBrokenTimer -= diff;
-
- if(SoulRetrieveTimer)
- if(SoulRetrieveTimer <= diff)
- {
- switch(EndingTalkCount)
- {
- case 0:
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
- ++EndingTalkCount;
- SoulRetrieveTimer = 2000;
- SummonBrokenTimer = 1;
- case 1:
- DoYell(SAY_FREE, LANG_UNIVERSAL, NULL);
- ++EndingTalkCount;
- SoulRetrieveTimer = 25000;
- break;
- case 2:
- if(!BrokenList.empty())
- {
- bool Yelled = false;
- for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
- {
- if(!Yelled)
- {
- pUnit->MonsterYell(SAY_BROKEN_FREE_01, LANG_UNIVERSAL, 0);
- Yelled = true;
- }
- pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
- }
- }
- ++EndingTalkCount;
- SoulRetrieveTimer = 1500;
- break;
- case 3:
- if(!BrokenList.empty())
- for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
- // This is the incorrect spell, but can't seem to find the right one.
- pUnit->CastSpell(pUnit, 39656, true);
- ++EndingTalkCount;
- SoulRetrieveTimer = 5000;
- case 4:
- if(!BrokenList.empty())
- for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
- if(Unit* pUnit = Unit::GetUnit((*m_creature), *itr))
- pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0);
- SoulRetrieveTimer = 0;
- break;
- }
- }else SoulRetrieveTimer -= diff;
-
- if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
- return;
-
- if(DestructivePoisonTimer < diff)
- {
- // SPELL_DESTRUCTIVE_POISON is self-cast only for some reason so we make our target cast it on itself
- m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_DESTRUCTIVE_POISON, true);
- DestructivePoisonTimer = 15000;
- }else DestructivePoisonTimer -= diff;
-
- if(LightningBoltTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT);
- LightningBoltTimer = 10000;
- }else LightningBoltTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_shade_of_akama(Creature *_Creature)
-{
- return new boss_shade_of_akamaAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_ashtongue_channeler(Creature *_Creature)
-{
- return new mob_ashtongue_channelerAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature *_Creature)
-{
- return new mob_ashtongue_sorcererAI (_Creature);
-}
-
-CreatureAI* GetAI_npc_akama_shade(Creature *_Creature)
-{
- return new npc_akamaAI (_Creature);
-}
-
-bool GossipSelect_npc_akama(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
- {
- player->CLOSE_GOSSIP_MENU();
- ((npc_akamaAI*)_Creature->AI())->BeginEvent(player);
- }
-
- return true;
-}
-
-bool GossipHello_npc_akama(Player *player, Creature *_Creature)
-{
- if(player->isAlive())
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(907, _Creature->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;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_ashtongue_channeler";
- newscript->GetAI = GetAI_mob_ashtongue_channeler;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_ashtongue_sorcerer";
- newscript->GetAI = GetAI_mob_ashtongue_sorcerer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_akama_shade";
- newscript->GetAI = GetAI_npc_akama_shade;
- newscript->pGossipHello = &GossipHello_npc_akama;
- newscript->pGossipSelect = &GossipSelect_npc_akama;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Shade_of_Akama
+SD%Complete: 99
+SDComment: Seems to be complete.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+struct Location
+{
+ float x, y, o, z;
+};
+
+static Location ChannelerLocations[]=
+{
+ {463.161285, 401.219757, 3.141592},
+ {457.377625, 391.227661, 2.106461},
+ {446.012421, 391.227661, 1.071904},
+ {439.533783, 401.219757, 0.000000},
+ {446.012421, 411.211853, 5.210546},
+ {457.377625, 411.211853, 4.177494}
+};
+
+static Location SpawnLocations[]=
+{
+ {498.652740, 461.728119, 0},
+ {498.505003, 339.619324, 0}
+};
+
+static Location AkamaWP[]=
+{
+ {482.352448, 401.162720, 0, 112.783928},
+ {469.597443, 402.264404, 0, 118.537910}
+};
+
+static Location BrokenCoords[]=
+{
+ {541.375916, 401.439575, M_PI, 112.783997}, // The place where Akama channels
+ {534.130005, 352.394531, 2.164150, 112.783737}, // Behind a 'pillar' which is behind the east alcove
+ {499.621185, 341.534729, 1.652856, 112.783730}, // East Alcove
+ {499.151093, 461.036438, 4.770888, 112.78370}, // West Alcove
+};
+
+static Location BrokenWP[]=
+{
+ {492.491638, 400.744690, 3.122336, 112.783737},
+ {494.335724, 382.221771, 2.676230, 112.783737},
+ {489.555939, 373.507202, 2.416263, 112.783737},
+ {491.136353, 427.868774, 3.519748, 112.783737},
+};
+
+// Locations
+#define Z1 118.543144
+#define Z2 120.783768
+#define Z_SPAWN 113.537949
+#define AGGRO_X 482.793182
+#define AGGRO_Y 401.270172
+#define AGGRO_Z 112.783928
+#define AKAMA_X 514.583984
+#define AKAMA_Y 400.601013
+#define AKAMA_Z 112.783997
+
+// Texts
+#define SOUND_DEATH 11386
+#define SAY_DEATH "No! Not yet..."
+#define SOUND_LOW_HEALTH 11385
+#define SAY_LOW_HEALTH "I will not last much longer..."
+
+// Ending cinematic text
+#define SAY_FREE "Come out from the shadows! I've returned to lead you against our true enemy! Shed your chains and raise your weapons against your Illidari masters!"
+#define SAY_BROKEN_FREE_01 "Hail our leader! Hail Akama!"
+#define SAY_BROKEN_FREE_02 "Hail Akama!"
+
+// Gossips
+#define GOSSIP_ITEM "We are ready to fight alongside you, Akama"
+
+// Spells
+#define SPELL_VERTEX_SHADE_BLACK 39833
+#define SPELL_SHADE_SOUL_CHANNEL 40401
+#define SPELL_DESTRUCTIVE_POISON 40874
+#define SPELL_LIGHTNING_BOLT 42024
+#define SPELL_AKAMA_SOUL_CHANNEL 40447
+#define SPELL_AKAMA_SOUL_RETRIEVE 40902
+#define AKAMA_SOUL_EXPEL 40855
+#define SPELL_SHADE_SOUL_CHANNEL_2 40520
+
+// Channeler entry
+#define CREATURE_CHANNELER 23421
+#define CREATURE_SORCERER 23215
+#define CREATURE_DEFENDER 23216
+#define CREATURE_BROKEN 23319
+
+const uint32 spawnEntries[4]= { 23523, 23318, 23524 };
+
+struct TRINITY_DLL_DECL mob_ashtongue_channelerAI : public ScriptedAI
+{
+ mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ uint64 ShadeGUID;
+
+ void Reset() { ShadeGUID = 0; }
+ void JustDied(Unit* killer);
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff) {}
+};
+
+struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI
+{
+ mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) { Reset(); }
+
+ uint64 ShadeGUID;
+ uint32 CheckTimer;
+ bool StartBanishing;
+
+ void Reset()
+ {
+ StartBanishing = false;
+ CheckTimer = 5000;
+ ShadeGUID = 0;
+ }
+
+ void JustDied(Unit* killer);
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ if(StartBanishing)
+ return;
+
+ if(CheckTimer < diff)
+ {
+ Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID);
+ if(Shade && Shade->isAlive() && m_creature->isAlive())
+ {
+ if(m_creature->GetDistance2d(Shade) < 20)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true);
+ DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true);
+
+ StartBanishing = true;
+ }
+ }
+ CheckTimer = 2000;
+ }else CheckTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
+{
+ boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0;
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ std::list Channelers;
+ std::list Sorcerers;
+ uint64 AkamaGUID;
+
+ uint32 SorcererCount;
+ uint32 DeathCount;
+
+ uint32 ReduceHealthTimer;
+ uint32 SummonTimer;
+ uint32 ResetTimer;
+ uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon creature timer.
+
+ bool IsBanished;
+ bool HasKilledAkama;
+
+ void Reset()
+ {
+ FindChannelers();
+
+ if(!Channelers.empty())
+ for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
+ {
+ Creature* Channeler = NULL;
+ Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr));
+ if(Channeler)
+ {
+ if(Channeler->isDead())
+ {
+ Channeler->RemoveCorpse();
+ Channeler->Respawn();
+ }
+ Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true);
+ Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true);
+ Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ }
+ else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
+
+ if(!Sorcerers.empty())
+ for(std::list::iterator itr = Sorcerers.begin(); itr != Sorcerers.end(); ++itr)
+ if(Creature* Sorcerer = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
+ if(Sorcerer->isAlive())
+ {
+ Sorcerer->SetVisibility(VISIBILITY_OFF);
+ Sorcerer->DealDamage(Sorcerer, Sorcerer->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ Sorcerers.clear();
+
+ if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
+ Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ SorcererCount = 0;
+ DeathCount = 0;
+
+ SummonTimer = 10000;
+ ReduceHealthTimer = 0;
+ ResetTimer = 60000;
+ DefenderTimer = 15000;
+
+ IsBanished = true;
+ HasKilledAkama = false;
+
+ m_creature->SetVisibility(VISIBILITY_ON);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
+
+ if(pInstance && m_creature->isAlive())
+ pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
+ }
+
+ void Aggro(Unit* who) { }
+
+ void AttackStart(Unit* who)
+ {
+ if(!who || IsBanished) return;
+
+ if(who->isTargetableForAttack() && who != m_creature)
+ DoStartAttackAndMovement(who);
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if(IsBanished) return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer
+ {
+ debug_log("SD2: Increasing Death Count for Shade of Akama encounter");
+ ++DeathCount;
+ m_creature->RemoveSingleAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2, 0);
+ if(guid)
+ {
+ if(Sorcerers.empty())
+ error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid);
+ else Sorcerers.remove(guid);
+ }
+ }
+
+ 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))
+ {
+ Creature* Sorcerer = m_creature->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
+ if(Sorcerer)
+ {
+ ((mob_ashtongue_sorcererAI*)Sorcerer->AI())->ShadeGUID = m_creature->GetGUID();
+ Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ Sorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+ Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ Sorcerers.push_back(Sorcerer->GetGUID());
+ --DeathCount;
+ ++SorcererCount;
+ }
+ }
+ else
+ {
+ for(uint8 i = 0; i < 3; ++i)
+ {
+ Creature* Spawn = m_creature->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
+ if(Spawn)
+ {
+ Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z);
+ }
+ }
+ }
+ }
+
+ void FindChannelers()
+ {
+ CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ std::list ChannelerList;
+
+ Trinity::AllCreaturesOfEntryInRange check(m_creature, CREATURE_CHANNELER, 50);
+ Trinity::CreatureListSearcher searcher(ChannelerList, check);
+ TypeContainerVisitor, GridTypeMapContainer> visitor(searcher);
+
+ CellLock cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap()));
+
+ if(!ChannelerList.empty())
+ {
+ Channelers.clear();
+ for(std::list::iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
+ {
+ ((mob_ashtongue_channelerAI*)(*itr)->AI())->ShadeGUID = m_creature->GetGUID();
+ Channelers.push_back((*itr)->GetGUID());
+ debug_log("SD2: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID());
+ }
+ }
+ else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy");
+ }
+
+ void SetSelectableChannelers()
+ {
+ if(Channelers.empty())
+ {
+ error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy");
+ return;
+ }
+
+ for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
+ if(Creature* Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
+ Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!InCombat)
+ return;
+
+ if(IsBanished)
+ {
+ // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check
+ if(m_creature->getThreatManager().getThreatList().size() < 2)
+ EnterEvadeMode();
+
+ if(DefenderTimer < diff)
+ {
+ uint32 ran = rand()%2;
+ Creature* Defender = m_creature->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000);
+ if(Defender)
+ {
+ Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ bool move = true;
+ if(AkamaGUID)
+ {
+ if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
+ {
+ float x, y, z;
+ Akama->GetPosition(x,y,z);
+ // They move towards AKama
+ Defender->GetMotionMaster()->MovePoint(0, x, y, z);
+ }else move = false;
+ }else move = false;
+ 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(DeathCount >= 6)
+ {
+ if(AkamaGUID)
+ {
+ Unit* Akama = Unit::GetUnit((*m_creature), AkamaGUID);
+ if(Akama && Akama->isAlive())
+ {
+ IsBanished = false;
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveChase(Akama);
+ Akama->GetMotionMaster()->Clear();
+ // Shade should move to Akama, not the other way around
+ Akama->GetMotionMaster()->MoveIdle();
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Crazy amount of threat
+ m_creature->AddThreat(Akama, 10000000.0f);
+ Akama->AddThreat(m_creature, 10000000.0f);
+ m_creature->Attack(Akama, true);
+ Akama->Attack(m_creature, true);
+ }
+ }
+ }
+ }
+ else // No longer banished, let's fight Akama now
+ {
+ if(ReduceHealthTimer < diff)
+ {
+ if(AkamaGUID)
+ {
+ Unit* Akama = Unit::GetUnit((*m_creature), AkamaGUID);
+ if(Akama && Akama->isAlive())
+ {
+ //10 % less health every few seconds.
+ m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ ReduceHealthTimer = 12000;
+ }
+ else
+ {
+ HasKilledAkama = true; // Akama is dead or missing, we stop fighting and disappear
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->SetHealth(m_creature->GetMaxHealth());
+ m_creature->RemoveAllAuras();
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ }
+ }else ReduceHealthTimer -= diff;
+
+ if(HasKilledAkama)
+ {
+ if(ResetTimer < diff)
+ {
+ InCombat = false;
+ EnterEvadeMode(); // Reset a little while after killing Akama
+ }
+ else ResetTimer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ }
+};
+
+void mob_ashtongue_channelerAI::JustDied(Unit* killer)
+{
+ Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
+ if(Shade && Shade->isAlive())
+ ((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount();
+ else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama.");
+}
+
+void mob_ashtongue_sorcererAI::JustDied(Unit* killer)
+{
+ Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
+ if(Shade && Shade->isAlive())
+ ((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount(m_creature->GetGUID());
+ else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama.");
+}
+
+struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
+{
+ npc_akamaAI(Creature* c) : ScriptedAI(c)
+ {
+ ShadeHasDied = false;
+ StartCombat = false;
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : 0;
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 ShadeGUID;
+
+ uint32 DestructivePoisonTimer;
+ uint32 LightningBoltTimer;
+ uint32 CheckTimer;
+ uint32 CastSoulRetrieveTimer;
+ uint32 SoulRetrieveTimer;
+ uint32 SummonBrokenTimer;
+ uint32 EndingTalkCount;
+ uint32 WayPointId;
+ uint32 BrokenSummonIndex;
+
+ std::list BrokenList;
+
+ bool EventBegun;
+ bool ShadeHasDied;
+ bool StartCombat;
+ bool HasYelledOnce;
+
+ void Reset()
+ {
+ DestructivePoisonTimer = 15000;
+ LightningBoltTimer = 10000;
+ CheckTimer = 2000;
+ CastSoulRetrieveTimer = 0;
+ SoulRetrieveTimer = 0;
+ SummonBrokenTimer = 0;
+ EndingTalkCount = 0;
+ WayPointId = 0;
+ BrokenSummonIndex = 0;
+
+ BrokenList.clear();
+
+ EventBegun = false;
+ HasYelledOnce = false;
+
+ m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void BeginEvent(Player* pl)
+ {
+ if(!pInstance)
+ return;
+
+ ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA);
+ if(!ShadeGUID)
+ return;
+
+ Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
+ if(Shade)
+ {
+ pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS);
+ // Prevent players from trying to restart event
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ ((boss_shade_of_akamaAI*)Shade->AI())->SetAkamaGUID(m_creature->GetGUID());
+ ((boss_shade_of_akamaAI*)Shade->AI())->SetSelectableChannelers();
+ ((boss_shade_of_akamaAI*)Shade->AI())->InCombat = true;
+ Shade->AddThreat(m_creature, 1000000.0f);
+ Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ Shade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
+ if(pl) Shade->AddThreat(pl, 1.0f);
+ DoZoneInCombat(Shade);
+ EventBegun = true;
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if(type != POINT_MOTION_TYPE)
+ return;
+
+ switch(id)
+ {
+ case 0: ++WayPointId; break;
+
+ case 1:
+ if(Unit* Shade = Unit::GetUnit(*m_creature, ShadeGUID))
+ {
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID);
+ DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE);
+ EndingTalkCount = 0;
+ SoulRetrieveTimer = 16000;
+ }
+ break;
+ }
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!EventBegun)
+ return;
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15 && !HasYelledOnce)
+ {
+ DoYell(SAY_LOW_HEALTH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_LOW_HEALTH);
+ HasYelledOnce = true;
+ }
+
+ if(ShadeGUID && !StartCombat)
+ {
+ Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
+ if(Shade && Shade->isAlive())
+ {
+ if(((boss_shade_of_akamaAI*)Shade->AI())->IsBanished)
+ {
+ if(CastSoulRetrieveTimer < diff)
+ {
+ DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL);
+ CastSoulRetrieveTimer = 500;
+ }else CastSoulRetrieveTimer -= diff;
+ }
+ else
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ StartCombat = true;
+ }
+ }
+ }
+
+ if(ShadeHasDied && (WayPointId == 1))
+ {
+ if(pInstance) pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE);
+ m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z);
+ ++WayPointId;
+ }
+
+ if(!ShadeHasDied && StartCombat)
+ {
+ if(CheckTimer < diff)
+ {
+ if(ShadeGUID)
+ {
+ Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID);
+ if(Shade && !Shade->isAlive())
+ {
+ ShadeHasDied = true;
+ WayPointId = 0;
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
+ m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
+ }
+ }
+ CheckTimer = 5000;
+ }else CheckTimer -= diff;
+ }
+
+ if(SummonBrokenTimer && BrokenSummonIndex < 4)
+ if(SummonBrokenTimer <= diff)
+ {
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ 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 = m_creature->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());
+ }
+ }
+ ++BrokenSummonIndex;
+ SummonBrokenTimer = 1000;
+ }else SummonBrokenTimer -= diff;
+
+ if(SoulRetrieveTimer)
+ if(SoulRetrieveTimer <= diff)
+ {
+ switch(EndingTalkCount)
+ {
+ case 0:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 2000;
+ SummonBrokenTimer = 1;
+ case 1:
+ DoYell(SAY_FREE, LANG_UNIVERSAL, NULL);
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 25000;
+ break;
+ case 2:
+ if(!BrokenList.empty())
+ {
+ bool Yelled = false;
+ for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
+ if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
+ {
+ if(!Yelled)
+ {
+ pUnit->MonsterYell(SAY_BROKEN_FREE_01, LANG_UNIVERSAL, 0);
+ Yelled = true;
+ }
+ pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
+ }
+ }
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 1500;
+ break;
+ case 3:
+ if(!BrokenList.empty())
+ for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
+ if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
+ // This is the incorrect spell, but can't seem to find the right one.
+ pUnit->CastSpell(pUnit, 39656, true);
+ ++EndingTalkCount;
+ SoulRetrieveTimer = 5000;
+ case 4:
+ if(!BrokenList.empty())
+ for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
+ if(Unit* pUnit = Unit::GetUnit((*m_creature), *itr))
+ pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0);
+ SoulRetrieveTimer = 0;
+ break;
+ }
+ }else SoulRetrieveTimer -= diff;
+
+ if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
+ return;
+
+ if(DestructivePoisonTimer < diff)
+ {
+ // SPELL_DESTRUCTIVE_POISON is self-cast only for some reason so we make our target cast it on itself
+ m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_DESTRUCTIVE_POISON, true);
+ DestructivePoisonTimer = 15000;
+ }else DestructivePoisonTimer -= diff;
+
+ if(LightningBoltTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT);
+ LightningBoltTimer = 10000;
+ }else LightningBoltTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_shade_of_akama(Creature *_Creature)
+{
+ return new boss_shade_of_akamaAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_ashtongue_channeler(Creature *_Creature)
+{
+ return new mob_ashtongue_channelerAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature *_Creature)
+{
+ return new mob_ashtongue_sorcererAI (_Creature);
+}
+
+CreatureAI* GetAI_npc_akama_shade(Creature *_Creature)
+{
+ return new npc_akamaAI (_Creature);
+}
+
+bool GossipSelect_npc_akama(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_akamaAI*)_Creature->AI())->BeginEvent(player);
+ }
+
+ return true;
+}
+
+bool GossipHello_npc_akama(Player *player, Creature *_Creature)
+{
+ if(player->isAlive())
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(907, _Creature->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;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_ashtongue_channeler";
+ newscript->GetAI = GetAI_mob_ashtongue_channeler;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_ashtongue_sorcerer";
+ newscript->GetAI = GetAI_mob_ashtongue_sorcerer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_akama_shade";
+ newscript->GetAI = GetAI_npc_akama_shade;
+ newscript->pGossipHello = &GossipHello_npc_akama;
+ newscript->pGossipSelect = &GossipSelect_npc_akama;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
index b3555c12816..243e4fed886 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
@@ -1,395 +1,395 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Supremus
-SD%Complete: 95
-SDComment: Need to implement doors.
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-//Spells
-#define SPELL_HURTFUL_STRIKE 41926
-#define SPELL_DEMON_FIRE 40029
-#define SPELL_MOLTEN_FLAME 40253
-#define SPELL_VOLCANIC_ERUPTION 40276
-#define SPELL_VOLCANIC_FIREBALL 40118
-#define SPELL_VOLCANIC_GEYSER 42055
-#define SPELL_MOLTEN_PUNCH 40126
-#define SPELL_BERSERK 45078
-
-#define CREATURE_VOLCANO 23085
-#define CREATURE_STALKER 23095
-
-struct TRINITY_DLL_DECL molten_flameAI : public ScriptedAI
-{
- molten_flameAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint64 SupremusGUID;
- bool TargetLocked;
- uint32 CheckTimer;
-
- void Reset()
- {
- SupremusGUID = 0;
- TargetLocked = false;
-
- CheckTimer = 1000;
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit *who)
- {
- if(TargetLocked)
- return; // stop it from aggroing players who move in LOS if we have a target.
- if(who && (who != m_creature) && (m_creature->IsWithinDistInMap(who, 10)))
- StalkTarget(who);
- }
-
- void SetSupremusGUID(uint64 GUID) { SupremusGUID = GUID; }
-
- void StalkTarget(Unit* target)
- {
- if(!target) return;
-
- m_creature->AddThreat(target, 50000000.0f);
- m_creature->GetMotionMaster()->MoveChase(target);
- DoCast(m_creature, SPELL_DEMON_FIRE, true);
- // DoCast(m_creature, SPELL_MOLTEN_FLAME, true); // This spell damages self, so disabled for now
- TargetLocked = true;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget())
- return;
-
- if(m_creature->getVictim() && m_creature->isAlive())
- {
- if(CheckTimer < diff)
- {
- if(SupremusGUID)
- {
- Unit* Supremus = NULL;
- Supremus = Unit::GetUnit((*m_creature), SupremusGUID);
- if(Supremus && (!Supremus->isAlive()))
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), 0, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- CheckTimer = 2000;
- }else CheckTimer -= diff;
- }
- }
-};
-
-struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
-{
- npc_volcanoAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CheckTimer;
- uint64 SupremusGUID;
- uint32 FireballTimer;
- uint32 GeyserTimer;
-
- void Reset()
- {
- CheckTimer = 1000;
- SupremusGUID = 0;
- FireballTimer = 500;
- GeyserTimer = 0;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(GeyserTimer < diff)
- {
- DoCast(m_creature, SPELL_VOLCANIC_GEYSER);
- GeyserTimer = 18000;
- }else GeyserTimer -= diff;
-
- if(FireballTimer < diff)
- {
- DoCast(m_creature, SPELL_VOLCANIC_FIREBALL, true);
- FireballTimer = 1000;
- }else FireballTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
-{
- boss_supremusAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 SummonFlameTimer;
- uint32 SwitchTargetTimer;
- uint32 PhaseSwitchTimer;
- uint32 SummonVolcanoTimer;
- uint32 HurtfulStrikeTimer;
- uint32 BerserkTimer;
-
- bool Phase1;
-
- void Reset()
- {
- if(pInstance)
- {
- if(m_creature->isAlive())
- {
- pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED);
- ToggleDoors(true);
- }
- else ToggleDoors(false);
- }
-
- HurtfulStrikeTimer = 5000;
- SummonFlameTimer = 20000;
- SwitchTargetTimer = 90000;
- PhaseSwitchTimer = 60000;
- SummonVolcanoTimer = 5000;
- BerserkTimer = 900000; // 15 minute enrage
-
- Phase1 = true;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
-
- if(pInstance)
- pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS);
- }
-
- void ToggleDoors(bool close)
- {
- if(GameObject* Doors = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS)))
- {
- if(close) Doors->SetGoState(1); // Closed
- else Doors->SetGoState(0); // Open
- }
- }
-
- void JustDied(Unit *killer)
- {
- if(pInstance)
- {
- pInstance->SetData(DATA_SUPREMUSEVENT, DONE);
- ToggleDoors(false);
- }
- }
-
- float CalculateRandomCoord(float initial)
- {
- float coord = 0;
-
- switch(rand()%2)
- {
- case 0: coord = initial + 20 + rand()%20; break;
- case 1: coord = initial - 20 - rand()%20; break;
- }
-
- return coord;
- }
-
- Creature* SummonCreature(uint32 entry, Unit* target)
- {
- if(target && entry)
- {
- Creature* Summon = m_creature->SummonCreature(entry, CalculateRandomCoord(target->GetPositionX()), CalculateRandomCoord(target->GetPositionY()), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 20000);
- if(Summon)
- {
- Summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Summon->setFaction(m_creature->getFaction());
- return Summon;
- }
- }
- return NULL;
- }
-
- Unit* CalculateHurtfulStrikeTarget()
- {
- uint32 health = 0;
- Unit* target = NULL;
-
- std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
- std::list::iterator i = m_threatlist.begin();
- for (i = m_threatlist.begin(); i!= m_threatlist.end();++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && m_creature->IsWithinDistInMap(pUnit, ATTACK_DISTANCE))
- {
- if(pUnit->GetHealth() > health)
- {
- health = pUnit->GetHealth();
- target = pUnit;
- }
- }
- }
-
- return target;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
- if(BerserkTimer < diff)
- DoCast(m_creature, SPELL_BERSERK);
- else BerserkTimer -= diff;
-
- if(SummonFlameTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 1);
-
- if(!target) // someone is trying to solo, set target as current victim.
- target = m_creature->getVictim();
-
- if(target)
- {
- Creature* MoltenFlame = SummonCreature(CREATURE_STALKER, target);
- if(MoltenFlame)
- {
- // Invisible model
- MoltenFlame->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- ((molten_flameAI*)MoltenFlame->AI())->SetSupremusGUID(m_creature->GetGUID());
- ((molten_flameAI*)MoltenFlame->AI())->StalkTarget(target);
- SummonFlameTimer = 20000;
- }
- }
- }else SummonFlameTimer -= diff;
-
- if(Phase1)
- {
- if(HurtfulStrikeTimer < diff)
- {
- Unit* target = CalculateHurtfulStrikeTarget();
- if(target)
- {
- DoCast(target, SPELL_HURTFUL_STRIKE);
- HurtfulStrikeTimer = 5000;
- }
- }else HurtfulStrikeTimer -= diff;
- }
-
- if(!Phase1)
- {
- if(SwitchTargetTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- DoResetThreat();
- m_creature->AddThreat(target, 5000000.0f);
- DoTextEmote("acquires a new target!", NULL);
- SwitchTargetTimer = 10000;
- }
-
- }else SwitchTargetTimer -= diff;
-
- if(SummonVolcanoTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
-
- if(!target)
- target = m_creature->getVictim();
-
- if(target)
- {
- DoCast(target, SPELL_VOLCANIC_ERUPTION);
- DoTextEmote("roars and the ground begins to crack open!", NULL);
- SummonVolcanoTimer = 10000;
- }
- }else SummonVolcanoTimer -= diff;
- }
-
- if(PhaseSwitchTimer < diff)
- {
- if(!Phase1)
- {
- Phase1 = true;
- DoResetThreat();
- PhaseSwitchTimer = 60000;
- m_creature->SetSpeed(MOVE_RUN, 1.0f);
- DoZoneInCombat();
- }
- else
- {
- Phase1 = false;
- DoResetThreat();
- SwitchTargetTimer = 10000;
- SummonVolcanoTimer = 2000;
- PhaseSwitchTimer = 60000;
- m_creature->SetSpeed(MOVE_RUN, 0.9f);
- DoZoneInCombat();
- }
- }else PhaseSwitchTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_supremus(Creature *_Creature)
-{
- return new boss_supremusAI (_Creature);
-}
-
-CreatureAI* GetAI_molten_flame(Creature *_Creature)
-{
- return new molten_flameAI (_Creature);
-}
-
-CreatureAI* GetAI_npc_volcano(Creature *_Creature)
-{
- return new npc_volcanoAI (_Creature);
-}
-
-void AddSC_boss_supremus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_supremus";
- newscript->GetAI = GetAI_boss_supremus;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="molten_flame";
- newscript->GetAI = GetAI_molten_flame;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_volcano";
- newscript->GetAI = GetAI_npc_volcano;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Supremus
+SD%Complete: 95
+SDComment: Need to implement doors.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+//Spells
+#define SPELL_HURTFUL_STRIKE 41926
+#define SPELL_DEMON_FIRE 40029
+#define SPELL_MOLTEN_FLAME 40253
+#define SPELL_VOLCANIC_ERUPTION 40276
+#define SPELL_VOLCANIC_FIREBALL 40118
+#define SPELL_VOLCANIC_GEYSER 42055
+#define SPELL_MOLTEN_PUNCH 40126
+#define SPELL_BERSERK 45078
+
+#define CREATURE_VOLCANO 23085
+#define CREATURE_STALKER 23095
+
+struct TRINITY_DLL_DECL molten_flameAI : public ScriptedAI
+{
+ molten_flameAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint64 SupremusGUID;
+ bool TargetLocked;
+ uint32 CheckTimer;
+
+ void Reset()
+ {
+ SupremusGUID = 0;
+ TargetLocked = false;
+
+ CheckTimer = 1000;
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(TargetLocked)
+ return; // stop it from aggroing players who move in LOS if we have a target.
+ if(who && (who != m_creature) && (m_creature->IsWithinDistInMap(who, 10)))
+ StalkTarget(who);
+ }
+
+ void SetSupremusGUID(uint64 GUID) { SupremusGUID = GUID; }
+
+ void StalkTarget(Unit* target)
+ {
+ if(!target) return;
+
+ m_creature->AddThreat(target, 50000000.0f);
+ m_creature->GetMotionMaster()->MoveChase(target);
+ DoCast(m_creature, SPELL_DEMON_FIRE, true);
+ // DoCast(m_creature, SPELL_MOLTEN_FLAME, true); // This spell damages self, so disabled for now
+ TargetLocked = true;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget())
+ return;
+
+ if(m_creature->getVictim() && m_creature->isAlive())
+ {
+ if(CheckTimer < diff)
+ {
+ if(SupremusGUID)
+ {
+ Unit* Supremus = NULL;
+ Supremus = Unit::GetUnit((*m_creature), SupremusGUID);
+ if(Supremus && (!Supremus->isAlive()))
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), 0, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ CheckTimer = 2000;
+ }else CheckTimer -= diff;
+ }
+ }
+};
+
+struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
+{
+ npc_volcanoAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CheckTimer;
+ uint64 SupremusGUID;
+ uint32 FireballTimer;
+ uint32 GeyserTimer;
+
+ void Reset()
+ {
+ CheckTimer = 1000;
+ SupremusGUID = 0;
+ FireballTimer = 500;
+ GeyserTimer = 0;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(GeyserTimer < diff)
+ {
+ DoCast(m_creature, SPELL_VOLCANIC_GEYSER);
+ GeyserTimer = 18000;
+ }else GeyserTimer -= diff;
+
+ if(FireballTimer < diff)
+ {
+ DoCast(m_creature, SPELL_VOLCANIC_FIREBALL, true);
+ FireballTimer = 1000;
+ }else FireballTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
+{
+ boss_supremusAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 SummonFlameTimer;
+ uint32 SwitchTargetTimer;
+ uint32 PhaseSwitchTimer;
+ uint32 SummonVolcanoTimer;
+ uint32 HurtfulStrikeTimer;
+ uint32 BerserkTimer;
+
+ bool Phase1;
+
+ void Reset()
+ {
+ if(pInstance)
+ {
+ if(m_creature->isAlive())
+ {
+ pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED);
+ ToggleDoors(true);
+ }
+ else ToggleDoors(false);
+ }
+
+ HurtfulStrikeTimer = 5000;
+ SummonFlameTimer = 20000;
+ SwitchTargetTimer = 90000;
+ PhaseSwitchTimer = 60000;
+ SummonVolcanoTimer = 5000;
+ BerserkTimer = 900000; // 15 minute enrage
+
+ Phase1 = true;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+
+ if(pInstance)
+ pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS);
+ }
+
+ void ToggleDoors(bool close)
+ {
+ if(GameObject* Doors = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS)))
+ {
+ if(close) Doors->SetGoState(1); // Closed
+ else Doors->SetGoState(0); // Open
+ }
+ }
+
+ void JustDied(Unit *killer)
+ {
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_SUPREMUSEVENT, DONE);
+ ToggleDoors(false);
+ }
+ }
+
+ float CalculateRandomCoord(float initial)
+ {
+ float coord = 0;
+
+ switch(rand()%2)
+ {
+ case 0: coord = initial + 20 + rand()%20; break;
+ case 1: coord = initial - 20 - rand()%20; break;
+ }
+
+ return coord;
+ }
+
+ Creature* SummonCreature(uint32 entry, Unit* target)
+ {
+ if(target && entry)
+ {
+ Creature* Summon = m_creature->SummonCreature(entry, CalculateRandomCoord(target->GetPositionX()), CalculateRandomCoord(target->GetPositionY()), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 20000);
+ if(Summon)
+ {
+ Summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Summon->setFaction(m_creature->getFaction());
+ return Summon;
+ }
+ }
+ return NULL;
+ }
+
+ Unit* CalculateHurtfulStrikeTarget()
+ {
+ uint32 health = 0;
+ Unit* target = NULL;
+
+ std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list::iterator i = m_threatlist.begin();
+ for (i = m_threatlist.begin(); i!= m_threatlist.end();++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && m_creature->IsWithinDistInMap(pUnit, ATTACK_DISTANCE))
+ {
+ if(pUnit->GetHealth() > health)
+ {
+ health = pUnit->GetHealth();
+ target = pUnit;
+ }
+ }
+ }
+
+ return target;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(BerserkTimer < diff)
+ DoCast(m_creature, SPELL_BERSERK);
+ else BerserkTimer -= diff;
+
+ if(SummonFlameTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+
+ if(!target) // someone is trying to solo, set target as current victim.
+ target = m_creature->getVictim();
+
+ if(target)
+ {
+ Creature* MoltenFlame = SummonCreature(CREATURE_STALKER, target);
+ if(MoltenFlame)
+ {
+ // Invisible model
+ MoltenFlame->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ ((molten_flameAI*)MoltenFlame->AI())->SetSupremusGUID(m_creature->GetGUID());
+ ((molten_flameAI*)MoltenFlame->AI())->StalkTarget(target);
+ SummonFlameTimer = 20000;
+ }
+ }
+ }else SummonFlameTimer -= diff;
+
+ if(Phase1)
+ {
+ if(HurtfulStrikeTimer < diff)
+ {
+ Unit* target = CalculateHurtfulStrikeTarget();
+ if(target)
+ {
+ DoCast(target, SPELL_HURTFUL_STRIKE);
+ HurtfulStrikeTimer = 5000;
+ }
+ }else HurtfulStrikeTimer -= diff;
+ }
+
+ if(!Phase1)
+ {
+ if(SwitchTargetTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ DoResetThreat();
+ m_creature->AddThreat(target, 5000000.0f);
+ DoTextEmote("acquires a new target!", NULL);
+ SwitchTargetTimer = 10000;
+ }
+
+ }else SwitchTargetTimer -= diff;
+
+ if(SummonVolcanoTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target)
+ {
+ DoCast(target, SPELL_VOLCANIC_ERUPTION);
+ DoTextEmote("roars and the ground begins to crack open!", NULL);
+ SummonVolcanoTimer = 10000;
+ }
+ }else SummonVolcanoTimer -= diff;
+ }
+
+ if(PhaseSwitchTimer < diff)
+ {
+ if(!Phase1)
+ {
+ Phase1 = true;
+ DoResetThreat();
+ PhaseSwitchTimer = 60000;
+ m_creature->SetSpeed(MOVE_RUN, 1.0f);
+ DoZoneInCombat();
+ }
+ else
+ {
+ Phase1 = false;
+ DoResetThreat();
+ SwitchTargetTimer = 10000;
+ SummonVolcanoTimer = 2000;
+ PhaseSwitchTimer = 60000;
+ m_creature->SetSpeed(MOVE_RUN, 0.9f);
+ DoZoneInCombat();
+ }
+ }else PhaseSwitchTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_supremus(Creature *_Creature)
+{
+ return new boss_supremusAI (_Creature);
+}
+
+CreatureAI* GetAI_molten_flame(Creature *_Creature)
+{
+ return new molten_flameAI (_Creature);
+}
+
+CreatureAI* GetAI_npc_volcano(Creature *_Creature)
+{
+ return new npc_volcanoAI (_Creature);
+}
+
+void AddSC_boss_supremus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_supremus";
+ newscript->GetAI = GetAI_boss_supremus;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="molten_flame";
+ newscript->GetAI = GetAI_molten_flame;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_volcano";
+ newscript->GetAI = GetAI_npc_volcano;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp
index af97adb4ca7..00b29611d78 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp
@@ -1,589 +1,589 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Teron_Gorefiend
-SD%Complete: 60
-SDComment: Requires Mind Control support for Ghosts.
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-//Spells
-#define SPELL_INCINERATE 40239
-#define SPELL_CRUSHING_SHADOWS 40243
-#define SPELL_SHADOWBOLT 40185
-#define SPELL_PASSIVE_SHADOWFORM 40326
-#define SPELL_SHADOW_OF_DEATH 40251
-#define SPELL_BERSERK 45078
-
-#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player
-
-//Speech'n'sound
-#define SAY_INTRO "I was the first, you know. For me, the wheel of death has spun many times. So much time has passed. I have a lot of catching up to do..."
-#define SOUND_INTRO 11512
-
-#define SAY_AGGRO "Vengeance is mine!"
-#define SOUND_AGGRO 11513
-
-#define SAY_SLAY1 "I have use for you!"
-#define SOUND_SLAY1 11514
-
-#define SAY_SLAY2 "It gets worse..."
-#define SOUND_SLAY2 11515
-
-#define SAY_SPELL1 "What are you afraid of?"
-#define SOUND_SPELL1 11517
-
-#define SAY_SPELL2 "Death... really isn't so bad."
-#define SOUND_SPELL2 11516
-
-#define SAY_SPECIAL1 "Give in!"
-#define SOUND_SPECIAL1 11518
-
-#define SAY_SPECIAL2 "I have something for you..."
-#define SOUND_SPECIAL2 11519
-
-#define SAY_ENRAGE "YOU WILL SHOW THE PROPER RESPECT!"
-#define SOUND_ENRAGE 11520
-
-#define SAY_DEATH "The wheel...spins...again...."
-#define SOUND_DEATH 11521
-
-#define CREATURE_DOOM_BLOSSOM 23123
-#define CREATURE_SHADOWY_CONSTRUCT 23111
-
-struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI
-{
- mob_doom_blossomAI(Creature *c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint32 CheckTeronTimer;
- uint32 ShadowBoltTimer;
- uint64 TeronGUID;
-
- void Reset()
- {
- CheckTeronTimer = 5000;
- ShadowBoltTimer = 12000;
- TeronGUID = 0;
- }
-
- void Aggro(Unit *who) { }
- void AttackStart(Unit* who) { }
- void MoveInLineOfSight(Unit* who) { }
-
- void UpdateAI(const uint32 diff)
- {
- if(CheckTeronTimer < diff)
- {
- if(TeronGUID)
- {
- DoZoneInCombat();
-
- Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
- if((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- else
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-
- CheckTeronTimer = 5000;
- }else CheckTeronTimer -= diff;
-
- if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
- return;
-
- if(ShadowBoltTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT);
- ShadowBoltTimer = 10000;
- }else ShadowBoltTimer -= diff;
- }
-
- void SetTeronGUID(uint64 guid){ TeronGUID = guid; }
-};
-
-//This is used to sort the players by distance for Constructs to see who to cast Atrophy on
-struct TargetDistanceOrder : public std::binary_function
-{
- const Unit* MainTarget;
- TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
- // functor for operator "<"
- bool operator()(const Unit* _Left, const Unit* _Right) const
- {
- return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
- }
-};
-
-struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI
-{
- mob_shadowy_constructAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint64 GhostGUID;
- uint64 TeronGUID;
-
- uint32 CheckPlayerTimer;
- uint32 CheckTeronTimer;
-
- void Reset()
- {
- GhostGUID = 0;
- TeronGUID = 0;
-
- CheckPlayerTimer = 2000;
- CheckTeronTimer = 5000;
- }
-
- void Aggro(Unit* who) { }
-
- void MoveInLineOfSight(Unit *who)
- {
- if(!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID))
- return;
-
- if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- float attackRadius = m_creature->GetAttackDistance(who);
-
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- m_creature->AddThreat(who, 1.0f);
- }
- }
- }
-
-/* 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 CheckPlayers()
- {
- std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
- if(m_threatlist.empty())
- return; // No threat list. Don't continue.
- std::list::iterator itr = m_threatlist.begin();
- std::list targets;
- for( ; itr != m_threatlist.end(); ++itr)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
- if(pUnit && pUnit->isAlive())
- targets.push_back(pUnit);
- }
- targets.sort(TargetDistanceOrder(m_creature));
- Unit* target = targets.front();
- if(target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
- {
- DoCast(target, SPELL_ATROPHY);
- m_creature->AI()->AttackStart(target);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(CheckPlayerTimer < diff)
- {
- CheckPlayers();
- CheckPlayerTimer = 3000;
- }else CheckPlayerTimer -= diff;
-
- if(CheckTeronTimer < diff)
- {
- Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
- if(!Teron || !Teron->isAlive() || Teron->IsInEvadeMode())
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-
- CheckTeronTimer = 5000;
- }else CheckTeronTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
-{
- boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 IncinerateTimer;
- uint32 SummonDoomBlossomTimer;
- uint32 EnrageTimer;
- uint32 CrushingShadowsTimer;
- uint32 ShadowOfDeathTimer;
- uint32 SummonShadowsTimer;
- uint32 RandomYellTimer;
- uint32 AggroTimer;
-
- uint64 AggroTargetGUID;
- uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost
-
- bool Intro;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED);
-
- IncinerateTimer = 20000 + rand()%11000;
- SummonDoomBlossomTimer = 12000;
- EnrageTimer = 600000;
- CrushingShadowsTimer = 22000;
- SummonShadowsTimer = 60000;
- RandomYellTimer = 50000;
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Start off unattackable so that the intro is done properly
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- AggroTimer = 20000;
- AggroTargetGUID = 0;
- Intro = false;
- }
-
- void Aggro(Unit *who) {}
-
- void MoveInLineOfSight(Unit *who)
- {
- if(!who || (!who->isAlive())) return;
-
- if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- float attackRadius = m_creature->GetAttackDistance(who);
-
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- m_creature->AddThreat(who, 1.0f);
- }
-
- if(!InCombat && !Intro && m_creature->IsWithinDistInMap(who, 200.0f) && (who->GetTypeId() == TYPEID_PLAYER))
- {
- if(pInstance)
- pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS);
-
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoYell(SAY_INTRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_INTRO);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
- AggroTargetGUID = who->GetGUID();
- Intro = true;
- }
- }
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE);
-
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- float CalculateRandomLocation(float Loc, uint32 radius)
- {
- float coord = Loc;
- switch(rand()%2)
- {
- case 0:
- coord += rand()%radius;
- break;
- case 1:
- coord -= rand()%radius;
- break;
- }
- return coord;
- }
-
- void SetThreatList(Creature* Blossom)
- {
- if(!Blossom) return;
-
- std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
- std::list::iterator i = m_threatlist.begin();
- for(i = m_threatlist.begin(); i != m_threatlist.end(); i++)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && pUnit->isAlive())
- {
- float threat = m_creature->getThreatManager().getThreat(pUnit);
- Blossom->AddThreat(pUnit, threat);
- }
- }
- }
-
- 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((*m_creature), GhostGUID);
- if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH, 0))
- {
- /*float x,y,z;
- Ghost->GetPosition(x,y,z);
- Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
- if(control)
- {
- ((Player*)Ghost)->Possess(control);
- Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL,
- false);
- }*/
- for(uint8 i = 0; i < 4; ++i)
- {
- Creature* Construct = NULL;
- float X = CalculateRandomLocation(Ghost->GetPositionX(), 10);
- float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10);
- Construct = m_creature->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.
- ((mob_shadowy_constructAI*)Construct->AI())->GhostGUID = GhostGUID;
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target) // someone's trying to solo.
- target = m_creature->getVictim();
-
- if(target)
- Construct->GetMotionMaster()->MoveChase(target);
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(Intro)
- {
- if(AggroTimer < diff)
- {
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
- Intro = false;
- if(AggroTargetGUID)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID);
- if(pUnit)
- {
- m_creature->GetMotionMaster()->MoveChase(pUnit);
- AttackStart(pUnit);
- }
- DoZoneInCombat();
- }else EnterEvadeMode();
-
- }else AggroTimer -= diff;
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() || Intro)
- return;
-
- if(SummonShadowsTimer < diff)
- {
- //MindControlGhost();
-
- for(uint8 i = 0; i < 2; ++i)
- {
- Creature* Shadow = NULL;
- float X = CalculateRandomLocation(m_creature->GetPositionX(), 10);
- Shadow = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0);
- if(Shadow)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target)
- target = m_creature->getVictim();
-
- if(target)
- Shadow->AI()->AttackStart(target);
- }
- }
- SummonShadowsTimer = 60000;
- }else SummonShadowsTimer -= diff;
-
- if(SummonDoomBlossomTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target)
- {
- float X = CalculateRandomLocation(target->GetPositionX(), 20);
- float Y = CalculateRandomLocation(target->GetPositionY(), 20);
- Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
- if(DoomBlossom)
- {
- DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoomBlossom->setFaction(m_creature->getFaction());
- DoomBlossom->AddThreat(target, 1.0f);
- ((mob_doom_blossomAI*)DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID());
- ((mob_doom_blossomAI*)DoomBlossom->AI())->InCombat = true;
- SetThreatList(DoomBlossom);
- SummonDoomBlossomTimer = 35000;
- }
- }
- }else SummonDoomBlossomTimer -= diff;
-
- if(IncinerateTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target)
- target = m_creature->getVictim();
-
- if(target)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPECIAL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
- break;
- case 1:
- DoYell(SAY_SPECIAL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
- break;
- }
- DoCast(target, SPELL_INCINERATE);
- IncinerateTimer = 20000 + rand()%31 * 1000;
- }
- }else IncinerateTimer -= diff;
-
- if(CrushingShadowsTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && target->isAlive())
- DoCast(target, 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* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
-
- if(!target)
- target = m_creature->getVictim();
-
- if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
- {
- DoCast(target, SPELL_SHADOW_OF_DEATH);
- GhostGUID = target->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(RandomYellTimer < diff)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SPELL1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPELL1);
- break;
- case 1:
- DoYell(SAY_SPELL2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPELL2);
- break;
- }
- RandomYellTimer = 50000 + rand()%51 * 1000;
- }else RandomYellTimer -= diff;
-
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
- if(EnrageTimer < diff)
- {
- DoCast(m_creature, SPELL_BERSERK);
- DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }else EnrageTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_mob_doom_blossom(Creature *_Creature)
-{
- return new mob_doom_blossomAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_shadowy_construct(Creature *_Creature)
-{
- return new mob_shadowy_constructAI(_Creature);
-}
-
-CreatureAI* GetAI_boss_teron_gorefiend(Creature *_Creature)
-{
- return new boss_teron_gorefiendAI (_Creature);
-}
-
-void AddSC_boss_teron_gorefiend()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "mob_doom_blossom";
- newscript->GetAI = GetAI_mob_doom_blossom;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_shadowy_construct";
- newscript->GetAI = GetAI_mob_shadowy_construct;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_teron_gorefiend";
- newscript->GetAI = GetAI_boss_teron_gorefiend;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Teron_Gorefiend
+SD%Complete: 60
+SDComment: Requires Mind Control support for Ghosts.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+//Spells
+#define SPELL_INCINERATE 40239
+#define SPELL_CRUSHING_SHADOWS 40243
+#define SPELL_SHADOWBOLT 40185
+#define SPELL_PASSIVE_SHADOWFORM 40326
+#define SPELL_SHADOW_OF_DEATH 40251
+#define SPELL_BERSERK 45078
+
+#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player
+
+//Speech'n'sound
+#define SAY_INTRO "I was the first, you know. For me, the wheel of death has spun many times. So much time has passed. I have a lot of catching up to do..."
+#define SOUND_INTRO 11512
+
+#define SAY_AGGRO "Vengeance is mine!"
+#define SOUND_AGGRO 11513
+
+#define SAY_SLAY1 "I have use for you!"
+#define SOUND_SLAY1 11514
+
+#define SAY_SLAY2 "It gets worse..."
+#define SOUND_SLAY2 11515
+
+#define SAY_SPELL1 "What are you afraid of?"
+#define SOUND_SPELL1 11517
+
+#define SAY_SPELL2 "Death... really isn't so bad."
+#define SOUND_SPELL2 11516
+
+#define SAY_SPECIAL1 "Give in!"
+#define SOUND_SPECIAL1 11518
+
+#define SAY_SPECIAL2 "I have something for you..."
+#define SOUND_SPECIAL2 11519
+
+#define SAY_ENRAGE "YOU WILL SHOW THE PROPER RESPECT!"
+#define SOUND_ENRAGE 11520
+
+#define SAY_DEATH "The wheel...spins...again...."
+#define SOUND_DEATH 11521
+
+#define CREATURE_DOOM_BLOSSOM 23123
+#define CREATURE_SHADOWY_CONSTRUCT 23111
+
+struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI
+{
+ mob_doom_blossomAI(Creature *c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint32 CheckTeronTimer;
+ uint32 ShadowBoltTimer;
+ uint64 TeronGUID;
+
+ void Reset()
+ {
+ CheckTeronTimer = 5000;
+ ShadowBoltTimer = 12000;
+ TeronGUID = 0;
+ }
+
+ void Aggro(Unit *who) { }
+ void AttackStart(Unit* who) { }
+ void MoveInLineOfSight(Unit* who) { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(CheckTeronTimer < diff)
+ {
+ if(TeronGUID)
+ {
+ DoZoneInCombat();
+
+ Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
+ if((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ else
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ CheckTeronTimer = 5000;
+ }else CheckTeronTimer -= diff;
+
+ if(!m_creature->getVictim() || !m_creature->SelectHostilTarget())
+ return;
+
+ if(ShadowBoltTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT);
+ ShadowBoltTimer = 10000;
+ }else ShadowBoltTimer -= diff;
+ }
+
+ void SetTeronGUID(uint64 guid){ TeronGUID = guid; }
+};
+
+//This is used to sort the players by distance for Constructs to see who to cast Atrophy on
+struct TargetDistanceOrder : public std::binary_function
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator "<"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI
+{
+ mob_shadowy_constructAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint64 GhostGUID;
+ uint64 TeronGUID;
+
+ uint32 CheckPlayerTimer;
+ uint32 CheckTeronTimer;
+
+ void Reset()
+ {
+ GhostGUID = 0;
+ TeronGUID = 0;
+
+ CheckPlayerTimer = 2000;
+ CheckTeronTimer = 5000;
+ }
+
+ void Aggro(Unit* who) { }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID))
+ return;
+
+ if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ float attackRadius = m_creature->GetAttackDistance(who);
+
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ m_creature->AddThreat(who, 1.0f);
+ }
+ }
+ }
+
+/* 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 CheckPlayers()
+ {
+ std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
+ if(m_threatlist.empty())
+ return; // No threat list. Don't continue.
+ std::list::iterator itr = m_threatlist.begin();
+ std::list targets;
+ for( ; itr != m_threatlist.end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ if(pUnit && pUnit->isAlive())
+ targets.push_back(pUnit);
+ }
+ targets.sort(TargetDistanceOrder(m_creature));
+ Unit* target = targets.front();
+ if(target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
+ {
+ DoCast(target, SPELL_ATROPHY);
+ m_creature->AI()->AttackStart(target);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(CheckPlayerTimer < diff)
+ {
+ CheckPlayers();
+ CheckPlayerTimer = 3000;
+ }else CheckPlayerTimer -= diff;
+
+ if(CheckTeronTimer < diff)
+ {
+ Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
+ if(!Teron || !Teron->isAlive() || Teron->IsInEvadeMode())
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ CheckTeronTimer = 5000;
+ }else CheckTeronTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
+{
+ boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 IncinerateTimer;
+ uint32 SummonDoomBlossomTimer;
+ uint32 EnrageTimer;
+ uint32 CrushingShadowsTimer;
+ uint32 ShadowOfDeathTimer;
+ uint32 SummonShadowsTimer;
+ uint32 RandomYellTimer;
+ uint32 AggroTimer;
+
+ uint64 AggroTargetGUID;
+ uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost
+
+ bool Intro;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED);
+
+ IncinerateTimer = 20000 + rand()%11000;
+ SummonDoomBlossomTimer = 12000;
+ EnrageTimer = 600000;
+ CrushingShadowsTimer = 22000;
+ SummonShadowsTimer = 60000;
+ RandomYellTimer = 50000;
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Start off unattackable so that the intro is done properly
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ AggroTimer = 20000;
+ AggroTargetGUID = 0;
+ Intro = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!who || (!who->isAlive())) return;
+
+ if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ float attackRadius = m_creature->GetAttackDistance(who);
+
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ m_creature->AddThreat(who, 1.0f);
+ }
+
+ if(!InCombat && !Intro && m_creature->IsWithinDistInMap(who, 200.0f) && (who->GetTypeId() == TYPEID_PLAYER))
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS);
+
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoYell(SAY_INTRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_INTRO);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
+ AggroTargetGUID = who->GetGUID();
+ Intro = true;
+ }
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE);
+
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ float CalculateRandomLocation(float Loc, uint32 radius)
+ {
+ float coord = Loc;
+ switch(rand()%2)
+ {
+ case 0:
+ coord += rand()%radius;
+ break;
+ case 1:
+ coord -= rand()%radius;
+ break;
+ }
+ return coord;
+ }
+
+ void SetThreatList(Creature* Blossom)
+ {
+ if(!Blossom) return;
+
+ std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list::iterator i = m_threatlist.begin();
+ for(i = m_threatlist.begin(); i != m_threatlist.end(); i++)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && pUnit->isAlive())
+ {
+ float threat = m_creature->getThreatManager().getThreat(pUnit);
+ Blossom->AddThreat(pUnit, threat);
+ }
+ }
+ }
+
+ 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((*m_creature), GhostGUID);
+ if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH, 0))
+ {
+ /*float x,y,z;
+ Ghost->GetPosition(x,y,z);
+ Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
+ if(control)
+ {
+ ((Player*)Ghost)->Possess(control);
+ Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL,
+ false);
+ }*/
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Creature* Construct = NULL;
+ float X = CalculateRandomLocation(Ghost->GetPositionX(), 10);
+ float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10);
+ Construct = m_creature->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.
+ ((mob_shadowy_constructAI*)Construct->AI())->GhostGUID = GhostGUID;
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target) // someone's trying to solo.
+ target = m_creature->getVictim();
+
+ if(target)
+ Construct->GetMotionMaster()->MoveChase(target);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(Intro)
+ {
+ if(AggroTimer < diff)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ Intro = false;
+ if(AggroTargetGUID)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID);
+ if(pUnit)
+ {
+ m_creature->GetMotionMaster()->MoveChase(pUnit);
+ AttackStart(pUnit);
+ }
+ DoZoneInCombat();
+ }else EnterEvadeMode();
+
+ }else AggroTimer -= diff;
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() || Intro)
+ return;
+
+ if(SummonShadowsTimer < diff)
+ {
+ //MindControlGhost();
+
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ Creature* Shadow = NULL;
+ float X = CalculateRandomLocation(m_creature->GetPositionX(), 10);
+ Shadow = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0);
+ if(Shadow)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target)
+ Shadow->AI()->AttackStart(target);
+ }
+ }
+ SummonShadowsTimer = 60000;
+ }else SummonShadowsTimer -= diff;
+
+ if(SummonDoomBlossomTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ {
+ float X = CalculateRandomLocation(target->GetPositionX(), 20);
+ float Y = CalculateRandomLocation(target->GetPositionY(), 20);
+ Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
+ if(DoomBlossom)
+ {
+ DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoomBlossom->setFaction(m_creature->getFaction());
+ DoomBlossom->AddThreat(target, 1.0f);
+ ((mob_doom_blossomAI*)DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID());
+ ((mob_doom_blossomAI*)DoomBlossom->AI())->InCombat = true;
+ SetThreatList(DoomBlossom);
+ SummonDoomBlossomTimer = 35000;
+ }
+ }
+ }else SummonDoomBlossomTimer -= diff;
+
+ if(IncinerateTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPECIAL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
+ break;
+ case 1:
+ DoYell(SAY_SPECIAL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
+ break;
+ }
+ DoCast(target, SPELL_INCINERATE);
+ IncinerateTimer = 20000 + rand()%31 * 1000;
+ }
+ }else IncinerateTimer -= diff;
+
+ if(CrushingShadowsTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && target->isAlive())
+ DoCast(target, 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* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoCast(target, SPELL_SHADOW_OF_DEATH);
+ GhostGUID = target->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(RandomYellTimer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SPELL1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPELL1);
+ break;
+ case 1:
+ DoYell(SAY_SPELL2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPELL2);
+ break;
+ }
+ RandomYellTimer = 50000 + rand()%51 * 1000;
+ }else RandomYellTimer -= diff;
+
+ if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(EnrageTimer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ DoYell(SAY_ENRAGE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }else EnrageTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_doom_blossom(Creature *_Creature)
+{
+ return new mob_doom_blossomAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_shadowy_construct(Creature *_Creature)
+{
+ return new mob_shadowy_constructAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_teron_gorefiend(Creature *_Creature)
+{
+ return new boss_teron_gorefiendAI (_Creature);
+}
+
+void AddSC_boss_teron_gorefiend()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "mob_doom_blossom";
+ newscript->GetAI = GetAI_mob_doom_blossom;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_shadowy_construct";
+ newscript->GetAI = GetAI_mob_shadowy_construct;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_teron_gorefiend";
+ newscript->GetAI = GetAI_boss_teron_gorefiend;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
index 7ab12293b0f..685810151c6 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
@@ -1,269 +1,269 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Warlord_Najentus
-SD%Complete: 95
-SDComment:
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-//Aggro
-#define SAY_AGGRO "You will die, in the name of Lady Vashj!"
-#define SOUND_AGGRO 11450
-
-//Needle (Random)
-#define SAY_NEEDLE1 "Stick around!"
-#define SOUND_NEEDLE1 11451
-
-#define SAY_NEEDLE2 "I'll deal with you later!"
-#define SOUND_NEEDLE2 11452
-
-//Slay
-#define SAY_SLAY1 "Your success was short lived!"
-#define SOUND_SLAY1 11455
-
-#define SAY_SLAY2 "Time for you to go!"
-#define SOUND_SLAY2 11456
-
-//Special
-#define SAY_SPECIAL1 "Bel'anen dal'lorei!"
-#define SOUND_SPECIAL1 11453
-
-#define SAY_SPECIAL2 "Blood will flow!"
-#define SOUND_SPECIAL2 11454
-
-//Enrage
-#define SAY_ENRAGE "My patience has ran out! Die, DIE!"
-#define SOUND_ENRAGE 11458
-
-//Death
-#define SAY_DEATH "Lord Illidan will... crush you."
-#define SOUND_DEATH 11459
-
-//Spells
-#define SPELL_NEEDLE_SPINE 39835
-#define SPELL_NEEDLE_AOE 39968
-#define SPELL_TIDAL_BURST 39878
-#define SPELL_TIDAL_SHIELD 39872
-#define SPELL_IMPALING_SPINE 39837
-#define SPELL_CREATE_NAJENTUS_SPINE 39956
-#define SPELL_HURL_SPINE 39948
-#define SPELL_BERSERK 45078
-
-#define GOBJECT_SPINE 185584
-
-struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
-{
- boss_najentusAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 NeedleSpineTimer;
- uint32 EnrageTimer;
- uint32 SpecialYellTimer;
- uint32 TidalShieldTimer;
- uint32 ImpalingSpineTimer;
-
- uint64 SpineTargetGUID;
-
- void Reset()
- {
- EnrageTimer = 480000;
- SpecialYellTimer = 45000 + (rand()%76)*1000;
-
- ResetTimer();
-
- SpineTargetGUID = 0;
-
- if(pInstance)
- pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- if(pInstance)
- pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE);
-
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
- }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if(spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD, 0))
- {
- m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
- m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true);
- ResetTimer();
- }
- }
-
- void Aggro(Unit *who)
- {
- if(pInstance)
- pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS);
-
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- DoZoneInCombat();
- }
-
- bool RemoveImpalingSpine()
- {
- if(!SpineTargetGUID) return false;
- Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID);
- if(target && target->HasAura(SPELL_IMPALING_SPINE, 1))
- target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
- SpineTargetGUID=0;
- return true;
- }
-
- void ResetTimer(uint32 inc = 0)
- {
- NeedleSpineTimer = 10000 + inc;
- TidalShieldTimer = 60000 + inc;
- ImpalingSpineTimer = 20000 + inc;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(TidalShieldTimer < diff)
- {
- m_creature->CastSpell(m_creature, SPELL_TIDAL_SHIELD, true);
- ResetTimer(45000);
- }else TidalShieldTimer -= diff;
-
- if(EnrageTimer < diff)
- {
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
- EnrageTimer = 600000;
- }else EnrageTimer -= diff;
-
- // Needle
- if(NeedleSpineTimer < diff)
- {
- for(uint8 i = 0; i < 3; ++i)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- m_creature->CastSpell(target, SPELL_NEEDLE_SPINE, true);
- }
- NeedleSpineTimer = 30000;
- }else NeedleSpineTimer -= diff;
-
- if(SpecialYellTimer < diff)
- {
- switch(rand()%2)
- {
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
- break;
- case 1:
- DoYell(SAY_SPECIAL2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
- break;
- }
- SpecialYellTimer = 25000 + (rand()%76)*1000;
- }else SpecialYellTimer -= diff;
-
- if(ImpalingSpineTimer < diff)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(!target) target = m_creature->getVictim();
- if(target)
- {
- m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true);
- SpineTargetGUID = target->GetGUID();
- //must let target summon, otherwise you cannot click the spine
- target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30);
-
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_NEEDLE1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NEEDLE1);
- break;
- case 1:
- DoYell(SAY_NEEDLE2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_NEEDLE2);
- break;
- }
- ImpalingSpineTimer = 21000;
- }
- }else ImpalingSpineTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-bool GOHello_go_najentus_spine(Player *player, GameObject* _GO)
-{
- if(ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData())
- if(Creature* Najentus = (Creature*)Unit::GetUnit(*_GO, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS)))
- if(((boss_najentusAI*)Najentus->AI())->RemoveImpalingSpine())
- {
- player->CastSpell(player, SPELL_CREATE_NAJENTUS_SPINE, true);
- _GO->SetLootState(GO_NOT_READY);
- _GO->SetRespawnTime(0);
- }
- return true;
-}
-
-CreatureAI* GetAI_boss_najentus(Creature *_Creature)
-{
- return new boss_najentusAI (_Creature);
-}
-
-void AddSC_boss_najentus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_najentus";
- newscript->GetAI = GetAI_boss_najentus;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "go_najentus_spine";
- newscript->pGOHello = &GOHello_go_najentus_spine;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Warlord_Najentus
+SD%Complete: 95
+SDComment:
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+//Aggro
+#define SAY_AGGRO "You will die, in the name of Lady Vashj!"
+#define SOUND_AGGRO 11450
+
+//Needle (Random)
+#define SAY_NEEDLE1 "Stick around!"
+#define SOUND_NEEDLE1 11451
+
+#define SAY_NEEDLE2 "I'll deal with you later!"
+#define SOUND_NEEDLE2 11452
+
+//Slay
+#define SAY_SLAY1 "Your success was short lived!"
+#define SOUND_SLAY1 11455
+
+#define SAY_SLAY2 "Time for you to go!"
+#define SOUND_SLAY2 11456
+
+//Special
+#define SAY_SPECIAL1 "Bel'anen dal'lorei!"
+#define SOUND_SPECIAL1 11453
+
+#define SAY_SPECIAL2 "Blood will flow!"
+#define SOUND_SPECIAL2 11454
+
+//Enrage
+#define SAY_ENRAGE "My patience has ran out! Die, DIE!"
+#define SOUND_ENRAGE 11458
+
+//Death
+#define SAY_DEATH "Lord Illidan will... crush you."
+#define SOUND_DEATH 11459
+
+//Spells
+#define SPELL_NEEDLE_SPINE 39835
+#define SPELL_NEEDLE_AOE 39968
+#define SPELL_TIDAL_BURST 39878
+#define SPELL_TIDAL_SHIELD 39872
+#define SPELL_IMPALING_SPINE 39837
+#define SPELL_CREATE_NAJENTUS_SPINE 39956
+#define SPELL_HURL_SPINE 39948
+#define SPELL_BERSERK 45078
+
+#define GOBJECT_SPINE 185584
+
+struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
+{
+ boss_najentusAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 NeedleSpineTimer;
+ uint32 EnrageTimer;
+ uint32 SpecialYellTimer;
+ uint32 TidalShieldTimer;
+ uint32 ImpalingSpineTimer;
+
+ uint64 SpineTargetGUID;
+
+ void Reset()
+ {
+ EnrageTimer = 480000;
+ SpecialYellTimer = 45000 + (rand()%76)*1000;
+
+ ResetTimer();
+
+ SpineTargetGUID = 0;
+
+ if(pInstance)
+ pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE);
+
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if(spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD, 0))
+ {
+ m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
+ m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true);
+ ResetTimer();
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS);
+
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ DoZoneInCombat();
+ }
+
+ bool RemoveImpalingSpine()
+ {
+ if(!SpineTargetGUID) return false;
+ Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID);
+ if(target && target->HasAura(SPELL_IMPALING_SPINE, 1))
+ target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
+ SpineTargetGUID=0;
+ return true;
+ }
+
+ void ResetTimer(uint32 inc = 0)
+ {
+ NeedleSpineTimer = 10000 + inc;
+ TidalShieldTimer = 60000 + inc;
+ ImpalingSpineTimer = 20000 + inc;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(TidalShieldTimer < diff)
+ {
+ m_creature->CastSpell(m_creature, SPELL_TIDAL_SHIELD, true);
+ ResetTimer(45000);
+ }else TidalShieldTimer -= diff;
+
+ if(EnrageTimer < diff)
+ {
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
+ EnrageTimer = 600000;
+ }else EnrageTimer -= diff;
+
+ // Needle
+ if(NeedleSpineTimer < diff)
+ {
+ for(uint8 i = 0; i < 3; ++i)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ m_creature->CastSpell(target, SPELL_NEEDLE_SPINE, true);
+ }
+ NeedleSpineTimer = 30000;
+ }else NeedleSpineTimer -= diff;
+
+ if(SpecialYellTimer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL1);
+ break;
+ case 1:
+ DoYell(SAY_SPECIAL2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SPECIAL2);
+ break;
+ }
+ SpecialYellTimer = 25000 + (rand()%76)*1000;
+ }else SpecialYellTimer -= diff;
+
+ if(ImpalingSpineTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target) target = m_creature->getVictim();
+ if(target)
+ {
+ m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true);
+ SpineTargetGUID = target->GetGUID();
+ //must let target summon, otherwise you cannot click the spine
+ target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30);
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_NEEDLE1, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_NEEDLE1);
+ break;
+ case 1:
+ DoYell(SAY_NEEDLE2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_NEEDLE2);
+ break;
+ }
+ ImpalingSpineTimer = 21000;
+ }
+ }else ImpalingSpineTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+bool GOHello_go_najentus_spine(Player *player, GameObject* _GO)
+{
+ if(ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData())
+ if(Creature* Najentus = (Creature*)Unit::GetUnit(*_GO, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS)))
+ if(((boss_najentusAI*)Najentus->AI())->RemoveImpalingSpine())
+ {
+ player->CastSpell(player, SPELL_CREATE_NAJENTUS_SPINE, true);
+ _GO->SetLootState(GO_NOT_READY);
+ _GO->SetRespawnTime(0);
+ }
+ return true;
+}
+
+CreatureAI* GetAI_boss_najentus(Creature *_Creature)
+{
+ return new boss_najentusAI (_Creature);
+}
+
+void AddSC_boss_najentus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_najentus";
+ newscript->GetAI = GetAI_boss_najentus;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "go_najentus_spine";
+ newscript->pGOHello = &GOHello_go_najentus_spine;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h b/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h
index 3b48c6f7755..53e099f7835 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h
+++ b/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h
@@ -1,34 +1,34 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_BLACK_TEMPLE_H
-#define DEF_BLACK_TEMPLE_H
-
-#define DATA_AKAMA 1
-#define DATA_AKAMA_SHADE 2
-#define DATA_GURTOGGBLOODBOILEVENT 3
-#define DATA_HIGHWARLORDNAJENTUS 4
-#define DATA_HIGHWARLORDNAJENTUSEVENT 5
-#define DATA_ILLIDANSTORMRAGE 6
-#define DATA_ILLIDANSTORMRAGEEVENT 7
-#define DATA_ILLIDARICOUNCILEVENT 8
-#define DATA_ILLIDARICOUNCIL 9
-#define DATA_LADYMALANDE 10
-#define DATA_HIGHNETHERMANCERZEREVOR 11
-#define DATA_GATHIOSTHESHATTERER 12
-#define DATA_VERASDARKSHADOW 13
-#define DATA_MOTHERSHAHRAZEVENT 14
-#define DATA_RELIQUARYOFSOULSEVENT 15
-#define DATA_SHADEOFAKAMA 16
-#define DATA_SHADEOFAKAMAEVENT 17
-#define DATA_SUPREMUS 18
-#define DATA_SUPREMUSEVENT 19
-#define DATA_TERONGOREFIENDEVENT 20
-#define DATA_GAMEOBJECT_NAJENTUS_GATE 21
-#define DATA_GAMEOBJECT_ILLIDAN_GATE 22
-#define DATA_GAMEOBJECT_ILLIDAN_DOOR_R 23
-#define DATA_GAMEOBJECT_ILLIDAN_DOOR_L 24
-#define DATA_GAMEOBJECT_SUPREMUS_DOORS 25
-#define DATA_BLOOD_ELF_COUNCIL_VOICE 26
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_BLACK_TEMPLE_H
+#define DEF_BLACK_TEMPLE_H
+
+#define DATA_AKAMA 1
+#define DATA_AKAMA_SHADE 2
+#define DATA_GURTOGGBLOODBOILEVENT 3
+#define DATA_HIGHWARLORDNAJENTUS 4
+#define DATA_HIGHWARLORDNAJENTUSEVENT 5
+#define DATA_ILLIDANSTORMRAGE 6
+#define DATA_ILLIDANSTORMRAGEEVENT 7
+#define DATA_ILLIDARICOUNCILEVENT 8
+#define DATA_ILLIDARICOUNCIL 9
+#define DATA_LADYMALANDE 10
+#define DATA_HIGHNETHERMANCERZEREVOR 11
+#define DATA_GATHIOSTHESHATTERER 12
+#define DATA_VERASDARKSHADOW 13
+#define DATA_MOTHERSHAHRAZEVENT 14
+#define DATA_RELIQUARYOFSOULSEVENT 15
+#define DATA_SHADEOFAKAMA 16
+#define DATA_SHADEOFAKAMAEVENT 17
+#define DATA_SUPREMUS 18
+#define DATA_SUPREMUSEVENT 19
+#define DATA_TERONGOREFIENDEVENT 20
+#define DATA_GAMEOBJECT_NAJENTUS_GATE 21
+#define DATA_GAMEOBJECT_ILLIDAN_GATE 22
+#define DATA_GAMEOBJECT_ILLIDAN_DOOR_R 23
+#define DATA_GAMEOBJECT_ILLIDAN_DOOR_L 24
+#define DATA_GAMEOBJECT_SUPREMUS_DOORS 25
+#define DATA_BLOOD_ELF_COUNCIL_VOICE 26
+#endif
diff --git a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
index 18f991148d5..13f30cf37da 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
@@ -1,885 +1,885 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Illidari_Council
-SD%Complete: 95
-SDComment: Circle of Healing not working properly.
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-// High Nethermancer Zerevor's spells
-#define SPELL_FLAMESTRIKE 41481
-#define SPELL_BLIZZARD 41482
-#define SPELL_ARCANE_BOLT 41483
-#define SPELL_ARCANE_EXPLOSION 41524
-#define SPELL_DAMPEN_MAGIC 41478
-
-// Lady Malande's spells
-#define SPELL_EMPOWERED_SMITE 41471
-#define SPELL_CIRCLE_OF_HEALING 41455
-#define SPELL_REFLECTIVE_SHIELD 41475
-#define SPELL_DIVINE_WRATH 41472
-#define SPELL_HEAL_VISUAL 24171
-
-// Gathios the Shatterer's spells
-#define SPELL_BLESS_PROTECTION 41450
-#define SPELL_BLESS_SPELLWARD 41451
-#define SPELL_CONSECRATION 41541
-#define SPELL_HAMMER_OF_JUSTICE 41468
-#define SPELL_SEAL_OF_COMMAND 41469
-#define SPELL_SEAL_OF_BLOOD 41459
-#define SPELL_CHROMATIC_AURA 41453
-#define SPELL_DEVOTION_AURA 41452
-
-// Veras Darkshadow's spells
-#define SPELL_DEADLY_POISON 41485
-#define SPELL_ENVENOM 41487
-#define SPELL_VANISH 41479
-
-#define SPELL_BERSERK 45078
-
-//Speech'n'Sounds
-#define SAY_GATH_AGGRO "I have better things to do!"
-#define SOUND_GATH_AGGRO 11422
-#define SAY_GATH_SLAY "Selama am'oronor!"
-#define SOUND_GATH_SLAY 11423
-#define SAY_GATH_COMNT "Well done!"
-#define SOUND_GATH_COMNT 11424
-#define SAY_GATH_DEATH "Lord Illidan... I..."
-#define SOUND_GATH_DEATH 11425
-#define SAY_GATH_SPECIAL1 "Enjoy your final moments!"
-#define SOUND_GATH_SPECIAL1 11426
-#define SAY_GATH_SPECIAL2 "You are mine!"
-#define SOUND_GATH_SPECIAL2 11427
-
-#define SAY_MALA_AGGRO "Flee, or die!"
-#define SOUND_MALA_AGGRO 11482
-#define SAY_MALA_SLAY "My work is done."
-#define SOUND_MALA_SLAY 11483
-#define SAY_MALA_COMNT "As it should be!"
-#define SOUND_MALA_COMNT 11484
-#define SAY_MALA_DEATH "Destiny... awaits."
-#define SOUND_MALA_DEATH 11485
-#define SAY_MALA_SPECIAL1 "No second chances!"
-#define SOUND_MALA_SPECIAL1 11486
-#define SAY_MALA_SPECIAL2 "I'm full of surprises!"
-#define SOUND_MALA_SPECIAL2 11487
-
-#define SAY_ZERE_AGGRO "Common... such a crude language. Bandal!"
-#define SOUND_ZERE_AGGRO 11440
-#define SAY_ZERE_SLAY "Shorel'aran."
-#define SOUND_ZERE_SLAY 11441
-#define SAY_ZERE_COMNT "Belesa menoor!"
-#define SOUND_ZERE_COMNT 11442
-#define SAY_ZERE_DEATH "Diel ma'ahn... oreindel'o"
-#define SOUND_ZERE_DEATH 11443
-#define SAY_ZERE_SPECIAL1 "Diel fin'al"
-#define SOUND_ZERE_SPECIAL1 11444
-#define SAY_ZERE_SPECIAL2 "Sha'amoor ara mashal?"
-#define SOUND_ZERE_SPECIAL2 11445
-
-#define SAY_VERA_AGGRO "You wish to test me?"
-#define SOUND_VERA_AGGRO 11524
-#define SAY_VERA_SLAY "Valiant effort!"
-#define SOUND_VERA_SLAY 11525
-#define SAY_VERA_COMNT "A glorious kill!"
-#define SOUND_VERA_COMNT 11526
-#define SAY_VERA_DEATH "You got lucky!"
-#define SOUND_VERA_DEATH 11527
-#define SAY_VERA_SPECIAL1 "You're not caught up for this!"
-#define SOUND_VERA_SPECIAL1 11528
-#define SAY_VERA_SPECIAL2 "Anar'alah belore!"
-#define SOUND_VERA_SPECIAL2 11529
-
-#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly."
-
-struct CouncilYells
-{
- char* text;
- uint32 soundId, timer;
-};
-
-static CouncilYells CouncilAggro[]=
-{
- {"I have better things to do!", 11422, 5000}, // Gathios
- {"You wish to test me?", 11524, 5500}, // Veras
- {"Flee, or die!", 11482, 5000}, // Malande
- {"Common... such a crude language. Bandal!", 11440, 0}, // Zerevor
-};
-
-// Need to get proper timers for this later
-static CouncilYells CouncilEnrage[]=
-{
- {"Enough games!", 11428, 2000}, // Gathios
- {"You wish to kill me? Hahaha, you first!", 11530, 6000},//Veras
- {"For Quel'Thalas! For the Sunwell!", 11488, 5000}, // Malande
- {"Sha'amoor sine menoor!", 11446, 0}, // Zerevor
-};
-
-struct TRINITY_DLL_DECL 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;
- Reset();
- }
-
- uint64 Council[4];
-
- uint32 EnrageTimer;
- uint32 AggroYellTimer;
-
- uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells
-
- bool EventStarted;
-
- void Reset()
- {
- EnrageTimer = 900000; // 15 minutes
- AggroYellTimer = 500;
-
- YellCounter = 0;
-
- EventStarted = false;
- }
-
- // finds and stores the GUIDs for each Council member using instance data system.
- void LoadCouncilGUIDs()
- {
- if(ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()))
- {
- 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 error_log(ERROR_INST_DATA);
- }
-
- void Aggro(Unit* who) {}
-
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
-
- void UpdateAI(const uint32 diff)
- {
- if(!EventStarted)
- return;
-
- if(YellCounter > 3)
- return;
-
- if(AggroYellTimer)
- if(AggroYellTimer <= diff)
- {
- if(Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter]))
- {
- pMember->MonsterYell(CouncilAggro[YellCounter].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(pMember, CouncilAggro[YellCounter].soundId);
- AggroYellTimer = CouncilAggro[YellCounter].timer;
- }
- ++YellCounter;
- if(YellCounter > 3)
- YellCounter = 0; // Reuse for Enrage Yells
- }else AggroYellTimer -= diff;
-
- if(EnrageTimer)
- if(EnrageTimer <= diff)
- {
- if(Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter]))
- {
- pMember->CastSpell(pMember, SPELL_BERSERK, true);
- pMember->MonsterYell(CouncilEnrage[YellCounter].text, LANG_UNIVERSAL, 0);
- DoPlaySoundToSet(pMember, CouncilEnrage[YellCounter].soundId);
- EnrageTimer = CouncilEnrage[YellCounter].timer;
- }
- ++YellCounter;
- }else EnrageTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
-{
- mob_illidari_councilAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- for(uint8 i = 0; i < 4; ++i)
- Council[i] = 0;
-
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint64 Council[4];
-
- uint32 CheckTimer;
- uint32 EndEventTimer;
-
- uint8 DeathCount;
-
- bool EventBegun;
-
- void Reset()
- {
- CheckTimer = 2000;
- EndEventTimer = 0;
-
- DeathCount = 0;
-
- Creature* pMember = NULL;
- for(uint8 i = 0; i < 4; ++i)
- {
- if(pMember = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
- {
- if(!pMember->isAlive())
- {
- pMember->RemoveCorpse();
- pMember->Respawn();
- }
- pMember->AI()->EnterEvadeMode();
- }
- }
-
- if(pInstance)
- {
- pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED);
- if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
- VoiceTrigger->AI()->EnterEvadeMode();
- }
-
- EventBegun = false;
-
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- }
-
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
-
- void StartEvent(Unit *target)
- {
- if(!pInstance) return;
-
- if(target && target->isAlive())
- {
- 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 = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
- {
- ((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->LoadCouncilGUIDs();
- ((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->EventStarted = true;
- }
-
- for(uint8 i = 0; i < 4; ++i)
- {
- Unit* Member = NULL;
- if(Council[i])
- {
- Member = Unit::GetUnit((*m_creature), Council[i]);
- if(Member && Member->isAlive())
- Member->AddThreat(target, 1.0f);
- }
- }
-
- pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS);
-
- EventBegun = true;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!EventBegun) return;
-
- if(EndEventTimer)
- if(EndEventTimer <= diff)
- {
- if(DeathCount > 3)
- {
- if(pInstance)
- {
- if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, 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);
- }
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- return;
- }
-
- Creature* pMember = ((Creature*)Unit::GetUnit(*m_creature, 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 = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
- {
- // This is the evade/death check.
- if(Member->isAlive() && !Member->SelectHostilTarget())
- ++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();
-
- CheckTimer = 2000;
- }else CheckTimer -= diff;
-
- }
-};
-
-struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI
-{
- boss_illidari_councilAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- for(uint8 i = 0; i < 4; ++i)
- Council[i] = 0;
- LoadedGUIDs = false;
- }
-
- uint64 Council[4];
-
- ScriptedInstance* pInstance;
-
- bool LoadedGUIDs;
-
- void Aggro(Unit* who)
- {
- if(pInstance)
- {
- Creature* Controller = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL)));
- if(Controller)
- ((mob_illidari_councilAI*)Controller->AI())->StartEvent(who);
- }
- else
- {
- error_log(ERROR_INST_DATA);
- EnterEvadeMode();
- }
- DoZoneInCombat();
- // Load GUIDs on first aggro because the creature guids are only set as the creatures are created in world-
- // this means that for each creature, it will attempt to LoadGUIDs even though some of the other creatures are
- // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures
- // have been loaded and have their GUIDs set in the instance data system.
- if(!LoadedGUIDs)
- LoadGUIDs();
- }
-
- void DamageTaken(Unit* done_by, uint32 &damage)
- {
- if(done_by == m_creature)
- return;
-
- damage /= 4;
- for(uint8 i = 0; i < 4; ++i)
- {
- if(Unit* pUnit = Unit::GetUnit(*m_creature, Council[i]))
- if(pUnit != m_creature && damage < pUnit->GetHealth())
- pUnit->SetHealth(pUnit->GetHealth() - damage);
- }
- }
-
- void LoadGUIDs()
- {
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- Council[0] = pInstance->GetData64(DATA_LADYMALANDE);
- Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
- Council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
- Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
-
- LoadedGUIDs = true;
- }
-};
-
-struct TRINITY_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_councilAI
-{
- boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
-
- uint32 ConsecrationTimer;
- uint32 HammerOfJusticeTimer;
- uint32 SealTimer;
- uint32 AuraTimer;
- uint32 BlessingTimer;
-
- void Reset()
- {
- ConsecrationTimer = 40000;
- HammerOfJusticeTimer = 10000;
- SealTimer = 40000;
- AuraTimer = 90000;
- BlessingTimer = 60000;
- }
-
- void KilledUnit(Unit *victim)
- {
- DoYell(SAY_GATH_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_GATH_SLAY);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_GATH_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_GATH_DEATH);
- }
-
- Unit* SelectCouncilMember()
- {
- Unit* pUnit = m_creature;
- 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);
-
- if(member != 2) // No need to create another pointer to us using Unit::GetUnit
- pUnit = Unit::GetUnit((*m_creature), Council[member]);
- return pUnit;
- }
-
- void CastAuraOnCouncil()
- {
- uint32 spellid = 0;
- switch(rand()%2)
- {
- case 0: spellid = SPELL_DEVOTION_AURA; break;
- case 1: spellid = SPELL_CHROMATIC_AURA; break;
- }
- for(uint8 i = 0; i < 4; ++i)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), Council[i]);
- if(pUnit)
- pUnit->CastSpell(pUnit, spellid, true, 0, 0, m_creature->GetGUID());
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(BlessingTimer < diff)
- {
- if(Unit* pUnit = SelectCouncilMember())
- {
- switch(rand()%2)
- {
- case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break;
- case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break;
- }
- }
- BlessingTimer = 60000;
- }else BlessingTimer -= diff;
-
- if(ConsecrationTimer < diff)
- {
- DoCast(m_creature, SPELL_CONSECRATION);
- ConsecrationTimer = 40000;
- }else ConsecrationTimer -= diff;
-
- if(HammerOfJusticeTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- // is in ~10-40 yd range
- if(m_creature->GetDistance2d(target) > 10 && m_creature->GetDistance2d(target) < 40)
- {
- DoCast(target, SPELL_HAMMER_OF_JUSTICE);
- HammerOfJusticeTimer = 20000;
- }
- }
- }else HammerOfJusticeTimer -= diff;
-
- if(SealTimer < diff)
- {
- switch(rand()%2)
- {
- case 0: DoCast(m_creature, SPELL_SEAL_OF_COMMAND); break;
- case 1: DoCast(m_creature, SPELL_SEAL_OF_BLOOD); break;
- }
- SealTimer = 40000;
- }else SealTimer -= diff;
-
- if(AuraTimer < diff)
- {
- CastAuraOnCouncil();
- AuraTimer = 90000;
- }else AuraTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI
-{
- boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
-
- uint32 BlizzardTimer;
- uint32 FlamestrikeTimer;
- uint32 ArcaneBoltTimer;
- uint32 DampenMagicTimer;
- uint32 Cooldown;
- uint32 ArcaneExplosionTimer;
-
- void Reset()
- {
- BlizzardTimer = 30000 + rand()%61 * 1000;
- FlamestrikeTimer = 30000 + rand()%61 * 1000;
- ArcaneBoltTimer = 10000;
- DampenMagicTimer = 2000;
- ArcaneExplosionTimer = 14000;
- Cooldown = 0;
- }
-
- void KilledUnit(Unit *victim)
- {
- DoYell(SAY_ZERE_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ZERE_SLAY);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_ZERE_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_ZERE_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(Cooldown)
- {
- if(Cooldown < diff) Cooldown = 0;
- else
- {
- Cooldown -= diff;
- return; // Don't cast any other spells if global cooldown is still ticking
- }
- }
-
- if(DampenMagicTimer < diff)
- {
- DoCast(m_creature, SPELL_DAMPEN_MAGIC);
- Cooldown = 1000;
- DampenMagicTimer = 110000; // almost 2 minutes
- ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen.
- }else DampenMagicTimer -= diff;
-
- if(ArcaneExplosionTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
- Cooldown = 1000;
- ArcaneExplosionTimer = 14000;
- }else ArcaneExplosionTimer -= diff;
-
- if(ArcaneBoltTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_ARCANE_BOLT);
- ArcaneBoltTimer = 3000;
- Cooldown = 2000;
- }else ArcaneBoltTimer -= diff;
-
- if(BlizzardTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_BLIZZARD);
- BlizzardTimer = 45000 + rand()%46 * 1000;
- FlamestrikeTimer += 10000;
- Cooldown = 1000;
- }
- }else BlizzardTimer -= diff;
-
- if(FlamestrikeTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_FLAMESTRIKE);
- FlamestrikeTimer = 55000 + rand()%46 * 1000;
- BlizzardTimer += 10000;
- Cooldown = 2000;
- }
- }else FlamestrikeTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI
-{
- boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
-
- uint32 EmpoweredSmiteTimer;
- uint32 CircleOfHealingTimer;
- uint32 DivineWrathTimer;
- uint32 ReflectiveShieldTimer;
-
- void Reset()
- {
- EmpoweredSmiteTimer = 38000;
- CircleOfHealingTimer = 20000;
- DivineWrathTimer = 40000;
- ReflectiveShieldTimer = 0;
- }
-
- void KilledUnit(Unit *victim)
- {
- DoYell(SAY_MALA_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_MALA_SLAY);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_MALA_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_MALA_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(EmpoweredSmiteTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_EMPOWERED_SMITE);
- EmpoweredSmiteTimer = 38000;
- }
- }else EmpoweredSmiteTimer -= diff;
-
- if(CircleOfHealingTimer < diff)
- {
- //Currently bugged and puts Malande on the threatlist of the other council members. It also heals players.
- //DoCast(m_creature, SPELL_CIRCLE_OF_HEALING);
- CircleOfHealingTimer = 60000;
- }else CircleOfHealingTimer -= diff;
-
- if(DivineWrathTimer < diff)
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_DIVINE_WRATH);
- DivineWrathTimer = 40000 + rand()%41 * 1000;
- }
- }else DivineWrathTimer -= diff;
-
- if(ReflectiveShieldTimer < diff)
- {
- DoCast(m_creature, SPELL_REFLECTIVE_SHIELD);
- ReflectiveShieldTimer = 65000;
- }else ReflectiveShieldTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-struct TRINITY_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI
-{
- boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
-
- uint64 EnvenomTargetGUID;
-
- uint32 DeadlyPoisonTimer;
- uint32 VanishTimer;
- uint32 AppearEnvenomTimer;
-
- bool HasVanished;
-
- void Reset()
- {
- EnvenomTargetGUID = 0;
-
- DeadlyPoisonTimer = 20000;
- VanishTimer = 60000 + rand()%61 * 1000;
- AppearEnvenomTimer = 150000;
-
- HasVanished = false;
- m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void KilledUnit(Unit *victim)
- {
- DoYell(SAY_VERA_SLAY,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_VERA_SLAY);
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_VERA_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_VERA_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(!HasVanished)
- {
- if(DeadlyPoisonTimer < diff)
- {
- DoCast(m_creature->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(m_creature->getVictim(), SPELL_ENVENOM);
- AppearEnvenomTimer = 90000;
- }else AppearEnvenomTimer -= diff;
-
- if(VanishTimer < diff) // Disappear and stop attacking, but follow a random unit
- {
- if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- {
- VanishTimer = 30000;
- AppearEnvenomTimer= 28000;
- HasVanished = true;
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoResetThreat();
- // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking
- m_creature->AddThreat(target, 500000.0f);
- m_creature->GetMotionMaster()->MoveChase(target);
- }
- }else VanishTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
- else
- {
- if(VanishTimer < diff) // Become attackable and poison current target
- {
- Unit* target = m_creature->getVictim();
- DoCast(target, SPELL_DEADLY_POISON);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoResetThreat();
- m_creature->AddThreat(target, 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)
- {
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- m_creature->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 *_Creature)
-{
- return new mob_illidari_councilAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_gathios_the_shatterer(Creature *_Creature)
-{
- return new boss_gathios_the_shattererAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_lady_malande(Creature *_Creature)
-{
- return new boss_lady_malandeAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_veras_darkshadow(Creature *_Creature)
-{
- return new boss_veras_darkshadowAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature *_Creature)
-{
- return new boss_high_nethermancer_zerevorAI (_Creature);
-}
-
-void AddSC_boss_illidari_council()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_illidari_council";
- newscript->GetAI = GetAI_mob_illidari_council;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_blood_elf_council_voice_trigger";
- newscript->GetAI = GetAI_mob_blood_elf_council_voice_trigger;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_gathios_the_shatterer";
- newscript->GetAI = GetAI_boss_gathios_the_shatterer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_lady_malande";
- newscript->GetAI = GetAI_boss_lady_malande;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_veras_darkshadow";
- newscript->GetAI = GetAI_boss_veras_darkshadow;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="boss_high_nethermancer_zerevor";
- newscript->GetAI = GetAI_boss_high_nethermancer_zerevor;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Illidari_Council
+SD%Complete: 95
+SDComment: Circle of Healing not working properly.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+// High Nethermancer Zerevor's spells
+#define SPELL_FLAMESTRIKE 41481
+#define SPELL_BLIZZARD 41482
+#define SPELL_ARCANE_BOLT 41483
+#define SPELL_ARCANE_EXPLOSION 41524
+#define SPELL_DAMPEN_MAGIC 41478
+
+// Lady Malande's spells
+#define SPELL_EMPOWERED_SMITE 41471
+#define SPELL_CIRCLE_OF_HEALING 41455
+#define SPELL_REFLECTIVE_SHIELD 41475
+#define SPELL_DIVINE_WRATH 41472
+#define SPELL_HEAL_VISUAL 24171
+
+// Gathios the Shatterer's spells
+#define SPELL_BLESS_PROTECTION 41450
+#define SPELL_BLESS_SPELLWARD 41451
+#define SPELL_CONSECRATION 41541
+#define SPELL_HAMMER_OF_JUSTICE 41468
+#define SPELL_SEAL_OF_COMMAND 41469
+#define SPELL_SEAL_OF_BLOOD 41459
+#define SPELL_CHROMATIC_AURA 41453
+#define SPELL_DEVOTION_AURA 41452
+
+// Veras Darkshadow's spells
+#define SPELL_DEADLY_POISON 41485
+#define SPELL_ENVENOM 41487
+#define SPELL_VANISH 41479
+
+#define SPELL_BERSERK 45078
+
+//Speech'n'Sounds
+#define SAY_GATH_AGGRO "I have better things to do!"
+#define SOUND_GATH_AGGRO 11422
+#define SAY_GATH_SLAY "Selama am'oronor!"
+#define SOUND_GATH_SLAY 11423
+#define SAY_GATH_COMNT "Well done!"
+#define SOUND_GATH_COMNT 11424
+#define SAY_GATH_DEATH "Lord Illidan... I..."
+#define SOUND_GATH_DEATH 11425
+#define SAY_GATH_SPECIAL1 "Enjoy your final moments!"
+#define SOUND_GATH_SPECIAL1 11426
+#define SAY_GATH_SPECIAL2 "You are mine!"
+#define SOUND_GATH_SPECIAL2 11427
+
+#define SAY_MALA_AGGRO "Flee, or die!"
+#define SOUND_MALA_AGGRO 11482
+#define SAY_MALA_SLAY "My work is done."
+#define SOUND_MALA_SLAY 11483
+#define SAY_MALA_COMNT "As it should be!"
+#define SOUND_MALA_COMNT 11484
+#define SAY_MALA_DEATH "Destiny... awaits."
+#define SOUND_MALA_DEATH 11485
+#define SAY_MALA_SPECIAL1 "No second chances!"
+#define SOUND_MALA_SPECIAL1 11486
+#define SAY_MALA_SPECIAL2 "I'm full of surprises!"
+#define SOUND_MALA_SPECIAL2 11487
+
+#define SAY_ZERE_AGGRO "Common... such a crude language. Bandal!"
+#define SOUND_ZERE_AGGRO 11440
+#define SAY_ZERE_SLAY "Shorel'aran."
+#define SOUND_ZERE_SLAY 11441
+#define SAY_ZERE_COMNT "Belesa menoor!"
+#define SOUND_ZERE_COMNT 11442
+#define SAY_ZERE_DEATH "Diel ma'ahn... oreindel'o"
+#define SOUND_ZERE_DEATH 11443
+#define SAY_ZERE_SPECIAL1 "Diel fin'al"
+#define SOUND_ZERE_SPECIAL1 11444
+#define SAY_ZERE_SPECIAL2 "Sha'amoor ara mashal?"
+#define SOUND_ZERE_SPECIAL2 11445
+
+#define SAY_VERA_AGGRO "You wish to test me?"
+#define SOUND_VERA_AGGRO 11524
+#define SAY_VERA_SLAY "Valiant effort!"
+#define SOUND_VERA_SLAY 11525
+#define SAY_VERA_COMNT "A glorious kill!"
+#define SOUND_VERA_COMNT 11526
+#define SAY_VERA_DEATH "You got lucky!"
+#define SOUND_VERA_DEATH 11527
+#define SAY_VERA_SPECIAL1 "You're not caught up for this!"
+#define SOUND_VERA_SPECIAL1 11528
+#define SAY_VERA_SPECIAL2 "Anar'alah belore!"
+#define SOUND_VERA_SPECIAL2 11529
+
+#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly."
+
+struct CouncilYells
+{
+ char* text;
+ uint32 soundId, timer;
+};
+
+static CouncilYells CouncilAggro[]=
+{
+ {"I have better things to do!", 11422, 5000}, // Gathios
+ {"You wish to test me?", 11524, 5500}, // Veras
+ {"Flee, or die!", 11482, 5000}, // Malande
+ {"Common... such a crude language. Bandal!", 11440, 0}, // Zerevor
+};
+
+// Need to get proper timers for this later
+static CouncilYells CouncilEnrage[]=
+{
+ {"Enough games!", 11428, 2000}, // Gathios
+ {"You wish to kill me? Hahaha, you first!", 11530, 6000},//Veras
+ {"For Quel'Thalas! For the Sunwell!", 11488, 5000}, // Malande
+ {"Sha'amoor sine menoor!", 11446, 0}, // Zerevor
+};
+
+struct TRINITY_DLL_DECL 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;
+ Reset();
+ }
+
+ uint64 Council[4];
+
+ uint32 EnrageTimer;
+ uint32 AggroYellTimer;
+
+ uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells
+
+ bool EventStarted;
+
+ void Reset()
+ {
+ EnrageTimer = 900000; // 15 minutes
+ AggroYellTimer = 500;
+
+ YellCounter = 0;
+
+ EventStarted = false;
+ }
+
+ // finds and stores the GUIDs for each Council member using instance data system.
+ void LoadCouncilGUIDs()
+ {
+ if(ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()))
+ {
+ 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 error_log(ERROR_INST_DATA);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!EventStarted)
+ return;
+
+ if(YellCounter > 3)
+ return;
+
+ if(AggroYellTimer)
+ if(AggroYellTimer <= diff)
+ {
+ if(Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter]))
+ {
+ pMember->MonsterYell(CouncilAggro[YellCounter].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(pMember, CouncilAggro[YellCounter].soundId);
+ AggroYellTimer = CouncilAggro[YellCounter].timer;
+ }
+ ++YellCounter;
+ if(YellCounter > 3)
+ YellCounter = 0; // Reuse for Enrage Yells
+ }else AggroYellTimer -= diff;
+
+ if(EnrageTimer)
+ if(EnrageTimer <= diff)
+ {
+ if(Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter]))
+ {
+ pMember->CastSpell(pMember, SPELL_BERSERK, true);
+ pMember->MonsterYell(CouncilEnrage[YellCounter].text, LANG_UNIVERSAL, 0);
+ DoPlaySoundToSet(pMember, CouncilEnrage[YellCounter].soundId);
+ EnrageTimer = CouncilEnrage[YellCounter].timer;
+ }
+ ++YellCounter;
+ }else EnrageTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
+{
+ mob_illidari_councilAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ for(uint8 i = 0; i < 4; ++i)
+ Council[i] = 0;
+
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint64 Council[4];
+
+ uint32 CheckTimer;
+ uint32 EndEventTimer;
+
+ uint8 DeathCount;
+
+ bool EventBegun;
+
+ void Reset()
+ {
+ CheckTimer = 2000;
+ EndEventTimer = 0;
+
+ DeathCount = 0;
+
+ Creature* pMember = NULL;
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ if(pMember = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
+ {
+ if(!pMember->isAlive())
+ {
+ pMember->RemoveCorpse();
+ pMember->Respawn();
+ }
+ pMember->AI()->EnterEvadeMode();
+ }
+ }
+
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED);
+ if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ VoiceTrigger->AI()->EnterEvadeMode();
+ }
+
+ EventBegun = false;
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+
+ void StartEvent(Unit *target)
+ {
+ if(!pInstance) return;
+
+ if(target && target->isAlive())
+ {
+ 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 = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
+ {
+ ((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->LoadCouncilGUIDs();
+ ((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->EventStarted = true;
+ }
+
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Unit* Member = NULL;
+ if(Council[i])
+ {
+ Member = Unit::GetUnit((*m_creature), Council[i]);
+ if(Member && Member->isAlive())
+ Member->AddThreat(target, 1.0f);
+ }
+ }
+
+ pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS);
+
+ EventBegun = true;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!EventBegun) return;
+
+ if(EndEventTimer)
+ if(EndEventTimer <= diff)
+ {
+ if(DeathCount > 3)
+ {
+ if(pInstance)
+ {
+ if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, 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);
+ }
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ return;
+ }
+
+ Creature* pMember = ((Creature*)Unit::GetUnit(*m_creature, 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 = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
+ {
+ // This is the evade/death check.
+ if(Member->isAlive() && !Member->SelectHostilTarget())
+ ++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();
+
+ CheckTimer = 2000;
+ }else CheckTimer -= diff;
+
+ }
+};
+
+struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI
+{
+ boss_illidari_councilAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ for(uint8 i = 0; i < 4; ++i)
+ Council[i] = 0;
+ LoadedGUIDs = false;
+ }
+
+ uint64 Council[4];
+
+ ScriptedInstance* pInstance;
+
+ bool LoadedGUIDs;
+
+ void Aggro(Unit* who)
+ {
+ if(pInstance)
+ {
+ Creature* Controller = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL)));
+ if(Controller)
+ ((mob_illidari_councilAI*)Controller->AI())->StartEvent(who);
+ }
+ else
+ {
+ error_log(ERROR_INST_DATA);
+ EnterEvadeMode();
+ }
+ DoZoneInCombat();
+ // Load GUIDs on first aggro because the creature guids are only set as the creatures are created in world-
+ // this means that for each creature, it will attempt to LoadGUIDs even though some of the other creatures are
+ // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures
+ // have been loaded and have their GUIDs set in the instance data system.
+ if(!LoadedGUIDs)
+ LoadGUIDs();
+ }
+
+ void DamageTaken(Unit* done_by, uint32 &damage)
+ {
+ if(done_by == m_creature)
+ return;
+
+ damage /= 4;
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ if(Unit* pUnit = Unit::GetUnit(*m_creature, Council[i]))
+ if(pUnit != m_creature && damage < pUnit->GetHealth())
+ pUnit->SetHealth(pUnit->GetHealth() - damage);
+ }
+ }
+
+ void LoadGUIDs()
+ {
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ Council[0] = pInstance->GetData64(DATA_LADYMALANDE);
+ Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
+ Council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
+ Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
+
+ LoadedGUIDs = true;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_councilAI
+{
+ boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
+
+ uint32 ConsecrationTimer;
+ uint32 HammerOfJusticeTimer;
+ uint32 SealTimer;
+ uint32 AuraTimer;
+ uint32 BlessingTimer;
+
+ void Reset()
+ {
+ ConsecrationTimer = 40000;
+ HammerOfJusticeTimer = 10000;
+ SealTimer = 40000;
+ AuraTimer = 90000;
+ BlessingTimer = 60000;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoYell(SAY_GATH_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_GATH_SLAY);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_GATH_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_GATH_DEATH);
+ }
+
+ Unit* SelectCouncilMember()
+ {
+ Unit* pUnit = m_creature;
+ 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);
+
+ if(member != 2) // No need to create another pointer to us using Unit::GetUnit
+ pUnit = Unit::GetUnit((*m_creature), Council[member]);
+ return pUnit;
+ }
+
+ void CastAuraOnCouncil()
+ {
+ uint32 spellid = 0;
+ switch(rand()%2)
+ {
+ case 0: spellid = SPELL_DEVOTION_AURA; break;
+ case 1: spellid = SPELL_CHROMATIC_AURA; break;
+ }
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), Council[i]);
+ if(pUnit)
+ pUnit->CastSpell(pUnit, spellid, true, 0, 0, m_creature->GetGUID());
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(BlessingTimer < diff)
+ {
+ if(Unit* pUnit = SelectCouncilMember())
+ {
+ switch(rand()%2)
+ {
+ case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break;
+ case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break;
+ }
+ }
+ BlessingTimer = 60000;
+ }else BlessingTimer -= diff;
+
+ if(ConsecrationTimer < diff)
+ {
+ DoCast(m_creature, SPELL_CONSECRATION);
+ ConsecrationTimer = 40000;
+ }else ConsecrationTimer -= diff;
+
+ if(HammerOfJusticeTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ // is in ~10-40 yd range
+ if(m_creature->GetDistance2d(target) > 10 && m_creature->GetDistance2d(target) < 40)
+ {
+ DoCast(target, SPELL_HAMMER_OF_JUSTICE);
+ HammerOfJusticeTimer = 20000;
+ }
+ }
+ }else HammerOfJusticeTimer -= diff;
+
+ if(SealTimer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0: DoCast(m_creature, SPELL_SEAL_OF_COMMAND); break;
+ case 1: DoCast(m_creature, SPELL_SEAL_OF_BLOOD); break;
+ }
+ SealTimer = 40000;
+ }else SealTimer -= diff;
+
+ if(AuraTimer < diff)
+ {
+ CastAuraOnCouncil();
+ AuraTimer = 90000;
+ }else AuraTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI
+{
+ boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
+
+ uint32 BlizzardTimer;
+ uint32 FlamestrikeTimer;
+ uint32 ArcaneBoltTimer;
+ uint32 DampenMagicTimer;
+ uint32 Cooldown;
+ uint32 ArcaneExplosionTimer;
+
+ void Reset()
+ {
+ BlizzardTimer = 30000 + rand()%61 * 1000;
+ FlamestrikeTimer = 30000 + rand()%61 * 1000;
+ ArcaneBoltTimer = 10000;
+ DampenMagicTimer = 2000;
+ ArcaneExplosionTimer = 14000;
+ Cooldown = 0;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoYell(SAY_ZERE_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ZERE_SLAY);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_ZERE_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_ZERE_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(Cooldown)
+ {
+ if(Cooldown < diff) Cooldown = 0;
+ else
+ {
+ Cooldown -= diff;
+ return; // Don't cast any other spells if global cooldown is still ticking
+ }
+ }
+
+ if(DampenMagicTimer < diff)
+ {
+ DoCast(m_creature, SPELL_DAMPEN_MAGIC);
+ Cooldown = 1000;
+ DampenMagicTimer = 110000; // almost 2 minutes
+ ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen.
+ }else DampenMagicTimer -= diff;
+
+ if(ArcaneExplosionTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
+ Cooldown = 1000;
+ ArcaneExplosionTimer = 14000;
+ }else ArcaneExplosionTimer -= diff;
+
+ if(ArcaneBoltTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_ARCANE_BOLT);
+ ArcaneBoltTimer = 3000;
+ Cooldown = 2000;
+ }else ArcaneBoltTimer -= diff;
+
+ if(BlizzardTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(target, SPELL_BLIZZARD);
+ BlizzardTimer = 45000 + rand()%46 * 1000;
+ FlamestrikeTimer += 10000;
+ Cooldown = 1000;
+ }
+ }else BlizzardTimer -= diff;
+
+ if(FlamestrikeTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(target, SPELL_FLAMESTRIKE);
+ FlamestrikeTimer = 55000 + rand()%46 * 1000;
+ BlizzardTimer += 10000;
+ Cooldown = 2000;
+ }
+ }else FlamestrikeTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI
+{
+ boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
+
+ uint32 EmpoweredSmiteTimer;
+ uint32 CircleOfHealingTimer;
+ uint32 DivineWrathTimer;
+ uint32 ReflectiveShieldTimer;
+
+ void Reset()
+ {
+ EmpoweredSmiteTimer = 38000;
+ CircleOfHealingTimer = 20000;
+ DivineWrathTimer = 40000;
+ ReflectiveShieldTimer = 0;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoYell(SAY_MALA_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_MALA_SLAY);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_MALA_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_MALA_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(EmpoweredSmiteTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(target, SPELL_EMPOWERED_SMITE);
+ EmpoweredSmiteTimer = 38000;
+ }
+ }else EmpoweredSmiteTimer -= diff;
+
+ if(CircleOfHealingTimer < diff)
+ {
+ //Currently bugged and puts Malande on the threatlist of the other council members. It also heals players.
+ //DoCast(m_creature, SPELL_CIRCLE_OF_HEALING);
+ CircleOfHealingTimer = 60000;
+ }else CircleOfHealingTimer -= diff;
+
+ if(DivineWrathTimer < diff)
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ DoCast(target, SPELL_DIVINE_WRATH);
+ DivineWrathTimer = 40000 + rand()%41 * 1000;
+ }
+ }else DivineWrathTimer -= diff;
+
+ if(ReflectiveShieldTimer < diff)
+ {
+ DoCast(m_creature, SPELL_REFLECTIVE_SHIELD);
+ ReflectiveShieldTimer = 65000;
+ }else ReflectiveShieldTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI
+{
+ boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) { Reset(); }
+
+ uint64 EnvenomTargetGUID;
+
+ uint32 DeadlyPoisonTimer;
+ uint32 VanishTimer;
+ uint32 AppearEnvenomTimer;
+
+ bool HasVanished;
+
+ void Reset()
+ {
+ EnvenomTargetGUID = 0;
+
+ DeadlyPoisonTimer = 20000;
+ VanishTimer = 60000 + rand()%61 * 1000;
+ AppearEnvenomTimer = 150000;
+
+ HasVanished = false;
+ m_creature->SetVisibility(VISIBILITY_ON);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ DoYell(SAY_VERA_SLAY,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_VERA_SLAY);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_VERA_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_VERA_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(!HasVanished)
+ {
+ if(DeadlyPoisonTimer < diff)
+ {
+ DoCast(m_creature->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(m_creature->getVictim(), SPELL_ENVENOM);
+ AppearEnvenomTimer = 90000;
+ }else AppearEnvenomTimer -= diff;
+
+ if(VanishTimer < diff) // Disappear and stop attacking, but follow a random unit
+ {
+ if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ VanishTimer = 30000;
+ AppearEnvenomTimer= 28000;
+ HasVanished = true;
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoResetThreat();
+ // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking
+ m_creature->AddThreat(target, 500000.0f);
+ m_creature->GetMotionMaster()->MoveChase(target);
+ }
+ }else VanishTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ else
+ {
+ if(VanishTimer < diff) // Become attackable and poison current target
+ {
+ Unit* target = m_creature->getVictim();
+ DoCast(target, SPELL_DEADLY_POISON);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoResetThreat();
+ m_creature->AddThreat(target, 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)
+ {
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ m_creature->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 *_Creature)
+{
+ return new mob_illidari_councilAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_gathios_the_shatterer(Creature *_Creature)
+{
+ return new boss_gathios_the_shattererAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_lady_malande(Creature *_Creature)
+{
+ return new boss_lady_malandeAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_veras_darkshadow(Creature *_Creature)
+{
+ return new boss_veras_darkshadowAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature *_Creature)
+{
+ return new boss_high_nethermancer_zerevorAI (_Creature);
+}
+
+void AddSC_boss_illidari_council()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_illidari_council";
+ newscript->GetAI = GetAI_mob_illidari_council;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_blood_elf_council_voice_trigger";
+ newscript->GetAI = GetAI_mob_blood_elf_council_voice_trigger;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_gathios_the_shatterer";
+ newscript->GetAI = GetAI_boss_gathios_the_shatterer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_lady_malande";
+ newscript->GetAI = GetAI_boss_lady_malande;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_veras_darkshadow";
+ newscript->GetAI = GetAI_boss_veras_darkshadow;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_high_nethermancer_zerevor";
+ newscript->GetAI = GetAI_boss_high_nethermancer_zerevor;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp
index 551f62de6a2..a4bac36295d 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp
@@ -1,343 +1,343 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Instance_Black_Temple
-SD%Complete: 100
-SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts
-SDCategory: Black Temple
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_black_temple.h"
-
-#define ENCOUNTERS 9
-
-/* Black Temple encounters:
-0 - High Warlord Naj'entus event
-1 - Supremus Event
-2 - Shade of Akama Event
-3 - Teron Gorefiend Event
-4 - Gurtogg Bloodboil Event
-5 - Reliquary Of Souls Event
-6 - Mother Shahraz Event
-7 - Illidari Council Event
-8 - Illidan Stormrage Event
-*/
-
-struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
-{
- instance_black_temple(Map *Map) : ScriptedInstance(Map) {Initialize();};
-
- 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;
-
- uint16 BossKilled;
-
- 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];
-
-
- uint32 Encounters[ENCOUNTERS];
-
- void Initialize()
- {
- 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;
-
- BossKilled = 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;
-
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- Encounters[i] = NOT_STARTED;
- }
-
- bool IsEncounterInProgress() const
- {
- for(uint8 i = 0; i < ENCOUNTERS; i++)
- if(Encounters[i] == IN_PROGRESS) return true;
-
- return false;
- }
-
- void OpenDoor(uint64 DoorGUID, bool open)
- {
- if(((InstanceMap*)instance)->GetPlayers().size())
- if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
- if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID))
- Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
- }
-
- void CloseDoor(uint64 DoorGUID, bool close)
- {
- if(((InstanceMap*)instance)->GetPlayers().size())
- if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
- if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID))
- Door->SetUInt32Value(GAMEOBJECT_STATE, close ? 1 : 0);
- }
-
-
-
- void OnCreatureCreate(Creature *creature, uint32 creature_entry)
- {
- switch(creature_entry)
- {
- case 22887: Najentus = creature->GetGUID(); break;
- case 23089: Akama = creature->GetGUID(); break;
- case 22990: Akama_Shade = creature->GetGUID(); break;
- case 22841: ShadeOfAkama = creature->GetGUID(); break;
- case 22898: Supremus = creature->GetGUID(); break;
- case 22917: IllidanStormrage = creature->GetGUID(); break;
- case 22949: GathiosTheShatterer = creature->GetGUID(); break;
- case 22950: HighNethermancerZerevor = creature->GetGUID(); break;
- case 22951: LadyMalande = creature->GetGUID(); break;
- case 22952: VerasDarkshadow = creature->GetGUID(); break;
- case 23426: IllidariCouncil = creature->GetGUID(); break;
- case 23499: BloodElfCouncilVoice = creature->GetGUID(); break;
- }
- }
-
- void OnObjectCreate(GameObject* go)
- {
- switch(go->GetEntry())
- {
- case 185483: // Gate past Naj'entus (at the entrance to Supermoose's courtyards)
- NajentusGate = go->GetGUID();break;
- case 185882: // Main Temple Doors - right past Supermoose (Supremus)
- MainTempleDoors = go->GetGUID();break;
- case 185478:
- ShadeOfAkamaDoor = go->GetGUID();break;
- case 185480:
- CommonDoor = go->GetGUID();break;
- case 186153:
- TeronDoor = go->GetGUID();break;
- case 185892:
- GuurtogDoor = go->GetGUID();break;
- case 185479:
- TempleDoor = go->GetGUID();break;
- case 185482:
- MotherDoor = go->GetGUID();break;
- case 185481:
- CouncilDoor = go->GetGUID();break;
- case 186152://used by council
- SimpleDoor = go->GetGUID();break;
- case 185905: // Gate leading to Temple Summit
- IllidanGate = go->GetGUID();
- go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
- break;
- case 186261: // Right door at Temple Summit
- IllidanDoor[0] = go->GetGUID();
- go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
- break;
- case 186262: // Left door at Temple Summit
- IllidanDoor[1] = go->GetGUID();
- go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
- break;
- }
- }
-
- uint64 GetData64(uint32 identifier)
- {
- switch(identifier)
- {
- 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;
- }
-
- return 0;
- }
-
- void SetData(uint32 type, uint32 data)
- {
- switch(type)
- {
- case DATA_HIGHWARLORDNAJENTUSEVENT: Encounters[0] = data; break;
- case DATA_SUPREMUSEVENT: Encounters[1] = data; break;
- case DATA_SHADEOFAKAMAEVENT: Encounters[2] = data; break;
- case DATA_TERONGOREFIENDEVENT: Encounters[3] = data; break;
- case DATA_GURTOGGBLOODBOILEVENT: Encounters[4] = data; break;
- case DATA_RELIQUARYOFSOULSEVENT: Encounters[5] = data; break;
- case DATA_MOTHERSHAHRAZEVENT: Encounters[6] = data; break;
- case DATA_ILLIDARICOUNCILEVENT: Encounters[7] = data; break;
- case DATA_ILLIDANSTORMRAGEEVENT: Encounters[8] = data; break;
- }
-
- if(data == DONE)
- {
- SaveToDB();
- BossKilled++;
- }
- CheckInstanceStatus();
- }
-
- void CheckInstanceStatus()
- {
- if(BossKilled >= 6)
- OpenDoor(TempleDoor, true);
- if(Encounters[0] == DONE)
- OpenDoor(NajentusGate, true);
- if(Encounters[2] == IN_PROGRESS)
- CloseDoor(ShadeOfAkamaDoor, true);
- else OpenDoor(ShadeOfAkamaDoor, true);
- if(Encounters[3] == IN_PROGRESS)
- {
- CloseDoor(TeronDoor, true);
- CloseDoor(CommonDoor, true);
- }else{
- OpenDoor(TeronDoor, true);
- OpenDoor(CommonDoor, true);
- }
- if(Encounters[4] == DONE)
- OpenDoor(GuurtogDoor, true);
- if(Encounters[6] == DONE)
- OpenDoor(MotherDoor, true);
- if(Encounters[7] == IN_PROGRESS)
- {
- CloseDoor(CouncilDoor, true);
- CloseDoor(SimpleDoor, true);
- }else{
- OpenDoor(CouncilDoor, true);
- OpenDoor(SimpleDoor, true);
- }
- }
-
- uint32 GetData(uint32 type)
- {
- switch(type)
- {
- case DATA_HIGHWARLORDNAJENTUSEVENT: return Encounters[0];
- case DATA_SUPREMUSEVENT: return Encounters[1];
- case DATA_SHADEOFAKAMAEVENT: return Encounters[2];
- case DATA_TERONGOREFIENDEVENT: return Encounters[3];
- case DATA_GURTOGGBLOODBOILEVENT: return Encounters[4];
- case DATA_RELIQUARYOFSOULSEVENT: return Encounters[5];
- case DATA_MOTHERSHAHRAZEVENT: return Encounters[6];
- case DATA_ILLIDARICOUNCILEVENT: return Encounters[7];
- case DATA_ILLIDANSTORMRAGEEVENT: return Encounters[8];
- }
-
- return 0;
- }
-
- const char* Save()
- {
- OUT_SAVE_INST_DATA;
- std::ostringstream stream;
- stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
- << Encounters[3] << " " << Encounters[4] << " " << Encounters[5] << " "
- << Encounters[6] << " " << Encounters[7] << " " << Encounters[8];
- 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)
- {
- OUT_LOAD_INST_DATA_FAIL;
- return;
- }
-
- OUT_LOAD_INST_DATA(in);
- std::istringstream stream(in);
- stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3]
- >> Encounters[4] >> Encounters[5] >> Encounters[6] >> Encounters[7]
- >> Encounters[8];
- for(uint8 i = 0; i < ENCOUNTERS; ++i)
- if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
- Encounters[i] = NOT_STARTED;
- OUT_LOAD_INST_DATA_COMPLETE;
- }
-};
-
-InstanceData* GetInstanceData_instance_black_temple(Map* map)
-{
- return new instance_black_temple(map);
-}
-
-void AddSC_instance_black_temple()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_black_temple";
- newscript->GetInstanceData = GetInstanceData_instance_black_temple;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Black_Temple
+SD%Complete: 100
+SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+#define ENCOUNTERS 9
+
+/* Black Temple encounters:
+0 - High Warlord Naj'entus event
+1 - Supremus Event
+2 - Shade of Akama Event
+3 - Teron Gorefiend Event
+4 - Gurtogg Bloodboil Event
+5 - Reliquary Of Souls Event
+6 - Mother Shahraz Event
+7 - Illidari Council Event
+8 - Illidan Stormrage Event
+*/
+
+struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
+{
+ instance_black_temple(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ 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;
+
+ uint16 BossKilled;
+
+ 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];
+
+
+ uint32 Encounters[ENCOUNTERS];
+
+ void Initialize()
+ {
+ 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;
+
+ BossKilled = 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;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounters[i] = NOT_STARTED;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ if(Encounters[i] == IN_PROGRESS) return true;
+
+ return false;
+ }
+
+ void OpenDoor(uint64 DoorGUID, bool open)
+ {
+ if(((InstanceMap*)instance)->GetPlayers().size())
+ if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
+ if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
+ }
+
+ void CloseDoor(uint64 DoorGUID, bool close)
+ {
+ if(((InstanceMap*)instance)->GetPlayers().size())
+ if(Player* first = ((InstanceMap*)instance)->GetPlayers().front())
+ if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, close ? 1 : 0);
+ }
+
+
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 22887: Najentus = creature->GetGUID(); break;
+ case 23089: Akama = creature->GetGUID(); break;
+ case 22990: Akama_Shade = creature->GetGUID(); break;
+ case 22841: ShadeOfAkama = creature->GetGUID(); break;
+ case 22898: Supremus = creature->GetGUID(); break;
+ case 22917: IllidanStormrage = creature->GetGUID(); break;
+ case 22949: GathiosTheShatterer = creature->GetGUID(); break;
+ case 22950: HighNethermancerZerevor = creature->GetGUID(); break;
+ case 22951: LadyMalande = creature->GetGUID(); break;
+ case 22952: VerasDarkshadow = creature->GetGUID(); break;
+ case 23426: IllidariCouncil = creature->GetGUID(); break;
+ case 23499: BloodElfCouncilVoice = creature->GetGUID(); break;
+ }
+ }
+
+ void OnObjectCreate(GameObject* go)
+ {
+ switch(go->GetEntry())
+ {
+ case 185483: // Gate past Naj'entus (at the entrance to Supermoose's courtyards)
+ NajentusGate = go->GetGUID();break;
+ case 185882: // Main Temple Doors - right past Supermoose (Supremus)
+ MainTempleDoors = go->GetGUID();break;
+ case 185478:
+ ShadeOfAkamaDoor = go->GetGUID();break;
+ case 185480:
+ CommonDoor = go->GetGUID();break;
+ case 186153:
+ TeronDoor = go->GetGUID();break;
+ case 185892:
+ GuurtogDoor = go->GetGUID();break;
+ case 185479:
+ TempleDoor = go->GetGUID();break;
+ case 185482:
+ MotherDoor = go->GetGUID();break;
+ case 185481:
+ CouncilDoor = go->GetGUID();break;
+ case 186152://used by council
+ SimpleDoor = go->GetGUID();break;
+ case 185905: // Gate leading to Temple Summit
+ IllidanGate = go->GetGUID();
+ go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
+ break;
+ case 186261: // Right door at Temple Summit
+ IllidanDoor[0] = go->GetGUID();
+ go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
+ break;
+ case 186262: // Left door at Temple Summit
+ IllidanDoor[1] = go->GetGUID();
+ go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND);
+ break;
+ }
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ 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;
+ }
+
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_HIGHWARLORDNAJENTUSEVENT: Encounters[0] = data; break;
+ case DATA_SUPREMUSEVENT: Encounters[1] = data; break;
+ case DATA_SHADEOFAKAMAEVENT: Encounters[2] = data; break;
+ case DATA_TERONGOREFIENDEVENT: Encounters[3] = data; break;
+ case DATA_GURTOGGBLOODBOILEVENT: Encounters[4] = data; break;
+ case DATA_RELIQUARYOFSOULSEVENT: Encounters[5] = data; break;
+ case DATA_MOTHERSHAHRAZEVENT: Encounters[6] = data; break;
+ case DATA_ILLIDARICOUNCILEVENT: Encounters[7] = data; break;
+ case DATA_ILLIDANSTORMRAGEEVENT: Encounters[8] = data; break;
+ }
+
+ if(data == DONE)
+ {
+ SaveToDB();
+ BossKilled++;
+ }
+ CheckInstanceStatus();
+ }
+
+ void CheckInstanceStatus()
+ {
+ if(BossKilled >= 6)
+ OpenDoor(TempleDoor, true);
+ if(Encounters[0] == DONE)
+ OpenDoor(NajentusGate, true);
+ if(Encounters[2] == IN_PROGRESS)
+ CloseDoor(ShadeOfAkamaDoor, true);
+ else OpenDoor(ShadeOfAkamaDoor, true);
+ if(Encounters[3] == IN_PROGRESS)
+ {
+ CloseDoor(TeronDoor, true);
+ CloseDoor(CommonDoor, true);
+ }else{
+ OpenDoor(TeronDoor, true);
+ OpenDoor(CommonDoor, true);
+ }
+ if(Encounters[4] == DONE)
+ OpenDoor(GuurtogDoor, true);
+ if(Encounters[6] == DONE)
+ OpenDoor(MotherDoor, true);
+ if(Encounters[7] == IN_PROGRESS)
+ {
+ CloseDoor(CouncilDoor, true);
+ CloseDoor(SimpleDoor, true);
+ }else{
+ OpenDoor(CouncilDoor, true);
+ OpenDoor(SimpleDoor, true);
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_HIGHWARLORDNAJENTUSEVENT: return Encounters[0];
+ case DATA_SUPREMUSEVENT: return Encounters[1];
+ case DATA_SHADEOFAKAMAEVENT: return Encounters[2];
+ case DATA_TERONGOREFIENDEVENT: return Encounters[3];
+ case DATA_GURTOGGBLOODBOILEVENT: return Encounters[4];
+ case DATA_RELIQUARYOFSOULSEVENT: return Encounters[5];
+ case DATA_MOTHERSHAHRAZEVENT: return Encounters[6];
+ case DATA_ILLIDARICOUNCILEVENT: return Encounters[7];
+ case DATA_ILLIDANSTORMRAGEEVENT: return Encounters[8];
+ }
+
+ return 0;
+ }
+
+ const char* Save()
+ {
+ OUT_SAVE_INST_DATA;
+ std::ostringstream stream;
+ stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
+ << Encounters[3] << " " << Encounters[4] << " " << Encounters[5] << " "
+ << Encounters[6] << " " << Encounters[7] << " " << Encounters[8];
+ 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)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+ std::istringstream stream(in);
+ stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3]
+ >> Encounters[4] >> Encounters[5] >> Encounters[6] >> Encounters[7]
+ >> Encounters[8];
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
+ Encounters[i] = NOT_STARTED;
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+};
+
+InstanceData* GetInstanceData_instance_black_temple(Map* map)
+{
+ return new instance_black_temple(map);
+}
+
+void AddSC_instance_black_temple()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_black_temple";
+ newscript->GetInstanceData = GetInstanceData_instance_black_temple;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp
index 4f3168602f5..95a920d39a3 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp
@@ -1,237 +1,237 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Blackrock_Depths
-SD%Complete: 95
-SDComment: Quest support: 4001, 4342, 7604. Vendor Lokhtos Darkbargainer.
-SDCategory: Blackrock Depths
-EndScriptData */
-
-/* ContentData
-mob_phalanx
-npc_kharan_mighthammer
-npc_lokhtos_darkbargainer
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mob_phalanx
-######*/
-
-#define SPELL_THUNDERCLAP 8732
-#define SPELL_FIREBALLVOLLEY 22425
-#define SPELL_MIGHTYBLOW 14099
-
-struct TRINITY_DLL_DECL mob_phalanxAI : public ScriptedAI
-{
- mob_phalanxAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ThunderClap_Timer;
- uint32 FireballVolley_Timer;
- uint32 MightyBlow_Timer;
-
- void Reset()
- {
- ThunderClap_Timer = 12000;
- FireballVolley_Timer =0;
- MightyBlow_Timer = 15000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ThunderClap_Timer
- if( ThunderClap_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- ThunderClap_Timer = 10000;
- }else ThunderClap_Timer -= diff;
-
- //FireballVolley_Timer
- if( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
- {
- if (FireballVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY);
- FireballVolley_Timer = 15000;
- }else FireballVolley_Timer -= diff;
- }
-
- //MightyBlow_Timer
- if( MightyBlow_Timer < diff )
- {
- DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
- MightyBlow_Timer = 10000;
- }else MightyBlow_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mob_phalanx(Creature *_Creature)
-{
- return new mob_phalanxAI (_Creature);
-}
-
-/*######
-## npc_kharan_mighthammer
-######*/
-
-#define QUEST_4001 4001
-#define QUEST_4342 4342
-
-bool GossipHello_npc_kharan_mighthammer(Player *player, Creature *_Creature)
-{
- if( _Creature->isQuestGiver() )
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if( player->GetQuestStatus(QUEST_4001) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM( 0, "I need to know where the princess are, Kharan!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- if( player->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM( 0, "All is not lost, Kharan!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
-
- if( player->GetTeam() == HORDE ) player->SEND_GOSSIP_MENU(2473, _Creature->GetGUID());
- if( player->GetTeam() == ALLIANCE ) player->SEND_GOSSIP_MENU(2474, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_kharan_mighthammer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, "Gor'shak is my friend, you can trust me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(2475, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(0, "Not enough, you need to tell me more.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(2476, _Creature->GetGUID());
- break;
-
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(0, "So what happened?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(2477, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(0, "Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(2478, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(0, "So you suspect that someone on the inside was involved? That they were tipped off?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(2479, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(0, "Continue with your story please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
- player->SEND_GOSSIP_MENU(2480, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->ADD_GOSSIP_ITEM(0, "Indeed.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
- player->SEND_GOSSIP_MENU(2481, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+8:
- player->ADD_GOSSIP_ITEM(0, "The door is open, Kharan. You are a free man.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
- player->SEND_GOSSIP_MENU(2482, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+9:
- player->CLOSE_GOSSIP_MENU();
- if( player->GetTeam() == HORDE ) player->AreaExploredOrEventHappens(QUEST_4001);
- if( player->GetTeam() == ALLIANCE ) player->AreaExploredOrEventHappens(QUEST_4342);
- break;
- }
- return true;
-}
-
-/*######
-## npc_lokhtos_darkbargainer
-######*/
-
-#define ITEM_THRORIUM_BROTHERHOOD_CONTRACT 18628
-#define ITEM_SULFURON_INGOT 17203
-#define QUEST_A_BINDING_CONTRACT 7604
-#define SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND 23059
-
-bool GossipHello_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (_Creature->isVendor() && player->GetReputationRank(59) >= REP_FRIENDLY)
- player->ADD_GOSSIP_ITEM( 1, "Show me what I have access to, Lothos.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- if (player->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 &&
- !player->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) &&
- player->HasItemCount(ITEM_SULFURON_INGOT, 1))
- {
- player->ADD_GOSSIP_ITEM(0, "Get Thorium Brotherhood Contract", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- }
-
- if (player->GetReputationRank(59) < REP_FRIENDLY)
- player->SEND_GOSSIP_MENU(3673, _Creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(3677, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- {
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false);
- }
- if (action == GOSSIP_ACTION_TRADE)
- {
- player->SEND_VENDORLIST( _Creature->GetGUID() );
- }
- return true;
-}
-
-/*######
-##
-######*/
-
-void AddSC_blackrock_depths()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="phalanx";
- newscript->GetAI = GetAI_mob_phalanx;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_kharan_mighthammer";
- newscript->pGossipHello = &GossipHello_npc_kharan_mighthammer;
- newscript->pGossipSelect = &GossipSelect_npc_kharan_mighthammer;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_lokhtos_darkbargainer";
- newscript->pGossipHello = &GossipHello_npc_lokhtos_darkbargainer;
- newscript->pGossipSelect = &GossipSelect_npc_lokhtos_darkbargainer;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Blackrock_Depths
+SD%Complete: 95
+SDComment: Quest support: 4001, 4342, 7604. Vendor Lokhtos Darkbargainer.
+SDCategory: Blackrock Depths
+EndScriptData */
+
+/* ContentData
+mob_phalanx
+npc_kharan_mighthammer
+npc_lokhtos_darkbargainer
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mob_phalanx
+######*/
+
+#define SPELL_THUNDERCLAP 8732
+#define SPELL_FIREBALLVOLLEY 22425
+#define SPELL_MIGHTYBLOW 14099
+
+struct TRINITY_DLL_DECL mob_phalanxAI : public ScriptedAI
+{
+ mob_phalanxAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ThunderClap_Timer;
+ uint32 FireballVolley_Timer;
+ uint32 MightyBlow_Timer;
+
+ void Reset()
+ {
+ ThunderClap_Timer = 12000;
+ FireballVolley_Timer =0;
+ MightyBlow_Timer = 15000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ThunderClap_Timer
+ if( ThunderClap_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ ThunderClap_Timer = 10000;
+ }else ThunderClap_Timer -= diff;
+
+ //FireballVolley_Timer
+ if( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
+ {
+ if (FireballVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY);
+ FireballVolley_Timer = 15000;
+ }else FireballVolley_Timer -= diff;
+ }
+
+ //MightyBlow_Timer
+ if( MightyBlow_Timer < diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
+ MightyBlow_Timer = 10000;
+ }else MightyBlow_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mob_phalanx(Creature *_Creature)
+{
+ return new mob_phalanxAI (_Creature);
+}
+
+/*######
+## npc_kharan_mighthammer
+######*/
+
+#define QUEST_4001 4001
+#define QUEST_4342 4342
+
+bool GossipHello_npc_kharan_mighthammer(Player *player, Creature *_Creature)
+{
+ if( _Creature->isQuestGiver() )
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if( player->GetQuestStatus(QUEST_4001) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM( 0, "I need to know where the princess are, Kharan!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ if( player->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM( 0, "All is not lost, Kharan!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+
+ if( player->GetTeam() == HORDE ) player->SEND_GOSSIP_MENU(2473, _Creature->GetGUID());
+ if( player->GetTeam() == ALLIANCE ) player->SEND_GOSSIP_MENU(2474, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_kharan_mighthammer(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, "Gor'shak is my friend, you can trust me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(2475, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM(0, "Not enough, you need to tell me more.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(2476, _Creature->GetGUID());
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM(0, "So what happened?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(2477, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM(0, "Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(2478, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM(0, "So you suspect that someone on the inside was involved? That they were tipped off?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ player->SEND_GOSSIP_MENU(2479, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->ADD_GOSSIP_ITEM(0, "Continue with your story please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
+ player->SEND_GOSSIP_MENU(2480, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ player->ADD_GOSSIP_ITEM(0, "Indeed.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
+ player->SEND_GOSSIP_MENU(2481, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+8:
+ player->ADD_GOSSIP_ITEM(0, "The door is open, Kharan. You are a free man.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
+ player->SEND_GOSSIP_MENU(2482, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+9:
+ player->CLOSE_GOSSIP_MENU();
+ if( player->GetTeam() == HORDE ) player->AreaExploredOrEventHappens(QUEST_4001);
+ if( player->GetTeam() == ALLIANCE ) player->AreaExploredOrEventHappens(QUEST_4342);
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_lokhtos_darkbargainer
+######*/
+
+#define ITEM_THRORIUM_BROTHERHOOD_CONTRACT 18628
+#define ITEM_SULFURON_INGOT 17203
+#define QUEST_A_BINDING_CONTRACT 7604
+#define SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND 23059
+
+bool GossipHello_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (_Creature->isVendor() && player->GetReputationRank(59) >= REP_FRIENDLY)
+ player->ADD_GOSSIP_ITEM( 1, "Show me what I have access to, Lothos.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+
+ if (player->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 &&
+ !player->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) &&
+ player->HasItemCount(ITEM_SULFURON_INGOT, 1))
+ {
+ player->ADD_GOSSIP_ITEM(0, "Get Thorium Brotherhood Contract", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ }
+
+ if (player->GetReputationRank(59) < REP_FRIENDLY)
+ player->SEND_GOSSIP_MENU(3673, _Creature->GetGUID());
+ else
+ player->SEND_GOSSIP_MENU(3677, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false);
+ }
+ if (action == GOSSIP_ACTION_TRADE)
+ {
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+ }
+ return true;
+}
+
+/*######
+##
+######*/
+
+void AddSC_blackrock_depths()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="phalanx";
+ newscript->GetAI = GetAI_mob_phalanx;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_kharan_mighthammer";
+ newscript->pGossipHello = &GossipHello_npc_kharan_mighthammer;
+ newscript->pGossipSelect = &GossipSelect_npc_kharan_mighthammer;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_lokhtos_darkbargainer";
+ newscript->pGossipHello = &GossipHello_npc_lokhtos_darkbargainer;
+ newscript->pGossipSelect = &GossipSelect_npc_lokhtos_darkbargainer;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
index 0d049557e58..b63691a3b6e 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
@@ -1,106 +1,106 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ambassador_Flamelash
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FIREBLAST 15573
-
-struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI
-{
- boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FireBlast_Timer;
- uint32 Spirit_Timer;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- FireBlast_Timer = 2000;
- Spirit_Timer = 24000;
- }
-
- void Aggro(Unit *who) {}
-
- void SummonSpirits(Unit* victim)
- {
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandX -= Rand; break;
- case 1: RandX += Rand; break;
- }
- Rand = 0;
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandY -= Rand; break;
- case 1: RandY += Rand; break;
- }
- Summoned = DoSpawnCreature(9178, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //FireBlast_Timer
- if (FireBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIREBLAST);
- FireBlast_Timer = 7000;
- }else FireBlast_Timer -= diff;
-
- //Spirit_Timer
- if (Spirit_Timer < diff)
- {
- SummonSpirits(m_creature->getVictim());
- SummonSpirits(m_creature->getVictim());
- SummonSpirits(m_creature->getVictim());
- SummonSpirits(m_creature->getVictim());
-
- Spirit_Timer = 30000;
- }else Spirit_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_ambassador_flamelash(Creature *_Creature)
-{
- return new boss_ambassador_flamelashAI (_Creature);
-}
-
-void AddSC_boss_ambassador_flamelash()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ambassador_flamelash";
- newscript->GetAI = GetAI_boss_ambassador_flamelash;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ambassador_Flamelash
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FIREBLAST 15573
+
+struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI
+{
+ boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FireBlast_Timer;
+ uint32 Spirit_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ FireBlast_Timer = 2000;
+ Spirit_Timer = 24000;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void SummonSpirits(Unit* victim)
+ {
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandX -= Rand; break;
+ case 1: RandX += Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandY -= Rand; break;
+ case 1: RandY += Rand; break;
+ }
+ Summoned = DoSpawnCreature(9178, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FireBlast_Timer
+ if (FireBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREBLAST);
+ FireBlast_Timer = 7000;
+ }else FireBlast_Timer -= diff;
+
+ //Spirit_Timer
+ if (Spirit_Timer < diff)
+ {
+ SummonSpirits(m_creature->getVictim());
+ SummonSpirits(m_creature->getVictim());
+ SummonSpirits(m_creature->getVictim());
+ SummonSpirits(m_creature->getVictim());
+
+ Spirit_Timer = 30000;
+ }else Spirit_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_ambassador_flamelash(Creature *_Creature)
+{
+ return new boss_ambassador_flamelashAI (_Creature);
+}
+
+void AddSC_boss_ambassador_flamelash()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ambassador_flamelash";
+ newscript->GetAI = GetAI_boss_ambassador_flamelash;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp
index 944e5fb4b10..13b9f31e734 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp
@@ -1,91 +1,91 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Angerrel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SUNDERARMOR 24317
-#define SPELL_SHIELDBLOCK 12169
-#define SPELL_STRIKE 15580
-
-struct TRINITY_DLL_DECL boss_angerrelAI : public ScriptedAI
-{
- boss_angerrelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SunderArmor_Timer;
- uint32 ShieldBlock_Timer;
- uint32 Strike_Timer;
-
- void Reset()
- {
- SunderArmor_Timer = 8000;
- ShieldBlock_Timer = 15000;
- Strike_Timer = 12000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //SunderArmor_Timer
- if (SunderArmor_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
- SunderArmor_Timer = 28000;
- }else SunderArmor_Timer -= diff;
-
- //ShieldBlock_Timer
- if (ShieldBlock_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHIELDBLOCK);
- ShieldBlock_Timer = 25000;
- }else ShieldBlock_Timer -= diff;
-
- //Strike_Timer
- if (Strike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_STRIKE);
- Strike_Timer = 10000;
- }else Strike_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_angerrel(Creature *_Creature)
-{
- return new boss_angerrelAI (_Creature);
-}
-
-void AddSC_boss_angerrel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_angerrel";
- newscript->GetAI = GetAI_boss_angerrel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Angerrel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SUNDERARMOR 24317
+#define SPELL_SHIELDBLOCK 12169
+#define SPELL_STRIKE 15580
+
+struct TRINITY_DLL_DECL boss_angerrelAI : public ScriptedAI
+{
+ boss_angerrelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SunderArmor_Timer;
+ uint32 ShieldBlock_Timer;
+ uint32 Strike_Timer;
+
+ void Reset()
+ {
+ SunderArmor_Timer = 8000;
+ ShieldBlock_Timer = 15000;
+ Strike_Timer = 12000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //SunderArmor_Timer
+ if (SunderArmor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
+ SunderArmor_Timer = 28000;
+ }else SunderArmor_Timer -= diff;
+
+ //ShieldBlock_Timer
+ if (ShieldBlock_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHIELDBLOCK);
+ ShieldBlock_Timer = 25000;
+ }else ShieldBlock_Timer -= diff;
+
+ //Strike_Timer
+ if (Strike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_STRIKE);
+ Strike_Timer = 10000;
+ }else Strike_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_angerrel(Creature *_Creature)
+{
+ return new boss_angerrelAI (_Creature);
+}
+
+void AddSC_boss_angerrel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_angerrel";
+ newscript->GetAI = GetAI_boss_angerrel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp
index e9dcf4be094..50cf2af8169 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp
@@ -1,115 +1,115 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Anubshiah
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWBOLT 17228
-#define SPELL_CURSEOFTONGUES 15470
-#define SPELL_CURSEOFWEAKNESS 17227
-#define SPELL_DEMONARMOR 11735
-#define SPELL_ENVELOPINGWEB 15471
-
-struct TRINITY_DLL_DECL boss_anubshiahAI : public ScriptedAI
-{
- boss_anubshiahAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowBolt_Timer;
- uint32 CurseOfTongues_Timer;
- uint32 CurseOfWeakness_Timer;
- uint32 DemonArmor_Timer;
- uint32 EnvelopingWeb_Timer;
-
- void Reset()
- {
- ShadowBolt_Timer = 7000;
- CurseOfTongues_Timer = 24000;
- CurseOfWeakness_Timer = 12000;
- DemonArmor_Timer = 3000;
- EnvelopingWeb_Timer = 16000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowBolt_Timer
- if (ShadowBolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT);
- ShadowBolt_Timer = 7000;
- }else ShadowBolt_Timer -= diff;
-
- //CurseOfTongues_Timer
- if (CurseOfTongues_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_CURSEOFTONGUES);
- CurseOfTongues_Timer = 18000;
- }else CurseOfTongues_Timer -= diff;
-
- //CurseOfWeakness_Timer
- if (CurseOfWeakness_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
- CurseOfWeakness_Timer = 45000;
- }else CurseOfWeakness_Timer -= diff;
-
- //DemonArmor_Timer
- if (DemonArmor_Timer < diff)
- {
- DoCast(m_creature,SPELL_DEMONARMOR);
- DemonArmor_Timer = 300000;
- }else DemonArmor_Timer -= diff;
-
- //EnvelopingWeb_Timer
- if (EnvelopingWeb_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_ENVELOPINGWEB);
- EnvelopingWeb_Timer = 12000;
- }else EnvelopingWeb_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_anubshiah(Creature *_Creature)
-{
- return new boss_anubshiahAI (_Creature);
-}
-
-void AddSC_boss_anubshiah()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_anubshiah";
- newscript->GetAI = GetAI_boss_anubshiah;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Anubshiah
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWBOLT 17228
+#define SPELL_CURSEOFTONGUES 15470
+#define SPELL_CURSEOFWEAKNESS 17227
+#define SPELL_DEMONARMOR 11735
+#define SPELL_ENVELOPINGWEB 15471
+
+struct TRINITY_DLL_DECL boss_anubshiahAI : public ScriptedAI
+{
+ boss_anubshiahAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowBolt_Timer;
+ uint32 CurseOfTongues_Timer;
+ uint32 CurseOfWeakness_Timer;
+ uint32 DemonArmor_Timer;
+ uint32 EnvelopingWeb_Timer;
+
+ void Reset()
+ {
+ ShadowBolt_Timer = 7000;
+ CurseOfTongues_Timer = 24000;
+ CurseOfWeakness_Timer = 12000;
+ DemonArmor_Timer = 3000;
+ EnvelopingWeb_Timer = 16000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowBolt_Timer
+ if (ShadowBolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT);
+ ShadowBolt_Timer = 7000;
+ }else ShadowBolt_Timer -= diff;
+
+ //CurseOfTongues_Timer
+ if (CurseOfTongues_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_CURSEOFTONGUES);
+ CurseOfTongues_Timer = 18000;
+ }else CurseOfTongues_Timer -= diff;
+
+ //CurseOfWeakness_Timer
+ if (CurseOfWeakness_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
+ CurseOfWeakness_Timer = 45000;
+ }else CurseOfWeakness_Timer -= diff;
+
+ //DemonArmor_Timer
+ if (DemonArmor_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_DEMONARMOR);
+ DemonArmor_Timer = 300000;
+ }else DemonArmor_Timer -= diff;
+
+ //EnvelopingWeb_Timer
+ if (EnvelopingWeb_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_ENVELOPINGWEB);
+ EnvelopingWeb_Timer = 12000;
+ }else EnvelopingWeb_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_anubshiah(Creature *_Creature)
+{
+ return new boss_anubshiahAI (_Creature);
+}
+
+void AddSC_boss_anubshiah()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_anubshiah";
+ newscript->GetAI = GetAI_boss_anubshiah;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp
index f5d4f8bd699..b58ebc7b97a 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp
@@ -1,139 +1,139 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Doomrel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWBOLTVOLLEY 17228
-#define SPELL_IMMOLATE 15505
-#define SPELL_CURSEOFWEAKNESS 17227
-#define SPELL_DEMONARMOR 11735
-
-struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI
-{
- boss_doomrelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowVolley_Timer;
- uint32 Immolate_Timer;
- uint32 CurseOfWeakness_Timer;
- uint32 DemonArmor_Timer;
- bool Voidwalkers;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- ShadowVolley_Timer = 10000;
- Immolate_Timer = 18000;
- CurseOfWeakness_Timer = 5000;
- DemonArmor_Timer = 16000;
- Voidwalkers = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonVoidwalkers(Unit* victim)
- {
- Rand = rand()%5;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%5;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(16119, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowVolley_Timer
- if (ShadowVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY);
- ShadowVolley_Timer = 12000;
- }else ShadowVolley_Timer -= diff;
-
- //Immolate_Timer
- if (Immolate_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)DoCast(target,SPELL_IMMOLATE);
- Immolate_Timer = 25000;
- }else Immolate_Timer -= diff;
-
- //CurseOfWeakness_Timer
- if (CurseOfWeakness_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
- CurseOfWeakness_Timer = 45000;
- }else CurseOfWeakness_Timer -= diff;
-
- //DemonArmor_Timer
- if (DemonArmor_Timer < diff)
- {
- DoCast(m_creature,SPELL_DEMONARMOR);
- DemonArmor_Timer = 300000;
- }else DemonArmor_Timer -= diff;
-
- //Summon Voidwalkers
- if (!Voidwalkers && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
- {
- SummonVoidwalkers(m_creature->getVictim());
- SummonVoidwalkers(m_creature->getVictim());
- SummonVoidwalkers(m_creature->getVictim());
- Voidwalkers = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_doomrel(Creature *_Creature)
-{
- return new boss_doomrelAI (_Creature);
-}
-
-void AddSC_boss_doomrel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_doomrel";
- newscript->GetAI = GetAI_boss_doomrel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Doomrel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWBOLTVOLLEY 17228
+#define SPELL_IMMOLATE 15505
+#define SPELL_CURSEOFWEAKNESS 17227
+#define SPELL_DEMONARMOR 11735
+
+struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI
+{
+ boss_doomrelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowVolley_Timer;
+ uint32 Immolate_Timer;
+ uint32 CurseOfWeakness_Timer;
+ uint32 DemonArmor_Timer;
+ bool Voidwalkers;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ ShadowVolley_Timer = 10000;
+ Immolate_Timer = 18000;
+ CurseOfWeakness_Timer = 5000;
+ DemonArmor_Timer = 16000;
+ Voidwalkers = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonVoidwalkers(Unit* victim)
+ {
+ Rand = rand()%5;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%5;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(16119, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowVolley_Timer
+ if (ShadowVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY);
+ ShadowVolley_Timer = 12000;
+ }else ShadowVolley_Timer -= diff;
+
+ //Immolate_Timer
+ if (Immolate_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)DoCast(target,SPELL_IMMOLATE);
+ Immolate_Timer = 25000;
+ }else Immolate_Timer -= diff;
+
+ //CurseOfWeakness_Timer
+ if (CurseOfWeakness_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
+ CurseOfWeakness_Timer = 45000;
+ }else CurseOfWeakness_Timer -= diff;
+
+ //DemonArmor_Timer
+ if (DemonArmor_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_DEMONARMOR);
+ DemonArmor_Timer = 300000;
+ }else DemonArmor_Timer -= diff;
+
+ //Summon Voidwalkers
+ if (!Voidwalkers && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
+ {
+ SummonVoidwalkers(m_creature->getVictim());
+ SummonVoidwalkers(m_creature->getVictim());
+ SummonVoidwalkers(m_creature->getVictim());
+ Voidwalkers = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_doomrel(Creature *_Creature)
+{
+ return new boss_doomrelAI (_Creature);
+}
+
+void AddSC_boss_doomrel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_doomrel";
+ newscript->GetAI = GetAI_boss_doomrel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp
index ffa79896b55..f9da16dd2fd 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp
@@ -1,91 +1,91 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Doperel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SINISTERSTRIKE 15581
-#define SPELL_BACKSTAB 15582
-#define SPELL_GOUGE 13579
-
-struct TRINITY_DLL_DECL boss_doperelAI : public ScriptedAI
-{
- boss_doperelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SinisterStrike_Timer;
- uint32 BackStab_Timer;
- uint32 Gouge_Timer;
-
- void Reset()
- {
- SinisterStrike_Timer = 8000;
- BackStab_Timer = 12000;
- Gouge_Timer = 6000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //SinisterStrike_Timer
- if (SinisterStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SINISTERSTRIKE);
- SinisterStrike_Timer = 7000;
- }else SinisterStrike_Timer -= diff;
-
- //BackStab_Timer
- if (BackStab_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BACKSTAB);
- BackStab_Timer = 6000;
- }else BackStab_Timer -= diff;
-
- //Gouge_Timer
- if (Gouge_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_GOUGE);
- Gouge_Timer = 8000;
- }else Gouge_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_doperel(Creature *_Creature)
-{
- return new boss_doperelAI (_Creature);
-}
-
-void AddSC_boss_doperel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_doperel";
- newscript->GetAI = GetAI_boss_doperel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Doperel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SINISTERSTRIKE 15581
+#define SPELL_BACKSTAB 15582
+#define SPELL_GOUGE 13579
+
+struct TRINITY_DLL_DECL boss_doperelAI : public ScriptedAI
+{
+ boss_doperelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SinisterStrike_Timer;
+ uint32 BackStab_Timer;
+ uint32 Gouge_Timer;
+
+ void Reset()
+ {
+ SinisterStrike_Timer = 8000;
+ BackStab_Timer = 12000;
+ Gouge_Timer = 6000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //SinisterStrike_Timer
+ if (SinisterStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SINISTERSTRIKE);
+ SinisterStrike_Timer = 7000;
+ }else SinisterStrike_Timer -= diff;
+
+ //BackStab_Timer
+ if (BackStab_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BACKSTAB);
+ BackStab_Timer = 6000;
+ }else BackStab_Timer -= diff;
+
+ //Gouge_Timer
+ if (Gouge_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_GOUGE);
+ Gouge_Timer = 8000;
+ }else Gouge_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_doperel(Creature *_Creature)
+{
+ return new boss_doperelAI (_Creature);
+}
+
+void AddSC_boss_doperel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_doperel";
+ newscript->GetAI = GetAI_boss_doperel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
index 7594bec05df..e8b1fb791ee 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
@@ -1,104 +1,104 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Emperor_Dagran_Thaurissan
-SD%Complete: 99
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_HANDOFTHAURISSAN 17492
-#define SPELL_AVATAROFFLAME 15636
-
-#define SAY_AGGRO "Come to aid the Throne!"
-#define SAY_SLAY "Hail to the king, baby!"
-
-struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI
-{
- boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 HandOfThaurissan_Timer;
- uint32 AvatarOfFlame_Timer;
- //uint32 Counter;
-
- void Reset()
- {
- HandOfThaurissan_Timer = 4000;
- AvatarOfFlame_Timer = 25000;
- //Counter= 0;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- }
-
- void KilledUnit(Unit* victim)
- {
- DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if (HandOfThaurissan_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_HANDOFTHAURISSAN);
-
- //3 Hands of Thaurissan will be casted
- //if (Counter < 3)
- //{
- // HandOfThaurissan_Timer = 1000;
- // Counter++;
- //}
- //else
- //{
- HandOfThaurissan_Timer = 5000;
- //Counter=0;
- //}
- }else HandOfThaurissan_Timer -= diff;
-
- //AvatarOfFlame_Timer
- if (AvatarOfFlame_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_AVATAROFFLAME);
- AvatarOfFlame_Timer = 18000;
- }else AvatarOfFlame_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_draganthaurissan(Creature *_Creature)
-{
- return new boss_draganthaurissanAI (_Creature);
-}
-
-void AddSC_boss_draganthaurissan()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_emperor_dagran_thaurissan";
- newscript->GetAI = GetAI_boss_draganthaurissan;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Emperor_Dagran_Thaurissan
+SD%Complete: 99
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_HANDOFTHAURISSAN 17492
+#define SPELL_AVATAROFFLAME 15636
+
+#define SAY_AGGRO "Come to aid the Throne!"
+#define SAY_SLAY "Hail to the king, baby!"
+
+struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI
+{
+ boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 HandOfThaurissan_Timer;
+ uint32 AvatarOfFlame_Timer;
+ //uint32 Counter;
+
+ void Reset()
+ {
+ HandOfThaurissan_Timer = 4000;
+ AvatarOfFlame_Timer = 25000;
+ //Counter= 0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if (HandOfThaurissan_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_HANDOFTHAURISSAN);
+
+ //3 Hands of Thaurissan will be casted
+ //if (Counter < 3)
+ //{
+ // HandOfThaurissan_Timer = 1000;
+ // Counter++;
+ //}
+ //else
+ //{
+ HandOfThaurissan_Timer = 5000;
+ //Counter=0;
+ //}
+ }else HandOfThaurissan_Timer -= diff;
+
+ //AvatarOfFlame_Timer
+ if (AvatarOfFlame_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_AVATAROFFLAME);
+ AvatarOfFlame_Timer = 18000;
+ }else AvatarOfFlame_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_draganthaurissan(Creature *_Creature)
+{
+ return new boss_draganthaurissanAI (_Creature);
+}
+
+void AddSC_boss_draganthaurissan()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_emperor_dagran_thaurissan";
+ newscript->GetAI = GetAI_boss_draganthaurissan;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp
index 1198596754d..0760bc65733 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp
@@ -1,167 +1,167 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_General_Angerforge
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_MIGHTYBLOW 14099
-#define SPELL_HAMSTRING 9080
-#define SPELL_CLEAVE 20691
-
-struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
-{
- boss_general_angerforgeAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MightyBlow_Timer;
- uint32 HamString_Timer;
- uint32 Cleave_Timer;
- uint32 Adds_Timer;
- bool Medics;
- int Rand1;
- int Rand1X;
- int Rand1Y;
- int Rand2;
- int Rand2X;
- int Rand2Y;
- Creature* SummonedAdds;
- Creature* SummonedMedics;
-
- void Reset()
- {
- MightyBlow_Timer = 8000;
- HamString_Timer = 12000;
- Cleave_Timer = 16000;
- Adds_Timer = 0;
- Medics = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonAdds(Unit* victim)
- {
- Rand1 = rand()%15;
- switch (rand()%2)
- {
- case 0: Rand1X = 0 - Rand1; break;
- case 1: Rand1X = 0 + Rand1; break;
- }
- Rand1 = 0;
- Rand1 = rand()%15;
- switch (rand()%2)
- {
- case 0: Rand1Y = 0 - Rand1; break;
- case 1: Rand1Y = 0 + Rand1; break;
- }
- Rand1 = 0;
- SummonedAdds = DoSpawnCreature(8901, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
- if(SummonedAdds)
- ((CreatureAI*)SummonedAdds->AI())->AttackStart(victim);
- }
-
- void SummonMedics(Unit* victim)
- {
- Rand2 = rand()%10;
- switch (rand()%2)
- {
- case 0: Rand2X = 0 - Rand2; break;
- case 1: Rand2X = 0 + Rand2; break;
- }
- Rand2 = 0;
- Rand2 = rand()%10;
- switch (rand()%2)
- {
- case 0: Rand2Y = 0 - Rand2; break;
- case 1: Rand2Y = 0 + Rand2; break;
- }
- Rand2 = 0;
- SummonedMedics = DoSpawnCreature(8894, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
- if(SummonedMedics)
- ((CreatureAI*)SummonedMedics->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //MightyBlow_Timer
- if (MightyBlow_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
- MightyBlow_Timer = 18000;
- }else MightyBlow_Timer -= diff;
-
- //HamString_Timer
- if (HamString_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
- HamString_Timer = 15000;
- }else HamString_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 9000;
- }else Cleave_Timer -= diff;
-
- //Adds_Timer
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21 )
- {
- if (Adds_Timer < diff)
- {
- // summon 3 Adds every 25s
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
- SummonAdds(m_creature->getVictim());
-
- Adds_Timer = 25000;
- } else Adds_Timer -= diff;
- }
-
- //Summon Medics
- if ( !Medics && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21 )
- {
- SummonMedics(m_creature->getVictim());
- SummonMedics(m_creature->getVictim());
- Medics = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_general_angerforge(Creature *_Creature)
-{
- return new boss_general_angerforgeAI (_Creature);
-}
-
-void AddSC_boss_general_angerforge()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_general_angerforge";
- newscript->GetAI = GetAI_boss_general_angerforge;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_General_Angerforge
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_MIGHTYBLOW 14099
+#define SPELL_HAMSTRING 9080
+#define SPELL_CLEAVE 20691
+
+struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
+{
+ boss_general_angerforgeAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MightyBlow_Timer;
+ uint32 HamString_Timer;
+ uint32 Cleave_Timer;
+ uint32 Adds_Timer;
+ bool Medics;
+ int Rand1;
+ int Rand1X;
+ int Rand1Y;
+ int Rand2;
+ int Rand2X;
+ int Rand2Y;
+ Creature* SummonedAdds;
+ Creature* SummonedMedics;
+
+ void Reset()
+ {
+ MightyBlow_Timer = 8000;
+ HamString_Timer = 12000;
+ Cleave_Timer = 16000;
+ Adds_Timer = 0;
+ Medics = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonAdds(Unit* victim)
+ {
+ Rand1 = rand()%15;
+ switch (rand()%2)
+ {
+ case 0: Rand1X = 0 - Rand1; break;
+ case 1: Rand1X = 0 + Rand1; break;
+ }
+ Rand1 = 0;
+ Rand1 = rand()%15;
+ switch (rand()%2)
+ {
+ case 0: Rand1Y = 0 - Rand1; break;
+ case 1: Rand1Y = 0 + Rand1; break;
+ }
+ Rand1 = 0;
+ SummonedAdds = DoSpawnCreature(8901, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
+ if(SummonedAdds)
+ ((CreatureAI*)SummonedAdds->AI())->AttackStart(victim);
+ }
+
+ void SummonMedics(Unit* victim)
+ {
+ Rand2 = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: Rand2X = 0 - Rand2; break;
+ case 1: Rand2X = 0 + Rand2; break;
+ }
+ Rand2 = 0;
+ Rand2 = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: Rand2Y = 0 - Rand2; break;
+ case 1: Rand2Y = 0 + Rand2; break;
+ }
+ Rand2 = 0;
+ SummonedMedics = DoSpawnCreature(8894, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
+ if(SummonedMedics)
+ ((CreatureAI*)SummonedMedics->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //MightyBlow_Timer
+ if (MightyBlow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
+ MightyBlow_Timer = 18000;
+ }else MightyBlow_Timer -= diff;
+
+ //HamString_Timer
+ if (HamString_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
+ HamString_Timer = 15000;
+ }else HamString_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 9000;
+ }else Cleave_Timer -= diff;
+
+ //Adds_Timer
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21 )
+ {
+ if (Adds_Timer < diff)
+ {
+ // summon 3 Adds every 25s
+ SummonAdds(m_creature->getVictim());
+ SummonAdds(m_creature->getVictim());
+ SummonAdds(m_creature->getVictim());
+
+ Adds_Timer = 25000;
+ } else Adds_Timer -= diff;
+ }
+
+ //Summon Medics
+ if ( !Medics && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21 )
+ {
+ SummonMedics(m_creature->getVictim());
+ SummonMedics(m_creature->getVictim());
+ Medics = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_general_angerforge(Creature *_Creature)
+{
+ return new boss_general_angerforgeAI (_Creature);
+}
+
+void AddSC_boss_general_angerforge()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_general_angerforge";
+ newscript->GetAI = GetAI_boss_general_angerforge;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp
index 79647ea55ed..30caa104b31 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp
@@ -1,142 +1,142 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gloomrel
-SD%Complete: 80
-SDComment: Learning Smelt Dark Iron if tribute quest rewarded. Missing event and re-spawn GO Spectral Chalice
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_HAMSTRING 9080
-#define SPELL_CLEAVE 15579
-#define SPELL_MORTALSTRIKE 15708
-
-struct TRINITY_DLL_DECL boss_gloomrelAI : public ScriptedAI
-{
- boss_gloomrelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 HamString_Timer;
- uint32 Cleave_Timer;
- uint32 MortalStrike_Timer;
-
- void Reset()
- {
- HamString_Timer = 19000;
- Cleave_Timer = 6000;
- MortalStrike_Timer = 10000;
-
- m_creature->setFaction(734);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //HamString_Timer
- if (HamString_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
- HamString_Timer = 14000;
- }else HamString_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 8000;
- }else Cleave_Timer -= diff;
-
- //MortalStrike_Timer
- if (MortalStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
- MortalStrike_Timer = 12000;
- }else MortalStrike_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_gloomrel(Creature *_Creature)
-{
- return new boss_gloomrelAI (_Creature);
-}
-
-bool GossipHello_boss_gloomrel(Player *player, Creature *_Creature)
-{
- if (player->GetQuestRewardStatus(4083) == 1 && player->GetSkillValue(SKILL_MINING) >= 230 && !player->HasSpell(14891) )
- player->ADD_GOSSIP_ITEM(0, "Teach me the art of smelting dark iron", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if (player->GetQuestRewardStatus(4083) == 0 && player->GetSkillValue(SKILL_MINING) >= 230)
- player->ADD_GOSSIP_ITEM(0, "I want to pay tribute", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- player->ADD_GOSSIP_ITEM(0, "Challenge", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2602, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_boss_gloomrel(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(2606, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player, 14894, false);
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
- player->SEND_GOSSIP_MENU(2604, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+22:
- player->CLOSE_GOSSIP_MENU();
- //re-spawn object here
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 33);
- player->SEND_GOSSIP_MENU(2605, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+33:
- player->CLOSE_GOSSIP_MENU();
- //start event here, below code just temporary
- _Creature->setFaction(754);
- break;
- }
- return true;
-}
-
-void AddSC_boss_gloomrel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gloomrel";
- newscript->GetAI = GetAI_boss_gloomrel;
- newscript->pGossipHello = &GossipHello_boss_gloomrel;
- newscript->pGossipSelect = &GossipSelect_boss_gloomrel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gloomrel
+SD%Complete: 80
+SDComment: Learning Smelt Dark Iron if tribute quest rewarded. Missing event and re-spawn GO Spectral Chalice
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_HAMSTRING 9080
+#define SPELL_CLEAVE 15579
+#define SPELL_MORTALSTRIKE 15708
+
+struct TRINITY_DLL_DECL boss_gloomrelAI : public ScriptedAI
+{
+ boss_gloomrelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 HamString_Timer;
+ uint32 Cleave_Timer;
+ uint32 MortalStrike_Timer;
+
+ void Reset()
+ {
+ HamString_Timer = 19000;
+ Cleave_Timer = 6000;
+ MortalStrike_Timer = 10000;
+
+ m_creature->setFaction(734);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //HamString_Timer
+ if (HamString_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
+ HamString_Timer = 14000;
+ }else HamString_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 8000;
+ }else Cleave_Timer -= diff;
+
+ //MortalStrike_Timer
+ if (MortalStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
+ MortalStrike_Timer = 12000;
+ }else MortalStrike_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_gloomrel(Creature *_Creature)
+{
+ return new boss_gloomrelAI (_Creature);
+}
+
+bool GossipHello_boss_gloomrel(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestRewardStatus(4083) == 1 && player->GetSkillValue(SKILL_MINING) >= 230 && !player->HasSpell(14891) )
+ player->ADD_GOSSIP_ITEM(0, "Teach me the art of smelting dark iron", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ if (player->GetQuestRewardStatus(4083) == 0 && player->GetSkillValue(SKILL_MINING) >= 230)
+ player->ADD_GOSSIP_ITEM(0, "I want to pay tribute", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+
+ player->ADD_GOSSIP_ITEM(0, "Challenge", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(2602, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_boss_gloomrel(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(2606, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+11:
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player, 14894, false);
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
+ player->SEND_GOSSIP_MENU(2604, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+22:
+ player->CLOSE_GOSSIP_MENU();
+ //re-spawn object here
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 33);
+ player->SEND_GOSSIP_MENU(2605, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+33:
+ player->CLOSE_GOSSIP_MENU();
+ //start event here, below code just temporary
+ _Creature->setFaction(754);
+ break;
+ }
+ return true;
+}
+
+void AddSC_boss_gloomrel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gloomrel";
+ newscript->GetAI = GetAI_boss_gloomrel;
+ newscript->pGossipHello = &GossipHello_boss_gloomrel;
+ newscript->pGossipSelect = &GossipSelect_boss_gloomrel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp
index 9d3e3172569..91770069779 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp
@@ -1,81 +1,81 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gorosh_the_Dervish
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_WHIRLWIND 15589
-#define SPELL_MORTALSTRIKE 24573
-
-struct TRINITY_DLL_DECL boss_gorosh_the_dervishAI : public ScriptedAI
-{
- boss_gorosh_the_dervishAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 WhirlWind_Timer;
- uint32 MortalStrike_Timer;
-
- void Reset()
- {
- WhirlWind_Timer = 12000;
- MortalStrike_Timer = 22000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //WhirlWind_Timer
- if (WhirlWind_Timer < diff)
- {
- DoCast(m_creature,SPELL_WHIRLWIND);
- WhirlWind_Timer = 15000;
- }else WhirlWind_Timer -= diff;
-
- //MortalStrike_Timer
- if (MortalStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
- MortalStrike_Timer = 15000;
- }else MortalStrike_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_gorosh_the_dervish(Creature *_Creature)
-{
- return new boss_gorosh_the_dervishAI (_Creature);
-}
-
-void AddSC_boss_gorosh_the_dervish()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gorosh_the_dervish";
- newscript->GetAI = GetAI_boss_gorosh_the_dervish;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gorosh_the_Dervish
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_WHIRLWIND 15589
+#define SPELL_MORTALSTRIKE 24573
+
+struct TRINITY_DLL_DECL boss_gorosh_the_dervishAI : public ScriptedAI
+{
+ boss_gorosh_the_dervishAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 WhirlWind_Timer;
+ uint32 MortalStrike_Timer;
+
+ void Reset()
+ {
+ WhirlWind_Timer = 12000;
+ MortalStrike_Timer = 22000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //WhirlWind_Timer
+ if (WhirlWind_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_WHIRLWIND);
+ WhirlWind_Timer = 15000;
+ }else WhirlWind_Timer -= diff;
+
+ //MortalStrike_Timer
+ if (MortalStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
+ MortalStrike_Timer = 15000;
+ }else MortalStrike_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_gorosh_the_dervish(Creature *_Creature)
+{
+ return new boss_gorosh_the_dervishAI (_Creature);
+}
+
+void AddSC_boss_gorosh_the_dervish()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gorosh_the_dervish";
+ newscript->GetAI = GetAI_boss_gorosh_the_dervish;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp
index db9a66a0ea3..7e489cca5a7 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp
@@ -1,86 +1,86 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Grizzle
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_GROUNDTREMOR 6524
-#define SPELL_FRENZY 28371
-
-struct TRINITY_DLL_DECL boss_grizzleAI : public ScriptedAI
-{
- boss_grizzleAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 GroundTremor_Timer;
- uint32 Frenzy_Timer;
-
- void Reset()
- {
- GroundTremor_Timer = 12000;
- Frenzy_Timer =0;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //GroundTremor_Timer
- if (GroundTremor_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_GROUNDTREMOR);
- GroundTremor_Timer = 8000;
- }else GroundTremor_Timer -= diff;
-
- //Frenzy_Timer
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
- {
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature,SPELL_FRENZY);
- DoTextEmote("goes into a killing frenzy!",NULL);
-
- Frenzy_Timer = 15000;
- }else Frenzy_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_grizzle(Creature *_Creature)
-{
- return new boss_grizzleAI (_Creature);
-}
-
-void AddSC_boss_grizzle()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_grizzle";
- newscript->GetAI = GetAI_boss_grizzle;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Grizzle
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_GROUNDTREMOR 6524
+#define SPELL_FRENZY 28371
+
+struct TRINITY_DLL_DECL boss_grizzleAI : public ScriptedAI
+{
+ boss_grizzleAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 GroundTremor_Timer;
+ uint32 Frenzy_Timer;
+
+ void Reset()
+ {
+ GroundTremor_Timer = 12000;
+ Frenzy_Timer =0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //GroundTremor_Timer
+ if (GroundTremor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_GROUNDTREMOR);
+ GroundTremor_Timer = 8000;
+ }else GroundTremor_Timer -= diff;
+
+ //Frenzy_Timer
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
+ {
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FRENZY);
+ DoTextEmote("goes into a killing frenzy!",NULL);
+
+ Frenzy_Timer = 15000;
+ }else Frenzy_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_grizzle(Creature *_Creature)
+{
+ return new boss_grizzleAI (_Creature);
+}
+
+void AddSC_boss_grizzle()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_grizzle";
+ newscript->GetAI = GetAI_boss_grizzle;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp
index dc6c834bc8f..778c68f73d3 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp
@@ -1,105 +1,105 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Haterel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWBOLT 17483 //Not sure if right ID
-#define SPELL_MANABURN 10876
-#define SPELL_SHADOWSHIELD 22417
-#define SPELL_STRIKE 15580
-
-struct TRINITY_DLL_DECL boss_haterelAI : public ScriptedAI
-{
- boss_haterelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowBolt_Timer;
- uint32 ManaBurn_Timer;
- uint32 ShadowShield_Timer;
- uint32 Strike_Timer;
-
- void Reset()
- {
- ShadowBolt_Timer = 15000;
- ManaBurn_Timer = 3000;
- ShadowShield_Timer = 8000;
- Strike_Timer = 12000;
- }
-
- void Aggro(Unit *who)
- {
- }
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowBolt_Timer
- if (ShadowBolt_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_SHADOWBOLT);
- ShadowBolt_Timer = 7000;
- }else ShadowBolt_Timer -= diff;
-
- //ManaBurn_Timer
- if (ManaBurn_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_MANABURN);
- ManaBurn_Timer = 13000;
- }else ManaBurn_Timer -= diff;
-
- //ShadowShield_Timer
- if (ShadowShield_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHADOWSHIELD);
- ShadowShield_Timer = 25000;
- }else ShadowShield_Timer -= diff;
-
- //Strike_Timer
- if (Strike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_STRIKE);
- Strike_Timer = 10000;
- }else Strike_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_haterel(Creature *_Creature)
-{
- return new boss_haterelAI (_Creature);
-}
-
-void AddSC_boss_haterel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_haterel";
- newscript->GetAI = GetAI_boss_haterel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Haterel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWBOLT 17483 //Not sure if right ID
+#define SPELL_MANABURN 10876
+#define SPELL_SHADOWSHIELD 22417
+#define SPELL_STRIKE 15580
+
+struct TRINITY_DLL_DECL boss_haterelAI : public ScriptedAI
+{
+ boss_haterelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowBolt_Timer;
+ uint32 ManaBurn_Timer;
+ uint32 ShadowShield_Timer;
+ uint32 Strike_Timer;
+
+ void Reset()
+ {
+ ShadowBolt_Timer = 15000;
+ ManaBurn_Timer = 3000;
+ ShadowShield_Timer = 8000;
+ Strike_Timer = 12000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowBolt_Timer
+ if (ShadowBolt_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_SHADOWBOLT);
+ ShadowBolt_Timer = 7000;
+ }else ShadowBolt_Timer -= diff;
+
+ //ManaBurn_Timer
+ if (ManaBurn_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_MANABURN);
+ ManaBurn_Timer = 13000;
+ }else ManaBurn_Timer -= diff;
+
+ //ShadowShield_Timer
+ if (ShadowShield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHADOWSHIELD);
+ ShadowShield_Timer = 25000;
+ }else ShadowShield_Timer -= diff;
+
+ //Strike_Timer
+ if (Strike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_STRIKE);
+ Strike_Timer = 10000;
+ }else Strike_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_haterel(Creature *_Creature)
+{
+ return new boss_haterelAI (_Creature);
+}
+
+void AddSC_boss_haterel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_haterel";
+ newscript->GetAI = GetAI_boss_haterel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
index 6831ecf006e..8ee1a00c85b 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
@@ -1,105 +1,105 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_High_Interrogator_Gerstahn
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWWORDPAIN 10894
-#define SPELL_MANABURN 10876
-#define SPELL_PSYCHICSCREAM 8122
-#define SPELL_SHADOWSHIELD 22417
-
-struct TRINITY_DLL_DECL boss_high_interrogator_gerstahnAI : public ScriptedAI
-{
- boss_high_interrogator_gerstahnAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowWordPain_Timer;
- uint32 ManaBurn_Timer;
- uint32 PsychicScream_Timer;
- uint32 ShadowShield_Timer;
-
- void Reset()
- {
- ShadowWordPain_Timer = 4000;
- ManaBurn_Timer = 14000;
- PsychicScream_Timer = 32000;
- ShadowShield_Timer = 8000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowWordPain_Timer
- if (ShadowWordPain_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)DoCast(target,SPELL_SHADOWWORDPAIN);
- ShadowWordPain_Timer = 7000;
- }else ShadowWordPain_Timer -= diff;
-
- //ManaBurn_Timer
- if (ManaBurn_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)DoCast(target,SPELL_MANABURN);
- ManaBurn_Timer = 10000;
- }else ManaBurn_Timer -= diff;
-
- //PsychicScream_Timer
- if (PsychicScream_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_PSYCHICSCREAM);
- PsychicScream_Timer = 30000;
- }else PsychicScream_Timer -= diff;
-
- //ShadowShield_Timer
- if (ShadowShield_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHADOWSHIELD);
- ShadowShield_Timer = 25000;
- }else ShadowShield_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_high_interrogator_gerstahn(Creature *_Creature)
-{
- return new boss_high_interrogator_gerstahnAI (_Creature);
-}
-
-void AddSC_boss_high_interrogator_gerstahn()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_high_interrogator_gerstahn";
- newscript->GetAI = GetAI_boss_high_interrogator_gerstahn;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_High_Interrogator_Gerstahn
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWWORDPAIN 10894
+#define SPELL_MANABURN 10876
+#define SPELL_PSYCHICSCREAM 8122
+#define SPELL_SHADOWSHIELD 22417
+
+struct TRINITY_DLL_DECL boss_high_interrogator_gerstahnAI : public ScriptedAI
+{
+ boss_high_interrogator_gerstahnAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowWordPain_Timer;
+ uint32 ManaBurn_Timer;
+ uint32 PsychicScream_Timer;
+ uint32 ShadowShield_Timer;
+
+ void Reset()
+ {
+ ShadowWordPain_Timer = 4000;
+ ManaBurn_Timer = 14000;
+ PsychicScream_Timer = 32000;
+ ShadowShield_Timer = 8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowWordPain_Timer
+ if (ShadowWordPain_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)DoCast(target,SPELL_SHADOWWORDPAIN);
+ ShadowWordPain_Timer = 7000;
+ }else ShadowWordPain_Timer -= diff;
+
+ //ManaBurn_Timer
+ if (ManaBurn_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)DoCast(target,SPELL_MANABURN);
+ ManaBurn_Timer = 10000;
+ }else ManaBurn_Timer -= diff;
+
+ //PsychicScream_Timer
+ if (PsychicScream_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_PSYCHICSCREAM);
+ PsychicScream_Timer = 30000;
+ }else PsychicScream_Timer -= diff;
+
+ //ShadowShield_Timer
+ if (ShadowShield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHADOWSHIELD);
+ ShadowShield_Timer = 25000;
+ }else ShadowShield_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_high_interrogator_gerstahn(Creature *_Creature)
+{
+ return new boss_high_interrogator_gerstahnAI (_Creature);
+}
+
+void AddSC_boss_high_interrogator_gerstahn()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_high_interrogator_gerstahn";
+ newscript->GetAI = GetAI_boss_high_interrogator_gerstahn;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp
index c617f36dc05..0d163d31775 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp
@@ -1,84 +1,84 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Magmus
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FIERYBURST 13900
-#define SPELL_WARSTOMP 24375
-
-struct TRINITY_DLL_DECL boss_magmusAI : public ScriptedAI
-{
- boss_magmusAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FieryBurst_Timer;
- uint32 WarStomp_Timer;
-
- void Reset()
- {
- FieryBurst_Timer = 5000;
- WarStomp_Timer =0;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //FieryBurst_Timer
- if (FieryBurst_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIERYBURST);
- FieryBurst_Timer = 6000;
- }else FieryBurst_Timer -= diff;
-
- //WarStomp_Timer
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
- {
- if (WarStomp_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
- WarStomp_Timer = 8000;
- }else WarStomp_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_magmus(Creature *_Creature)
-{
- return new boss_magmusAI (_Creature);
-}
-
-void AddSC_boss_magmus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_magmus";
- newscript->GetAI = GetAI_boss_magmus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Magmus
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FIERYBURST 13900
+#define SPELL_WARSTOMP 24375
+
+struct TRINITY_DLL_DECL boss_magmusAI : public ScriptedAI
+{
+ boss_magmusAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FieryBurst_Timer;
+ uint32 WarStomp_Timer;
+
+ void Reset()
+ {
+ FieryBurst_Timer = 5000;
+ WarStomp_Timer =0;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FieryBurst_Timer
+ if (FieryBurst_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIERYBURST);
+ FieryBurst_Timer = 6000;
+ }else FieryBurst_Timer -= diff;
+
+ //WarStomp_Timer
+ if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
+ {
+ if (WarStomp_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
+ WarStomp_Timer = 8000;
+ }else WarStomp_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_magmus(Creature *_Creature)
+{
+ return new boss_magmusAI (_Creature);
+}
+
+void AddSC_boss_magmus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_magmus";
+ newscript->GetAI = GetAI_boss_magmus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
index d3dd3ddeae0..208353e66f3 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
@@ -1,99 +1,99 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Moira_Bronzbeard
-SD%Complete: 90
-SDComment: Healing of Emperor NYI
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_HEAL 10917
-#define SPELL_RENEW 10929
-#define SPELL_SHIELD 10901
-#define SPELL_MINDBLAST 10947
-#define SPELL_SHADOWWORDPAIN 10894
-#define SPELL_SMITE 10934
-
-struct TRINITY_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI
-{
- boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Heal_Timer;
- uint32 MindBlast_Timer;
- uint32 ShadowWordPain_Timer;
- uint32 Smite_Timer;
- Unit* PlayerHolder;
- Unit* Target;
- bool Heal;
-
- void Reset()
- {
- Target = NULL;
- Heal_Timer = 12000; //These times are probably wrong
- MindBlast_Timer = 16000;
- ShadowWordPain_Timer = 2000;
- Smite_Timer = 8000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //MindBlast_Timer
- if (MindBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
- MindBlast_Timer = 14000;
- }else MindBlast_Timer -= diff;
-
- //ShadowWordPain_Timer
- if (ShadowWordPain_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
- ShadowWordPain_Timer = 18000;
- }else ShadowWordPain_Timer -= diff;
-
- //Smite_Timer
- if (Smite_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SMITE);
- Smite_Timer = 10000;
- }else Smite_Timer -= diff;
-
- }
-};
-CreatureAI* GetAI_boss_moira_bronzebeard(Creature *_Creature)
-{
- return new boss_moira_bronzebeardAI (_Creature);
-}
-
-void AddSC_boss_moira_bronzebeard()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_moira_bronzebeard";
- newscript->GetAI = GetAI_boss_moira_bronzebeard;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Moira_Bronzbeard
+SD%Complete: 90
+SDComment: Healing of Emperor NYI
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_HEAL 10917
+#define SPELL_RENEW 10929
+#define SPELL_SHIELD 10901
+#define SPELL_MINDBLAST 10947
+#define SPELL_SHADOWWORDPAIN 10894
+#define SPELL_SMITE 10934
+
+struct TRINITY_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI
+{
+ boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Heal_Timer;
+ uint32 MindBlast_Timer;
+ uint32 ShadowWordPain_Timer;
+ uint32 Smite_Timer;
+ Unit* PlayerHolder;
+ Unit* Target;
+ bool Heal;
+
+ void Reset()
+ {
+ Target = NULL;
+ Heal_Timer = 12000; //These times are probably wrong
+ MindBlast_Timer = 16000;
+ ShadowWordPain_Timer = 2000;
+ Smite_Timer = 8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //MindBlast_Timer
+ if (MindBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
+ MindBlast_Timer = 14000;
+ }else MindBlast_Timer -= diff;
+
+ //ShadowWordPain_Timer
+ if (ShadowWordPain_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
+ ShadowWordPain_Timer = 18000;
+ }else ShadowWordPain_Timer -= diff;
+
+ //Smite_Timer
+ if (Smite_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SMITE);
+ Smite_Timer = 10000;
+ }else Smite_Timer -= diff;
+
+ }
+};
+CreatureAI* GetAI_boss_moira_bronzebeard(Creature *_Creature)
+{
+ return new boss_moira_bronzebeardAI (_Creature);
+}
+
+void AddSC_boss_moira_bronzebeard()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_moira_bronzebeard";
+ newscript->GetAI = GetAI_boss_moira_bronzebeard;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp
index bed39db9a04..93f3c124f29 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp
@@ -1,115 +1,115 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Seethrel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FROSTBOLT 16799
-#define SPELL_FROSTARMOR 15784 //This is actually a buff he gives himself
-#define SPELL_BLIZZARD 19099
-#define SPELL_FROSTNOVA 15063
-#define SPELL_FROSTWARD 15004
-
-struct TRINITY_DLL_DECL boss_seethrelAI : public ScriptedAI
-{
- boss_seethrelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FrostArmor_Timer;
- uint32 Frostbolt_Timer;
- uint32 Blizzard_Timer;
- uint32 FrostNova_Timer;
- uint32 FrostWard_Timer;
-
- void Reset()
- {
- FrostArmor_Timer = 2000;
- Frostbolt_Timer = 6000;
- Blizzard_Timer = 18000;
- FrostNova_Timer = 12000;
- FrostWard_Timer = 25000;
-
- m_creature->CastSpell(m_creature,SPELL_FROSTARMOR,true);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //FrostArmor_Timer
- if (FrostArmor_Timer < diff)
- {
- DoCast(m_creature, SPELL_FROSTARMOR);
- FrostArmor_Timer = 180000;
- }else FrostArmor_Timer -= diff;
-
- //Frostbolt_Timer
- if (Frostbolt_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
- Frostbolt_Timer = 15000;
- }else Frostbolt_Timer -= diff;
-
- //Blizzard_Timer
- if (Blizzard_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_BLIZZARD);
- Blizzard_Timer = 22000;
- }else Blizzard_Timer -= diff;
-
- //FrostNova_Timer
- if (FrostNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROSTNOVA);
- FrostNova_Timer = 14000;
- }else FrostNova_Timer -= diff;
-
- //FrostWard_Timer
- if (FrostWard_Timer < diff)
- {
- DoCast(m_creature,SPELL_FROSTWARD);
- FrostWard_Timer = 68000;
- }else FrostWard_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_seethrel(Creature *_Creature)
-{
- return new boss_seethrelAI (_Creature);
-}
-
-void AddSC_boss_seethrel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_seethrel";
- newscript->GetAI = GetAI_boss_seethrel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Seethrel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FROSTBOLT 16799
+#define SPELL_FROSTARMOR 15784 //This is actually a buff he gives himself
+#define SPELL_BLIZZARD 19099
+#define SPELL_FROSTNOVA 15063
+#define SPELL_FROSTWARD 15004
+
+struct TRINITY_DLL_DECL boss_seethrelAI : public ScriptedAI
+{
+ boss_seethrelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FrostArmor_Timer;
+ uint32 Frostbolt_Timer;
+ uint32 Blizzard_Timer;
+ uint32 FrostNova_Timer;
+ uint32 FrostWard_Timer;
+
+ void Reset()
+ {
+ FrostArmor_Timer = 2000;
+ Frostbolt_Timer = 6000;
+ Blizzard_Timer = 18000;
+ FrostNova_Timer = 12000;
+ FrostWard_Timer = 25000;
+
+ m_creature->CastSpell(m_creature,SPELL_FROSTARMOR,true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FrostArmor_Timer
+ if (FrostArmor_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_FROSTARMOR);
+ FrostArmor_Timer = 180000;
+ }else FrostArmor_Timer -= diff;
+
+ //Frostbolt_Timer
+ if (Frostbolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
+ Frostbolt_Timer = 15000;
+ }else Frostbolt_Timer -= diff;
+
+ //Blizzard_Timer
+ if (Blizzard_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_BLIZZARD);
+ Blizzard_Timer = 22000;
+ }else Blizzard_Timer -= diff;
+
+ //FrostNova_Timer
+ if (FrostNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FROSTNOVA);
+ FrostNova_Timer = 14000;
+ }else FrostNova_Timer -= diff;
+
+ //FrostWard_Timer
+ if (FrostWard_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FROSTWARD);
+ FrostWard_Timer = 68000;
+ }else FrostWard_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_seethrel(Creature *_Creature)
+{
+ return new boss_seethrelAI (_Creature);
+}
+
+void AddSC_boss_seethrel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_seethrel";
+ newscript->GetAI = GetAI_boss_seethrel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp
index f9b8a68adc7..0ecf70148fe 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp
@@ -1,101 +1,101 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Vilerel
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Depths
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_MINDBLAST 15587
-#define SPELL_HEAL 15586
-#define SPELL_PRAYEROFHEALING 15585
-#define SPELL_SHIELD 10901
-
-struct TRINITY_DLL_DECL boss_vilerelAI : public ScriptedAI
-{
- boss_vilerelAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 MindBlast_Timer;
- uint32 Heal_Timer;
- uint32 PrayerOfHealing_Timer;
- uint32 Shield_Timer;
-
- void Reset()
- {
- MindBlast_Timer = 10000;
- Heal_Timer = 35000;
- PrayerOfHealing_Timer = 25000;
- Shield_Timer = 3000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //MindBlast_Timer
- if (MindBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
- MindBlast_Timer = 7000;
- }else MindBlast_Timer -= diff;
-
- //Heal_Timer
- if (Heal_Timer < diff)
- {
- DoCast(m_creature,SPELL_HEAL);
- Heal_Timer = 20000;
- }else Heal_Timer -= diff;
-
- //PrayerOfHealing_Timer
- if (PrayerOfHealing_Timer < diff)
- {
- DoCast(m_creature,SPELL_PRAYEROFHEALING);
- PrayerOfHealing_Timer = 30000;
- }else PrayerOfHealing_Timer -= diff;
-
- //Shield_Timer
- if (Shield_Timer < diff)
- {
- DoCast(m_creature,SPELL_SHIELD);
- Shield_Timer = 30000;
- }else Shield_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_vilerel(Creature *_Creature)
-{
- return new boss_vilerelAI (_Creature);
-}
-
-void AddSC_boss_vilerel()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_vilerel";
- newscript->GetAI = GetAI_boss_vilerel;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Vilerel
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Depths
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_MINDBLAST 15587
+#define SPELL_HEAL 15586
+#define SPELL_PRAYEROFHEALING 15585
+#define SPELL_SHIELD 10901
+
+struct TRINITY_DLL_DECL boss_vilerelAI : public ScriptedAI
+{
+ boss_vilerelAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 MindBlast_Timer;
+ uint32 Heal_Timer;
+ uint32 PrayerOfHealing_Timer;
+ uint32 Shield_Timer;
+
+ void Reset()
+ {
+ MindBlast_Timer = 10000;
+ Heal_Timer = 35000;
+ PrayerOfHealing_Timer = 25000;
+ Shield_Timer = 3000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //MindBlast_Timer
+ if (MindBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
+ MindBlast_Timer = 7000;
+ }else MindBlast_Timer -= diff;
+
+ //Heal_Timer
+ if (Heal_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_HEAL);
+ Heal_Timer = 20000;
+ }else Heal_Timer -= diff;
+
+ //PrayerOfHealing_Timer
+ if (PrayerOfHealing_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_PRAYEROFHEALING);
+ PrayerOfHealing_Timer = 30000;
+ }else PrayerOfHealing_Timer -= diff;
+
+ //Shield_Timer
+ if (Shield_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SHIELD);
+ Shield_Timer = 30000;
+ }else Shield_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_vilerel(Creature *_Creature)
+{
+ return new boss_vilerelAI (_Creature);
+}
+
+void AddSC_boss_vilerel()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_vilerel";
+ newscript->GetAI = GetAI_boss_vilerel;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp
index d9231f50f21..c26ba2ed6b9 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp
@@ -1,101 +1,101 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Drakkisath
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FIRENOVA 23462
-#define SPELL_CLEAVE 20691
-#define SPELL_CONFLIGURATION 16805
-#define SPELL_THUNDERCLAP 15548 //Not sure if right ID. 23931 would be a harder possibility.
-
-struct TRINITY_DLL_DECL boss_drakkisathAI : public ScriptedAI
-{
- boss_drakkisathAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FireNova_Timer;
- uint32 Cleave_Timer;
- uint32 Confliguration_Timer;
- uint32 Thunderclap_Timer;
-
- void Reset()
- {
- FireNova_Timer = 6000;
- Cleave_Timer = 8000;
- Confliguration_Timer = 15000;
- Thunderclap_Timer = 17000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //FireNova_Timer
- if (FireNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
- FireNova_Timer = 10000;
- }else FireNova_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 8000;
- }else Cleave_Timer -= diff;
-
- //Confliguration_Timer
- if (Confliguration_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CONFLIGURATION);
- Confliguration_Timer = 18000;
- }else Confliguration_Timer -= diff;
-
- //Thunderclap_Timer
- if (Thunderclap_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- Thunderclap_Timer = 20000;
- }else Thunderclap_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_drakkisath(Creature *_Creature)
-{
- return new boss_drakkisathAI (_Creature);
-}
-
-void AddSC_boss_drakkisath()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_drakkisath";
- newscript->GetAI = GetAI_boss_drakkisath;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Drakkisath
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FIRENOVA 23462
+#define SPELL_CLEAVE 20691
+#define SPELL_CONFLIGURATION 16805
+#define SPELL_THUNDERCLAP 15548 //Not sure if right ID. 23931 would be a harder possibility.
+
+struct TRINITY_DLL_DECL boss_drakkisathAI : public ScriptedAI
+{
+ boss_drakkisathAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FireNova_Timer;
+ uint32 Cleave_Timer;
+ uint32 Confliguration_Timer;
+ uint32 Thunderclap_Timer;
+
+ void Reset()
+ {
+ FireNova_Timer = 6000;
+ Cleave_Timer = 8000;
+ Confliguration_Timer = 15000;
+ Thunderclap_Timer = 17000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FireNova_Timer
+ if (FireNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
+ FireNova_Timer = 10000;
+ }else FireNova_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 8000;
+ }else Cleave_Timer -= diff;
+
+ //Confliguration_Timer
+ if (Confliguration_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CONFLIGURATION);
+ Confliguration_Timer = 18000;
+ }else Confliguration_Timer -= diff;
+
+ //Thunderclap_Timer
+ if (Thunderclap_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ Thunderclap_Timer = 20000;
+ }else Thunderclap_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_drakkisath(Creature *_Creature)
+{
+ return new boss_drakkisathAI (_Creature);
+}
+
+void AddSC_boss_drakkisath()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_drakkisath";
+ newscript->GetAI = GetAI_boss_drakkisath;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp
index bc6100579a6..68107e820bf 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp
@@ -1,205 +1,205 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Gyth
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CORROSIVEACID 20667
-#define SPELL_FREEZE 18763
-#define SPELL_FLAMEBREATH 20712
-
-struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
-{
- boss_gythAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Aggro_Timer;
- uint32 Dragons_Timer;
- uint32 Orc_Timer;
- uint32 CorrosiveAcid_Timer;
- uint32 Freeze_Timer;
- uint32 Flamebreath_Timer;
- uint32 Line1Count;
- uint32 Line2Count;
-
- bool Event;
- bool SummonedDragons;
- bool SummonedOrcs;
- bool SummonedRend;
- bool bAggro;
- bool RootSelf;
- Creature *SummonedCreature;
-
- void Reset()
- {
- Dragons_Timer = 3000;
- Orc_Timer = 60000;
- Aggro_Timer = 60000;
- CorrosiveAcid_Timer = 8000;
- Freeze_Timer = 11000;
- Flamebreath_Timer = 4000;
- Event = false;
- SummonedDragons = false;
- SummonedOrcs= false;
- SummonedRend = false;
- bAggro = false;
- RootSelf = false;
-
- // how many times should the two lines of summoned creatures be spawned
- // min 2 x 2, max 7 lines of attack in total
- Line1Count = rand() % 4 + 2;
- if (Line1Count < 5)
- Line2Count = rand() % (5 - Line1Count) + 2;
- else
- Line2Count = 2;
-
- //Invisible for event start
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void SummonCreatureWithRandomTarget(uint32 creatureId)
- {
- Unit* Summoned = m_creature->SummonCreature(creatureId, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000);
- if (Summoned)
- {
- Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (target)
- Summoned->AddThreat(target, 1.0f);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //char buf[200];
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if (!RootSelf)
- {
- //m_creature->m_canMove = true;
- DoCast(m_creature, 33356);
- RootSelf = true;
- }
-
- if (!bAggro && Line1Count == 0 && Line2Count == 0)
- {
- if (Aggro_Timer < diff)
- {
- bAggro = true;
- // Visible now!
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 9723);
- m_creature->setFaction(14);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- } else Aggro_Timer -= diff;
- }
-
- // Summon Dragon pack. 2 Dragons and 3 Whelps
- if (!bAggro && !SummonedRend && Line1Count > 0)
- {
- if (Dragons_Timer < diff)
- {
- SummonCreatureWithRandomTarget(10372);
- SummonCreatureWithRandomTarget(10372);
- SummonCreatureWithRandomTarget(10442);
- SummonCreatureWithRandomTarget(10442);
- SummonCreatureWithRandomTarget(10442);
- Line1Count = Line1Count - 1;
- Dragons_Timer = 60000;
- } else Dragons_Timer -= diff;
- }
-
- //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps
- if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0)
- {
- if (Orc_Timer < diff)
- {
- SummonCreatureWithRandomTarget(10447);
- SummonCreatureWithRandomTarget(10317);
- SummonCreatureWithRandomTarget(10442);
- SummonCreatureWithRandomTarget(10442);
- SummonCreatureWithRandomTarget(10442);
- Line2Count = Line2Count - 1;
- Orc_Timer = 60000;
- } else Orc_Timer -= diff;
- }
-
- // we take part in the fight
- if (bAggro)
- {
- // CorrosiveAcid_Timer
- if (CorrosiveAcid_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_CORROSIVEACID);
- CorrosiveAcid_Timer = 7000;
- } else CorrosiveAcid_Timer -= diff;
-
- // Freeze_Timer
- if (Freeze_Timer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FREEZE);
- Freeze_Timer = 16000;
- } else Freeze_Timer -= diff;
-
- // Flamebreath_Timer
- if (Flamebreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH);
- Flamebreath_Timer = 10500;
- } else Flamebreath_Timer -= diff;
-
- //Summon Rend
- if (!SummonedRend && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11
- && m_creature->GetHealth() > 0 )
- {
- //summon Rend and Change model to normal Gyth
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
- //Gyth model
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 9806);
- m_creature->SummonCreature(10429, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
- SummonedRend = true;
- }
-
- DoMeleeAttackIfReady();
- } // end if Aggro
- }
-};
-
-CreatureAI* GetAI_boss_gyth(Creature *_Creature)
-{
- return new boss_gythAI (_Creature);
-}
-
-void AddSC_boss_gyth()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_gyth";
- newscript->GetAI = GetAI_boss_gyth;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Gyth
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CORROSIVEACID 20667
+#define SPELL_FREEZE 18763
+#define SPELL_FLAMEBREATH 20712
+
+struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
+{
+ boss_gythAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Aggro_Timer;
+ uint32 Dragons_Timer;
+ uint32 Orc_Timer;
+ uint32 CorrosiveAcid_Timer;
+ uint32 Freeze_Timer;
+ uint32 Flamebreath_Timer;
+ uint32 Line1Count;
+ uint32 Line2Count;
+
+ bool Event;
+ bool SummonedDragons;
+ bool SummonedOrcs;
+ bool SummonedRend;
+ bool bAggro;
+ bool RootSelf;
+ Creature *SummonedCreature;
+
+ void Reset()
+ {
+ Dragons_Timer = 3000;
+ Orc_Timer = 60000;
+ Aggro_Timer = 60000;
+ CorrosiveAcid_Timer = 8000;
+ Freeze_Timer = 11000;
+ Flamebreath_Timer = 4000;
+ Event = false;
+ SummonedDragons = false;
+ SummonedOrcs= false;
+ SummonedRend = false;
+ bAggro = false;
+ RootSelf = false;
+
+ // how many times should the two lines of summoned creatures be spawned
+ // min 2 x 2, max 7 lines of attack in total
+ Line1Count = rand() % 4 + 2;
+ if (Line1Count < 5)
+ Line2Count = rand() % (5 - Line1Count) + 2;
+ else
+ Line2Count = 2;
+
+ //Invisible for event start
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void SummonCreatureWithRandomTarget(uint32 creatureId)
+ {
+ Unit* Summoned = m_creature->SummonCreature(creatureId, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000);
+ if (Summoned)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (target)
+ Summoned->AddThreat(target, 1.0f);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //char buf[200];
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if (!RootSelf)
+ {
+ //m_creature->m_canMove = true;
+ DoCast(m_creature, 33356);
+ RootSelf = true;
+ }
+
+ if (!bAggro && Line1Count == 0 && Line2Count == 0)
+ {
+ if (Aggro_Timer < diff)
+ {
+ bAggro = true;
+ // Visible now!
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 9723);
+ m_creature->setFaction(14);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ } else Aggro_Timer -= diff;
+ }
+
+ // Summon Dragon pack. 2 Dragons and 3 Whelps
+ if (!bAggro && !SummonedRend && Line1Count > 0)
+ {
+ if (Dragons_Timer < diff)
+ {
+ SummonCreatureWithRandomTarget(10372);
+ SummonCreatureWithRandomTarget(10372);
+ SummonCreatureWithRandomTarget(10442);
+ SummonCreatureWithRandomTarget(10442);
+ SummonCreatureWithRandomTarget(10442);
+ Line1Count = Line1Count - 1;
+ Dragons_Timer = 60000;
+ } else Dragons_Timer -= diff;
+ }
+
+ //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps
+ if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0)
+ {
+ if (Orc_Timer < diff)
+ {
+ SummonCreatureWithRandomTarget(10447);
+ SummonCreatureWithRandomTarget(10317);
+ SummonCreatureWithRandomTarget(10442);
+ SummonCreatureWithRandomTarget(10442);
+ SummonCreatureWithRandomTarget(10442);
+ Line2Count = Line2Count - 1;
+ Orc_Timer = 60000;
+ } else Orc_Timer -= diff;
+ }
+
+ // we take part in the fight
+ if (bAggro)
+ {
+ // CorrosiveAcid_Timer
+ if (CorrosiveAcid_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CORROSIVEACID);
+ CorrosiveAcid_Timer = 7000;
+ } else CorrosiveAcid_Timer -= diff;
+
+ // Freeze_Timer
+ if (Freeze_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FREEZE);
+ Freeze_Timer = 16000;
+ } else Freeze_Timer -= diff;
+
+ // Flamebreath_Timer
+ if (Flamebreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH);
+ Flamebreath_Timer = 10500;
+ } else Flamebreath_Timer -= diff;
+
+ //Summon Rend
+ if (!SummonedRend && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11
+ && m_creature->GetHealth() > 0 )
+ {
+ //summon Rend and Change model to normal Gyth
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+ //Gyth model
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 9806);
+ m_creature->SummonCreature(10429, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
+ SummonedRend = true;
+ }
+
+ DoMeleeAttackIfReady();
+ } // end if Aggro
+ }
+};
+
+CreatureAI* GetAI_boss_gyth(Creature *_Creature)
+{
+ return new boss_gythAI (_Creature);
+}
+
+void AddSC_boss_gyth()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_gyth";
+ newscript->GetAI = GetAI_boss_gyth;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp
index 0cd834fa7c9..0b2c09acccf 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp
@@ -1,95 +1,95 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Halycon
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CROWDPUMMEL 10887
-#define SPELL_MIGHTYBLOW 14099
-
-#define ADD_1X -169.839203
-#define ADD_1Y -324.961395
-#define ADD_1Z 64.401443
-#define ADD_1O 3.124724
-
-struct TRINITY_DLL_DECL boss_halyconAI : public ScriptedAI
-{
- boss_halyconAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CrowdPummel_Timer;
- uint32 MightyBlow_Timer;
- bool Summoned;
-
- void Reset()
- {
- CrowdPummel_Timer = 8000;
- MightyBlow_Timer = 14000;
- Summoned = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //CrowdPummel_Timer
- if (CrowdPummel_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL);
- CrowdPummel_Timer = 14000;
- }else CrowdPummel_Timer -= diff;
-
- //MightyBlow_Timer
- if (MightyBlow_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
- MightyBlow_Timer = 10000;
- }else MightyBlow_Timer -= diff;
-
- //Summon Gizrul
- if ( !Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25 )
- {
- m_creature->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
- Summoned = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_halycon(Creature *_Creature)
-{
- return new boss_halyconAI (_Creature);
-}
-
-void AddSC_boss_halycon()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_halycon";
- newscript->GetAI = GetAI_boss_halycon;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Halycon
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CROWDPUMMEL 10887
+#define SPELL_MIGHTYBLOW 14099
+
+#define ADD_1X -169.839203
+#define ADD_1Y -324.961395
+#define ADD_1Z 64.401443
+#define ADD_1O 3.124724
+
+struct TRINITY_DLL_DECL boss_halyconAI : public ScriptedAI
+{
+ boss_halyconAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CrowdPummel_Timer;
+ uint32 MightyBlow_Timer;
+ bool Summoned;
+
+ void Reset()
+ {
+ CrowdPummel_Timer = 8000;
+ MightyBlow_Timer = 14000;
+ Summoned = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //CrowdPummel_Timer
+ if (CrowdPummel_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL);
+ CrowdPummel_Timer = 14000;
+ }else CrowdPummel_Timer -= diff;
+
+ //MightyBlow_Timer
+ if (MightyBlow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
+ MightyBlow_Timer = 10000;
+ }else MightyBlow_Timer -= diff;
+
+ //Summon Gizrul
+ if ( !Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25 )
+ {
+ m_creature->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
+ Summoned = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_halycon(Creature *_Creature)
+{
+ return new boss_halyconAI (_Creature);
+}
+
+void AddSC_boss_halycon()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_halycon";
+ newscript->GetAI = GetAI_boss_halycon;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp
index cf20cf422c6..afaedcc4ad8 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp
@@ -1,131 +1,131 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Highlord_Omokk
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_WARSTOMP 24375
-#define SPELL_CLEAVE 15579
-#define SPELL_STRIKE 18368
-#define SPELL_REND 18106
-#define SPELL_SUNDERARMOR 24317
-#define SPELL_KNOCKAWAY 20686
-#define SPELL_SLOW 22356
-
-struct TRINITY_DLL_DECL boss_highlordomokkAI : public ScriptedAI
-{
- boss_highlordomokkAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 WarStomp_Timer;
- uint32 Cleave_Timer;
- uint32 Strike_Timer;
- uint32 Rend_Timer;
- uint32 SunderArmor_Timer;
- uint32 KnockAway_Timer;
- uint32 Slow_Timer;
-
- void Reset()
- {
- WarStomp_Timer = 15000;
- Cleave_Timer = 6000;
- Strike_Timer = 10000;
- Rend_Timer = 14000;
- SunderArmor_Timer = 2000;
- KnockAway_Timer = 18000;
- Slow_Timer = 24000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //WarStomp_Timer
- if (WarStomp_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
- WarStomp_Timer = 14000;
- }else WarStomp_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 8000;
- }else Cleave_Timer -= diff;
-
- //Strike_Timer
- if (Strike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_STRIKE);
- Strike_Timer = 10000;
- }else Strike_Timer -= diff;
-
- //Rend_Timer
- if (Rend_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_REND);
- Rend_Timer = 18000;
- }else Rend_Timer -= diff;
-
- //SunderArmor_Timer
- if (SunderArmor_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
- SunderArmor_Timer = 25000;
- }else SunderArmor_Timer -= diff;
-
- //KnockAway_Timer
- if (KnockAway_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
- KnockAway_Timer = 12000;
- }else KnockAway_Timer -= diff;
-
- //Slow_Timer
- if (Slow_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SLOW);
- Slow_Timer = 18000;
- }else Slow_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_highlordomokk(Creature *_Creature)
-{
- return new boss_highlordomokkAI (_Creature);
-}
-
-void AddSC_boss_highlordomokk()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_highlord_omokk";
- newscript->GetAI = GetAI_boss_highlordomokk;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Highlord_Omokk
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_WARSTOMP 24375
+#define SPELL_CLEAVE 15579
+#define SPELL_STRIKE 18368
+#define SPELL_REND 18106
+#define SPELL_SUNDERARMOR 24317
+#define SPELL_KNOCKAWAY 20686
+#define SPELL_SLOW 22356
+
+struct TRINITY_DLL_DECL boss_highlordomokkAI : public ScriptedAI
+{
+ boss_highlordomokkAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 WarStomp_Timer;
+ uint32 Cleave_Timer;
+ uint32 Strike_Timer;
+ uint32 Rend_Timer;
+ uint32 SunderArmor_Timer;
+ uint32 KnockAway_Timer;
+ uint32 Slow_Timer;
+
+ void Reset()
+ {
+ WarStomp_Timer = 15000;
+ Cleave_Timer = 6000;
+ Strike_Timer = 10000;
+ Rend_Timer = 14000;
+ SunderArmor_Timer = 2000;
+ KnockAway_Timer = 18000;
+ Slow_Timer = 24000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //WarStomp_Timer
+ if (WarStomp_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
+ WarStomp_Timer = 14000;
+ }else WarStomp_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 8000;
+ }else Cleave_Timer -= diff;
+
+ //Strike_Timer
+ if (Strike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_STRIKE);
+ Strike_Timer = 10000;
+ }else Strike_Timer -= diff;
+
+ //Rend_Timer
+ if (Rend_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_REND);
+ Rend_Timer = 18000;
+ }else Rend_Timer -= diff;
+
+ //SunderArmor_Timer
+ if (SunderArmor_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
+ SunderArmor_Timer = 25000;
+ }else SunderArmor_Timer -= diff;
+
+ //KnockAway_Timer
+ if (KnockAway_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
+ KnockAway_Timer = 12000;
+ }else KnockAway_Timer -= diff;
+
+ //Slow_Timer
+ if (Slow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SLOW);
+ Slow_Timer = 18000;
+ }else Slow_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_highlordomokk(Creature *_Creature)
+{
+ return new boss_highlordomokkAI (_Creature);
+}
+
+void AddSC_boss_highlordomokk()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_highlord_omokk";
+ newscript->GetAI = GetAI_boss_highlordomokk;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp
index 0c77b2f4658..8c1d3096597 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp
@@ -1,86 +1,86 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Mother_Smolderweb
-SD%Complete: 100
-SDComment: Uncertain how often mother's milk is casted
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CRYSTALIZE 16104
-#define SPELL_MOTHERSMILK 16468
-#define SPELL_SUMMON_SPIRE_SPIDERLING 16103
-
-struct TRINITY_DLL_DECL boss_mothersmolderwebAI : public ScriptedAI
-{
- boss_mothersmolderwebAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Crystalize_Timer;
- uint32 MothersMilk_Timer;
-
- void Reset()
- {
- Crystalize_Timer = 20000;
- MothersMilk_Timer = 10000;
- }
-
- void Aggro(Unit *who) { }
-
- void DamageTaken(Unit *done_by, uint32 &damage)
- {
- if( m_creature->GetHealth() <= damage )
- m_creature->CastSpell(m_creature,SPELL_SUMMON_SPIRE_SPIDERLING,true);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Crystalize_Timer
- if( Crystalize_Timer < diff )
- {
- DoCast(m_creature,SPELL_CRYSTALIZE);
- Crystalize_Timer = 15000;
- }else Crystalize_Timer -= diff;
-
- //MothersMilk_Timer
- if( MothersMilk_Timer < diff )
- {
- DoCast(m_creature,SPELL_MOTHERSMILK);
- MothersMilk_Timer = 5000+rand()%7500;
- }else MothersMilk_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_mothersmolderweb(Creature *_Creature)
-{
- return new boss_mothersmolderwebAI (_Creature);
-}
-
-void AddSC_boss_mothersmolderweb()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_mother_smolderweb";
- newscript->GetAI = GetAI_boss_mothersmolderweb;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Mother_Smolderweb
+SD%Complete: 100
+SDComment: Uncertain how often mother's milk is casted
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CRYSTALIZE 16104
+#define SPELL_MOTHERSMILK 16468
+#define SPELL_SUMMON_SPIRE_SPIDERLING 16103
+
+struct TRINITY_DLL_DECL boss_mothersmolderwebAI : public ScriptedAI
+{
+ boss_mothersmolderwebAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Crystalize_Timer;
+ uint32 MothersMilk_Timer;
+
+ void Reset()
+ {
+ Crystalize_Timer = 20000;
+ MothersMilk_Timer = 10000;
+ }
+
+ void Aggro(Unit *who) { }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if( m_creature->GetHealth() <= damage )
+ m_creature->CastSpell(m_creature,SPELL_SUMMON_SPIRE_SPIDERLING,true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Crystalize_Timer
+ if( Crystalize_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_CRYSTALIZE);
+ Crystalize_Timer = 15000;
+ }else Crystalize_Timer -= diff;
+
+ //MothersMilk_Timer
+ if( MothersMilk_Timer < diff )
+ {
+ DoCast(m_creature,SPELL_MOTHERSMILK);
+ MothersMilk_Timer = 5000+rand()%7500;
+ }else MothersMilk_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_mothersmolderweb(Creature *_Creature)
+{
+ return new boss_mothersmolderwebAI (_Creature);
+}
+
+void AddSC_boss_mothersmolderweb()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_mother_smolderweb";
+ newscript->GetAI = GetAI_boss_mothersmolderweb;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp
index d805d3d13f5..5ab5847e38a 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp
@@ -1,127 +1,127 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Overlord_Wyrmthalak
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_BLASTWAVE 11130
-#define SPELL_SHOUT 23511
-#define SPELL_CLEAVE 20691
-#define SPELL_KNOCKAWAY 20686
-
-#define ADD_1X -39.355381
-#define ADD_1Y -513.456482
-#define ADD_1Z 88.472046
-#define ADD_1O 4.679872
-
-#define ADD_2X -49.875881
-#define ADD_2Y -511.896942
-#define ADD_2Z 88.195160
-#define ADD_2O 4.613114
-
-struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI
-{
- boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 BlastWave_Timer;
- uint32 Shout_Timer;
- uint32 Cleave_Timer;
- uint32 Knockaway_Timer;
- bool Summoned;
- Creature *SummonedCreature;
-
- void Reset()
- {
- BlastWave_Timer = 20000;
- Shout_Timer = 2000;
- Cleave_Timer = 6000;
- Knockaway_Timer = 12000;
- Summoned = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //BlastWave_Timer
- if (BlastWave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
- BlastWave_Timer = 20000;
- }else BlastWave_Timer -= diff;
-
- //Shout_Timer
- if (Shout_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHOUT);
- Shout_Timer = 10000;
- }else Shout_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- //Knockaway_Timer
- if (Knockaway_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
- Knockaway_Timer = 14000;
- }else Knockaway_Timer -= diff;
-
- //Summon two Beserks
- if ( !Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
- ((CreatureAI*)SummonedCreature->AI())->AttackStart(target);
- SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000);
- ((CreatureAI*)SummonedCreature->AI())->AttackStart(target);
- Summoned = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_overlordwyrmthalak(Creature *_Creature)
-{
- return new boss_overlordwyrmthalakAI (_Creature);
-}
-
-void AddSC_boss_overlordwyrmthalak()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_overlord_wyrmthalak";
- newscript->GetAI = GetAI_boss_overlordwyrmthalak;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Overlord_Wyrmthalak
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_BLASTWAVE 11130
+#define SPELL_SHOUT 23511
+#define SPELL_CLEAVE 20691
+#define SPELL_KNOCKAWAY 20686
+
+#define ADD_1X -39.355381
+#define ADD_1Y -513.456482
+#define ADD_1Z 88.472046
+#define ADD_1O 4.679872
+
+#define ADD_2X -49.875881
+#define ADD_2Y -511.896942
+#define ADD_2Z 88.195160
+#define ADD_2O 4.613114
+
+struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI
+{
+ boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 BlastWave_Timer;
+ uint32 Shout_Timer;
+ uint32 Cleave_Timer;
+ uint32 Knockaway_Timer;
+ bool Summoned;
+ Creature *SummonedCreature;
+
+ void Reset()
+ {
+ BlastWave_Timer = 20000;
+ Shout_Timer = 2000;
+ Cleave_Timer = 6000;
+ Knockaway_Timer = 12000;
+ Summoned = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //BlastWave_Timer
+ if (BlastWave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
+ BlastWave_Timer = 20000;
+ }else BlastWave_Timer -= diff;
+
+ //Shout_Timer
+ if (Shout_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHOUT);
+ Shout_Timer = 10000;
+ }else Shout_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ //Knockaway_Timer
+ if (Knockaway_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
+ Knockaway_Timer = 14000;
+ }else Knockaway_Timer -= diff;
+
+ //Summon two Beserks
+ if ( !Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 )
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
+ ((CreatureAI*)SummonedCreature->AI())->AttackStart(target);
+ SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000);
+ ((CreatureAI*)SummonedCreature->AI())->AttackStart(target);
+ Summoned = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_overlordwyrmthalak(Creature *_Creature)
+{
+ return new boss_overlordwyrmthalakAI (_Creature);
+}
+
+void AddSC_boss_overlordwyrmthalak()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_overlord_wyrmthalak";
+ newscript->GetAI = GetAI_boss_overlordwyrmthalak;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp
index 2c75dce3dd0..f7705c647af 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp
@@ -1,93 +1,93 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Pyroguard_Emberseer
-SD%Complete: 100
-SDComment: Event to activate Emberseer NYI
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FIRENOVA 23462
-#define SPELL_FLAMEBUFFET 23341
-#define SPELL_PYROBLAST 17274
-
-struct TRINITY_DLL_DECL boss_pyroguard_emberseerAI : public ScriptedAI
-{
- boss_pyroguard_emberseerAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 FireNova_Timer;
- uint32 FlameBuffet_Timer;
- uint32 PyroBlast_Timer;
-
- void Reset()
- {
- FireNova_Timer = 6000;
- FlameBuffet_Timer = 3000;
- PyroBlast_Timer = 14000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //FireNova_Timer
- if (FireNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
- FireNova_Timer = 6000;
- }else FireNova_Timer -= diff;
-
- //FlameBuffet_Timer
- if (FlameBuffet_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET);
- FlameBuffet_Timer = 14000;
- }else FlameBuffet_Timer -= diff;
-
- //PyroBlast_Timer
- if (PyroBlast_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_PYROBLAST);
- PyroBlast_Timer = 15000;
- }else PyroBlast_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_pyroguard_emberseer(Creature *_Creature)
-{
- return new boss_pyroguard_emberseerAI (_Creature);
-}
-
-void AddSC_boss_pyroguard_emberseer()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_pyroguard_emberseer";
- newscript->GetAI = GetAI_boss_pyroguard_emberseer;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Pyroguard_Emberseer
+SD%Complete: 100
+SDComment: Event to activate Emberseer NYI
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FIRENOVA 23462
+#define SPELL_FLAMEBUFFET 23341
+#define SPELL_PYROBLAST 17274
+
+struct TRINITY_DLL_DECL boss_pyroguard_emberseerAI : public ScriptedAI
+{
+ boss_pyroguard_emberseerAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 FireNova_Timer;
+ uint32 FlameBuffet_Timer;
+ uint32 PyroBlast_Timer;
+
+ void Reset()
+ {
+ FireNova_Timer = 6000;
+ FlameBuffet_Timer = 3000;
+ PyroBlast_Timer = 14000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FireNova_Timer
+ if (FireNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
+ FireNova_Timer = 6000;
+ }else FireNova_Timer -= diff;
+
+ //FlameBuffet_Timer
+ if (FlameBuffet_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET);
+ FlameBuffet_Timer = 14000;
+ }else FlameBuffet_Timer -= diff;
+
+ //PyroBlast_Timer
+ if (PyroBlast_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_PYROBLAST);
+ PyroBlast_Timer = 15000;
+ }else PyroBlast_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_pyroguard_emberseer(Creature *_Creature)
+{
+ return new boss_pyroguard_emberseerAI (_Creature);
+}
+
+void AddSC_boss_pyroguard_emberseer()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_pyroguard_emberseer";
+ newscript->GetAI = GetAI_boss_pyroguard_emberseer;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp
index 59076be8587..7c0901e1f40 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp
@@ -1,85 +1,85 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Quartmaster_Zigris
-SD%Complete: 100
-SDComment: Needs revision
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHOOT 16496
-#define SPELL_STUNBOMB 16497
-#define SPELL_HEALING_POTION 15504
-#define SPELL_HOOKEDNET 15609
-
-struct TRINITY_DLL_DECL boss_quatermasterzigrisAI : public ScriptedAI
-{
- boss_quatermasterzigrisAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Shoot_Timer;
- uint32 StunBomb_Timer;
- //uint32 HelingPotion_Timer;
-
- void Reset()
- {
- Shoot_Timer = 1000;
- StunBomb_Timer = 16000;
- //HelingPotion_Timer = 25000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Shoot_Timer
- if (Shoot_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHOOT);
- Shoot_Timer = 500;
- }else Shoot_Timer -= diff;
-
- //StunBomb_Timer
- if (StunBomb_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_STUNBOMB);
- StunBomb_Timer = 14000;
- }else StunBomb_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_quatermasterzigris(Creature *_Creature)
-{
- return new boss_quatermasterzigrisAI (_Creature);
-}
-
-void AddSC_boss_quatermasterzigris()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="quartermaster_zigris";
- newscript->GetAI = GetAI_boss_quatermasterzigris;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Quartmaster_Zigris
+SD%Complete: 100
+SDComment: Needs revision
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHOOT 16496
+#define SPELL_STUNBOMB 16497
+#define SPELL_HEALING_POTION 15504
+#define SPELL_HOOKEDNET 15609
+
+struct TRINITY_DLL_DECL boss_quatermasterzigrisAI : public ScriptedAI
+{
+ boss_quatermasterzigrisAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Shoot_Timer;
+ uint32 StunBomb_Timer;
+ //uint32 HelingPotion_Timer;
+
+ void Reset()
+ {
+ Shoot_Timer = 1000;
+ StunBomb_Timer = 16000;
+ //HelingPotion_Timer = 25000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Shoot_Timer
+ if (Shoot_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHOOT);
+ Shoot_Timer = 500;
+ }else Shoot_Timer -= diff;
+
+ //StunBomb_Timer
+ if (StunBomb_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_STUNBOMB);
+ StunBomb_Timer = 14000;
+ }else StunBomb_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_quatermasterzigris(Creature *_Creature)
+{
+ return new boss_quatermasterzigrisAI (_Creature);
+}
+
+void AddSC_boss_quatermasterzigris()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="quartermaster_zigris";
+ newscript->GetAI = GetAI_boss_quatermasterzigris;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp
index e36df935215..7ca84b3c429 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp
@@ -1,91 +1,91 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Rend_Blackhand
-SD%Complete: 100
-SDComment: Intro event NYI
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_WHIRLWIND 26038
-#define SPELL_CLEAVE 20691
-#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell
-
-struct TRINITY_DLL_DECL boss_rend_blackhandAI : public ScriptedAI
-{
- boss_rend_blackhandAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 WhirlWind_Timer;
- uint32 Cleave_Timer;
- uint32 Thunderclap_Timer;
-
- void Reset()
- {
- WhirlWind_Timer = 20000;
- Cleave_Timer = 5000;
- Thunderclap_Timer = 9000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //WhirlWind_Timer
- if (WhirlWind_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WHIRLWIND);
- WhirlWind_Timer = 18000;
- }else WhirlWind_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 10000;
- }else Cleave_Timer -= diff;
-
- //Thunderclap_Timer
- if (Thunderclap_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- Thunderclap_Timer = 16000;
- }else Thunderclap_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_rend_blackhand(Creature *_Creature)
-{
- return new boss_rend_blackhandAI (_Creature);
-}
-
-void AddSC_boss_rend_blackhand()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_rend_blackhand";
- newscript->GetAI = GetAI_boss_rend_blackhand;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Rend_Blackhand
+SD%Complete: 100
+SDComment: Intro event NYI
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_WHIRLWIND 26038
+#define SPELL_CLEAVE 20691
+#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell
+
+struct TRINITY_DLL_DECL boss_rend_blackhandAI : public ScriptedAI
+{
+ boss_rend_blackhandAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 WhirlWind_Timer;
+ uint32 Cleave_Timer;
+ uint32 Thunderclap_Timer;
+
+ void Reset()
+ {
+ WhirlWind_Timer = 20000;
+ Cleave_Timer = 5000;
+ Thunderclap_Timer = 9000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //WhirlWind_Timer
+ if (WhirlWind_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WHIRLWIND);
+ WhirlWind_Timer = 18000;
+ }else WhirlWind_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 10000;
+ }else Cleave_Timer -= diff;
+
+ //Thunderclap_Timer
+ if (Thunderclap_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ Thunderclap_Timer = 16000;
+ }else Thunderclap_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_rend_blackhand(Creature *_Creature)
+{
+ return new boss_rend_blackhandAI (_Creature);
+}
+
+void AddSC_boss_rend_blackhand()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_rend_blackhand";
+ newscript->GetAI = GetAI_boss_rend_blackhand;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
index 35c774b1e95..17c73e43c82 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
@@ -1,95 +1,95 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Shadow_Hunter_Voshgajin
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CURSEOFBLOOD 24673
-#define SPELL_HEX 16708
-#define SPELL_CLEAVE 20691
-
-struct TRINITY_DLL_DECL boss_shadowvoshAI : public ScriptedAI
-{
- boss_shadowvoshAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 CurseOfBlood_Timer;
- uint32 Hex_Timer;
- uint32 Cleave_Timer;
-
- void Reset()
- {
- CurseOfBlood_Timer = 2000;
- Hex_Timer = 8000;
- Cleave_Timer = 14000;
-
- //m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //CurseOfBlood_Timer
- if (CurseOfBlood_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CURSEOFBLOOD);
- CurseOfBlood_Timer = 45000;
- }else CurseOfBlood_Timer -= diff;
-
- //Hex_Timer
- if (Hex_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_HEX);
- Hex_Timer = 15000;
- }else Hex_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_shadowvosh(Creature *_Creature)
-{
- return new boss_shadowvoshAI (_Creature);
-}
-
-void AddSC_boss_shadowvosh()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_shadow_hunter_voshgajin";
- newscript->GetAI = GetAI_boss_shadowvosh;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Shadow_Hunter_Voshgajin
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CURSEOFBLOOD 24673
+#define SPELL_HEX 16708
+#define SPELL_CLEAVE 20691
+
+struct TRINITY_DLL_DECL boss_shadowvoshAI : public ScriptedAI
+{
+ boss_shadowvoshAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 CurseOfBlood_Timer;
+ uint32 Hex_Timer;
+ uint32 Cleave_Timer;
+
+ void Reset()
+ {
+ CurseOfBlood_Timer = 2000;
+ Hex_Timer = 8000;
+ Cleave_Timer = 14000;
+
+ //m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //CurseOfBlood_Timer
+ if (CurseOfBlood_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSEOFBLOOD);
+ CurseOfBlood_Timer = 45000;
+ }else CurseOfBlood_Timer -= diff;
+
+ //Hex_Timer
+ if (Hex_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_HEX);
+ Hex_Timer = 15000;
+ }else Hex_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_shadowvosh(Creature *_Creature)
+{
+ return new boss_shadowvoshAI (_Creature);
+}
+
+void AddSC_boss_shadowvosh()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_shadow_hunter_voshgajin";
+ newscript->GetAI = GetAI_boss_shadowvosh;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp
index 1d3edd0458b..d7e403d0e72 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp
@@ -1,93 +1,93 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_The_Best
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_FLAMEBREAK 16785
-#define SPELL_IMMOLATE 20294
-#define SPELL_TERRIFYINGROAR 14100
-
-struct TRINITY_DLL_DECL boss_thebeastAI : public ScriptedAI
-{
- boss_thebeastAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Flamebreak_Timer;
- uint32 Immolate_Timer;
- uint32 TerrifyingRoar_Timer;
-
- void Reset()
- {
- Flamebreak_Timer = 12000;
- Immolate_Timer = 3000;
- TerrifyingRoar_Timer = 23000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Flamebreak_Timer
- if (Flamebreak_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMEBREAK);
- Flamebreak_Timer = 10000;
- }else Flamebreak_Timer -= diff;
-
- //Immolate_Timer
- if (Immolate_Timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_IMMOLATE);
- Immolate_Timer = 8000;
- }else Immolate_Timer -= diff;
-
- //TerrifyingRoar_Timer
- if (TerrifyingRoar_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_TERRIFYINGROAR);
- TerrifyingRoar_Timer = 20000;
- }else TerrifyingRoar_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_thebeast(Creature *_Creature)
-{
- return new boss_thebeastAI (_Creature);
-}
-
-void AddSC_boss_thebeast()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_the_beast";
- newscript->GetAI = GetAI_boss_thebeast;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_The_Best
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_FLAMEBREAK 16785
+#define SPELL_IMMOLATE 20294
+#define SPELL_TERRIFYINGROAR 14100
+
+struct TRINITY_DLL_DECL boss_thebeastAI : public ScriptedAI
+{
+ boss_thebeastAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Flamebreak_Timer;
+ uint32 Immolate_Timer;
+ uint32 TerrifyingRoar_Timer;
+
+ void Reset()
+ {
+ Flamebreak_Timer = 12000;
+ Immolate_Timer = 3000;
+ TerrifyingRoar_Timer = 23000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Flamebreak_Timer
+ if (Flamebreak_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMEBREAK);
+ Flamebreak_Timer = 10000;
+ }else Flamebreak_Timer -= diff;
+
+ //Immolate_Timer
+ if (Immolate_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target) DoCast(target,SPELL_IMMOLATE);
+ Immolate_Timer = 8000;
+ }else Immolate_Timer -= diff;
+
+ //TerrifyingRoar_Timer
+ if (TerrifyingRoar_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_TERRIFYINGROAR);
+ TerrifyingRoar_Timer = 20000;
+ }else TerrifyingRoar_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_thebeast(Creature *_Creature)
+{
+ return new boss_thebeastAI (_Creature);
+}
+
+void AddSC_boss_thebeast()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_the_beast";
+ newscript->GetAI = GetAI_boss_thebeast;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp
index b349bd3ec25..7377b46526f 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp
@@ -1,121 +1,121 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Warmaster_Voone
-SD%Complete: 100
-SDComment:
-SDCategory: Blackrock Spire
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SNAPKICK 15618
-#define SPELL_CLEAVE 15579
-#define SPELL_UPPERCUT 10966
-#define SPELL_MORTALSTRIKE 16856
-#define SPELL_PUMMEL 15615
-#define SPELL_THROWAXE 16075
-
-struct TRINITY_DLL_DECL boss_warmastervooneAI : public ScriptedAI
-{
- boss_warmastervooneAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Snapkick_Timer;
- uint32 Cleave_Timer;
- uint32 Uppercut_Timer;
- uint32 MortalStrike_Timer;
- uint32 Pummel_Timer;
- uint32 ThrowAxe_Timer;
-
- void Reset()
- {
- Snapkick_Timer = 8000;
- Cleave_Timer = 14000;
- Uppercut_Timer = 20000;
- MortalStrike_Timer = 12000;
- Pummel_Timer = 32000;
- ThrowAxe_Timer = 1000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Snapkick_Timer
- if (Snapkick_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SNAPKICK);
- Snapkick_Timer = 6000;
- }else Snapkick_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 12000;
- }else Cleave_Timer -= diff;
-
- //Uppercut_Timer
- if (Uppercut_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
- Uppercut_Timer = 14000;
- }else Uppercut_Timer -= diff;
-
- //MortalStrike_Timer
- if (MortalStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
- MortalStrike_Timer = 10000;
- }else MortalStrike_Timer -= diff;
-
- //Pummel_Timer
- if (Pummel_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_PUMMEL);
- Pummel_Timer = 16000;
- }else Pummel_Timer -= diff;
-
- //ThrowAxe_Timer
- if (ThrowAxe_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_THROWAXE);
- ThrowAxe_Timer = 8000;
- }else ThrowAxe_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_warmastervoone(Creature *_Creature)
-{
- return new boss_warmastervooneAI (_Creature);
-}
-
-void AddSC_boss_warmastervoone()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_warmaster_voone";
- newscript->GetAI = GetAI_boss_warmastervoone;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Warmaster_Voone
+SD%Complete: 100
+SDComment:
+SDCategory: Blackrock Spire
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SNAPKICK 15618
+#define SPELL_CLEAVE 15579
+#define SPELL_UPPERCUT 10966
+#define SPELL_MORTALSTRIKE 16856
+#define SPELL_PUMMEL 15615
+#define SPELL_THROWAXE 16075
+
+struct TRINITY_DLL_DECL boss_warmastervooneAI : public ScriptedAI
+{
+ boss_warmastervooneAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Snapkick_Timer;
+ uint32 Cleave_Timer;
+ uint32 Uppercut_Timer;
+ uint32 MortalStrike_Timer;
+ uint32 Pummel_Timer;
+ uint32 ThrowAxe_Timer;
+
+ void Reset()
+ {
+ Snapkick_Timer = 8000;
+ Cleave_Timer = 14000;
+ Uppercut_Timer = 20000;
+ MortalStrike_Timer = 12000;
+ Pummel_Timer = 32000;
+ ThrowAxe_Timer = 1000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Snapkick_Timer
+ if (Snapkick_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SNAPKICK);
+ Snapkick_Timer = 6000;
+ }else Snapkick_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 12000;
+ }else Cleave_Timer -= diff;
+
+ //Uppercut_Timer
+ if (Uppercut_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
+ Uppercut_Timer = 14000;
+ }else Uppercut_Timer -= diff;
+
+ //MortalStrike_Timer
+ if (MortalStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
+ MortalStrike_Timer = 10000;
+ }else MortalStrike_Timer -= diff;
+
+ //Pummel_Timer
+ if (Pummel_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_PUMMEL);
+ Pummel_Timer = 16000;
+ }else Pummel_Timer -= diff;
+
+ //ThrowAxe_Timer
+ if (ThrowAxe_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THROWAXE);
+ ThrowAxe_Timer = 8000;
+ }else ThrowAxe_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_warmastervoone(Creature *_Creature)
+{
+ return new boss_warmastervooneAI (_Creature);
+}
+
+void AddSC_boss_warmastervoone()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_warmaster_voone";
+ newscript->GetAI = GetAI_boss_warmastervoone;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
index 5f9e73f835e..3e2feba5699 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
@@ -1,130 +1,130 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Broodlord_Lashlayer
-SD%Complete: 100
-SDComment:
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_CLEAVE 26350
-#define SPELL_BLASTWAVE 23331
-#define SPELL_MORTALSTRIKE 24573
-#define SPELL_KNOCKBACK 25778
-
-#define SAY_AGGRO "None of your kind should be here! You've doomed only yourselves!"
-#define SAY_LEASH "Clever Mortals but I am not so easily lured away from my sanctum!"
-#define SOUND_AGGRO 8286
-#define SOUND_LEASH 8287
-
-struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI
-{
- boss_broodlordAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Cleave_Timer;
- uint32 BlastWave_Timer;
- uint32 MortalStrike_Timer;
- uint32 KnockBack_Timer;
- uint32 LeashCheck_Timer;
-
- void Reset()
- {
- Cleave_Timer = 8000; //These times are probably wrong
- BlastWave_Timer = 12000;
- MortalStrike_Timer = 20000;
- KnockBack_Timer = 30000;
- LeashCheck_Timer = 2000;
-
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- //LeashCheck_Timer
- if (LeashCheck_Timer < diff)
- {
- float rx,ry,rz;
- m_creature->GetRespawnCoord(rx, ry, rz);
- float spawndist = m_creature->GetDistance(rx,ry,rz);
- if ( spawndist > 250 )
- {
- EnterEvadeMode();
- return;
- }
- LeashCheck_Timer = 2000;
- }else LeashCheck_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- // BlastWave
- if (BlastWave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
- BlastWave_Timer = 8000 + rand()%8000;
- }else BlastWave_Timer -= diff;
-
- //MortalStrike_Timer
- if (MortalStrike_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
- MortalStrike_Timer = 25000 + rand()%10000;
- }else MortalStrike_Timer -= diff;
-
- if (KnockBack_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);
- //Drop 50% aggro
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
-
- KnockBack_Timer = 15000 + rand()%15000;
- }else KnockBack_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_broodlord(Creature *_Creature)
-{
- return new boss_broodlordAI (_Creature);
-}
-
-void AddSC_boss_broodlord()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_broodlord";
- newscript->GetAI = GetAI_boss_broodlord;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Broodlord_Lashlayer
+SD%Complete: 100
+SDComment:
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_CLEAVE 26350
+#define SPELL_BLASTWAVE 23331
+#define SPELL_MORTALSTRIKE 24573
+#define SPELL_KNOCKBACK 25778
+
+#define SAY_AGGRO "None of your kind should be here! You've doomed only yourselves!"
+#define SAY_LEASH "Clever Mortals but I am not so easily lured away from my sanctum!"
+#define SOUND_AGGRO 8286
+#define SOUND_LEASH 8287
+
+struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI
+{
+ boss_broodlordAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Cleave_Timer;
+ uint32 BlastWave_Timer;
+ uint32 MortalStrike_Timer;
+ uint32 KnockBack_Timer;
+ uint32 LeashCheck_Timer;
+
+ void Reset()
+ {
+ Cleave_Timer = 8000; //These times are probably wrong
+ BlastWave_Timer = 12000;
+ MortalStrike_Timer = 20000;
+ KnockBack_Timer = 30000;
+ LeashCheck_Timer = 2000;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ //LeashCheck_Timer
+ if (LeashCheck_Timer < diff)
+ {
+ float rx,ry,rz;
+ m_creature->GetRespawnCoord(rx, ry, rz);
+ float spawndist = m_creature->GetDistance(rx,ry,rz);
+ if ( spawndist > 250 )
+ {
+ EnterEvadeMode();
+ return;
+ }
+ LeashCheck_Timer = 2000;
+ }else LeashCheck_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ // BlastWave
+ if (BlastWave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
+ BlastWave_Timer = 8000 + rand()%8000;
+ }else BlastWave_Timer -= diff;
+
+ //MortalStrike_Timer
+ if (MortalStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
+ MortalStrike_Timer = 25000 + rand()%10000;
+ }else MortalStrike_Timer -= diff;
+
+ if (KnockBack_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);
+ //Drop 50% aggro
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
+
+ KnockBack_Timer = 15000 + rand()%15000;
+ }else KnockBack_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_broodlord(Creature *_Creature)
+{
+ return new boss_broodlordAI (_Creature);
+}
+
+void AddSC_boss_broodlord()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_broodlord";
+ newscript->GetAI = GetAI_boss_broodlord;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp
index a34fbfd2180..33a91413ade 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp
@@ -1,320 +1,320 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Chromaggus
-SD%Complete: 95
-SDComment: Chromatic Mutation disabled due to lack of core support
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-//These spells are actually called elemental shield
-//What they do is decrease all damage by 75% then they increase
-//One school of damage by 1100%
-#define SPELL_FIRE_VURNALBILTY 22277
-#define SPELL_FROST_VURNALBILTY 22278
-#define SPELL_SHADOW_VURNALBILTY 22279
-#define SPELL_NATURE_VURNALBILTY 22280
-#define SPELL_ARCANE_VURNALBILTY 22281
-
-#define EMOTE_FRENZY "goes into a killing frenzy!"
-#define EMOTE_SHIMMER "flinches as its skin shimmers"
-
-#define SPELL_INCINERATE 23308 //Incinerate 23308,23309
-#define SPELL_TIMELAPSE 23310 //Time lapse 23310, 23311(old threat mod that was removed in 2.01)
-#define SPELL_CORROSIVEACID 23313 //Corrosive Acid 23313, 23314
-#define SPELL_IGNITEFLESH 23315 //Ignite Flesh 23315,23316
-#define SPELL_FROSTBURN 23187 //Frost burn 23187, 23189
-
-//Brood Affliction 23173 - Scripted Spell that cycles through all targets within 100 yards and has a chance to cast one of the afflictions on them
-//Since Scripted spells arn't coded I'll just write a function that does the same thing
-
-#define SPELL_BROODAF_BLUE 23153 //Blue affliction 23153
-#define SPELL_BROODAF_BLACK 23154 //Black affliction 23154
-#define SPELL_BROODAF_RED 23155 //Red affliction 23155 (23168 on death)
-#define SPELL_BROODAF_BRONZE 23170 //Bronze Affliction 23170
-#define SPELL_BROODAF_GREEN 23169 //Brood Affliction Green 23169
-
-#define SPELL_CHROMATIC_MUT_1 23174 //Spell cast on player if they get all 5 debuffs
-
-#define SPELL_FRENZY 28371 //The frenzy spell may be wrong
-#define SPELL_ENRAGE 28747
-
-#define TEMP_MUTATE_WHISPER "[SD2 Debug] You would be mind controlled here!"
-
-struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
-{
- boss_chromaggusAI(Creature *c) : ScriptedAI(c)
- {
- //Select the 2 breaths that we are going to use until despawned
- //5 possiblities for the first breath, 4 for the second, 20 total possiblites
- //This way we don't end up casting 2 of the same breath
- //TL TL would be stupid
- srand(time(NULL));
- switch (rand()%20)
- {
- //B1 - Incin
- case 0:
- Breath1_Spell = SPELL_INCINERATE;
- Breath2_Spell = SPELL_TIMELAPSE;
- break;
- case 1:
- Breath1_Spell = SPELL_INCINERATE;
- Breath2_Spell = SPELL_CORROSIVEACID;
- break;
- case 2:
- Breath1_Spell = SPELL_INCINERATE;
- Breath2_Spell = SPELL_IGNITEFLESH;
- break;
- case 3:
- Breath1_Spell = SPELL_INCINERATE;
- Breath2_Spell = SPELL_FROSTBURN;
- break;
-
- //B1 - TL
- case 4:
- Breath1_Spell = SPELL_TIMELAPSE;
- Breath2_Spell = SPELL_INCINERATE;
- break;
- case 5:
- Breath1_Spell = SPELL_TIMELAPSE;
- Breath2_Spell = SPELL_CORROSIVEACID;
- break;
- case 6:
- Breath1_Spell = SPELL_TIMELAPSE;
- Breath2_Spell = SPELL_IGNITEFLESH;
- break;
- case 7:
- Breath1_Spell = SPELL_TIMELAPSE;
- Breath2_Spell = SPELL_FROSTBURN;
- break;
-
- //B1 - Acid
- case 8:
- Breath1_Spell = SPELL_CORROSIVEACID;
- Breath2_Spell = SPELL_INCINERATE;
- break;
- case 9:
- Breath1_Spell = SPELL_CORROSIVEACID;
- Breath2_Spell = SPELL_TIMELAPSE;
- break;
- case 10:
- Breath1_Spell = SPELL_CORROSIVEACID;
- Breath2_Spell = SPELL_IGNITEFLESH;
- break;
- case 11:
- Breath1_Spell = SPELL_CORROSIVEACID;
- Breath2_Spell = SPELL_FROSTBURN;
- break;
-
- //B1 - Ignite
- case 12:
- Breath1_Spell = SPELL_IGNITEFLESH;
- Breath2_Spell = SPELL_INCINERATE;
- break;
- case 13:
- Breath1_Spell = SPELL_IGNITEFLESH;
- Breath2_Spell = SPELL_CORROSIVEACID;
- break;
- case 14:
- Breath1_Spell = SPELL_IGNITEFLESH;
- Breath2_Spell = SPELL_TIMELAPSE;
- break;
- case 15:
- Breath1_Spell = SPELL_IGNITEFLESH;
- Breath2_Spell = SPELL_FROSTBURN;
- break;
-
- //B1 - Frost
- case 16:
- Breath1_Spell = SPELL_FROSTBURN;
- Breath2_Spell = SPELL_INCINERATE;
- break;
- case 17:
- Breath1_Spell = SPELL_FROSTBURN;
- Breath2_Spell = SPELL_TIMELAPSE;
- break;
- case 18:
- Breath1_Spell = SPELL_FROSTBURN;
- Breath2_Spell = SPELL_CORROSIVEACID;
- break;
- case 19:
- Breath1_Spell = SPELL_FROSTBURN;
- Breath2_Spell = SPELL_IGNITEFLESH;
- break;
- };
-
- EnterEvadeMode();
- }
-
- uint32 Breath1_Spell;
- uint32 Breath2_Spell;
- uint32 CurrentVurln_Spell;
-
- uint32 Shimmer_Timer;
- uint32 Breath1_Timer;
- uint32 Breath2_Timer;
- uint32 Affliction_Timer;
- uint32 Frenzy_Timer;
- bool Enraged;
-
- void Reset()
- {
- CurrentVurln_Spell = 0; //We use this to store our last vurlnability spell so we can remove it later
-
- Shimmer_Timer = 0; //Time till we change vurlnerabilites
- Breath1_Timer = 30000; //First breath is 30 seconds
- Breath2_Timer = 60000; //Second is 1 minute so that we can alternate
- Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds
- Frenzy_Timer = 15000;
-
- Enraged = false;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Shimmer_Timer Timer
- if (Shimmer_Timer < diff)
- {
- //Remove old vurlnability spell
- if (CurrentVurln_Spell)
- m_creature->RemoveAurasDueToSpell(CurrentVurln_Spell);
-
- //Cast new random vurlnabilty on self
- uint32 spell;
- switch (rand()%5)
- {
- case 0: spell = SPELL_FIRE_VURNALBILTY; break;
- case 1: spell = SPELL_FROST_VURNALBILTY; break;
- case 2: spell = SPELL_SHADOW_VURNALBILTY; break;
- case 3: spell = SPELL_NATURE_VURNALBILTY; break;
- case 4: spell = SPELL_ARCANE_VURNALBILTY; break;
- }
-
- DoCast(m_creature,spell);
- CurrentVurln_Spell = spell;
-
- DoTextEmote(EMOTE_SHIMMER, NULL);
- Shimmer_Timer = 45000;
- }else Shimmer_Timer -= diff;
-
- //Breath1_Timer
- if (Breath1_Timer < diff)
- {
- DoCast(m_creature->getVictim(),Breath1_Spell);
- Breath1_Timer = 60000;
- }else Breath1_Timer -= diff;
-
- //Breath2_Timer
- if (Breath2_Timer < diff)
- {
- DoCast(m_creature->getVictim(),Breath2_Spell);
- Breath2_Timer = 60000;
- }else Breath2_Timer -= diff;
-
- //Affliction_Timer
- if (Affliction_Timer < diff)
- {
- uint32 SpellAfflict = 0;
-
- switch (rand()%5)
- {
- case 0: SpellAfflict = SPELL_BROODAF_BLUE; break;
- case 1: SpellAfflict = SPELL_BROODAF_BLACK; break;
- case 2: SpellAfflict = SPELL_BROODAF_RED; break;
- case 3: SpellAfflict = SPELL_BROODAF_BRONZE; break;
- case 4: SpellAfflict = SPELL_BROODAF_GREEN; break;
- }
-
- std::list::iterator i;
-
- for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Unit* pUnit = NULL;
- pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
-
- if(pUnit)
- {
- //Cast affliction
- DoCast(pUnit, SpellAfflict, true);
-
- //Chromatic mutation if target is effected by all afflictions
- if (pUnit->HasAura(SPELL_BROODAF_BLUE,0)
- && pUnit->HasAura(SPELL_BROODAF_BLACK,0)
- && pUnit->HasAura(SPELL_BROODAF_RED,0)
- && pUnit->HasAura(SPELL_BROODAF_BRONZE,0)
- && pUnit->HasAura(SPELL_BROODAF_GREEN,0))
- {
- //target->RemoveAllAuras();
- //DoCast(target,SPELL_CHROMATIC_MUT_1);
-
- //Chromatic mutation is causing issues
- //Assuming it is caused by a lack of core support for Charm
- //So instead we instant kill our target
-
- //WORKAROUND
- if (pUnit->GetTypeId() == TYPEID_PLAYER)
- {
- DoWhisper(TEMP_MUTATE_WHISPER, pUnit);
- pUnit->CastSpell(pUnit, 5, false);
- }
- }
- }
- }
-
- Affliction_Timer = 10000;
- }else Affliction_Timer -= diff;
-
- //Frenzy_Timer
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature,SPELL_FRENZY);
- DoTextEmote(EMOTE_FRENZY,NULL);
- Frenzy_Timer = 10000 + (rand() % 5000);
- }else Frenzy_Timer -= diff;
-
- //Enrage if not already enraged and below 20%
- if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
- {
- DoCast(m_creature,SPELL_ENRAGE);
- Enraged = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_chromaggus(Creature *_Creature)
-{
- return new boss_chromaggusAI (_Creature);
-}
-
-void AddSC_boss_chromaggus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_chromaggus";
- newscript->GetAI = GetAI_boss_chromaggus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Chromaggus
+SD%Complete: 95
+SDComment: Chromatic Mutation disabled due to lack of core support
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+//These spells are actually called elemental shield
+//What they do is decrease all damage by 75% then they increase
+//One school of damage by 1100%
+#define SPELL_FIRE_VURNALBILTY 22277
+#define SPELL_FROST_VURNALBILTY 22278
+#define SPELL_SHADOW_VURNALBILTY 22279
+#define SPELL_NATURE_VURNALBILTY 22280
+#define SPELL_ARCANE_VURNALBILTY 22281
+
+#define EMOTE_FRENZY "goes into a killing frenzy!"
+#define EMOTE_SHIMMER "flinches as its skin shimmers"
+
+#define SPELL_INCINERATE 23308 //Incinerate 23308,23309
+#define SPELL_TIMELAPSE 23310 //Time lapse 23310, 23311(old threat mod that was removed in 2.01)
+#define SPELL_CORROSIVEACID 23313 //Corrosive Acid 23313, 23314
+#define SPELL_IGNITEFLESH 23315 //Ignite Flesh 23315,23316
+#define SPELL_FROSTBURN 23187 //Frost burn 23187, 23189
+
+//Brood Affliction 23173 - Scripted Spell that cycles through all targets within 100 yards and has a chance to cast one of the afflictions on them
+//Since Scripted spells arn't coded I'll just write a function that does the same thing
+
+#define SPELL_BROODAF_BLUE 23153 //Blue affliction 23153
+#define SPELL_BROODAF_BLACK 23154 //Black affliction 23154
+#define SPELL_BROODAF_RED 23155 //Red affliction 23155 (23168 on death)
+#define SPELL_BROODAF_BRONZE 23170 //Bronze Affliction 23170
+#define SPELL_BROODAF_GREEN 23169 //Brood Affliction Green 23169
+
+#define SPELL_CHROMATIC_MUT_1 23174 //Spell cast on player if they get all 5 debuffs
+
+#define SPELL_FRENZY 28371 //The frenzy spell may be wrong
+#define SPELL_ENRAGE 28747
+
+#define TEMP_MUTATE_WHISPER "[SD2 Debug] You would be mind controlled here!"
+
+struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
+{
+ boss_chromaggusAI(Creature *c) : ScriptedAI(c)
+ {
+ //Select the 2 breaths that we are going to use until despawned
+ //5 possiblities for the first breath, 4 for the second, 20 total possiblites
+ //This way we don't end up casting 2 of the same breath
+ //TL TL would be stupid
+ srand(time(NULL));
+ switch (rand()%20)
+ {
+ //B1 - Incin
+ case 0:
+ Breath1_Spell = SPELL_INCINERATE;
+ Breath2_Spell = SPELL_TIMELAPSE;
+ break;
+ case 1:
+ Breath1_Spell = SPELL_INCINERATE;
+ Breath2_Spell = SPELL_CORROSIVEACID;
+ break;
+ case 2:
+ Breath1_Spell = SPELL_INCINERATE;
+ Breath2_Spell = SPELL_IGNITEFLESH;
+ break;
+ case 3:
+ Breath1_Spell = SPELL_INCINERATE;
+ Breath2_Spell = SPELL_FROSTBURN;
+ break;
+
+ //B1 - TL
+ case 4:
+ Breath1_Spell = SPELL_TIMELAPSE;
+ Breath2_Spell = SPELL_INCINERATE;
+ break;
+ case 5:
+ Breath1_Spell = SPELL_TIMELAPSE;
+ Breath2_Spell = SPELL_CORROSIVEACID;
+ break;
+ case 6:
+ Breath1_Spell = SPELL_TIMELAPSE;
+ Breath2_Spell = SPELL_IGNITEFLESH;
+ break;
+ case 7:
+ Breath1_Spell = SPELL_TIMELAPSE;
+ Breath2_Spell = SPELL_FROSTBURN;
+ break;
+
+ //B1 - Acid
+ case 8:
+ Breath1_Spell = SPELL_CORROSIVEACID;
+ Breath2_Spell = SPELL_INCINERATE;
+ break;
+ case 9:
+ Breath1_Spell = SPELL_CORROSIVEACID;
+ Breath2_Spell = SPELL_TIMELAPSE;
+ break;
+ case 10:
+ Breath1_Spell = SPELL_CORROSIVEACID;
+ Breath2_Spell = SPELL_IGNITEFLESH;
+ break;
+ case 11:
+ Breath1_Spell = SPELL_CORROSIVEACID;
+ Breath2_Spell = SPELL_FROSTBURN;
+ break;
+
+ //B1 - Ignite
+ case 12:
+ Breath1_Spell = SPELL_IGNITEFLESH;
+ Breath2_Spell = SPELL_INCINERATE;
+ break;
+ case 13:
+ Breath1_Spell = SPELL_IGNITEFLESH;
+ Breath2_Spell = SPELL_CORROSIVEACID;
+ break;
+ case 14:
+ Breath1_Spell = SPELL_IGNITEFLESH;
+ Breath2_Spell = SPELL_TIMELAPSE;
+ break;
+ case 15:
+ Breath1_Spell = SPELL_IGNITEFLESH;
+ Breath2_Spell = SPELL_FROSTBURN;
+ break;
+
+ //B1 - Frost
+ case 16:
+ Breath1_Spell = SPELL_FROSTBURN;
+ Breath2_Spell = SPELL_INCINERATE;
+ break;
+ case 17:
+ Breath1_Spell = SPELL_FROSTBURN;
+ Breath2_Spell = SPELL_TIMELAPSE;
+ break;
+ case 18:
+ Breath1_Spell = SPELL_FROSTBURN;
+ Breath2_Spell = SPELL_CORROSIVEACID;
+ break;
+ case 19:
+ Breath1_Spell = SPELL_FROSTBURN;
+ Breath2_Spell = SPELL_IGNITEFLESH;
+ break;
+ };
+
+ EnterEvadeMode();
+ }
+
+ uint32 Breath1_Spell;
+ uint32 Breath2_Spell;
+ uint32 CurrentVurln_Spell;
+
+ uint32 Shimmer_Timer;
+ uint32 Breath1_Timer;
+ uint32 Breath2_Timer;
+ uint32 Affliction_Timer;
+ uint32 Frenzy_Timer;
+ bool Enraged;
+
+ void Reset()
+ {
+ CurrentVurln_Spell = 0; //We use this to store our last vurlnability spell so we can remove it later
+
+ Shimmer_Timer = 0; //Time till we change vurlnerabilites
+ Breath1_Timer = 30000; //First breath is 30 seconds
+ Breath2_Timer = 60000; //Second is 1 minute so that we can alternate
+ Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds
+ Frenzy_Timer = 15000;
+
+ Enraged = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Shimmer_Timer Timer
+ if (Shimmer_Timer < diff)
+ {
+ //Remove old vurlnability spell
+ if (CurrentVurln_Spell)
+ m_creature->RemoveAurasDueToSpell(CurrentVurln_Spell);
+
+ //Cast new random vurlnabilty on self
+ uint32 spell;
+ switch (rand()%5)
+ {
+ case 0: spell = SPELL_FIRE_VURNALBILTY; break;
+ case 1: spell = SPELL_FROST_VURNALBILTY; break;
+ case 2: spell = SPELL_SHADOW_VURNALBILTY; break;
+ case 3: spell = SPELL_NATURE_VURNALBILTY; break;
+ case 4: spell = SPELL_ARCANE_VURNALBILTY; break;
+ }
+
+ DoCast(m_creature,spell);
+ CurrentVurln_Spell = spell;
+
+ DoTextEmote(EMOTE_SHIMMER, NULL);
+ Shimmer_Timer = 45000;
+ }else Shimmer_Timer -= diff;
+
+ //Breath1_Timer
+ if (Breath1_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),Breath1_Spell);
+ Breath1_Timer = 60000;
+ }else Breath1_Timer -= diff;
+
+ //Breath2_Timer
+ if (Breath2_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),Breath2_Spell);
+ Breath2_Timer = 60000;
+ }else Breath2_Timer -= diff;
+
+ //Affliction_Timer
+ if (Affliction_Timer < diff)
+ {
+ uint32 SpellAfflict = 0;
+
+ switch (rand()%5)
+ {
+ case 0: SpellAfflict = SPELL_BROODAF_BLUE; break;
+ case 1: SpellAfflict = SPELL_BROODAF_BLACK; break;
+ case 2: SpellAfflict = SPELL_BROODAF_RED; break;
+ case 3: SpellAfflict = SPELL_BROODAF_BRONZE; break;
+ case 4: SpellAfflict = SPELL_BROODAF_GREEN; break;
+ }
+
+ std::list::iterator i;
+
+ for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Unit* pUnit = NULL;
+ pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+
+ if(pUnit)
+ {
+ //Cast affliction
+ DoCast(pUnit, SpellAfflict, true);
+
+ //Chromatic mutation if target is effected by all afflictions
+ if (pUnit->HasAura(SPELL_BROODAF_BLUE,0)
+ && pUnit->HasAura(SPELL_BROODAF_BLACK,0)
+ && pUnit->HasAura(SPELL_BROODAF_RED,0)
+ && pUnit->HasAura(SPELL_BROODAF_BRONZE,0)
+ && pUnit->HasAura(SPELL_BROODAF_GREEN,0))
+ {
+ //target->RemoveAllAuras();
+ //DoCast(target,SPELL_CHROMATIC_MUT_1);
+
+ //Chromatic mutation is causing issues
+ //Assuming it is caused by a lack of core support for Charm
+ //So instead we instant kill our target
+
+ //WORKAROUND
+ if (pUnit->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoWhisper(TEMP_MUTATE_WHISPER, pUnit);
+ pUnit->CastSpell(pUnit, 5, false);
+ }
+ }
+ }
+ }
+
+ Affliction_Timer = 10000;
+ }else Affliction_Timer -= diff;
+
+ //Frenzy_Timer
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FRENZY);
+ DoTextEmote(EMOTE_FRENZY,NULL);
+ Frenzy_Timer = 10000 + (rand() % 5000);
+ }else Frenzy_Timer -= diff;
+
+ //Enrage if not already enraged and below 20%
+ if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
+ {
+ DoCast(m_creature,SPELL_ENRAGE);
+ Enraged = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_chromaggus(Creature *_Creature)
+{
+ return new boss_chromaggusAI (_Creature);
+}
+
+void AddSC_boss_chromaggus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_chromaggus";
+ newscript->GetAI = GetAI_boss_chromaggus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp
index 1e6cb6794fe..703dec09536 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp
@@ -1,103 +1,103 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ebonroc
-SD%Complete: 50
-SDComment: Shadow of Ebonroc needs core support
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWFLAME 22539
-#define SPELL_WINGBUFFET 18500
-#define SPELL_SHADOWOFEBONROC 23340
-#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow
-
-struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI
-{
- boss_ebonrocAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowFlame_Timer;
- uint32 WingBuffet_Timer;
- uint32 ShadowOfEbonroc_Timer;
- uint32 Heal_Timer;
-
- void Reset()
- {
- ShadowFlame_Timer = 15000; //These times are probably wrong
- WingBuffet_Timer = 30000;
- ShadowOfEbonroc_Timer = 45000;
- Heal_Timer = 1000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Shadowflame Timer
- if (ShadowFlame_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
- ShadowFlame_Timer = 12000 + rand()%3000;
- }else ShadowFlame_Timer -= diff;
-
- //Wing Buffet Timer
- if (WingBuffet_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
- WingBuffet_Timer = 25000;
- }else WingBuffet_Timer -= diff;
-
- //Shadow of Ebonroc Timer
- if (ShadowOfEbonroc_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWOFEBONROC);
- ShadowOfEbonroc_Timer = 25000 + rand()%10000;
- }else ShadowOfEbonroc_Timer -= diff;
-
- if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC,0))
- {
- if (Heal_Timer < diff)
- {
- DoCast(m_creature, SPELL_HEAL);
- Heal_Timer = 1000 + rand()%2000;
- }else Heal_Timer -= diff;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_ebonroc(Creature *_Creature)
-{
- return new boss_ebonrocAI (_Creature);
-}
-
-void AddSC_boss_ebonroc()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ebonroc";
- newscript->GetAI = GetAI_boss_ebonroc;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ebonroc
+SD%Complete: 50
+SDComment: Shadow of Ebonroc needs core support
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWFLAME 22539
+#define SPELL_WINGBUFFET 18500
+#define SPELL_SHADOWOFEBONROC 23340
+#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow
+
+struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI
+{
+ boss_ebonrocAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowFlame_Timer;
+ uint32 WingBuffet_Timer;
+ uint32 ShadowOfEbonroc_Timer;
+ uint32 Heal_Timer;
+
+ void Reset()
+ {
+ ShadowFlame_Timer = 15000; //These times are probably wrong
+ WingBuffet_Timer = 30000;
+ ShadowOfEbonroc_Timer = 45000;
+ Heal_Timer = 1000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Shadowflame Timer
+ if (ShadowFlame_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
+ ShadowFlame_Timer = 12000 + rand()%3000;
+ }else ShadowFlame_Timer -= diff;
+
+ //Wing Buffet Timer
+ if (WingBuffet_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
+ WingBuffet_Timer = 25000;
+ }else WingBuffet_Timer -= diff;
+
+ //Shadow of Ebonroc Timer
+ if (ShadowOfEbonroc_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWOFEBONROC);
+ ShadowOfEbonroc_Timer = 25000 + rand()%10000;
+ }else ShadowOfEbonroc_Timer -= diff;
+
+ if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC,0))
+ {
+ if (Heal_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_HEAL);
+ Heal_Timer = 1000 + rand()%2000;
+ }else Heal_Timer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_ebonroc(Creature *_Creature)
+{
+ return new boss_ebonrocAI (_Creature);
+}
+
+void AddSC_boss_ebonroc()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_ebonroc";
+ newscript->GetAI = GetAI_boss_ebonroc;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp
index 54c0b4b40d7..05a3e36948b 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp
@@ -1,94 +1,94 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Firemaw
-SD%Complete: 100
-SDComment:
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWFLAME 22539
-#define SPELL_WINGBUFFET 23339
-#define SPELL_FLAMEBUFFET 23341
-
-struct TRINITY_DLL_DECL boss_firemawAI : public ScriptedAI
-{
- boss_firemawAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowFlame_Timer;
- uint32 WingBuffet_Timer;
- uint32 FlameBuffet_Timer;
-
- void Reset()
- {
- ShadowFlame_Timer = 30000; //These times are probably wrong
- WingBuffet_Timer = 24000;
- FlameBuffet_Timer = 5000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowFlame_Timer
- if (ShadowFlame_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
- ShadowFlame_Timer = 15000 + rand()%3000;
- }else ShadowFlame_Timer -= diff;
-
- //WingBuffet_Timer
- if (WingBuffet_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-75);
-
- WingBuffet_Timer = 25000;
- }else WingBuffet_Timer -= diff;
-
- //FlameBuffet_Timer
- if (FlameBuffet_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET);
- FlameBuffet_Timer = 5000;
- }else FlameBuffet_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_firemaw(Creature *_Creature)
-{
- return new boss_firemawAI (_Creature);
-}
-
-void AddSC_boss_firemaw()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_firemaw";
- newscript->GetAI = GetAI_boss_firemaw;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Firemaw
+SD%Complete: 100
+SDComment:
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWFLAME 22539
+#define SPELL_WINGBUFFET 23339
+#define SPELL_FLAMEBUFFET 23341
+
+struct TRINITY_DLL_DECL boss_firemawAI : public ScriptedAI
+{
+ boss_firemawAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowFlame_Timer;
+ uint32 WingBuffet_Timer;
+ uint32 FlameBuffet_Timer;
+
+ void Reset()
+ {
+ ShadowFlame_Timer = 30000; //These times are probably wrong
+ WingBuffet_Timer = 24000;
+ FlameBuffet_Timer = 5000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowFlame_Timer
+ if (ShadowFlame_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
+ ShadowFlame_Timer = 15000 + rand()%3000;
+ }else ShadowFlame_Timer -= diff;
+
+ //WingBuffet_Timer
+ if (WingBuffet_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-75);
+
+ WingBuffet_Timer = 25000;
+ }else WingBuffet_Timer -= diff;
+
+ //FlameBuffet_Timer
+ if (FlameBuffet_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET);
+ FlameBuffet_Timer = 5000;
+ }else FlameBuffet_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_firemaw(Creature *_Creature)
+{
+ return new boss_firemawAI (_Creature);
+}
+
+void AddSC_boss_firemaw()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_firemaw";
+ newscript->GetAI = GetAI_boss_firemaw;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp
index 320bf380b28..fa34406b1fe 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp
@@ -1,94 +1,94 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Flamegor
-SD%Complete: 100
-SDComment:
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWFLAME 22539
-#define SPELL_WINGBUFFET 23339
-#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova
-
-struct TRINITY_DLL_DECL boss_flamegorAI : public ScriptedAI
-{
- boss_flamegorAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowFlame_Timer;
- uint32 WingBuffet_Timer;
- uint32 Frenzy_Timer;
-
- void Reset()
- {
- ShadowFlame_Timer = 21000; //These times are probably wrong
- WingBuffet_Timer = 35000;
- Frenzy_Timer = 10000;
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowFlame_Timer
- if (ShadowFlame_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
- ShadowFlame_Timer = 15000 + rand()%7000;
- }else ShadowFlame_Timer -= diff;
-
- //WingBuffet_Timer
- if (WingBuffet_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
- if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-75);
-
- WingBuffet_Timer = 25000;
- }else WingBuffet_Timer -= diff;
-
- //Frenzy_Timer
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature,SPELL_FRENZY);
- Frenzy_Timer = 8000 + (rand()%2000);
- }else Frenzy_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_flamegor(Creature *_Creature)
-{
- return new boss_flamegorAI (_Creature);
-}
-
-void AddSC_boss_flamegor()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_flamegor";
- newscript->GetAI = GetAI_boss_flamegor;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Flamegor
+SD%Complete: 100
+SDComment:
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWFLAME 22539
+#define SPELL_WINGBUFFET 23339
+#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova
+
+struct TRINITY_DLL_DECL boss_flamegorAI : public ScriptedAI
+{
+ boss_flamegorAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowFlame_Timer;
+ uint32 WingBuffet_Timer;
+ uint32 Frenzy_Timer;
+
+ void Reset()
+ {
+ ShadowFlame_Timer = 21000; //These times are probably wrong
+ WingBuffet_Timer = 35000;
+ Frenzy_Timer = 10000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowFlame_Timer
+ if (ShadowFlame_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
+ ShadowFlame_Timer = 15000 + rand()%7000;
+ }else ShadowFlame_Timer -= diff;
+
+ //WingBuffet_Timer
+ if (WingBuffet_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
+ if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-75);
+
+ WingBuffet_Timer = 25000;
+ }else WingBuffet_Timer -= diff;
+
+ //Frenzy_Timer
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FRENZY);
+ Frenzy_Timer = 8000 + (rand()%2000);
+ }else Frenzy_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_flamegor(Creature *_Creature)
+{
+ return new boss_flamegorAI (_Creature);
+}
+
+void AddSC_boss_flamegor()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_flamegor";
+ newscript->GetAI = GetAI_boss_flamegor;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp
index 8ffe94f3f92..dffd01f171e 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp
@@ -1,250 +1,250 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Nefarian
-SD%Complete: 100
-SDComment: Some issues with class calls effecting more than one class
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO "Well done, my minions. The mortals' courage begins to wane! Now, let's see how they contend with the true Lord of Blackrock Spire!"
-#define SAY_DEATH "This cannot be! I am the Master here! You mortals are nothing to my kind! DO YOU HEAR? NOTHING!"
-#define SAY_RAISE_SKELETONS "Impossible! Rise my minions! Serve your master once more!"
-#define SAY_SHADOWFLAME "Burn, you wretches! Burn!"
-#define SAY_SLAY "Worthless $N! Your friends will join you soon enough!"
-#define SAY_XHEALTH "Enough! Now you vermin shall feel the force of my birthright, the fury of the earth itself."
-#define SAY_GAMESBEGIN "Let the games begin!"
-#define SAY_START ""
-
-#define SOUND_AGGRO 8288
-#define SOUND_DEATH 8292
-#define SOUND_RAISE_SKELETONS 8291
-#define SOUND_SHADOWFLAME 8290
-#define SOUND_SLAY 8293
-#define SOUND_XHEALTH 8289
-#define SOUND_GAMESBEGIN 8279
-#define SOUND_START 8280
-
-#define SPELL_SHADOWFLAME_INITIAL 22972
-#define SPELL_SHADOWFLAME 22539
-#define SPELL_BELLOWINGROAR 22686
-#define SPELL_VEILOFSHADOW 7068
-#define SPELL_CLEAVE 20691
-#define SPELL_TAILLASH 23364
-#define SPELL_BONECONTRUST 23363 //23362, 23361
-
-#define SPELL_MAGE 23410 //wild magic
-#define SPELL_WARRIOR 23397 //beserk
-#define SPELL_DRUID 23398 // cat form
-#define SPELL_PRIEST 23401 // corrupted healing
-#define SPELL_PALADIN 23418 //syphon blessing
-#define SPELL_SHAMAN 23425 //totems
-#define SPELL_WARLOCK 23427 //infernals
-#define SPELL_HUNTER 23436 //bow broke
-#define SPELL_ROGUE 23414 //Paralise
-
-#define SAY_MAGE "Mages too? You should be more careful when you play with magic..."
-#define SAY_WARRIOR "Warriors, I know you can hit harder than that! Let's see it!"
-#define SAY_DRUID "Druids and your silly shapeshifting. Let's see it in action!"
-#define SAY_PRIEST "Priests! If you're going to keep healing like that, we might as well make it a little more interesting!"
-#define SAY_PALADIN "Paladins, I've heard you have many lives. Show me."
-#define SAY_SHAMAN "Shamans, show me what your totems can do!"
-#define SAY_WARLOCK "Warlocks, you shouldn't be playing with magic you don't understand. See what happens?"
-#define SAY_HUNTER "Hunters and your annoying pea-shooters!"
-#define SAY_ROGUE "Rogues? Stop hiding and face me!"
-
-struct TRINITY_DLL_DECL boss_nefarianAI : public ScriptedAI
-{
- boss_nefarianAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowFlame_Timer;
- uint32 BellowingRoar_Timer;
- uint32 VeilOfShadow_Timer;
- uint32 Cleave_Timer;
- uint32 TailLash_Timer;
- uint32 ClassCall_Timer;
- bool Phase3;
-
- void Reset()
- {
- ShadowFlame_Timer = 12000; //These times are probably wrong
- BellowingRoar_Timer = 30000;
- VeilOfShadow_Timer = 15000;
- Cleave_Timer = 7000;
- TailLash_Timer = 10000;
- ClassCall_Timer = 35000; //35-40 seconds
- Phase3 = false;
-
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- }
-
- void KilledUnit(Unit* Victim)
- {
- if (rand()%5)
- return;
-
- DoYell(SAY_SLAY,LANG_UNIVERSAL,Victim);
- DoPlaySoundToSet(m_creature, SOUND_SLAY);
- }
-
- void JustDied(Unit* Killer)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void Aggro(Unit *who)
- {
- switch (rand()%3)
- {
- case 0:
- DoYell(SAY_XHEALTH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_XHEALTH);
- break;
- case 1:
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
- break;
- case 2:
- DoYell(SAY_SHADOWFLAME,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SHADOWFLAME);
- break;
- }
-
- DoCast(who,SPELL_SHADOWFLAME_INITIAL);
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowFlame_Timer
- if (ShadowFlame_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
- ShadowFlame_Timer = 12000;
- }else ShadowFlame_Timer -= diff;
-
- //BellowingRoar_Timer
- if (BellowingRoar_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR);
- BellowingRoar_Timer = 30000;
- }else BellowingRoar_Timer -= diff;
-
- //VeilOfShadow_Timer
- if (VeilOfShadow_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_VEILOFSHADOW);
- VeilOfShadow_Timer = 15000;
- }else VeilOfShadow_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000;
- }else Cleave_Timer -= diff;
-
- //TailLash_Timer
- if (TailLash_Timer < diff)
- {
- //Cast NYI since we need a better check for behind target
- //DoCast(m_creature->getVictim(),SPELL_TAILLASH);
-
- TailLash_Timer = 10000;
- }else TailLash_Timer -= diff;
-
- //ClassCall_Timer
- if (ClassCall_Timer < diff)
- {
- //Cast a random class call
- //On official it is based on what classes are currently on the hostil list
- //but we can't do that yet so just randomly call one
-
- switch (rand()%9)
- {
- case 0:
- DoYell(SAY_MAGE,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_MAGE);
- break;
- case 1:
- DoYell(SAY_WARRIOR,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_WARRIOR);
- break;
- case 2:
- DoYell(SAY_DRUID,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_DRUID);
- break;
- case 3:
- DoYell(SAY_PRIEST,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_PRIEST);
- break;
- case 4:
- DoYell(SAY_PALADIN,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_PALADIN);
- break;
- case 5:
- DoYell(SAY_SHAMAN,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_SHAMAN);
- break;
- case 6:
- DoYell(SAY_WARLOCK,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_WARLOCK);
- break;
- case 7:
- DoYell(SAY_HUNTER,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_HUNTER);
- break;
- case 8:
- DoYell(SAY_ROGUE,LANG_UNIVERSAL,NULL);
- DoCast(m_creature,SPELL_ROGUE);
- break;
- }
-
- ClassCall_Timer = 35000 + (rand() % 5000);
- }else ClassCall_Timer -= diff;
-
- //Phase3 begins when we are below X health
- if (!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
- {
- Phase3 = true;
- DoYell(SAY_RAISE_SKELETONS,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_RAISE_SKELETONS);
- }
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_nefarian(Creature *_Creature)
-{
- return new boss_nefarianAI (_Creature);
-}
-
-void AddSC_boss_nefarian()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_nefarian";
- newscript->GetAI = GetAI_boss_nefarian;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Nefarian
+SD%Complete: 100
+SDComment: Some issues with class calls effecting more than one class
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_AGGRO "Well done, my minions. The mortals' courage begins to wane! Now, let's see how they contend with the true Lord of Blackrock Spire!"
+#define SAY_DEATH "This cannot be! I am the Master here! You mortals are nothing to my kind! DO YOU HEAR? NOTHING!"
+#define SAY_RAISE_SKELETONS "Impossible! Rise my minions! Serve your master once more!"
+#define SAY_SHADOWFLAME "Burn, you wretches! Burn!"
+#define SAY_SLAY "Worthless $N! Your friends will join you soon enough!"
+#define SAY_XHEALTH "Enough! Now you vermin shall feel the force of my birthright, the fury of the earth itself."
+#define SAY_GAMESBEGIN "Let the games begin!"
+#define SAY_START ""
+
+#define SOUND_AGGRO 8288
+#define SOUND_DEATH 8292
+#define SOUND_RAISE_SKELETONS 8291
+#define SOUND_SHADOWFLAME 8290
+#define SOUND_SLAY 8293
+#define SOUND_XHEALTH 8289
+#define SOUND_GAMESBEGIN 8279
+#define SOUND_START 8280
+
+#define SPELL_SHADOWFLAME_INITIAL 22972
+#define SPELL_SHADOWFLAME 22539
+#define SPELL_BELLOWINGROAR 22686
+#define SPELL_VEILOFSHADOW 7068
+#define SPELL_CLEAVE 20691
+#define SPELL_TAILLASH 23364
+#define SPELL_BONECONTRUST 23363 //23362, 23361
+
+#define SPELL_MAGE 23410 //wild magic
+#define SPELL_WARRIOR 23397 //beserk
+#define SPELL_DRUID 23398 // cat form
+#define SPELL_PRIEST 23401 // corrupted healing
+#define SPELL_PALADIN 23418 //syphon blessing
+#define SPELL_SHAMAN 23425 //totems
+#define SPELL_WARLOCK 23427 //infernals
+#define SPELL_HUNTER 23436 //bow broke
+#define SPELL_ROGUE 23414 //Paralise
+
+#define SAY_MAGE "Mages too? You should be more careful when you play with magic..."
+#define SAY_WARRIOR "Warriors, I know you can hit harder than that! Let's see it!"
+#define SAY_DRUID "Druids and your silly shapeshifting. Let's see it in action!"
+#define SAY_PRIEST "Priests! If you're going to keep healing like that, we might as well make it a little more interesting!"
+#define SAY_PALADIN "Paladins, I've heard you have many lives. Show me."
+#define SAY_SHAMAN "Shamans, show me what your totems can do!"
+#define SAY_WARLOCK "Warlocks, you shouldn't be playing with magic you don't understand. See what happens?"
+#define SAY_HUNTER "Hunters and your annoying pea-shooters!"
+#define SAY_ROGUE "Rogues? Stop hiding and face me!"
+
+struct TRINITY_DLL_DECL boss_nefarianAI : public ScriptedAI
+{
+ boss_nefarianAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowFlame_Timer;
+ uint32 BellowingRoar_Timer;
+ uint32 VeilOfShadow_Timer;
+ uint32 Cleave_Timer;
+ uint32 TailLash_Timer;
+ uint32 ClassCall_Timer;
+ bool Phase3;
+
+ void Reset()
+ {
+ ShadowFlame_Timer = 12000; //These times are probably wrong
+ BellowingRoar_Timer = 30000;
+ VeilOfShadow_Timer = 15000;
+ Cleave_Timer = 7000;
+ TailLash_Timer = 10000;
+ ClassCall_Timer = 35000; //35-40 seconds
+ Phase3 = false;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+
+ void KilledUnit(Unit* Victim)
+ {
+ if (rand()%5)
+ return;
+
+ DoYell(SAY_SLAY,LANG_UNIVERSAL,Victim);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void Aggro(Unit *who)
+ {
+ switch (rand()%3)
+ {
+ case 0:
+ DoYell(SAY_XHEALTH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_XHEALTH);
+ break;
+ case 1:
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ break;
+ case 2:
+ DoYell(SAY_SHADOWFLAME,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SHADOWFLAME);
+ break;
+ }
+
+ DoCast(who,SPELL_SHADOWFLAME_INITIAL);
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowFlame_Timer
+ if (ShadowFlame_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
+ ShadowFlame_Timer = 12000;
+ }else ShadowFlame_Timer -= diff;
+
+ //BellowingRoar_Timer
+ if (BellowingRoar_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR);
+ BellowingRoar_Timer = 30000;
+ }else BellowingRoar_Timer -= diff;
+
+ //VeilOfShadow_Timer
+ if (VeilOfShadow_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_VEILOFSHADOW);
+ VeilOfShadow_Timer = 15000;
+ }else VeilOfShadow_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000;
+ }else Cleave_Timer -= diff;
+
+ //TailLash_Timer
+ if (TailLash_Timer < diff)
+ {
+ //Cast NYI since we need a better check for behind target
+ //DoCast(m_creature->getVictim(),SPELL_TAILLASH);
+
+ TailLash_Timer = 10000;
+ }else TailLash_Timer -= diff;
+
+ //ClassCall_Timer
+ if (ClassCall_Timer < diff)
+ {
+ //Cast a random class call
+ //On official it is based on what classes are currently on the hostil list
+ //but we can't do that yet so just randomly call one
+
+ switch (rand()%9)
+ {
+ case 0:
+ DoYell(SAY_MAGE,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_MAGE);
+ break;
+ case 1:
+ DoYell(SAY_WARRIOR,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_WARRIOR);
+ break;
+ case 2:
+ DoYell(SAY_DRUID,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_DRUID);
+ break;
+ case 3:
+ DoYell(SAY_PRIEST,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_PRIEST);
+ break;
+ case 4:
+ DoYell(SAY_PALADIN,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_PALADIN);
+ break;
+ case 5:
+ DoYell(SAY_SHAMAN,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_SHAMAN);
+ break;
+ case 6:
+ DoYell(SAY_WARLOCK,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_WARLOCK);
+ break;
+ case 7:
+ DoYell(SAY_HUNTER,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_HUNTER);
+ break;
+ case 8:
+ DoYell(SAY_ROGUE,LANG_UNIVERSAL,NULL);
+ DoCast(m_creature,SPELL_ROGUE);
+ break;
+ }
+
+ ClassCall_Timer = 35000 + (rand() % 5000);
+ }else ClassCall_Timer -= diff;
+
+ //Phase3 begins when we are below X health
+ if (!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
+ {
+ Phase3 = true;
+ DoYell(SAY_RAISE_SKELETONS,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RAISE_SKELETONS);
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_nefarian(Creature *_Creature)
+{
+ return new boss_nefarianAI (_Creature);
+}
+
+void AddSC_boss_nefarian()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_nefarian";
+ newscript->GetAI = GetAI_boss_nefarian;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp
index 2a44768ca50..305910aefa6 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp
@@ -1,126 +1,126 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Razorgore
-SD%Complete: 50
-SDComment: Needs additional review. Phase 1 NYI
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-//Razorgore Phase 2 Script
-
-#define SAY_NPC_DEATH "If I fall into the abyss I'll take all of you mortals with me..."
-#define SOUND_NPC_DEATH 8278
-#define SAY_EGGS_BREAK3 "No! Not another one! I'll have your heads for this atrocity."
-#define SOUND_EGGS_BREAK3 8277
-
-#define SPELL_CLEAVE 22540
-#define SPELL_WARSTOMP 24375
-#define SPELL_FIREBALLVOLLEY 22425
-#define SPELL_CONFLAGRATION 23023
-
-struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI
-{
- boss_razorgoreAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Cleave_Timer;
- uint32 WarStomp_Timer;
- uint32 FireballVolley_Timer;
- uint32 Conflagration_Timer;
-
- void Reset()
- {
- Cleave_Timer = 15000; //These times are probably wrong
- WarStomp_Timer = 35000;
- FireballVolley_Timer = 7000;
- Conflagration_Timer = 12000;
-
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- }
-
- void Aggro(Unit *who)
- {
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 7000 + rand()%3000;
- }else Cleave_Timer -= diff;
-
- //WarStomp_Timer
- if (WarStomp_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
- WarStomp_Timer = 15000 + rand()%10000;
- }else WarStomp_Timer -= diff;
-
- //FireballVolley_Timer
- if (FireballVolley_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY);
- FireballVolley_Timer = 12000 + rand()%3000;
- }else FireballVolley_Timer -= diff;
-
- //Conflagration_Timer
- if (Conflagration_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CONFLAGRATION);
- //We will remove this threat reduction and add an aura check.
-
- //if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
- //m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
-
- Conflagration_Timer = 12000;
- }else Conflagration_Timer -= diff;
-
- // Aura Check. If the gamer is affected by confliguration we attack a random gamer.
- if (m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION,0))
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,1);
- if (target)
- m_creature->TauntApply(target);
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_razorgore(Creature *_Creature)
-{
- return new boss_razorgoreAI (_Creature);
-}
-
-void AddSC_boss_razorgore()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_razorgore";
- newscript->GetAI = GetAI_boss_razorgore;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Razorgore
+SD%Complete: 50
+SDComment: Needs additional review. Phase 1 NYI
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+//Razorgore Phase 2 Script
+
+#define SAY_NPC_DEATH "If I fall into the abyss I'll take all of you mortals with me..."
+#define SOUND_NPC_DEATH 8278
+#define SAY_EGGS_BREAK3 "No! Not another one! I'll have your heads for this atrocity."
+#define SOUND_EGGS_BREAK3 8277
+
+#define SPELL_CLEAVE 22540
+#define SPELL_WARSTOMP 24375
+#define SPELL_FIREBALLVOLLEY 22425
+#define SPELL_CONFLAGRATION 23023
+
+struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI
+{
+ boss_razorgoreAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Cleave_Timer;
+ uint32 WarStomp_Timer;
+ uint32 FireballVolley_Timer;
+ uint32 Conflagration_Timer;
+
+ void Reset()
+ {
+ Cleave_Timer = 15000; //These times are probably wrong
+ WarStomp_Timer = 35000;
+ FireballVolley_Timer = 7000;
+ Conflagration_Timer = 12000;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 7000 + rand()%3000;
+ }else Cleave_Timer -= diff;
+
+ //WarStomp_Timer
+ if (WarStomp_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
+ WarStomp_Timer = 15000 + rand()%10000;
+ }else WarStomp_Timer -= diff;
+
+ //FireballVolley_Timer
+ if (FireballVolley_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY);
+ FireballVolley_Timer = 12000 + rand()%3000;
+ }else FireballVolley_Timer -= diff;
+
+ //Conflagration_Timer
+ if (Conflagration_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CONFLAGRATION);
+ //We will remove this threat reduction and add an aura check.
+
+ //if(m_creature->getThreatManager().getThreat(m_creature->getVictim()))
+ //m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50);
+
+ Conflagration_Timer = 12000;
+ }else Conflagration_Timer -= diff;
+
+ // Aura Check. If the gamer is affected by confliguration we attack a random gamer.
+ if (m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION,0))
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ m_creature->TauntApply(target);
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_razorgore(Creature *_Creature)
+{
+ return new boss_razorgoreAI (_Creature);
+}
+
+void AddSC_boss_razorgore()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_razorgore";
+ newscript->GetAI = GetAI_boss_razorgore;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp
index dffe68c5958..5bcf7fe995e 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp
@@ -1,278 +1,278 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Vaelastrasz
-SD%Complete: 75
-SDComment: Burning Adrenaline not correctly implemented in core
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_ESSENCEOFTHERED 23513
-#define SPELL_FLAMEBREATH 23461
-#define SPELL_FIRENOVA 23462
-#define SPELL_TAILSWIPE 15847
-#define SPELL_BURNINGADRENALINE 23620
-#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect
-
-#define SAY_LINE1 "Too late...friends. Nefarius' corruption has taken hold. I cannot...control myself. "
-#define SOUND_LINE1 8281
-
-#define SAY_LINE2 "I beg you Mortals, flee! Flee before I lose all control. The Black Fire rages within my heart. I must release it!"
-#define SOUND_LINE2 8282
-
-#define SAY_LINE3 "FLAME! DEATH! DESTRUCTION! COWER MORTALS BEFORE THE WRATH OF LORD....NO! I MUST FIGHT THIS!"
-#define SOUND_LINE3 8283
-
-#define SAY_HALFLIFE "Nefarius' hate has made me stronger than ever before. You should have fled, while you could, mortals! The fury of Blackrock courses through my veins! "
-#define SOUND_HALFLIFE 8285
-
-#define SAY_KILLTARGET "Forgive me $N, your death only adds to my failure."
-#define SOUND_KILLTARGET 8284
-
-#define GOSSIP_ITEM "Start Event "
-
-struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
-{
- boss_vaelAI(Creature *c) : ScriptedAI(c)
- {
- c->SetUInt32Value(UNIT_NPC_FLAGS,1);
- c->setFaction(35);
- c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Reset();
- }
-
- uint64 PlayerGUID;
- uint32 SpeachTimer;
- uint32 SpeachNum;
- uint32 Cleave_Timer;
- uint32 FlameBreath_Timer;
- uint32 FireNova_Timer;
- uint32 BurningAdrenalineCaster_Timer;
- uint32 BurningAdrenalineTank_Timer;
- uint32 TailSwipe_Timer;
- bool HasYelled;
- bool DoingSpeach;
-
- void Reset()
- {
- PlayerGUID = 0;
- SpeachTimer = 0;
- SpeachNum = 0;
- Cleave_Timer = 8000; //These times are probably wrong
- FlameBreath_Timer = 11000;
- BurningAdrenalineCaster_Timer = 15000;
- BurningAdrenalineTank_Timer = 45000;
- FireNova_Timer = 5000;
- TailSwipe_Timer = 20000;
- HasYelled = false;
- DoingSpeach = false;
-
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
- }
-
- void BeginSpeach(Unit* target)
- {
- //Stand up and begin speach
- PlayerGUID = target->GetGUID();
-
- //10 seconds
- DoYell(SAY_LINE1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_LINE1);
- SpeachTimer = 10000;
- SpeachNum = 0;
- DoingSpeach = true;
- }
-
- void KilledUnit(Unit *victim)
- {
- if (rand()%5)
- return;
-
- DoYell(SAY_KILLTARGET,LANG_UNIVERSAL,victim);
- DoPlaySoundToSet(m_creature,SOUND_KILLTARGET);
- }
-
- void Aggro(Unit *who)
- {
- DoCast(m_creature,SPELL_ESSENCEOFTHERED);
- DoZoneInCombat();
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Speach
- if (DoingSpeach)
- if (SpeachTimer < diff)
- {
- switch (SpeachNum)
- {
- case 0:
- //16 seconds till next line
- DoYell(SAY_LINE2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_LINE2);
- SpeachTimer = 16000;
- SpeachNum++;
- break;
-
- case 1:
- //This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!"
- DoYell(SAY_LINE3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_LINE3);
- SpeachTimer = 10000;
- SpeachNum++;
- break;
-
- case 2:
- default:
- m_creature->setFaction(103);
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3));
- if (PlayerGUID && Unit::GetUnit((*m_creature),PlayerGUID))
- {
- DoStartAttackAndMovement(Unit::GetUnit((*m_creature),PlayerGUID));
- DoCast(m_creature,SPELL_ESSENCEOFTHERED);
- }
-
- SpeachTimer = 0;
- DoingSpeach = false;
- break;
- }
- }else SpeachTimer -= diff;
-
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- // Yell if hp lower than 15%
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15 && !HasYelled)
- {
- //Say our dialog
- DoYell(SAY_HALFLIFE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_HALFLIFE);
- HasYelled = true;
- }
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- Cleave_Timer = 15000;
- }else Cleave_Timer -= diff;
-
- //FlameBreath_Timer
- if (FlameBreath_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH);
- FlameBreath_Timer = 4000 + rand()%4000;
- }else FlameBreath_Timer -= diff;
-
- //BurningAdrenalineCaster_Timer
- if (BurningAdrenalineCaster_Timer < diff)
- {
- Unit* target = NULL;
-
- int i = 0 ;
- while (i < 3) // max 3 tries to get a random target with power_mana
- {
- ++i;
- target = SelectUnit(SELECT_TARGET_RANDOM,1);//not aggro leader
- if (target)
- if (target->getPowerType() == POWER_MANA)
- i=3;
- }
- if (target) // cast on self (see below)
- target->CastSpell(target,SPELL_BURNINGADRENALINE,1);
-
- BurningAdrenalineCaster_Timer = 15000;
- }else BurningAdrenalineCaster_Timer -= diff;
-
- //BurningAdrenalineTank_Timer
- if (BurningAdrenalineTank_Timer < diff)
- {
- // have the victim cast the spell on himself otherwise the third effect aura will be applied
- // to Vael instead of the player
-
- m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_BURNINGADRENALINE,1);
-
- BurningAdrenalineTank_Timer = 45000;
- }else BurningAdrenalineTank_Timer -= diff;
-
- //FireNova_Timer
- if (FireNova_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
- FireNova_Timer = 5000;
- }else FireNova_Timer -= diff;
-
- //TailSwipe_Timer
- if (TailSwipe_Timer < diff)
- {
- //Only cast if we are behind
- /*if (!m_creature->HasInArc( M_PI, m_creature->getVictim()))
- {
- DoCast(m_creature->getVictim(),SPELL_TAILSWIPE);
- }*/
-
- TailSwipe_Timer = 20000;
- }else TailSwipe_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-void SendDefaultMenu_boss_vael(Player *player, Creature *_Creature, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
- {
- player->CLOSE_GOSSIP_MENU();
- ((boss_vaelAI*)_Creature->AI())->BeginSpeach((Unit*)player);
- }
-}
-
-bool GossipSelect_boss_vael(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (sender == GOSSIP_SENDER_MAIN)
- SendDefaultMenu_boss_vael(player, _Creature, action);
-
- return true;
-}
-
-bool GossipHello_boss_vael(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(907,_Creature->GetGUID());
-
- return true;
-}
-
-CreatureAI* GetAI_boss_vael(Creature *_Creature)
-{
- return new boss_vaelAI (_Creature);
-}
-
-void AddSC_boss_vael()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_vaelastrasz";
- newscript->GetAI = GetAI_boss_vael;
- newscript->pGossipHello = &GossipHello_boss_vael;
- newscript->pGossipSelect = &GossipSelect_boss_vael;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Vaelastrasz
+SD%Complete: 75
+SDComment: Burning Adrenaline not correctly implemented in core
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_ESSENCEOFTHERED 23513
+#define SPELL_FLAMEBREATH 23461
+#define SPELL_FIRENOVA 23462
+#define SPELL_TAILSWIPE 15847
+#define SPELL_BURNINGADRENALINE 23620
+#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect
+
+#define SAY_LINE1 "Too late...friends. Nefarius' corruption has taken hold. I cannot...control myself. "
+#define SOUND_LINE1 8281
+
+#define SAY_LINE2 "I beg you Mortals, flee! Flee before I lose all control. The Black Fire rages within my heart. I must release it!"
+#define SOUND_LINE2 8282
+
+#define SAY_LINE3 "FLAME! DEATH! DESTRUCTION! COWER MORTALS BEFORE THE WRATH OF LORD....NO! I MUST FIGHT THIS!"
+#define SOUND_LINE3 8283
+
+#define SAY_HALFLIFE "Nefarius' hate has made me stronger than ever before. You should have fled, while you could, mortals! The fury of Blackrock courses through my veins! "
+#define SOUND_HALFLIFE 8285
+
+#define SAY_KILLTARGET "Forgive me $N, your death only adds to my failure."
+#define SOUND_KILLTARGET 8284
+
+#define GOSSIP_ITEM "Start Event "
+
+struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
+{
+ boss_vaelAI(Creature *c) : ScriptedAI(c)
+ {
+ c->SetUInt32Value(UNIT_NPC_FLAGS,1);
+ c->setFaction(35);
+ c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Reset();
+ }
+
+ uint64 PlayerGUID;
+ uint32 SpeachTimer;
+ uint32 SpeachNum;
+ uint32 Cleave_Timer;
+ uint32 FlameBreath_Timer;
+ uint32 FireNova_Timer;
+ uint32 BurningAdrenalineCaster_Timer;
+ uint32 BurningAdrenalineTank_Timer;
+ uint32 TailSwipe_Timer;
+ bool HasYelled;
+ bool DoingSpeach;
+
+ void Reset()
+ {
+ PlayerGUID = 0;
+ SpeachTimer = 0;
+ SpeachNum = 0;
+ Cleave_Timer = 8000; //These times are probably wrong
+ FlameBreath_Timer = 11000;
+ BurningAdrenalineCaster_Timer = 15000;
+ BurningAdrenalineTank_Timer = 45000;
+ FireNova_Timer = 5000;
+ TailSwipe_Timer = 20000;
+ HasYelled = false;
+ DoingSpeach = false;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+ }
+
+ void BeginSpeach(Unit* target)
+ {
+ //Stand up and begin speach
+ PlayerGUID = target->GetGUID();
+
+ //10 seconds
+ DoYell(SAY_LINE1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_LINE1);
+ SpeachTimer = 10000;
+ SpeachNum = 0;
+ DoingSpeach = true;
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if (rand()%5)
+ return;
+
+ DoYell(SAY_KILLTARGET,LANG_UNIVERSAL,victim);
+ DoPlaySoundToSet(m_creature,SOUND_KILLTARGET);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoCast(m_creature,SPELL_ESSENCEOFTHERED);
+ DoZoneInCombat();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Speach
+ if (DoingSpeach)
+ if (SpeachTimer < diff)
+ {
+ switch (SpeachNum)
+ {
+ case 0:
+ //16 seconds till next line
+ DoYell(SAY_LINE2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_LINE2);
+ SpeachTimer = 16000;
+ SpeachNum++;
+ break;
+
+ case 1:
+ //This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!"
+ DoYell(SAY_LINE3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_LINE3);
+ SpeachTimer = 10000;
+ SpeachNum++;
+ break;
+
+ case 2:
+ default:
+ m_creature->setFaction(103);
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3));
+ if (PlayerGUID && Unit::GetUnit((*m_creature),PlayerGUID))
+ {
+ DoStartAttackAndMovement(Unit::GetUnit((*m_creature),PlayerGUID));
+ DoCast(m_creature,SPELL_ESSENCEOFTHERED);
+ }
+
+ SpeachTimer = 0;
+ DoingSpeach = false;
+ break;
+ }
+ }else SpeachTimer -= diff;
+
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ // Yell if hp lower than 15%
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15 && !HasYelled)
+ {
+ //Say our dialog
+ DoYell(SAY_HALFLIFE,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_HALFLIFE);
+ HasYelled = true;
+ }
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 15000;
+ }else Cleave_Timer -= diff;
+
+ //FlameBreath_Timer
+ if (FlameBreath_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH);
+ FlameBreath_Timer = 4000 + rand()%4000;
+ }else FlameBreath_Timer -= diff;
+
+ //BurningAdrenalineCaster_Timer
+ if (BurningAdrenalineCaster_Timer < diff)
+ {
+ Unit* target = NULL;
+
+ int i = 0 ;
+ while (i < 3) // max 3 tries to get a random target with power_mana
+ {
+ ++i;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);//not aggro leader
+ if (target)
+ if (target->getPowerType() == POWER_MANA)
+ i=3;
+ }
+ if (target) // cast on self (see below)
+ target->CastSpell(target,SPELL_BURNINGADRENALINE,1);
+
+ BurningAdrenalineCaster_Timer = 15000;
+ }else BurningAdrenalineCaster_Timer -= diff;
+
+ //BurningAdrenalineTank_Timer
+ if (BurningAdrenalineTank_Timer < diff)
+ {
+ // have the victim cast the spell on himself otherwise the third effect aura will be applied
+ // to Vael instead of the player
+
+ m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_BURNINGADRENALINE,1);
+
+ BurningAdrenalineTank_Timer = 45000;
+ }else BurningAdrenalineTank_Timer -= diff;
+
+ //FireNova_Timer
+ if (FireNova_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
+ FireNova_Timer = 5000;
+ }else FireNova_Timer -= diff;
+
+ //TailSwipe_Timer
+ if (TailSwipe_Timer < diff)
+ {
+ //Only cast if we are behind
+ /*if (!m_creature->HasInArc( M_PI, m_creature->getVictim()))
+ {
+ DoCast(m_creature->getVictim(),SPELL_TAILSWIPE);
+ }*/
+
+ TailSwipe_Timer = 20000;
+ }else TailSwipe_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+void SendDefaultMenu_boss_vael(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((boss_vaelAI*)_Creature->AI())->BeginSpeach((Unit*)player);
+ }
+}
+
+bool GossipSelect_boss_vael(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (sender == GOSSIP_SENDER_MAIN)
+ SendDefaultMenu_boss_vael(player, _Creature, action);
+
+ return true;
+}
+
+bool GossipHello_boss_vael(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(907,_Creature->GetGUID());
+
+ return true;
+}
+
+CreatureAI* GetAI_boss_vael(Creature *_Creature)
+{
+ return new boss_vaelAI (_Creature);
+}
+
+void AddSC_boss_vael()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_vaelastrasz";
+ newscript->GetAI = GetAI_boss_vael;
+ newscript->pGossipHello = &GossipHello_boss_vael;
+ newscript->pGossipSelect = &GossipSelect_boss_vael;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp
index 3bf03bcbb81..0063f070e24 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp
@@ -1,399 +1,399 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Victor_Nefarius
-SD%Complete: 75
-SDComment: Missing some text, Vael beginning event, and spawns Nef in wrong place
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_GAMESBEGIN_1 "In this world where time is your enemy, it is my greatest ally. This grand game of life that you think you play in fact plays you. To that I say..."
-#define SAY_GAMESBEGIN_2 "Let the games begin!"
-#define SAY_VAEL_INTRO ""
-
-#define SOUND_GAMESBEGIN 8280
-#define SOUND_VAEL_INTRO 8279
-
-#define GOSSIP_ITEM_1 "I've made no mistakes."
-#define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles."
-#define GOSSIP_ITEM_3 "Please do."
-
-#define CREATURE_BRONZE_DRAKANOID 14263
-#define CREATURE_BLUE_DRAKANOID 14261
-#define CREATURE_RED_DRAKANOID 14264
-#define CREATURE_GREEN_DRAKANOID 14262
-#define CREATURE_BLACK_DRAKANOID 14265
-
-#define CREATURE_CHROMATIC_DRAKANOID 14302
-
-#define CREATURE_NEFARIAN 11583
-
-#define ADD_X1 -7591.151855
-#define ADD_X2 -7514.598633
-#define ADD_Y1 -1204.051880
-#define ADD_Y2 -1150.448853
-#define ADD_Z1 476.800476
-#define ADD_Z2 476.796570
-
-#define NEF_X -7445
-#define NEF_Y -1332
-#define NEF_Z 536
-
-#define HIDE_X -7592
-#define HIDE_Y -1264
-#define HIDE_Z 481
-
-#define SPELL_SHADOWBOLT 21077
-#define SPELL_FEAR 26070
-
-//This script is complicated
-//Instead of morphing Victor Nefarius we will have him control phase 1
-//And then have him spawn "Nefarian" for phase 2
-//When phase 2 starts Victor Nefarius will go into hiding and stop attacking
-//If Nefarian despawns because he killed the players then this guy will EnterEvadeMode
-//and allow players to start the event over
-//If nefarian dies then he will kill himself then he will kill himself in his hiding place
-//To prevent players from doing the event twice
-
-struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
-{
- boss_victor_nefariusAI(Creature *c) : ScriptedAI(c)
- {
- NefarianGUID = 0;
- Reset();
- srand(time(NULL));
- switch (rand()%20)
- {
- case 0:
- DrakType1 = CREATURE_BRONZE_DRAKANOID;
- DrakType2 = CREATURE_BLUE_DRAKANOID;
- break;
- case 1:
- DrakType1 = CREATURE_BRONZE_DRAKANOID;
- DrakType2 = CREATURE_RED_DRAKANOID;
- break;
- case 2:
- DrakType1 = CREATURE_BRONZE_DRAKANOID;
- DrakType2 = CREATURE_GREEN_DRAKANOID;
- break;
- case 3:
- DrakType1 = CREATURE_BRONZE_DRAKANOID;
- DrakType2 = CREATURE_BLACK_DRAKANOID;
- break;
- case 4:
- DrakType1 = CREATURE_BLUE_DRAKANOID;
- DrakType2 = CREATURE_BRONZE_DRAKANOID;
- break;
- case 5:
- DrakType1 = CREATURE_BLUE_DRAKANOID;
- DrakType2 = CREATURE_RED_DRAKANOID;
- break;
- case 6:
- DrakType1 = CREATURE_BLUE_DRAKANOID;
- DrakType2 = CREATURE_GREEN_DRAKANOID;
- break;
- case 7:
- DrakType1 = CREATURE_BLUE_DRAKANOID;
- DrakType2 = CREATURE_BLACK_DRAKANOID;
- break;
- case 8:
- DrakType1 = CREATURE_RED_DRAKANOID;
- DrakType2 = CREATURE_BRONZE_DRAKANOID;
- break;
- case 9:
- DrakType1 = CREATURE_RED_DRAKANOID;
- DrakType2 = CREATURE_BLUE_DRAKANOID;
- break;
- case 10:
- DrakType1 = CREATURE_RED_DRAKANOID;
- DrakType2 = CREATURE_GREEN_DRAKANOID;
- break;
- case 11:
- DrakType1 = CREATURE_RED_DRAKANOID;
- DrakType2 = CREATURE_BLACK_DRAKANOID;
- break;
- case 12:
- DrakType1 = CREATURE_GREEN_DRAKANOID;
- DrakType2 = CREATURE_BRONZE_DRAKANOID;
- break;
- case 13:
- DrakType1 = CREATURE_GREEN_DRAKANOID;
- DrakType2 = CREATURE_BLUE_DRAKANOID;
- break;
- case 14:
- DrakType1 = CREATURE_GREEN_DRAKANOID;
- DrakType2 = CREATURE_RED_DRAKANOID;
- break;
- case 15:
- DrakType1 = CREATURE_GREEN_DRAKANOID;
- DrakType2 = CREATURE_BLACK_DRAKANOID;
- break;
- case 16:
- DrakType1 = CREATURE_BLACK_DRAKANOID;
- DrakType2 = CREATURE_BRONZE_DRAKANOID;
- break;
- case 17:
- DrakType1 = CREATURE_BLACK_DRAKANOID;
- DrakType2 = CREATURE_BLUE_DRAKANOID;
- break;
- case 18:
- DrakType1 = CREATURE_BLACK_DRAKANOID;
- DrakType2 = CREATURE_GREEN_DRAKANOID;
- break;
- case 19:
- DrakType1 = CREATURE_BLACK_DRAKANOID;
- DrakType2 = CREATURE_RED_DRAKANOID;
- break;
- }
- }
-
- uint32 SpawnedAdds;
- uint32 AddSpawnTimer;
- uint32 ShadowBoltTimer;
- uint32 FearTimer;
- uint32 MindControlTimer;
- uint32 ResetTimer;
- uint32 DrakType1;
- uint32 DrakType2;
- uint64 NefarianGUID;
- uint32 NefCheckTime;
-
- void Reset()
- {
- SpawnedAdds = 0;
- AddSpawnTimer = 10000;
- ShadowBoltTimer = 5000;
- FearTimer = 8000;
- ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
- NefarianGUID = 0;
- NefCheckTime = 2000;
-
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS,1);
- m_creature->setFaction(35);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void BeginEvent(Player* target)
- {
- DoYell(SAY_GAMESBEGIN_2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_GAMESBEGIN);
-
- //Trinity::Singleton::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
- /*
- list ::iterator i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
-
- for (i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); i != MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().end(); ++i)
- {
- AttackStart((*i));
- }
- */
- m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
- m_creature->setFaction(103);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- AttackStart(target);
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- //We simply use this function to find players until we can use Map->GetPlayers()
-
- if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who))
- {
- //Add them to our threat list
- m_creature->AddThreat(who,0.0f);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Only do this if we haven't spawned nef yet
- if (SpawnedAdds < 42)
- {
- //ShadowBoltTimer
- if (ShadowBoltTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- DoCast(target,SPELL_SHADOWBOLT);
-
- ShadowBoltTimer = 3000 + (rand()%7000);
- }else ShadowBoltTimer -= diff;
-
- //FearTimer
- if (FearTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)
- DoCast(target,SPELL_FEAR);
-
- FearTimer = 10000 + (rand()%10000);
- }else FearTimer -= diff;
-
- //Add spawning mechanism
- if (AddSpawnTimer < diff)
- {
- //Spawn 2 random types of creatures at the 2 locations
- uint32 CreatureID;
- Creature* Spawned = NULL;
- Unit* target = NULL;
-
- //1 in 3 chance it will be a chromatic
- if (rand()%3 == 0)
- CreatureID = CREATURE_CHROMATIC_DRAKANOID;
- else CreatureID = DrakType1;
-
- SpawnedAdds++;
-
- //Spawn creature and force it to start attacking a random target
- Spawned = m_creature->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && Spawned)
- {
- Spawned->AI()->AttackStart(target);
- Spawned->setFaction(103);
- }
-
- //1 in 3 chance it will be a chromatic
- if (rand()%3 == 0)
- CreatureID = CREATURE_CHROMATIC_DRAKANOID;
- else CreatureID = DrakType2;
-
- SpawnedAdds++;
-
- target = NULL;
- Spawned = NULL;
- Spawned = m_creature->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && Spawned)
- {
- Spawned->AI()->AttackStart(target);
- Spawned->setFaction(103);
- }
-
- //Begin phase 2 by spawning Nefarian and what not
- if (SpawnedAdds >= 42)
- {
- //Teleport Victor Nefarius way out of the map
- //MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->CreatureRelocation(m_creature,0,0,-5000,0);
-
- //Inturrupt any spell casting
- m_creature->InterruptNonMeleeSpells(false);
-
- //Root self
- DoCast(m_creature,33356);
-
- //Make super invis
- DoCast(m_creature,8149);
-
- //Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
- m_creature->Relocate(HIDE_X,HIDE_Y,HIDE_Z,0);
- m_creature->SendMonsterMove(HIDE_X,HIDE_Y,HIDE_Z,0,true,0);
- m_creature->addUnitState(UNIT_STAT_FLEEING);
-
- //Spawn nef and have him attack a random target
- Creature* Nefarian = NULL;
- Nefarian = m_creature->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
- target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && Nefarian)
- {
- Nefarian->AI()->AttackStart(target);
- Nefarian->setFaction(103);
- NefarianGUID = Nefarian->GetGUID();
- }
- else DoYell("UNABLE TO SPAWN NEF PROPERLY",LANG_UNIVERSAL,NULL);
- }
-
- AddSpawnTimer = 4000;
- }else AddSpawnTimer -= diff;
- }
- else if (NefarianGUID)
- {
- if (NefCheckTime < diff)
- {
- Unit* Nefarian = NULL;
- Nefarian = Unit::GetUnit((*m_creature),NefarianGUID);
-
- //If nef is dead then we die to so the players get out of combat
- //and cannot repeat the event
- if (!Nefarian || !Nefarian->isAlive())
- {
- NefarianGUID = 0;
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- NefCheckTime = 2000;
- }else NefCheckTime -= diff;
- }
- }
-};
-
-CreatureAI* GetAI_boss_victor_nefarius(Creature *_Creature)
-{
- return new boss_victor_nefariusAI (_Creature);
-}
-
-bool GossipHello_boss_victor_nefarius(Player *player, Creature *_Creature)
-{
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(7134,_Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_boss_victor_nefarius(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(7198, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(7199, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->CLOSE_GOSSIP_MENU();
- _Creature->MonsterSay(SAY_GAMESBEGIN_1,LANG_UNIVERSAL,0);
- ((boss_victor_nefariusAI*)_Creature->AI())->BeginEvent(player);
- break;
- }
- return true;
-}
-
-void AddSC_boss_victor_nefarius()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="boss_victor_nefarius";
- newscript->GetAI = GetAI_boss_victor_nefarius;
- newscript->pGossipHello = &GossipHello_boss_victor_nefarius;
- newscript->pGossipSelect = &GossipSelect_boss_victor_nefarius;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Victor_Nefarius
+SD%Complete: 75
+SDComment: Missing some text, Vael beginning event, and spawns Nef in wrong place
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_GAMESBEGIN_1 "In this world where time is your enemy, it is my greatest ally. This grand game of life that you think you play in fact plays you. To that I say..."
+#define SAY_GAMESBEGIN_2 "Let the games begin!"
+#define SAY_VAEL_INTRO ""
+
+#define SOUND_GAMESBEGIN 8280
+#define SOUND_VAEL_INTRO 8279
+
+#define GOSSIP_ITEM_1 "I've made no mistakes."
+#define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles."
+#define GOSSIP_ITEM_3 "Please do."
+
+#define CREATURE_BRONZE_DRAKANOID 14263
+#define CREATURE_BLUE_DRAKANOID 14261
+#define CREATURE_RED_DRAKANOID 14264
+#define CREATURE_GREEN_DRAKANOID 14262
+#define CREATURE_BLACK_DRAKANOID 14265
+
+#define CREATURE_CHROMATIC_DRAKANOID 14302
+
+#define CREATURE_NEFARIAN 11583
+
+#define ADD_X1 -7591.151855
+#define ADD_X2 -7514.598633
+#define ADD_Y1 -1204.051880
+#define ADD_Y2 -1150.448853
+#define ADD_Z1 476.800476
+#define ADD_Z2 476.796570
+
+#define NEF_X -7445
+#define NEF_Y -1332
+#define NEF_Z 536
+
+#define HIDE_X -7592
+#define HIDE_Y -1264
+#define HIDE_Z 481
+
+#define SPELL_SHADOWBOLT 21077
+#define SPELL_FEAR 26070
+
+//This script is complicated
+//Instead of morphing Victor Nefarius we will have him control phase 1
+//And then have him spawn "Nefarian" for phase 2
+//When phase 2 starts Victor Nefarius will go into hiding and stop attacking
+//If Nefarian despawns because he killed the players then this guy will EnterEvadeMode
+//and allow players to start the event over
+//If nefarian dies then he will kill himself then he will kill himself in his hiding place
+//To prevent players from doing the event twice
+
+struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
+{
+ boss_victor_nefariusAI(Creature *c) : ScriptedAI(c)
+ {
+ NefarianGUID = 0;
+ Reset();
+ srand(time(NULL));
+ switch (rand()%20)
+ {
+ case 0:
+ DrakType1 = CREATURE_BRONZE_DRAKANOID;
+ DrakType2 = CREATURE_BLUE_DRAKANOID;
+ break;
+ case 1:
+ DrakType1 = CREATURE_BRONZE_DRAKANOID;
+ DrakType2 = CREATURE_RED_DRAKANOID;
+ break;
+ case 2:
+ DrakType1 = CREATURE_BRONZE_DRAKANOID;
+ DrakType2 = CREATURE_GREEN_DRAKANOID;
+ break;
+ case 3:
+ DrakType1 = CREATURE_BRONZE_DRAKANOID;
+ DrakType2 = CREATURE_BLACK_DRAKANOID;
+ break;
+ case 4:
+ DrakType1 = CREATURE_BLUE_DRAKANOID;
+ DrakType2 = CREATURE_BRONZE_DRAKANOID;
+ break;
+ case 5:
+ DrakType1 = CREATURE_BLUE_DRAKANOID;
+ DrakType2 = CREATURE_RED_DRAKANOID;
+ break;
+ case 6:
+ DrakType1 = CREATURE_BLUE_DRAKANOID;
+ DrakType2 = CREATURE_GREEN_DRAKANOID;
+ break;
+ case 7:
+ DrakType1 = CREATURE_BLUE_DRAKANOID;
+ DrakType2 = CREATURE_BLACK_DRAKANOID;
+ break;
+ case 8:
+ DrakType1 = CREATURE_RED_DRAKANOID;
+ DrakType2 = CREATURE_BRONZE_DRAKANOID;
+ break;
+ case 9:
+ DrakType1 = CREATURE_RED_DRAKANOID;
+ DrakType2 = CREATURE_BLUE_DRAKANOID;
+ break;
+ case 10:
+ DrakType1 = CREATURE_RED_DRAKANOID;
+ DrakType2 = CREATURE_GREEN_DRAKANOID;
+ break;
+ case 11:
+ DrakType1 = CREATURE_RED_DRAKANOID;
+ DrakType2 = CREATURE_BLACK_DRAKANOID;
+ break;
+ case 12:
+ DrakType1 = CREATURE_GREEN_DRAKANOID;
+ DrakType2 = CREATURE_BRONZE_DRAKANOID;
+ break;
+ case 13:
+ DrakType1 = CREATURE_GREEN_DRAKANOID;
+ DrakType2 = CREATURE_BLUE_DRAKANOID;
+ break;
+ case 14:
+ DrakType1 = CREATURE_GREEN_DRAKANOID;
+ DrakType2 = CREATURE_RED_DRAKANOID;
+ break;
+ case 15:
+ DrakType1 = CREATURE_GREEN_DRAKANOID;
+ DrakType2 = CREATURE_BLACK_DRAKANOID;
+ break;
+ case 16:
+ DrakType1 = CREATURE_BLACK_DRAKANOID;
+ DrakType2 = CREATURE_BRONZE_DRAKANOID;
+ break;
+ case 17:
+ DrakType1 = CREATURE_BLACK_DRAKANOID;
+ DrakType2 = CREATURE_BLUE_DRAKANOID;
+ break;
+ case 18:
+ DrakType1 = CREATURE_BLACK_DRAKANOID;
+ DrakType2 = CREATURE_GREEN_DRAKANOID;
+ break;
+ case 19:
+ DrakType1 = CREATURE_BLACK_DRAKANOID;
+ DrakType2 = CREATURE_RED_DRAKANOID;
+ break;
+ }
+ }
+
+ uint32 SpawnedAdds;
+ uint32 AddSpawnTimer;
+ uint32 ShadowBoltTimer;
+ uint32 FearTimer;
+ uint32 MindControlTimer;
+ uint32 ResetTimer;
+ uint32 DrakType1;
+ uint32 DrakType2;
+ uint64 NefarianGUID;
+ uint32 NefCheckTime;
+
+ void Reset()
+ {
+ SpawnedAdds = 0;
+ AddSpawnTimer = 10000;
+ ShadowBoltTimer = 5000;
+ FearTimer = 8000;
+ ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
+ NefarianGUID = 0;
+ NefCheckTime = 2000;
+
+ m_creature->SetUInt32Value(UNIT_NPC_FLAGS,1);
+ m_creature->setFaction(35);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void BeginEvent(Player* target)
+ {
+ DoYell(SAY_GAMESBEGIN_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_GAMESBEGIN);
+
+ //Trinity::Singleton::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
+ /*
+ list ::iterator i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
+
+ for (i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); i != MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().end(); ++i)
+ {
+ AttackStart((*i));
+ }
+ */
+ m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
+ m_creature->setFaction(103);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ AttackStart(target);
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ //We simply use this function to find players until we can use Map->GetPlayers()
+
+ if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who))
+ {
+ //Add them to our threat list
+ m_creature->AddThreat(who,0.0f);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Only do this if we haven't spawned nef yet
+ if (SpawnedAdds < 42)
+ {
+ //ShadowBoltTimer
+ if (ShadowBoltTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ DoCast(target,SPELL_SHADOWBOLT);
+
+ ShadowBoltTimer = 3000 + (rand()%7000);
+ }else ShadowBoltTimer -= diff;
+
+ //FearTimer
+ if (FearTimer < diff)
+ {
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ DoCast(target,SPELL_FEAR);
+
+ FearTimer = 10000 + (rand()%10000);
+ }else FearTimer -= diff;
+
+ //Add spawning mechanism
+ if (AddSpawnTimer < diff)
+ {
+ //Spawn 2 random types of creatures at the 2 locations
+ uint32 CreatureID;
+ Creature* Spawned = NULL;
+ Unit* target = NULL;
+
+ //1 in 3 chance it will be a chromatic
+ if (rand()%3 == 0)
+ CreatureID = CREATURE_CHROMATIC_DRAKANOID;
+ else CreatureID = DrakType1;
+
+ SpawnedAdds++;
+
+ //Spawn creature and force it to start attacking a random target
+ Spawned = m_creature->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && Spawned)
+ {
+ Spawned->AI()->AttackStart(target);
+ Spawned->setFaction(103);
+ }
+
+ //1 in 3 chance it will be a chromatic
+ if (rand()%3 == 0)
+ CreatureID = CREATURE_CHROMATIC_DRAKANOID;
+ else CreatureID = DrakType2;
+
+ SpawnedAdds++;
+
+ target = NULL;
+ Spawned = NULL;
+ Spawned = m_creature->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && Spawned)
+ {
+ Spawned->AI()->AttackStart(target);
+ Spawned->setFaction(103);
+ }
+
+ //Begin phase 2 by spawning Nefarian and what not
+ if (SpawnedAdds >= 42)
+ {
+ //Teleport Victor Nefarius way out of the map
+ //MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->CreatureRelocation(m_creature,0,0,-5000,0);
+
+ //Inturrupt any spell casting
+ m_creature->InterruptNonMeleeSpells(false);
+
+ //Root self
+ DoCast(m_creature,33356);
+
+ //Make super invis
+ DoCast(m_creature,8149);
+
+ //Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
+ m_creature->Relocate(HIDE_X,HIDE_Y,HIDE_Z,0);
+ m_creature->SendMonsterMove(HIDE_X,HIDE_Y,HIDE_Z,0,true,0);
+ m_creature->addUnitState(UNIT_STAT_FLEEING);
+
+ //Spawn nef and have him attack a random target
+ Creature* Nefarian = NULL;
+ Nefarian = m_creature->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
+ target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && Nefarian)
+ {
+ Nefarian->AI()->AttackStart(target);
+ Nefarian->setFaction(103);
+ NefarianGUID = Nefarian->GetGUID();
+ }
+ else DoYell("UNABLE TO SPAWN NEF PROPERLY",LANG_UNIVERSAL,NULL);
+ }
+
+ AddSpawnTimer = 4000;
+ }else AddSpawnTimer -= diff;
+ }
+ else if (NefarianGUID)
+ {
+ if (NefCheckTime < diff)
+ {
+ Unit* Nefarian = NULL;
+ Nefarian = Unit::GetUnit((*m_creature),NefarianGUID);
+
+ //If nef is dead then we die to so the players get out of combat
+ //and cannot repeat the event
+ if (!Nefarian || !Nefarian->isAlive())
+ {
+ NefarianGUID = 0;
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ NefCheckTime = 2000;
+ }else NefCheckTime -= diff;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_victor_nefarius(Creature *_Creature)
+{
+ return new boss_victor_nefariusAI (_Creature);
+}
+
+bool GossipHello_boss_victor_nefarius(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(7134,_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_boss_victor_nefarius(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(7198, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(7199, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->MonsterSay(SAY_GAMESBEGIN_1,LANG_UNIVERSAL,0);
+ ((boss_victor_nefariusAI*)_Creature->AI())->BeginEvent(player);
+ break;
+ }
+ return true;
+}
+
+void AddSC_boss_victor_nefarius()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_victor_nefarius";
+ newscript->GetAI = GetAI_boss_victor_nefarius;
+ newscript->pGossipHello = &GossipHello_boss_victor_nefarius;
+ newscript->pGossipSelect = &GossipSelect_boss_victor_nefarius;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp
index e6c06bc739c..7bdd3250442 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp
@@ -1,8 +1,8 @@
-/* ScriptData
-SDName: Instance_Blackwing_Lair
-SD%Complete: 0
-SDComment:
-SDCategory: Blackwing Lair
-EndScriptData */
-
-#include "precompiled.h"
+/* ScriptData
+SDName: Instance_Blackwing_Lair
+SD%Complete: 0
+SDComment:
+SDCategory: Blackwing Lair
+EndScriptData */
+
+#include "precompiled.h"
diff --git a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
index 42e3121f350..a7c35624830 100644
--- a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
+++ b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
@@ -1,441 +1,441 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Blades_Edge_Mountains
-SD%Complete: 90
-SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
-SDCategory: Blade's Edge Mountains
-EndScriptData */
-
-/* ContentData
-mobs_bladespire_ogre
-mobs_nether_drake
-npc_daranelle
-npc_overseer_nuaar
-npc_saikkal_the_elder
-npc_skyguard_handler_irena
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mobs_bladespire_ogre
-######*/
-
-//TODO: add support for quest 10512 + creature abilities
-struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI
-{
- mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void JustDied(Unit* Killer)
- {
- if (Killer->GetTypeId() == TYPEID_PLAYER)
- ((Player*)Killer)->KilledMonster(19995, m_creature->GetGUID());
- }
-};
-CreatureAI* GetAI_mobs_bladespire_ogre(Creature *_Creature)
-{
- return new mobs_bladespire_ogreAI (_Creature);
-}
-
-/*######
-## mobs_nether_drake
-######*/
-
-#define SAY_NIHIL_1 "Muahahahaha! You fool! You've released me from my banishment in the interstices between space and time!"
-#define SAY_NIHIL_2 "All of Draenor shall quick beneath my feet! I will destroy this world and reshape it in my image!"
-#define SAY_NIHIL_3 "Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!"
-#define SAY_NIHIL_4 "No doubt the fools that banished me are long dead. I shall take wing survey my demense. Pray to whatever gods you hold dear that we do not meet again."
-#define SAY_NIHIL_INTERRUPT "NOOOOooooooo!"
-
-#define ENTRY_WHELP 20021
-#define ENTRY_PROTO 21821
-#define ENTRY_ADOLE 21817
-#define ENTRY_MATUR 21820
-#define ENTRY_NIHIL 21823
-
-#define SPELL_T_PHASE_MODULATOR 37573
-
-#define SPELL_ARCANE_BLAST 38881
-#define SPELL_MANA_BURN 38884
-#define SPELL_INTANGIBLE_PRESENCE 36513
-
-struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI
-{
- mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- bool IsNihil;
- uint32 NihilSpeech_Timer;
- uint32 NihilSpeech_Phase;
-
- uint32 ArcaneBlast_Timer;
- uint32 ManaBurn_Timer;
- uint32 IntangiblePresence_Timer;
-
- void Reset()
- {
- NihilSpeech_Timer = 2000;
- IsNihil = false;
- if( m_creature->GetEntry() == ENTRY_NIHIL )
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- IsNihil = true;
- }
- NihilSpeech_Phase = 1;
-
- ArcaneBlast_Timer = 7500;
- ManaBurn_Timer = 10000;
- IntangiblePresence_Timer = 15000;
- }
-
- void Aggro(Unit* who) { }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if( spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER )
- {
- uint32 cEntry = 0;
-
- switch( m_creature->GetEntry() )
- {
- case ENTRY_WHELP:
- switch(rand()%4)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_ADOLE; break;
- case 2: cEntry = ENTRY_MATUR; break;
- case 3: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_PROTO:
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_ADOLE; break;
- case 1: cEntry = ENTRY_MATUR; break;
- case 2: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_ADOLE:
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_MATUR; break;
- case 2: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_MATUR:
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_ADOLE; break;
- case 2: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_NIHIL:
- if( NihilSpeech_Phase )
- {
- DoYell(SAY_NIHIL_INTERRUPT,LANG_UNIVERSAL,NULL);
- IsNihil = false;
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_ADOLE; break;
- case 2: cEntry = ENTRY_MATUR; break;
- }
- }
- break;
- }
-
- if( cEntry )
- {
- m_creature->UpdateEntry(cEntry);
-
- if( cEntry == ENTRY_NIHIL )
- {
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- InCombat = false;
- Reset();
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if( IsNihil )
- {
- if( NihilSpeech_Phase )
- {
- if(NihilSpeech_Timer <= diff)
- {
- switch( NihilSpeech_Phase )
- {
- case 1:
- DoSay(SAY_NIHIL_1,LANG_UNIVERSAL,NULL);
- ++NihilSpeech_Phase;
- break;
- case 2:
- DoSay(SAY_NIHIL_2,LANG_UNIVERSAL,NULL);
- ++NihilSpeech_Phase;
- break;
- case 3:
- DoSay(SAY_NIHIL_3,LANG_UNIVERSAL,NULL);
- ++NihilSpeech_Phase;
- break;
- case 4:
- DoSay(SAY_NIHIL_4,LANG_UNIVERSAL,NULL);
- ++NihilSpeech_Phase;
- break;
- case 5:
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // + MOVEMENTFLAG_LEVITATING
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- //then take off to random location. creature is initially summoned, so don't bother do anything else.
- m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+100, m_creature->GetPositionY(), m_creature->GetPositionZ()+100);
- NihilSpeech_Phase = 0;
- break;
- }
- NihilSpeech_Timer = 5000;
- }else NihilSpeech_Timer -=diff;
- }
- return; //anything below here is not interesting for Nihil, so skip it
- }
-
- if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- if( IntangiblePresence_Timer <= diff )
- {
- DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE);
- IntangiblePresence_Timer = 15000+rand()%15000;
- }else IntangiblePresence_Timer -= diff;
-
- if( ManaBurn_Timer <= diff )
- {
- Unit* target = m_creature->getVictim();
- if( target && target->getPowerType() == POWER_MANA )
- DoCast(target,SPELL_MANA_BURN);
- ManaBurn_Timer = 8000+rand()%8000;
- }else ManaBurn_Timer -= diff;
-
- if( ArcaneBlast_Timer <= diff )
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST);
- ArcaneBlast_Timer = 2500+rand()%5000;
- }else ArcaneBlast_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature)
-{
- return new mobs_nether_drakeAI (_Creature);
-}
-
-/*######
-## npc_daranelle
-######*/
-
-struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
-{
- npc_daranelleAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (who->GetTypeId() == TYPEID_PLAYER)
- {
- if(who->HasAura(36904,0))
- {
- DoSay("Good $N, you are under the spell's influence. I must analyze it quickly, then we can talk.",LANG_COMMON,who);
- //TODO: Move the below to updateAI and run if this statement == true
- ((Player*)who)->KilledMonster(21511, m_creature->GetGUID());
- ((Player*)who)->RemoveAurasDueToSpell(36904);
- }
- }
-
- if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- //Begin melee attack if we are within range
- DoStartAttackAndMovement(who);
- }
- }
- }
-};
-
-CreatureAI* GetAI_npc_daranelle(Creature *_Creature)
-{
- return new npc_daranelleAI (_Creature);
-}
-
-/*######
-## npc_overseer_nuaar
-######*/
-
-bool GossipHello_npc_overseer_nuaar(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(10532, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_overseer_nuaar(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->SEND_GOSSIP_MENU(10533, _Creature->GetGUID());
- player->AreaExploredOrEventHappens(10682);
- }
- return true;
-}
-
-/*######
-## npc_saikkal_the_elder
-######*/
-
-bool GossipHello_npc_saikkal_the_elder(Player *player, Creature *_Creature)
-{
- if (player->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(10794, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_saikkal_the_elder(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(10795, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
- player->SEND_GOSSIP_MENU(10796, _Creature->GetGUID());
- break;
- }
- return true;
-}
-
-/*######
-## npc_skyguard_handler_irena
-######*/
-
-#define GOSSIP_SKYGUARD "Fly me to Skettis please"
-
-bool GossipHello_npc_skyguard_handler_irena(Player *player, Creature *_Creature )
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetReputationRank(1031) >= REP_HONORED)
- player->ADD_GOSSIP_ITEM( 2, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_skyguard_handler_irena(Player *player, Creature *_Creature, uint32 sender, uint32 action )
-{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
-
- std::vector nodes;
-
- nodes.resize(2);
- nodes[0] = 172; //from ogri'la
- nodes[1] = 171; //end at skettis
- player->ActivateTaxiPathTo(nodes); //TaxiPath 706
- }
- return true;
-}
-
-/*######
-## AddSC
-######*/
-
-void AddSC_blades_edge_mountains()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mobs_bladespire_ogre";
- newscript->GetAI = GetAI_mobs_bladespire_ogre;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mobs_nether_drake";
- newscript->GetAI = GetAI_mobs_nether_drake;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_daranelle";
- newscript->GetAI = GetAI_npc_daranelle;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_overseer_nuaar";
- newscript->pGossipHello = &GossipHello_npc_overseer_nuaar;
- newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_saikkal_the_elder";
- newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder;
- newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_skyguard_handler_irena";
- newscript->pGossipHello = &GossipHello_npc_skyguard_handler_irena;
- newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_irena;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Blades_Edge_Mountains
+SD%Complete: 90
+SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
+SDCategory: Blade's Edge Mountains
+EndScriptData */
+
+/* ContentData
+mobs_bladespire_ogre
+mobs_nether_drake
+npc_daranelle
+npc_overseer_nuaar
+npc_saikkal_the_elder
+npc_skyguard_handler_irena
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mobs_bladespire_ogre
+######*/
+
+//TODO: add support for quest 10512 + creature abilities
+struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI
+{
+ mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if (Killer->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)Killer)->KilledMonster(19995, m_creature->GetGUID());
+ }
+};
+CreatureAI* GetAI_mobs_bladespire_ogre(Creature *_Creature)
+{
+ return new mobs_bladespire_ogreAI (_Creature);
+}
+
+/*######
+## mobs_nether_drake
+######*/
+
+#define SAY_NIHIL_1 "Muahahahaha! You fool! You've released me from my banishment in the interstices between space and time!"
+#define SAY_NIHIL_2 "All of Draenor shall quick beneath my feet! I will destroy this world and reshape it in my image!"
+#define SAY_NIHIL_3 "Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!"
+#define SAY_NIHIL_4 "No doubt the fools that banished me are long dead. I shall take wing survey my demense. Pray to whatever gods you hold dear that we do not meet again."
+#define SAY_NIHIL_INTERRUPT "NOOOOooooooo!"
+
+#define ENTRY_WHELP 20021
+#define ENTRY_PROTO 21821
+#define ENTRY_ADOLE 21817
+#define ENTRY_MATUR 21820
+#define ENTRY_NIHIL 21823
+
+#define SPELL_T_PHASE_MODULATOR 37573
+
+#define SPELL_ARCANE_BLAST 38881
+#define SPELL_MANA_BURN 38884
+#define SPELL_INTANGIBLE_PRESENCE 36513
+
+struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI
+{
+ mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ bool IsNihil;
+ uint32 NihilSpeech_Timer;
+ uint32 NihilSpeech_Phase;
+
+ uint32 ArcaneBlast_Timer;
+ uint32 ManaBurn_Timer;
+ uint32 IntangiblePresence_Timer;
+
+ void Reset()
+ {
+ NihilSpeech_Timer = 2000;
+ IsNihil = false;
+ if( m_creature->GetEntry() == ENTRY_NIHIL )
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ IsNihil = true;
+ }
+ NihilSpeech_Phase = 1;
+
+ ArcaneBlast_Timer = 7500;
+ ManaBurn_Timer = 10000;
+ IntangiblePresence_Timer = 15000;
+ }
+
+ void Aggro(Unit* who) { }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if( spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER )
+ {
+ uint32 cEntry = 0;
+
+ switch( m_creature->GetEntry() )
+ {
+ case ENTRY_WHELP:
+ switch(rand()%4)
+ {
+ case 0: cEntry = ENTRY_PROTO; break;
+ case 1: cEntry = ENTRY_ADOLE; break;
+ case 2: cEntry = ENTRY_MATUR; break;
+ case 3: cEntry = ENTRY_NIHIL; break;
+ }
+ break;
+ case ENTRY_PROTO:
+ switch(rand()%3)
+ {
+ case 0: cEntry = ENTRY_ADOLE; break;
+ case 1: cEntry = ENTRY_MATUR; break;
+ case 2: cEntry = ENTRY_NIHIL; break;
+ }
+ break;
+ case ENTRY_ADOLE:
+ switch(rand()%3)
+ {
+ case 0: cEntry = ENTRY_PROTO; break;
+ case 1: cEntry = ENTRY_MATUR; break;
+ case 2: cEntry = ENTRY_NIHIL; break;
+ }
+ break;
+ case ENTRY_MATUR:
+ switch(rand()%3)
+ {
+ case 0: cEntry = ENTRY_PROTO; break;
+ case 1: cEntry = ENTRY_ADOLE; break;
+ case 2: cEntry = ENTRY_NIHIL; break;
+ }
+ break;
+ case ENTRY_NIHIL:
+ if( NihilSpeech_Phase )
+ {
+ DoYell(SAY_NIHIL_INTERRUPT,LANG_UNIVERSAL,NULL);
+ IsNihil = false;
+ switch(rand()%3)
+ {
+ case 0: cEntry = ENTRY_PROTO; break;
+ case 1: cEntry = ENTRY_ADOLE; break;
+ case 2: cEntry = ENTRY_MATUR; break;
+ }
+ }
+ break;
+ }
+
+ if( cEntry )
+ {
+ m_creature->UpdateEntry(cEntry);
+
+ if( cEntry == ENTRY_NIHIL )
+ {
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ InCombat = false;
+ Reset();
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if( IsNihil )
+ {
+ if( NihilSpeech_Phase )
+ {
+ if(NihilSpeech_Timer <= diff)
+ {
+ switch( NihilSpeech_Phase )
+ {
+ case 1:
+ DoSay(SAY_NIHIL_1,LANG_UNIVERSAL,NULL);
+ ++NihilSpeech_Phase;
+ break;
+ case 2:
+ DoSay(SAY_NIHIL_2,LANG_UNIVERSAL,NULL);
+ ++NihilSpeech_Phase;
+ break;
+ case 3:
+ DoSay(SAY_NIHIL_3,LANG_UNIVERSAL,NULL);
+ ++NihilSpeech_Phase;
+ break;
+ case 4:
+ DoSay(SAY_NIHIL_4,LANG_UNIVERSAL,NULL);
+ ++NihilSpeech_Phase;
+ break;
+ case 5:
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // + MOVEMENTFLAG_LEVITATING
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ //then take off to random location. creature is initially summoned, so don't bother do anything else.
+ m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+100, m_creature->GetPositionY(), m_creature->GetPositionZ()+100);
+ NihilSpeech_Phase = 0;
+ break;
+ }
+ NihilSpeech_Timer = 5000;
+ }else NihilSpeech_Timer -=diff;
+ }
+ return; //anything below here is not interesting for Nihil, so skip it
+ }
+
+ if( !m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ if( IntangiblePresence_Timer <= diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE);
+ IntangiblePresence_Timer = 15000+rand()%15000;
+ }else IntangiblePresence_Timer -= diff;
+
+ if( ManaBurn_Timer <= diff )
+ {
+ Unit* target = m_creature->getVictim();
+ if( target && target->getPowerType() == POWER_MANA )
+ DoCast(target,SPELL_MANA_BURN);
+ ManaBurn_Timer = 8000+rand()%8000;
+ }else ManaBurn_Timer -= diff;
+
+ if( ArcaneBlast_Timer <= diff )
+ {
+ DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST);
+ ArcaneBlast_Timer = 2500+rand()%5000;
+ }else ArcaneBlast_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature)
+{
+ return new mobs_nether_drakeAI (_Creature);
+}
+
+/*######
+## npc_daranelle
+######*/
+
+struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
+{
+ npc_daranelleAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ {
+ if(who->HasAura(36904,0))
+ {
+ DoSay("Good $N, you are under the spell's influence. I must analyze it quickly, then we can talk.",LANG_COMMON,who);
+ //TODO: Move the below to updateAI and run if this statement == true
+ ((Player*)who)->KilledMonster(21511, m_creature->GetGUID());
+ ((Player*)who)->RemoveAurasDueToSpell(36904);
+ }
+ }
+
+ if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ //Begin melee attack if we are within range
+ DoStartAttackAndMovement(who);
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_daranelle(Creature *_Creature)
+{
+ return new npc_daranelleAI (_Creature);
+}
+
+/*######
+## npc_overseer_nuaar
+######*/
+
+bool GossipHello_npc_overseer_nuaar(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(10532, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_overseer_nuaar(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->SEND_GOSSIP_MENU(10533, _Creature->GetGUID());
+ player->AreaExploredOrEventHappens(10682);
+ }
+ return true;
+}
+
+/*######
+## npc_saikkal_the_elder
+######*/
+
+bool GossipHello_npc_saikkal_the_elder(Player *player, Creature *_Creature)
+{
+ if (player->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(10794, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_saikkal_the_elder(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(10795, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
+ player->SEND_GOSSIP_MENU(10796, _Creature->GetGUID());
+ break;
+ }
+ return true;
+}
+
+/*######
+## npc_skyguard_handler_irena
+######*/
+
+#define GOSSIP_SKYGUARD "Fly me to Skettis please"
+
+bool GossipHello_npc_skyguard_handler_irena(Player *player, Creature *_Creature )
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetReputationRank(1031) >= REP_HONORED)
+ player->ADD_GOSSIP_ITEM( 2, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_skyguard_handler_irena(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ std::vector nodes;
+
+ nodes.resize(2);
+ nodes[0] = 172; //from ogri'la
+ nodes[1] = 171; //end at skettis
+ player->ActivateTaxiPathTo(nodes); //TaxiPath 706
+ }
+ return true;
+}
+
+/*######
+## AddSC
+######*/
+
+void AddSC_blades_edge_mountains()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mobs_bladespire_ogre";
+ newscript->GetAI = GetAI_mobs_bladespire_ogre;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="mobs_nether_drake";
+ newscript->GetAI = GetAI_mobs_nether_drake;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_daranelle";
+ newscript->GetAI = GetAI_npc_daranelle;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_overseer_nuaar";
+ newscript->pGossipHello = &GossipHello_npc_overseer_nuaar;
+ newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_saikkal_the_elder";
+ newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder;
+ newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_skyguard_handler_irena";
+ newscript->pGossipHello = &GossipHello_npc_skyguard_handler_irena;
+ newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_irena;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp b/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
index 3a20df853ef..9212f13946a 100644
--- a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
+++ b/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
@@ -1,159 +1,159 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Blasted_Lands
-SD%Complete: 90
-SDComment: Quest support: 2784, 2801, 3628. Missing some texts for Fallen Hero. Teleporter to Rise of the Defiler missing group support.
-SDCategory: Blasted Lands
-EndScriptData */
-
-/* ContentData
-npc_deathly_usher
-npc_fallen_hero_of_horde
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_deathly_usher
-######*/
-
-#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler."
-
-#define SPELL_TELEPORT_SINGLE 12885
-#define SPELL_TELEPORT_SINGLE_IN_GROUP 13142
-#define SPELL_TELEPORT_GROUP 27686
-
-bool GossipHello_npc_deathly_usher(Player *player, Creature *_Creature)
-{
- if(player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757, 1))
- player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_deathly_usher(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if(action = GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- _Creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
- }
-
- return true;
-}
-
-/*######
-## npc_fallen_hero_of_horde
-######*/
-
-#define GOSSIP_ITEM_FALLEN "Continue..."
-
-#define GOSSIP_ITEM_FALLEN1 "What could be worse than death?"
-#define GOSSIP_ITEM_FALLEN2 "Subordinates?"
-#define GOSSIP_ITEM_FALLEN3 "What are the stones of binding?"
-#define GOSSIP_ITEM_FALLEN4 "You can count on me, Hero"
-#define GOSSIP_ITEM_FALLEN5 "I shall"
-
-bool GossipHello_npc_fallen_hero_of_horde(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Why are you here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- if (player->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && player->GetTeam() == HORDE)
- player->ADD_GOSSIP_ITEM( 0, "Continue story...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- if (player->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && player->GetTeam() == ALLIANCE)
- player->ADD_GOSSIP_ITEM( 0, "Why are you here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_fallen_hero_of_horde(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(1392, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->SEND_GOSSIP_MENU(1411, _Creature->GetGUID());
- if (player->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(2784);
- if (player->GetTeam() == ALLIANCE)
- {
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(1411, _Creature->GetGUID());
- }
- break;
-
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
- player->SEND_GOSSIP_MENU(1451, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+21:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
- player->SEND_GOSSIP_MENU(1452, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+22:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
- player->SEND_GOSSIP_MENU(1453, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+23:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
- player->SEND_GOSSIP_MENU(1454, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+24:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25);
- player->SEND_GOSSIP_MENU(1455, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+25:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26);
- player->SEND_GOSSIP_MENU(1456, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+26:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(2801);
- break;
- }
- return true;
-}
-
-void AddSC_blasted_lands()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_deathly_usher";
- newscript->pGossipHello = &GossipHello_npc_deathly_usher;
- newscript->pGossipSelect = &GossipSelect_npc_deathly_usher;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_fallen_hero_of_horde";
- newscript->pGossipHello = &GossipHello_npc_fallen_hero_of_horde;
- newscript->pGossipSelect = &GossipSelect_npc_fallen_hero_of_horde;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Blasted_Lands
+SD%Complete: 90
+SDComment: Quest support: 2784, 2801, 3628. Missing some texts for Fallen Hero. Teleporter to Rise of the Defiler missing group support.
+SDCategory: Blasted Lands
+EndScriptData */
+
+/* ContentData
+npc_deathly_usher
+npc_fallen_hero_of_horde
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_deathly_usher
+######*/
+
+#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler."
+
+#define SPELL_TELEPORT_SINGLE 12885
+#define SPELL_TELEPORT_SINGLE_IN_GROUP 13142
+#define SPELL_TELEPORT_GROUP 27686
+
+bool GossipHello_npc_deathly_usher(Player *player, Creature *_Creature)
+{
+ if(player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757, 1))
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_deathly_usher(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if(action = GOSSIP_ACTION_INFO_DEF)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ _Creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
+ }
+
+ return true;
+}
+
+/*######
+## npc_fallen_hero_of_horde
+######*/
+
+#define GOSSIP_ITEM_FALLEN "Continue..."
+
+#define GOSSIP_ITEM_FALLEN1 "What could be worse than death?"
+#define GOSSIP_ITEM_FALLEN2 "Subordinates?"
+#define GOSSIP_ITEM_FALLEN3 "What are the stones of binding?"
+#define GOSSIP_ITEM_FALLEN4 "You can count on me, Hero"
+#define GOSSIP_ITEM_FALLEN5 "I shall"
+
+bool GossipHello_npc_fallen_hero_of_horde(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Why are you here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ if (player->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && player->GetTeam() == HORDE)
+ player->ADD_GOSSIP_ITEM( 0, "Continue story...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ if (player->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && player->GetTeam() == ALLIANCE)
+ player->ADD_GOSSIP_ITEM( 0, "Why are you here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_fallen_hero_of_horde(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(1392, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+11:
+ player->SEND_GOSSIP_MENU(1411, _Creature->GetGUID());
+ if (player->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(2784);
+ if (player->GetTeam() == ALLIANCE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(1411, _Creature->GetGUID());
+ }
+ break;
+
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
+ player->SEND_GOSSIP_MENU(1451, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+21:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
+ player->SEND_GOSSIP_MENU(1452, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+22:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
+ player->SEND_GOSSIP_MENU(1453, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+23:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
+ player->SEND_GOSSIP_MENU(1454, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+24:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25);
+ player->SEND_GOSSIP_MENU(1455, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+25:
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_FALLEN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26);
+ player->SEND_GOSSIP_MENU(1456, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+26:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(2801);
+ break;
+ }
+ return true;
+}
+
+void AddSC_blasted_lands()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_deathly_usher";
+ newscript->pGossipHello = &GossipHello_npc_deathly_usher;
+ newscript->pGossipSelect = &GossipSelect_npc_deathly_usher;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_fallen_hero_of_horde";
+ newscript->pGossipHello = &GossipHello_npc_fallen_hero_of_horde;
+ newscript->pGossipSelect = &GossipSelect_npc_fallen_hero_of_horde;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp b/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp
index 982ef1d1765..9de7b6d6085 100644
--- a/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp
+++ b/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp
@@ -1,182 +1,182 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Kruul
-SD%Complete: 100
-SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back.
-SDCategory: Bosses
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_SHADOWVOLLEY 21341
-#define SPELL_CLEAVE 20677
-#define SPELL_THUNDERCLAP 23931
-#define SPELL_TWISTEDREFLECTION 21063
-#define SPELL_VOIDBOLT 21066
-#define SPELL_RAGE 21340
-#define SPELL_CAPTURESOUL 21054
-
-struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
-{
- boss_kruulAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ShadowVolley_Timer;
- uint32 Cleave_Timer;
- uint32 ThunderClap_Timer;
- uint32 TwistedReflection_Timer;
- uint32 VoidBolt_Timer;
- uint32 Rage_Timer;
- uint32 Hound_Timer;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
-
- void Reset()
- {
- ShadowVolley_Timer = 10000;
- Cleave_Timer = 14000;
- ThunderClap_Timer = 20000;
- TwistedReflection_Timer = 25000;
- VoidBolt_Timer = 30000;
- Rage_Timer = 60000; //Cast rage after 1 minute
- Hound_Timer = 8000;
- }
-
- void Aggro(Unit *who)
- {
- }
-
- void KilledUnit()
- {
- // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health.
- DoCast(m_creature,SPELL_CAPTURESOUL);
-
- }
-
- void SummonHounds(Unit* victim)
- {
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%10;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(19207, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //ShadowVolley_Timer
- if (ShadowVolley_Timer < diff)
- {
- if (rand()%100 < 46)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWVOLLEY);
- }
-
- ShadowVolley_Timer = 5000;
- }else ShadowVolley_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer < diff)
- {
- if (rand()%100 < 50)
- {
- DoCast(m_creature->getVictim(),SPELL_CLEAVE);
- }
-
- Cleave_Timer = 10000;
- }else Cleave_Timer -= diff;
-
- //ThunderClap_Timer
- if (ThunderClap_Timer < diff)
- {
- if (rand()%100 < 20)
- {
- DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
- }
-
- ThunderClap_Timer = 12000;
- }else ThunderClap_Timer -= diff;
-
- //TwistedReflection_Timer
- if (TwistedReflection_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_TWISTEDREFLECTION);
- TwistedReflection_Timer = 30000;
- }else TwistedReflection_Timer -= diff;
-
- //VoidBolt_Timer
- if (VoidBolt_Timer < diff)
- {
- if (rand()%100 < 40)
- {
- DoCast(m_creature->getVictim(),SPELL_VOIDBOLT);
- }
-
- VoidBolt_Timer = 18000;
- }else VoidBolt_Timer -= diff;
-
- //Rage_Timer
- if (Rage_Timer < diff)
- {
- DoCast(m_creature,SPELL_RAGE);
- Rage_Timer = 70000;
- }else Rage_Timer -= diff;
-
- //Hound_Timer
- if (Hound_Timer < diff)
- {
- SummonHounds(m_creature->getVictim());
- SummonHounds(m_creature->getVictim());
- SummonHounds(m_creature->getVictim());
-
- Hound_Timer = 45000;
- }else Hound_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-CreatureAI* GetAI_boss_kruul(Creature *_Creature)
-{
- return new boss_kruulAI (_Creature);
-}
-
-void AddSC_boss_kruul()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_kruul";
- newscript->GetAI = GetAI_boss_kruul;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Kruul
+SD%Complete: 100
+SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back.
+SDCategory: Bosses
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_SHADOWVOLLEY 21341
+#define SPELL_CLEAVE 20677
+#define SPELL_THUNDERCLAP 23931
+#define SPELL_TWISTEDREFLECTION 21063
+#define SPELL_VOIDBOLT 21066
+#define SPELL_RAGE 21340
+#define SPELL_CAPTURESOUL 21054
+
+struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
+{
+ boss_kruulAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ShadowVolley_Timer;
+ uint32 Cleave_Timer;
+ uint32 ThunderClap_Timer;
+ uint32 TwistedReflection_Timer;
+ uint32 VoidBolt_Timer;
+ uint32 Rage_Timer;
+ uint32 Hound_Timer;
+ int Rand;
+ int RandX;
+ int RandY;
+ Creature* Summoned;
+
+ void Reset()
+ {
+ ShadowVolley_Timer = 10000;
+ Cleave_Timer = 14000;
+ ThunderClap_Timer = 20000;
+ TwistedReflection_Timer = 25000;
+ VoidBolt_Timer = 30000;
+ Rage_Timer = 60000; //Cast rage after 1 minute
+ Hound_Timer = 8000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void KilledUnit()
+ {
+ // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health.
+ DoCast(m_creature,SPELL_CAPTURESOUL);
+
+ }
+
+ void SummonHounds(Unit* victim)
+ {
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandX = 0 - Rand; break;
+ case 1: RandX = 0 + Rand; break;
+ }
+ Rand = 0;
+ Rand = rand()%10;
+ switch (rand()%2)
+ {
+ case 0: RandY = 0 - Rand; break;
+ case 1: RandY = 0 + Rand; break;
+ }
+ Rand = 0;
+ Summoned = DoSpawnCreature(19207, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
+ if(Summoned)
+ ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //ShadowVolley_Timer
+ if (ShadowVolley_Timer < diff)
+ {
+ if (rand()%100 < 46)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWVOLLEY);
+ }
+
+ ShadowVolley_Timer = 5000;
+ }else ShadowVolley_Timer -= diff;
+
+ //Cleave_Timer
+ if (Cleave_Timer < diff)
+ {
+ if (rand()%100 < 50)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ }
+
+ Cleave_Timer = 10000;
+ }else Cleave_Timer -= diff;
+
+ //ThunderClap_Timer
+ if (ThunderClap_Timer < diff)
+ {
+ if (rand()%100 < 20)
+ {
+ DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
+ }
+
+ ThunderClap_Timer = 12000;
+ }else ThunderClap_Timer -= diff;
+
+ //TwistedReflection_Timer
+ if (TwistedReflection_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_TWISTEDREFLECTION);
+ TwistedReflection_Timer = 30000;
+ }else TwistedReflection_Timer -= diff;
+
+ //VoidBolt_Timer
+ if (VoidBolt_Timer < diff)
+ {
+ if (rand()%100 < 40)
+ {
+ DoCast(m_creature->getVictim(),SPELL_VOIDBOLT);
+ }
+
+ VoidBolt_Timer = 18000;
+ }else VoidBolt_Timer -= diff;
+
+ //Rage_Timer
+ if (Rage_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_RAGE);
+ Rage_Timer = 70000;
+ }else Rage_Timer -= diff;
+
+ //Hound_Timer
+ if (Hound_Timer < diff)
+ {
+ SummonHounds(m_creature->getVictim());
+ SummonHounds(m_creature->getVictim());
+ SummonHounds(m_creature->getVictim());
+
+ Hound_Timer = 45000;
+ }else Hound_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+CreatureAI* GetAI_boss_kruul(Creature *_Creature)
+{
+ return new boss_kruulAI (_Creature);
+}
+
+void AddSC_boss_kruul()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_kruul";
+ newscript->GetAI = GetAI_boss_kruul;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
index 001e2ed4e6c..e52386fc020 100644
--- a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
+++ b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
@@ -1,141 +1,141 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Bloodmyst_Isle
-SD%Complete: 80
-SDComment: Quest support: 9670, 9756(gossip items text needed).
-SDCategory: Bloodmyst Isle
-EndScriptData */
-
-/* ContentData
-mob_webbed_creature
-npc_captured_sunhawk_agent
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## mob_webbed_creature
-######*/
-
-//possible creatures to be spawned
-const uint32 possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327};
-
-struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI
-{
- mob_webbed_creatureAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
- }
-
- void Aggro(Unit* who)
- {
- }
-
- void JustDied(Unit* Killer)
- {
- uint32 spawnCreatureID;
-
- switch(rand()%3)
- {
- case 0:
- spawnCreatureID = 17681;
- if (Killer->GetTypeId() == TYPEID_PLAYER)
- ((Player*)Killer)->KilledMonster(spawnCreatureID, m_creature->GetGUID());
- break;
- case 1:
- case 2:
- spawnCreatureID = possibleSpawns[rand()%31];
- break;
- }
-
- if(spawnCreatureID)
- DoSpawnCreature(spawnCreatureID,0,0,0,m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
- }
-};
-CreatureAI* GetAI_mob_webbed_creature(Creature *_Creature)
-{
- return new mob_webbed_creatureAI (_Creature);
-}
-
-/*######
-## npc_captured_sunhawk_agent
-######*/
-
-#define C_SUNHAWK_TRIGGER 17974
-
-bool GossipHello_npc_captured_sunhawk_agent(Player *player, Creature *_Creature)
-{
- if (player->HasAura(31609,1) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(9136, _Creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(9134, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_captured_sunhawk_agent(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(9137, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(9138, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(9139, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(9140, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(9141, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->CLOSE_GOSSIP_MENU();
- player->TalkedToCreature(C_SUNHAWK_TRIGGER, _Creature->GetGUID());
- break;
- }
- return true;
-}
-
-void AddSC_bloodmyst_isle()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="mob_webbed_creature";
- newscript->GetAI = GetAI_mob_webbed_creature;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_captured_sunhawk_agent";
- newscript->pGossipHello = &GossipHello_npc_captured_sunhawk_agent;
- newscript->pGossipSelect = &GossipSelect_npc_captured_sunhawk_agent;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Bloodmyst_Isle
+SD%Complete: 80
+SDComment: Quest support: 9670, 9756(gossip items text needed).
+SDCategory: Bloodmyst Isle
+EndScriptData */
+
+/* ContentData
+mob_webbed_creature
+npc_captured_sunhawk_agent
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## mob_webbed_creature
+######*/
+
+//possible creatures to be spawned
+const uint32 possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327};
+
+struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI
+{
+ mob_webbed_creatureAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset()
+ {
+ }
+
+ void Aggro(Unit* who)
+ {
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ uint32 spawnCreatureID;
+
+ switch(rand()%3)
+ {
+ case 0:
+ spawnCreatureID = 17681;
+ if (Killer->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)Killer)->KilledMonster(spawnCreatureID, m_creature->GetGUID());
+ break;
+ case 1:
+ case 2:
+ spawnCreatureID = possibleSpawns[rand()%31];
+ break;
+ }
+
+ if(spawnCreatureID)
+ DoSpawnCreature(spawnCreatureID,0,0,0,m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
+ }
+};
+CreatureAI* GetAI_mob_webbed_creature(Creature *_Creature)
+{
+ return new mob_webbed_creatureAI (_Creature);
+}
+
+/*######
+## npc_captured_sunhawk_agent
+######*/
+
+#define C_SUNHAWK_TRIGGER 17974
+
+bool GossipHello_npc_captured_sunhawk_agent(Player *player, Creature *_Creature)
+{
+ if (player->HasAura(31609,1) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(9136, _Creature->GetGUID());
+ }
+ else
+ player->SEND_GOSSIP_MENU(9134, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_captured_sunhawk_agent(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(9137, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(9138, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(9139, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(9140, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ player->SEND_GOSSIP_MENU(9141, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->CLOSE_GOSSIP_MENU();
+ player->TalkedToCreature(C_SUNHAWK_TRIGGER, _Creature->GetGUID());
+ break;
+ }
+ return true;
+}
+
+void AddSC_bloodmyst_isle()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="mob_webbed_creature";
+ newscript->GetAI = GetAI_mob_webbed_creature;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_captured_sunhawk_agent";
+ newscript->pGossipHello = &GossipHello_npc_captured_sunhawk_agent;
+ newscript->pGossipSelect = &GossipSelect_npc_captured_sunhawk_agent;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp b/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp
index 4a86bcaf104..4b5e491c1c1 100644
--- a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp
+++ b/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp
@@ -1,157 +1,157 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Burning_Steppes
-SD%Complete: 100
-SDComment: Quest support: 4224, 4866
-SDCategory: Burning Steppes
-EndScriptData */
-
-/* ContentData
-npc_ragged_john
-EndContentData */
-
-#include "precompiled.h"
-
-/*######
-## npc_ragged_john
-######*/
-
-struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
-{
- npc_ragged_johnAI(Creature *c) : ScriptedAI(c) { Reset(); }
-
- void Reset() {}
-
- void MoveInLineOfSight(Unit *who)
- {
- if( who->HasAura(16468,0) )
- {
- if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessablePlaceFor(m_creature) )
- {
- DoCast(who,16472);
- ((Player*)who)->AreaExploredOrEventHappens(4866);
- }
- }
-
- if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- DoStartAttackAndMovement(who);
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
- }
- }
- }
-
- void Aggro(Unit *who) {}
-};
-
-CreatureAI* GetAI_npc_ragged_john(Creature *_Creature)
-{
- return new npc_ragged_johnAI (_Creature);
-}
-
-bool GossipHello_npc_ragged_john(Player *player, Creature *_Creature)
-{
- if (_Creature->isQuestGiver())
- player->PrepareQuestMenu( _Creature->GetGUID() );
-
- if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(2713, _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_ragged_john(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM( 0, "So what did you do?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(2714, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(2715, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM( 0, "Ironfoe?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2716, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM( 0, "Interesting... continue John.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(2717, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM( 0, "So that's how Windsor died...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(2718, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM( 0, "So how did he die?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(2719, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM( 0, "Ok so where the hell is he? Wait a minute! Are you drunk?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(2720, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->ADD_GOSSIP_ITEM( 0, "WHY is he in Blackrock Depths?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(2721, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+8:
- player->ADD_GOSSIP_ITEM( 0, "300? So the Dark Irons killed him and dragged him into the Depths?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->SEND_GOSSIP_MENU(2722, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+9:
- player->ADD_GOSSIP_ITEM( 0, "Ahh... Ironfoe", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->SEND_GOSSIP_MENU(2723, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+10:
- player->ADD_GOSSIP_ITEM( 0, "Thanks, Ragged John. Your story was very uplifting and informative", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(2725, _Creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(4224);
- break;
- }
- return true;
-}
-
-void AddSC_burning_steppes()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name="npc_ragged_john";
- newscript->GetAI = GetAI_npc_ragged_john;
- newscript->pGossipHello = &GossipHello_npc_ragged_john;
- newscript->pGossipSelect = &GossipSelect_npc_ragged_john;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Burning_Steppes
+SD%Complete: 100
+SDComment: Quest support: 4224, 4866
+SDCategory: Burning Steppes
+EndScriptData */
+
+/* ContentData
+npc_ragged_john
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_ragged_john
+######*/
+
+struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
+{
+ npc_ragged_johnAI(Creature *c) : ScriptedAI(c) { Reset(); }
+
+ void Reset() {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( who->HasAura(16468,0) )
+ {
+ if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ DoCast(who,16472);
+ ((Player*)who)->AreaExploredOrEventHappens(4866);
+ }
+ }
+
+ if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
+ {
+ DoStartAttackAndMovement(who);
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+ }
+ }
+ }
+
+ void Aggro(Unit *who) {}
+};
+
+CreatureAI* GetAI_npc_ragged_john(Creature *_Creature)
+{
+ return new npc_ragged_johnAI (_Creature);
+}
+
+bool GossipHello_npc_ragged_john(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu( _Creature->GetGUID() );
+
+ if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+
+ player->SEND_GOSSIP_MENU(2713, _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_ragged_john(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF:
+ player->ADD_GOSSIP_ITEM( 0, "So what did you do?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(2714, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+1:
+ player->ADD_GOSSIP_ITEM( 0, "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(2715, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ player->ADD_GOSSIP_ITEM( 0, "Ironfoe?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(2716, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->ADD_GOSSIP_ITEM( 0, "Interesting... continue John.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->SEND_GOSSIP_MENU(2717, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->ADD_GOSSIP_ITEM( 0, "So that's how Windsor died...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(2718, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->ADD_GOSSIP_ITEM( 0, "So how did he die?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(2719, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ player->ADD_GOSSIP_ITEM( 0, "Ok so where the hell is he? Wait a minute! Are you drunk?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->SEND_GOSSIP_MENU(2720, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ player->ADD_GOSSIP_ITEM( 0, "WHY is he in Blackrock Depths?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->SEND_GOSSIP_MENU(2721, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+8:
+ player->ADD_GOSSIP_ITEM( 0, "300? So the Dark Irons killed him and dragged him into the Depths?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->SEND_GOSSIP_MENU(2722, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+9:
+ player->ADD_GOSSIP_ITEM( 0, "Ahh... Ironfoe", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->SEND_GOSSIP_MENU(2723, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+10:
+ player->ADD_GOSSIP_ITEM( 0, "Thanks, Ragged John. Your story was very uplifting and informative", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->SEND_GOSSIP_MENU(2725, _Creature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+11:
+ player->CLOSE_GOSSIP_MENU();
+ player->AreaExploredOrEventHappens(4224);
+ break;
+ }
+ return true;
+}
+
+void AddSC_burning_steppes()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_ragged_john";
+ newscript->GetAI = GetAI_npc_ragged_john;
+ newscript->pGossipHello = &GossipHello_npc_ragged_john;
+ newscript->pGossipSelect = &GossipSelect_npc_ragged_john;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp
index 7927730f4b2..91f05eadc3c 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp
@@ -1,137 +1,137 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Aeonus
-SD%Complete: 100
-SDComment:
-SDCategory: Caverns of Time, The Dark Portal
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAND_BREATH 31478
-#define TIME_STOP 31422
-#define FRENZY 19812
-
-#define SAY_ENTER "The time has come to shatter this clockwork universe forever! Let us no longer be slaves of the hourglass! I warn you: those who do not embrace the greater path shall become victims of its passing!"
-#define SAY_AGGRO "Let us see what fate lays in store..."
-#define SAY_BANISH "Your time is up, slave of the past!"
-#define SAY_SLAY1 "One less obstacle in our way!"
-#define SAY_SLAY2 "No one can stop us! No one!"
-#define SAY_DEATH "It is only a matter...of time."
-
-#define SOUND_ENTER 10400
-#define SOUND_AGGRO 10402
-#define SOUND_BANISH 10401
-#define SOUND_SLAY1 10403
-#define SOUND_SLAY2 10404
-#define SOUND_DEATH 10405
-
-struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
-{
- boss_aeonusAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 SandBreath_Timer;
- uint32 TimeStop_Timer;
- uint32 Frenzy_Timer;
-
- void Reset()
- {
- SandBreath_Timer = 30000;
- TimeStop_Timer = 40000;
- Frenzy_Timer = 120000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void JustDied(Unit *victim)
- {
- //Just Died
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void KilledUnit(Unit *victim)
- {
- //Killed Unit
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Sand Breath
- if (SandBreath_Timer < diff)
- {
- Unit* target = NULL;
- target = m_creature->getVictim();
- if (target)
- DoCast(target, SAND_BREATH);
- SandBreath_Timer = 30000;
- }else SandBreath_Timer -= diff;
-
- //Time Stop
- if (TimeStop_Timer < diff)
- {
- DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BANISH);
-
- DoCast(m_creature->getVictim(), TIME_STOP);
- TimeStop_Timer = 40000;
- }else TimeStop_Timer -= diff;
-
- //Frenzy
- if (Frenzy_Timer < diff)
- {
- DoCast(m_creature, FRENZY);
- Frenzy_Timer = 120000;
- }else Frenzy_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_aeonus(Creature *_Creature)
-{
- return new boss_aeonusAI (_Creature);
-}
-
-void AddSC_boss_aeonus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_aeonus";
- newscript->GetAI = GetAI_boss_aeonus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Aeonus
+SD%Complete: 100
+SDComment:
+SDCategory: Caverns of Time, The Dark Portal
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAND_BREATH 31478
+#define TIME_STOP 31422
+#define FRENZY 19812
+
+#define SAY_ENTER "The time has come to shatter this clockwork universe forever! Let us no longer be slaves of the hourglass! I warn you: those who do not embrace the greater path shall become victims of its passing!"
+#define SAY_AGGRO "Let us see what fate lays in store..."
+#define SAY_BANISH "Your time is up, slave of the past!"
+#define SAY_SLAY1 "One less obstacle in our way!"
+#define SAY_SLAY2 "No one can stop us! No one!"
+#define SAY_DEATH "It is only a matter...of time."
+
+#define SOUND_ENTER 10400
+#define SOUND_AGGRO 10402
+#define SOUND_BANISH 10401
+#define SOUND_SLAY1 10403
+#define SOUND_SLAY2 10404
+#define SOUND_DEATH 10405
+
+struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
+{
+ boss_aeonusAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 SandBreath_Timer;
+ uint32 TimeStop_Timer;
+ uint32 Frenzy_Timer;
+
+ void Reset()
+ {
+ SandBreath_Timer = 30000;
+ TimeStop_Timer = 40000;
+ Frenzy_Timer = 120000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void JustDied(Unit *victim)
+ {
+ //Just Died
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ //Killed Unit
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Sand Breath
+ if (SandBreath_Timer < diff)
+ {
+ Unit* target = NULL;
+ target = m_creature->getVictim();
+ if (target)
+ DoCast(target, SAND_BREATH);
+ SandBreath_Timer = 30000;
+ }else SandBreath_Timer -= diff;
+
+ //Time Stop
+ if (TimeStop_Timer < diff)
+ {
+ DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BANISH);
+
+ DoCast(m_creature->getVictim(), TIME_STOP);
+ TimeStop_Timer = 40000;
+ }else TimeStop_Timer -= diff;
+
+ //Frenzy
+ if (Frenzy_Timer < diff)
+ {
+ DoCast(m_creature, FRENZY);
+ Frenzy_Timer = 120000;
+ }else Frenzy_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_aeonus(Creature *_Creature)
+{
+ return new boss_aeonusAI (_Creature);
+}
+
+void AddSC_boss_aeonus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_aeonus";
+ newscript->GetAI = GetAI_boss_aeonus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
index 9b63c8411d9..497f916c9c5 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
@@ -1,124 +1,124 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Chrono_Lord_Deja
-SD%Complete: 100
-SDComment:
-SDCategory: Caverns of Time, The Dark Portal
-EndScriptData */
-
-#include "precompiled.h"
-
-#define ARCANE_BLAST 24857
-#define TIME_LAPSE 31467
-#define MAGNETIC_PULL 28337 //Not Implemented (Heroic mod)
-
-#define SAY_ENTER "Why do you aid the Magus? Just think of how many lives could be saved if the portal is never opened, if the resulting wars could be erased ..."
-#define SAY_AGGRO "If you will not cease this foolish quest, then you will die!"
-#define SAY_BANISH "You have outstayed your welcome, Timekeeper. Begone!"
-#define SAY_SLAY1 "I told you it was a fool's quest!"
-#define SAY_SLAY2 "Leaving so soon?"
-#define SAY_DEATH "Time ... is on our side."
-
-#define SOUND_ENTER 10412
-#define SOUND_AGGRO 10414
-#define SOUND_BANISH 10413
-#define SOUND_SLAY1 10415
-#define SOUND_SLAY2 10416
-#define SOUND_DEATH 10417
-
-struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI
-{
- boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 ArcaneBlast_Timer;
- uint32 TimeLapse_Timer;
-
- void Reset()
- {
- ArcaneBlast_Timer = 20000;
- TimeLapse_Timer = 15000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
-
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Arcane Blast
- if (ArcaneBlast_Timer < diff)
- {
- DoCast(m_creature->getVictim(), ARCANE_BLAST);
- ArcaneBlast_Timer = 20000+rand()%5000;
- }else ArcaneBlast_Timer -= diff;
-
- //Time Lapse
- if (TimeLapse_Timer < diff)
- {
- DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BANISH);
- DoCast(m_creature, TIME_LAPSE);
- TimeLapse_Timer = 15000+rand()%10000;
- }else TimeLapse_Timer -= diff;
-
- DoMeleeAttackIfReady();
-
- }
-};
-
-CreatureAI* GetAI_boss_chrono_lord_deja(Creature *_Creature)
-{
- return new boss_chrono_lord_dejaAI (_Creature);
-}
-
-void AddSC_boss_chrono_lord_deja()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_chrono_lord_deja";
- newscript->GetAI = GetAI_boss_chrono_lord_deja;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Chrono_Lord_Deja
+SD%Complete: 100
+SDComment:
+SDCategory: Caverns of Time, The Dark Portal
+EndScriptData */
+
+#include "precompiled.h"
+
+#define ARCANE_BLAST 24857
+#define TIME_LAPSE 31467
+#define MAGNETIC_PULL 28337 //Not Implemented (Heroic mod)
+
+#define SAY_ENTER "Why do you aid the Magus? Just think of how many lives could be saved if the portal is never opened, if the resulting wars could be erased ..."
+#define SAY_AGGRO "If you will not cease this foolish quest, then you will die!"
+#define SAY_BANISH "You have outstayed your welcome, Timekeeper. Begone!"
+#define SAY_SLAY1 "I told you it was a fool's quest!"
+#define SAY_SLAY2 "Leaving so soon?"
+#define SAY_DEATH "Time ... is on our side."
+
+#define SOUND_ENTER 10412
+#define SOUND_AGGRO 10414
+#define SOUND_BANISH 10413
+#define SOUND_SLAY1 10415
+#define SOUND_SLAY2 10416
+#define SOUND_DEATH 10417
+
+struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI
+{
+ boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 ArcaneBlast_Timer;
+ uint32 TimeLapse_Timer;
+
+ void Reset()
+ {
+ ArcaneBlast_Timer = 20000;
+ TimeLapse_Timer = 15000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Arcane Blast
+ if (ArcaneBlast_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), ARCANE_BLAST);
+ ArcaneBlast_Timer = 20000+rand()%5000;
+ }else ArcaneBlast_Timer -= diff;
+
+ //Time Lapse
+ if (TimeLapse_Timer < diff)
+ {
+ DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BANISH);
+ DoCast(m_creature, TIME_LAPSE);
+ TimeLapse_Timer = 15000+rand()%10000;
+ }else TimeLapse_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+
+ }
+};
+
+CreatureAI* GetAI_boss_chrono_lord_deja(Creature *_Creature)
+{
+ return new boss_chrono_lord_dejaAI (_Creature);
+}
+
+void AddSC_boss_chrono_lord_deja()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_chrono_lord_deja";
+ newscript->GetAI = GetAI_boss_chrono_lord_deja;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp
index 5d893e6c80e..55cbde02e3a 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp
@@ -1,169 +1,169 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Temporus
-SD%Complete: 100
-SDComment:
-SDCategory: Caverns of Time, The Dark Portal
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SPELL_TAUNT 355
-#define SPELL_HASTE 31458
-#define SPELL_MORTAL_WOUND 28467
-#define SPELL_REFLECT 23920 //Not Implemented (Heroic mod)
-
-#define SAY_ENTER "Why do you persist? Surely you can see the futility of it all. It is not too late! You may still leave with your lives ..."
-#define SAY_AGGRO "So be it ... you have been warned."
-#define SAY_BANISH "Time... sands of time is run out for you."
-#define SAY_SLAY1 "You should have left when you had the chance."
-#define SAY_SLAY2 "Your days are done."
-#define SAY_DEATH "My death means ... little."
-
-#define SOUND_ENTER 10442
-#define SOUND_AGGRO 10444
-#define SOUND_BANISH 10443
-#define SOUND_SLAY1 10445
-#define SOUND_SLAY2 10446
-#define SOUND_DEATH 10447
-
-struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI
-{
- boss_temporusAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- uint32 Haste_Timer;
- uint32 SpellReflection_Timer;
-
- void Reset()
- {
- Haste_Timer = 20000;
- SpellReflection_Timer = 40000;
- }
-
- void Aggro(Unit *who)
- {
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- }
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || m_creature->getVictim())
- return;
-
- //Despawn Time Keeper
- if (who->GetTypeId() == TYPEID_UNIT)
- {
- if(((Creature*)who)->GetEntry() == 17918 && m_creature->IsWithinDistInMap(who,20))
- {
- //This is the wrong yell & sound for despawning time keepers!
- DoYell(SAY_ENTER, LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENTER);
-
- m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- }
-
- if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
- {
- if(who->HasStealthAura())
- who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- DoStartAttackAndMovement(who);
- if (!InCombat)
- {
- DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- }
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
- return;
-
- //Check if we have a current target
- if( m_creature->getVictim() && m_creature->isAlive())
- {
-
- //Attack Haste
- if (Haste_Timer < diff)
- {
- DoCast(m_creature, SPELL_HASTE);
- Haste_Timer = 20000+rand()%5000;
- }else Haste_Timer -= diff;
-
- //Spell Reflection
- if (SpellReflection_Timer < diff)
- {
- DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_BANISH);
-
- DoCast(m_creature, SPELL_REFLECT);
- SpellReflection_Timer = 40000+rand()%10000;
- }else SpellReflection_Timer -= diff;
-
- DoMeleeAttackIfReady();
-
- }
- }
-};
-
-CreatureAI* GetAI_boss_temporus(Creature *_Creature)
-{
- return new boss_temporusAI (_Creature);
-}
-
-void AddSC_boss_temporus()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_temporus";
- newscript->GetAI = GetAI_boss_temporus;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Temporus
+SD%Complete: 100
+SDComment:
+SDCategory: Caverns of Time, The Dark Portal
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_TAUNT 355
+#define SPELL_HASTE 31458
+#define SPELL_MORTAL_WOUND 28467
+#define SPELL_REFLECT 23920 //Not Implemented (Heroic mod)
+
+#define SAY_ENTER "Why do you persist? Surely you can see the futility of it all. It is not too late! You may still leave with your lives ..."
+#define SAY_AGGRO "So be it ... you have been warned."
+#define SAY_BANISH "Time... sands of time is run out for you."
+#define SAY_SLAY1 "You should have left when you had the chance."
+#define SAY_SLAY2 "Your days are done."
+#define SAY_DEATH "My death means ... little."
+
+#define SOUND_ENTER 10442
+#define SOUND_AGGRO 10444
+#define SOUND_BANISH 10443
+#define SOUND_SLAY1 10445
+#define SOUND_SLAY2 10446
+#define SOUND_DEATH 10447
+
+struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI
+{
+ boss_temporusAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint32 Haste_Timer;
+ uint32 SpellReflection_Timer;
+
+ void Reset()
+ {
+ Haste_Timer = 20000;
+ SpellReflection_Timer = 40000;
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_DEATH);
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!who || m_creature->getVictim())
+ return;
+
+ //Despawn Time Keeper
+ if (who->GetTypeId() == TYPEID_UNIT)
+ {
+ if(((Creature*)who)->GetEntry() == 17918 && m_creature->IsWithinDistInMap(who,20))
+ {
+ //This is the wrong yell & sound for despawning time keepers!
+ DoYell(SAY_ENTER, LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENTER);
+
+ m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+
+ if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = m_creature->GetAttackDistance(who);
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
+ {
+ if(who->HasStealthAura())
+ who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ DoStartAttackAndMovement(who);
+ if (!InCombat)
+ {
+ DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Check if we have a current target
+ if( m_creature->getVictim() && m_creature->isAlive())
+ {
+
+ //Attack Haste
+ if (Haste_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_HASTE);
+ Haste_Timer = 20000+rand()%5000;
+ }else Haste_Timer -= diff;
+
+ //Spell Reflection
+ if (SpellReflection_Timer < diff)
+ {
+ DoYell(SAY_BANISH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_BANISH);
+
+ DoCast(m_creature, SPELL_REFLECT);
+ SpellReflection_Timer = 40000+rand()%10000;
+ }else SpellReflection_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_temporus(Creature *_Creature)
+{
+ return new boss_temporusAI (_Creature);
+}
+
+void AddSC_boss_temporus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_temporus";
+ newscript->GetAI = GetAI_boss_temporus;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp
index c2a9a349838..7e25c0c9b15 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp
@@ -1,788 +1,788 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Archimonde
-SD%Complete: 95
-SDComment: Doomfires not completely offlike due to core limitations for random moving.
-SDCategory: Caverns of Time, Mount Hyjal
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_hyjal.h"
-#include "SpellAuras.h"
-
-#define SPELL_DENOUEMENT_WISP 32124
-#define SPELL_ANCIENT_SPARK 39349
-#define SPELL_PROTECTION_OF_ELUNE 38528
-
-#define SPELL_DRAIN_WORLD_TREE 39140
-#define SPELL_DRAIN_WORLD_TREE_2 39141
-
-#define SPELL_FINGER_OF_DEATH 31984
-#define SPELL_HAND_OF_DEATH 35354
-#define SPELL_AIR_BURST 32014
-#define SPELL_GRIP_OF_THE_LEGION 31972
-#define SPELL_DOOMFIRE_SPAWN 32074
-#define SPELL_DOOMFIRE_VISUAL 42344 // This is actually a Zul'Aman spell, but the proper Doomfire spell sometimes freezes the server if a player stands in it for too long
-#define SPELL_DOOMFIRE_DAMAGE 31944
-#define SPELL_SOUL_CHARGE_YELLOW 32045
-#define SPELL_SOUL_CHARGE_GREEN 32051
-#define SPELL_SOUL_CHARGE_RED 32052
-#define SPELL_UNLEASH_SOUL_YELLOW 32054
-#define SPELL_UNLEASH_SOUL_GREEN 32057
-#define SPELL_UNLEASH_SOUL_RED 32053
-#define SPELL_FEAR 31970
-
-#define SAY_AGGRO "Your resistance is insignificant!"
-#define SOUND_AGGRO 10987
-
-#define SAY_DOOMFIRE1 "This world will burn!"
-#define SOUND_DOOMFIRE1 10990
-
-#define SAY_DOOMFIRE2 "Manach sheek-thrish!"
-#define SOUND_DOOMFIRE2 11041
-
-#define SAY_AIR_BURST "A-kreesh!"
-#define SOUND_AIR_BURST 10989
-
-#define SAY_AIR_BURST2 "Away vermin!"
-#define SOUND_AIR_BURST2 11043
-
-#define SAY_SLAY1 "All creation will be devoured!"
-#define SOUND_SLAY1 11044
-
-#define SAY_SLAY2 "Your soul will languish for eternity."
-#define SOUND_SLAY2 10991
-
-#define SAY_SLAY3 "I am the coming of the end!"
-#define SOUND_SLAY3 11045
-
-#define SAY_UNK1 "You are mine now."
-#define SOUND_UNK1 10988
-
-#define SAY_UNK2 "Bow to my will."
-#define SOUND_UNK2 11042
-
-#define SAY_ENRAGE "At last it is here. Mourn and lament the passing of all you have ever known and all that would have been! Akmin-kurai!"
-#define SOUND_ENRAGE 10993
-
-#define SAY_DEATH "No, it cannot be! Nooo!"
-#define SOUND_DEATH 10992
-
-#define CREATURE_ARCHIMONDE 17968
-#define CREATURE_DOOMFIRE 18095
-#define CREATURE_DOOMFIRE_TARGETING 18104
-#define CREATURE_ANCIENT_WISP 17946
-#define CREATURE_CHANNEL_TARGET 22418
-
-#define NORDRASSIL_X 5503.713
-#define NORDRASSIL_Y -3523.436
-#define NORDRASSIL_Z 1608.781
-
-struct mob_ancient_wispAI : public ScriptedAI
-{
- mob_ancient_wispAI(Creature* c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
- uint64 ArchimondeGUID;
- uint32 CheckTimer;
-
- void Reset()
- {
- ArchimondeGUID = 0;
- CheckTimer = 1000;
-
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- void Aggro(Unit* who) {}
-
- void DamageTaken(Unit* done_by, uint32 &damage) { damage = 0; }
-
- void UpdateAI(const uint32 diff)
- {
- if(!ArchimondeGUID)
- {
- if(pInstance)
- ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE);
- }
-
- if(CheckTimer < diff)
- {
- if(ArchimondeGUID)
- {
- Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
- if(Archimonde)
- {
- if((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive())
- DoCast(m_creature, SPELL_DENOUEMENT_WISP);
- else
- DoCast(Archimonde, SPELL_ANCIENT_SPARK);
- }
- }
- CheckTimer = 1000;
- }else CheckTimer -= diff;
- }
-};
-
-/* This script controls the Doomfire mob. Unlike the other Doomfire mob, this one does not stalk players.
- Instead, this doomfire will simply stand in one place after spawning and deal damage to any players that
- are within 3 yards. Another creature called Doomfire Targetting spawns this creature as well as stalks. */
-struct TRINITY_DLL_DECL mob_doomfireAI : public ScriptedAI
-{
- mob_doomfireAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint32 CheckTimer;
- uint32 RefreshTimer;
-
- bool TargetSelected;
-
- uint64 ArchimondeGUID;
- uint64 TargetGUID;
-
- void Reset()
- {
- CheckTimer = 5000;
- RefreshTimer = 0;
-
- TargetSelected = false;
-
- ArchimondeGUID = 0;
- TargetGUID = 0;
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
-
- void Aggro(Unit* who) { }
-
- void MoveInLineOfSight(Unit* who)
- {
- // Do not do anything if who does not exist, or we are refreshing our timer, or who is Doomfire, Archimonde or Doomfire targetting
- if(!who || who == m_creature || RefreshTimer || who->GetEntry() == CREATURE_ANCIENT_WISP ||
- who->GetEntry() == CREATURE_ARCHIMONDE || who->GetEntry() == CREATURE_DOOMFIRE ||
- who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack())
- return;
-
- if(m_creature->IsWithinDistInMap(who, 3))
- {
- TargetSelected = true;
- TargetGUID = who->GetGUID();
- RefreshTimer = 2000;
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- bool suicide = true;
- if(ArchimondeGUID)
- {
- Creature* Archimonde = ((Creature*)Unit::GetUnit((*m_creature), ArchimondeGUID));
- if(Archimonde && Archimonde->isAlive())
- {
- suicide = false;
- Archimonde->AI()->KilledUnit(victim);
- }
- }
-
- if(suicide)
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(RefreshTimer < diff)
- RefreshTimer = 0;
- else RefreshTimer -= diff;
-
- if(TargetSelected && TargetGUID)
- {
- Unit* target = Unit::GetUnit((*m_creature), TargetGUID);
- if(target && target->isAlive())
- {
- target->CastSpell(target, SPELL_DOOMFIRE_DAMAGE, true);
- TargetGUID = 0;
- TargetSelected = false;
- }
- }
-
- if(CheckTimer < diff)
- {
- if(ArchimondeGUID)
- {
- Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
- if(!Archimonde || !Archimonde->isAlive())
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- CheckTimer = 5000;
- }
- else m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }else CheckTimer -= diff;
- }
-};
-
-/* This is the script for the Doomfire Targetting Mob. This mob simply follows players and/or travels in random directions and spawns the actual Doomfire which does damage to anyone that moves close. */
-struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI
-{
- mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c)
- {
- Reset();
- }
-
- uint32 ChangeTargetTimer;
- uint32 SummonTimer; // This timer will serve as both a summon timer for the doomfire that does damage as well as to check on Archionde
-
- uint64 ArchimondeGUID;
-
- void Reset()
- {
- ChangeTargetTimer = 5000;
- SummonTimer = 1000;
-
- ArchimondeGUID = 0;
- }
-
- void Aggro(Unit* who) {}
-
- void MoveInLineOfSight(Unit* who)
- {
- // Do not do anything if who does not exist, or who is Doomfire, Archimonde or Doomfire targetting
- if(!who || who == m_creature || who->GetEntry() == CREATURE_ARCHIMONDE
- || who->GetEntry() == CREATURE_DOOMFIRE || who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack())
- return;
-
- m_creature->AddThreat(who, 1.0f);
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
-
- void UpdateAI(const uint32 diff)
- {
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(SummonTimer < diff)
- {
- if(ArchimondeGUID)
- {
- Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
- if(Archimonde && Archimonde->isAlive())
- {
- Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE, 0, 0, 2, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
- if(Doomfire)
- {
- Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true);
- ((mob_doomfireAI*)Doomfire->AI())->ArchimondeGUID = ArchimondeGUID;
- Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- SummonTimer = 500;
- }
- else
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- else
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }else SummonTimer -= diff;
-
- if(ChangeTargetTimer < diff)
- {
- Unit* target = NULL;
- switch(rand()%2)
- {
- case 0: // stalk player
- target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(target && target->isAlive())
- {
- m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
- m_creature->GetMotionMaster()->MoveChase(target);
- }
- break;
-
- case 1: // random location
- float x = 0;
- float y = 0;
- float z = 0;
- m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
- break;
- }
- ChangeTargetTimer = 5000;
- }else ChangeTargetTimer -= diff;
- }
-
-};
-
-/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers.
- The only complicated aspect of the battle is Finger of Death and Doomfire, with Doomfire being the
- hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then
- select a random target and cast the spell on them. However, if someone IS in melee range, and this
- is NOT the main tank (creature's victim), then we aggro that player and they become the new victim.
- For Doomfire, we summon a mob (Doomfire Targetting) that summons another mob (Doomfire every second)
- Doomfire Targetting 'stalks' players whilst Doomfire damages player that are within range. */
-
-// This is used to sort by distance in order to see who is the closest target, when checking for Finger of Death
-struct TargetDistanceOrder : public std::binary_function
-{
- const Unit* MainTarget;
- TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
- // functor for operator "<"
- bool operator()(const Unit* _Left, const Unit* _Right) const
- {
- return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
- }
-};
-
-struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
-{
- boss_archimondeAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
- }
-
- ScriptedInstance* pInstance;
-
- uint32 DrainNordrassilTimer;
- uint32 FearTimer;
- uint32 AirBurstTimer;
- uint32 GripOfTheLegionTimer;
- uint32 DoomfireTimer;
- uint32 SoulChargeTimer;
- uint32 SoulChargeCount;
- uint32 MeleeRangeCheckTimer;
- uint32 HandOfDeathTimer;
- uint32 SummonWispTimer;
- uint32 WispCount;
- uint32 EnrageTimer;
- uint32 CheckDistanceTimer;
-
- bool Enraged;
- bool BelowTenPercent;
- bool HasProtected;
- bool IsChanneling;
-
- void Reset()
- {
- if(pInstance)
- pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
-
- DrainNordrassilTimer = 0;
- FearTimer = 40000;
- AirBurstTimer = 30000;
- GripOfTheLegionTimer = 5000 + rand()%20000;
- DoomfireTimer = 20000;
- SoulChargeTimer = 2000 + rand()%27000;
- SoulChargeCount = 0;
- MeleeRangeCheckTimer = 15000;
- HandOfDeathTimer = 2000;
- WispCount = 0; // When ~30 wisps are summoned, Archimonde dies
- EnrageTimer = 600000; // 10 minutes
- CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage
-
- Enraged = false;
- BelowTenPercent = false;
- HasProtected = false;
- IsChanneling = false;
- }
-
- void Aggro(Unit *who)
- {
- m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_AGGRO);
- DoZoneInCombat();
-
- if(pInstance)
- pInstance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS);
- }
-
- void KilledUnit(Unit *victim)
- {
- switch(rand()%2)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- break;
- case 2:
- DoYell(SAY_SLAY3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY3);
- break;
- }
-
- if(victim && (victim->GetTypeId() == TYPEID_PLAYER))
- GainSoulCharge(((Player*)victim));
- }
-
- void GainSoulCharge(Player* victim)
- {
- switch(victim->getClass())
- {
- case CLASS_PRIEST:
- case CLASS_PALADIN:
- case CLASS_WARLOCK:
- victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true);
- break;
- case CLASS_MAGE:
- case CLASS_ROGUE:
- case CLASS_WARRIOR:
- victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true);
- break;
- case CLASS_DRUID:
- case CLASS_SHAMAN:
- case CLASS_HUNTER:
- victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true);
- break;
- }
-
- SoulChargeTimer = 2000 + rand()%28000;
- ++SoulChargeCount;
- }
-
- void JustDied(Unit *victim)
- {
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
-
- if(pInstance)
- pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE);
- }
-
- bool CanUseFingerOfDeath()
- {
- // First we check if our current victim is in melee range or not.
- Unit* victim = m_creature->getVictim();
- if(victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim)))
- return false;
-
- std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
- if(m_threatlist.empty())
- return false;
-
- std::list targets;
- std::list::iterator itr = m_threatlist.begin();
- for( ; itr != m_threatlist.end(); ++itr)
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
- if(pUnit && pUnit->isAlive())
- targets.push_back(pUnit);
- }
-
- if(targets.empty())
- return false;
-
- targets.sort(TargetDistanceOrder(m_creature));
- Unit* target = targets.front();
- if(target)
- {
- if(!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
- return true; // Cast Finger of Death
- else // This target is closest, he is our new tank
- m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
- }
-
- return false;
- }
-
- void SummonDoomfire(Unit* target)
- {
- Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE_TARGETING, rand()%30, rand()%30, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
- if(Doomfire)
- {
- ((mob_doomfire_targettingAI*)Doomfire->AI())->ArchimondeGUID = m_creature->GetGUID();
- Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Give Doomfire a taste of everyone in the threatlist = more targets to chase.
- std::list::iterator itr;
- for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
- Doomfire->AddThreat(Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()), 1.0f);
- Doomfire->setFaction(m_creature->getFaction());
- DoCast(Doomfire, SPELL_DOOMFIRE_SPAWN);
- Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true);
- if(target)
- Doomfire->AI()->AttackStart(target);
-
- if(rand()%2 == 0)
- {
- DoYell(SAY_DOOMFIRE1, LANG_UNIVERSAL, m_creature);
- DoPlaySoundToSet(m_creature, SOUND_DOOMFIRE1);
- }else
- {
- DoYell(SAY_DOOMFIRE2, LANG_UNIVERSAL, m_creature);
- DoPlaySoundToSet(m_creature, SOUND_DOOMFIRE2);
- }
- }
- }
-
- void UnleashSoulCharge()
- {
- m_creature->InterruptNonMeleeSpells(false);
- bool HasCast = false;
- uint32 chargeSpell = 0;
- uint32 unleashSpell = 0;
- switch(rand()%3)
- {
- case 0:
- chargeSpell = SPELL_SOUL_CHARGE_RED;
- unleashSpell = SPELL_UNLEASH_SOUL_RED;
- break;
- case 1:
- chargeSpell = SPELL_SOUL_CHARGE_YELLOW;
- unleashSpell = SPELL_UNLEASH_SOUL_YELLOW;
- break;
- case 2:
- chargeSpell = SPELL_SOUL_CHARGE_GREEN;
- unleashSpell = SPELL_UNLEASH_SOUL_GREEN;
- break;
- }
- if(m_creature->HasAura(chargeSpell, 0))
- {
- m_creature->RemoveSingleAuraFromStack(chargeSpell, 0);
- DoCast(m_creature->getVictim(), unleashSpell);
- HasCast = true;
- SoulChargeCount--;
- }
- if(HasCast)
- SoulChargeTimer = 2000 + rand()%28000;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(!InCombat)
- {
- if(pInstance)
- {
- // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
- if((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35)))
- {
- m_creature->SetVisibility(VISIBILITY_OFF);
- m_creature->setFaction(35);
- }
- else if((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35)))
- {
- m_creature->setFaction(1720);
- m_creature->SetVisibility(VISIBILITY_ON);
- }
- }
-
- if(DrainNordrassilTimer < diff)
- {
- if(!IsChanneling)
- {
- Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000);
- if(Nordrassil)
- {
- Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- DoCast(Nordrassil, SPELL_DRAIN_WORLD_TREE);
- IsChanneling = true;
- }
- }
- Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 5000);
- if(Nordrassil)
- {
- Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
- Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true);
- DrainNordrassilTimer = 1000;
- }
- }else DrainNordrassilTimer -= diff;
- }
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
- BelowTenPercent = true;
-
- if(!Enraged)
- {
- if(EnrageTimer < diff)
- {
- if((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- Enraged = true;
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }
- }else EnrageTimer -= diff;
-
- if(CheckDistanceTimer < diff)
- { // To simplify the check, we simply summon a creature in the location and then check how far we are from the creature
- Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
- if(Check)
- {
- Check->SetVisibility(VISIBILITY_OFF);
- if(m_creature->IsWithinDistInMap(Check, 75))
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- Enraged = true;
- DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
- }
- }
- CheckDistanceTimer = 5000;
- }else CheckDistanceTimer -= diff;
- }
-
- if(BelowTenPercent)
- {
- if(!HasProtected)
- {
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE);
- HasProtected = true;
- Enraged = true;
- }
-
- if(SummonWispTimer < diff)
- {
- Creature* Wisp = DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(Wisp)
- {
- Wisp->AI()->AttackStart(m_creature);
- ((mob_ancient_wispAI*)Wisp->AI())->ArchimondeGUID = m_creature->GetGUID();
- }
- SummonWispTimer = 1500;
- ++WispCount;
- }else SummonWispTimer -= diff;
-
- if(WispCount >= 30)
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- if(Enraged)
- {
- if(HandOfDeathTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH);
- HandOfDeathTimer = 2000;
- }else HandOfDeathTimer -= diff;
- return; // Don't do anything after this point.
- }
-
- if(SoulChargeCount)
- {
- if(SoulChargeTimer < diff)
- UnleashSoulCharge();
- else SoulChargeTimer -= diff;
- }
-
- if(GripOfTheLegionTimer < diff)
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION);
- GripOfTheLegionTimer = 5000 + rand()%20000;
- }else GripOfTheLegionTimer -= diff;
-
- if(AirBurstTimer < diff)
- {
- if(rand()%2 == 0)
- {
- DoYell(SAY_AIR_BURST, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AIR_BURST);
- }else
- {
- DoYell(SAY_AIR_BURST2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_AIR_BURST2);
- }
-
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AIR_BURST);
- AirBurstTimer = 25000 + rand()%15000;
- }else AirBurstTimer -= diff;
-
- if(FearTimer < diff)
- {
- DoCast(m_creature->getVictim(), SPELL_FEAR);
- FearTimer = 40000;
- }else FearTimer -= diff;
-
- if(DoomfireTimer < diff)
- {
- SummonDoomfire(SelectUnit(SELECT_TARGET_RANDOM, 1));
- DoomfireTimer = 40000;
- }else DoomfireTimer -= diff;
-
- if(MeleeRangeCheckTimer < diff)
- {
- if(CanUseFingerOfDeath())
- {
- DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH);
- MeleeRangeCheckTimer = 1000;
- }
-
- MeleeRangeCheckTimer = 5000;
- }else MeleeRangeCheckTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_archimonde(Creature *_Creature)
-{
- return new boss_archimondeAI (_Creature);
-}
-
-CreatureAI* GetAI_mob_doomfire(Creature* _Creature)
-{
- return new mob_doomfireAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_doomfire_targetting(Creature* _Creature)
-{
- return new mob_doomfire_targettingAI(_Creature);
-}
-
-CreatureAI* GetAI_mob_ancient_wisp(Creature* _Creature)
-{
- return new mob_ancient_wispAI(_Creature);
-}
-
-void AddSC_boss_archimonde()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_archimonde";
- newscript->GetAI = GetAI_boss_archimonde;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_doomfire";
- newscript->GetAI = GetAI_mob_doomfire;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_doomfire_targetting";
- newscript->GetAI = GetAI_mob_doomfire_targetting;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "mob_ancient_wisp";
- newscript->GetAI = GetAI_mob_ancient_wisp;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Archimonde
+SD%Complete: 95
+SDComment: Doomfires not completely offlike due to core limitations for random moving.
+SDCategory: Caverns of Time, Mount Hyjal
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_hyjal.h"
+#include "SpellAuras.h"
+
+#define SPELL_DENOUEMENT_WISP 32124
+#define SPELL_ANCIENT_SPARK 39349
+#define SPELL_PROTECTION_OF_ELUNE 38528
+
+#define SPELL_DRAIN_WORLD_TREE 39140
+#define SPELL_DRAIN_WORLD_TREE_2 39141
+
+#define SPELL_FINGER_OF_DEATH 31984
+#define SPELL_HAND_OF_DEATH 35354
+#define SPELL_AIR_BURST 32014
+#define SPELL_GRIP_OF_THE_LEGION 31972
+#define SPELL_DOOMFIRE_SPAWN 32074
+#define SPELL_DOOMFIRE_VISUAL 42344 // This is actually a Zul'Aman spell, but the proper Doomfire spell sometimes freezes the server if a player stands in it for too long
+#define SPELL_DOOMFIRE_DAMAGE 31944
+#define SPELL_SOUL_CHARGE_YELLOW 32045
+#define SPELL_SOUL_CHARGE_GREEN 32051
+#define SPELL_SOUL_CHARGE_RED 32052
+#define SPELL_UNLEASH_SOUL_YELLOW 32054
+#define SPELL_UNLEASH_SOUL_GREEN 32057
+#define SPELL_UNLEASH_SOUL_RED 32053
+#define SPELL_FEAR 31970
+
+#define SAY_AGGRO "Your resistance is insignificant!"
+#define SOUND_AGGRO 10987
+
+#define SAY_DOOMFIRE1 "This world will burn!"
+#define SOUND_DOOMFIRE1 10990
+
+#define SAY_DOOMFIRE2 "Manach sheek-thrish!"
+#define SOUND_DOOMFIRE2 11041
+
+#define SAY_AIR_BURST "A-kreesh!"
+#define SOUND_AIR_BURST 10989
+
+#define SAY_AIR_BURST2 "Away vermin!"
+#define SOUND_AIR_BURST2 11043
+
+#define SAY_SLAY1 "All creation will be devoured!"
+#define SOUND_SLAY1 11044
+
+#define SAY_SLAY2 "Your soul will languish for eternity."
+#define SOUND_SLAY2 10991
+
+#define SAY_SLAY3 "I am the coming of the end!"
+#define SOUND_SLAY3 11045
+
+#define SAY_UNK1 "You are mine now."
+#define SOUND_UNK1 10988
+
+#define SAY_UNK2 "Bow to my will."
+#define SOUND_UNK2 11042
+
+#define SAY_ENRAGE "At last it is here. Mourn and lament the passing of all you have ever known and all that would have been! Akmin-kurai!"
+#define SOUND_ENRAGE 10993
+
+#define SAY_DEATH "No, it cannot be! Nooo!"
+#define SOUND_DEATH 10992
+
+#define CREATURE_ARCHIMONDE 17968
+#define CREATURE_DOOMFIRE 18095
+#define CREATURE_DOOMFIRE_TARGETING 18104
+#define CREATURE_ANCIENT_WISP 17946
+#define CREATURE_CHANNEL_TARGET 22418
+
+#define NORDRASSIL_X 5503.713
+#define NORDRASSIL_Y -3523.436
+#define NORDRASSIL_Z 1608.781
+
+struct mob_ancient_wispAI : public ScriptedAI
+{
+ mob_ancient_wispAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+ uint64 ArchimondeGUID;
+ uint32 CheckTimer;
+
+ void Reset()
+ {
+ ArchimondeGUID = 0;
+ CheckTimer = 1000;
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void DamageTaken(Unit* done_by, uint32 &damage) { damage = 0; }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!ArchimondeGUID)
+ {
+ if(pInstance)
+ ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE);
+ }
+
+ if(CheckTimer < diff)
+ {
+ if(ArchimondeGUID)
+ {
+ Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
+ if(Archimonde)
+ {
+ if((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive())
+ DoCast(m_creature, SPELL_DENOUEMENT_WISP);
+ else
+ DoCast(Archimonde, SPELL_ANCIENT_SPARK);
+ }
+ }
+ CheckTimer = 1000;
+ }else CheckTimer -= diff;
+ }
+};
+
+/* This script controls the Doomfire mob. Unlike the other Doomfire mob, this one does not stalk players.
+ Instead, this doomfire will simply stand in one place after spawning and deal damage to any players that
+ are within 3 yards. Another creature called Doomfire Targetting spawns this creature as well as stalks. */
+struct TRINITY_DLL_DECL mob_doomfireAI : public ScriptedAI
+{
+ mob_doomfireAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint32 CheckTimer;
+ uint32 RefreshTimer;
+
+ bool TargetSelected;
+
+ uint64 ArchimondeGUID;
+ uint64 TargetGUID;
+
+ void Reset()
+ {
+ CheckTimer = 5000;
+ RefreshTimer = 0;
+
+ TargetSelected = false;
+
+ ArchimondeGUID = 0;
+ TargetGUID = 0;
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
+
+ void Aggro(Unit* who) { }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ // Do not do anything if who does not exist, or we are refreshing our timer, or who is Doomfire, Archimonde or Doomfire targetting
+ if(!who || who == m_creature || RefreshTimer || who->GetEntry() == CREATURE_ANCIENT_WISP ||
+ who->GetEntry() == CREATURE_ARCHIMONDE || who->GetEntry() == CREATURE_DOOMFIRE ||
+ who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack())
+ return;
+
+ if(m_creature->IsWithinDistInMap(who, 3))
+ {
+ TargetSelected = true;
+ TargetGUID = who->GetGUID();
+ RefreshTimer = 2000;
+ }
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ bool suicide = true;
+ if(ArchimondeGUID)
+ {
+ Creature* Archimonde = ((Creature*)Unit::GetUnit((*m_creature), ArchimondeGUID));
+ if(Archimonde && Archimonde->isAlive())
+ {
+ suicide = false;
+ Archimonde->AI()->KilledUnit(victim);
+ }
+ }
+
+ if(suicide)
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(RefreshTimer < diff)
+ RefreshTimer = 0;
+ else RefreshTimer -= diff;
+
+ if(TargetSelected && TargetGUID)
+ {
+ Unit* target = Unit::GetUnit((*m_creature), TargetGUID);
+ if(target && target->isAlive())
+ {
+ target->CastSpell(target, SPELL_DOOMFIRE_DAMAGE, true);
+ TargetGUID = 0;
+ TargetSelected = false;
+ }
+ }
+
+ if(CheckTimer < diff)
+ {
+ if(ArchimondeGUID)
+ {
+ Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
+ if(!Archimonde || !Archimonde->isAlive())
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ CheckTimer = 5000;
+ }
+ else m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }else CheckTimer -= diff;
+ }
+};
+
+/* This is the script for the Doomfire Targetting Mob. This mob simply follows players and/or travels in random directions and spawns the actual Doomfire which does damage to anyone that moves close. */
+struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI
+{
+ mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c)
+ {
+ Reset();
+ }
+
+ uint32 ChangeTargetTimer;
+ uint32 SummonTimer; // This timer will serve as both a summon timer for the doomfire that does damage as well as to check on Archionde
+
+ uint64 ArchimondeGUID;
+
+ void Reset()
+ {
+ ChangeTargetTimer = 5000;
+ SummonTimer = 1000;
+
+ ArchimondeGUID = 0;
+ }
+
+ void Aggro(Unit* who) {}
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ // Do not do anything if who does not exist, or who is Doomfire, Archimonde or Doomfire targetting
+ if(!who || who == m_creature || who->GetEntry() == CREATURE_ARCHIMONDE
+ || who->GetEntry() == CREATURE_DOOMFIRE || who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack())
+ return;
+
+ m_creature->AddThreat(who, 1.0f);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(SummonTimer < diff)
+ {
+ if(ArchimondeGUID)
+ {
+ Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
+ if(Archimonde && Archimonde->isAlive())
+ {
+ Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE, 0, 0, 2, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
+ if(Doomfire)
+ {
+ Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true);
+ ((mob_doomfireAI*)Doomfire->AI())->ArchimondeGUID = ArchimondeGUID;
+ Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ SummonTimer = 500;
+ }
+ else
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ else
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }else SummonTimer -= diff;
+
+ if(ChangeTargetTimer < diff)
+ {
+ Unit* target = NULL;
+ switch(rand()%2)
+ {
+ case 0: // stalk player
+ target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(target && target->isAlive())
+ {
+ m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
+ m_creature->GetMotionMaster()->MoveChase(target);
+ }
+ break;
+
+ case 1: // random location
+ float x = 0;
+ float y = 0;
+ float z = 0;
+ m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z);
+ m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
+ break;
+ }
+ ChangeTargetTimer = 5000;
+ }else ChangeTargetTimer -= diff;
+ }
+
+};
+
+/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers.
+ The only complicated aspect of the battle is Finger of Death and Doomfire, with Doomfire being the
+ hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then
+ select a random target and cast the spell on them. However, if someone IS in melee range, and this
+ is NOT the main tank (creature's victim), then we aggro that player and they become the new victim.
+ For Doomfire, we summon a mob (Doomfire Targetting) that summons another mob (Doomfire every second)
+ Doomfire Targetting 'stalks' players whilst Doomfire damages player that are within range. */
+
+// This is used to sort by distance in order to see who is the closest target, when checking for Finger of Death
+struct TargetDistanceOrder : public std::binary_function
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator "<"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
+{
+ boss_archimondeAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 DrainNordrassilTimer;
+ uint32 FearTimer;
+ uint32 AirBurstTimer;
+ uint32 GripOfTheLegionTimer;
+ uint32 DoomfireTimer;
+ uint32 SoulChargeTimer;
+ uint32 SoulChargeCount;
+ uint32 MeleeRangeCheckTimer;
+ uint32 HandOfDeathTimer;
+ uint32 SummonWispTimer;
+ uint32 WispCount;
+ uint32 EnrageTimer;
+ uint32 CheckDistanceTimer;
+
+ bool Enraged;
+ bool BelowTenPercent;
+ bool HasProtected;
+ bool IsChanneling;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
+
+ DrainNordrassilTimer = 0;
+ FearTimer = 40000;
+ AirBurstTimer = 30000;
+ GripOfTheLegionTimer = 5000 + rand()%20000;
+ DoomfireTimer = 20000;
+ SoulChargeTimer = 2000 + rand()%27000;
+ SoulChargeCount = 0;
+ MeleeRangeCheckTimer = 15000;
+ HandOfDeathTimer = 2000;
+ WispCount = 0; // When ~30 wisps are summoned, Archimonde dies
+ EnrageTimer = 600000; // 10 minutes
+ CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage
+
+ Enraged = false;
+ BelowTenPercent = false;
+ HasProtected = false;
+ IsChanneling = false;
+ }
+
+ void Aggro(Unit *who)
+ {
+ m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AGGRO);
+ DoZoneInCombat();
+
+ if(pInstance)
+ pInstance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY1);
+ break;
+ case 1:
+ DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY2);
+ break;
+ case 2:
+ DoYell(SAY_SLAY3,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature, SOUND_SLAY3);
+ break;
+ }
+
+ if(victim && (victim->GetTypeId() == TYPEID_PLAYER))
+ GainSoulCharge(((Player*)victim));
+ }
+
+ void GainSoulCharge(Player* victim)
+ {
+ switch(victim->getClass())
+ {
+ case CLASS_PRIEST:
+ case CLASS_PALADIN:
+ case CLASS_WARLOCK:
+ victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true);
+ break;
+ case CLASS_MAGE:
+ case CLASS_ROGUE:
+ case CLASS_WARRIOR:
+ victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true);
+ break;
+ case CLASS_DRUID:
+ case CLASS_SHAMAN:
+ case CLASS_HUNTER:
+ victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true);
+ break;
+ }
+
+ SoulChargeTimer = 2000 + rand()%28000;
+ ++SoulChargeCount;
+ }
+
+ void JustDied(Unit *victim)
+ {
+ DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEATH);
+
+ if(pInstance)
+ pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE);
+ }
+
+ bool CanUseFingerOfDeath()
+ {
+ // First we check if our current victim is in melee range or not.
+ Unit* victim = m_creature->getVictim();
+ if(victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim)))
+ return false;
+
+ std::list& m_threatlist = m_creature->getThreatManager().getThreatList();
+ if(m_threatlist.empty())
+ return false;
+
+ std::list targets;
+ std::list::iterator itr = m_threatlist.begin();
+ for( ; itr != m_threatlist.end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ if(pUnit && pUnit->isAlive())
+ targets.push_back(pUnit);
+ }
+
+ if(targets.empty())
+ return false;
+
+ targets.sort(TargetDistanceOrder(m_creature));
+ Unit* target = targets.front();
+ if(target)
+ {
+ if(!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
+ return true; // Cast Finger of Death
+ else // This target is closest, he is our new tank
+ m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
+ }
+
+ return false;
+ }
+
+ void SummonDoomfire(Unit* target)
+ {
+ Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE_TARGETING, rand()%30, rand()%30, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
+ if(Doomfire)
+ {
+ ((mob_doomfire_targettingAI*)Doomfire->AI())->ArchimondeGUID = m_creature->GetGUID();
+ Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Give Doomfire a taste of everyone in the threatlist = more targets to chase.
+ std::list::iterator itr;
+ for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
+ Doomfire->AddThreat(Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()), 1.0f);
+ Doomfire->setFaction(m_creature->getFaction());
+ DoCast(Doomfire, SPELL_DOOMFIRE_SPAWN);
+ Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true);
+ if(target)
+ Doomfire->AI()->AttackStart(target);
+
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_DOOMFIRE1, LANG_UNIVERSAL, m_creature);
+ DoPlaySoundToSet(m_creature, SOUND_DOOMFIRE1);
+ }else
+ {
+ DoYell(SAY_DOOMFIRE2, LANG_UNIVERSAL, m_creature);
+ DoPlaySoundToSet(m_creature, SOUND_DOOMFIRE2);
+ }
+ }
+ }
+
+ void UnleashSoulCharge()
+ {
+ m_creature->InterruptNonMeleeSpells(false);
+ bool HasCast = false;
+ uint32 chargeSpell = 0;
+ uint32 unleashSpell = 0;
+ switch(rand()%3)
+ {
+ case 0:
+ chargeSpell = SPELL_SOUL_CHARGE_RED;
+ unleashSpell = SPELL_UNLEASH_SOUL_RED;
+ break;
+ case 1:
+ chargeSpell = SPELL_SOUL_CHARGE_YELLOW;
+ unleashSpell = SPELL_UNLEASH_SOUL_YELLOW;
+ break;
+ case 2:
+ chargeSpell = SPELL_SOUL_CHARGE_GREEN;
+ unleashSpell = SPELL_UNLEASH_SOUL_GREEN;
+ break;
+ }
+ if(m_creature->HasAura(chargeSpell, 0))
+ {
+ m_creature->RemoveSingleAuraFromStack(chargeSpell, 0);
+ DoCast(m_creature->getVictim(), unleashSpell);
+ HasCast = true;
+ SoulChargeCount--;
+ }
+ if(HasCast)
+ SoulChargeTimer = 2000 + rand()%28000;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!InCombat)
+ {
+ if(pInstance)
+ {
+ // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
+ if((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35)))
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setFaction(35);
+ }
+ else if((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35)))
+ {
+ m_creature->setFaction(1720);
+ m_creature->SetVisibility(VISIBILITY_ON);
+ }
+ }
+
+ if(DrainNordrassilTimer < diff)
+ {
+ if(!IsChanneling)
+ {
+ Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000);
+ if(Nordrassil)
+ {
+ Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ DoCast(Nordrassil, SPELL_DRAIN_WORLD_TREE);
+ IsChanneling = true;
+ }
+ }
+ Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 5000);
+ if(Nordrassil)
+ {
+ Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true);
+ DrainNordrassilTimer = 1000;
+ }
+ }else DrainNordrassilTimer -= diff;
+ }
+
+ if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ return;
+
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
+ BelowTenPercent = true;
+
+ if(!Enraged)
+ {
+ if(EnrageTimer < diff)
+ {
+ if((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ Enraged = true;
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }
+ }else EnrageTimer -= diff;
+
+ if(CheckDistanceTimer < diff)
+ { // To simplify the check, we simply summon a creature in the location and then check how far we are from the creature
+ Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
+ if(Check)
+ {
+ Check->SetVisibility(VISIBILITY_OFF);
+ if(m_creature->IsWithinDistInMap(Check, 75))
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ Enraged = true;
+ DoYell(SAY_ENRAGE, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_ENRAGE);
+ }
+ }
+ CheckDistanceTimer = 5000;
+ }else CheckDistanceTimer -= diff;
+ }
+
+ if(BelowTenPercent)
+ {
+ if(!HasProtected)
+ {
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE);
+ HasProtected = true;
+ Enraged = true;
+ }
+
+ if(SummonWispTimer < diff)
+ {
+ Creature* Wisp = DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if(Wisp)
+ {
+ Wisp->AI()->AttackStart(m_creature);
+ ((mob_ancient_wispAI*)Wisp->AI())->ArchimondeGUID = m_creature->GetGUID();
+ }
+ SummonWispTimer = 1500;
+ ++WispCount;
+ }else SummonWispTimer -= diff;
+
+ if(WispCount >= 30)
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ if(Enraged)
+ {
+ if(HandOfDeathTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH);
+ HandOfDeathTimer = 2000;
+ }else HandOfDeathTimer -= diff;
+ return; // Don't do anything after this point.
+ }
+
+ if(SoulChargeCount)
+ {
+ if(SoulChargeTimer < diff)
+ UnleashSoulCharge();
+ else SoulChargeTimer -= diff;
+ }
+
+ if(GripOfTheLegionTimer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION);
+ GripOfTheLegionTimer = 5000 + rand()%20000;
+ }else GripOfTheLegionTimer -= diff;
+
+ if(AirBurstTimer < diff)
+ {
+ if(rand()%2 == 0)
+ {
+ DoYell(SAY_AIR_BURST, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AIR_BURST);
+ }else
+ {
+ DoYell(SAY_AIR_BURST2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(m_creature, SOUND_AIR_BURST2);
+ }
+
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AIR_BURST);
+ AirBurstTimer = 25000 + rand()%15000;
+ }else AirBurstTimer -= diff;
+
+ if(FearTimer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FEAR);
+ FearTimer = 40000;
+ }else FearTimer -= diff;
+
+ if(DoomfireTimer < diff)
+ {
+ SummonDoomfire(SelectUnit(SELECT_TARGET_RANDOM, 1));
+ DoomfireTimer = 40000;
+ }else DoomfireTimer -= diff;
+
+ if(MeleeRangeCheckTimer < diff)
+ {
+ if(CanUseFingerOfDeath())
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH);
+ MeleeRangeCheckTimer = 1000;
+ }
+
+ MeleeRangeCheckTimer = 5000;
+ }else MeleeRangeCheckTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_archimonde(Creature *_Creature)
+{
+ return new boss_archimondeAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_doomfire(Creature* _Creature)
+{
+ return new mob_doomfireAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_doomfire_targetting(Creature* _Creature)
+{
+ return new mob_doomfire_targettingAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_ancient_wisp(Creature* _Creature)
+{
+ return new mob_ancient_wispAI(_Creature);
+}
+
+void AddSC_boss_archimonde()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_archimonde";
+ newscript->GetAI = GetAI_boss_archimonde;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_doomfire";
+ newscript->GetAI = GetAI_mob_doomfire;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_doomfire_targetting";
+ newscript->GetAI = GetAI_mob_doomfire_targetting;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_ancient_wisp";
+ newscript->GetAI = GetAI_mob_ancient_wisp;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h
index ff8e3dd3eed..1e28156857f 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h
@@ -1,25 +1,25 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef DEF_HYJAL_H
-#define DEF_HYJAL_H
-
-#define DATA_ANETHERON 1
-#define DATA_ANETHERONEVENT 2
-#define DATA_ARCHIMONDE 3
-#define DATA_ARCHIMONDEEVENT 4
-#define DATA_AZGALOR 5
-#define DATA_AZGALOREVENT 6
-#define DATA_JAINAPROUDMOORE 7
-#define DATA_KAZROGAL 8
-#define DATA_KAZROGALEVENT 9
-#define DATA_RAGEWINTERCHILL 10
-#define DATA_RAGEWINTERCHILLEVENT 11
-#define DATA_THRALL 12
-#define DATA_TYRANDEWHISPERWIND 13
-#define DATA_TRASH 14
-#define DATA_RESET_TRASH_COUNT 15
-
-#define ERROR_INST_DATA "SD2: Instance data not set properly for Mount Hyjal. Encounters will be buggy"
-#endif
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software licensed under GPL version 2
+ * Please see the included DOCS/LICENSE.TXT for more information */
+
+#ifndef DEF_HYJAL_H
+#define DEF_HYJAL_H
+
+#define DATA_ANETHERON 1
+#define DATA_ANETHERONEVENT 2
+#define DATA_ARCHIMONDE 3
+#define DATA_ARCHIMONDEEVENT 4
+#define DATA_AZGALOR 5
+#define DATA_AZGALOREVENT 6
+#define DATA_JAINAPROUDMOORE 7
+#define DATA_KAZROGAL 8
+#define DATA_KAZROGALEVENT 9
+#define DATA_RAGEWINTERCHILL 10
+#define DATA_RAGEWINTERCHILLEVENT 11
+#define DATA_THRALL 12
+#define DATA_TYRANDEWHISPERWIND 13
+#define DATA_TRASH 14
+#define DATA_RESET_TRASH_COUNT 15
+
+#define ERROR_INST_DATA "SD2: Instance data not set properly for Mount Hyjal. Encounters will be buggy"
+#endif
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
index a3484a4321a..837f1f09872 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
@@ -1,217 +1,217 @@
-/* Copyright (C) 2006,2007 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Hyjal
-SD%Complete: 100
-SDComment:
-SDCategory: Caverns of Time, Mount Hyjal
-EndScriptData */
-
-/* ContentData
-npc_jaina_proudmoore
-npc_thrall
-npc_tyrande_whisperwind
-EndContentData */
-
-#include "precompiled.h"
-#include "hyjalAI.h"
-
-#define GOSSIP_ITEM_BEGIN_ALLY "We are ready to defend the Alliance base."
-#define GOSSIP_ITEM_ANETHERON "The defenses are holding up; we can continue."
-#define GOSSIP_ITEM_RETREAT "We can't keep this up. Let's retreat!"
-
-#define GOSSIP_ITEM_BEGIN_HORDE "We're here to help! The Alliance are overrun."
-#define GOSSIP_ITEM_AZGALOR "We're okay so far. Let's do this!"
-
-CreatureAI* GetAI_npc_jaina_proudmoore(Creature *_Creature)
-{
- hyjalAI* ai = new hyjalAI(_Creature);
-
- ai->Reset();
- ai->EnterEvadeMode();
-
- ai->Spell[0].SpellId = SPELL_BLIZZARD;
- ai->Spell[0].Cooldown = 15000 + rand()%20000;
- ai->Spell[0].TargetType = TARGETTYPE_RANDOM;
-
- ai->Spell[1].SpellId = SPELL_PYROBLAST;
- ai->Spell[1].Cooldown = 2000 + rand()%7000;
- ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
-
- ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS;
- ai->Spell[2].Cooldown = 15000 + rand()%30000;
- ai->Spell[2].TargetType = TARGETTYPE_SELF;
-
- return ai;
-}
-
-bool GossipHello_npc_jaina_proudmoore(Player *player, Creature *_Creature)
-{
- hyjalAI* ai = ((hyjalAI*)_Creature->AI());
- if(ai->EventBegun)
- return false;
-
- uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT);
- uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT);
- if(RageEncounter == NOT_STARTED)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- else if(RageEncounter == DONE && AnetheronEncounter == NOT_STARTED)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- else if(RageEncounter == DONE && AnetheronEncounter == DONE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- if(player->isGameMaster())
- player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
-
- player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_jaina_proudmoore(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- player->PlayerTalkClass->GetGossipMenu();
- hyjalAI* ai = ((hyjalAI*)_Creature->AI());
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- ai->StartEvent(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- ai->FirstBossDead = true;
- ai->WaveCount = 9;
- ai->StartEvent(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- ai->Retreat();
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- ai->Debug = !ai->Debug;
- outstring_log("SD2 : HyjalAI - Debug mode has been toggled");
- break;
- }
-
- return true;
-}
-
-CreatureAI* GetAI_npc_thrall(Creature *_Creature)
-{
- hyjalAI* ai = new hyjalAI(_Creature);
-
- ai->Reset();
- ai->EnterEvadeMode();
-
- ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING;
- ai->Spell[0].Cooldown = 2000 + rand()%5000;
- ai->Spell[0].TargetType = TARGETTYPE_VICTIM;
-
- ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF;
- ai->Spell[1].Cooldown = 6000 + rand()%35000;
- ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
-
- return ai;
-}
-
-bool GossipHello_npc_thrall(Player *player, Creature *_Creature)
-{
- hyjalAI* ai = ((hyjalAI*)_Creature->AI());
- uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT);
- if(AnetheronEvent >= DONE && !ai->EventBegun) // Only let them start the Horde phase if Anetheron is dead.
- {
- uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT);
- uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
- if(KazrogalEvent == NOT_STARTED)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- else if(KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- else if(AzgalorEvent == DONE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- }
-
- if(player->isGameMaster())
- player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
-
- player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
-
- return true;
-}
-
-bool GossipSelect_npc_thrall(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- player->PlayerTalkClass->GetGossipMenu();
- hyjalAI* ai = ((hyjalAI*)_Creature->AI());
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- ai->StartEvent(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- ai->FirstBossDead = true;
- ai->WaveCount = 9;
- ai->StartEvent(player);
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- ai->Retreat();
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- ai->Debug = !ai->Debug;
- outstring_log("SD2 : HyjalAI - Debug mode has been toggled");
- break;
- }
-
- return true;
-}
-
-bool GossipHello_npc_tyrande_whisperwind(Player* player, Creature* _Creature)
-{
- player->ADD_GOSSIP_ITEM(1, "Aid us in defending Nordrassil", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
- return true;
-}
-
-bool GossipSelect_npc_tyrande_whisperwind(Player *player, Creature *_Creature, uint32 sender, uint32 action)
-{
- if(action == GOSSIP_ACTION_TRADE)
- player->SEND_VENDORLIST( _Creature->GetGUID() );
-
- return true;
-}
-
-void AddSC_hyjal()
-{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "npc_jaina_proudmoore";
- newscript->GetAI = GetAI_npc_jaina_proudmoore;
- newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore;
- newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_thrall";
- newscript->GetAI = GetAI_npc_thrall;
- newscript->pGossipHello = &GossipHello_npc_thrall;
- newscript->pGossipSelect = &GossipSelect_npc_thrall;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name = "npc_tyrande_whisperwind";
- newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind;
- newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind;
- m_scripts[nrscripts++] = newscript;
-}
+/* Copyright (C) 2006,2007 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Hyjal
+SD%Complete: 100
+SDComment:
+SDCategory: Caverns of Time, Mount Hyjal
+EndScriptData */
+
+/* ContentData
+npc_jaina_proudmoore
+npc_thrall
+npc_tyrande_whisperwind
+EndContentData */
+
+#include "precompiled.h"
+#include "hyjalAI.h"
+
+#define GOSSIP_ITEM_BEGIN_ALLY "We are ready to defend the Alliance base."
+#define GOSSIP_ITEM_ANETHERON "The defenses are holding up; we can continue."
+#define GOSSIP_ITEM_RETREAT "We can't keep this up. Let's retreat!"
+
+#define GOSSIP_ITEM_BEGIN_HORDE "We're here to help! The Alliance are overrun."
+#define GOSSIP_ITEM_AZGALOR "We're okay so far. Let's do this!"
+
+CreatureAI* GetAI_npc_jaina_proudmoore(Creature *_Creature)
+{
+ hyjalAI* ai = new hyjalAI(_Creature);
+
+ ai->Reset();
+ ai->EnterEvadeMode();
+
+ ai->Spell[0].SpellId = SPELL_BLIZZARD;
+ ai->Spell[0].Cooldown = 15000 + rand()%20000;
+ ai->Spell[0].TargetType = TARGETTYPE_RANDOM;
+
+ ai->Spell[1].SpellId = SPELL_PYROBLAST;
+ ai->Spell[1].Cooldown = 2000 + rand()%7000;
+ ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
+
+ ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS;
+ ai->Spell[2].Cooldown = 15000 + rand()%30000;
+ ai->Spell[2].TargetType = TARGETTYPE_SELF;
+
+ return ai;
+}
+
+bool GossipHello_npc_jaina_proudmoore(Player *player, Creature *_Creature)
+{
+ hyjalAI* ai = ((hyjalAI*)_Creature->AI());
+ if(ai->EventBegun)
+ return false;
+
+ uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT);
+ uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT);
+ if(RageEncounter == NOT_STARTED)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ else if(RageEncounter == DONE && AnetheronEncounter == NOT_STARTED)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ else if(RageEncounter == DONE && AnetheronEncounter == DONE)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+
+ if(player->isGameMaster())
+ player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+
+ player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_jaina_proudmoore(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ player->PlayerTalkClass->GetGossipMenu();
+ hyjalAI* ai = ((hyjalAI*)_Creature->AI());
+ switch(action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ ai->StartEvent(player);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ ai->FirstBossDead = true;
+ ai->WaveCount = 9;
+ ai->StartEvent(player);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ ai->Retreat();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ ai->Debug = !ai->Debug;
+ outstring_log("SD2 : HyjalAI - Debug mode has been toggled");
+ break;
+ }
+
+ return true;
+}
+
+CreatureAI* GetAI_npc_thrall(Creature *_Creature)
+{
+ hyjalAI* ai = new hyjalAI(_Creature);
+
+ ai->Reset();
+ ai->EnterEvadeMode();
+
+ ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING;
+ ai->Spell[0].Cooldown = 2000 + rand()%5000;
+ ai->Spell[0].TargetType = TARGETTYPE_VICTIM;
+
+ ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF;
+ ai->Spell[1].Cooldown = 6000 + rand()%35000;
+ ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
+
+ return ai;
+}
+
+bool GossipHello_npc_thrall(Player *player, Creature *_Creature)
+{
+ hyjalAI* ai = ((hyjalAI*)_Creature->AI());
+ uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT);
+ if(AnetheronEvent >= DONE && !ai->EventBegun) // Only let them start the Horde phase if Anetheron is dead.
+ {
+ uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT);
+ uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
+ if(KazrogalEvent == NOT_STARTED)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ else if(KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ else if(AzgalorEvent == DONE)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ }
+
+ if(player->isGameMaster())
+ player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+
+ player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_thrall(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ player->PlayerTalkClass->GetGossipMenu();
+ hyjalAI* ai = ((hyjalAI*)_Creature->AI());
+ switch(action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ ai->StartEvent(player);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ ai->FirstBossDead = true;
+ ai->WaveCount = 9;
+ ai->StartEvent(player);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ ai->Retreat();
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4:
+ ai->Debug = !ai->Debug;
+ outstring_log("SD2 : HyjalAI - Debug mode has been toggled");
+ break;
+ }
+
+ return true;
+}
+
+bool GossipHello_npc_tyrande_whisperwind(Player* player, Creature* _Creature)
+{
+ player->ADD_GOSSIP_ITEM(1, "Aid us in defending Nordrassil", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
+ player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_tyrande_whisperwind(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if(action == GOSSIP_ACTION_TRADE)
+ player->SEND_VENDORLIST( _Creature->GetGUID() );
+
+ return true;
+}
+
+void AddSC_hyjal()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_jaina_proudmoore";
+ newscript->GetAI = GetAI_npc_jaina_proudmoore;
+ newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore;
+ newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_thrall";
+ newscript->GetAI = GetAI_npc_thrall;
+ newscript->pGossipHello = &GossipHello_npc_thrall;
+ newscript->pGossipSelect = &GossipSelect_npc_thrall;
+ m_scripts[nrscripts++] = newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_tyrande_whisperwind";
+ newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind;
+ newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind;
+ m_scripts[nrscripts++] = newscript;
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
index c117b73e57f..3ccd790a648 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
@@ -1,458 +1,458 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: HyjalAI
-SD%Complete: 99
-SDComment: World Packet workaround for World States
-SDCategory: Caverns of Time, Mount Hyjal
-EndScriptData */
-
-#include "precompiled.h"
-#include "hyjalAI.h"
-#include "WorldPacket.h"
-
-float AllianceBase[4][3]= // Locations for summoning waves in Alliance base
-{
- {4979.010, -1709.134, 1339.674},
- {4969.123, -1705.904, 1341.363},
- {4970.260, -1698.546, 1341.200},
- {4975.262, -1698.239, 1341.427}
-};
-
-float HordeBase[4][3]= // Locations for summoning waves in Horde base
-{
- {5554.399, -2581.419, 1480.820},
- {5538.996, -2577.742, 1479.790},
- {5565.642, -2565.666, 1481.635},
- {5547.218, -2574.589, 1479.194}
-};
-
-float AttackArea[2][3]= // used to inform the wave where to move and attack to
-{
- { // Alliance
- 5042.9189, -1776.2562, 1323.0621
- },
- { // Horde
- 5510.4815, -2676.7112, 1480.4314
- }
-};
-
-hyjalAI::hyjalAI(Creature *c) : ScriptedAI(c)
-{
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Reset();
-}
-
-void hyjalAI::Reset()
-{
- /** GUIDs **/
- PlayerGUID = 0;
- BossGUID[0] = 0;
- BossGUID[1] = 0;
-
- /** Timers **/
- NextWaveTimer = 10000;
- CheckTimer = 0;
- RetreatTimer = 1000;
-
- /** Misc **/
- WaveCount = 0;
-
- /** Set faction properly based on creature entry**/
- switch(m_creature->GetEntry())
- {
- case 17772:
- Faction = 0;
- DoCast(m_creature, SPELL_BRILLIANCE_AURA, true);
- break;
-
- case 17852: Faction = 1; break;
- }
-
- /** Bools **/
- EventBegun = false;
- FirstBossDead = false;
- SecondBossDead = false;
- Summon = false;
- bRetreat = false;
-
- /** Flags **/
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- /** Initialize spells **/
- memset(Spell, 0, sizeof(Spell));
-
- /** Reset World States **/
- UpdateWorldState(WORLDSTATE_WAVES, 0);
- UpdateWorldState(WORLDSTATE_ENEMY, 0);
- UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 0);
-
- /** Reset Instance Data for trash count **/
- if(pInstance)
- pInstance->SetData(DATA_RESET_TRASH_COUNT, 0);
- else error_log(ERROR_INST_DATA);
-
- /*** Visibility ***/
- m_creature->SetVisibility(VISIBILITY_ON);
-
- /** If Jaina evades, reset the visibility of all other creatures in the grid. **/
- if(CreatureList.empty())
- return;
-
- for(std::list::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr)
- if(Creature* cr = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
- cr->SetVisibility(VISIBILITY_ON);
-
- CreatureList.clear();
-}
-
-void hyjalAI::EnterEvadeMode()
-{
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- m_creature->LoadCreaturesAddon();
-
- if(m_creature->isAlive())
- m_creature->GetMotionMaster()->MoveTargetedHome();
-
- InCombat = false;
-}
-
-void hyjalAI::Aggro(Unit *who)
-{
- for(uint8 i = 0; i < 2; ++i)
- if(Spell[i].Cooldown)
- SpellTimer[i] = Spell[i].Cooldown;
-
- Talk(ATTACKED);
-}
-
-void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
-{
- uint32 random = rand()%4;
- float SpawnLoc[3];
- float AttackLoc[3];
-
- for(uint8 i = 0; i < 3; ++i)
- {
- SpawnLoc[i] = Base[random][i];
- AttackLoc[i] = AttackArea[Faction][i];
- }
-
- Creature* pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
- if(pCreature)
- {
- ++EnemyCount; // Increment Enemy Count to be used in World States and instance script
-
- pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- pCreature->GetMotionMaster()->MovePoint(0, AttackLoc[0],AttackLoc[1],AttackLoc[2]);
- pCreature->AddThreat(m_creature, 1.0f);
- DoZoneInCombat(pCreature);
-
- // Check if creature is a boss.
- if(pCreature->GetCreatureInfo()->rank == 3)
- {
- if(!FirstBossDead) BossGUID[0] = pCreature->GetGUID();
- else BossGUID[1] = pCreature->GetGUID();
- CheckTimer = 5000;
- }
- }
-}
-
-void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3])
-{
- if(rand()%4 == 0) // 1 in 4 chance we give a rally yell. Not sure if the chance is Blizzlike.
- Talk(RALLY);
-
- if(!pInstance)
- {
- error_log(ERROR_INST_DATA);
- return;
- }
-
- EnemyCount = pInstance->GetData(DATA_TRASH);
- for(uint8 i = 0; i < 18; ++i)
- {
- if(wave[Count].Mob[i])
- SummonCreature(wave[Count].Mob[i], Base);
- }
-
- if(!wave[Count].IsBoss)
- {
- uint32 stateValue = Count+1;
- if(FirstBossDead)
- stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8
- UpdateWorldState(WORLDSTATE_WAVES, stateValue); // Set world state to our current wave number
- UpdateWorldState(WORLDSTATE_ENEMY, 1);
- //UpdateWorldState(WORLDSTATE_ENEMYCOUNT, EnemyCount); // Let Instance Script handle this
- pInstance->SetData(DATA_TRASH, EnemyCount);
- if(!Debug)
- NextWaveTimer = wave[Count].WaveTimer;
- else
- {
- NextWaveTimer = 15000;
- DoTextEmote(": Debug Mode is enabled. Next Wave in 15 seconds", NULL);
- }
- }
- else
- {
- UpdateWorldState(WORLDSTATE_WAVES, 0); // Set world state for waves to 0 to disable it.
- UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 1); // Set World State for enemies invading to 1.
- Summon = false;
- }
- CheckTimer = 5000;
-}
-
-void hyjalAI::StartEvent(Player* player)
-{
- if(!player)
- return;
-
- Talk(BEGIN);
-
- EventBegun = true;
- Summon = true;
-
- NextWaveTimer = 15000;
- CheckTimer = 5000;
- PlayerGUID = player->GetGUID();
-
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- UpdateWorldState(WORLDSTATE_WAVES, 0);
- UpdateWorldState(WORLDSTATE_ENEMY, 0);
- UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 0);
-}
-
-uint32 hyjalAI::GetInstanceData(uint32 Event)
-{
- if(pInstance)
- return pInstance->GetData(Event);
- else error_log(ERROR_INST_DATA);
-
- return 0;
-}
-
-void hyjalAI::Talk(uint32 id)
-{
- std::list index;
- for(uint8 i = 0; i < 10; i++)
- {
- if(Faction == 0) // Alliance
- {
- if(JainaQuotes[i].id == id)
- index.push_back(i);
- }
- else if(Faction == 1) // Horde
- {
- if(ThrallQuotes[i].id == id)
- index.push_back(i);
- }
- }
-
- if(index.empty())
- return; // No quotes found, no use to continue
-
- uint8 ind = *(index.begin()) + rand()%index.size();
-
- char* Yell = NULL;
- uint32 Sound = 0;
- if(Faction == 0) // Alliance
- {
- Yell = JainaQuotes[ind].text;
- Sound = JainaQuotes[ind].sound;
- }
- else if(Faction == 1) // Horde
- {
- Yell = ThrallQuotes[ind].text;
- Sound = ThrallQuotes[ind].sound;
- }
-
- if(Yell)
- DoYell(Yell, LANG_UNIVERSAL, NULL);
- if(Sound)
- DoPlaySoundToSet(m_creature, Sound);
-}
-
-// Slight workaround for now
-void hyjalAI::UpdateWorldState(uint32 field, uint32 value)
-{
- Map * map = m_creature->GetMap();
- if(!map->IsDungeon()) return;
-
- WorldPacket data(SMSG_UPDATE_WORLD_STATE, 8);
-
- data << field;
- data << value;
-
- ((InstanceMap*)map)->SendToPlayers(&data);
-
- // TODO: Uncomment and remove everything above this line only when the core patch for this is accepted
- //m_creature->GetMap()->UpdateWorldState(field, value);
-}
-
-void hyjalAI::Retreat()
-{
- CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- // First get all creatures.
- std::list creatures;
- Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
- Trinity::CreatureListSearcher creature_searcher(creatures, creature_check);
- TypeContainerVisitor
- ,
- GridTypeMapContainer> creature_visitor(creature_searcher);
-
- // Then get all Ancient Gem Veins. NOTE: Grid Search will only be able to find those in the grid.
- std::list goList;
- Trinity::AllGameObjectsWithEntryInGrid go_check(185557);
- Trinity::GameObjectListSearcher go_search(goList, go_check);
- TypeContainerVisitor
- , GridTypeMapContainer> go_visit(go_search);
-
- CellLock cell_lock(cell, pair);
- // Get Creatures
- cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap()));
- // Get GOs
- cell_lock->Visit(cell_lock, go_visit, *(m_creature->GetMap()));
-
- CreatureList.clear();
- if(!creatures.empty())
- {
- for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
- {
- (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true);
- CreatureList.push_back((*itr)->GetGUID());
- }
-
- DoCast(m_creature, SPELL_TELEPORT_VISUAL);
- bRetreat = true;
- RetreatTimer = 1000;
- }
-
- if(!goList.empty())
- {
- for(std::list::iterator itr = goList.begin(); itr != goList.end(); ++itr)
- (*itr)->SetRespawnTime(5000);
- }
-}
-
-void hyjalAI::UpdateAI(const uint32 diff)
-{
- if(bRetreat)
- if(RetreatTimer < diff)
- {
- bRetreat = false;
- if(CreatureList.empty())
- return;
-
- for(std::list::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr)
- if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
- pUnit->SetVisibility(VISIBILITY_OFF);
-
- m_creature->SetVisibility(VISIBILITY_OFF);
- }else RetreatTimer -= diff;
-
- if(!EventBegun)
- return;
-
- if(Summon)
- {
- if(pInstance && EnemyCount)
- {
- EnemyCount = pInstance->GetData(DATA_TRASH);
- if(!EnemyCount)
- NextWaveTimer = 5000;
- }
-
- if(NextWaveTimer < diff)
- {
- if(Faction == 0)
- SummonNextWave(AllianceWaves, WaveCount, AllianceBase);
- else if(Faction == 1)
- SummonNextWave(HordeWaves, WaveCount, HordeBase);
- ++WaveCount;
- }else NextWaveTimer -= diff;
- }
-
- if(CheckTimer < diff)
- {
- for(uint8 i = 0; i < 2; ++i)
- {
- if(BossGUID[i])
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), BossGUID[i]);
- if(pUnit && (!pUnit->isAlive()))
- {
- if(BossGUID[i] == BossGUID[0])
- {
- Talk(INCOMING);
- FirstBossDead = true;
- }
- else if(BossGUID[i] == BossGUID[1])
- {
- Talk(SUCCESS);
- SecondBossDead = true;
- }
- EventBegun = false;
- CheckTimer = 0;
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- BossGUID[i] = 0;
- UpdateWorldState(WORLDSTATE_ENEMY, 0); // Reset world state for enemies to disable it
- }
- }
- }
- CheckTimer = 5000;
- }else CheckTimer -= diff;
-
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
- return;
-
- for(uint8 i = 0; i < 3; ++i)
- {
- if(Spell[i].SpellId)
- {
- if(SpellTimer[i] < diff)
- {
- if(m_creature->IsNonMeleeSpellCasted(false))
- m_creature->InterruptNonMeleeSpells(false);
-
- Unit* target = NULL;
-
- switch(Spell[i].TargetType)
- {
- case TARGETTYPE_SELF: target = m_creature; break;
- case TARGETTYPE_RANDOM: target = SelectUnit(SELECT_TARGET_RANDOM, 0); break;
- case TARGETTYPE_VICTIM: target = m_creature->getVictim(); break;
- }
-
- if(target && target->isAlive())
- {
- DoCast(target, Spell[i].SpellId);
- SpellTimer[i] = Spell[i].Cooldown;
- }
- }else SpellTimer[i] -= diff;
- }
- }
-
- DoMeleeAttackIfReady();
-}
+/* Copyright (C) 2006 - 2008 ScriptDev2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: HyjalAI
+SD%Complete: 99
+SDComment: World Packet workaround for World States
+SDCategory: Caverns of Time, Mount Hyjal
+EndScriptData */
+
+#include "precompiled.h"
+#include "hyjalAI.h"
+#include "WorldPacket.h"
+
+float AllianceBase[4][3]= // Locations for summoning waves in Alliance base
+{
+ {4979.010, -1709.134, 1339.674},
+ {4969.123, -1705.904, 1341.363},
+ {4970.260, -1698.546, 1341.200},
+ {4975.262, -1698.239, 1341.427}
+};
+
+float HordeBase[4][3]= // Locations for summoning waves in Horde base
+{
+ {5554.399, -2581.419, 1480.820},
+ {5538.996, -2577.742, 1479.790},
+ {5565.642, -2565.666, 1481.635},
+ {5547.218, -2574.589, 1479.194}
+};
+
+float AttackArea[2][3]= // used to inform the wave where to move and attack to
+{
+ { // Alliance
+ 5042.9189, -1776.2562, 1323.0621
+ },
+ { // Horde
+ 5510.4815, -2676.7112, 1480.4314
+ }
+};
+
+hyjalAI::hyjalAI(Creature *c) : ScriptedAI(c)
+{
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+}
+
+void hyjalAI::Reset()
+{
+ /** GUIDs **/
+ PlayerGUID = 0;
+ BossGUID[0] = 0;
+ BossGUID[1] = 0;
+
+ /** Timers **/
+ NextWaveTimer = 10000;
+ CheckTimer = 0;
+ RetreatTimer = 1000;
+
+ /** Misc **/
+ WaveCount = 0;
+
+ /** Set faction properly based on creature entry**/
+ switch(m_creature->GetEntry())
+ {
+ case 17772:
+ Faction = 0;
+ DoCast(m_creature, SPELL_BRILLIANCE_AURA, true);
+ break;
+
+ case 17852: Faction = 1; break;
+ }
+
+ /** Bools **/
+ EventBegun = false;
+ FirstBossDead = false;
+ SecondBossDead = false;
+ Summon = false;
+ bRetreat = false;
+
+ /** Flags **/
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ /** Initialize spells **/
+ memset(Spell, 0, sizeof(Spell));
+
+ /** Reset World States **/
+ UpdateWorldState(WORLDSTATE_WAVES, 0);
+ UpdateWorldState(WORLDSTATE_ENEMY, 0);
+ UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 0);
+
+ /** Reset Instance Data for trash count **/
+ if(pInstance)
+ pInstance->SetData(DATA_RESET_TRASH_COUNT, 0);
+ else error_log(ERROR_INST_DATA);
+
+ /*** Visibility ***/
+ m_creature->SetVisibility(VISIBILITY_ON);
+
+ /** If Jaina evades, reset the visibility of all other creatures in the grid. **/
+ if(CreatureList.empty())
+ return;
+
+ for(std::list::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr)
+ if(Creature* cr = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
+ cr->SetVisibility(VISIBILITY_ON);
+
+ CreatureList.clear();
+}
+
+void hyjalAI::EnterEvadeMode()
+{
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+ m_creature->LoadCreaturesAddon();
+
+ if(m_creature->isAlive())
+ m_creature->GetMotionMaster()->MoveTargetedHome();
+
+ InCombat = false;
+}
+
+void hyjalAI::Aggro(Unit *who)
+{
+ for(uint8 i = 0; i < 2; ++i)
+ if(Spell[i].Cooldown)
+ SpellTimer[i] = Spell[i].Cooldown;
+
+ Talk(ATTACKED);
+}
+
+void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
+{
+ uint32 random = rand()%4;
+ float SpawnLoc[3];
+ float AttackLoc[3];
+
+ for(uint8 i = 0; i < 3; ++i)
+ {
+ SpawnLoc[i] = Base[random][i];
+ AttackLoc[i] = AttackArea[Faction][i];
+ }
+
+ Creature* pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
+ if(pCreature)
+ {
+ ++EnemyCount; // Increment Enemy Count to be used in World States and instance script
+
+ pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ pCreature->GetMotionMaster()->MovePoint(0, AttackLoc[0],AttackLoc[1],AttackLoc[2]);
+ pCreature->AddThreat(m_creature, 1.0f);
+ DoZoneInCombat(pCreature);
+
+ // Check if creature is a boss.
+ if(pCreature->GetCreatureInfo()->rank == 3)
+ {
+ if(!FirstBossDead) BossGUID[0] = pCreature->GetGUID();
+ else BossGUID[1] = pCreature->GetGUID();
+ CheckTimer = 5000;
+ }
+ }
+}
+
+void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3])
+{
+ if(rand()%4 == 0) // 1 in 4 chance we give a rally yell. Not sure if the chance is Blizzlike.
+ Talk(RALLY);
+
+ if(!pInstance)
+ {
+ error_log(ERROR_INST_DATA);
+ return;
+ }
+
+ EnemyCount = pInstance->GetData(DATA_TRASH);
+ for(uint8 i = 0; i < 18; ++i)
+ {
+ if(wave[Count].Mob[i])
+ SummonCreature(wave[Count].Mob[i], Base);
+ }
+
+ if(!wave[Count].IsBoss)
+ {
+ uint32 stateValue = Count+1;
+ if(FirstBossDead)
+ stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8
+ UpdateWorldState(WORLDSTATE_WAVES, stateValue); // Set world state to our current wave number
+ UpdateWorldState(WORLDSTATE_ENEMY, 1);
+ //UpdateWorldState(WORLDSTATE_ENEMYCOUNT, EnemyCount); // Let Instance Script handle this
+ pInstance->SetData(DATA_TRASH, EnemyCount);
+ if(!Debug)
+ NextWaveTimer = wave[Count].WaveTimer;
+ else
+ {
+ NextWaveTimer = 15000;
+ DoTextEmote(": Debug Mode is enabled. Next Wave in 15 seconds", NULL);
+ }
+ }
+ else
+ {
+ UpdateWorldState(WORLDSTATE_WAVES, 0); // Set world state for waves to 0 to disable it.
+ UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 1); // Set World State for enemies invading to 1.
+ Summon = false;
+ }
+ CheckTimer = 5000;
+}
+
+void hyjalAI::StartEvent(Player* player)
+{
+ if(!player)
+ return;
+
+ Talk(BEGIN);
+
+ EventBegun = true;
+ Summon = true;
+
+ NextWaveTimer = 15000;
+ CheckTimer = 5000;
+ PlayerGUID = player->GetGUID();
+
+ m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+
+ UpdateWorldState(WORLDSTATE_WAVES, 0);
+ UpdateWorldState(WORLDSTATE_ENEMY, 0);
+ UpdateWorldState(WORLDSTATE_ENEMYCOUNT, 0);
+}
+
+uint32 hyjalAI::GetInstanceData(uint32 Event)
+{
+ if(pInstance)
+ return pInstance->GetData(Event);
+ else error_log(ERROR_INST_DATA);
+
+ return 0;
+}
+
+void hyjalAI::Talk(uint32 id)
+{
+ std::list index;
+ for(uint8 i = 0; i < 10; i++)
+ {
+ if(Faction == 0) // Alliance
+ {
+ if(JainaQuotes[i].id == id)
+ index.push_back(i);
+ }
+ else if(Faction == 1) // Horde
+ {
+ if(ThrallQuotes[i].id == id)
+ index.push_back(i);
+ }
+ }
+
+ if(index.empty())
+ return; // No quotes found, no use to continue
+
+ uint8 ind = *(index.begin()) + rand()%index.size();
+
+ char* Yell = NULL;
+ uint32 Sound = 0;
+ if(Faction == 0) // Alliance
+ {
+ Yell = JainaQuotes[ind].text;
+ Sound = JainaQuotes[ind].sound;
+ }
+ else if(Faction == 1) // Horde
+ {
+ Yell = ThrallQuotes[ind].text;
+ Sound = ThrallQuotes[ind].sound;
+ }
+
+ if(Yell)
+ DoYell(Yell, LANG_UNIVERSAL, NULL);
+ if(Sound)
+ DoPlaySoundToSet(m_creature, Sound);
+}
+
+// Slight workaround for now
+void hyjalAI::UpdateWorldState(uint32 field, uint32 value)
+{
+ Map * map = m_creature->GetMap();
+ if(!map->IsDungeon()) return;
+
+ WorldPacket data(SMSG_UPDATE_WORLD_STATE, 8);
+
+ data << field;
+ data << value;
+
+ ((InstanceMap*)map)->SendToPlayers(&data);
+
+ // TODO: Uncomment and remove everything above this line only when the core patch for this is accepted
+ //m_creature->GetMap()->UpdateWorldState(field, value);
+}
+
+void hyjalAI::Retreat()
+{
+ CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ // First get all creatures.
+ std::list