From 5d2d8d8074eb7f845627fcc97645c8d0081be2ba Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 22:21:57 +0200 Subject: Merge [SD2] r1321 Add support for quest 863. Some cleanup in existing script. r1322 Correct database info for current supported Mangos revision (8273+) (Windows may use from 8190+) - skip r1323 Make escortAI function IsPlayerOrGroupInRange and move existing code to this. r1324 Fixed IsEncounterInProgress for Arcatraz, The Eye and Shadow Labyrinth r1325 Renamed aunchindoun to auchindoun. Fixed comment typos. --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 28 +- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 28 +- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 28 +- src/bindings/scripts/base/escort_ai.cpp | 52 +-- src/bindings/scripts/base/escort_ai.h | 2 + .../scripts/eastern_kingdoms/hinterlands.cpp | 168 ++++++-- .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 +++++++++++++++++ .../boss_shirrak_the_dead_watcher.cpp | 212 ++++++++++ .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 +++++++++++++++++ .../auchindoun/mana_tombs/boss_pandemonius.cpp | 138 +++++++ .../sethekk_halls/boss_darkweaver_syth.cpp | 438 +++++++++++++++++++++ .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 +++++++++++ .../auchindoun/sethekk_halls/def_sethekk_halls.h | 14 + .../sethekk_halls/instance_sethekk_halls.cpp | 91 +++++ .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 ++++++++++ .../boss_blackheart_the_inciter.cpp | 177 +++++++++ .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 +++++++++++++++ .../auchindoun/shadow_labyrinth/boss_murmur.cpp | 207 ++++++++++ .../shadow_labyrinth/def_shadow_labyrinth.h | 15 + .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 +++++++++++ .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 ----------------- .../boss_shirrak_the_dead_watcher.cpp | 212 ---------- .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 ----------------- .../aunchindoun/mana_tombs/boss_pandemonius.cpp | 138 ------- .../sethekk_halls/boss_darkweaver_syth.cpp | 438 --------------------- .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 ----------- .../aunchindoun/sethekk_halls/def_sethekk_halls.h | 14 - .../sethekk_halls/instance_sethekk_halls.cpp | 91 ----- .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 ---------- .../boss_blackheart_the_inciter.cpp | 177 --------- .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 --------------- .../aunchindoun/shadow_labyrinth/boss_murmur.cpp | 207 ---------- .../shadow_labyrinth/def_shadow_labyrinth.h | 15 - .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 ----------- .../tempest_keep/arcatraz/instance_arcatraz.cpp | 3 +- src/bindings/scripts/system/ScriptLoader.cpp | 16 +- 36 files changed, 3229 insertions(+), 3106 deletions(-) create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp (limited to 'src/bindings') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 285fb004c59..58b91096c18 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -405,20 +405,20 @@ SET(trinityscript_LIB_SRCS scripts/northrend/sholazar_basin.cpp scripts/northrend/wintergrasp.cpp scripts/northrend/zuldrak.cpp - scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp - scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp - scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp - scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp - scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp - scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp - scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h - scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp - scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h - scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp + scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp + scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp + scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp + scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp + scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp + scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp + scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h + scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp + scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h + scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp scripts/outland/black_temple/black_temple.cpp scripts/outland/black_temple/boss_bloodboil.cpp scripts/outland/black_temple/boss_illidan.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 635f9356908..4c98db9abb2 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -2172,11 +2172,11 @@ Name="Auchenai Crypts" > @@ -2184,11 +2184,11 @@ Name="Mana Tombs" > @@ -2196,19 +2196,19 @@ Name="Sethekk Halls" > @@ -2216,27 +2216,27 @@ Name="Shadow Labyrinth" > diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index c6f403470cb..ee30f353115 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -2169,11 +2169,11 @@ Name="Auchenai Crypts" > @@ -2181,11 +2181,11 @@ Name="Mana Tombs" > @@ -2193,19 +2193,19 @@ Name="Sethekk Halls" > @@ -2213,27 +2213,27 @@ Name="Shadow Labyrinth" > diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp index 2c28aa6b9a6..37c8c31981b 100644 --- a/src/bindings/scripts/base/escort_ai.cpp +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -130,6 +130,32 @@ void npc_escortAI::EnterEvadeMode() Reset(); } +bool npc_escortAI::IsPlayerOrGroupInRange() +{ + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + Player* pMember = pRef->getSource(); + + if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance())) + { + return true; + break; + } + } + } + else + { + if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance())) + return true; + } + } + return false; +} + void npc_escortAI::UpdateAI(const uint32 uiDiff) { //Waypoint Updating @@ -194,31 +220,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) { if (m_uiPlayerCheckTimer < uiDiff) { - bool bIsMaxRangeExceeded = true; - - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - { - if (Group* pGroup = pPlayer->GetGroup()) - { - for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) - { - Player* pMember = pRef->getSource(); - - if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance())) - { - bIsMaxRangeExceeded = false; - break; - } - } - } - else - { - if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance())) - bIsMaxRangeExceeded = false; - } - } - - if (DespawnAtFar && bIsMaxRangeExceeded) + if (DespawnAtFar && !IsPlayerOrGroupInRange()) { debug_log("TSCR: EscortAI failed because player/group was to far away or not found"); diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 663e11d79f6..243e64d6d21 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -56,6 +56,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI // EscortAI functions void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0); + bool IsPlayerOrGroupInRange(); + void FillPointMovementListForCreature(); void Start(bool bIsActiveAttacker = true, bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp index b02d3fb918b..6b661dad5ef 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp @@ -17,17 +17,125 @@ /* ScriptData SDName: Hinterlands SD%Complete: 100 -SDComment: Quest support: 2742 +SDComment: Quest support: 863, 2742 SDCategory: The Hinterlands EndScriptData */ /* ContentData +npc_00x09hl npc_rinji EndContentData */ #include "precompiled.h" #include "escort_ai.h" +/*###### +## npc_00x09hl +######*/ + +enum +{ + SAY_OOX_START = -1000416, + SAY_OOX_AGGRO = -1000417, + SAY_OOX_DANGER = -1000418, + SAY_OOX_COMPLETE = -1000419, + + QUEST_RESQUE_OOX_09 = 836, + + NPC_MARAUDING_OWL = 7808, + NPC_VILE_AMBUSHER = 7809, + + FACTION_ESCORTEE_A = 774, + FACTION_ESCORTEE_H = 775 +}; + +struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI +{ + npc_00x09hlAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 26: + DoScriptText(SAY_OOX_DANGER, m_creature); + break; + case 43: + DoScriptText(SAY_OOX_DANGER, m_creature); + break; + case 64: + DoScriptText(SAY_OOX_COMPLETE, m_creature); + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, m_creature); + break; + } + } + + void WaypointStart(uint32 uiPointId) + { + switch(uiPointId) + { + case 27: + for(int i = 0; i < 3; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(147.927444, -3851.513428, 130.893, 7.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_MARAUDING_OWL, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + case 44: + for(int i = 0; i < 3; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(-141.151581, -4291.213867, 120.130, 7.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_VILE_AMBUSHER, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + } + } + + void Aggro(Unit* pWho) + { + if (pWho->GetEntry() == NPC_MARAUDING_OWL || pWho->GetEntry() == NPC_VILE_AMBUSHER) + return; + + DoScriptText(SAY_OOX_AGGRO, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } +}; + +bool QuestAccept_npc_00x09hl(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_RESQUE_OOX_09) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (pPlayer->GetTeam() == ALLIANCE) + pCreature->setFaction(FACTION_ESCORTEE_A); + else if (pPlayer->GetTeam() == HORDE) + pCreature->setFaction(FACTION_ESCORTEE_H); + + DoScriptText(SAY_OOX_START, pCreature, pPlayer); + + if (npc_00x09hlAI* pEscortAI = CAST_AI(npc_00x09hlAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_00x09hl(Creature* pCreature) +{ + return new npc_00x09hlAI(pCreature); +} + /*###### ## npc_rinji ######*/ @@ -164,39 +272,45 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI } } - void UpdateAI(const uint32 uiDiff) + void UpdateEscortAI(const uint32 uiDiff) { - npc_escortAI::UpdateAI(uiDiff); - - if (IsBeingEscorted && m_uiPostEventCount && !m_creature->getVictim()) + //Check if we have a current target + if (!UpdateVictim()) { - if (m_uiPostEventTimer < uiDiff) + if (IsBeingEscorted && m_uiPostEventCount) { - m_uiPostEventTimer = 3000; - - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (m_uiPostEventTimer < uiDiff) { - switch(m_uiPostEventCount) + m_uiPostEventTimer = 3000; + + if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + { + switch(m_uiPostEventCount) + { + case 1: + DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer); + ++m_uiPostEventCount; + break; + case 2: + DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer); + m_uiPostEventCount = 0; + break; + } + } + else { - case 1: - DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer); - ++m_uiPostEventCount; - break; - case 2: - DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer); - m_uiPostEventCount = 0; - break; + m_creature->ForcedDespawn(); + return; } } else - { - m_creature->ForcedDespawn(); - return; - } + m_uiPostEventTimer -= uiDiff; } - else - m_uiPostEventTimer -= uiDiff; + + return; } + + DoMeleeAttackIfReady(); } }; @@ -222,6 +336,12 @@ void AddSC_hinterlands() { Script* newscript; + newscript = new Script; + newscript->Name = "npc_00x09hl"; + newscript->GetAI = &GetAI_npc_00x09hl; + newscript->pQuestAccept = &QuestAccept_npc_00x09hl; + newscript->RegisterSelf(); + newscript = new Script; newscript->Name = "npc_rinji"; newscript->GetAI = &GetAI_npc_rinji; diff --git a/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp new file mode 100644 index 00000000000..414804a6576 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -0,0 +1,358 @@ +/* Copyright (C) 2006 - 2009 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) {} + + uint8 myClass; + uint32 Class_Timer; + + void Reset() + { + Class_Timer = 1000; + } + + void EnterCombat(Unit *who) + { } + + void SetMyClass(uint8 myclass) + { + myClass = myclass; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + 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* pCreature) +{ + return new mob_stolen_soulAI (pCreature); +} + +#define SAY_INTRO -1558000 +#define SAY_SUMMON -1558001 + +#define SAY_AGGRO_1 -1558002 +#define SAY_AGGRO_2 -1558003 +#define SAY_AGGRO_3 -1558004 + +#define SAY_ROAR -1558005 +#define SAY_SOUL_CLEAVE -1558006 + +#define SAY_SLAY_1 -1558007 +#define SAY_SLAY_2 -1558008 + +#define SAY_DEATH -1558009 + +#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) + { + HasTaunted = false; + } + + 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 = 15000 + rand()% 5000; + Ribbon_of_Souls_timer = 5000; + StolenSoul_Timer = 25000 + rand()% 10000; + + Avatar_summoned = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + + void EnterCombat(Unit *who) + { + switch (rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); 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->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); + summoned->SetDisplayId(soulmodel); + summoned->setFaction(m_creature->getFaction()); + + if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) + { + + CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); + summoned->AI()->AttackStart(target); + } + } + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch (rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + //When Exarch Maladar is defeated D'ore appear. + m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature, SPELL_SUMMON_AVATAR); + Avatar_summoned = true; + StolenSoul_Timer = 15000 + rand()% 15000; + } + + 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) + DoScriptText(SAY_ROAR, m_creature); + else + DoScriptText(SAY_SOUL_CLEAVE, m_creature); + + soulmodel = target->GetDisplayId(); + soulholder = target->GetGUID(); + soulclass = target->getClass(); + + DoCast(target,SPELL_STOLEN_SOUL); + m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + + StolenSoul_Timer = 20000 + rand()% 10000; + } else StolenSoul_Timer = 1000; + } + }else StolenSoul_Timer -= diff; + + if (Ribbon_of_Souls_timer < diff) + { + if (Unit *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 = 15000 + rand()% 15000; + }else Fear_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) +{ + return new boss_exarch_maladaarAI (pCreature); +} + +#define SPELL_AV_MORTAL_STRIKE 16856 +#define SPELL_AV_SUNDER_ARMOR 16145 + +struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI +{ + mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} + + uint32 Mortal_Strike_timer; + + void Reset() + { + Mortal_Strike_timer = 10000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Mortal_Strike_timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); + Mortal_Strike_timer = 10000 + rand()%20 * 1000; + } else Mortal_Strike_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) +{ + return new mob_avatar_of_martyredAI (pCreature); +} + +void AddSC_boss_exarch_maladaar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_exarch_maladaar"; + newscript->GetAI = &GetAI_boss_exarch_maladaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_avatar_of_martyred"; + newscript->GetAI = &GetAI_mob_avatar_of_martyred; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_stolen_soul"; + newscript->GetAI = &GetAI_mob_stolen_soul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp new file mode 100644 index 00000000000..4dfdd407731 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp @@ -0,0 +1,212 @@ +/* Copyright (C) 2006 - 2009 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 +Name: Boss_Shirrak_the_dead_watcher +%Complete: 80 +Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented +Category: Auchindoun, Auchenai Crypts +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_INHIBITMAGIC 32264 +#define SPELL_ATTRACTMAGIC 32265 +#define N_SPELL_CARNIVOROUSBITE 36383 +#define H_SPELL_CARNIVOROUSBITE 39382 +#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) + +#define ENTRY_FOCUS_FIRE 18374 + +#define N_SPELL_FIERY_BLAST 32302 +#define H_SPELL_FIERY_BLAST 38382 +#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) +#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual + +struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI +{ + boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 Inhibitmagic_Timer; + uint32 Attractmagic_Timer; + uint32 Carnivorousbite_Timer; + uint32 FocusFire_Timer; + bool HeroicMode; + Unit *focusedTarget; + + void Reset() + { + Inhibitmagic_Timer = 0; + Attractmagic_Timer = 28000; + Carnivorousbite_Timer = 10000; + FocusFire_Timer = 17000; + focusedTarget = NULL; + } + + void EnterCombat(Unit *who) + { } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) + { + summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); + summoned->setFaction(m_creature->getFaction()); + summoned->SetLevel(m_creature->getLevel()); + summoned->addUnitState(UNIT_STAT_ROOT); + + if (focusedTarget) + summoned->AI()->AttackStart(focusedTarget); + } + } + + void UpdateAI(const uint32 diff) + { + //Inhibitmagic_Timer + if (Inhibitmagic_Timer < diff) + { + float dist; + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) + { + i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 35) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 25) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 15) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + } + Inhibitmagic_Timer = 3000+(rand()%1000); + }else Inhibitmagic_Timer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Attractmagic_Timer + if (Attractmagic_Timer < diff) + { + DoCast(m_creature,SPELL_ATTRACTMAGIC); + Attractmagic_Timer = 30000; + Carnivorousbite_Timer = 1500; + }else Attractmagic_Timer -= diff; + + //Carnivorousbite_Timer + if (Carnivorousbite_Timer < diff) + { + DoCast(m_creature,SPELL_CARNIVOROUSBITE); + Carnivorousbite_Timer = 10000; + }else Carnivorousbite_Timer -= diff; + + //FocusFire_Timer + if (FocusFire_Timer < diff) + { + // Summon Focus Fire & Emote + Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + focusedTarget = target; + m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); + + // TODO: Find better way to handle emote + // Emote + std::string *emote = new std::string("focuses on "); + emote->append(target->GetName()); + emote->append("!"); + const char* text = emote->c_str(); + m_creature->MonsterTextEmote(text, 0, true); + delete emote; + } + FocusFire_Timer = 15000+(rand()%5000); + }else FocusFire_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) +{ + return new boss_shirrak_the_dead_watcherAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI +{ + mob_focus_fireAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 FieryBlast_Timer; + bool fiery1, fiery2; + + void Reset() + { + FieryBlast_Timer = 3000+(rand()%1000); + fiery1 = fiery2 = true; + } + + void EnterCombat(Unit *who) + { } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FieryBlast_Timer + if (fiery2 && FieryBlast_Timer < diff) + { + DoCast(m_creature,SPELL_FIERY_BLAST); + + if (fiery1) fiery1 = false; + else if (fiery2) fiery2 = false; + + FieryBlast_Timer = 1000; + }else FieryBlast_Timer -= diff; + + //DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) +{ + return new mob_focus_fireAI (pCreature); +} + +void AddSC_boss_shirrak_the_dead_watcher() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_shirrak_the_dead_watcher"; + newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_focus_fire"; + newscript->GetAI = &GetAI_mob_focus_fire; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp new file mode 100644 index 00000000000..dcaaefee8c2 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -0,0 +1,369 @@ +/* Copyright (C) 2006 - 2009 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" + +enum +{ + SAY_INTRO = -1557000, + SAY_AGGRO_1 = -1557001, + SAY_AGGRO_2 = -1557002, + SAY_AGGRO_3 = -1557003, + SAY_SLAY_1 = -1557004, + SAY_SLAY_2 = -1557005, + SAY_SUMMON = -1557006, + SAY_DEAD = -1557007, + + SPELL_BLINK = 34605, + SPELL_FROSTBOLT = 32364, + SPELL_FIREBALL = 32363, + SPELL_FROSTNOVA = 32365, + + SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON + SPELL_ETHEREAL_BEACON_VISUAL = 32368, + + NPC_BEACON = 18431, + NPC_SHAFFAR = 18344, + + NR_INITIAL_BEACONS = 3 +}; + +struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI +{ + boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } + + uint32 Blink_Timer; + uint32 Beacon_Timer; + uint32 FireBall_Timer; + uint32 Frostbolt_Timer; + uint32 FrostNova_Timer; + + SummonList summons; + + bool HasTaunted; + bool CanBlink; + + void Reset() + { + Blink_Timer = 1500; + Beacon_Timer = 10000; + FireBall_Timer = 8000; + Frostbolt_Timer = 4000; + FrostNova_Timer = 15000; + + CanBlink = false; + + float dist = 8.0f; + float posX, posY, posZ, angle; + m_creature->GetHomePosition(posX, posY, posZ, angle); + + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + } + + void EnterEvadeMode() + { + summons.DespawnAll(); + ScriptedAI::EnterEvadeMode(); + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + DoZoneInCombat(); + summons.DoZoneInCombat(); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == NPC_BEACON) + { + summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature *summon) + { + summons.Despawn(summon); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEAD, m_creature); + summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + 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); + + //expire movement, will prevent from running right back to victim after cast + //(but should MoveChase be used again at a certain time or should he not move?) + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + 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)) + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); + + Beacon_Timer = 10000; + }else Beacon_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) +{ + return new boss_nexusprince_shaffarAI (pCreature); +} + +enum +{ + SPELL_ARCANE_BOLT = 15254, + 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(); + } + + bool HeroicMode; + uint32 Apprentice_Timer; + uint32 ArcaneBolt_Timer; + uint32 Check_Timer; + + void KillSelf() + { + m_creature->Kill(m_creature); + } + + void Reset() + { + Apprentice_Timer = (HeroicMode ? 10000 : 20000); + ArcaneBolt_Timer = 1000; + Check_Timer = 1000; + } + + void EnterCombat(Unit *who) + { + // Send Shaffar to fight + Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead()) + { + KillSelf(); + return; + } + if (!Shaffar->isInCombat()) + Shaffar->AI()->AttackStart(who); + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature->getVictim()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Check_Timer < diff) + { + Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) + { + KillSelf(); + return; + } + Check_Timer = 1000; + }else Check_Timer -= diff; + + if (ArcaneBolt_Timer < diff) + { + DoCast(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); + m_creature->ForcedDespawn(); + return; + }else Apprentice_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) +{ + return new mob_ethereal_beaconAI (pCreature); +} + +enum +{ + SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, + SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 +}; + +struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI +{ + mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cast_Timer; + + bool isFireboltTurn; + + void Reset() + { + Cast_Timer = 3000; + isFireboltTurn = true; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cast_Timer < diff) + { + if (isFireboltTurn) + { + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); + isFireboltTurn = false; + }else{ + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); + isFireboltTurn = true; + } + Cast_Timer = 3000; + }else Cast_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) +{ + return new mob_ethereal_apprenticeAI (pCreature); +} + +void AddSC_boss_nexusprince_shaffar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_nexusprince_shaffar"; + newscript->GetAI = &GetAI_boss_nexusprince_shaffar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_beacon"; + newscript->GetAI = &GetAI_mob_ethereal_beacon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_apprentice"; + newscript->GetAI = &GetAI_mob_ethereal_apprentice; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp new file mode 100644 index 00000000000..77e1c535340 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp @@ -0,0 +1,138 @@ +/* Copyright (C) 2006 - 2009 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 -1557008 +#define SAY_AGGRO_2 -1557009 +#define SAY_AGGRO_3 -1557010 + +#define SAY_KILL_1 -1557011 +#define SAY_KILL_2 -1557012 + +#define SAY_DEATH -1557013 + +#define EMOTE_DARK_SHELL -1557014 + +#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(); + } + + bool HeroicMode; + uint32 VoidBlast_Timer; + uint32 DarkShell_Timer; + uint32 VoidBlast_Counter; + + void Reset() + { + VoidBlast_Timer = 8000+rand()%15000; + DarkShell_Timer = 20000; + VoidBlast_Counter = 0; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + 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 = 15000+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); + + DoScriptText(EMOTE_DARK_SHELL, m_creature); + + DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); + DarkShell_Timer = 20000; + }else DarkShell_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) +{ + return new boss_pandemoniusAI (pCreature); +} + +void AddSC_boss_pandemonius() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_pandemonius"; + newscript->GetAI = &GetAI_boss_pandemonius; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp new file mode 100644 index 00000000000..00e43fa257d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -0,0 +1,438 @@ +/* Copyright (C) 2006 - 2009 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 partly implemented. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SUMMON -1556000 + +#define SAY_AGGRO_1 -1556001 +#define SAY_AGGRO_2 -1556002 +#define SAY_AGGRO_3 -1556003 + +#define SAY_SLAY_1 -1556004 +#define SAY_SLAY_2 -1556005 + +#define SAY_DEATH -1556006 + +#define SPELL_FROST_SHOCK 21401 //37865 +#define SPELL_FLAME_SHOCK 34354 +#define SPELL_SHADOW_SHOCK 30138 +#define SPELL_ARCANE_SHOCK 37132 + +#define SPELL_CHAIN_LIGHTNING 15659 //15305 + +#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 (HeroicMode?38141:33526) +#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) +#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) +#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) + +struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI +{ + boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 arcaneshock_timer; + uint32 frostshock_timer; + uint32 shadowshock_timer; + uint32 chainlightning_timer; + + bool summon90; + bool summon50; + bool summon10; + bool HeroicMode; + + void Reset() + { + flameshock_timer = 2000; + arcaneshock_timer = 4000; + frostshock_timer = 6000; + shadowshock_timer = 8000; + chainlightning_timer = 15000; + + summon90 = false; + summon50 = false; + summon10 = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + void SythSummoning() + { + DoScriptText(SAY_SUMMON, m_creature); + + 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 (!UpdateVictim()) + 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* pCreature) +{ + return new boss_darkweaver_sythAI (pCreature); +} + +/* ELEMENTALS */ + +struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI +{ + mob_syth_fireAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 flamebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + flameshock_timer = 2500; + flamebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + 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* pCreature) +{ + return new mob_syth_fireAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI +{ + mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 arcaneshock_timer; + uint32 arcanebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + arcaneshock_timer = 2500; + arcanebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + 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* pCreature) +{ + return new mob_syth_arcaneAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI +{ + mob_syth_frostAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 frostshock_timer; + uint32 frostbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + frostshock_timer = 2500; + frostbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + 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* pCreature) +{ + return new mob_syth_frostAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI +{ + mob_syth_shadowAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 shadowshock_timer; + uint32 shadowbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + shadowshock_timer = 2500; + shadowbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + 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* pCreature) +{ + return new mob_syth_shadowAI (pCreature); +} + +void AddSC_boss_darkweaver_syth() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_darkweaver_syth"; + newscript->GetAI = &GetAI_boss_darkweaver_syth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_fire"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_arcane"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_frost"; + newscript->GetAI = &GetAI_mob_syth_frost; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_shadow"; + newscript->GetAI = &GetAI_mob_syth_shadow; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp new file mode 100644 index 00000000000..7830fc10645 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -0,0 +1,221 @@ +/* Copyright (C) 2006 - 2009 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 -1556007 + +#define SAY_AGGRO_1 -1556008 +#define SAY_AGGRO_2 -1556009 +#define SAY_AGGRO_3 -1556010 + +#define SAY_SLAY_1 -1556011 +#define SAY_SLAY_2 -1556012 +#define SAY_DEATH -1556013 +#define EMOTE_ARCANE_EXP -1556015 + +#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 = c->GetInstanceData(); + } + + 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->isInAccessiblePlaceFor(m_creature)) + { + if (!Intro && m_creature->IsWithinDistInMap(who, 100)) + { + Intro = true; + DoScriptText(SAY_INTRO, 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); + AttackStart(who); + } + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_IKISSDOOREVENT, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + 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 = 7000+rand()%5000; + }else ArcaneVolley_Timer -= diff; + + if (Sheep_Timer < diff) + { + //second top aggro target in normal, random target in heroic correct? + Unit *target = NULL; + target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); + if (target) + 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) + { + DoScriptText(EMOTE_ARCANE_EXP, m_creature); + + 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(); + + DoTeleportTo(X,Y,Z); + + 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* pCreature) +{ + return new boss_talon_king_ikissAI (pCreature); +} + +void AddSC_boss_talon_king_ikiss() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_talon_king_ikiss"; + newscript->GetAI = &GetAI_boss_talon_king_ikiss; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h new file mode 100644 index 00000000000..6156f354d84 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 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 + +enum +{ + DATA_IKISSDOOREVENT = 1, + TYPE_ANZU_ENCOUNTER = 2, +}; +#endif + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp new file mode 100644 index 00000000000..060e09a1325 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2009 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" + +enum +{ + NPC_ANZU = 23035, + IKISS_DOOR = 177203, +}; + +struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance +{ + instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 AnzuEncounter; + uint64 m_uiIkissDoorGUID; + + void Initialize() + { + AnzuEncounter = NOT_STARTED; + m_uiIkissDoorGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) + { + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pCreature->RemoveCorpse(); + } else { + AnzuEncounter = IN_PROGRESS; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (pGo->GetEntry() == IKISS_DOOR) + m_uiIkissDoorGUID = pGo->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_IKISSDOOREVENT: + if (data == DONE) + DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); + break; + case TYPE_ANZU_ENCOUNTER: + AnzuEncounter = data; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) +{ + return new instance_sethekk_halls(pMap); +} + +void AddSC_instance_sethekk_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sethekk_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp new file mode 100644 index 00000000000..66e6b3a108d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp @@ -0,0 +1,217 @@ +/* Copyright (C) 2006 - 2009 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: 80 +SDComment: Enrage spell missing/not known +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "def_shadow_labyrinth.h" + +enum +{ + SAY_INTRO = -1555000, + SAY_AGGRO1 = -1555001, + SAY_AGGRO2 = -1555002, + SAY_AGGRO3 = -1555003, + SAY_HELP = -1555004, + SAY_SLAY1 = -1555005, + SAY_SLAY2 = -1555006, + SAY_DEATH = -1555007, + + SPELL_BANISH = 30231, + SPELL_CORROSIVE_ACID = 33551, + SPELL_FEAR = 33547, + SPELL_ENRAGE = 34970 +}; + +struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI +{ + boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + HeroicMode = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool HeroicMode; + + uint32 EventCheck_Timer; + uint32 CorrosiveAcid_Timer; + uint32 Fear_Timer; + uint32 Enrage_Timer; + bool Intro; + bool IsBanished; + bool Enraged; + + void Reset() + { + EventCheck_Timer = 5000; + CorrosiveAcid_Timer = 5000 + rand()%5000; + Fear_Timer = 25000 + rand()%5000; + Enrage_Timer = 180000; + Intro = false; + IsBanished = true; + Enraged = false; + + if (m_pInstance && m_creature->isAlive()) + { + if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) + m_creature->CastSpell(m_creature, SPELL_BANISH, true); + } + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, FAIL); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_creature->HasAura(SPELL_BANISH)) + return; + + npc_escortAI::MoveInLineOfSight(pWho); + } + + void WaypointReached(uint32 i) + { + } + + void DoIntro() + { + if (m_creature->HasAura(SPELL_BANISH)) + m_creature->RemoveAurasDueToSpell(SPELL_BANISH); + + IsBanished = false; + Intro = true; + + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) + { + DoScriptText(SAY_INTRO, m_creature); + Start(true, false, 0, NULL, false, true); + } + + m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro && !IsBeingEscorted) + { + if (EventCheck_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) + { + DoIntro(); + return; + } + } + EventCheck_Timer = 5000; + return; + } + else + { + EventCheck_Timer -= diff; + return; + } + } + + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (m_creature->HasAura(SPELL_BANISH, 0)) + { + EnterEvadeMode(); + return; + } + + if (CorrosiveAcid_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); + CorrosiveAcid_Timer = 15000 + rand()%10000; + }else CorrosiveAcid_Timer -= diff; + + if (Fear_Timer < diff) + { + DoCast(m_creature,SPELL_FEAR); + Fear_Timer = 20000 + rand()%15000; + }else Fear_Timer -= diff; + + if (HeroicMode) + { + if (!Enraged && Enrage_Timer < diff) + { + DoCast(m_creature,SPELL_ENRAGE); + Enraged = true; + }else Enrage_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) +{ + return new boss_ambassador_hellmawAI(pCreature); +} + +void AddSC_boss_ambassador_hellmaw() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_ambassador_hellmaw"; + newscript->GetAI = &GetAI_boss_ambassador_hellmaw; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp new file mode 100644 index 00000000000..73374c08f8c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp @@ -0,0 +1,177 @@ +/* Copyright (C) 2006 - 2009 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_INTRO1 -1555008 +#define SAY_INTRO2 -1555009 +#define SAY_INTRO3 -1555010 +#define SAY_AGGRO1 -1555011 +#define SAY_AGGRO2 -1555012 +#define SAY_AGGRO3 -1555013 +#define SAY_SLAY1 -1555014 +#define SAY_SLAY2 -1555015 +#define SAY_HELP -1555016 +#define SAY_DEATH -1555017 + +#define SAY2_INTRO1 -1555018 +#define SAY2_INTRO2 -1555019 +#define SAY2_INTRO3 -1555020 +#define SAY2_AGGRO1 -1555021 +#define SAY2_AGGRO2 -1555022 +#define SAY2_AGGRO3 -1555023 +#define SAY2_SLAY1 -1555024 +#define SAY2_SLAY2 -1555025 +#define SAY2_HELP -1555026 +#define SAY2_DEATH -1555027 + +struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI +{ + boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + 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()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + 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 = 15000 + rand()%10000; + }else Charge_Timer -= diff; + + //Knockback_Timer + if (Knockback_Timer < diff) + { + DoCast(m_creature, SPELL_WAR_STOMP); + Knockback_Timer = 18000 + rand()%6000; + }else Knockback_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) +{ + return new boss_blackheart_the_inciterAI (pCreature); +} + +void AddSC_boss_blackheart_the_inciter() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_blackheart_the_inciter"; + newscript->GetAI = &GetAI_boss_blackheart_the_inciter; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp new file mode 100644 index 00000000000..0cc6255f3cf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -0,0 +1,321 @@ +/* Copyright (C) 2006 - 2009 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 -1555028 +#define SAY_AGGRO1 -1555029 +#define SAY_AGGRO2 -1555030 +#define SAY_AGGRO3 -1555031 +#define SAY_HELP -1555032 +#define SAY_SLAY1 -1555033 +#define SAY_SLAY2 -1555034 +#define SAY_DEATH -1555035 + +#define SPELL_RAIN_OF_FIRE 33617 +#define H_SPELL_RAIN_OF_FIRE 39363 + +#define SPELL_DRAW_SHADOWS 33563 +#define SPELL_SHADOWBOLT_VOLLEY 33841 +#define SPELL_BANISH 38791 + +#define MOB_VOID_TRAVELER 19226 +#define SPELL_SACRIFICE 33587 +#define SPELL_SHADOW_NOVA 33846 +#define SPELL_EMPOWERING_SHADOWS 33783 +#define H_SPELL_EMPOWERING_SHADOWS 39364 + +#define MOB_VOID_PORTAL 19224 +#define SPELL_VOID_PORTAL_VISUAL 33569 + +float VorpilPosition[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 mob_voidtravelerAI : public ScriptedAI +{ + mob_voidtravelerAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + Unit *Vorpil; + uint32 move; + bool sacrificed; + + void Reset() + { + Vorpil = NULL; + move = 0; + sacrificed = false; + } + + void EnterCombat(Unit *who){} + + void UpdateAI(const uint32 diff) + { + if (!Vorpil) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + if (move < diff) + { + if (sacrificed) + { + SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); + if (spell) + Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); + Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); + DoCast(m_creature, SPELL_SHADOW_NOVA, true); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); + if (m_creature->IsWithinDist(Vorpil, 3)) + { + DoCast(m_creature, SPELL_SACRIFICE, false); + sacrificed = true; + move = 500; + return; + } + if (!Vorpil->isInCombat() || Vorpil->isDead()) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + move = 1000; + }else move -= diff; + } +}; +CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) +{ + return new mob_voidtravelerAI (pCreature); +} + +struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI +{ + boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Intro = false; + } + + ScriptedInstance *pInstance; + bool Intro, HelpYell; + bool sumportals; + bool HeroicMode; + + uint32 ShadowBoltVolley_Timer; + uint32 DrawShadows_Timer; + uint32 summonTraveler_Timer; + uint32 banish_Timer; + uint64 PortalsGuid[5]; + + void Reset() + { + ShadowBoltVolley_Timer = 7000 + rand()%7000; + DrawShadows_Timer = 45000; + summonTraveler_Timer = 90000; + banish_Timer = 17000; + HelpYell = false; + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); + } + + void summonPortals() + { + if (!sumportals) + { + 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); + if (Portal) + { + PortalsGuid[i] = Portal->GetGUID(); + Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); + } + } + sumportals = true; + summonTraveler_Timer = 5000; + } + } + + void destroyPortals() + { + if (sumportals) + { + for (int i = 0;i < 5; i ++) + { + Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); + if (Portal && Portal->isAlive()) + Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + PortalsGuid[i] = 0; + } + sumportals = false; + } + } + + void spawnVoidTraveler() + { + int pos = rand()%5; + m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); + if (!HelpYell) + { + DoScriptText(SAY_HELP, m_creature); + HelpYell = true; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) + CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + summonPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); + } + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) + { + DoScriptText(SAY_INTRO, m_creature); + Intro = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowBoltVolley_Timer < diff) + { + DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); + ShadowBoltVolley_Timer = 15000 + rand()%15000;; + }else ShadowBoltVolley_Timer -= diff; + + if (HeroicMode && banish_Timer < diff) + { + Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); + if (target) + { + DoCast(target,SPELL_BANISH); + banish_Timer = 16000; + } + }else banish_Timer -= diff; + + if (DrawShadows_Timer < diff) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) + i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); + + m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); + DoCast(m_creature,SPELL_DRAW_SHADOWS,true); + + DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); + + ShadowBoltVolley_Timer = 6000; + DrawShadows_Timer = 30000; + }else DrawShadows_Timer -= diff; + + if (summonTraveler_Timer < diff) + { + spawnVoidTraveler(); + summonTraveler_Timer = 10000; + //enrage at 20% + if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) + summonTraveler_Timer = 5000; + }else summonTraveler_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) +{ + return new boss_grandmaster_vorpilAI (pCreature); +} + +void AddSC_boss_grandmaster_vorpil() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_grandmaster_vorpil"; + newscript->GetAI = &GetAI_boss_grandmaster_vorpil; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_voidtraveler"; + newscript->GetAI = &GetAI_mob_voidtraveler; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp new file mode 100644 index 00000000000..259f6091af6 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp @@ -0,0 +1,207 @@ +/* Copyright (C) 2006 - 2009 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: 90 +SDComment: Timers may be incorrect +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define EMOTE_SONIC_BOOM -1555036 + +#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) +#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) +#define SPELL_RESONANCE 33657 +#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) +#define SPELL_MAGNETIC_PULL 33689 +#define SPELL_SONIC_SHOCK 38797 +#define SPELL_THUNDERING_STORM 39365 + +struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI +{ + boss_murmurAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 SonicBoom_Timer; + uint32 MurmursTouch_Timer; + uint32 Resonance_Timer; + uint32 MagneticPull_Timer; + uint32 SonicShock_Timer; + uint32 ThunderingStorm_Timer; + bool HeroicMode; + bool SonicBoom; + + void Reset() + { + SonicBoom_Timer = 30000; + MurmursTouch_Timer = 8000 + rand()%12000; + Resonance_Timer = 5000; + MagneticPull_Timer = 15000 + rand()%15000; + ThunderingStorm_Timer = 15000; + SonicShock_Timer = 10000; + SonicBoom = false; + + //database should have `RegenHealth`=0 to prevent regen + uint32 hp = (m_creature->GetMaxHealth()*40)/100; + if (hp) m_creature->SetHealth(hp); + m_creature->ResetPlayerDamageReq(); + } + + void SonicBoomEffect() + { + 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) + { + //Not do anything without aura, spell can be resisted! + if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) + { + //This will be wrong calculation. Also, comments suggest it must deal damage + target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); + } + } + } + } + + void EnterCombat(Unit *who) { } + + // Sonic Boom instant damage (needs core fix instead of this) + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) + m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target or casting + if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) + return; + + // Sonic Boom + if (SonicBoom) + { + DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); + SonicBoomEffect(); + + SonicBoom = false; + Resonance_Timer = 1500; + } + if (SonicBoom_Timer < diff) + { + DoScriptText(EMOTE_SONIC_BOOM, m_creature); + DoCast(m_creature, SPELL_SONIC_BOOM_CAST); + SonicBoom_Timer = 30000; + SonicBoom = true; + return; + }else SonicBoom_Timer -= diff; + + // Murmur's Touch + if (MurmursTouch_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) + DoCast(target, SPELL_MURMURS_TOUCH); + MurmursTouch_Timer = 25000 + rand()%10000; + }else MurmursTouch_Timer -= diff; + + // Resonance + if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) + { + if (Resonance_Timer < diff) + { + DoCast(m_creature, SPELL_RESONANCE); + Resonance_Timer = 5000; + }else Resonance_Timer -= diff; + } + + // Magnetic Pull + if (MagneticPull_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + DoCast(target, SPELL_MAGNETIC_PULL); + MagneticPull_Timer = 15000+rand()%15000; + return; + } + MagneticPull_Timer = 500; + }else MagneticPull_Timer -= diff; + + if (HeroicMode) + { + // Thundering Storm + if (ThunderingStorm_Timer < diff) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) + DoCast(target, SPELL_THUNDERING_STORM, true); + ThunderingStorm_Timer = 15000; + }else ThunderingStorm_Timer -= diff; + + // Sonic Shock + if (SonicShock_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) + if (target->isAlive()) + DoCast(target, SPELL_SONIC_SHOCK); + SonicShock_Timer = 10000+rand()%10000; + }else SonicShock_Timer -= diff; + } + + // Select nearest most aggro target if top aggro too far + if (!m_creature->isAttackReady()) + return; + if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) + { + m_creature->TauntApply(target); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_murmur(Creature* pCreature) +{ + return new boss_murmurAI (pCreature); +} + +void AddSC_boss_murmur() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_murmur"; + newscript->GetAI = &GetAI_boss_murmur; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h new file mode 100644 index 00000000000..a78955368bf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h @@ -0,0 +1,15 @@ +/* Copyright (C) 2006 - 2009 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/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp new file mode 100644 index 00000000000..f8f3b73bffa --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -0,0 +1,227 @@ +/* Copyright (C) 2006 - 2009 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 MAX_ENCOUNTER 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* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 m_uiRefectoryDoorGUID; + uint64 m_uiScreamingHallDoorGUID; + + uint64 m_uiGrandmasterVorpil; + uint32 m_uiFelOverseerCount; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiRefectoryDoorGUID = 0; + m_uiScreamingHallDoorGUID = 0; + + m_uiGrandmasterVorpil = 0; + m_uiFelOverseerCount = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case REFECTORY_DOOR: + m_uiRefectoryDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case SCREAMING_HALL_DOOR: + m_uiScreamingHallDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 18732: + m_uiGrandmasterVorpil = pCreature->GetGUID(); + break; + case 18796: + if (pCreature->isAlive()) + { + ++m_uiFelOverseerCount; + debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); + } + break; + } + } + + void SetData(uint32 type, uint32 uiData) + { + switch(type) + { + case TYPE_HELLMAW: + m_auiEncounter[0] = uiData; + break; + + case TYPE_OVERSEER: + if (uiData != DONE) + { + error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); + return; + } + if (m_uiFelOverseerCount) + { + --m_uiFelOverseerCount; + + if (m_uiFelOverseerCount) + debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); + else + { + m_auiEncounter[1] = DONE; + debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + } + } + break; + + case DATA_BLACKHEARTTHEINCITEREVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiRefectoryDoorGUID); + m_auiEncounter[2] = uiData; + break; + + case DATA_GRANDMASTERVORPILEVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiScreamingHallDoorGUID); + m_auiEncounter[3] = uiData; + break; + + case DATA_MURMUREVENT: + m_auiEncounter[4] = uiData; + break; + } + + if (uiData == DONE) + { + if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) + return; + + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HELLMAW: return m_auiEncounter[0]; + case TYPE_OVERSEER: return m_auiEncounter[1]; + case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; + case DATA_MURMUREVENT: return m_auiEncounter[4]; + } + return false; + } + + uint64 GetData64(uint32 identifier) + { + if (identifier == DATA_GRANDMASTERVORPIL) + return m_uiGrandmasterVorpil; + + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) +{ + return new instance_shadow_labyrinth(pMap); +} + +void AddSC_instance_shadow_labyrinth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shadow_labyrinth"; + newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp deleted file mode 100644 index 414804a6576..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* Copyright (C) 2006 - 2009 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) {} - - uint8 myClass; - uint32 Class_Timer; - - void Reset() - { - Class_Timer = 1000; - } - - void EnterCombat(Unit *who) - { } - - void SetMyClass(uint8 myclass) - { - myClass = myclass; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - 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* pCreature) -{ - return new mob_stolen_soulAI (pCreature); -} - -#define SAY_INTRO -1558000 -#define SAY_SUMMON -1558001 - -#define SAY_AGGRO_1 -1558002 -#define SAY_AGGRO_2 -1558003 -#define SAY_AGGRO_3 -1558004 - -#define SAY_ROAR -1558005 -#define SAY_SOUL_CLEAVE -1558006 - -#define SAY_SLAY_1 -1558007 -#define SAY_SLAY_2 -1558008 - -#define SAY_DEATH -1558009 - -#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) - { - HasTaunted = false; - } - - 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 = 15000 + rand()% 5000; - Ribbon_of_Souls_timer = 5000; - StolenSoul_Timer = 25000 + rand()% 10000; - - Avatar_summoned = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - - void EnterCombat(Unit *who) - { - switch (rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); 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->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); - summoned->SetDisplayId(soulmodel); - summoned->setFaction(m_creature->getFaction()); - - if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) - { - - CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); - summoned->AI()->AttackStart(target); - } - } - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch (rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - //When Exarch Maladar is defeated D'ore appear. - m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature, SPELL_SUMMON_AVATAR); - Avatar_summoned = true; - StolenSoul_Timer = 15000 + rand()% 15000; - } - - 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) - DoScriptText(SAY_ROAR, m_creature); - else - DoScriptText(SAY_SOUL_CLEAVE, m_creature); - - soulmodel = target->GetDisplayId(); - soulholder = target->GetGUID(); - soulclass = target->getClass(); - - DoCast(target,SPELL_STOLEN_SOUL); - m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - - StolenSoul_Timer = 20000 + rand()% 10000; - } else StolenSoul_Timer = 1000; - } - }else StolenSoul_Timer -= diff; - - if (Ribbon_of_Souls_timer < diff) - { - if (Unit *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 = 15000 + rand()% 15000; - }else Fear_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) -{ - return new boss_exarch_maladaarAI (pCreature); -} - -#define SPELL_AV_MORTAL_STRIKE 16856 -#define SPELL_AV_SUNDER_ARMOR 16145 - -struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI -{ - mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mortal_Strike_timer; - - void Reset() - { - Mortal_Strike_timer = 10000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Mortal_Strike_timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); - Mortal_Strike_timer = 10000 + rand()%20 * 1000; - } else Mortal_Strike_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) -{ - return new mob_avatar_of_martyredAI (pCreature); -} - -void AddSC_boss_exarch_maladaar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_exarch_maladaar"; - newscript->GetAI = &GetAI_boss_exarch_maladaar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_avatar_of_martyred"; - newscript->GetAI = &GetAI_mob_avatar_of_martyred; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_stolen_soul"; - newscript->GetAI = &GetAI_mob_stolen_soul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp deleted file mode 100644 index 4dfdd407731..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* Copyright (C) 2006 - 2009 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 -Name: Boss_Shirrak_the_dead_watcher -%Complete: 80 -Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented -Category: Auchindoun, Auchenai Crypts -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_INHIBITMAGIC 32264 -#define SPELL_ATTRACTMAGIC 32265 -#define N_SPELL_CARNIVOROUSBITE 36383 -#define H_SPELL_CARNIVOROUSBITE 39382 -#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) - -#define ENTRY_FOCUS_FIRE 18374 - -#define N_SPELL_FIERY_BLAST 32302 -#define H_SPELL_FIERY_BLAST 38382 -#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) -#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual - -struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI -{ - boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 Inhibitmagic_Timer; - uint32 Attractmagic_Timer; - uint32 Carnivorousbite_Timer; - uint32 FocusFire_Timer; - bool HeroicMode; - Unit *focusedTarget; - - void Reset() - { - Inhibitmagic_Timer = 0; - Attractmagic_Timer = 28000; - Carnivorousbite_Timer = 10000; - FocusFire_Timer = 17000; - focusedTarget = NULL; - } - - void EnterCombat(Unit *who) - { } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) - { - summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); - summoned->setFaction(m_creature->getFaction()); - summoned->SetLevel(m_creature->getLevel()); - summoned->addUnitState(UNIT_STAT_ROOT); - - if (focusedTarget) - summoned->AI()->AttackStart(focusedTarget); - } - } - - void UpdateAI(const uint32 diff) - { - //Inhibitmagic_Timer - if (Inhibitmagic_Timer < diff) - { - float dist; - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) - { - i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 35) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 25) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 15) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - } - Inhibitmagic_Timer = 3000+(rand()%1000); - }else Inhibitmagic_Timer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Attractmagic_Timer - if (Attractmagic_Timer < diff) - { - DoCast(m_creature,SPELL_ATTRACTMAGIC); - Attractmagic_Timer = 30000; - Carnivorousbite_Timer = 1500; - }else Attractmagic_Timer -= diff; - - //Carnivorousbite_Timer - if (Carnivorousbite_Timer < diff) - { - DoCast(m_creature,SPELL_CARNIVOROUSBITE); - Carnivorousbite_Timer = 10000; - }else Carnivorousbite_Timer -= diff; - - //FocusFire_Timer - if (FocusFire_Timer < diff) - { - // Summon Focus Fire & Emote - Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - focusedTarget = target; - m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); - - // TODO: Find better way to handle emote - // Emote - std::string *emote = new std::string("focuses on "); - emote->append(target->GetName()); - emote->append("!"); - const char* text = emote->c_str(); - m_creature->MonsterTextEmote(text, 0, true); - delete emote; - } - FocusFire_Timer = 15000+(rand()%5000); - }else FocusFire_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) -{ - return new boss_shirrak_the_dead_watcherAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI -{ - mob_focus_fireAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 FieryBlast_Timer; - bool fiery1, fiery2; - - void Reset() - { - FieryBlast_Timer = 3000+(rand()%1000); - fiery1 = fiery2 = true; - } - - void EnterCombat(Unit *who) - { } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FieryBlast_Timer - if (fiery2 && FieryBlast_Timer < diff) - { - DoCast(m_creature,SPELL_FIERY_BLAST); - - if (fiery1) fiery1 = false; - else if (fiery2) fiery2 = false; - - FieryBlast_Timer = 1000; - }else FieryBlast_Timer -= diff; - - //DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) -{ - return new mob_focus_fireAI (pCreature); -} - -void AddSC_boss_shirrak_the_dead_watcher() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_shirrak_the_dead_watcher"; - newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_focus_fire"; - newscript->GetAI = &GetAI_mob_focus_fire; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp deleted file mode 100644 index dcaaefee8c2..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* Copyright (C) 2006 - 2009 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" - -enum -{ - SAY_INTRO = -1557000, - SAY_AGGRO_1 = -1557001, - SAY_AGGRO_2 = -1557002, - SAY_AGGRO_3 = -1557003, - SAY_SLAY_1 = -1557004, - SAY_SLAY_2 = -1557005, - SAY_SUMMON = -1557006, - SAY_DEAD = -1557007, - - SPELL_BLINK = 34605, - SPELL_FROSTBOLT = 32364, - SPELL_FIREBALL = 32363, - SPELL_FROSTNOVA = 32365, - - SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON - SPELL_ETHEREAL_BEACON_VISUAL = 32368, - - NPC_BEACON = 18431, - NPC_SHAFFAR = 18344, - - NR_INITIAL_BEACONS = 3 -}; - -struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI -{ - boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } - - uint32 Blink_Timer; - uint32 Beacon_Timer; - uint32 FireBall_Timer; - uint32 Frostbolt_Timer; - uint32 FrostNova_Timer; - - SummonList summons; - - bool HasTaunted; - bool CanBlink; - - void Reset() - { - Blink_Timer = 1500; - Beacon_Timer = 10000; - FireBall_Timer = 8000; - Frostbolt_Timer = 4000; - FrostNova_Timer = 15000; - - CanBlink = false; - - float dist = 8.0f; - float posX, posY, posZ, angle; - m_creature->GetHomePosition(posX, posY, posZ, angle); - - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - } - - void EnterEvadeMode() - { - summons.DespawnAll(); - ScriptedAI::EnterEvadeMode(); - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - DoZoneInCombat(); - summons.DoZoneInCombat(); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == NPC_BEACON) - { - summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature *summon) - { - summons.Despawn(summon); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEAD, m_creature); - summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - 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); - - //expire movement, will prevent from running right back to victim after cast - //(but should MoveChase be used again at a certain time or should he not move?) - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - m_creature->GetMotionMaster()->MovementExpired(); - - 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)) - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); - - Beacon_Timer = 10000; - }else Beacon_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) -{ - return new boss_nexusprince_shaffarAI (pCreature); -} - -enum -{ - SPELL_ARCANE_BOLT = 15254, - 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(); - } - - bool HeroicMode; - uint32 Apprentice_Timer; - uint32 ArcaneBolt_Timer; - uint32 Check_Timer; - - void KillSelf() - { - m_creature->Kill(m_creature); - } - - void Reset() - { - Apprentice_Timer = (HeroicMode ? 10000 : 20000); - ArcaneBolt_Timer = 1000; - Check_Timer = 1000; - } - - void EnterCombat(Unit *who) - { - // Send Shaffar to fight - Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead()) - { - KillSelf(); - return; - } - if (!Shaffar->isInCombat()) - Shaffar->AI()->AttackStart(who); - } - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature->getVictim()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Check_Timer < diff) - { - Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) - { - KillSelf(); - return; - } - Check_Timer = 1000; - }else Check_Timer -= diff; - - if (ArcaneBolt_Timer < diff) - { - DoCast(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); - m_creature->ForcedDespawn(); - return; - }else Apprentice_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) -{ - return new mob_ethereal_beaconAI (pCreature); -} - -enum -{ - SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, - SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 -}; - -struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI -{ - mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cast_Timer; - - bool isFireboltTurn; - - void Reset() - { - Cast_Timer = 3000; - isFireboltTurn = true; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cast_Timer < diff) - { - if (isFireboltTurn) - { - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); - isFireboltTurn = false; - }else{ - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); - isFireboltTurn = true; - } - Cast_Timer = 3000; - }else Cast_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) -{ - return new mob_ethereal_apprenticeAI (pCreature); -} - -void AddSC_boss_nexusprince_shaffar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_nexusprince_shaffar"; - newscript->GetAI = &GetAI_boss_nexusprince_shaffar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_beacon"; - newscript->GetAI = &GetAI_mob_ethereal_beacon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_apprentice"; - newscript->GetAI = &GetAI_mob_ethereal_apprentice; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp deleted file mode 100644 index 77e1c535340..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* Copyright (C) 2006 - 2009 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 -1557008 -#define SAY_AGGRO_2 -1557009 -#define SAY_AGGRO_3 -1557010 - -#define SAY_KILL_1 -1557011 -#define SAY_KILL_2 -1557012 - -#define SAY_DEATH -1557013 - -#define EMOTE_DARK_SHELL -1557014 - -#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(); - } - - bool HeroicMode; - uint32 VoidBlast_Timer; - uint32 DarkShell_Timer; - uint32 VoidBlast_Counter; - - void Reset() - { - VoidBlast_Timer = 8000+rand()%15000; - DarkShell_Timer = 20000; - VoidBlast_Counter = 0; - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - 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 = 15000+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); - - DoScriptText(EMOTE_DARK_SHELL, m_creature); - - DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); - DarkShell_Timer = 20000; - }else DarkShell_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) -{ - return new boss_pandemoniusAI (pCreature); -} - -void AddSC_boss_pandemonius() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_pandemonius"; - newscript->GetAI = &GetAI_boss_pandemonius; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp deleted file mode 100644 index 00e43fa257d..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/* Copyright (C) 2006 - 2009 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 partly implemented. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" - -#define SAY_SUMMON -1556000 - -#define SAY_AGGRO_1 -1556001 -#define SAY_AGGRO_2 -1556002 -#define SAY_AGGRO_3 -1556003 - -#define SAY_SLAY_1 -1556004 -#define SAY_SLAY_2 -1556005 - -#define SAY_DEATH -1556006 - -#define SPELL_FROST_SHOCK 21401 //37865 -#define SPELL_FLAME_SHOCK 34354 -#define SPELL_SHADOW_SHOCK 30138 -#define SPELL_ARCANE_SHOCK 37132 - -#define SPELL_CHAIN_LIGHTNING 15659 //15305 - -#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 (HeroicMode?38141:33526) -#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) -#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) -#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) - -struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI -{ - boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 arcaneshock_timer; - uint32 frostshock_timer; - uint32 shadowshock_timer; - uint32 chainlightning_timer; - - bool summon90; - bool summon50; - bool summon10; - bool HeroicMode; - - void Reset() - { - flameshock_timer = 2000; - arcaneshock_timer = 4000; - frostshock_timer = 6000; - shadowshock_timer = 8000; - chainlightning_timer = 15000; - - summon90 = false; - summon50 = false; - summon10 = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - void SythSummoning() - { - DoScriptText(SAY_SUMMON, m_creature); - - 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 (!UpdateVictim()) - 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* pCreature) -{ - return new boss_darkweaver_sythAI (pCreature); -} - -/* ELEMENTALS */ - -struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI -{ - mob_syth_fireAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 flamebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - flameshock_timer = 2500; - flamebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - 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* pCreature) -{ - return new mob_syth_fireAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI -{ - mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 arcaneshock_timer; - uint32 arcanebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - arcaneshock_timer = 2500; - arcanebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - 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* pCreature) -{ - return new mob_syth_arcaneAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI -{ - mob_syth_frostAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 frostshock_timer; - uint32 frostbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - frostshock_timer = 2500; - frostbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - 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* pCreature) -{ - return new mob_syth_frostAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI -{ - mob_syth_shadowAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 shadowshock_timer; - uint32 shadowbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - shadowshock_timer = 2500; - shadowbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - 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* pCreature) -{ - return new mob_syth_shadowAI (pCreature); -} - -void AddSC_boss_darkweaver_syth() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_darkweaver_syth"; - newscript->GetAI = &GetAI_boss_darkweaver_syth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_fire"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_arcane"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_frost"; - newscript->GetAI = &GetAI_mob_syth_frost; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_shadow"; - newscript->GetAI = &GetAI_mob_syth_shadow; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp deleted file mode 100644 index 7830fc10645..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* Copyright (C) 2006 - 2009 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 -1556007 - -#define SAY_AGGRO_1 -1556008 -#define SAY_AGGRO_2 -1556009 -#define SAY_AGGRO_3 -1556010 - -#define SAY_SLAY_1 -1556011 -#define SAY_SLAY_2 -1556012 -#define SAY_DEATH -1556013 -#define EMOTE_ARCANE_EXP -1556015 - -#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 = c->GetInstanceData(); - } - - 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->isInAccessiblePlaceFor(m_creature)) - { - if (!Intro && m_creature->IsWithinDistInMap(who, 100)) - { - Intro = true; - DoScriptText(SAY_INTRO, 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); - AttackStart(who); - } - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_IKISSDOOREVENT, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - 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 = 7000+rand()%5000; - }else ArcaneVolley_Timer -= diff; - - if (Sheep_Timer < diff) - { - //second top aggro target in normal, random target in heroic correct? - Unit *target = NULL; - target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); - if (target) - 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) - { - DoScriptText(EMOTE_ARCANE_EXP, m_creature); - - 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(); - - DoTeleportTo(X,Y,Z); - - 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* pCreature) -{ - return new boss_talon_king_ikissAI (pCreature); -} - -void AddSC_boss_talon_king_ikiss() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_talon_king_ikiss"; - newscript->GetAI = &GetAI_boss_talon_king_ikiss; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h deleted file mode 100644 index 6156f354d84..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 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 - -enum -{ - DATA_IKISSDOOREVENT = 1, - TYPE_ANZU_ENCOUNTER = 2, -}; -#endif - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp deleted file mode 100644 index 060e09a1325..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2006 - 2009 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" - -enum -{ - NPC_ANZU = 23035, - IKISS_DOOR = 177203, -}; - -struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance -{ - instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 AnzuEncounter; - uint64 m_uiIkissDoorGUID; - - void Initialize() - { - AnzuEncounter = NOT_STARTED; - m_uiIkissDoorGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) - { - pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - pCreature->RemoveCorpse(); - } else { - AnzuEncounter = IN_PROGRESS; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (pGo->GetEntry() == IKISS_DOOR) - m_uiIkissDoorGUID = pGo->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_IKISSDOOREVENT: - if (data == DONE) - DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); - break; - case TYPE_ANZU_ENCOUNTER: - AnzuEncounter = data; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) -{ - return new instance_sethekk_halls(pMap); -} - -void AddSC_instance_sethekk_halls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_sethekk_halls"; - newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp deleted file mode 100644 index 66e6b3a108d..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* Copyright (C) 2006 - 2009 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: 80 -SDComment: Enrage spell missing/not known -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "escort_ai.h" -#include "def_shadow_labyrinth.h" - -enum -{ - SAY_INTRO = -1555000, - SAY_AGGRO1 = -1555001, - SAY_AGGRO2 = -1555002, - SAY_AGGRO3 = -1555003, - SAY_HELP = -1555004, - SAY_SLAY1 = -1555005, - SAY_SLAY2 = -1555006, - SAY_DEATH = -1555007, - - SPELL_BANISH = 30231, - SPELL_CORROSIVE_ACID = 33551, - SPELL_FEAR = 33547, - SPELL_ENRAGE = 34970 -}; - -struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI -{ - boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - HeroicMode = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool HeroicMode; - - uint32 EventCheck_Timer; - uint32 CorrosiveAcid_Timer; - uint32 Fear_Timer; - uint32 Enrage_Timer; - bool Intro; - bool IsBanished; - bool Enraged; - - void Reset() - { - EventCheck_Timer = 5000; - CorrosiveAcid_Timer = 5000 + rand()%5000; - Fear_Timer = 25000 + rand()%5000; - Enrage_Timer = 180000; - Intro = false; - IsBanished = true; - Enraged = false; - - if (m_pInstance && m_creature->isAlive()) - { - if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) - m_creature->CastSpell(m_creature, SPELL_BANISH, true); - } - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, FAIL); - } - - void MoveInLineOfSight(Unit* pWho) - { - if (m_creature->HasAura(SPELL_BANISH)) - return; - - npc_escortAI::MoveInLineOfSight(pWho); - } - - void WaypointReached(uint32 i) - { - } - - void DoIntro() - { - if (m_creature->HasAura(SPELL_BANISH)) - m_creature->RemoveAurasDueToSpell(SPELL_BANISH); - - IsBanished = false; - Intro = true; - - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) - { - DoScriptText(SAY_INTRO, m_creature); - Start(true, false, 0, NULL, false, true); - } - - m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!Intro && !IsBeingEscorted) - { - if (EventCheck_Timer < diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) - { - DoIntro(); - return; - } - } - EventCheck_Timer = 5000; - return; - } - else - { - EventCheck_Timer -= diff; - return; - } - } - - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (m_creature->HasAura(SPELL_BANISH, 0)) - { - EnterEvadeMode(); - return; - } - - if (CorrosiveAcid_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); - CorrosiveAcid_Timer = 15000 + rand()%10000; - }else CorrosiveAcid_Timer -= diff; - - if (Fear_Timer < diff) - { - DoCast(m_creature,SPELL_FEAR); - Fear_Timer = 20000 + rand()%15000; - }else Fear_Timer -= diff; - - if (HeroicMode) - { - if (!Enraged && Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enraged = true; - }else Enrage_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) -{ - return new boss_ambassador_hellmawAI(pCreature); -} - -void AddSC_boss_ambassador_hellmaw() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_ambassador_hellmaw"; - newscript->GetAI = &GetAI_boss_ambassador_hellmaw; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp deleted file mode 100644 index 73374c08f8c..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (C) 2006 - 2009 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_INTRO1 -1555008 -#define SAY_INTRO2 -1555009 -#define SAY_INTRO3 -1555010 -#define SAY_AGGRO1 -1555011 -#define SAY_AGGRO2 -1555012 -#define SAY_AGGRO3 -1555013 -#define SAY_SLAY1 -1555014 -#define SAY_SLAY2 -1555015 -#define SAY_HELP -1555016 -#define SAY_DEATH -1555017 - -#define SAY2_INTRO1 -1555018 -#define SAY2_INTRO2 -1555019 -#define SAY2_INTRO3 -1555020 -#define SAY2_AGGRO1 -1555021 -#define SAY2_AGGRO2 -1555022 -#define SAY2_AGGRO3 -1555023 -#define SAY2_SLAY1 -1555024 -#define SAY2_SLAY2 -1555025 -#define SAY2_HELP -1555026 -#define SAY2_DEATH -1555027 - -struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI -{ - boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - 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()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - 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 = 15000 + rand()%10000; - }else Charge_Timer -= diff; - - //Knockback_Timer - if (Knockback_Timer < diff) - { - DoCast(m_creature, SPELL_WAR_STOMP); - Knockback_Timer = 18000 + rand()%6000; - }else Knockback_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) -{ - return new boss_blackheart_the_inciterAI (pCreature); -} - -void AddSC_boss_blackheart_the_inciter() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_blackheart_the_inciter"; - newscript->GetAI = &GetAI_boss_blackheart_the_inciter; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp deleted file mode 100644 index 0cc6255f3cf..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/* Copyright (C) 2006 - 2009 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 -1555028 -#define SAY_AGGRO1 -1555029 -#define SAY_AGGRO2 -1555030 -#define SAY_AGGRO3 -1555031 -#define SAY_HELP -1555032 -#define SAY_SLAY1 -1555033 -#define SAY_SLAY2 -1555034 -#define SAY_DEATH -1555035 - -#define SPELL_RAIN_OF_FIRE 33617 -#define H_SPELL_RAIN_OF_FIRE 39363 - -#define SPELL_DRAW_SHADOWS 33563 -#define SPELL_SHADOWBOLT_VOLLEY 33841 -#define SPELL_BANISH 38791 - -#define MOB_VOID_TRAVELER 19226 -#define SPELL_SACRIFICE 33587 -#define SPELL_SHADOW_NOVA 33846 -#define SPELL_EMPOWERING_SHADOWS 33783 -#define H_SPELL_EMPOWERING_SHADOWS 39364 - -#define MOB_VOID_PORTAL 19224 -#define SPELL_VOID_PORTAL_VISUAL 33569 - -float VorpilPosition[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 mob_voidtravelerAI : public ScriptedAI -{ - mob_voidtravelerAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - Unit *Vorpil; - uint32 move; - bool sacrificed; - - void Reset() - { - Vorpil = NULL; - move = 0; - sacrificed = false; - } - - void EnterCombat(Unit *who){} - - void UpdateAI(const uint32 diff) - { - if (!Vorpil) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - if (move < diff) - { - if (sacrificed) - { - SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); - if (spell) - Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); - Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); - DoCast(m_creature, SPELL_SHADOW_NOVA, true); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); - if (m_creature->IsWithinDist(Vorpil, 3)) - { - DoCast(m_creature, SPELL_SACRIFICE, false); - sacrificed = true; - move = 500; - return; - } - if (!Vorpil->isInCombat() || Vorpil->isDead()) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - move = 1000; - }else move -= diff; - } -}; -CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) -{ - return new mob_voidtravelerAI (pCreature); -} - -struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI -{ - boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Intro = false; - } - - ScriptedInstance *pInstance; - bool Intro, HelpYell; - bool sumportals; - bool HeroicMode; - - uint32 ShadowBoltVolley_Timer; - uint32 DrawShadows_Timer; - uint32 summonTraveler_Timer; - uint32 banish_Timer; - uint64 PortalsGuid[5]; - - void Reset() - { - ShadowBoltVolley_Timer = 7000 + rand()%7000; - DrawShadows_Timer = 45000; - summonTraveler_Timer = 90000; - banish_Timer = 17000; - HelpYell = false; - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); - } - - void summonPortals() - { - if (!sumportals) - { - 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); - if (Portal) - { - PortalsGuid[i] = Portal->GetGUID(); - Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); - } - } - sumportals = true; - summonTraveler_Timer = 5000; - } - } - - void destroyPortals() - { - if (sumportals) - { - for (int i = 0;i < 5; i ++) - { - Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); - if (Portal && Portal->isAlive()) - Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - PortalsGuid[i] = 0; - } - sumportals = false; - } - } - - void spawnVoidTraveler() - { - int pos = rand()%5; - m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); - if (!HelpYell) - { - DoScriptText(SAY_HELP, m_creature); - HelpYell = true; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) - CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - summonPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); - } - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) - { - DoScriptText(SAY_INTRO, m_creature); - Intro = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowBoltVolley_Timer < diff) - { - DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); - ShadowBoltVolley_Timer = 15000 + rand()%15000;; - }else ShadowBoltVolley_Timer -= diff; - - if (HeroicMode && banish_Timer < diff) - { - Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); - if (target) - { - DoCast(target,SPELL_BANISH); - banish_Timer = 16000; - } - }else banish_Timer -= diff; - - if (DrawShadows_Timer < diff) - { - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) - i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); - - m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); - DoCast(m_creature,SPELL_DRAW_SHADOWS,true); - - DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); - - ShadowBoltVolley_Timer = 6000; - DrawShadows_Timer = 30000; - }else DrawShadows_Timer -= diff; - - if (summonTraveler_Timer < diff) - { - spawnVoidTraveler(); - summonTraveler_Timer = 10000; - //enrage at 20% - if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) - summonTraveler_Timer = 5000; - }else summonTraveler_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) -{ - return new boss_grandmaster_vorpilAI (pCreature); -} - -void AddSC_boss_grandmaster_vorpil() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_grandmaster_vorpil"; - newscript->GetAI = &GetAI_boss_grandmaster_vorpil; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_voidtraveler"; - newscript->GetAI = &GetAI_mob_voidtraveler; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp deleted file mode 100644 index 259f6091af6..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (C) 2006 - 2009 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: 90 -SDComment: Timers may be incorrect -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define EMOTE_SONIC_BOOM -1555036 - -#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) -#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) -#define SPELL_RESONANCE 33657 -#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) -#define SPELL_MAGNETIC_PULL 33689 -#define SPELL_SONIC_SHOCK 38797 -#define SPELL_THUNDERING_STORM 39365 - -struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI -{ - boss_murmurAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 SonicBoom_Timer; - uint32 MurmursTouch_Timer; - uint32 Resonance_Timer; - uint32 MagneticPull_Timer; - uint32 SonicShock_Timer; - uint32 ThunderingStorm_Timer; - bool HeroicMode; - bool SonicBoom; - - void Reset() - { - SonicBoom_Timer = 30000; - MurmursTouch_Timer = 8000 + rand()%12000; - Resonance_Timer = 5000; - MagneticPull_Timer = 15000 + rand()%15000; - ThunderingStorm_Timer = 15000; - SonicShock_Timer = 10000; - SonicBoom = false; - - //database should have `RegenHealth`=0 to prevent regen - uint32 hp = (m_creature->GetMaxHealth()*40)/100; - if (hp) m_creature->SetHealth(hp); - m_creature->ResetPlayerDamageReq(); - } - - void SonicBoomEffect() - { - 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) - { - //Not do anything without aura, spell can be resisted! - if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) - { - //This will be wrong calculation. Also, comments suggest it must deal damage - target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); - } - } - } - } - - void EnterCombat(Unit *who) { } - - // Sonic Boom instant damage (needs core fix instead of this) - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) - m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target or casting - if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) - return; - - // Sonic Boom - if (SonicBoom) - { - DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); - SonicBoomEffect(); - - SonicBoom = false; - Resonance_Timer = 1500; - } - if (SonicBoom_Timer < diff) - { - DoScriptText(EMOTE_SONIC_BOOM, m_creature); - DoCast(m_creature, SPELL_SONIC_BOOM_CAST); - SonicBoom_Timer = 30000; - SonicBoom = true; - return; - }else SonicBoom_Timer -= diff; - - // Murmur's Touch - if (MurmursTouch_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) - DoCast(target, SPELL_MURMURS_TOUCH); - MurmursTouch_Timer = 25000 + rand()%10000; - }else MurmursTouch_Timer -= diff; - - // Resonance - if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) - { - if (Resonance_Timer < diff) - { - DoCast(m_creature, SPELL_RESONANCE); - Resonance_Timer = 5000; - }else Resonance_Timer -= diff; - } - - // Magnetic Pull - if (MagneticPull_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - DoCast(target, SPELL_MAGNETIC_PULL); - MagneticPull_Timer = 15000+rand()%15000; - return; - } - MagneticPull_Timer = 500; - }else MagneticPull_Timer -= diff; - - if (HeroicMode) - { - // Thundering Storm - if (ThunderingStorm_Timer < diff) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) - DoCast(target, SPELL_THUNDERING_STORM, true); - ThunderingStorm_Timer = 15000; - }else ThunderingStorm_Timer -= diff; - - // Sonic Shock - if (SonicShock_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) - if (target->isAlive()) - DoCast(target, SPELL_SONIC_SHOCK); - SonicShock_Timer = 10000+rand()%10000; - }else SonicShock_Timer -= diff; - } - - // Select nearest most aggro target if top aggro too far - if (!m_creature->isAttackReady()) - return; - if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) - { - m_creature->TauntApply(target); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_murmur(Creature* pCreature) -{ - return new boss_murmurAI (pCreature); -} - -void AddSC_boss_murmur() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_murmur"; - newscript->GetAI = &GetAI_boss_murmur; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h deleted file mode 100644 index a78955368bf..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (C) 2006 - 2009 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/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp deleted file mode 100644 index f8f3b73bffa..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* Copyright (C) 2006 - 2009 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 MAX_ENCOUNTER 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* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 m_uiRefectoryDoorGUID; - uint64 m_uiScreamingHallDoorGUID; - - uint64 m_uiGrandmasterVorpil; - uint32 m_uiFelOverseerCount; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiRefectoryDoorGUID = 0; - m_uiScreamingHallDoorGUID = 0; - - m_uiGrandmasterVorpil = 0; - m_uiFelOverseerCount = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case REFECTORY_DOOR: - m_uiRefectoryDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case SCREAMING_HALL_DOOR: - m_uiScreamingHallDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 18732: - m_uiGrandmasterVorpil = pCreature->GetGUID(); - break; - case 18796: - if (pCreature->isAlive()) - { - ++m_uiFelOverseerCount; - debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); - } - break; - } - } - - void SetData(uint32 type, uint32 uiData) - { - switch(type) - { - case TYPE_HELLMAW: - m_auiEncounter[0] = uiData; - break; - - case TYPE_OVERSEER: - if (uiData != DONE) - { - error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); - return; - } - if (m_uiFelOverseerCount) - { - --m_uiFelOverseerCount; - - if (m_uiFelOverseerCount) - debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); - else - { - m_auiEncounter[1] = DONE; - debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); - } - } - break; - - case DATA_BLACKHEARTTHEINCITEREVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiRefectoryDoorGUID); - m_auiEncounter[2] = uiData; - break; - - case DATA_GRANDMASTERVORPILEVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiScreamingHallDoorGUID); - m_auiEncounter[3] = uiData; - break; - - case DATA_MURMUREVENT: - m_auiEncounter[4] = uiData; - break; - } - - if (uiData == DONE) - { - if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) - return; - - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HELLMAW: return m_auiEncounter[0]; - case TYPE_OVERSEER: return m_auiEncounter[1]; - case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; - case DATA_MURMUREVENT: return m_auiEncounter[4]; - } - return false; - } - - uint64 GetData64(uint32 identifier) - { - if (identifier == DATA_GRANDMASTERVORPIL) - return m_uiGrandmasterVorpil; - - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) -{ - return new instance_shadow_labyrinth(pMap); -} - -void AddSC_instance_shadow_labyrinth() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shadow_labyrinth"; - newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp index 081c80c56e5..ebf5484671c 100644 --- a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp @@ -84,8 +84,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance bool IsEncounterInProgress() const { for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; + if (m_auiEncounter[i] == IN_PROGRESS) return true; return false; } diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 024fbe7b7a1..236dab3bfcc 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -307,14 +307,14 @@ extern void AddSC_wintergrasp(); extern void AddSC_zuldrak(); //outland -extern void AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts +extern void AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts extern void AddSC_boss_shirrak_the_dead_watcher(); -extern void AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs +extern void AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs extern void AddSC_boss_pandemonius(); -extern void AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls +extern void AddSC_boss_darkweaver_syth(); //Auchindoun Sekketh Halls extern void AddSC_boss_talon_king_ikiss(); extern void AddSC_instance_sethekk_halls(); -extern void AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth +extern void AddSC_instance_shadow_labyrinth(); //Auchindoun Shadow Labyrinth extern void AddSC_boss_ambassador_hellmaw(); extern void AddSC_boss_blackheart_the_inciter(); extern void AddSC_boss_grandmaster_vorpil(); @@ -693,14 +693,14 @@ void AddScripts() AddSC_zuldrak(); //outland - AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts + AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts AddSC_boss_shirrak_the_dead_watcher(); - AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs + AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs AddSC_boss_pandemonius(); - AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls + AddSC_boss_darkweaver_syth(); //Auchindoun Sekketh Halls AddSC_boss_talon_king_ikiss(); AddSC_instance_sethekk_halls(); - AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth + AddSC_instance_shadow_labyrinth(); //Auchindoun Shadow Labyrinth AddSC_boss_ambassador_hellmaw(); AddSC_boss_blackheart_the_inciter(); AddSC_boss_grandmaster_vorpil(); -- cgit v1.2.3