Skip to content

Instantly share code, notes, and snippets.

@FALL1N1
Forked from SymbolixDEV/Gunship.patch
Created May 18, 2013 13:08
Show Gist options
  • Save FALL1N1/5604355 to your computer and use it in GitHub Desktop.
Save FALL1N1/5604355 to your computer and use it in GitHub Desktop.
From: Updated by: Toba and Baeumchen (maddin)
Fixed Error by : SymbolixDEV!
Date: Mon, 29 Apr 2013 04:37:58 +0300
Gunship Battle
---
src/server/scripts/Northrend/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt
index 1da1e4a..03831e5 100644
--- a/src/server/scripts/Northrend/CMakeLists.txt
+++ b/src/server/scripts/Northrend/CMakeLists.txt
@@ -176,6 +176,7 @@ set(scripts_STAT_SRCS
Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
Northrend/IcecrownCitadel/boss_sindragosa.cpp
Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+ Northrend/IcecrownCitadel/boss_gunship_battle.cpp
Northrend/zone_zuldrak.cpp
Northrend/zone_icecrown.cpp
Northrend/Gundrak/boss_slad_ran.cpp
--
1.8.1.msysgit.1
From 70da41c0033e3197830d43bfce96a170c93facc7 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:38:50 +0300
Subject: [PATCH 02/14] Update icecrown_citadel.cpp
---
.../Northrend/IcecrownCitadel/icecrown_citadel.cpp | 260 ++++++++++++++++++++-
1 file changed, 249 insertions(+), 11 deletions(-)
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index 3ffa6a0..b7092b1 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -1,18 +1,21 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 Trinity <http://www.trinitycore.org/>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
+ * 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.
+ * 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, see <http://www.gnu.org/licenses/>.
+ * 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
+ *
+ * Updated by: Toba and Baeumchen (maddin)
*/
#include "ObjectMgr.h"
@@ -255,6 +258,11 @@ enum EventTypes
// Invisible Stalker (Float, Uninteractible, LargeAOI)
EVENT_SOUL_MISSILE = 55,
+
+ // Sindragosas Ward
+ EVENT_SUB_WAVE_1 = 56,
+ EVENT_SUB_WAVE_2 = 57,
+ EVENT_UPDATE_CHECK = 58,
};
enum DataTypesICC
@@ -285,6 +293,25 @@ enum MovementPoints
POINT_LAND = 1,
};
+const Position SvalnaLandPos = {4356.71f, 2484.33f, 358.5f, 1.571f};
+
+const Position SindragosaGauntletSpawn[12] =
+{
+ { 4130.71f, 2484.10f, 211.033f, 0 },
+ { 4137.93f, 2505.52f, 211.033f, 0 },
+ { 4160.64f, 2528.13f, 211.033f, 0 },
+ { 4180.81f, 2533.88f, 211.033f, 0 },
+ { 4200.92f, 2527.18f, 211.033f, 0 },
+ { 4222.23f, 2503.56f, 211.033f, 0 },
+ { 4229.40f, 2484.63f, 211.033f, 0 },
+ { 4222.01f, 2464.93f, 211.033f, 0 },
+ { 4201.55f, 2441.03f, 211.033f, 0 },
+ { 4181.29f, 2433.38f, 211.033f, 0 },
+ { 4161.86f, 2441.94f, 211.033f, 0 },
+ { 4138.78f, 2463.95f, 211.033f, 0 },
+};
+
+
class FrostwingVrykulSearcher
{
public:
@@ -2136,6 +2163,215 @@ class at_icc_start_frostwing_gauntlet : public AreaTriggerScript
}
};
+class npc_sindragosas_ward : public CreatureScript
+{
+ public:
+ npc_sindragosas_ward() : CreatureScript("npc_sindragosas_ward") { }
+
+ struct npc_sindragosas_wardAI : public BossAI
+ {
+ npc_sindragosas_wardAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA_GAUNTLET)
+ {
+ }
+
+ void Reset()
+ {
+ _Reset();
+ _isEventInProgressOrDone = false;
+ _spawnCountToBeSummonedInWave = 0;
+ _waveNumber = 0;
+ }
+
+ void DoAction(int32 action)
+ {
+ if (action == ACTION_START_GAUNTLET)
+ if (!_isEventInProgressOrDone)
+ if (!IsAnyPlayerOutOfRange())
+ DoZoneInCombat(me, 150.0f);
+ }
+
+ void EnterCombat(Unit* /*attacker*/)
+ {
+ _EnterCombat();
+ _isEventInProgressOrDone = true;
+ _spawnCountToBeSummonedInWave = 32;
+ _waveNumber = 1;
+ DoSummonWave(_waveNumber);
+ events.ScheduleEvent(EVENT_SUB_WAVE_1, 10000);
+ events.ScheduleEvent(EVENT_SUB_WAVE_2, 25000);
+ events.ScheduleEvent(EVENT_UPDATE_CHECK, 5000);
+ }
+
+ void DoSummonWave(uint8 number)
+ {
+ switch (number)
+ {
+ case 1:
+ case 3:
+ me->SummonCreature(NPC_NERUBAR_WEBWEAVER, SindragosaGauntletSpawn[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_NERUBAR_WEBWEAVER, SindragosaGauntletSpawn[4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_NERUBAR_WEBWEAVER, SindragosaGauntletSpawn[7], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_NERUBAR_WEBWEAVER, SindragosaGauntletSpawn[10], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_NERUBAR_CHAMPION, SindragosaGauntletSpawn[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_NERUBAR_CHAMPION, SindragosaGauntletSpawn[5], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_NERUBAR_CHAMPION, SindragosaGauntletSpawn[8], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_NERUBAR_CHAMPION, SindragosaGauntletSpawn[11], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ break;
+ case 2:
+ me->SummonCreature(NPC_FROSTWARDEN_SORCERESS, SindragosaGauntletSpawn[3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_FROSTWARDEN_SORCERESS, SindragosaGauntletSpawn[9], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_FROSTWARDEN_WARRIOR, SindragosaGauntletSpawn[3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_FROSTWARDEN_WARRIOR, SindragosaGauntletSpawn[9], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_FROSTWARDEN_WARRIOR, SindragosaGauntletSpawn[3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ me->SummonCreature(NPC_FROSTWARDEN_WARRIOR, SindragosaGauntletSpawn[9], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ break;
+ case EVENT_SUB_WAVE_1:
+ case EVENT_SUB_WAVE_2:
+ for (uint8 i = 0; i < 12; i++)
+ me->SummonCreature(NPC_NERUBAR_BROODLING, SindragosaGauntletSpawn[i], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ break;
+ default:
+ break;
+ }
+ }
+
+ bool IsAnyPlayerOutOfRange()
+ {
+ if (!me->GetMap())
+ return true;
+
+ Map::PlayerList const& playerList = me->GetMap()->GetPlayers();
+
+ if (playerList.isEmpty())
+ return true;
+
+ for (Map::PlayerList::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
+ {
+ if (Player* player = itr->getSource())
+ {
+ if (player->isGameMaster())
+ continue;
+
+ if (player->isAlive() && me->GetDistance(player) > 125.0f)
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ void JustSummoned(Creature* summon)
+ {
+ summons.Summon(summon);
+ DoZoneInCombat(summon, 150.0f);
+ }
+
+ void SummonedCreatureDies(Creature* summon, Unit* /*who*/)
+ {
+ _spawnCountToBeSummonedInWave--;
+ summon->DespawnOrUnsummon(30000);
+ }
+
+ void SummonedCreatureDespawn(Creature* summon)
+ {
+ // This one should never happen, if summoned creature despawns alive, reset!
+ if (summon->isAlive())
+ {
+ EnterEvadeMode();
+ return;
+ }
+
+ summons.Despawn(summon);
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if (!UpdateVictim() || !_isEventInProgressOrDone)
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_SUB_WAVE_1:
+ DoSummonWave(EVENT_SUB_WAVE_1);
+ break;
+ case EVENT_SUB_WAVE_2:
+ DoSummonWave(EVENT_SUB_WAVE_2);
+ break;
+ case EVENT_UPDATE_CHECK:
+ {
+ if (_spawnCountToBeSummonedInWave <= 5)
+ {
+ if (summons.size() < _spawnCountToBeSummonedInWave)
+ _spawnCountToBeSummonedInWave = summons.size();
+
+ if (!_spawnCountToBeSummonedInWave)
+ {
+ switch (_waveNumber)
+ {
+ case 1:
+ _spawnCountToBeSummonedInWave += 30;
+ break;
+ case 2:
+ _spawnCountToBeSummonedInWave += 32;
+ break;
+ case 3:
+ me->Kill(me);
+ return;
+ }
+
+ _waveNumber++;
+ DoSummonWave(_waveNumber);
+ events.ScheduleEvent(EVENT_SUB_WAVE_1, 10000);
+ events.ScheduleEvent(EVENT_SUB_WAVE_2, 25000);
+ }
+ }
+
+ if (IsAnyPlayerOutOfRange())
+ {
+ EnterEvadeMode();
+ return;
+ }
+
+ events.ScheduleEvent(EVENT_UPDATE_CHECK, 5000);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ }
+
+ private:
+ bool _isEventInProgressOrDone;
+ uint32 _spawnCountToBeSummonedInWave;
+ uint8 _waveNumber;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return GetIcecrownCitadelAI<npc_sindragosas_wardAI>(creature);
+ }
+};
+
+class at_icc_start_sindragosa_gauntlet : public AreaTriggerScript
+{
+ public:
+ at_icc_start_sindragosa_gauntlet() : AreaTriggerScript("at_icc_start_sindragosa_gauntlet") { }
+
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/)
+ {
+ if (InstanceScript* instance = player->GetInstanceScript())
+ if (Creature* ward = ObjectAccessor::GetCreature(*player, instance->GetData64(DATA_SINDRAGOSA_GAUNTLET)))
+ ward->AI()->DoAction(ACTION_START_GAUNTLET);
+ return true;
+ }
+};
+
+
void AddSC_icecrown_citadel()
{
new npc_highlord_tirion_fordring_lh();
@@ -2163,4 +2399,6 @@ void AddSC_icecrown_citadel()
new at_icc_shutdown_traps();
new at_icc_start_blood_quickening();
new at_icc_start_frostwing_gauntlet();
+ new npc_sindragosas_ward();
+ new at_icc_start_sindragosa_gauntlet();
}
--
1.8.1.msysgit.1
From 72c4111d543cfe2f1e8e6da1f02f3738d69aace7 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:39:25 +0300
Subject: [PATCH 03/14] Update icecrown_citadel.h
---
.../Northrend/IcecrownCitadel/icecrown_citadel.h | 162 +++++++++++++++------
1 file changed, 121 insertions(+), 41 deletions(-)
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
index 887a31b..c1708d4 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
@@ -1,18 +1,21 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 Trinity <http://www.trinitycore.org/>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
+ * 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.
+ * 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, see <http://www.gnu.org/licenses/>.
+ * 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
+ *
+ * Updated by: Toba and Baeumchen (maddin)
*/
#ifndef ICECROWN_CITADEL_H_
@@ -25,7 +28,7 @@
#define ICCScriptName "instance_icecrown_citadel"
-uint32 const EncounterCount = 13;
+uint32 const EncounterCount = 14;
uint32 const WeeklyNPCs = 9;
uint32 const MaxHeroicAttempts = 50;
@@ -87,35 +90,56 @@ enum DataTypes
DATA_VALITHRIA_DREAMWALKER = 10,
DATA_SINDRAGOSA = 11,
DATA_THE_LICH_KING = 12,
-
+ DATA_SINDRAGOSA_GAUNTLET = 13,
+
// Additional data
- DATA_SAURFANG_EVENT_NPC = 13,
- DATA_BONED_ACHIEVEMENT = 14,
- DATA_OOZE_DANCE_ACHIEVEMENT = 15,
- DATA_PUTRICIDE_TABLE = 16,
- DATA_NAUSEA_ACHIEVEMENT = 17,
- DATA_ORB_WHISPERER_ACHIEVEMENT = 18,
- DATA_PRINCE_KELESETH_GUID = 19,
- DATA_PRINCE_TALDARAM_GUID = 20,
- DATA_PRINCE_VALANAR_GUID = 21,
- DATA_BLOOD_PRINCES_CONTROL = 22,
- DATA_SINDRAGOSA_FROSTWYRMS = 23,
- DATA_SPINESTALKER = 24,
- DATA_RIMEFANG = 25,
- DATA_COLDFLAME_JETS = 26,
- DATA_TEAM_IN_INSTANCE = 27,
- DATA_BLOOD_QUICKENING_STATE = 28,
- DATA_HEROIC_ATTEMPTS = 29,
- DATA_CROK_SCOURGEBANE = 30,
- DATA_CAPTAIN_ARNATH = 31,
- DATA_CAPTAIN_BRANDON = 32,
- DATA_CAPTAIN_GRONDEL = 33,
- DATA_CAPTAIN_RUPERT = 34,
- DATA_VALITHRIA_TRIGGER = 35,
- DATA_VALITHRIA_LICH_KING = 36,
- DATA_HIGHLORD_TIRION_FORDRING = 37,
- DATA_ARTHAS_PLATFORM = 38,
- DATA_TERENAS_MENETHIL = 39,
+ DATA_SAURFANG_EVENT_NPC = 14,
+ DATA_BONED_ACHIEVEMENT = 15,
+ DATA_OOZE_DANCE_ACHIEVEMENT = 16,
+ DATA_PUTRICIDE_TABLE = 17,
+ DATA_NAUSEA_ACHIEVEMENT = 18,
+ DATA_ORB_WHISPERER_ACHIEVEMENT = 19,
+ DATA_PRINCE_KELESETH_GUID = 20,
+ DATA_PRINCE_TALDARAM_GUID = 21,
+ DATA_PRINCE_VALANAR_GUID = 22,
+ DATA_BLOOD_PRINCES_CONTROL = 23,
+ DATA_SINDRAGOSA_FROSTWYRMS = 24,
+ DATA_SPINESTALKER = 25,
+ DATA_RIMEFANG = 26,
+ DATA_COLDFLAME_JETS = 27,
+ DATA_TEAM_IN_INSTANCE = 28,
+ DATA_BLOOD_QUICKENING_STATE = 29,
+ DATA_HEROIC_ATTEMPTS = 30,
+ DATA_CROK_SCOURGEBANE = 31,
+ DATA_CAPTAIN_ARNATH = 32,
+ DATA_CAPTAIN_BRANDON = 33,
+ DATA_CAPTAIN_GRONDEL = 34,
+ DATA_CAPTAIN_RUPERT = 35,
+ DATA_VALITHRIA_TRIGGER = 36,
+ DATA_VALITHRIA_LICH_KING = 37,
+ DATA_HIGHLORD_TIRION_FORDRING = 38,
+ DATA_ARTHAS_PLATFORM = 39,
+ DATA_TERENAS_MENETHIL = 40,
+
+ // Gunship: Data for achievements
+ DATA_BEEN_WAITING_ACHIEVEMENT = 49,
+ DATA_NECK_DEEP_ACHIEVEMENT = 50,
+
+ // Gunship: Data for the fight
+ // The numbering is very high for safety -- custom patch!
+ DATA_FIRST_SQUAD_STATE = 100,
+ DATA_SECOND_SQUAD_STATE = 101,
+ DATA_SPIRE_FROSTWYRM_STATE = 102,
+ DATA_GB_HIGH_OVERLORD_SAURFANG = 103,
+ DATA_GB_MURADIN_BRONZEBEARD = 104,
+ DATA_HIGH_OVERLORD_SAURFANG_NOT_VISUAL = 105,
+ DATA_GB_BATTLE_MAGE = 106,
+ DATA_SKYBREAKER_BOSS = 107,
+ DATA_ORGRIMMAR_HAMMER_BOSS = 108,
+ DATA_MURADIN_BRONZEBEARD_NOT_VISUAL = 109,
+ DATA_MURADIN_BRONZEBEARD = 110,
+ DATA_GUNSHIP_BATTLE = 111,
+ GUID_PLAYER_LOCATION = 112,
};
enum CreaturesIds
@@ -280,7 +304,48 @@ enum CreaturesIds
NPC_WORLD_TRIGGER = 22515,
NPC_WORLD_TRIGGER_INFINITE_AOI = 36171,
NPC_SPIRIT_BOMB = 39189,
- NPC_FROSTMOURNE_TRIGGER = 38584,
+ NPC_FROSTMOURNE_TRIGGER = 38584,
+
+ // Gunship: Ids of NPCs
+ NPC_GB_SKYBREAKER = 37540,
+ NPC_GB_ORGRIMS_HAMMER = 37215,
+ NPC_GB_HIGH_OVERLORD_SAURFANG = 36939,
+ NPC_GB_MURADIN_BRONZEBEARD = 36948,
+ NPC_GB_HIHG_CAPTAIN_JUSTIN_BARTLETT = 37182,
+ NPC_GB_HIGH_OVERLORD_SAURFANG_NOT_VISUAL = 50004,
+ NPC_GB_MURADIN_BRONZEBEARD_NOT_VISUAL = 50006,
+ NPC_GB_SKYBREAKER_SORCERER = 37026,
+ NPC_GB_SKYBREAKER_SORCERERS = 37116,
+ NPC_GB_KORKRON_REAVER = 37920,
+ NPC_GB_KORKRON_REAVERS = 36957,
+ NPC_GB_KORKRON_SERGANTE = 36960,
+ NPC_GB_SKYBREAKER_SERGANTE = 36961,
+ NPC_GB_KORKRON_BATTLE_MAGE = 37117,
+ NPC_GB_SKYBREAKER_MARINE = 36950,
+ NPC_GB_KORKRON_ROCKETEER = 36982,
+ NPC_GB_SKYBREAKER_MORTAR_SOLDIER = 36978,
+ NPC_GB_KORKRON_AXETHROWER = 36968,
+ NPC_GB_SKYBREAKER_RIFLEMAN = 36969,
+ NPC_GB_SKYBREAKER_DECKHAND = 36970,
+ NPC_GB_ZAFOD_BOOMBOX = 37184,
+ NPC_GB_ALLIANCE_CANON = 36838,
+ NPC_GB_HORDE_CANON = 36839,
+ NPC_GB_INVISIBLE_STALKER = 32780,
+ NPC_GB_PORTAL = 37227,
+ NPC_GB_GUNSHIP_HULL = 37547,
+
+ // Gunship: Ids missing from trash
+ NPC_KORKRON_INVOKER = 37033,
+ NPC_SPIRE_FROSTWYRM = 37230,
+ NPC_SKYBREAKER_SORCERER = 37026,
+
+ // Sindragosas Ward
+ NPC_SINDRAGOSAS_WARD = 37503,
+ NPC_NERUBAR_WEBWEAVER = 37502,
+ NPC_NERUBAR_CHAMPION = 37501,
+ NPC_NERUBAR_BROODLING = 37232,
+ NPC_FROSTWARDEN_WARRIOR = 37228,
+ NPC_FROSTWARDEN_SORCERESS = 37229,
// Generic
NPC_INVISIBLE_STALKER = 30298,
@@ -367,6 +432,21 @@ enum GameObjectsIds
GO_FROZEN_LAVAMAN = 202436,
GO_LAVAMAN_PILLARS_CHAINED = 202437,
GO_LAVAMAN_PILLARS_UNCHAINED = 202438,
+
+ //Gunship: Ids of GameObjects
+ GO_ORGRIM_S_HAMMER_HORDE_ICC = 201812,
+ GO_ORGRIM_S_HAMMER_ALLIANCE_ICC = 201581,
+ GO_THE_SKYBREAKER_HORDE_ICC = 201811,
+ GO_THE_SKYBREAKER_ALLIANCE_ICC = 201580,
+ GO_CAPITAN_CHEST_A_10N = 201872,
+ GO_CAPITAN_CHEST_A_25N = 201873,
+ GO_CAPITAN_CHEST_A_10H = 201874,
+ GO_CAPITAN_CHEST_A_25H = 201875,
+ GO_CAPITAN_CHEST_H_10N = 202177,
+ GO_CAPITAN_CHEST_H_25N = 202178,
+ GO_CAPITAN_CHEST_H_10H = 202179,
+ GO_CAPITAN_CHEST_H_25H = 202180,
+
};
enum AchievementCriteriaIds
--
1.8.1.msysgit.1
From e1572337e7fa332a2f7c653c5e18136c365799e8 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:40:08 +0300
Subject: [PATCH 04/14] Update instance_icecrown_citadel.cpp
---
.../IcecrownCitadel/instance_icecrown_citadel.cpp | 328 ++++++++++++++++++++-
1 file changed, 316 insertions(+), 12 deletions(-)
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
index db4ab2f..0dbf14c 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
@@ -1,18 +1,21 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 Trinity <http://www.trinitycore.org/>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
+ * 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.
+ * 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, see <http://www.gnu.org/licenses/>.
+ * 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
+ *
+ * Updated by: Toba and Baeumchen (maddin)
*/
#include "ObjectMgr.h"
@@ -26,6 +29,8 @@
#include "Player.h"
#include "WorldPacket.h"
#include "WorldSession.h"
+#include "MapManager.h"
+#include "Transport.h"
enum EventIds
{
@@ -63,6 +68,7 @@ DoorData const doorData[] =
{GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_02, DATA_VALITHRIA_DREAMWALKER, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_S },
{GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_03, DATA_VALITHRIA_DREAMWALKER, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_N },
{GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_04, DATA_VALITHRIA_DREAMWALKER, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_S },
+ {GO_SINDRAGOSA_ENTRANCE_DOOR, DATA_SINDRAGOSA_GAUNTLET, DOOR_TYPE_PASSAGE, BOUNDARY_N },
{GO_SINDRAGOSA_ENTRANCE_DOOR, DATA_SINDRAGOSA, DOOR_TYPE_ROOM, BOUNDARY_S },
{GO_SINDRAGOSA_SHORTCUT_ENTRANCE_DOOR, DATA_SINDRAGOSA, DOOR_TYPE_PASSAGE, BOUNDARY_E },
{GO_SINDRAGOSA_SHORTCUT_EXIT_DOOR, DATA_SINDRAGOSA, DOOR_TYPE_PASSAGE, BOUNDARY_NONE},
@@ -149,6 +155,19 @@ class instance_icecrown_citadel : public InstanceMapScript
ColdflameJetsState = NOT_STARTED;
BloodQuickeningState = NOT_STARTED;
BloodQuickeningMinutes = 0;
+ // Gunship event
+ FirstSquadState = 0;
+ SecondSquadState = 0;
+ SpireSquadState = 0;
+ SkybreakerBossGUID = 0;
+ OrgrimmarBossGUID = 0;
+ DeathbringerSaurfangGbGUID = 0;
+ MuradinBronzebeardGbGUID = 0;
+ DeathbringerSaurfangNotVisualGUID = 0;
+ MuradinBronzebeardNotVisualGUID = 0;
+ GbBattleMageGUID = 0;
+ isPrepared = false;
+ SindragosasWardGUID = 0;
}
void FillInitialWorldStates(WorldPacket& data)
@@ -164,6 +183,7 @@ class instance_icecrown_citadel : public InstanceMapScript
{
if (!TeamInInstance)
TeamInInstance = player->GetTeam();
+ PrepareGunshipEvent(player); // Spawn Gunship Event
}
void OnCreatureCreate(Creature* creature)
@@ -304,6 +324,31 @@ class instance_icecrown_citadel : public InstanceMapScript
creature->SetCorpseDelay(0);
creature->SetReactState(REACT_PASSIVE);
break;
+ case NPC_SINDRAGOSAS_WARD:
+ SindragosasWardGUID = creature->GetGUID();
+ break;
+ case NPC_GB_SKYBREAKER:
+ SkybreakerBossGUID = creature->GetGUID();
+ break;
+ case NPC_GB_ORGRIMS_HAMMER:
+ OrgrimmarBossGUID = creature->GetGUID();
+ break;
+ case NPC_GB_HIGH_OVERLORD_SAURFANG:
+ DeathbringerSaurfangGbGUID = creature->GetGUID();
+ break;
+ case NPC_GB_MURADIN_BRONZEBEARD:
+ MuradinBronzebeardGbGUID = creature->GetGUID();
+ break;
+ case NPC_GB_HIGH_OVERLORD_SAURFANG_NOT_VISUAL:
+ DeathbringerSaurfangNotVisualGUID = creature->GetGUID();
+ break;
+ case NPC_GB_MURADIN_BRONZEBEARD_NOT_VISUAL:
+ MuradinBronzebeardNotVisualGUID = creature->GetGUID();
+ break;
+ case NPC_GB_SKYBREAKER_SORCERERS:
+ case NPC_GB_KORKRON_BATTLE_MAGE:
+ GbBattleMageGUID = creature->GetGUID();
+ break;
default:
break;
}
@@ -553,6 +598,29 @@ class instance_icecrown_citadel : public InstanceMapScript
if (GetBossState(DATA_THE_LICH_KING) == DONE)
go->SetRespawnTime(7 * DAY);
break;
+ //Gunship: Assignments
+ case NPC_GB_SKYBREAKER:
+ SkybreakerBossGUID = go->GetGUID();
+ break;
+ case NPC_GB_ORGRIMS_HAMMER:
+ OrgrimmarBossGUID = go->GetGUID();
+ break;
+ case NPC_GB_HIGH_OVERLORD_SAURFANG:
+ DeathbringerSaurfangGbGUID = go->GetGUID();
+ break;
+ case NPC_GB_MURADIN_BRONZEBEARD:
+ MuradinBronzebeardGbGUID = go->GetGUID();
+ break;
+ case NPC_GB_HIGH_OVERLORD_SAURFANG_NOT_VISUAL:
+ DeathbringerSaurfangNotVisualGUID = go->GetGUID();
+ break;
+ case NPC_GB_MURADIN_BRONZEBEARD_NOT_VISUAL:
+ MuradinBronzebeardNotVisualGUID = go->GetGUID();
+ break;
+ case NPC_GB_SKYBREAKER_SORCERERS:
+ case NPC_GB_KORKRON_BATTLE_MAGE:
+ GbBattleMageGUID = go->GetGUID();
+ break;
default:
break;
}
@@ -676,6 +744,23 @@ class instance_icecrown_citadel : public InstanceMapScript
return ArthasPlatformGUID;
case DATA_TERENAS_MENETHIL:
return TerenasMenethilGUID;
+ //Gunship: To merge all
+ case DATA_SKYBREAKER_BOSS:
+ return SkybreakerBossGUID;
+ case DATA_ORGRIMMAR_HAMMER_BOSS:
+ return OrgrimmarBossGUID;
+ case DATA_GB_HIGH_OVERLORD_SAURFANG:
+ return DeathbringerSaurfangGbGUID;
+ case DATA_GB_MURADIN_BRONZEBEARD:
+ return MuradinBronzebeardGbGUID;
+ case DATA_HIGH_OVERLORD_SAURFANG_NOT_VISUAL:
+ return DeathbringerSaurfangNotVisualGUID;
+ case DATA_MURADIN_BRONZEBEARD_NOT_VISUAL:
+ return MuradinBronzebeardNotVisualGUID;
+ case DATA_GB_BATTLE_MAGE:
+ return GbBattleMageGUID;
+ case DATA_SINDRAGOSA_GAUNTLET:
+ return SindragosasWardGUID;
default:
break;
}
@@ -691,7 +776,7 @@ class instance_icecrown_citadel : public InstanceMapScript
switch (type)
{
case DATA_LADY_DEATHWHISPER:
- SetBossState(DATA_GUNSHIP_EVENT, state); // TEMP HACK UNTIL GUNSHIP SCRIPTED
+ //SetBossState(DATA_GUNSHIP_EVENT, state); // TEMP HACK UNTIL GUNSHIP SCRIPTED
if (state == DONE)
{
if (GameObject* elevator = instance->GetGameObject(LadyDeathwisperElevatorGUID))
@@ -1257,7 +1342,207 @@ class instance_icecrown_citadel : public InstanceMapScript
break;
}
}
+ // Gunship: this sucks, do it differently
+ void PrepareGunshipEvent(Player* player)
+ {
+ Transport* th;
+ Transport* t;
+ if (GetBossState(DATA_GUNSHIP_EVENT) == DONE)
+ return;
+
+ if(!isPrepared)
+ {
+ if(TeamInInstance == ALLIANCE)
+ {
+ if(th = sMapMgr->LoadTransportInMap(instance, GO_ORGRIM_S_HAMMER_ALLIANCE_ICC, 108000))
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_ORGRIMS_HAMMER, 1.845810f, 1.268872f, 34.526218f, 1.5890f);
+ th->AddNPCPassengerInInstance(NPC_GB_HIGH_OVERLORD_SAURFANG, 37.18615f, 0.00016f, 36.78849f, 3.13683f);
+ th->AddNPCPassengerInInstance(NPC_GB_INVISIBLE_STALKER, 37.18615f, 0.00016f, 36.78849f, 3.13683f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_BATTLE_MAGE, 47.2929f, -4.308941f, 37.5555f, 3.05033f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_BATTLE_MAGE, 47.34621f, 4.032004f, 37.70952f, 3.05033f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_BATTLE_MAGE, 15.03016f, 0.00016f, 37.70952f, 1.55138f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -13.19547f, -27.160213f, 35.47252f, 3.10672f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.33902f, -25.230491f, 33.04052f, 3.00672f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -60.1251f, -1.27014f, 42.8335f, 5.16073f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -48.2651f, 16.78034f, 34.2515f, 0.04292f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -14.8356f, 27.931688f, 33.363f, 1.73231f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 10.2702f, 20.62966f, 35.37483f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 39.32459f, 14.50176f, 36.88428f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 46.17223f, -6.638763f, 37.35444f, 1.32f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 27.4456f, -13.397498f, 36.34746f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 18.16184f, 1.37897f, 35.31705f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.11516f, -0.196236f, 45.15709f, 2.9f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.11844f, -0.19624f, 49.18192f, 1.6f);
+
+ if (instance->ToInstanceMap()->GetMaxPlayers() == 10)
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -3.170555f, 28.30652f, 34.21082f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -12.0928f, 27.65942f, 33.58557f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 14.92804f, 26.18018f, 35.47803f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 24.70331f, 25.36584f, 35.97845f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, -11.44849f, -25.71838f, 33.64343f, 1.49248f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, 12.30336f, -25.69653f, 35.32373f, 1.49248f);
+ }
+ else
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -3.170555f, 28.30652f, 34.21082f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -12.0928f, 27.65942f, 33.58557f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 14.92804f, 26.18018f, 35.47803f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 24.70331f, 25.36584f, 35.97845f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 19.92804f, 27.18018f, 35.47803f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -7.70331f, 28.36584f, 33.88557f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, -11.44849f, -25.71838f, 33.64343f, 1.49248f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, 12.30336f, -25.69653f, 35.32373f, 1.49248f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, -3.44849f, -25.71838f, 34.21082f, 1.49248f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, 3.30336f, -25.69653f, 35.32373f, 1.49248f);
+ }
+ }
+
+ if(t = sMapMgr->LoadTransportInMap(instance, GO_THE_SKYBREAKER_ALLIANCE_ICC, 108000))
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER, -17.156807f, -1.633260f, 20.81273f, 4.52672f);
+ t->AddNPCPassengerInInstance(NPC_GB_MURADIN_BRONZEBEARD, 13.51547f, -0.160213f, 20.87252f, 3.10672f);
+ t->AddNPCPassengerInInstance(NPC_GB_HIHG_CAPTAIN_JUSTIN_BARTLETT, 42.78902f, -0.010491f, 25.24052f, 3.00672f);
+ t->AddNPCPassengerInInstance(NPC_GB_HIGH_OVERLORD_SAURFANG_NOT_VISUAL, -12.9806f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_ZAFOD_BOOMBOX, 18.8042f, 9.907914f, 20.33559f, 3.10672f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_DECKHAND, -64.8423f, 4.4658f, 23.4352f, 2.698897f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_DECKHAND, 35.54972f, 19.93269f, 25.0333f, 4.71242f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_DECKHAND, -36.39837f, 3.13127f, 20.4496f, 1.5708f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_DECKHAND, -36.23974f, -2.75767f, 20.4506f, 4.69496f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_DECKHAND, 41.94677f, 44.08411f, 24.66587f, 1.62032f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 13.51547f, -0.160213f, 20.87252f, 3.10672f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 42.78902f, -0.010491f, 25.24052f, 3.00672f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 14.0551f, 3.65014f, 20.7935f, 3.16073f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 14.0551f, -4.65034f, 20.7915f, 3.04292f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -17.8356f, 0.031688f, 20.823f, 4.73231f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -34.2702f, -26.18966f, 21.37483f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -11.64459f, -19.85176f, 20.88428f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -19.88223f, -6.578763f, 20.57444f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -41.4456f, -7.647498f, 20.49746f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 0.554884f, -1.232897f, 20.53705f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -50.16516f, 9.716236f, 23.58709f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 11.45844f, 16.36624f, 20.54192f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 19.72286f, -2.193787f, 33.06982f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 19.72286f, -2.193787f, 33.06982f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 8.599396f, -28.55855f, 24.79919f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 38.94339f, -33.808f, 25.39618f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 58.15474f, 0.748094f, 41.87663f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 5.607554f, -6.350654f, 34.00357f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 4.780305f, -29.05227f, 35.09634f, 1.6f);
+
+ if (instance->ToInstanceMap()->GetMaxPlayers() == 10)
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -5.15231f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -28.0876f, -22.9462f, 21.659f, 4.72416f);
+ }
+ else
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -5.15231f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -14.9806f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -21.7406f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -28.0876f, -22.9462f, 21.659f, 4.72416f);
+ }
+ }
+ }
+
+ if(TeamInInstance == HORDE)
+ {
+ if(t = sMapMgr->LoadTransportInMap(instance, GO_THE_SKYBREAKER_HORDE_ICC, 77800))
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER, -17.156807f, -1.633260f, 20.81273f, 4.52672f);
+ t->AddNPCPassengerInInstance(NPC_GB_MURADIN_BRONZEBEARD, 13.51547f, -0.160213f, 20.87252f, 3.10672f);
+ t->AddNPCPassengerInInstance(NPC_GB_HIHG_CAPTAIN_JUSTIN_BARTLETT, 42.78902f, -0.010491f, 25.24052f, 3.00672f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_SORCERERS, 14.0551f, 3.65014f, 20.7935f, 3.16073f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_SORCERERS, 14.0551f, -4.65034f, 20.7915f, 3.04292f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_SORCERERS, -17.8356f, 0.031688f, 20.823f, 4.73231f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 13.51547f, -0.160213f, 20.87252f, 3.10672f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 42.78902f, -0.010491f, 25.24052f, 3.00672f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 14.0551f, 3.65014f, 20.7935f, 3.16073f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 14.0551f, -4.65034f, 20.7915f, 3.04292f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -17.8356f, 0.031688f, 20.823f, 4.73231f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -34.2702f, -26.18966f, 21.37483f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -11.64459f, -19.85176f, 20.88428f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -19.88223f, -6.578763f, 20.57444f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -41.4456f, -7.647498f, 20.49746f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 0.554884f, -1.232897f, 20.53705f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -50.16516f, 9.716236f, 23.58709f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 11.45844f, 16.36624f, 20.54192f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 19.72286f, -2.193787f, 33.06982f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 19.72286f, -2.193787f, 33.06982f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 8.599396f, -28.55855f, 24.79919f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 38.94339f, -33.808f, 25.39618f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 58.15474f, 0.748094f, 41.87663f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 5.607554f, -6.350654f, 34.00357f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 4.780305f, -29.05227f, 35.09634f, 1.6f);
+
+ if(instance->ToInstanceMap()->GetMaxPlayers() == 10)
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -5.15231f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -14.9806f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -21.7406f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -28.0876f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -8.61003f, 15.483f, 20.4158f, 4.69854f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -27.9583f, 14.8875f, 20.4428f, 4.77865f);
+ }
+ else
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, 0.15231f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -5.15231f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -14.9806f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -21.7406f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -28.0876f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -33.0876f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -8.61003f, 15.483f, 20.4158f, 4.69854f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -27.9583f, 14.8875f, 20.4428f, 4.77865f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -15.61003f, 15.483f, 20.4158f, 4.69854f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -20.9583f, 14.8875f, 20.4428f, 4.77865f);
+ }
+ }
+
+ if(th = sMapMgr->LoadTransportInMap(instance,GO_ORGRIM_S_HAMMER_HORDE_ICC, 77800))
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_ORGRIMS_HAMMER, 1.845810f, 1.268872f, 34.526218f, 1.5890f);
+ th->AddNPCPassengerInInstance(NPC_GB_HIGH_OVERLORD_SAURFANG, 37.18615f, 0.00016f, 36.78849f, 3.13683f);
+ th->AddNPCPassengerInInstance(NPC_GB_MURADIN_BRONZEBEARD_NOT_VISUAL, -7.09684f, 30.582f, 34.5013f, 1.53591f);
+ th->AddNPCPassengerInInstance(NPC_GB_INVISIBLE_STALKER, 37.30764f, -0.143823f, 36.7936f, 3.13683f);
+ th->AddNPCPassengerInInstance(NPC_GB_ZAFOD_BOOMBOX, 35.18615f, 15.30652f, 37.64343f, 3.05033f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -13.19547f, -27.160213f, 35.47252f, 3.10672f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.33902f, -25.230491f, 33.04052f, 3.00672f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -60.1251f, -1.27014f, 42.8335f, 5.16073f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -48.2651f, 16.78034f, 34.2515f, 0.04292f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -14.8356f, 27.931688f, 33.363f, 1.73231f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 10.2702f, 20.62966f, 35.37483f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 39.32459f, 14.50176f, 36.88428f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 46.17223f, -6.638763f, 37.35444f, 1.32f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 27.4456f, -13.397498f, 36.34746f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 18.16184f, 1.37897f, 35.31705f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.11516f, -0.196236f, 45.15709f, 2.9f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.11844f, -0.19624f, 49.18192f, 1.6f);
+
+ if(instance->ToInstanceMap()->GetMaxPlayers() == 10)
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, 22.6225f, 28.9309f, 36.3929f, 1.53591f);
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, -21.7509f, 29.4207f, 34.2588f, 1.53591f);
+ }
+ else
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, 22.6225f, 28.9309f, 36.3929f, 1.53591f);
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, 9.87745f, 30.5047f, 35.7147f, 1.53591f);
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, -7.09684f, 30.582f, 34.5013f, 1.53591f);
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, -21.7509f, 29.4207f, 34.2588f, 1.53591f);
+ }
+ }
+ }
+ isPrepared = true;
+ }
+ else
+ {
+ sMapMgr->LoadTransportForPlayers(player);
+ }
+ }
+
protected:
EventMap Events;
uint64 LadyDeathwisperElevatorGUID;
@@ -1312,6 +1597,25 @@ class instance_icecrown_citadel : public InstanceMapScript
bool IsOozeDanceEligible;
bool IsNauseaEligible;
bool IsOrbWhispererEligible;
+ bool isPrepared;
+ // Gunship: Variables
+ // Here we must add states and these things first squad with real events ls
+ uint32 FirstSquadState;
+ uint32 SecondSquadState;
+ uint32 SpireSquadState;
+ uint64 SkybreakerBossGUID;
+ uint64 OrgrimmarBossGUID;
+ uint64 DeathbringerSaurfangGbGUID;
+ uint64 MuradinBronzebeardGbGUID;
+ uint64 DeathbringerSaurfangNotVisualGUID;
+ uint64 MuradinBronzebeardNotVisualGUID;
+ uint64 GbBattleMageGUID;
+ uint64 GunShipControllerGUID;
+ uint64 GBMuradinGUID;
+ uint64 GBSaurfangGUID;
+ uint64 GBSkybreakerGUID;
+ uint64 GBOgrimsHammerGUID;
+ uint64 SindragosasWardGUID;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const
--
1.8.1.msysgit.1
From 11eb766705f25e8f548b1ab91b72bce1c2d5ce54 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:40:54 +0300
Subject: [PATCH 05/14] Create boss_gunship_battle.cpp
---
.../IcecrownCitadel/boss_gunship_battle.cpp | 3408 ++++++++++++++++++++
1 file changed, 3408 insertions(+)
create mode 100644 src/server/scripts/Northrend/IcecrownCitadel/boss_gunship_battle.cpp
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_gunship_battle.cpp
new file mode 100644
index 0000000..16b3631
--- /dev/null
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_gunship_battle.cpp
@@ -0,0 +1,3408 @@
+/*
+ * Copyright (C) 2008-2013 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * 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
+ *
+ * Updated by: Toba and Baeumchen (maddin)
+ */
+
+#include "icecrown_citadel.h"
+#include "MapManager.h"
+#include "Transport.h"
+#include "Vehicle.h"
+#include "Group.h"
+#include "ObjectMgr.h"
+#include "Object.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellAuras.h"
+#include "SpellScript.h"
+
+enum eAchievements
+{
+ IM_ON_A_BOAT_10 = 4536,
+ IM_ON_A_BOAT_25 = 4612
+};
+
+enum Actions
+{
+ ACTION_INTRO_START = 1,
+ ACTION_BATTLE_EVENT = 2,
+ ACTION_MAGE_DIE = 3,
+ ACTION_ROCK_DIE = 4,
+ ACTION_AXES_RIFL_DIE = 5,
+ ACTION_DONE = 6,
+ ACTION_FAIL = 7,
+};
+
+enum Spells
+{
+ SPELL_BURNING_PITCH_A = 71335,
+ SPELL_BURNING_PITCH_H = 71339,
+ SPELL_BURNING_PITCH_SIEGE_DMG_A = 70383,
+ SPELL_BURNING_PITCH_SIEGE_DMG_H = 70374,
+ SPELL_BURNING_PITCH_AOE_DAMAGE = 69660,
+
+ SPELL_WOUNDING_STRIKE_10_NM = 69651,
+ SPELL_WOUNDING_STRIKE_10_HM = 72570,
+ SPELL_WOUNDING_STRIKE_25_NM = 72569,
+ SPELL_WOUNDING_STRIKE_25_HM = 72571,
+
+ SPELL_TELEPORT_VISUAL = 64446,
+ SPELL_BLADESTORM = 69652,
+ SPELL_BLADESTORM_TRIGGER = 69653,
+
+ // Cannon
+ SPELL_HEAT_DRAIN = 69470,
+ SPELL_OVERHEAT = 69487, // Triggers spell #69488 every 0.25s. It should consume 10 Energy but does not.
+ SPELL_CANNON_BLAST = 69399,
+ SPELL_INCINERATING_BLAST = 69401,
+
+ // Auras
+ SPELL_ON_ORGRIMS_HAMMERS_DECK = 70121,
+ SPELL_ON_SKYBREAKERS_DECK = 70120,
+
+ // Achievement spell required target
+ SPELL_ACHIEVEMENT = 72959,
+
+ // Rampart of Skulls NPCs Spells
+ // Kor'kron Primalist
+ SPELL_WRATH = 69968,
+ SPELL_HEALING_TOUCH = 69899,
+ SPELL_REGROWTH = 69882,
+ SPELL_REJUVENATION = 69898,
+
+ SPELL_SUMMON_BATTLE_STANDART_A = 69810,
+ SPELL_SUMMON_BATTLE_STANDART_H = 69811,
+
+ // Kor'kron Defender
+ SPELL_DEVASTATE = 69902,
+ SPELL_THUNDERCLAP = 69965,
+ SPELL_SUNDER_ARMOR = 57807,
+ SPELL_SPELL_REFLECT = 69901,
+
+ // Skybreaker Vindicator
+ SPELL_AVENGERS_SHIELD = 69927,
+ SPELL_CONCENTRATION = 69930,
+ SPELL_HOLY_WRATH = 69934,
+
+ // Frostwyrm
+ SPELL_FROST_BREATH = 70116,
+ SPELL_BLIZZARD = 70362,
+ SPELL_FROST_CLEAVE = 70361,
+
+ // Muradin Bronzebeard / High Overlord Saurfang
+ SPELL_CLEAVE = 15284,
+ SPELL_RENDING_THROW = 70309,
+ SPELL_TASTE_OF_BLOOD = 69634,
+
+ // Kor'kron Battle-mage & Skybreaker Sorcerer
+ SPELL_BELOW_ZERO = 69705,
+ SPELL_SHADOW_CHANNELING = 45104,
+
+ // Experience spells
+ SPELL_EXPERIENCED = 71188,
+ SPELL_VETERAN = 71193,
+ SPELL_ELITE = 71195,
+ SPELL_DESPERATE_RESOLVE_10_NM = 69647,
+ SPELL_DESPERATE_RESOLVE_10_HM = 72537,
+ SPELL_DESPERATE_RESOLVE_25_NM = 72536,
+ SPELL_DESPERATE_RESOLVE_25_HM = 72538,
+
+ // Kor'kron Axethrower & Skybreaker Rifleman
+ SPELL_HURL_AXE = 70161,
+ SPELL_SHOOT = 70162,
+
+ // Kor'kron Rocketeer & Skybreaker Mortar Soldier
+ SPELL_ROCKET_ARTILLERY_MARKER = 71371,
+ SPELL_ROCKET_ARTILLERY_TRIGGERED = 69679,
+ SPELL_ROCKET_ARTILLERY_HORDE = 69678,
+ SPELL_ROCKET_ARTILLERY_ALLIANCE = 70609,
+ SPELL_EXPLOSION = 69680,
+
+ // Ship Explsion
+ SPELL_SHIP_EXPLOSION = 72137,
+
+ // Remove Rocket Packs
+ SPELL_REMOVE_ROCKET_PACK = 70713,
+
+ // Achievements
+ SPELL_ACHIEVEMENT_CHECK = 72959,
+};
+
+enum Events
+{
+ EVENT_NULL,
+ EVENT_INTRO_ALLIANCE_1, // Muradin Bronzebeard yells: Fire up the engines! We got a meetin' with destiny, lads!
+ EVENT_INTRO_ALLIANCE_2, // Muradin Bronzebeard yells: Hold on to yer hats!
+ EVENT_INTRO_ALLIANCE_3, // Muradin Bronzebeard yells: What in the world is that? Grab me spyglass, crewman!
+ EVENT_INTRO_ALLIANCE_4, // Muradin Bronzebeard yells: By me own beard! HORDE SAILIN' IN FAST 'N HOT!
+ EVENT_INTRO_ALLIANCE_5, // Muradin Bronzebeard yells: EVASIVE ACTION! MAN THE GUNS!
+ EVENT_INTRO_ALLIANCE_6, // Muradin Bronzebeard yells: Cowardly dogs! Ye blindsided us!
+ EVENT_INTRO_ALLIANCE_7, // High Overlord Saurfang yells: This is not your battle, dwarf. Back down or we will be forced to destroy your ship.
+ EVENT_INTRO_ALLIANCE_8, // Muradin Bronzebeard yells: Not me battle? I dunnae who ye think ye are, mister, but I got a score to settle with Arthas and yer not gettin' in me way! FIRE ALL GUNS! FIRE! FIRE!
+
+ EVENT_INTRO_HORDE_1, // High Overlord Saurfang yells: Rise up, sons and daughters of the Horde! Today we battle a hated enemy of the Horde! LOK'TAR OGAR! Kor'kron, take us out!
+ EVENT_INTRO_HORDE_1_1, // Kor'kron, take us out!
+ EVENT_INTRO_HORDE_2, // High Overlord Saurfang yells: What is that?! Something approaching in the distance!
+ EVENT_INTRO_HORDE_3, // High Overlord Saurfang yells: ALLIANCE GUNSHIP! ALL HANDS ON DECK!
+ EVENT_INTRO_HORDE_4, // Muradin Bronzebeard yells: Move yer jalopy or we'll blow it out of the sky, orc! The Horde's got no business here!
+ EVENT_INTRO_HORDE_5, // High Overlord Saurfang yells: You will know our business soon! KOR'KRON, ANNIHILATE THEM!
+
+ EVENT_OUTRO_ALLIANCE_1,
+ EVENT_OUTRO_ALLIANCE_2,
+ EVENT_OUTRO_ALLIANCE_3,
+
+ EVENT_OUTRO_HORDE_1,
+ EVENT_OUTRO_HORDE_2,
+ EVENT_OUTRO_HORDE_3,
+
+ //Fly
+ EVENT_START_FLY,
+
+ //Misc battle
+ EVENT_WALK_MOBS,
+ EVENT_SUMMON_PORTAL,
+ EVENT_FREEZE_CANNON,
+ EVENT_SHADOW_CHANNELING,
+ EVENT_UNSUMMON_PORTAL,
+ EVENT_BOARDING_GUNSHIP,
+ EVENT_BOARDING_TALK,
+ EVENT_BURNING_PITCH,
+ EVENT_WOUNDING_STRIKE,
+ EVENT_BLADE_STORM,
+ EVENT_DONE,
+ EVENT_FAIL,
+ EVENT_RESTART_EVENT,
+ EVENT_BOARDING_REAVERS_MARINE,
+ EVENT_WIPE_CHECK,
+
+ // Rampart of Skulls NPCs Events
+ EVENT_WRATH,
+ EVENT_HEAL,
+
+ EVENT_SUNDER_ARMOR,
+ EVENT_SPELL_REFLECT,
+ EVENT_THUNDERCLAP,
+ EVENT_DEVASTATE,
+
+ EVENT_FROST_BREATH,
+ EVENT_BLIZZARD,
+ EVENT_CLEAVE,
+
+ // Skybreaker Vindicator
+ EVENT_AVENGERS_SHILED,
+ EVENT_CONCENTRATION,
+ EVENT_HOLY_WRATH,
+
+ // First Squad Assisted
+ EVENT_FIRST_SQUAD_ASSISTED_1,
+ EVENT_FIRST_SQUAD_ASSISTED_2,
+
+ // Second Squad Assisted
+ EVENT_SECOND_SQUAD_ASSISTED_1,
+ EVENT_SECOND_SQUAD_ASSISTED_2,
+ EVENT_SECOND_SQUAD_ASSISTED_3,
+
+ // Shared experience events
+ EVENT_EXPERIENCED,
+ EVENT_VETERAN,
+ EVENT_ELITE,
+ EVENT_ATACK_START,
+
+ // Kor'kron Axethrower & Skybreaker Rifleman
+ EVENT_HURL_AXE,
+ EVENT_SHOOT,
+
+ // Kor'kron Rocketeer & Skybreaker Mortar Soldier
+ EVENT_ROCKET_ART,
+
+ // Muradin Bronzebeard & High Overlord Saurfang
+ EVENT_RENDING_THROW,
+ EVENT_TASTE_OF_BLOOD,
+
+ // Misc (used in various NPCs)
+ EVENT_SPAWN_MAGE,
+ EVENT_RESPAWN_AXES_RIFLEMEN,
+ EVENT_RESPAWN_ROCKETEER,
+};
+
+enum Texts
+{
+ // Kor'kron Primalist
+ SAY_FIRST_SQUAD_RESCUED_HORDE_0 = 0,
+
+ // Kor'kron Invoker
+ SAY_FIRST_SQUAD_RESCUED_HORDE_1 = 0,
+
+ // Kor'kron Defender
+ SAY_SECOND_SQUAD_RESCUED_HORDE_0 = 0,
+ SAY_SECOND_SQUAD_RESCUED_HORDE_1 = 1,
+ SAY_FROSTWYRM_SUMMON_0 = 2,
+ SAY_FROSTWYRM_SUMMON_1 = 3,
+
+ // Skybreaker Vindicator
+ SAY_FIRST_SQUAD_RESCUED_ALLIANCE_0 = 0,
+
+ // Skybreaker Sorcerer
+ SAY_FIRST_SQUAD_RESCUED_ALLIANCE_1 = 0,
+
+ // Skybreaker Protector
+ SAY_SECOND_SQUAD_RESCUED_ALLIANCE_0 = 0,
+ SAY_SECOND_SQUAD_RESCUED_ALLIANCE_1 = 1,
+ SAY_SECOND_SQUAD_RESCUED_ALLIANCE_2 = 2,
+
+ // Kor'kron Invoker & Skybreaker Sorcerer
+ SAY_SUMMON_BATTLE_STANDARD = 1,
+
+ // Froswyrm
+ SAY_FROSTWYRM_LAND_H_0 = 0,
+ SAY_FROSTWYRM_LAND_A_1 = 1,
+
+ // Muradin Bronzebeard
+ SAY_INTRO_ALLIANCE_0 = 0,
+ SAY_INTRO_ALLIANCE_1 = 1,
+ SAY_INTRO_ALLIANCE_2 = 2,
+ SAY_INTRO_ALLIANCE_3 = 3,
+ SAY_INTRO_ALLIANCE_4 = 4,
+ SAY_INTRO_ALLIANCE_5 = 5,
+ SAY_INTRO_ALLIANCE_7 = 6,
+ SAY_INTRO_HORDE_3 = 7,
+ SAY_BOARDING_SKYBREAKER_1 = 8,
+ SAY_BOARDING_ORGRIMS_HAMMER_0 = 9,
+ SAY_NEW_RIFLEMEN_SPAWNED = 10,
+ SAY_NEW_MORTAR_TEAM_SPAWNED = 11,
+ SAY_NEW_MAGE_SPAWNED = 12,
+ SAY_ALLIANCE_VICTORY = 13,
+ SAY_ALLIANCE_DEFEAT = 14, // How will we handle that case ? Ie. the player loses
+
+ // High Overlord Saurfang
+ SAY_INTRO_HORDE_0 = 0,
+ SAY_INTRO_HORDE_0_1 = 1,
+ SAY_INTRO_HORDE_1 = 2,
+ SAY_INTRO_HORDE_2 = 3,
+ SAY_INTRO_HORDE_4 = 4,
+ SAY_BOARDING_SKYBREAKER_0 = 5,
+ SAY_BOARDING_ORGRIMS_HAMMER_1 = 6,
+ SAY_NEW_AXETHROWER_SPAWNED = 7,
+ SAY_NEW_ROCKETEERS_SPAWNED = 8,
+ SAY_NEW_BATTLE_MAGE_SPAWNED = 9,
+ SAY_HORDE_VICTORY = 10,
+ SAY_HORDE_DEFEAT = 11, // How will we handle that case ? Ie. the player loses
+
+ SAY_HIGH_OVERLORD_SAURFANG_NOT_VISUAL = 0,
+ SAY_BOARDING_SKYBREAKER_SAURFANG = 1,
+ SAY_MURADIN_BRONZEBEARD_NOT_VISUAL = 0,
+ SAY_BOARDING_SKYBREAKER_MURADIN = 1,
+};
+
+Position const FrostWyrmPosH = {-435.429f, 2077.556f, 219.1148f, 4.767166f};
+Position const FrostWyrmPosA = {-437.409f, 2349.026f, 219.1148f, 1.483120f};
+
+struct mortarMarksLoc
+{
+ uint32 durationBeforeRefreshing;
+ Position location;
+};
+
+
+//Function find player special for Gunship battle
+typedef std::list<Player*> TPlayerLists;
+
+TPlayerLists GetPlayersInTheMaps(Map *pMap)
+{
+ TPlayerLists players;
+ const Map::PlayerList &PlayerList = pMap->GetPlayers();
+ if (!PlayerList.isEmpty())
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ if (Player* player = i->getSource())
+ players.push_back(player);
+ return players;
+}
+
+Player* SelectRandomPlayerFromLists(TPlayerLists &players)
+{
+ if (players.empty())
+ return NULL;
+ TPlayerLists::iterator it = players.begin();
+ std::advance(it, urand(0, players.size()-1));
+ return *it;
+}
+
+Player* SelectRandomPlayerInTheMaps(Map* pMap)
+{
+ TPlayerLists players = GetPlayersInTheMaps(pMap);
+ return SelectRandomPlayerFromLists(players);
+}
+
+//Function start motion of the ship
+void StartFlyShip(Transport* t)
+{
+ t->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ t->SetGoState(GO_STATE_ACTIVE);
+ t->SetUInt32Value(GAMEOBJECT_DYNAMIC, 0x10830010); // Seen in sniffs
+ t->SetFloatValue(GAMEOBJECT_PARENTROTATION + 3, 1.0f);
+
+ Map* map = t->GetMap();
+ std::set<uint32> mapsUsed;
+ GameObjectTemplate const* goinfo = t->GetGOInfo();
+
+ t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed);
+
+ for (Map::PlayerList::const_iterator itr = map->GetPlayers().begin(); itr != map->GetPlayers().end(); ++itr)
+ {
+ if (Player* pPlayer = itr->getSource())
+ {
+ UpdateData transData;
+ t->BuildCreateUpdateBlockForPlayer(&transData, pPlayer);
+ WorldPacket packet;
+ transData.BuildPacket(&packet);
+ pPlayer->SendDirectMessage(&packet);
+ }
+ }
+}
+
+void UpdateTransportMotionInMap(Transport* t)
+{
+ Map* map = t->GetMap();
+
+ for (Map::PlayerList::const_iterator itr = map->GetPlayers().begin(); itr != map->GetPlayers().end(); ++itr)
+ {
+ if (Player* pPlayer = itr->getSource())
+ {
+ UpdateData transData;
+ t->BuildCreateUpdateBlockForPlayer(&transData, pPlayer);
+ WorldPacket packet;
+ transData.BuildPacket(&packet);
+ pPlayer->SendDirectMessage(&packet);
+ }
+ }
+}
+
+void RelocateTransport(Transport* t)
+{
+ Map* map = t->GetMap();
+ InstanceScript* instance = t->GetInstanceScript();
+
+ if (!t || !instance)
+ return;
+
+ // Transoprt movemend on server-side is ugly hack, so we do sincronize positions
+ switch (t->GetEntry())
+ {
+ case GO_THE_SKYBREAKER_ALLIANCE_ICC:
+ if (instance->GetBossState(DATA_GUNSHIP_EVENT) != DONE)
+ t->Relocate(-377.184021f, 2073.548584f, 445.753387f);
+ else if (instance->GetBossState(DATA_GUNSHIP_EVENT) == DONE)
+ t->Relocate(-583.942627f, 2212.364990f, 534.673889f);
+ break;
+ case GO_ORGRIM_S_HAMMER_ALLIANCE_ICC:
+ if (instance->GetBossState(DATA_GUNSHIP_EVENT) != DONE)
+ t->Relocate(-384.878479f, 1989.831665f, 431.549438f);
+ break;
+ case GO_ORGRIM_S_HAMMER_HORDE_ICC:
+ if (instance->GetBossState(DATA_GUNSHIP_EVENT) != DONE)
+ t->Relocate(-438.142365f, 2395.725830f, 436.781647f);
+ else if (instance->GetBossState(DATA_GUNSHIP_EVENT) == DONE)
+ t->Relocate(-583.942627f, 2212.364990f, 534.673889f);
+ break;
+ case GO_THE_SKYBREAKER_HORDE_ICC:
+ if (instance->GetBossState(DATA_GUNSHIP_EVENT) != DONE)
+ t->Relocate(-435.854156f, 2475.328125f, 449.364105f);
+ break;
+ }
+
+ t->Update(0);
+ t->UpdatePassengerPositions();
+}
+
+
+//Function stop motion of the ship
+void StopFlyShip(Transport* t)
+{
+ Map* map = t->GetMap();
+ t->m_WayPoints.clear();
+ RelocateTransport(t);
+ t->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
+ t->SetGoState(GO_STATE_READY);
+
+ for (Map::PlayerList::const_iterator itr = map->GetPlayers().begin(); itr != map->GetPlayers().end(); ++itr)
+ {
+ if (Player* pPlayer = itr->getSource())
+ {
+ UpdateData transData;
+ t->BuildCreateUpdateBlockForPlayer(&transData, pPlayer);
+ WorldPacket packet;
+ transData.BuildPacket(&packet);
+ pPlayer->SendDirectMessage(&packet);
+ }
+ }
+}
+
+//Find Unfriendy transport
+Transport* CheckUnfriendlyShip(Creature* me, InstanceScript* instance, uint32 data)
+{
+ if(Creature* pCapitan = ObjectAccessor::GetCreature(*me, instance->GetData64(data)))
+ return pCapitan->GetTransport();
+ else
+ return NULL;
+}
+
+//Teleport players
+void TeleportPlayers(Map* map, uint64 TeamInInstance)
+{
+ if(map)
+ {
+ Map::PlayerList const &lPlayers = map->GetPlayers();
+ if (!lPlayers.isEmpty())
+ {
+ for(Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
+ {
+ if (Player* pPlayer = itr->getSource())
+ {
+ if (pPlayer->isDead() && !pPlayer->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
+ pPlayer->ResurrectPlayer(1.0f);
+
+ if(TeamInInstance == ALLIANCE)
+ pPlayer->TeleportTo(631, -437.498505f, 2425.954f, 192.997f, 2.247f);
+ else
+ pPlayer->TeleportTo(631, -437.498505f, 1997.954f, 192.997f, 2.247f);
+ }
+ }
+ }
+ }
+}
+
+//Ship explosion
+void DoShipExplosion(Transport* t)
+{
+ for (Transport::CreatureSet::iterator itr = t->m_NPCPassengerSet.begin(); itr != t->m_NPCPassengerSet.end();)
+ {
+ if (Creature* npc = *itr)
+ {
+ if(npc->GetEntry() == NPC_GB_GUNSHIP_HULL)
+ npc->CastSpell(npc, SPELL_SHIP_EXPLOSION, true);
+ }
+ ++itr;
+ }
+}
+
+//Wipe check
+bool DoWipeCheck(Transport* t)
+{
+ for (Transport::PlayerSet::const_iterator itr = t->GetPassengers().begin(); itr != t->GetPassengers().end();)
+ {
+ Player* plr = *itr;
+ ++itr;
+
+ if (plr && plr->isAlive())
+ return true;
+ }
+ return false;
+}
+
+//Check falling players
+void DoCheckFallingPlayer(Creature* me)
+{
+ Map* map = me->GetMap();
+
+ if(map)
+ {
+ Map::PlayerList const &lPlayers = map->GetPlayers();
+ if (!lPlayers.isEmpty())
+ {
+ for(Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
+ {
+ if (Player* pPlayer = itr->getSource())
+ {
+ if (pPlayer->GetPositionZ() < 420.0f && pPlayer->IsWithinDistInMap(me, 300.0f))
+ pPlayer->NearTeleportTo(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 5.0f, me->GetOrientation());
+ }
+ }
+ }
+ }
+}
+
+//Restart event
+void RestartEvent(Transport* t1, Transport* t2, Map* instance, uint64 TeamInInstance)
+{
+ sMapMgr->UnLoadTransportFromMap(t1);
+ sMapMgr->UnLoadTransportFromMap(t2);
+ sMapMgr->LoadTransports(); // Try
+
+ Map::PlayerList const& players = instance->GetPlayers();
+ if (players.isEmpty())
+ return;
+
+ if(TeamInInstance == ALLIANCE)
+ {
+ if(Transport* th = sMapMgr->LoadTransportInMap(instance, GO_ORGRIM_S_HAMMER_ALLIANCE_ICC, 108000))
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_ORGRIMS_HAMMER, 1.845810f, 1.268872f, 34.526218f, 1.5890f);
+ th->AddNPCPassengerInInstance(NPC_GB_HIGH_OVERLORD_SAURFANG, 37.18615f, 0.00016f, 36.78849f, 3.13683f);
+ th->AddNPCPassengerInInstance(NPC_GB_INVISIBLE_STALKER, 37.18615f, 0.00016f, 36.78849f, 3.13683f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_BATTLE_MAGE, 47.2929f, -4.308941f, 37.5555f, 3.05033f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_BATTLE_MAGE, 47.34621f, 4.032004f, 37.70952f, 3.05033f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_BATTLE_MAGE, 15.03016f, 0.00016f, 37.70952f, 1.55138f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -13.19547f, -27.160213f, 35.47252f, 3.10672f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.33902f, -25.230491f, 33.04052f, 3.00672f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -60.1251f, -1.27014f, 42.8335f, 5.16073f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -48.2651f, 16.78034f, 34.2515f, 0.04292f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -14.8356f, 27.931688f, 33.363f, 1.73231f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 10.2702f, 20.62966f, 35.37483f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 39.32459f, 14.50176f, 36.88428f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 46.17223f, -6.638763f, 37.35444f, 1.32f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 27.4456f, -13.397498f, 36.34746f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 18.16184f, 1.37897f, 35.31705f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.11516f, -0.196236f, 45.15709f, 2.9f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.11844f, -0.19624f, 49.18192f, 1.6f);
+
+ if (instance->ToInstanceMap()->GetMaxPlayers() == 10)
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -3.170555f, 28.30652f, 34.21082f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -12.0928f, 27.65942f, 33.58557f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 14.92804f, 26.18018f, 35.47803f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 24.70331f, 25.36584f, 35.97845f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, -11.44849f, -25.71838f, 33.64343f, 1.49248f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, 12.30336f, -25.69653f, 35.32373f, 1.49248f);
+ }
+ else
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -3.170555f, 28.30652f, 34.21082f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -12.0928f, 27.65942f, 33.58557f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 14.92804f, 26.18018f, 35.47803f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 24.70331f, 25.36584f, 35.97845f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 19.92804f, 27.18018f, 35.47803f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -7.70331f, 28.36584f, 33.88557f, 1.66527f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, -11.44849f, -25.71838f, 33.64343f, 1.49248f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, 12.30336f, -25.69653f, 35.32373f, 1.49248f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, -3.44849f, -25.71838f, 34.21082f, 1.49248f);
+ th->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, 3.30336f, -25.69653f, 35.32373f, 1.49248f);
+ }
+ }
+
+ if(Transport* t = sMapMgr->LoadTransportInMap(instance, GO_THE_SKYBREAKER_ALLIANCE_ICC, 108000))
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER, -17.156807f, -1.633260f, 20.81273f, 4.52672f);
+ t->AddNPCPassengerInInstance(NPC_GB_MURADIN_BRONZEBEARD, 13.51547f, -0.160213f, 20.87252f, 3.10672f);
+ t->AddNPCPassengerInInstance(NPC_GB_HIHG_CAPTAIN_JUSTIN_BARTLETT, 42.78902f, -0.010491f, 25.24052f, 3.00672f);
+ t->AddNPCPassengerInInstance(NPC_GB_HIGH_OVERLORD_SAURFANG_NOT_VISUAL, -12.9806f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_ZAFOD_BOOMBOX, 18.8042f, 9.907914f, 20.33559f, 3.10672f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_DECKHAND, -64.8423f, 4.4658f, 23.4352f, 2.698897f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_DECKHAND, 35.54972f, 19.93269f, 25.0333f, 4.71242f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_DECKHAND, -36.39837f, 3.13127f, 20.4496f, 1.5708f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_DECKHAND, -36.23974f, -2.75767f, 20.4506f, 4.69496f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_DECKHAND, 41.94677f, 44.08411f, 24.66587f, 1.62032f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 13.51547f, -0.160213f, 20.87252f, 3.10672f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 42.78902f, -0.010491f, 25.24052f, 3.00672f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 14.0551f, 3.65014f, 20.7935f, 3.16073f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 14.0551f, -4.65034f, 20.7915f, 3.04292f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -17.8356f, 0.031688f, 20.823f, 4.73231f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -34.2702f, -26.18966f, 21.37483f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -11.64459f, -19.85176f, 20.88428f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -19.88223f, -6.578763f, 20.57444f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -41.4456f, -7.647498f, 20.49746f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 0.554884f, -1.232897f, 20.53705f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -50.16516f, 9.716236f, 23.58709f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 11.45844f, 16.36624f, 20.54192f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 19.72286f, -2.193787f, 33.06982f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 19.72286f, -2.193787f, 33.06982f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 8.599396f, -28.55855f, 24.79919f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 38.94339f, -33.808f, 25.39618f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 58.15474f, 0.748094f, 41.87663f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 5.607554f, -6.350654f, 34.00357f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 4.780305f, -29.05227f, 35.09634f, 1.6f);
+
+ if (instance->ToInstanceMap()->GetMaxPlayers() == 10)
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -5.15231f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -28.0876f, -22.9462f, 21.659f, 4.72416f);
+ }
+ else
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -5.15231f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -14.9806f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -21.7406f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_ALLIANCE_CANON, -28.0876f, -22.9462f, 21.659f, 4.72416f);
+ }
+ }
+
+ }
+
+ if(TeamInInstance == HORDE)
+ {
+ if(Transport* t = sMapMgr->LoadTransportInMap(instance, GO_THE_SKYBREAKER_HORDE_ICC, 77800))
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER, -17.156807f, -1.633260f, 20.81273f, 4.52672f);
+ t->AddNPCPassengerInInstance(NPC_GB_MURADIN_BRONZEBEARD, 13.51547f, -0.160213f, 20.87252f, 3.10672f);
+ t->AddNPCPassengerInInstance(NPC_GB_HIHG_CAPTAIN_JUSTIN_BARTLETT, 42.78902f, -0.010491f, 25.24052f, 3.00672f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_SORCERERS, 14.0551f, 3.65014f, 20.7935f, 3.16073f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_SORCERERS, 14.0551f, -4.65034f, 20.7915f, 3.04292f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_SORCERERS, -17.8356f, 0.031688f, 20.823f, 4.73231f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 13.51547f, -0.160213f, 20.87252f, 3.10672f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 42.78902f, -0.010491f, 25.24052f, 3.00672f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 14.0551f, 3.65014f, 20.7935f, 3.16073f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 14.0551f, -4.65034f, 20.7915f, 3.04292f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -17.8356f, 0.031688f, 20.823f, 4.73231f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -34.2702f, -26.18966f, 21.37483f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -11.64459f, -19.85176f, 20.88428f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -19.88223f, -6.578763f, 20.57444f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -41.4456f, -7.647498f, 20.49746f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 0.554884f, -1.232897f, 20.53705f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -50.16516f, 9.716236f, 23.58709f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 11.45844f, 16.36624f, 20.54192f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 19.72286f, -2.193787f, 33.06982f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 19.72286f, -2.193787f, 33.06982f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 8.599396f, -28.55855f, 24.79919f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 38.94339f, -33.808f, 25.39618f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 58.15474f, 0.748094f, 41.87663f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 5.607554f, -6.350654f, 34.00357f, 1.6f);
+ t->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 4.780305f, -29.05227f, 35.09634f, 1.6f);
+
+ if(instance->ToInstanceMap()->GetMaxPlayers() == 10)
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -5.15231f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -14.9806f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -21.7406f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -28.0876f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -8.61003f, 15.483f, 20.4158f, 4.69854f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -27.9583f, 14.8875f, 20.4428f, 4.77865f);
+ }
+ else
+ {
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, 0.15231f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -5.15231f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -14.9806f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -21.7406f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -28.0876f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -33.0876f, -22.9462f, 21.659f, 4.72416f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -8.61003f, 15.483f, 20.4158f, 4.69854f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -27.9583f, 14.8875f, 20.4428f, 4.77865f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -15.61003f, 15.483f, 20.4158f, 4.69854f);
+ t->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -20.9583f, 14.8875f, 20.4428f, 4.77865f);
+ }
+ }
+
+ if(Transport* th = sMapMgr->LoadTransportInMap(instance,GO_ORGRIM_S_HAMMER_HORDE_ICC, 77800))
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_ORGRIMS_HAMMER, 1.845810f, 1.268872f, 34.526218f, 1.5890f);
+ th->AddNPCPassengerInInstance(NPC_GB_HIGH_OVERLORD_SAURFANG, 37.18615f, 0.00016f, 36.78849f, 3.13683f);
+ th->AddNPCPassengerInInstance(NPC_GB_MURADIN_BRONZEBEARD_NOT_VISUAL, -7.09684f, 30.582f, 34.5013f, 1.53591f);
+ th->AddNPCPassengerInInstance(NPC_GB_INVISIBLE_STALKER, 37.30764f, -0.143823f, 36.7936f, 3.13683f);
+ th->AddNPCPassengerInInstance(NPC_GB_ZAFOD_BOOMBOX, 35.18615f, 15.30652f, 37.64343f, 3.05033f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -13.19547f, -27.160213f, 35.47252f, 3.10672f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.33902f, -25.230491f, 33.04052f, 3.00672f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -60.1251f, -1.27014f, 42.8335f, 5.16073f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -48.2651f, 16.78034f, 34.2515f, 0.04292f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -14.8356f, 27.931688f, 33.363f, 1.73231f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 10.2702f, 20.62966f, 35.37483f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 39.32459f, 14.50176f, 36.88428f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 46.17223f, -6.638763f, 37.35444f, 1.32f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 27.4456f, -13.397498f, 36.34746f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, 18.16184f, 1.37897f, 35.31705f, 1.6f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.11516f, -0.196236f, 45.15709f, 2.9f);
+ th->AddNPCPassengerInInstance(NPC_GB_GUNSHIP_HULL, -18.11844f, -0.19624f, 49.18192f, 1.6f);
+
+ if(instance->ToInstanceMap()->GetMaxPlayers() == 10)
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, 22.6225f, 28.9309f, 36.3929f, 1.53591f);
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, -21.7509f, 29.4207f, 34.2588f, 1.53591f);
+ }
+ else
+ {
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, 22.6225f, 28.9309f, 36.3929f, 1.53591f);
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, 9.87745f, 30.5047f, 35.7147f, 1.53591f);
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, -7.09684f, 30.582f, 34.5013f, 1.53591f);
+ th->AddNPCPassengerInInstance(NPC_GB_HORDE_CANON, -21.7509f, 29.4207f, 34.2588f, 1.53591f);
+ }
+ }
+ }
+
+
+}
+
+//Stop Fight
+void StopFight(Transport* t1, Transport* t2)
+{
+ Map* map = t1->GetMap();
+
+ for (Transport::CreatureSet::iterator itr = t1->m_NPCPassengerSet.begin(); itr != t1->m_NPCPassengerSet.end();)
+ {
+ if (Creature *npc = *itr)
+ {
+ if(npc->GetEntry() != NPC_GB_SKYBREAKER && npc->GetEntry() != NPC_GB_ORGRIMS_HAMMER && npc->GetEntry() != NPC_GB_HIGH_OVERLORD_SAURFANG
+ && npc->GetEntry() != NPC_GB_MURADIN_BRONZEBEARD && npc->GetEntry() != NPC_GB_GUNSHIP_HULL)
+ {
+ if (Vehicle* veh = npc->GetVehicleKit())
+ veh->RemoveAllPassengers();
+ npc->Kill(npc);
+ }
+ }
+ ++itr;
+ }
+
+ for (Transport::CreatureSet::iterator itr = t2->m_NPCPassengerSet.begin(); itr != t2->m_NPCPassengerSet.end();)
+ {
+ if (Creature *npc = *itr)
+ {
+ if(npc->GetEntry() != NPC_GB_GUNSHIP_HULL && npc->GetEntry() != NPC_GB_SKYBREAKER && npc->GetEntry() != NPC_GB_ORGRIMS_HAMMER)
+ npc->Kill(npc);
+ }
+ ++itr;
+ }
+
+ for (Map::PlayerList::const_iterator itr = map->GetPlayers().begin(); itr != map->GetPlayers().end(); ++itr)
+ {
+ if (Player* pPlayer = itr->getSource())
+ pPlayer->CombatStop();
+ }
+}
+
+//Muradin Bronzebeard
+class npc_muradin_gunship : public CreatureScript
+{
+ public:
+ npc_muradin_gunship() : CreatureScript("npc_muradin_gunship") { }
+
+ bool OnGossipHello(Player* player, Creature* pCreature)
+ {
+ InstanceScript* pInstance = pCreature->GetInstanceScript();
+ if (pInstance && pInstance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
+ {
+ if ((!player->GetGroup() || !player->GetGroup()->IsLeader(player->GetGUID())) && !player->isGameMaster())
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I'm not the raid leader...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, pCreature->GetGUID());
+ return true;
+ }
+
+ player->ADD_GOSSIP_ITEM(0, "My companions are all accounted for, Muradin. Let's go!", 631, 1001);
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
+ }
+ return false;
+ }
+
+ bool OnGossipSelect(Player* player, Creature* pCreature, uint32 /*sender*/, uint32 action)
+ {
+ InstanceScript* instance = pCreature->GetInstanceScript();
+ player->PlayerTalkClass->ClearMenus();
+ player->CLOSE_GOSSIP_MENU();
+
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
+ pCreature->MonsterSay("I'll wait for the raid leader", LANG_UNIVERSAL, player->GetGUID());
+
+ if (action == 1001)
+ {
+ pCreature->AI()->DoAction(ACTION_INTRO_START);
+ pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ }
+ return true;
+ }
+
+ struct npc_muradin_gunshipAI : public ScriptedAI
+ {
+ npc_muradin_gunshipAI(Creature *creature) : ScriptedAI(creature),
+ _instance(creature->GetInstanceScript())
+ {
+
+ }
+
+ void Reset()
+ {
+ if (_instance->GetBossState(DATA_GUNSHIP_EVENT) == IN_PROGRESS)
+ return;
+ me->SetReactState(REACT_PASSIVE);
+ me->setFaction(1802);
+ events.Reset();
+ map = me->GetMap();
+ skybreaker = me->GetTransport();
+ UpdateTransportMotionInMap(skybreaker);
+ SummonCount = RAID_MODE(3, 5, 4, 6);
+ count = 0;
+ RocketerCount = RAID_MODE(2, 4, 2, 4);
+ RiflCount = RAID_MODE(4, 6, 4, 6);
+ RocketerDieCount = 0;
+ RiflDieCount = 0;
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ EventScheduled = false;
+ }
+
+ void SendMusicToPlayers(uint32 musicId) const
+ {
+ WorldPacket data(SMSG_PLAY_MUSIC, 4);
+ data << uint32(musicId);
+ SendPacketToPlayers(&data);
+ }
+
+ // Send packet to all players
+ void SendPacketToPlayers(WorldPacket const* data) const
+ {
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
+ if (!players.isEmpty())
+ for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
+ if (Player* player = itr->getSource())
+ player->GetSession()->SendPacket(data);
+ }
+
+ bool CanAIAttack(Unit const* target) const
+ {
+ if (target->GetEntry() == NPC_GB_KORKRON_SERGANTE || target->GetEntry() == NPC_GB_KORKRON_REAVERS)
+ return true;
+
+ return false;
+ }
+
+ void DoAction(int32 action)
+ {
+ switch (action)
+ {
+ case ACTION_INTRO_START:
+ events.ScheduleEvent(EVENT_INTRO_ALLIANCE_1, 1000);
+ events.ScheduleEvent(EVENT_START_FLY, 2500);
+ events.ScheduleEvent(EVENT_INTRO_ALLIANCE_2, 7000);
+ events.ScheduleEvent(EVENT_INTRO_ALLIANCE_3, 28000);
+ events.ScheduleEvent(EVENT_INTRO_ALLIANCE_4, 35000);
+ events.ScheduleEvent(EVENT_INTRO_ALLIANCE_5, 40000);
+ events.ScheduleEvent(EVENT_INTRO_ALLIANCE_6, 47000);
+ events.ScheduleEvent(EVENT_INTRO_ALLIANCE_7, 53000);
+ events.ScheduleEvent(EVENT_INTRO_ALLIANCE_8, 58900);
+ break;
+ case ACTION_BATTLE_EVENT:
+ {
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
+ events.ScheduleEvent(EVENT_WIPE_CHECK, 5000);
+
+ Creature* pAllianceBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_SKYBREAKER_BOSS));
+ Creature* pHordeBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ORGRIMMAR_HAMMER_BOSS));
+
+ if (pHordeBoss && pAllianceBoss)
+ {
+ me->SetReactState(REACT_AGGRESSIVE);
+ pHordeBoss->SetInCombatWith(pAllianceBoss);
+ pAllianceBoss->SetInCombatWith(pHordeBoss);
+ pAllianceBoss->AddThreat(pHordeBoss, 0.0f);
+ pHordeBoss->AddThreat(pAllianceBoss, 0.0f);
+ _instance->SetBossState(DATA_GUNSHIP_EVENT, IN_PROGRESS);
+ events.ScheduleEvent(EVENT_SUMMON_PORTAL, 30000);
+ RelocateTransport(skybreaker);
+ RelocateTransport(CheckUnfriendlyShip(me,_instance, DATA_GB_HIGH_OVERLORD_SAURFANG));
+ }
+ else
+ me->AI()->DoAction(ACTION_FAIL);
+ break;
+ }
+ case ACTION_DONE:
+ if (Creature* pAllianceBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_SKYBREAKER_BOSS)))
+ {
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, pAllianceBoss);
+ }
+ if (Creature* pHordeBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ORGRIMMAR_HAMMER_BOSS)))
+ {
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, pHordeBoss);
+ }
+
+ me->SetReactState(REACT_PASSIVE);
+ _instance->SetBossState(DATA_GUNSHIP_EVENT, DONE);
+ _instance->DoCastSpellOnPlayers(SPELL_REMOVE_ROCKET_PACK);
+ Talk(SAY_ALLIANCE_VICTORY);
+ StartFlyShip(CheckUnfriendlyShip(me, _instance, DATA_GB_HIGH_OVERLORD_SAURFANG));
+ StopFight(skybreaker, CheckUnfriendlyShip(me, _instance, DATA_GB_HIGH_OVERLORD_SAURFANG));
+ events.CancelEvent(EVENT_WIPE_CHECK);
+ events.ScheduleEvent(EVENT_OUTRO_ALLIANCE_1, 3500);
+ events.ScheduleEvent(EVENT_OUTRO_ALLIANCE_2, 23000);
+ events.ScheduleEvent(EVENT_OUTRO_ALLIANCE_3, 32000);
+ break;
+ case ACTION_FAIL:
+ events.CancelEvent(EVENT_WIPE_CHECK);
+ Talk(SAY_ALLIANCE_DEFEAT);
+ if (Creature* pAllianceBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_SKYBREAKER_BOSS)))
+ {
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, pAllianceBoss);
+ }
+ if (Creature* pHordeBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ORGRIMMAR_HAMMER_BOSS)))
+ {
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, pHordeBoss);
+ }
+ StopFight(skybreaker, CheckUnfriendlyShip(me, _instance, DATA_GB_HIGH_OVERLORD_SAURFANG));
+ events.ScheduleEvent(EVENT_FAIL, 10000);
+ break;
+ case ACTION_MAGE_DIE:
+ //Check, if there really is no mage
+ if(me->GetEntry() != NPC_GB_SKYBREAKER_SORCERERS){
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) == IN_PROGRESS)
+ events.ScheduleEvent(EVENT_SPAWN_MAGE, 33000); // try timer
+ }
+ break;
+ case ACTION_ROCK_DIE:
+ ++RocketerDieCount;
+ if(RocketerDieCount == RocketerCount)
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) == IN_PROGRESS)
+ events.ScheduleEvent(EVENT_RESPAWN_ROCKETEER, 60000);
+ break;
+ case ACTION_AXES_RIFL_DIE:
+ ++RiflDieCount;
+ if(RiflDieCount == RiflCount)
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) == IN_PROGRESS)
+ events.ScheduleEvent(EVENT_RESPAWN_AXES_RIFLEMEN, 60000);
+ break;
+ }
+ }
+
+ void DamageTaken(Unit* /*attacker*/, uint32& damage)
+ {
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE && me->GetHealthPct() < 2.0f )
+ {
+ damage = 0;
+ }
+
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE && me->GetHealthPct() < 2.0f )
+ {
+ damage = 0;
+ me->AI()->DoAction(ACTION_FAIL);
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 pointId)
+ {
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (pointId = 1)
+ me->DespawnOrUnsummon(1000);
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ if (!HealthAbovePct(75))
+ {
+ me->SetHealth(me->GetMaxHealth() / 100 * 76); // find a better way to avoid the hardcore spell spam ....
+ DoCast(me, SPELL_TASTE_OF_BLOOD);
+ }
+
+ if (UpdateVictim())
+ {
+ if (!EventScheduled)
+ {
+ EventScheduled = true; // should temp fix the hardcore casting
+ events.ScheduleEvent(EVENT_RENDING_THROW, 3000);
+ }
+ }
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_WIPE_CHECK:
+ DoCheckFallingPlayer(me);
+ if (DoWipeCheck(skybreaker))
+ events.ScheduleEvent(EVENT_WIPE_CHECK, 3000);
+ else
+ me->AI()->DoAction(ACTION_FAIL);
+ break;
+ case EVENT_INTRO_ALLIANCE_1:
+ Talk(SAY_INTRO_ALLIANCE_0);
+ break;
+ case EVENT_START_FLY:
+ StartFlyShip(skybreaker);
+ break;
+ case EVENT_INTRO_ALLIANCE_2:
+ Talk(SAY_INTRO_ALLIANCE_1);
+ break;
+ case EVENT_INTRO_ALLIANCE_3:
+ Talk(SAY_INTRO_ALLIANCE_2);
+ StartFlyShip(CheckUnfriendlyShip(me, _instance, DATA_GB_HIGH_OVERLORD_SAURFANG));
+ break;
+ case EVENT_INTRO_ALLIANCE_4:
+ Talk(SAY_INTRO_ALLIANCE_3);
+ break;
+ case EVENT_INTRO_ALLIANCE_5:
+ StopFlyShip(skybreaker);
+ StopFlyShip(CheckUnfriendlyShip(me, _instance, DATA_GB_HIGH_OVERLORD_SAURFANG));
+ Talk(SAY_INTRO_ALLIANCE_4);
+ break;
+ case EVENT_INTRO_ALLIANCE_6:
+ Talk(SAY_INTRO_ALLIANCE_5);
+ SendMusicToPlayers(17289);
+ me->AI()->DoAction(ACTION_BATTLE_EVENT);
+ break;
+ case EVENT_INTRO_ALLIANCE_7:
+ if (Creature* pSaurfang = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_HIGH_OVERLORD_SAURFANG_NOT_VISUAL)))
+ {
+ pSaurfang->AI()->Talk(SAY_HIGH_OVERLORD_SAURFANG_NOT_VISUAL);
+ pSaurfang->SetReactState(REACT_PASSIVE);
+ pSaurfang->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ }
+ break;
+ case EVENT_INTRO_ALLIANCE_8:
+ Talk(SAY_INTRO_ALLIANCE_7);
+ break;
+ case EVENT_SUMMON_PORTAL:
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) == IN_PROGRESS)
+ {
+ events.ScheduleEvent(EVENT_BOARDING_TALK, 10000);
+ events.ScheduleEvent(EVENT_BOARDING_GUNSHIP, 2500); // TODO: Fix the timers
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_PORTAL, -15.51547f, -0.160213f, 28.87252f, 1.56211f);
+ CheckUnfriendlyShip(me, _instance, DATA_GB_HIGH_OVERLORD_SAURFANG)->AddNPCPassengerInInstance(NPC_GB_PORTAL, 47.55099f, -0.101778f, 37.61111f, 1.55138f);
+ }
+ break;
+ case EVENT_RENDING_THROW:
+ if (UpdateVictim())
+ if (me->getVictim()->IsWithinDistInMap(me, 50.0f, false)) // Todo: Fix the distance
+ {
+ DoCastVictim(SPELL_RENDING_THROW);
+ EventScheduled = false;
+ }
+ else
+ events.CancelEvent(EVENT_RENDING_THROW);
+ break;
+ case EVENT_TASTE_OF_BLOOD:
+ DoCast(me, SPELL_TASTE_OF_BLOOD);
+ break;
+ case EVENT_BOARDING_TALK:
+ Talk(SAY_BOARDING_SKYBREAKER_1);
+ break;
+ case EVENT_BOARDING_GUNSHIP:
+ if (Creature* pSaurfang = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_HIGH_OVERLORD_SAURFANG_NOT_VISUAL)))
+ {
+ pSaurfang->AI()->Talk(SAY_BOARDING_SKYBREAKER_SAURFANG);
+ }
+ if(Creature* Sergante = skybreaker->AddNPCPassengerInInstance(NPC_GB_KORKRON_SERGANTE, -15.51547f, -0.160213f, 20.87252f, 1.56211f))
+ {
+ Sergante->CastSpell(Sergante, SPELL_TELEPORT_VISUAL, true);
+ }
+ events.ScheduleEvent(EVENT_SUMMON_PORTAL, 90000);
+ events.ScheduleEvent(EVENT_BOARDING_REAVERS_MARINE, 3000);
+ count = 0;
+ break;
+ case EVENT_BOARDING_REAVERS_MARINE:
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) == IN_PROGRESS){
+ if(count <= SummonCount)
+ {
+ if(Creature* Reavers = skybreaker->AddNPCPassengerInInstance(NPC_GB_KORKRON_REAVERS, -15.51547f, -0.160213f, 20.87252f, 1.56211f))
+ {
+ Reavers->CastSpell(Reavers, SPELL_TELEPORT_VISUAL, true);
+ events.ScheduleEvent(EVENT_BOARDING_REAVERS_MARINE, 21000 / SummonCount);
+ ++count;
+ }
+ }
+ }
+ break;
+ case EVENT_OUTRO_ALLIANCE_1:
+ _instance->DoCompleteAchievement(RAID_MODE(IM_ON_A_BOAT_10,IM_ON_A_BOAT_25,IM_ON_A_BOAT_10,IM_ON_A_BOAT_25));
+ _instance->DoCastSpellOnPlayers(SPELL_ACHIEVEMENT_CHECK);
+ StartFlyShip(skybreaker);
+ StopFlyShip(CheckUnfriendlyShip(me,_instance,DATA_GB_HIGH_OVERLORD_SAURFANG));
+ break;
+ case EVENT_OUTRO_ALLIANCE_2:
+ StopFlyShip(skybreaker);
+ me->SummonGameObject(RAID_MODE(GO_CAPITAN_CHEST_A_10N, GO_CAPITAN_CHEST_A_25N, GO_CAPITAN_CHEST_A_10H, GO_CAPITAN_CHEST_A_25H), -590.200022f, 2241.193115f, 538.588269f, 0, 0, 0, 0, 0, 100000);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ me->GetMotionMaster()->MovePoint(0, -590.700f, 2213.01f, 539.1f);
+ break;
+ case EVENT_OUTRO_ALLIANCE_3:
+ me->GetMotionMaster()->MovePoint(1, -555.59f, 2213.01f, 539.28f);
+ break;
+ case EVENT_FAIL:
+ TeleportPlayers(map, ALLIANCE);
+ events.ScheduleEvent(EVENT_RESTART_EVENT, 2000);
+ _instance->SetBossState(DATA_GUNSHIP_EVENT, NOT_STARTED);
+ break;
+ case EVENT_RESTART_EVENT:
+ _instance->SetBossState(DATA_GUNSHIP_EVENT, FAIL);
+ RestartEvent(skybreaker, CheckUnfriendlyShip(me,_instance,DATA_GB_HIGH_OVERLORD_SAURFANG), map, ALLIANCE);
+ break;
+ case EVENT_SPAWN_MAGE:
+ if(me->GetEntry() != NPC_GB_SKYBREAKER_SORCERERS){
+ Talk(SAY_NEW_MAGE_SPAWNED);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_SORCERERS, -17.8356f, 0.031688f, 20.823f, 4.73231f);
+ }
+ break;
+ case EVENT_RESPAWN_ROCKETEER:
+ Talk(SAY_NEW_MORTAR_TEAM_SPAWNED);
+ if(RocketerCount == 2)
+ {
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -8.61003f, 15.483f, 20.4158f, 4.69854f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -27.9583f, 14.8875f, 20.4428f, 4.77865f);
+ }
+ if(RocketerCount == 4)
+ {
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -8.61003f, 15.483f, 20.4158f, 4.69854f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -27.9583f, 14.8875f, 20.4428f, 4.77865f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -15.61003f, 15.483f, 20.4158f, 4.69854f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MORTAR_SOLDIER, -20.9583f, 14.8875f, 20.4428f, 4.77865f);
+ }
+ break;
+ case EVENT_RESPAWN_AXES_RIFLEMEN:
+ Talk(SAY_NEW_RIFLEMEN_SPAWNED);
+ if(RiflCount == 4)
+ {
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -28.0876f, -22.9462f, 21.659f, 4.72416f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -21.7406f, -22.9462f, 21.659f, 4.72416f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -14.9806f, -22.9462f, 21.659f, 4.72416f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -5.15231f, -22.9462f, 21.659f, 4.72416f);
+ }
+ if(RiflCount == 6)
+ {
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -33.0876f, -22.9462f, 21.659f, 4.72416f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -28.0876f, -22.9462f, 21.659f, 4.72416f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -21.7406f, -22.9462f, 21.659f, 4.72416f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -14.9806f, -22.9462f, 21.659f, 4.72416f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, -5.15231f, -22.9462f, 21.659f, 4.72416f);
+ skybreaker->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_RIFLEMAN, 0.15231f, -22.9462f, 21.659f, 4.72416f);
+ }
+ break;
+ }
+ }
+
+ if (!me->GetCurrentSpell(CURRENT_MELEE_SPELL))
+ DoCastVictim(SPELL_CLEAVE);
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ Transport* skybreaker;
+ Map* map;
+ uint32 SummonCount;
+ EventMap events;
+ InstanceScript* _instance;
+ uint32 count;
+ uint32 RocketerDieCount;
+ uint32 RiflDieCount;
+ uint32 RocketerCount;
+ uint32 RiflCount;
+ bool EventScheduled;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_muradin_gunshipAI(pCreature);
+ }
+};
+
+class npc_gunship_skybreaker : public CreatureScript
+{
+ public:
+ npc_gunship_skybreaker() : CreatureScript("npc_gunship_skybreaker") { }
+
+ struct npc_gunship_skybreakerAI : public ScriptedAI
+ {
+ npc_gunship_skybreakerAI(Creature *creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
+ {
+ Reset();
+ }
+
+ void Reset()
+ {
+ ScriptedAI::Reset();
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetDisplayId(11686);
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ SetCombatMovement(false);
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (Transport* t = me->GetTransport())
+ DoShipExplosion(t);
+
+ if(_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
+ {
+ if (Creature* pMuradin = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_GB_MURADIN_BRONZEBEARD)))
+ pMuradin->AI()->DoAction(ACTION_FAIL);
+ }
+
+ else if(_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
+ {
+ if (Creature* pSaurfang = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_GB_HIGH_OVERLORD_SAURFANG)))
+ pSaurfang->AI()->DoAction(ACTION_DONE);
+ }
+ }
+
+ private:
+ EventMap events;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_gunship_skybreakerAI(pCreature);
+ }
+};
+
+class npc_gunship_orgrimmar : public CreatureScript
+{
+ public:
+ npc_gunship_orgrimmar() : CreatureScript("npc_gunship_orgrimmar") { }
+
+ struct npc_gunship_orgrimmarAI : public ScriptedAI
+ {
+ npc_gunship_orgrimmarAI(Creature *creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
+ {
+ Reset();
+ }
+
+ void Reset()
+ {
+ ScriptedAI::Reset();
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetDisplayId(11686);
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ SetCombatMovement(false);
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (Transport* t = me->GetTransport())
+ DoShipExplosion(t);
+
+ if(_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
+ {
+ if (Creature* pMuradin = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_GB_MURADIN_BRONZEBEARD)))
+ pMuradin->AI()->DoAction(ACTION_DONE);
+ }
+
+ else if(_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
+ {
+ if (Creature* pSaurfang = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_GB_HIGH_OVERLORD_SAURFANG)))
+ pSaurfang->AI()->DoAction(ACTION_FAIL);
+ }
+ }
+
+ private:
+ EventMap events;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_gunship_orgrimmarAI(pCreature);
+ }
+};
+
+/* Kro'kron Axethrower */
+class npc_korkron_axethrower_rifleman : public CreatureScript
+{
+ public:
+ npc_korkron_axethrower_rifleman() : CreatureScript("npc_korkron_axethrower_rifleman") { }
+
+ struct npc_korkron_axethrower_riflemanAI : public ScriptedAI
+ {
+ npc_korkron_axethrower_riflemanAI(Creature *creature) : ScriptedAI(creature),_instance(creature->GetInstanceScript())
+ {
+ Reset();
+ }
+
+ void Reset()
+ {
+ ScriptedAI::Reset();
+ DesperateResolve = RAID_MODE( SPELL_DESPERATE_RESOLVE_10_NM, SPELL_DESPERATE_RESOLVE_25_NM, SPELL_DESPERATE_RESOLVE_10_HM, SPELL_DESPERATE_RESOLVE_25_HM);
+ desperated = false;
+ me->RemoveAurasDueToSpell(SPELL_EXPERIENCED);
+ me->RemoveAurasDueToSpell(SPELL_ELITE);
+ me->RemoveAurasDueToSpell(SPELL_VETERAN);
+ events.ScheduleEvent(EVENT_EXPERIENCED, urand(19000, 21000)); // ~20 sec
+ events.ScheduleEvent(EVENT_VETERAN, urand(39000, 41000)); // ~40 sec
+ events.ScheduleEvent(EVENT_ELITE, urand(59000, 61000)); // ~60 sec
+ attacktimer = urand(6000, 15000);
+ if (me->GetEntry() == NPC_GB_SKYBREAKER_RIFLEMAN)
+ SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, 47267);
+ else
+ SetEquipmentSlots(false, 49691, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
+ }
+
+ void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
+ {
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE && me->GetHealthPct() < 20.0f && !desperated)
+ {
+ desperated = true;
+ DoCast(me, DesperateResolve);
+ }
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
+ {
+ if (Creature* pSaurfangBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_GB_HIGH_OVERLORD_SAURFANG)))
+ pSaurfangBoss->AI()->DoAction(ACTION_AXES_RIFL_DIE);
+ }
+
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
+ {
+ if (Creature* pMuradin = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_GB_MURADIN_BRONZEBEARD)))
+ pMuradin->AI()->DoAction(ACTION_AXES_RIFL_DIE);
+ }
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if (_instance->GetBossState(DATA_GUNSHIP_EVENT) != IN_PROGRESS)
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); // Dodato
+ me->AI()->AttackStart(SelectRandomPlayerInTheMaps(me->GetMap()));
+
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (attacktimer <= diff)
+ {
+ if(me->GetEntry() == NPC_GB_KORKRON_AXETHROWER)
+ DoCast(me->getVictim(), SPELL_HURL_AXE);
+ else if(me->GetEntry() == NPC_GB_SKYBREAKER_RIFLEMAN)
+ DoCast(me->getVictim(), SPELL_SHOOT);
+ attacktimer = urand(6000, 15000);
+ } else attacktimer -= diff;
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_EXPERIENCED:
+ DoCast(me, SPELL_EXPERIENCED);
+ break;
+ case EVENT_VETERAN:
+ me->RemoveAurasDueToSpell(SPELL_EXPERIENCED);
+ DoCast(me, SPELL_VETERAN);
+ break;
+ case EVENT_ELITE:
+ me->RemoveAurasDueToSpell(SPELL_VETERAN);
+ DoCast(me, SPELL_ELITE);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ uint32 DesperateResolve;
+ uint32 attacktimer;
+
+ private:
+ EventMap events;
+ bool desperated;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_korkron_axethrower_riflemanAI(pCreature);
+ }
+};
+
+class npc_sergeant : public CreatureScript
+{
+ public:
+ npc_sergeant() : CreatureScript("npc_sergeant") { }
+
+ struct npc_sergeantAI : public ScriptedAI
+ {
+ npc_sergeantAI(Creature *creature) : ScriptedAI(creature),_instance(creature->GetInstanceScript())
+ {
+ Reset();
+ }
+
+ void Reset()
+ {
+ ScriptedAI::Reset();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetReactState(REACT_PASSIVE);
+ events.ScheduleEvent(EVENT_WALK_MOBS, 1500);
+ desperated = false;
+ me->RemoveAurasDueToSpell(SPELL_EXPERIENCED);
+ me->RemoveAurasDueToSpell(SPELL_ELITE);
+ DesperateResolve = RAID_MODE( SPELL_DESPERATE_RESOLVE_10_NM, SPELL_DESPERATE_RESOLVE_25_NM, SPELL_DESPERATE_RESOLVE_10_HM, SPELL_DESPERATE_RESOLVE_25_HM);
+ events.ScheduleEvent(EVENT_EXPERIENCED, urand(19000, 21000)); // ~20 sec
+ events.ScheduleEvent(EVENT_VETERAN, urand(39000, 41000)); // ~40 sec
+ events.ScheduleEvent(EVENT_BURNING_PITCH, urand(60000, 62000));// ~61 sec
+ if(me->GetMap()->ToInstanceMap()->GetMaxPlayers() == 25 && me->GetMap()->IsHeroic())
+ events.ScheduleEvent(EVENT_ELITE, urand(59000, 61000)); // ~60 sec
+ }
+
+ void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
+ {
+ if (me->GetHealthPct() < 20.0f && !desperated)
+ {
+ desperated = true;
+ DoCast(me, DesperateResolve);
+ }
+ }
+
+ bool CanAIAttack(Unit const* target) const
+ {
+ if (target->GetEntry() == NPC_GB_GUNSHIP_HULL)
+ return false;
+
+ return true;
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) != IN_PROGRESS)
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_WALK_MOBS:
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetReactState(REACT_AGGRESSIVE);
+ switch (me->GetEntry())
+ {
+ case NPC_GB_KORKRON_SERGANTE:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, SPELL_ON_SKYBREAKERS_DECK))
+ {
+ me->GetMotionMaster()->MoveChase(target);
+ me->AI()->AttackStart(target);
+ }
+ break;
+ case NPC_GB_SKYBREAKER_SERGANTE:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, SPELL_ON_ORGRIMS_HAMMERS_DECK))
+ {
+ me->GetMotionMaster()->MoveChase(target);
+ me->AI()->AttackStart(target);
+ }
+ break;
+ }
+ events.ScheduleEvent(EVENT_WOUNDING_STRIKE, 5000);
+ events.ScheduleEvent(EVENT_BLADE_STORM, 3000);
+ break;
+ case EVENT_BURNING_PITCH:
+ if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
+ {
+ if (me->GetEntry() == NPC_GB_KORKRON_SERGANTE)
+ DoCast(pTarget, SPELL_BURNING_PITCH_H);
+ else
+ DoCast(pTarget, SPELL_BURNING_PITCH_A);
+ }
+ events.ScheduleEvent(EVENT_BURNING_PITCH, urand(60000, 62000));// ~61 sec
+ break;
+ case EVENT_EXPERIENCED:
+ DoCast(me, SPELL_EXPERIENCED);
+ break;
+ case EVENT_VETERAN:
+ me->RemoveAurasDueToSpell(SPELL_EXPERIENCED);
+ DoCast(me, SPELL_VETERAN);
+ break;
+ case EVENT_ELITE:
+ me->RemoveAurasDueToSpell(SPELL_VETERAN);
+ DoCast(me, SPELL_ELITE);
+ break;
+ case EVENT_WOUNDING_STRIKE:
+ if (UpdateVictim())
+ DoCastVictim( RAID_MODE( SPELL_WOUNDING_STRIKE_10_NM, SPELL_WOUNDING_STRIKE_25_NM, SPELL_WOUNDING_STRIKE_10_HM, SPELL_WOUNDING_STRIKE_25_HM));
+ events.ScheduleEvent(EVENT_WOUNDING_STRIKE, urand(5000, 8000));
+ break;
+ case EVENT_BLADE_STORM:
+ DoCast(me, SPELL_BLADESTORM);
+ events.ScheduleEvent(EVENT_BLADE_STORM, urand(9000, 16000));
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+
+ }
+ uint32 DesperateResolve;
+ bool desperated;
+
+ private:
+ EventMap events;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_sergeantAI(pCreature);
+ }
+};
+
+class npc_marine_or_reaver : public CreatureScript
+{
+ public:
+ npc_marine_or_reaver() : CreatureScript("npc_marine_or_reaver") { }
+
+ struct npc_marine_or_reaverAI : public ScriptedAI
+ {
+ npc_marine_or_reaverAI(Creature *creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
+ {
+ Reset();
+ }
+
+ void Reset()
+ {
+ ScriptedAI::Reset();
+ desperated = false;
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetReactState(REACT_PASSIVE);
+ events.ScheduleEvent(EVENT_WALK_MOBS, 1500);
+ me->RemoveAurasDueToSpell(SPELL_EXPERIENCED);
+ me->RemoveAurasDueToSpell(SPELL_ELITE);
+ DesperateResolve = RAID_MODE( SPELL_DESPERATE_RESOLVE_10_NM, SPELL_DESPERATE_RESOLVE_25_NM, SPELL_DESPERATE_RESOLVE_10_HM, SPELL_DESPERATE_RESOLVE_25_HM);
+ events.ScheduleEvent(EVENT_EXPERIENCED, urand(19000, 21000)); // ~20 sec
+ events.ScheduleEvent(EVENT_VETERAN, urand(39000, 41000)); // ~40 sec
+ events.ScheduleEvent(EVENT_BURNING_PITCH, urand(60000, 62000));// ~61 sec
+ }
+
+ void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
+ {
+ if (me->GetHealthPct() < 20.0f && !desperated)
+ {
+ desperated = true;
+ DoCast(me, DesperateResolve);
+ }
+ }
+
+ bool CanAIAttack(Unit const* target) const
+ {
+ if (target->GetEntry() == NPC_GB_GUNSHIP_HULL)
+ return false;
+
+ return true;
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) != IN_PROGRESS)
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_WALK_MOBS:
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetReactState(REACT_AGGRESSIVE);
+ switch (me->GetEntry())
+ {
+ case NPC_GB_KORKRON_REAVERS:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, SPELL_ON_SKYBREAKERS_DECK))
+ {
+ me->GetMotionMaster()->MoveChase(target);
+ me->AI()->AttackStart(target);
+ }
+ break;
+ case NPC_GB_SKYBREAKER_MARINE:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, SPELL_ON_ORGRIMS_HAMMERS_DECK))
+ {
+ me->GetMotionMaster()->MoveChase(target);
+ me->AI()->AttackStart(target);
+ }
+ break;
+ }
+ break;
+ case EVENT_BURNING_PITCH:
+ if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
+ {
+ if (me->GetEntry() == NPC_GB_KORKRON_REAVERS)
+ DoCast(pTarget, SPELL_BURNING_PITCH_H);
+ else
+ DoCast(pTarget, SPELL_BURNING_PITCH_A);
+ }
+ events.ScheduleEvent(EVENT_BURNING_PITCH, urand(60000, 62000));// ~61 sec
+ break;
+ case EVENT_EXPERIENCED:
+ DoCast(me, SPELL_EXPERIENCED);
+ break;
+ case EVENT_VETERAN:
+ me->RemoveAurasDueToSpell(SPELL_EXPERIENCED);
+ DoCast(me, SPELL_VETERAN);
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ uint32 DesperateResolve;
+ bool desperated;
+
+ private:
+ EventMap events;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_marine_or_reaverAI(pCreature);
+ }
+};
+
+class npc_gunship_mage : public CreatureScript
+{
+ public:
+ npc_gunship_mage() : CreatureScript("npc_gunship_mage") { }
+
+ struct npc_gunship_mageAI : public ScriptedAI
+ {
+ npc_gunship_mageAI(Creature *creature) : ScriptedAI(creature),_instance(creature->GetInstanceScript())
+ {
+ Reset();
+ }
+
+ void Reset()
+ {
+ ScriptedAI::Reset();
+ timer_BelowZero = urand(10000, 15000);
+ }
+
+ void DoAction(int32 action)
+ {
+ switch (action)
+ {
+ case EVENT_FREEZE_CANNON:
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
+ {
+
+ std::list<Creature*> cannonsA;
+ GetCreatureListWithEntryInGrid(cannonsA, me, NPC_GB_ALLIANCE_CANON, 500.0f);
+ for (std::list<Creature*>::iterator itr = cannonsA.begin(); itr != cannonsA.end(); ++itr)
+ {
+ if (Vehicle* veh = (*itr)->GetVehicleKit())
+ veh->RemoveAllPassengers();
+
+ DoCast((*itr),SPELL_BELOW_ZERO,true);
+ }
+ }
+ else if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
+ {
+ std::list<Creature*> cannonsH;
+ GetCreatureListWithEntryInGrid(cannonsH, me, NPC_GB_HORDE_CANON, 500.0f);
+ for (std::list<Creature*>::iterator itr = cannonsH.begin(); itr != cannonsH.end(); ++itr)
+ {
+ if (Vehicle* veh = (*itr)->GetVehicleKit())
+ veh->RemoveAllPassengers();
+
+ DoCast((*itr),SPELL_BELOW_ZERO,true);
+ }
+ }
+ break;
+ }
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
+ {
+ if (me->GetGUID() == _instance->GetData64(DATA_GB_BATTLE_MAGE))
+ {
+ if (Creature* pSaurfangBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_GB_HIGH_OVERLORD_SAURFANG)))
+ pSaurfangBoss->AI()->DoAction(ACTION_MAGE_DIE);
+ }
+ }
+
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
+ {
+ if (me->GetGUID() == _instance->GetData64(DATA_GB_BATTLE_MAGE))
+ {
+ if (Creature* pMuradin = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_GB_MURADIN_BRONZEBEARD)))
+ pMuradin->AI()->DoAction(ACTION_MAGE_DIE);
+ }
+ }
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) != IN_PROGRESS)
+ return;
+
+ me->SetReactState(REACT_DEFENSIVE); // Dodato
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ if (me->GetGUID() == _instance->GetData64(DATA_GB_BATTLE_MAGE))
+ {
+
+ if( timer_BelowZero <= diff)
+ {
+ me->AI()->DoAction(EVENT_FREEZE_CANNON);
+ timer_BelowZero = urand(10000, 15000);
+ } else timer_BelowZero -= diff;
+ }
+ else
+ {
+ DoCast(me,SPELL_SHADOW_CHANNELING);
+ }
+ }
+ uint32 timer_BelowZero;
+ private:
+ EventMap events;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_gunship_mageAI(pCreature);
+ }
+};
+
+/* Gunship Cannon (Horde / Ally) */
+class npc_gunship_cannon : public CreatureScript
+{
+ public:
+ npc_gunship_cannon() : CreatureScript("npc_gunship_cannon") { }
+
+ struct npc_gunship_cannonAI : public ScriptedAI
+ {
+ npc_gunship_cannonAI(Creature *creature) : ScriptedAI(creature) { }
+
+ void Reset()
+ {
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ DoCast(me, SPELL_HEAT_DRAIN, true);
+ }
+
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spellEntry)
+ {
+ if (spellEntry->Id == SPELL_BELOW_ZERO)
+ me->GetVehicleKit()->RemoveAllPassengers();
+ }
+
+ void DamageTaken(Unit* attacker, uint32& damage)
+ {
+ if(me->GetEntry() == NPC_GB_ALLIANCE_CANON)
+ {
+ if (Creature* pAllianceBoss = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetData64(DATA_SKYBREAKER_BOSS)))
+ attacker->DealDamage(pAllianceBoss, damage);
+ }
+
+ if(me->GetEntry() == NPC_GB_HORDE_CANON)
+ {
+ if (Creature* pHordeBoss = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetData64(DATA_ORGRIMMAR_HAMMER_BOSS)))
+ attacker->DealDamage(pHordeBoss, damage);
+ }
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if(me->HasAura(SPELL_BELOW_ZERO))
+ {
+ me->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ if (Vehicle* veh = me->GetVehicleKit())
+ veh->RemoveAllPassengers();
+ }
+ else
+ {
+ //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_FULL_SPEED_TURNING);
+ //me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING);
+ //me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_FULL_SPEED_PITCHING);
+
+ //Try
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveExtraUnitMovementFlag(MOVEMENTFLAG_STRAFE_LEFT);
+ me->RemoveExtraUnitMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT);
+ me->RemoveExtraUnitMovementFlag(MOVEMENTFLAG2_INTERPOLATED_TURNING);
+ me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_NO_STRAFE);
+ me->AddExtraUnitMovementFlag(MOVEMENTFLAG_LEFT);
+ me->AddExtraUnitMovementFlag(MOVEMENTFLAG_RIGHT);
+
+
+ }
+ }
+
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_gunship_cannonAI(pCreature);
+ }
+};
+
+class npc_mortar_soldier_or_rocketeer : public CreatureScript
+{
+ public:
+ npc_mortar_soldier_or_rocketeer() : CreatureScript("npc_mortar_soldier_or_rocketeer") { }
+
+ struct npc_mortar_soldier_or_rocketeerAI : public ScriptedAI
+ {
+ npc_mortar_soldier_or_rocketeerAI(Creature *creature) : ScriptedAI(creature),_instance(creature->GetInstanceScript())
+ {
+ Reset();
+ }
+
+ void Reset()
+ {
+ ScriptedAI::Reset();
+ me->RemoveAurasDueToSpell(SPELL_EXPERIENCED);
+ me->RemoveAurasDueToSpell(SPELL_ELITE);
+ me->RemoveAurasDueToSpell(SPELL_VETERAN);
+ events.ScheduleEvent(EVENT_EXPERIENCED, urand(19000, 21000)); // ~20 sec
+ events.ScheduleEvent(EVENT_VETERAN, urand(39000, 41000)); // ~40 sec
+ events.ScheduleEvent(EVENT_ELITE, urand(59000, 61000)); // ~60 sec
+ events.ScheduleEvent(EVENT_ROCKET_ART, urand(10000, 15000)); // ~12 sec
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
+ {
+ if (Creature* pSaurfangBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_GB_HIGH_OVERLORD_SAURFANG)))
+ pSaurfangBoss->AI()->DoAction(ACTION_ROCK_DIE);
+ }
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
+ {
+ if (Creature* pMuradin = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_GB_MURADIN_BRONZEBEARD)))
+ pMuradin->AI()->DoAction(ACTION_ROCK_DIE);
+ }
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) != IN_PROGRESS)
+ return;
+
+ me->SetReactState(REACT_DEFENSIVE); // Dodato
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_EXPERIENCED:
+ DoCast(me, SPELL_EXPERIENCED);
+ break;
+ case EVENT_VETERAN:
+ me->RemoveAurasDueToSpell(SPELL_EXPERIENCED);
+ DoCast(me, SPELL_VETERAN);
+ break;
+ case EVENT_ELITE:
+ me->RemoveAurasDueToSpell(SPELL_VETERAN);
+ DoCast(me, SPELL_ELITE);
+ break;
+ case EVENT_ROCKET_ART:
+ if(Player* target = SelectRandomPlayerInTheMaps(me->GetMap()))
+ {
+ if(me->GetEntry() == NPC_GB_KORKRON_ROCKETEER && target->HasAura(SPELL_ON_SKYBREAKERS_DECK))
+ {
+ me->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SPELL_ROCKET_ARTILLERY_TRIGGERED, true);
+ me->CastSpell(target, 69400, true);
+ }
+ else if(me->GetEntry() == NPC_GB_SKYBREAKER_MORTAR_SOLDIER && target->HasAura(SPELL_ON_ORGRIMS_HAMMERS_DECK))
+ {
+ me->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SPELL_ROCKET_ARTILLERY_TRIGGERED, true);
+ me->CastSpell(target, 70173, true);
+ }
+ }
+ events.ScheduleEvent(EVENT_ROCKET_ART, urand(10000, 15000)); // ~12 sec
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ private:
+ EventMap events;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_mortar_soldier_or_rocketeerAI(pCreature);
+ }
+};
+
+class npc_zafod_boombox : public CreatureScript
+{
+ public:
+ npc_zafod_boombox() : CreatureScript("npc_zafod_boombox") { }
+
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ // Maybe this isn't blizzlike but I can't find any spell in the DBCs
+ if (pPlayer->GetItemCount(49278, false) == 0)
+ pPlayer->ADD_GOSSIP_ITEM(0, "Yeah, I'm sure that safety is your top priority. Give me a jetpack.", 631, 1);
+ pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
+ }
+
+ bool OnGossipSelect(Player* player, Creature* pCreature, uint32 /*sender*/, uint32 action)
+ {
+ player->PlayerTalkClass->ClearMenus();
+ player->CLOSE_GOSSIP_MENU();
+ if (action == 1)
+ {
+ // Seurity, this shouldn't happen. Maybe useless.
+ uint32 curItemCount = player->GetItemCount(49278, false);
+ if (curItemCount >= 1)
+ {
+ pCreature->MonsterWhisper("You already have my jetpack!", player->GetGUIDLow());
+ return false;
+ }
+
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 49278, 1);
+ if (msg == EQUIP_ERR_OK)
+ {
+ Item* item = player->StoreNewItem(dest, 49278, true);
+ player->SendNewItem(item, 1, true, false);
+ }
+ else
+ {
+ pCreature->MonsterWhisper("You do not have empty space for my jet-pack!", player->GetGUIDLow());
+ return false;
+ }
+ }
+
+ return true;
+ }
+};
+
+//
+class npc_saurfang_gunship : public CreatureScript
+{
+ public:
+ npc_saurfang_gunship() : CreatureScript("npc_saurfang_gunship") { }
+
+ bool OnGossipHello(Player* player, Creature* pCreature)
+ {
+ InstanceScript* pInstance = pCreature->GetInstanceScript();
+ if (pInstance && pInstance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
+ {
+ if ((!player->GetGroup() || !player->GetGroup()->IsLeader(player->GetGUID())) && !player->isGameMaster())
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I'm not the raid leader...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, pCreature->GetGUID());
+ return true;
+ }
+
+ player->ADD_GOSSIP_ITEM(0, "My companions are all accounted for, Saurfang. Let's go!", 631, 1001);
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(pCreature), pCreature->GetGUID());
+ return true;
+ }
+ return false;
+ }
+
+ bool OnGossipSelect(Player* player, Creature* pCreature, uint32 /*sender*/, uint32 action)
+ {
+ InstanceScript* instance = pCreature->GetInstanceScript();
+ player->PlayerTalkClass->ClearMenus();
+ player->CLOSE_GOSSIP_MENU();
+
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
+ pCreature->MonsterSay("I'll wait for the raid leader.", LANG_UNIVERSAL, player->GetGUID());
+
+ if (action == 1001)
+ {
+ pCreature->AI()->DoAction(ACTION_INTRO_START);
+ pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ }
+ return true;
+ }
+ struct npc_saurfang_gunshipAI : public ScriptedAI
+ {
+ npc_saurfang_gunshipAI(Creature *creature) : ScriptedAI(creature),
+ _instance(creature->GetInstanceScript())
+ {
+ }
+
+ void Reset()
+ {
+ if (_instance->GetBossState(DATA_GUNSHIP_EVENT) == IN_PROGRESS)
+ return;
+ me->SetReactState(REACT_PASSIVE);
+ me->setFaction(1801);
+ events.Reset();
+ map = me->GetMap();
+ orgrimmar = me->GetTransport();
+ UpdateTransportMotionInMap(orgrimmar);
+ RocketerDieCount = 0;
+ AxesDieCount = 0;
+ SummonCount = RAID_MODE(3, 5, 4, 6);
+ count = 0;
+ RocketerCount = RAID_MODE(2, 4, 2, 4);
+ AxesCount = RAID_MODE(4, 6, 4, 6);
+ EventScheduled = false;
+ }
+
+ void SendMusicToPlayers(uint32 musicId) const
+ {
+ WorldPacket data(SMSG_PLAY_MUSIC, 4);
+ data << uint32(musicId);
+ SendPacketToPlayers(&data);
+ }
+
+ // Send packet to all players
+ void SendPacketToPlayers(WorldPacket const* data) const
+ {
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
+ if (!players.isEmpty())
+ for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
+ if (Player* player = itr->getSource())
+ player->GetSession()->SendPacket(data);
+ }
+
+ bool CanAIAttack(Unit const* target) const
+ {
+ if (target->GetEntry() == NPC_GB_SKYBREAKER_SERGANTE || target->GetEntry() == NPC_GB_SKYBREAKER_MARINE)
+ return true;
+
+ return false;
+ }
+
+ void DoAction(int32 action)
+ {
+ switch (action)
+ {
+ case ACTION_INTRO_START:
+ events.ScheduleEvent(EVENT_INTRO_HORDE_1, 1000);
+ events.ScheduleEvent(EVENT_INTRO_HORDE_1_1, 11000);
+ events.ScheduleEvent(EVENT_START_FLY, 5000);
+ events.ScheduleEvent(EVENT_INTRO_HORDE_2, 32000);
+ events.ScheduleEvent(EVENT_INTRO_HORDE_3, 51000);
+ events.ScheduleEvent(EVENT_INTRO_HORDE_4, 57000);
+ events.ScheduleEvent(EVENT_INTRO_HORDE_5, 62000);
+ break;
+ case ACTION_BATTLE_EVENT:
+ {
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
+ events.ScheduleEvent(EVENT_WIPE_CHECK, 5000);
+
+ Creature* pHordeBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ORGRIMMAR_HAMMER_BOSS));
+ Creature* pAllianceBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_SKYBREAKER_BOSS));
+
+ if (pHordeBoss && pAllianceBoss)
+ {
+ me->SetReactState(REACT_AGGRESSIVE);
+ pHordeBoss->SetInCombatWith(pAllianceBoss);
+ pAllianceBoss->SetInCombatWith(pHordeBoss);
+ pAllianceBoss->AddThreat(pHordeBoss, 0.0f);
+ pHordeBoss->AddThreat(pAllianceBoss, 0.0f);
+ _instance->SetBossState(DATA_GUNSHIP_EVENT, IN_PROGRESS);
+ events.ScheduleEvent(EVENT_SUMMON_PORTAL, 30000);
+ RelocateTransport(orgrimmar);
+ RelocateTransport(CheckUnfriendlyShip(me,_instance, DATA_GB_MURADIN_BRONZEBEARD));
+ }
+ else
+ me->AI()->DoAction(ACTION_FAIL);
+ break;
+ }
+ case ACTION_DONE:
+ if (Creature* pAllianceBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_SKYBREAKER_BOSS)))
+ {
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, pAllianceBoss);
+ }
+ if (Creature* pHordeBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ORGRIMMAR_HAMMER_BOSS)))
+ {
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, pHordeBoss);
+ }
+
+ me->SetReactState(REACT_PASSIVE);
+ _instance->SetBossState(DATA_GUNSHIP_EVENT, DONE);
+ _instance->DoCastSpellOnPlayers(SPELL_REMOVE_ROCKET_PACK);
+ Talk(SAY_HORDE_VICTORY);
+ StartFlyShip(CheckUnfriendlyShip(me, _instance, DATA_GB_MURADIN_BRONZEBEARD));
+ StopFight(orgrimmar,CheckUnfriendlyShip(me,_instance, DATA_GB_MURADIN_BRONZEBEARD));
+ events.CancelEvent(EVENT_WIPE_CHECK);
+ events.ScheduleEvent(EVENT_OUTRO_HORDE_1, 3500);
+ events.ScheduleEvent(EVENT_OUTRO_HORDE_2, 21000);
+ events.ScheduleEvent(EVENT_OUTRO_HORDE_3, 32000);
+ break;
+ case ACTION_FAIL:
+ events.CancelEvent(EVENT_WIPE_CHECK);
+ Talk(SAY_HORDE_DEFEAT);
+ if (Creature* pHordeBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ORGRIMMAR_HAMMER_BOSS)))
+ {
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, pHordeBoss);
+ }
+ if (Creature* pAllianceBoss = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_SKYBREAKER_BOSS)))
+ {
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, pAllianceBoss);
+ }
+ StopFight(orgrimmar,CheckUnfriendlyShip(me,_instance, DATA_GB_MURADIN_BRONZEBEARD));
+ events.ScheduleEvent(EVENT_FAIL, 10000);
+ break;
+ case ACTION_MAGE_DIE:
+ //Check, if there really is no mage
+ if(me->GetEntry() != NPC_GB_KORKRON_BATTLE_MAGE){
+ events.ScheduleEvent(EVENT_SPAWN_MAGE, 60000);
+ }
+ break;
+ case ACTION_ROCK_DIE:
+ ++RocketerDieCount;
+ if(RocketerDieCount == RocketerCount)
+ events.ScheduleEvent(EVENT_RESPAWN_ROCKETEER, 60000);
+ break;
+ case ACTION_AXES_RIFL_DIE:
+ ++AxesDieCount;
+ if(AxesDieCount == AxesCount)
+ events.ScheduleEvent(EVENT_RESPAWN_AXES_RIFLEMEN, 60000);
+ break;
+ }
+ }
+
+ void DamageTaken(Unit* /*attacker*/, uint32& damage)
+ {
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE && me->GetHealthPct() < 2.0f )
+ {
+ damage = 0;
+ }
+
+ if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE && me->GetHealthPct() < 2.0f )
+ {
+ damage = 0;
+ me->AI()->DoAction(ACTION_FAIL);
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 pointId)
+ {
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (pointId = 1)
+ me->DespawnOrUnsummon(1000);
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) == IN_PROGRESS)
+ {
+ if (!HealthAbovePct(75))
+ {
+ me->SetHealth(me->GetMaxHealth() / 100 * 76); // find a better way to avoid the hardcore spell spam ....
+ DoCast(me, SPELL_TASTE_OF_BLOOD);
+ }
+
+ if (UpdateVictim())
+ {
+ if (!EventScheduled)
+ {
+ events.ScheduleEvent(EVENT_RENDING_THROW, 1500);
+ EventScheduled = true;
+ }
+ }
+ }
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_WIPE_CHECK:
+ DoCheckFallingPlayer(me);
+ if (DoWipeCheck(orgrimmar))
+ events.ScheduleEvent(EVENT_WIPE_CHECK, 3000);
+ else
+ me->AI()->DoAction(ACTION_FAIL);
+ break;
+ case EVENT_INTRO_HORDE_1:
+ Talk(SAY_INTRO_HORDE_0);
+ StartFlyShip(orgrimmar);
+ break;
+ case EVENT_INTRO_HORDE_1_1:
+ Talk(SAY_INTRO_HORDE_0_1);
+ break;
+ case EVENT_START_FLY:
+ StartFlyShip(orgrimmar); // Try
+ break;
+ case EVENT_INTRO_HORDE_2:
+ StopFlyShip(orgrimmar);
+ StartFlyShip(CheckUnfriendlyShip(me, _instance, DATA_GB_MURADIN_BRONZEBEARD));
+ Talk(SAY_INTRO_HORDE_1);
+ break;
+ case EVENT_INTRO_HORDE_3:
+ StopFlyShip(CheckUnfriendlyShip(me, _instance, DATA_GB_MURADIN_BRONZEBEARD));
+ Talk(SAY_INTRO_HORDE_2);
+ break;
+ case EVENT_INTRO_HORDE_4:
+ SendMusicToPlayers(17289);
+ me->AI()->DoAction(ACTION_BATTLE_EVENT);
+ if (Creature* pMuradin = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MURADIN_BRONZEBEARD_NOT_VISUAL)))
+ {
+ pMuradin->AI()->Talk(SAY_MURADIN_BRONZEBEARD_NOT_VISUAL);
+ pMuradin->SetReactState(REACT_PASSIVE);
+ pMuradin->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ }
+ break;
+ case EVENT_INTRO_HORDE_5:
+ Talk(SAY_INTRO_HORDE_4);
+ break;
+ case EVENT_SUMMON_PORTAL:
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_PORTAL, 15.03016f, -7.00016f, 37.70952f, 1.55138f);
+ CheckUnfriendlyShip(me, _instance, DATA_MURADIN_BRONZEBEARD_NOT_VISUAL)->AddNPCPassengerInInstance(NPC_GB_PORTAL, 3.51547f, -0.160213f, 20.87252f, 3.05033f);
+ events.ScheduleEvent(EVENT_BOARDING_TALK, 10000);
+ events.ScheduleEvent(EVENT_BOARDING_GUNSHIP, 2500); // TODO: Fix the timers
+ break;
+ case EVENT_BOARDING_TALK:
+ Talk(SAY_BOARDING_ORGRIMS_HAMMER_1);
+ break;
+ case EVENT_BOARDING_GUNSHIP:
+ count = 0;
+ if (Creature* pSaurfang = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MURADIN_BRONZEBEARD_NOT_VISUAL)))
+ {
+ pSaurfang->AI()->Talk(SAY_BOARDING_SKYBREAKER_MURADIN);
+ }
+ if (Creature* Sergante = orgrimmar->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_SERGANTE, 15.03016f, -7.00016f, 37.70952f, 1.55138f))
+ {
+ Sergante->CastSpell(Sergante, SPELL_TELEPORT_VISUAL, true);
+ }
+ events.ScheduleEvent(EVENT_BOARDING_REAVERS_MARINE, 3000);
+ events.ScheduleEvent(EVENT_SUMMON_PORTAL, 90000);
+ break;
+ case EVENT_BOARDING_REAVERS_MARINE:
+ if(_instance->GetBossState(DATA_GUNSHIP_EVENT) == IN_PROGRESS){
+ if(count <= SummonCount)
+ {
+ if(Creature* Marine = orgrimmar->AddNPCPassengerInInstance(NPC_GB_SKYBREAKER_MARINE, 15.03016f, -7.00016f, 37.70952f, 1.55138f))
+ {
+ Marine->CastSpell(Marine, SPELL_TELEPORT_VISUAL, true);
+ count++;
+ events.ScheduleEvent(EVENT_BOARDING_REAVERS_MARINE, 2500);
+ }
+ }
+ }
+ break;
+ case EVENT_OUTRO_HORDE_1:
+ _instance->DoCompleteAchievement(RAID_MODE(IM_ON_A_BOAT_10,IM_ON_A_BOAT_25,IM_ON_A_BOAT_10,IM_ON_A_BOAT_25));
+ _instance->DoCastSpellOnPlayers(SPELL_ACHIEVEMENT_CHECK);
+ StartFlyShip(orgrimmar);
+ StopFlyShip(CheckUnfriendlyShip(me,_instance,DATA_GB_MURADIN_BRONZEBEARD));
+ break;
+ case EVENT_OUTRO_HORDE_2:
+ StopFlyShip(orgrimmar);
+ me->SummonGameObject(RAID_MODE(GO_CAPITAN_CHEST_H_10N, GO_CAPITAN_CHEST_H_25N, GO_CAPITAN_CHEST_H_10H, GO_CAPITAN_CHEST_H_25H), -590.200022f, 2241.193115f, 539.588269f, 0, 0, 0, 0, 0, 100000);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ me->GetMotionMaster()->MovePoint(0, -590.700f, 2213.01f, 539.1f);
+ break;
+ case EVENT_OUTRO_HORDE_3:
+ me->GetMotionMaster()->MovePoint(1, -555.59f, 2213.01f, 539.28f);
+ break;
+ case EVENT_FAIL:
+ TeleportPlayers(map, HORDE);
+ events.ScheduleEvent(EVENT_RESTART_EVENT, 2000);
+ _instance->SetBossState(DATA_GUNSHIP_EVENT, NOT_STARTED);
+ break;
+ case EVENT_RESTART_EVENT:
+ _instance->SetBossState(DATA_GUNSHIP_EVENT, FAIL);
+ RestartEvent(orgrimmar, CheckUnfriendlyShip(me,_instance,DATA_GB_MURADIN_BRONZEBEARD), map, HORDE);
+ break;
+ case EVENT_RENDING_THROW:
+ if (UpdateVictim())
+ if (me->getVictim()->IsWithinDistInMap(me, 50.0f, false)) // Todo: Fix the distance
+ {
+ DoCastVictim(SPELL_RENDING_THROW);
+ EventScheduled = false;
+ }
+ else
+ events.CancelEvent(EVENT_RENDING_THROW);
+ break;
+ case EVENT_SPAWN_MAGE:
+ //Prevent from spawning multiple Mages
+ if(me->GetEntry() != NPC_GB_KORKRON_BATTLE_MAGE){
+ Talk(SAY_NEW_BATTLE_MAGE_SPAWNED);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_BATTLE_MAGE, 15.03016f, 0.00016f, 37.70952f, 1.55138f);
+ }
+ break;
+ case EVENT_RESPAWN_ROCKETEER:
+ Talk(SAY_NEW_ROCKETEERS_SPAWNED);
+ if(RocketerCount == 2)
+ {
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, -11.44849f, -25.71838f, 33.64343f, 1.49248f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, 12.30336f, -25.69653f, 35.32373f, 1.49248f);
+ }
+ if(RocketerCount == 4)
+ {
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, -11.44849f, -25.71838f, 33.64343f, 1.49248f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, 12.30336f, -25.69653f, 35.32373f, 1.49248f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, -3.44849f, -25.71838f, 34.21082f, 1.49248f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_ROCKETEER, 3.30336f, -25.69653f, 35.32373f, 1.49248f);
+ }
+ break;
+ case EVENT_RESPAWN_AXES_RIFLEMEN:
+ Talk(SAY_NEW_AXETHROWER_SPAWNED);
+ if(AxesCount == 4)
+ {
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -3.170555f, 28.30652f, 34.21082f, 1.66527f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -12.0928f, 27.65942f, 33.58557f, 1.66527f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 14.92804f, 26.18018f, 35.47803f, 1.66527f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 24.70331f, 25.36584f, 35.97845f, 1.66527f);
+ }
+ if(AxesCount == 6)
+ {
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -3.170555f, 28.30652f, 34.21082f, 1.66527f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -12.0928f, 27.65942f, 33.58557f, 1.66527f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 14.92804f, 26.18018f, 35.47803f, 1.66527f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 24.70331f, 25.36584f, 35.97845f, 1.66527f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, 19.92804f, 27.18018f, 35.47803f, 1.66527f);
+ orgrimmar->AddNPCPassengerInInstance(NPC_GB_KORKRON_AXETHROWER, -7.70331f, 28.36584f, 33.88557f, 1.66527f);
+ }
+ break;
+ }
+ }
+
+ if (!me->GetCurrentSpell(CURRENT_MELEE_SPELL))
+ DoCastVictim(SPELL_CLEAVE);
+
+ DoMeleeAttackIfReady();
+ }
+
+
+ private:
+ Transport* orgrimmar;
+ uint32 RocketerDieCount;
+ uint32 AxesDieCount;
+ uint32 RocketerCount;
+ uint32 AxesCount;
+ uint32 SummonCount;
+ uint32 count;
+ bool EventScheduled;
+ Map* map;
+ EventMap events;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_saurfang_gunshipAI(pCreature);
+ }
+};
+
+class npc_gunship_portal : public CreatureScript
+{
+ public:
+ npc_gunship_portal() : CreatureScript("npc_gunship_portal") { }
+
+ struct npc_gunship_portalAI : public ScriptedAI
+ {
+ npc_gunship_portalAI(Creature *creature) : ScriptedAI(creature),_instance(creature->GetInstanceScript())
+ {
+ Reset();
+ }
+
+ void Reset()
+ {
+ events.ScheduleEvent(EVENT_UNSUMMON_PORTAL, 20500); // TODO: Fix the timers
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ me->RemoveFromWorld();
+ }
+
+ void UpdateAI( const uint32 diff)
+ {
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_UNSUMMON_PORTAL:
+ me->RemoveFromWorld();
+ break;
+ }
+ }
+ }
+
+ private:
+ EventMap events;
+ InstanceScript* _instance;
+
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_gunship_portalAI(pCreature);
+ }
+};
+
+
+class npc_gunship_trigger : public CreatureScript
+{
+ public:
+ npc_gunship_trigger() : CreatureScript("npc_gunship_trigger") { }
+
+ struct npc_gunship_triggerAI : public ScriptedAI
+ {
+ npc_gunship_triggerAI(Creature *creature) : ScriptedAI(creature),_instance(creature->GetInstanceScript())
+ {
+
+ Reset();
+ }
+
+ void Reset()
+ {
+ ScriptedAI::Reset();
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ SetCombatMovement(false);
+ }
+
+ void DamageTaken(Unit* attacker, uint32& damage)
+ {
+ damage = 0;
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+
+ }
+
+ private:
+ EventMap events;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_gunship_triggerAI(pCreature);
+ }
+};
+
+/* ----------------------------------- Rampart of Skulls NPCs ----------------------------------- */
+
+/* Kor'kron Primalist 37030*/
+class npc_korkron_primalist: public CreatureScript
+{
+ public:
+ npc_korkron_primalist() : CreatureScript("npc_korkron_primalist") { }
+
+ struct npc_korkron_primalistAI : public ScriptedAI
+ {
+ npc_korkron_primalistAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ }
+
+ void Reset()
+ {
+ _started = instance->GetBossState(DATA_GUNSHIP_EVENT) == DONE;
+ events.Reset();
+ events.ScheduleEvent(EVENT_WRATH, 10000); // TODO: Fix the timers
+ events.ScheduleEvent(EVENT_HEAL, 20000); // TODO: Fix the timers
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if (!instance)
+ return;
+
+ if (instance->GetData(DATA_TEAM_IN_INSTANCE) != HORDE)
+ return;
+
+ if (who->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if (instance->GetData(DATA_FIRST_SQUAD_STATE) == DONE)
+ return;
+
+ if (!_started && me->IsWithinDistInMap(who, 25.0f))
+ {
+ _started = true;
+ events.ScheduleEvent(EVENT_FIRST_SQUAD_ASSISTED_1, 1000);
+ events.ScheduleEvent(EVENT_FIRST_SQUAD_ASSISTED_2, 15000); // TODO : fix the timer
+ }
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if (!instance)
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_FIRST_SQUAD_ASSISTED_1:
+ Talk(SAY_FIRST_SQUAD_RESCUED_HORDE_0);
+ break;
+ case EVENT_FIRST_SQUAD_ASSISTED_2:
+ if (Creature* tempUnit = me->FindNearestCreature(NPC_KORKRON_INVOKER, 120.0f, true))
+ {
+ tempUnit->AI()->Talk(SAY_FIRST_SQUAD_RESCUED_HORDE_1);
+ tempUnit->AI()->Talk(SAY_SUMMON_BATTLE_STANDARD);
+ tempUnit->CastSpell(tempUnit, SPELL_SUMMON_BATTLE_STANDART_H, true);
+ }
+ instance->SetData(DATA_FIRST_SQUAD_STATE, DONE);
+ break;
+ case EVENT_WRATH:
+ if (UpdateVictim())
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 10.0f))
+ DoCast(target, SPELL_WRATH);
+ events.ScheduleEvent(EVENT_WRATH, 10000);
+ break;
+ case EVENT_HEAL:
+ if (UpdateVictim())
+ {
+ std::list<Unit*> TargetList;
+ Unit* finalTarget = me;
+ Trinity::AnyFriendlyUnitInObjectRangeCheck checker(me, me, 30.0f);
+ Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(me, TargetList, checker);
+ me->VisitNearbyObject(30.0f, searcher);
+ for (std::list<Unit*>::iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr)
+ if ((*itr)->GetHealthPct() < finalTarget->GetHealthPct())
+ finalTarget = *itr;
+
+ uint32 spellId = SPELL_HEALING_TOUCH;
+ uint32 healthPct = uint32(finalTarget->GetHealthPct());
+ if (healthPct > 15 && healthPct < 20)
+ spellId = (urand (0, 1) ? SPELL_REGROWTH : SPELL_HEALING_TOUCH);
+ else if (healthPct >= 20 && healthPct < 40)
+ spellId = SPELL_REGROWTH;
+ else if (healthPct > 40)
+ spellId = (urand(0, 1) ? SPELL_REJUVENATION : SPELL_REGROWTH);
+
+ me->CastSpell(finalTarget, spellId, false);
+ events.ScheduleEvent(EVENT_HEAL, 20000);
+ }
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ bool _started;
+ EventMap events;
+ InstanceScript* instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_korkron_primalistAI(pCreature);
+ }
+};
+
+/* Kor'kron Defender 37032*/
+class npc_korkron_defender: public CreatureScript
+{
+ public:
+ npc_korkron_defender() : CreatureScript("npc_korkron_defender") { }
+
+ struct npc_korkron_defenderAI : public ScriptedAI
+ {
+ npc_korkron_defenderAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ }
+
+ void Reset()
+ {
+ events.Reset();
+ events.ScheduleEvent(EVENT_DEVASTATE, 10000);
+ events.ScheduleEvent(EVENT_THUNDERCLAP, 20000);
+ events.ScheduleEvent(EVENT_SPELL_REFLECT, 25000);
+ events.ScheduleEvent(EVENT_SUNDER_ARMOR, 15000);
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if (!instance)
+ return;
+
+ if (instance->GetData(DATA_TEAM_IN_INSTANCE) != HORDE)
+ return;
+
+ if (who->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if (me->IsWithinDistInMap(who, 25.0f))
+ {
+ if (instance->GetData(DATA_FIRST_SQUAD_STATE) == DONE && instance->GetData(DATA_SECOND_SQUAD_STATE) != DONE)
+ {
+ instance->SetData(DATA_SECOND_SQUAD_STATE, DONE);
+ events.ScheduleEvent(EVENT_SECOND_SQUAD_ASSISTED_1, 1000);
+ events.ScheduleEvent(EVENT_SECOND_SQUAD_ASSISTED_2, 15000); // TODO : fix the timer
+ }
+ }
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if (!instance)
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_SECOND_SQUAD_ASSISTED_1:
+ Talk(SAY_SECOND_SQUAD_RESCUED_HORDE_0);
+ break;
+ case EVENT_SECOND_SQUAD_ASSISTED_2:
+ Talk(SAY_SECOND_SQUAD_RESCUED_HORDE_1);
+ Talk(SAY_FROSTWYRM_SUMMON_0);
+ break;
+ case EVENT_DEVASTATE:
+ if (UpdateVictim())
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ DoCast(target, SPELL_DEVASTATE);
+ }
+ events.ScheduleEvent(EVENT_DEVASTATE, 10000);
+ break;
+ case EVENT_SPELL_REFLECT:
+ if (UpdateVictim())
+ {
+ DoCast(me, SPELL_SPELL_REFLECT);
+ }
+ events.ScheduleEvent(EVENT_SPELL_REFLECT, 25000);
+ break;
+ case EVENT_THUNDERCLAP:
+ if (UpdateVictim())
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
+ DoCast(target, SPELL_THUNDERCLAP);
+ }
+ events.ScheduleEvent(EVENT_THUNDERCLAP, 20000);
+ break;
+ case EVENT_SUNDER_ARMOR:
+ if (UpdateVictim())
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
+ DoCast(target, SPELL_SUNDER_ARMOR);
+ }
+ events.ScheduleEvent(EVENT_SUNDER_ARMOR, 15000);
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ EventMap events;
+ InstanceScript* instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_korkron_defenderAI(pCreature);
+ }
+};
+
+/* Skybreaker Vindicator 37003*/
+class npc_skybreaker_vindicator: public CreatureScript
+{
+ public:
+ npc_skybreaker_vindicator() : CreatureScript("npc_skybreaker_vindicator") { }
+
+ struct npc_skybreaker_vindicatorAI : public ScriptedAI
+ {
+ npc_skybreaker_vindicatorAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ }
+
+ void Reset()
+ {
+ _started = instance->GetBossState(DATA_GUNSHIP_EVENT) == DONE;
+ events.Reset();
+ events.ScheduleEvent(EVENT_AVENGERS_SHILED, 10000); // TODO: Fix the timers
+ events.ScheduleEvent(EVENT_CONCENTRATION, 20000); // TODO: Fix the timers
+ events.ScheduleEvent(EVENT_HOLY_WRATH, 20000); // TODO: Fix the timers
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if (!instance)
+ return;
+
+ if (instance->GetData(DATA_TEAM_IN_INSTANCE) != ALLIANCE)
+ return;
+
+ if (who->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if (instance->GetData(DATA_FIRST_SQUAD_STATE) == DONE)
+ return;
+
+ if (!_started && me->IsWithinDistInMap(who, 25.0f))
+ {
+ _started = true;
+ events.ScheduleEvent(EVENT_FIRST_SQUAD_ASSISTED_1, 1000);
+ events.ScheduleEvent(EVENT_FIRST_SQUAD_ASSISTED_2, 15000); // TODO : fix the timer
+ }
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if (!instance)
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_FIRST_SQUAD_ASSISTED_1:
+ Talk(SAY_FIRST_SQUAD_RESCUED_ALLIANCE_0);
+ break;
+ case EVENT_FIRST_SQUAD_ASSISTED_2:
+ if (Creature* tempUnit = me->FindNearestCreature(NPC_GB_SKYBREAKER_SORCERER, 120.0f, true))
+ {
+ tempUnit->AI()->Talk(SAY_FIRST_SQUAD_RESCUED_ALLIANCE_1);
+ tempUnit->AI()->Talk(SAY_SUMMON_BATTLE_STANDARD);
+ tempUnit->CastSpell(tempUnit, SPELL_SUMMON_BATTLE_STANDART_A, true);
+ }
+ instance->SetData(DATA_FIRST_SQUAD_STATE, DONE);
+ break;
+ case EVENT_AVENGERS_SHILED:
+ if (UpdateVictim())
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 10.0f))
+ DoCast(target, SPELL_WRATH);
+ events.ScheduleEvent(EVENT_AVENGERS_SHILED, 10000);
+ break;
+ case EVENT_CONCENTRATION:
+ if (UpdateVictim())
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 10.0f))
+ DoCast(target, SPELL_CONCENTRATION);
+ events.ScheduleEvent(EVENT_CONCENTRATION, 20000);
+ break;
+ case EVENT_HOLY_WRATH:
+ if (UpdateVictim())
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 10.0f))
+ DoCast(target, SPELL_HOLY_WRATH);
+ events.ScheduleEvent(EVENT_HOLY_WRATH, 15000);
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ bool _started;
+ EventMap events;
+ InstanceScript* instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_skybreaker_vindicatorAI(pCreature);
+ }
+};
+
+/* Skybreaker Protector 36998*/
+class npc_skybreaker_protector: public CreatureScript
+{
+ public:
+ npc_skybreaker_protector() : CreatureScript("npc_skybreaker_protector") { }
+
+ struct npc_skybreaker_protectorAI : public ScriptedAI
+ {
+ npc_skybreaker_protectorAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ }
+
+ void Reset()
+ {
+ events.Reset();
+ events.ScheduleEvent(EVENT_DEVASTATE, 10000);
+ events.ScheduleEvent(EVENT_THUNDERCLAP, 20000);
+ events.ScheduleEvent(EVENT_SPELL_REFLECT, 25000);
+ events.ScheduleEvent(EVENT_SUNDER_ARMOR, 15000);
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if (!instance)
+ return;
+
+ if (instance->GetData(DATA_TEAM_IN_INSTANCE) != ALLIANCE)
+ return;
+
+ if (who->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if (me->IsWithinDistInMap(who, 25.0f))
+ {
+ if (instance->GetData(DATA_FIRST_SQUAD_STATE) == DONE && instance->GetData(DATA_SECOND_SQUAD_STATE) != DONE)
+ {
+ instance->SetData(DATA_SECOND_SQUAD_STATE, DONE);
+ events.ScheduleEvent(EVENT_SECOND_SQUAD_ASSISTED_1, 1000);
+ events.ScheduleEvent(EVENT_SECOND_SQUAD_ASSISTED_2, 11000); // TODO : fix the timer
+ events.ScheduleEvent(EVENT_SECOND_SQUAD_ASSISTED_3, 17000); // TODO : fix the timer
+ }
+ }
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if (!instance)
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_SECOND_SQUAD_ASSISTED_1:
+ Talk(SAY_SECOND_SQUAD_RESCUED_ALLIANCE_0);
+ break;
+ case EVENT_SECOND_SQUAD_ASSISTED_2:
+ Talk(SAY_SECOND_SQUAD_RESCUED_ALLIANCE_1);
+ break;
+ case EVENT_SECOND_SQUAD_ASSISTED_3:
+ Talk(SAY_SECOND_SQUAD_RESCUED_ALLIANCE_2);
+ Talk(SAY_FROSTWYRM_SUMMON_1);
+ break;
+ case EVENT_DEVASTATE:
+ if (UpdateVictim())
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ DoCast(target, SPELL_DEVASTATE);
+ }
+ events.ScheduleEvent(EVENT_DEVASTATE, 10000);
+ break;
+ case EVENT_SPELL_REFLECT:
+ if (UpdateVictim())
+ {
+ DoCast(me, SPELL_SPELL_REFLECT);
+ }
+ events.ScheduleEvent(EVENT_SPELL_REFLECT, 25000);
+ break;
+ case EVENT_THUNDERCLAP:
+ if (UpdateVictim())
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
+ DoCast(target, SPELL_THUNDERCLAP);
+ }
+ events.ScheduleEvent(EVENT_THUNDERCLAP, 20000);
+ break;
+ case EVENT_SUNDER_ARMOR:
+ if (UpdateVictim())
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
+ DoCast(target, SPELL_SUNDER_ARMOR);
+ }
+ events.ScheduleEvent(EVENT_SUNDER_ARMOR, 15000);
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ EventMap events;
+ InstanceScript* instance;
+ };
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_skybreaker_protectorAI(pCreature);
+ }
+};
+
+
+/* Spire Frostwyrm 37230*/
+class npc_icc_spire_frostwyrm: public CreatureScript
+{
+ public:
+ npc_icc_spire_frostwyrm() : CreatureScript("npc_icc_spire_frostwyrm") { }
+
+ struct npc_icc_spire_frostwyrmAI : public ScriptedAI
+ {
+ npc_icc_spire_frostwyrmAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ }
+
+ void Reset()
+ {
+ landed = false;
+ events.Reset();
+ me->SetCanFly(true);
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
+ events.ScheduleEvent(EVENT_FROST_BREATH, 20000);
+ events.ScheduleEvent(EVENT_BLIZZARD, 25000);
+ events.ScheduleEvent(EVENT_CLEAVE, 10000);
+ }
+
+ void MoveInLineOfSight(Unit* who)
+ {
+ if (!instance)
+ return;
+
+ if (who->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if (!who->isTargetableForAttack())
+ return;
+
+ if (!landed && me->IsWithinDistInMap(who, 35.0f))
+ {
+ if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
+ Talk(SAY_FROSTWYRM_LAND_H_0);
+ else
+ Talk(SAY_FROSTWYRM_LAND_A_1);
+ landed = true;
+ me->SetCanFly(true);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
+ me->SetInCombatWith(who);
+ me->AddThreat(who, 1.0f);
+ me->GetMotionMaster()->MoveChase(who);
+ }
+ }
+
+ void UpdateAI(uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_FROST_BREATH:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 10.0f))
+ DoCast(target, SPELL_FROST_BREATH);
+ events.ScheduleEvent(EVENT_FROST_BREATH, 20000);
+ break;
+ case EVENT_BLIZZARD:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 10.0f))
+ DoCast(target, SPELL_BLIZZARD);
+ events.ScheduleEvent(EVENT_BLIZZARD, 25000);
+ break;
+ case EVENT_CLEAVE:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 10.0f))
+ DoCast(target, SPELL_FROST_CLEAVE);
+ events.ScheduleEvent(EVENT_CLEAVE, 10000);
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ bool landed;
+ EventMap events;
+ InstanceScript* instance;
+ };
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_icc_spire_frostwyrmAI(pCreature);
+ }
+};
+
+/* ---------------------------------- AreaTrigger Scripts ------------------------------------- */
+class at_icc_land_frostwyrm : public AreaTriggerScript
+{
+ public:
+ at_icc_land_frostwyrm() : AreaTriggerScript("at_icc_land_frostwyrm") { }
+
+ bool OnTrigger(Player* player, AreaTriggerEntry const* areaTrigger)
+ {
+ if (InstanceScript* instance = player->GetInstanceScript())
+ {
+ if (instance->GetData(DATA_SPIRE_FROSTWYRM_STATE) == NOT_STARTED && instance->GetData(DATA_SECOND_SQUAD_STATE) == DONE)
+ {
+ if (instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
+ player->GetMap()->SummonCreature(NPC_SPIRE_FROSTWYRM, FrostWyrmPosA);
+ else
+ player->GetMap()->SummonCreature(NPC_SPIRE_FROSTWYRM, FrostWyrmPosH);
+
+ instance->SetData(DATA_SPIRE_FROSTWYRM_STATE, IN_PROGRESS);
+ }
+ }
+
+ return true;
+ }
+};
+
+/* transport script */
+class transport_gunship : public TransportScript
+{
+ public:
+ transport_gunship() : TransportScript("transport_gunship") { }
+
+ void OnRelocate(Transport* transport, uint32 waypointId, uint32 mapId, float x, float y, float z)
+ {
+ }
+
+ void OnAddPassenger(Transport* transport, Player* player)
+ {
+ if (!transport || !player)
+ return;
+
+ switch (transport->GetEntry())
+ {
+ case GO_THE_SKYBREAKER_ALLIANCE_ICC:
+ player->AddAura(SPELL_ON_SKYBREAKERS_DECK, player);
+ break;
+ case GO_ORGRIM_S_HAMMER_HORDE_ICC:
+ player->AddAura(SPELL_ON_ORGRIMS_HAMMERS_DECK, player);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void OnRemovePassenger(Transport* /*transport*/, Player* player)
+ {
+ if (!player)
+ return;
+
+ player->RemoveAurasDueToSpell(SPELL_ON_ORGRIMS_HAMMERS_DECK);
+ player->RemoveAurasDueToSpell(SPELL_ON_SKYBREAKERS_DECK);
+ }
+};
+
+/* Remove Rocket Pack - 70713 */
+class spell_icc_remove_rocket_pack : public SpellScriptLoader
+{
+ public:
+ spell_icc_remove_rocket_pack() : SpellScriptLoader("spell_icc_remove_rocket_pack") { }
+
+ class spell_icc_remove_rocket_pack_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_icc_remove_rocket_pack_SpellScript);
+
+ void HandleEffect(SpellEffIndex /*effIndex*/)
+ {
+ Player* hitPlr = GetHitPlayer();
+ if (!hitPlr) // If player is offline
+ return;
+
+ int32 itemId = GetEffectValue();
+ uint32 itemCount = hitPlr->GetItemCount(itemId, false); // Should be 1, but just in case.
+ hitPlr->DestroyItemCount(itemId, -itemCount, true, false);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_icc_remove_rocket_pack_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_icc_remove_rocket_pack_SpellScript();
+ }
+};
+
+/* spell 69471 Heat Drain */
+class spell_gb_heat_drain : public SpellScriptLoader
+{
+ public:
+ spell_gb_heat_drain() : SpellScriptLoader("spell_gb_heat_drain") { }
+
+ class spell_gb_heat_drain_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gb_heat_drain_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+
+ if (caster->GetPower(POWER_ENERGY) != 0)
+ caster->ModifyPower(POWER_ENERGY, -1);
+
+ if (caster->GetPower(POWER_ENERGY) >= 99)
+ caster->CastSpell(caster, SPELL_OVERHEAT, true);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_gb_heat_drain_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gb_heat_drain_SpellScript();
+ }
+};
+
+/* spell 69488 Overheat Drain */
+class spell_gb_overheat_drain : public SpellScriptLoader
+{
+ public:
+ spell_gb_overheat_drain() : SpellScriptLoader("spell_gb_overheat_drain") { }
+
+ class spell_gb_overheat_drain_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gb_overheat_drain_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+
+ if (caster->GetPower(POWER_ENERGY) >= 10)
+ caster->ModifyPower(POWER_ENERGY, -10);
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_gb_overheat_drain_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gb_overheat_drain_SpellScript();
+ }
+};
+
+/* spell 69402 Incinerating Blast */
+class spell_gb_incinerating_blast : public SpellScriptLoader
+{
+ public:
+ spell_gb_incinerating_blast() : SpellScriptLoader("spell_gb_incinerating_blast") { }
+
+ class spell_gb_incinerating_blast_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gb_incinerating_blast_SpellScript);
+
+ void AddExtraDamage()
+ {
+ Unit* caster = GetCaster();
+ if (!caster || !caster->GetPower(POWER_ENERGY))
+ return;
+
+ SetHitDamage(int32(GetHitDamage() + (caster->GetPower(POWER_ENERGY) * 100.0f))); // TODO: How much should be?
+ caster->SetPower(POWER_ENERGY, 0);
+ }
+
+ void Register()
+ {
+ OnHit += SpellHitFn(spell_gb_incinerating_blast_SpellScript::AddExtraDamage);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gb_incinerating_blast_SpellScript();
+ }
+};
+
+/* spell 71335, 70339 Burning Pitch */
+class spell_gb_burning_pitch : public SpellScriptLoader
+{
+ public:
+ spell_gb_burning_pitch() : SpellScriptLoader("spell_gb_burning_pitch") { }
+
+ class spell_gb_burning_pitch_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gb_burning_pitch_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_BURNING_PITCH_SIEGE_DMG_A))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_BURNING_PITCH_SIEGE_DMG_H))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_BURNING_PITCH_AOE_DAMAGE))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ Unit* target = GetHitUnit();
+
+ if (!caster || !target)
+ return;
+
+ if (GetSpellInfo()->Id == SPELL_BURNING_PITCH_A)
+ caster->CastSpell(target, SPELL_BURNING_PITCH_SIEGE_DMG_A, true);
+ else
+ caster->CastSpell(target, SPELL_BURNING_PITCH_SIEGE_DMG_H, true);
+
+ caster->CastSpell(target, SPELL_BURNING_PITCH_AOE_DAMAGE, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gb_burning_pitch_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gb_burning_pitch_SpellScript();
+ }
+};
+
+/* Rocket Pack - 69188 */
+/* 68721 is a big red ball */
+/* 69193 is the damage when landing, it does not include the visual (which is 69192) */
+class spell_icc_rocket_pack : public SpellScriptLoader
+{
+ public:
+ spell_icc_rocket_pack() : SpellScriptLoader("spell_icc_rocket_pack") { }
+
+ class spell_icc_rocket_pack_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_icc_rocket_pack_SpellScript);
+
+ SpellCastResult CheckRequirement()
+ {
+ Unit* caster = GetOriginalCaster();
+ if (caster->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_FAILED_TARGET_NOT_PLAYER;
+
+ // The aura checks if the player has the aura that Zafod Boombox uses. (SPELL_EFFECT_APPLY_AREA_AURA_FRIEND)
+ if (!caster->ToPlayer()->HasAura(70348)) // Rocket Pack Useable
+ {
+ // May have a custom error message.
+ Spell::SendCastResult(caster->ToPlayer(), GetSpellInfo(), 0, SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW);
+ return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
+ }
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_icc_rocket_pack_SpellScript::CheckRequirement);
+ }
+ };
+
+ class spell_icc_rocket_pack_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_icc_rocket_pack_AuraScript);
+
+ void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, 69193, true);
+ // 69193 does trigger the visual AoE effect (69192) through DB
+ caster->RemoveAurasDueToSpell(69188); // spell_linked_spell
+ caster->RemoveAurasDueToSpell(68721); // spell_linked_spell
+ }
+
+ void Register()
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_icc_rocket_pack_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_icc_rocket_pack_SpellScript();
+ }
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_icc_rocket_pack_AuraScript();
+ }
+};
+
+void AddSC_boss_gunship_battle()
+{
+ new npc_muradin_gunship();
+ new npc_saurfang_gunship();
+ new npc_zafod_boombox();
+ new npc_korkron_axethrower_rifleman();
+ new npc_mortar_soldier_or_rocketeer();
+ new npc_gunship_mage();
+ new npc_gunship_cannon();
+ new npc_sergeant();
+ new npc_marine_or_reaver();
+ new npc_gunship_trigger();
+ new npc_gunship_portal();
+ new npc_korkron_primalist();
+ new npc_korkron_defender();
+ new npc_skybreaker_vindicator();
+ new npc_skybreaker_protector();
+ new npc_icc_spire_frostwyrm();
+ new at_icc_land_frostwyrm();
+ new npc_gunship_skybreaker();
+ new npc_gunship_orgrimmar();
+ new transport_gunship();
+ new spell_icc_remove_rocket_pack();
+ new spell_gb_heat_drain();
+ new spell_gb_overheat_drain();
+ new spell_gb_incinerating_blast();
+ new spell_gb_burning_pitch();
+ new spell_icc_rocket_pack();
+}
--
1.8.1.msysgit.1
From 251f980a231332ba850307cf6912051860dbfd09 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:41:30 +0300
Subject: [PATCH 06/14] Update Transport.cpp
---
src/server/game/Entities/Transport/Transport.cpp | 215 +++++++++++++++++++++--
1 file changed, 198 insertions(+), 17 deletions(-)
diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp
index 76c69a3..96ea273 100644
--- a/src/server/game/Entities/Transport/Transport.cpp
+++ b/src/server/game/Entities/Transport/Transport.cpp
@@ -1,19 +1,21 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ * Copyright (C) 2008-2013 Trinity <http://www.trinitycore.org/>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
+ * 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.
+ * 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, see <http://www.gnu.org/licenses/>.
+ * 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
+ *
+ * Updated by: Toba and Baeumchen (maddin)
*/
#include "Common.h"
@@ -27,6 +29,123 @@
#include "World.h"
#include "GameObjectAI.h"
#include "Player.h"
+#include "Vehicle.h"
+
+Transport* MapManager::LoadTransportInMap(Map* instance, uint32 goEntry, uint32 period)
+{
+ const GameObjectTemplate* goInfo = sObjectMgr->GetGameObjectTemplate(goEntry);
+
+ if (!goInfo)
+ {
+ return NULL;
+ }
+
+ if (goInfo->type != GAMEOBJECT_TYPE_MO_TRANSPORT)
+ {
+ return NULL;
+ }
+
+ Transport* t = new Transport(period, goInfo->ScriptId);
+ std::set<uint32> mapsUsed;
+ if (!t->GenerateWaypoints(goInfo->moTransport.taxiPathId, mapsUsed))
+ {
+ delete t;
+ return NULL;
+ }
+ uint32 transportLowGuid = sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT);
+
+ if (!t->Create(transportLowGuid, goEntry, t->m_WayPoints[0].mapid, t->m_WayPoints[0].x, t->m_WayPoints[0].y, t->m_WayPoints[0].z-10, 0.0f, 0, 0))
+ {
+ delete t;
+ return NULL;
+ }
+
+ m_Transports.insert(t);
+ m_TransportsByInstanceIdMap[instance->GetInstanceId()].insert(t);
+ t->SetMap(instance);
+ t->AddToWorld();
+
+ return t;
+}
+
+void MapManager::UnLoadTransportFromMap(Transport* t)
+{
+ Map* map = t->GetMap();
+
+ for (Transport::CreatureSet::iterator itr = t->m_NPCPassengerSet.begin(); itr != t->m_NPCPassengerSet.end();)
+ {
+ if (Creature* npc = *itr)
+ {
+ npc->SetTransport(NULL);
+ npc->setActive(false);
+ npc->RemoveFromWorld();
+ }
+ ++itr;
+ }
+
+ UpdateData transData;
+ t->BuildOutOfRangeUpdateBlock(&transData);
+ WorldPacket out_packet;
+ transData.BuildPacket(&out_packet);
+
+ for (Map::PlayerList::const_iterator itr = map->GetPlayers().begin(); itr != map->GetPlayers().end(); ++itr)
+ if (t != itr->getSource()->GetTransport())
+ itr->getSource()->SendDirectMessage(&out_packet);
+
+ t->m_NPCPassengerSet.clear();
+ m_TransportsByInstanceIdMap[t->GetInstanceId()].erase(t);
+ m_Transports.erase(t);
+ t->m_WayPoints.clear();
+ t->RemoveFromWorld();
+
+}
+
+void MapManager::LoadTransportForPlayers(Player* player)
+{
+ MapManager::TransportMap& tmap = sMapMgr->m_TransportsByInstanceIdMap;
+
+ UpdateData transData;
+
+ MapManager::TransportSet& tset = tmap[player->GetInstanceId()];
+
+ for (MapManager::TransportSet::const_iterator i = tset.begin(); i != tset.end(); ++i)
+ {
+ (*i)->BuildCreateUpdateBlockForPlayer(&transData, player);
+ }
+
+ WorldPacket packet;
+ transData.BuildPacket(&packet);
+ player->SendDirectMessage(&packet);
+}
+
+void MapManager::UnLoadTransportForPlayers(Player* player)
+{
+ MapManager::TransportMap& tmap = sMapMgr->m_TransportsByInstanceIdMap;
+
+ UpdateData transData;
+
+ MapManager::TransportSet& tset = tmap[player->GetInstanceId()];
+
+ for (MapManager::TransportSet::const_iterator i = tset.begin(); i != tset.end(); ++i)
+ {
+ for (Transport::CreatureSet::iterator itr = (*i)->m_NPCPassengerSet.begin(); itr != (*i)->m_NPCPassengerSet.end();)
+ {
+ if (Creature* npc = *itr)
+ {
+ npc->SetTransport(NULL);
+ npc->setActive(false);
+ npc->RemoveFromWorld();
+ }
+ ++itr;
+ }
+
+ (*i)->BuildOutOfRangeUpdateBlock(&transData);
+ }
+
+ WorldPacket packet;
+ transData.BuildPacket(&packet);
+ player->SendDirectMessage(&packet);
+}
void MapManager::LoadTransports()
{
@@ -85,9 +204,9 @@ void MapManager::LoadTransports()
uint32 mapid = t->m_WayPoints[0].mapid;
float o = 1.0f;
- // creates the Gameobject
- if (!t->Create(lowguid, entry, mapid, x, y, z, o, 255, 0))
- {
+ // creates the Gameobject -- Gunship
+ if (!t->Create(lowguid, entry, mapid, x, y, z, o, 100, 0))
+ {
delete t;
continue;
}
@@ -209,7 +328,8 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
SetObjectScale(goinfo->size);
SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
- SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
+ //SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); -- gunship
+ SetUInt32Value(GAMEOBJECT_FLAGS, MAKE_PAIR32(0x28, 0x64));
SetUInt32Value(GAMEOBJECT_LEVEL, m_period);
SetEntry(goinfo->entry);
@@ -549,6 +669,8 @@ void Transport::Update(uint32 p_diff)
{
Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z, GetAngle(m_next->second.x, m_next->second.y) + float(M_PI));
UpdatePassengerPositions(); // COME BACK MARKER
+ // This forces the server to update positions in transportation for players -- gunship
+ UpdatePlayerPositions();
}
sScriptMgr->OnRelocate(this, m_curr->first, m_curr->second.mapid, m_curr->second.x, m_curr->second.y, m_curr->second.z);
@@ -667,12 +789,50 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y,
}
else
currenttguid = std::max(tguid, currenttguid);
-
+ creature->setActive(true);
creature->SetGUIDTransport(tguid);
sScriptMgr->OnAddCreaturePassenger(this, creature);
return tguid;
}
+// gunship data
+Creature* Transport::AddNPCPassengerInInstance(uint32 entry, float x, float y, float z, float o, uint32 anim)
+{
+ Map* map = GetMap();
+ Creature* creature = new Creature;
+
+ if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, GetPhaseMask(), entry, 0, GetGOInfo()->faction, 0, 0, 0, 0))
+ {
+ delete creature;
+ return 0;
+ }
+
+ creature->SetTransport(this);
+ creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ creature->m_movementInfo.guid = GetGUID();
+ creature->m_movementInfo.t_pos.Relocate(x, y, z, o);
+
+ creature->Relocate(
+ GetPositionX() + (x * cos(GetOrientation()) + y * sin(GetOrientation() + float(M_PI))),
+ GetPositionY() + (y * cos(GetOrientation()) + x * sin(GetOrientation())),
+ z + GetPositionZ(),
+ o + GetOrientation());
+
+ creature->SetHomePosition(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
+
+ if (!creature->IsPositionValid())
+ {
+ delete creature;
+ return 0;
+ }
+
+ map->AddToMap(creature);
+ m_NPCPassengerSet.insert(creature);
+
+ creature->setActive(true);
+ sScriptMgr->OnAddCreaturePassenger(this, creature);
+ return creature;
+}
void Transport::UpdatePosition(MovementInfo* mi)
{
float transport_o = mi->pos.GetOrientation() - mi->t_pos.GetOrientation();
@@ -682,6 +842,7 @@ void Transport::UpdatePosition(MovementInfo* mi)
Relocate(transport_x, transport_y, transport_z, transport_o);
UpdatePassengerPositions();
+ UpdatePlayerPositions();
}
void Transport::UpdatePassengerPositions()
@@ -700,6 +861,26 @@ void Transport::UpdatePassengerPositions()
}
}
+// gunship Data
+void Transport::UpdatePlayerPositions()
+{
+ for (PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end(); ++itr)
+ {
+ Player* plr = *itr;
+
+ float x, y, z, o;
+ o = GetOrientation() + plr->m_movementInfo.t_pos.m_orientation;
+ x = GetPositionX() + (plr->m_movementInfo.t_pos.m_positionX * cos(GetOrientation()) + plr->m_movementInfo.t_pos.m_positionY * sin(GetOrientation() + M_PI));
+ y = GetPositionY() + (plr->m_movementInfo.t_pos.m_positionY * cos(GetOrientation()) + plr->m_movementInfo.t_pos.m_positionX * sin(GetOrientation()));
+ z = GetPositionZ() + plr->m_movementInfo.t_pos.m_positionZ;
+ plr->Relocate(x, y, z, o);
+ UpdateData transData;
+ WorldPacket packet;
+ transData.BuildPacket(&packet);
+ plr->SendDirectMessage(&packet);
+ }
+}
+
void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& o) const
{
float inx = x, iny = y, inz = z, ino = o;
--
1.8.1.msysgit.1
From 1553ccad0341aa7af281a329178a41bf32c1f842 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:41:54 +0300
Subject: [PATCH 07/14] Update Transport.h
---
src/server/game/Entities/Transport/Transport.h | 33 ++++++++++++++------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h
index bae0933..ce200c7 100644
--- a/src/server/game/Entities/Transport/Transport.h
+++ b/src/server/game/Entities/Transport/Transport.h
@@ -1,19 +1,21 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ * Copyright (C) 2008-2013 Trinity <http://www.trinitycore.org/>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
+ * 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.
+ * 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, see <http://www.gnu.org/licenses/>.
+ * 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
+ *
+ * Updated by: Toba and Baeumchen (maddin)
*/
#ifndef TRANSPORTS_H
@@ -46,8 +48,10 @@ class Transport : public GameObject, public TransportBase
typedef std::set<Creature*> CreatureSet;
CreatureSet m_NPCPassengerSet;
uint32 AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, float z, float o, uint32 anim=0);
+ Creature* AddNPCPassengerInInstance(uint32 entry, float x, float y, float z, float o, uint32 anim=0);
void UpdatePosition(MovementInfo* mi);
void UpdatePassengerPositions();
+ void UpdatePlayerPositions();
/// This method transforms supplied transport offsets into global coordinates
void CalculatePassengerPosition(float& x, float& y, float& z, float& o) const;
@@ -95,10 +99,9 @@ class Transport : public GameObject, public TransportBase
uint32 m_nextNodeTime;
private:
- void TeleportTransport(uint32 newMapid, float x, float y, float z);
- void UpdateForMap(Map const* map);
+ void TeleportTransport(uint32 newMapid, float x, float y, float z);
+ void UpdateForMap(Map const* map);
void DoEventIfAny(WayPointMap::value_type const& node, bool departure);
WayPointMap::const_iterator GetNextWayPoint();
};
#endif
-
--
1.8.1.msysgit.1
From ef8f501a4e0de5d733adcdefe6099118131e3428 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:42:32 +0300
Subject: [PATCH 08/14] Update Map.cpp
---
src/server/game/Maps/Map.cpp | 54 ++++++++++++++++++++++++++++++--------------
1 file changed, 37 insertions(+), 17 deletions(-)
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 98f0159..374c226 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -1,19 +1,21 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ * Copyright (C) 2008-2013 Trinity <http://www.trinitycore.org/>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
+ * 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.
+ * 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, see <http://www.gnu.org/licenses/>.
+ * 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
+ *
+ * Updated by: Toba and Baeumchen (maddin)
*/
#include "Map.h"
@@ -698,7 +700,7 @@ void Map::RemoveFromMap(T *obj, bool remove)
obj->UpdateObjectVisibility(true);
obj->RemoveFromGrid();
-
+ // gunship data
obj->ResetMap();
if (remove)
@@ -1676,7 +1678,25 @@ float Map::GetHeight(float x, float y, float z, bool checkVMap /*= true*/, float
return vmapHeight; // we have only vmapHeight (if have)
}
- return mapHeight; // explicitly use map data
+else
+
+ {
+
+ if (!checkVMap)
+
+ return mapHeight; // explicitly use map data (if have)
+
+ else if (mapHeight > INVALID_HEIGHT && (z < mapHeight + 2 || z == MAX_HEIGHT))
+
+ return mapHeight; // explicitly use map data if original z < mapHeight but map found (z+2 > mapHeight)
+
+ else
+
+ return VMAP_INVALID_HEIGHT_VALUE; // we not have any height
+
+ }
+
+ //return mapHeight; // explicitly use map data
}
inline bool IsOutdoorWMO(uint32 mogpFlags, int32 /*adtId*/, int32 /*rootId*/, int32 /*groupId*/, WMOAreaTableEntry const* wmoEntry, AreaTableEntry const* atEntry)
@@ -2421,7 +2441,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
// cannot enter other instances if bound permanently
if (playerBind->save != mapSave)
{
- sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is permanently bound to instance %s %d, %d, %d, %d, %d, %d but he is being put into instance %s %d, %d, %d, %d, %d, %d", player->GetName().c_str(), player->GetGUIDLow(), GetMapName(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), GetMapName(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is permanently bound to instance %d, %d, %d, %d, %d, %d but he is being put into instance %d, %d, %d, %d, %d, %d", player->GetName().c_str(), player->GetGUIDLow(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset());
return false;
}
}
@@ -2433,9 +2453,9 @@ bool InstanceMap::AddPlayerToMap(Player* player)
InstanceGroupBind* groupBind = group->GetBoundInstance(this);
if (playerBind && playerBind->save != mapSave)
{
- sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is being put into instance %s %d, %d, %d, %d, %d, %d but he is in group %d and is bound to instance %d, %d, %d, %d, %d, %d!", player->GetName().c_str(), player->GetGUIDLow(), GetMapName(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d, %d, %d, %d but he is in group %d and is bound to instance %d, %d, %d, %d, %d, %d!", player->GetName().c_str(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
if (groupBind)
- sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: the group is bound to the instance %s %d, %d, %d, %d, %d, %d", GetMapName(), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: the group is bound to the instance %d, %d, %d, %d, %d, %d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
//ASSERT(false);
return false;
}
--
1.8.1.msysgit.1
From 6c8a7cff19ae2c1b25241ed7783ff2ef2445f100 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:42:59 +0300
Subject: [PATCH 09/14] Update MapManager.h
---
src/server/game/Maps/MapManager.h | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h
index 8af609c..8a6aa7a 100644
--- a/src/server/game/Maps/MapManager.h
+++ b/src/server/game/Maps/MapManager.h
@@ -1,19 +1,21 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ * Copyright (C) 2008-2013 Trinity <http://www.trinitycore.org/>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
+ * 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.
+ * 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, see <http://www.gnu.org/licenses/>.
+ * 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
+ *
+ * Updated by: Toba and Baeumchen (maddin)
*/
#ifndef TRINITY_MAPMANAGER_H
@@ -109,12 +111,19 @@ class MapManager
void LoadTransports();
void LoadTransportNPCs();
+
+ //Load transport to instance
+ Transport* LoadTransportInMap(Map* instance, uint32 goEntry, uint32 period);
+ void UnLoadTransportFromMap(Transport* t);
+ void LoadTransportForPlayers(Player* player);
+ void UnLoadTransportForPlayers(Player* player);
typedef std::set<Transport*> TransportSet;
TransportSet m_Transports;
typedef std::map<uint32, TransportSet> TransportMap;
TransportMap m_TransportsByMap;
+ TransportMap m_TransportsByInstanceIdMap;
bool CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck = false);
void InitializeVisibilityDistanceInfo();
--
1.8.1.msysgit.1
From 18547e643c1dd8b3a9704f2544a54d0ec508945e Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:44:49 +0300
Subject: [PATCH 10/14] Update ScriptLoader.cpp
---
src/server/game/Scripting/ScriptLoader.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index 845c3fa..7dbec68 100644
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -492,6 +492,7 @@ void AddSC_boss_marwyn();
void AddSC_boss_lord_marrowgar(); // Icecrown Citadel
void AddSC_boss_lady_deathwhisper();
void AddSC_boss_deathbringer_saurfang();
+void AddSC_boss_gunship_battle();
void AddSC_boss_festergut();
void AddSC_boss_rotface();
void AddSC_boss_professor_putricide();
@@ -1230,6 +1231,7 @@ void AddNorthrendScripts()
AddSC_boss_lord_marrowgar(); // Icecrown Citadel
AddSC_boss_lady_deathwhisper();
AddSC_boss_deathbringer_saurfang();
+ AddSC_boss_gunship_battle();
AddSC_boss_festergut();
AddSC_boss_rotface();
AddSC_boss_professor_putricide();
--
1.8.1.msysgit.1
From af48cdfb979358d43e50b94995ff46597561e239 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:45:22 +0300
Subject: [PATCH 11/14] Update InstanceScript.cpp
---
src/server/game/Instances/InstanceScript.cpp | 44 ++++++++++++++++++++--------
1 file changed, 32 insertions(+), 12 deletions(-)
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index 0b4c325..2b5a09d 100644
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -1,19 +1,21 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ * Copyright (C) 2008-2013 Trinity <http://www.trinitycore.org/>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
+ * 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.
+ * 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, see <http://www.gnu.org/licenses/>.
+ * 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
+ *
+ * Updated by: Toba and Baeumchen (maddin)
*/
#include "Creature.h"
@@ -323,6 +325,24 @@ void InstanceScript::DoSendNotifyToInstance(char const* format, ...)
}
}
+// Complete Achievement for all players in instance
+void InstanceScript::DoCompleteAchievement(uint32 achievement)
+{
+ AchievementEntry const* pAE = sAchievementStore.LookupEntry(achievement);
+ Map::PlayerList const &PlayerList = instance->GetPlayers();
+
+ if (!pAE)
+ {
+ return;
+ }
+
+ if (!PlayerList.isEmpty())
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ if (Player *player = i->getSource())
+ player->CompletedAchievement(pAE);
+}
+
+
// Update Achievement Criteria for all players in instance
void InstanceScript::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/)
{
--
1.8.1.msysgit.1
From 62a20c83d2a5da720afedfbaa8f445469f1312b4 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:45:47 +0300
Subject: [PATCH 12/14] Update InstanceScript.h
---
src/server/game/Instances/InstanceScript.h | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h
index 609e318..51e3907 100644
--- a/src/server/game/Instances/InstanceScript.h
+++ b/src/server/game/Instances/InstanceScript.h
@@ -1,19 +1,21 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ * Copyright (C) 2008-2013 Trinity <http://www.trinitycore.org/>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
+ * 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.
+ * 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, see <http://www.gnu.org/licenses/>.
+ * 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
+ *
+ * Updated by: Toba and Baeumchen (maddin)
*/
#ifndef TRINITY_INSTANCE_DATA_H
@@ -176,6 +178,9 @@ class InstanceScript : public ZoneScript
// Send Notify to all players in instance
void DoSendNotifyToInstance(char const* format, ...);
+ // Complete Achievement for all players in instance
+ void DoCompleteAchievement(uint32 achievement);
+
// Update Achievement Criteria for all players in instance
void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL);
--
1.8.1.msysgit.1
From 66f66a3726bb30193c79beb5aceb9fb94492e113 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:47:27 +0300
Subject: [PATCH 13/14] Create 2013_04_29_01_world_gunship_battle.sql
---
.../world/2013_04_29_01_world_gunship_battle.sql | 397 +++++++++++++++++++++
1 file changed, 397 insertions(+)
create mode 100644 sql/updates/world/2013_04_29_01_world_gunship_battle.sql
diff --git a/sql/updates/world/2013_04_29_01_world_gunship_battle.sql b/sql/updates/world/2013_04_29_01_world_gunship_battle.sql
new file mode 100644
index 0000000..5a199dc
--- /dev/null
+++ b/sql/updates/world/2013_04_29_01_world_gunship_battle.sql
@@ -0,0 +1,397 @@
+-- Muradin & Saurfang
+DELETE FROM `creature_template` WHERE `entry` IN (50004, 50006);
+INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES
+(50004, 0, 0, 0, 0, 0, 11686, 0, 0, 0, 'High Overlord Saurfang', '', '', 0, 80, 80, 2, 1802, 1802, 0, 0, 0, 1, 1, 252, 357, 0, 304, '7.5', 2000, 0, 1, 33554432, 8, 0, 0, 0, 0, 0, 215, 320, 44, 7, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1000, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, '', 12340),
+(50006, 0, 0, 0, 0, 0, 11686, 0, 0, 0, 'Muradin Bronzebeard', '', '', 10875, 83, 83, 2, 1802, 1802, 1, 1, '1.14286', 1, 1, 468, 702, 0, 175, '47.2', 2000, 2000, 1, 33554432, 8, 0, 0, 0, 0, 0, 374, 562, 140, 7, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15284, 70309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 175, 1, 1, 0, 0, 0, 0, 0, 0, 0, 164, 1, 0, 2, '', 12340);
+
+-- Miscs
+UPDATE `creature_template` SET `npcflag` = 1 WHERE `entry` IN (36939, 38156, 38637, 38638, 37184);
+
+-- Templates del trash
+UPDATE `creature_template` SET `faction_A` = 1801, `faction_H` = 1801, `baseattacktime` = 2000, `rangeattacktime` = 2000, `unit_flags` = 32832, `spell1` = 71339, `spell2` = 70161, `spell3` = 72539, `mechanic_immune_mask` = 73745 WHERE `entry` IN (36968, 38403, 38675, 38676);
+UPDATE `creature_template` SET `faction_A` = 1802, `faction_H` = 1802, `baseattacktime` = 2000, `rangeattacktime` = 2000, `unit_flags` = 32832, `spell1` = 71335, `spell2` = 70162, `spell3` = 72566, `mechanic_immune_mask` = 73745 WHERE `entry` IN (36969, 38408, 38689, 38690);
+
+-- Spawn for the sorcerer and the vindicator
+DELETE FROM `creature` WHERE `id` IN (37003, 37026);
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
+(200988, 37003, 631, 15, 1, 0, 0, -562.385, 2217.58, 199.969, 3.46228, 86400, 0, 0, 398434, 41690, 0, 0, 0, 0),
+(201020, 37026, 631, 15, 1, 0, 0, -571.091, 2219.71, 199.969, 5.06842, 86400, 0, 0, 269600, 91600, 0, 0, 0, 0);
+
+-- Scriptnames
+UPDATE `creature_template` SET `ScriptName` = 'npc_muradin_gunship' WHERE `entry` = 36948;
+UPDATE `creature_template` SET `ScriptName` = 'npc_saurfang_gunship' WHERE `entry` = 36939;
+UPDATE `creature_template` SET `ScriptName` = 'npc_zafod_boombox' WHERE `entry` = 37184;
+UPDATE `creature_template` SET `ScriptName` = 'npc_korkron_defender' WHERE `entry` = 37032;
+UPDATE `creature_template` SET `ScriptName` = 'npc_korkron_primalist' WHERE `entry` = 37030;
+UPDATE `creature_template` SET `ScriptName` = 'npc_skybreaker_vindicator' WHERE `entry` = 37003;
+UPDATE `creature_template` SET `ScriptName` = 'npc_skybreaker_protector' WHERE `entry` = 36998;
+UPDATE `creature_template` SET `ScriptName` = 'npc_icc_spire_frostwyrm' WHERE `entry` = 37230;
+UPDATE `creature_template` SET `ScriptName` = 'npc_korkron_axethrower_rifleman' WHERE `entry` = 36968;
+UPDATE `creature_template` SET `ScriptName` = 'npc_korkron_axethrower_rifleman' WHERE `entry` = 36969;
+UPDATE `creature_template` SET `ScriptName` = 'npc_mortar_soldier_or_rocketeer', AIName = '' WHERE `entry` = 36982;
+UPDATE `creature_template` SET `ScriptName` = 'npc_mortar_soldier_or_rocketeer', AIName = '' WHERE `entry` = 36978;
+UPDATE `creature_template` SET `ScriptName` = 'npc_gunship_mage' WHERE `entry` = 37117;
+UPDATE `creature_template` SET `ScriptName` = 'npc_gunship_mage' WHERE `entry` = 37116;
+UPDATE `creature_template` SET `ScriptName` = 'npc_gunship_trigger' WHERE `entry` = 37547;
+UPDATE `creature_template` SET `ScriptName` = 'npc_gunship_portal' WHERE `entry` = 37227;
+UPDATE `creature_template` SET `ScriptName` = 'npc_marine_or_reaver' WHERE `entry` = 36957;
+UPDATE `creature_template` SET `ScriptName` = 'npc_marine_or_reaver' WHERE `entry` = 36950;
+UPDATE `creature_template` SET `ScriptName` = 'npc_sergeant' WHERE `entry` = 36960;
+UPDATE `creature_template` SET `ScriptName` = 'npc_sergeant' WHERE `entry` = 36961;
+UPDATE `creature_template` SET `ScriptName` = 'npc_gunship_skybreaker' WHERE `entry` = 37540;
+UPDATE `creature_template` SET `ScriptName` = 'npc_gunship_orgrimmar' WHERE `entry` = 37215;
+UPDATE `creature_template` SET `ScriptName` = 'npc_gunship_cannon' WHERE `entry` = 36838;
+UPDATE `creature_template` SET `ScriptName` = 'npc_gunship_cannon' WHERE `entry` = 36839;
+UPDATE `gameobject_template` SET `ScriptName` = 'transport_gunship' WHERE `entry` IN (201580, 201812);
+UPDATE `item_template` SET ScriptName = 'item_icc_rocket_pack' WHERE entry = 49278;
+
+-- Areatriggers Script
+DELETE FROM `areatrigger_scripts` WHERE `entry` IN (5630, 5628);
+INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES
+(5628,'at_icc_land_frostwyrm'),
+(5630,'at_icc_land_frostwyrm');
+
+-- Spell Scripts
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (70713, 68645, 69471, 69488, 69402, 70175, 71335, 71339);
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+('70713', 'spell_icc_remove_rocket_pack'),
+('68645', 'spell_rocket_pack'),
+('69471', 'spell_gb_heat_drain'),
+('69488', 'spell_gb_overheat_drain'),
+('69402', 'spell_gb_incinerating_blast'),
+('70175', 'spell_gb_incinerating_blast'),
+('71335', 'spell_gb_burning_pitch'),
+('71339', 'spell_gb_burning_pitch');
+
+-- Transport
+DELETE FROM transports WHERE entry IN (201580, 201581, 201811, 201812);
+DELETE FROM creature WHERE id IN (37230, 36838, 36839, 36948, 36939);
+DELETE FROM `creature_template_addon` WHERE (`entry`=37547);
+UPDATE `creature_template` SET `flags_extra` = 130 WHERE `entry` = 37547;
+
+-- Cannon template
+UPDATE `creature_template` SET `exp` = 2, `VehicleId` = 554, `RegenHealth` = 0, `npcflag` = 16777216, `spell1` = 69399, `spell2` = 69401 WHERE entry = 36839;
+UPDATE `creature_template` SET `exp` = 2, `VehicleId` = 554, `RegenHealth` = 0, `npcflag` = 16777216, `spell1` = 70172, `spell2` = 70174 WHERE entry = 36838;
+DELETE FROM `npc_spellclick_spells` WHERE npc_entry IN (36838, 36839);
+INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`) VALUES
+('36838', '46598', '1'),
+('36839', '46598', '1');
+DELETE FROM `creature_template_addon` WHERE `entry` IN (36838, 36839);
+INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(36838, 0, 0, 0, 1, 0, 69470),
+(36839, 0, 0, 0, 1, 0, 69470);
+UPDATE `creature_template` SET `difficulty_entry_1` = '38129',`difficulty_entry_2` = '38701', `difficulty_entry_3` = '38702' WHERE `entry` =37215;
+UPDATE `creature_template` SET `faction_A` = 35, `faction_H` = 35, `minlevel` = 83, `maxlevel` = 83, `unit_flags` = 4, `flags_extra` = 2, `modelid1` = 1126, `modelid2` = 11686 WHERE `entry` IN (37215, 38129, 38701, 38702, 37540, 38128, 38699, 38700);
+
+-- Fix for Cannons
+UPDATE `creature_template` SET `difficulty_entry_1`=0 WHERE `entry`=36839 LIMIT 1;
+UPDATE `creature_template` SET `speed_walk`=0 ,`speed_run`=0 WHERE `entry` IN (36839,36838);
+
+-- Spell effects
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 71193 AND `spell_effect` = -71188;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 71195 AND `spell_effect` = -71193;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 68645 AND `spell_effect` = 69193;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 73077 AND `spell_effect` = 69188;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 73077 AND `spell_effect` = 68721;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 69193 AND `spell_effect` = 69192;
+INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
+(71193, -71188, 0, 'Gunship Battle - Veteran removes Experimented'),
+(71195, -71193, 0, 'Gunship Battle - Elite removes Veteran'),
+(73077, 69188, 2, 'Gunship Battle - Fix visual for Rocket Pack'),
+(68645, 69193, 0, 'Gunship Battle - Fix visual for Rocket Pack'),
+(69193, 69192, 0, 'Gunship Battle - Cast Rocket Burst when landing with Rocket Pack');
+
+-- Spells
+UPDATE `creature_template` SET `unit_flags` = 33554564, `flags_extra` = 2 WHERE `entry` IN (37044, 37041);
+UPDATE `creature_template` SET `faction_A` = 1801, `faction_H` = 1801 WHERE `entry` = 37044;
+UPDATE `creature_template` SET `faction_A` = 1802, `faction_H` = 1802 WHERE `entry` = 37041;
+DELETE FROM `creature_template_addon` WHERE `entry` IN (37044, 37041);
+SET @KORKRON := 37044; -- Kor'kron Battle Standard
+SET @SKYBREAKER := 37041; -- Skybreaker Battle Standard
+SET @HSPELL := 69809;
+SET @ASPELL := 69808;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@KORKRON, @SKYBREAKER);
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@KORKRON, @SKYBREAKER);
+INSERT INTO `smart_scripts`
+(`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`)
+VALUES
+(@KORKRON ,0,0,0,25,0,100,1,0,0,0,0,11,@HSPELL,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Kor''kron Battle Standard - On spawn & reset - Cast spell 69809'),
+(@SKYBREAKER,0,0,0,25,0,100,1,0,0,0,0,11,@ASPELL,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Skybreaker Battle Standard - On spawn & reset - Cast spell 69808');
+
+-- Creature Text
+SET @MURADIN := 36948;
+SET @OVERLORD := 36939;
+SET @MURADIN_INVISIBLE := 50006;
+SET @OVERLORD_INVISIBLE := 50004;
+SET @PRIMALIST := 37030;
+SET @INVOKER := 37033;
+SET @DEFENDER := 37032;
+SET @VINDICATOR := 37003;
+SET @SORCERER := 37026;
+SET @PROTECTOR := 36998;
+SET @FROSTWYRM := 37230;
+SET @SOUNDID :=0;
+
+DELETE FROM `creature_text` WHERE `entry` IN (36948, 36939, 37030, 37033, 37032, 37003, 37026, 36998, 37230, 50004, 50006);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@MURADIN_INVISIBLE, 0, 0, 'Move yer jalopy or we''ll blow it out of the sky, orc! The Horde''s got no business here!', 14, 0, 0, 0, 0, 16969, 'Muradin Bronzebeard - INVISIBLE_0'),
+(@MURADIN_INVISIBLE, 1, 0, 'Marines, Sergeants, attack!', 14, 0, 0, 0, 0, 16956, 'Muradin Bronzebeard - INVISIBLE_1'),
+(@MURADIN, 0, 0, 'Fire up the engines! We got a meetin'' with destiny, lads!', 14, 0, 100, 0, 0, 16962, 'Muradin Bronzebeard - SAY_INTRO_ALLIANCE_0'),
+(@MURADIN, 1, 0, 'Hold on to yer hats!', 14, 0, 100, 0, 0, 16963, 'Muradin Bronzebeard - SAY_INTRO_ALLIANCE_1'),
+(@MURADIN, 2, 0, 'What in the world is that? Grab me spyglass, crewman!', 14, 0, 100, 0, 0, 16964, 'Muradin Bronzebeard - SAY_INTRO_ALLIANCE_2'),
+(@MURADIN, 3, 0, 'By me own beard! HORDE SAILIN'' IN FAST ''N HOT!', 14, 0, 100, 0, 0, 16965, 'Muradin Bronzebeard - SAY_INTRO_ALLIANCE_3'),
+(@MURADIN, 4, 0, 'EVASIVE ACTION! MAN THE GUNS!', 14, 0, 100, 0, 0, 16966, 'Muradin Bronzebeard - SAY_INTRO_ALLIANCE_4'),
+(@MURADIN, 5, 0, 'Cowardly dogs! Ye blindsided us!', 14, 0, 100, 0, 0, 16967, 'Muradin Bronzebeard - SAY_INTRO_ALLIANCE_5'),
+(@MURADIN, 6, 0, 'Not me battle? I dunnae who ye? think ye are, mister, but I got a score to settle with Arthas and yer not gettin'' in me way! FIRE ALL GUNS! FIRE! FIRE!', 14, 0, 100, 0, 0, 16968, 'Muradin Bronzebeard - SAY_INTRO_ALLIANCE_7'),
+(@MURADIN, 7, 0, 'Move yer jalopy or we''ll blow it out of the sky, orc! The Horde''s got no business here!', 14, 0, 100, 0, 0, 16969, 'Muradin Bronzebeard - SAY_INTRO_HORDE_3'),
+(@MURADIN, 8, 0, 'What''s this then?! Ye won''t be takin'' this son o'' Ironforge''s vessel without a fight!.', 14, 0, 100, 0, 0, 16958, 'Muradin Bronzebeard - SAY_BOARDING_SKYBREAKER_1'),
+(@MURADIN, 9, 0, 'Marines, Sergeants, attack!', 14, 0, 100, 0, 0, 16956, 'Muradin Bronzebeard - SAY_BOARDING_ORGRIMS_HAMMER_0'),
+(@MURADIN, 10, 0, 'Riflemen, shoot faster!', 14, 0, 100, 0, 0, 16954, 'Muradin Bronzebeard - SAY_NEW_RIFLEMEN_SPAWNED'),
+(@MURADIN, 11, 0, 'Mortar team, reload!', 14, 0, 100, 0, 0, 16955, 'Muradin Bronzebeard - SAY_NEW_MORTAR_TEAM_SPAWNED'),
+(@MURADIN, 12, 0, 'We''re taking hull damage, get a sorcerer out here to shut down those cannons!', 14, 0, 100, 0, 0, 16957, 'Muradin Bronzebeard - SAY_NEW_MAGE_SPAWNED'),
+(@MURADIN, 13, 0, 'Don''t say I didn''t warn ya, scoundrels! Onward, brothers and sisters!', 14, 0, 100, 0, 0, 16959, 'Muradin Bronzebeard - SAY_ALLIANCE_VICTORY'),
+(@MURADIN, 14, 0, 'Captain Bartlett, get us out of here! We''re taken too much damage to stay afloat!', 14, 0, 100, 0, 0, 16960, 'Muradin Bronzebeard - SAY_ALLIANCE_DEFEAT'),
+(@OVERLORD_INVISIBLE, 0, 0, 'This is not your battle, dwarf. Back down or we will be forced to destroy your ship.', 14, 0, 0, 0, 0, 17093, 'High Overlord Saurfang - INVISIBLE_0'),
+(@OVERLORD_INVISIBLE, 1, 0, 'Reavers, Sergeants, attack!', 14, 0, 0, 0, 0, 17081, 'High Overlord Saurfang - INVISIBLE_1'),
+(@OVERLORD, 0, 0, 'Rise up, sons and daughters of the Horde! Today we battle a hated enemy of the Horde! LOK''TAR OGAR!', 14, 0, 100, 0, 0, 17087, 'High Overlord Saurfang - SAY_INTRO_HORDE_0'),
+(@OVERLORD, 1, 0, 'Kor''kron, take us out!', 14, 0, 100, 0, 0, 17088, 'High Overlord Saurfang - SAY_INTRO_HORDE_1_1'),
+(@OVERLORD, 2, 0, 'What is that?! Something approaching in the distance!', 14, 0, 100, 0, 0, 17089, 'High Overlord Saurfang - SAY_INTRO_HORDE_1'),
+(@OVERLORD, 3, 0, 'ALLIANCE GUNSHIP! ALL HANDS ON DECK!', 14, 0, 100, 0, 0, 17090, 'High Overlord Saurfang - SAY_INTRO_HORDE_2'),
+(@OVERLORD, 4, 0, 'You will know our business soon! KOR''KRON, ANNIHILATE THEM!', 14, 0, 100, 0, 0, 17092, 'High Overlord Saurfang - SAY_INTRO_HORDE_4'),
+(@OVERLORD, 5, 0, 'Reavers, Sergeants, attack!', 14, 0, 100, 0, 0, 17081, 'High Overlord Saurfang - SAY_BOARDING_SKYBREAKER_0'),
+(@OVERLORD, 6, 0, 'You DARE board my ship? Your death will come swiftly.', 14, 0, 100, 0, 0, 17083, 'High Overlord Saurfang - SAY_BOARDING_ORGRIMS_HAMMER_1'),
+(@OVERLORD, 7, 0, 'Axethrowers, hurl faster!', 14, 0, 100, 0, 0, 17079, 'High Overlord Saurfang - SAY_NEW_AXETHROWER_SPAWNED'),
+(@OVERLORD, 8, 0, 'Rocketeers, reload!', 14, 0, 100, 0, 0, 17080, 'High Overlord Saurfang - SAY_NEW_ROCKETEERS_SPAWNED'),
+(@OVERLORD, 9, 0, 'We''re taking hull damage, get a battle-mage out here to shut down those cannons!', 14, 0, 100, 0, 0, 17082, 'High Overlord Saurfang - SAY_NEW_BATTLE_MAGE_SPAWNED'),
+(@OVERLORD, 10, 0, 'The Alliance falter. Onward to the Lich King!', 14, 0, 100, 0, 0, 17084, 'High Overlord Saurfang - SAY_HORDE_VICTORY'),
+(@OVERLORD, 11, 0, 'Damage control! Put those fires out! You haven''t seen the last of the Horde!', 14, 0, 100, 0, 0, 17085, 'High Overlord Saurfang - SAY_HORDE_DEFEAT'),
+(@OVERLORD, 12, 0, 'This is not your battle, dwarf. Back down or we will be forced to destroy your ship.', 14, 0, 100, 0, 0, 17093, 'High Overlord Saurfang - SAY_INTRO_ALLIANCE_6'),
+
+(@PRIMALIST,0, 0, 'Thank the spirits for you, brothers and sisters. The Skybreaker has already left. Quickly now, to Orgrim''s Hammer! If you leave soon, you may be able to catch them.', 12, 0, 100, 0, 0, @SOUNDID, 'Kor''kron Primalist - SAY_FIRST_SQUAD_RESCUED_HORDE_0'),
+(@INVOKER, 0, 0, 'This should be helpin''ya!', 12, 0, 100, 0, 0, @SOUNDID, 'Kor''kron Invoker - SAY_FIRST_SQUAD_RESCUED_HORDE_1'),
+(@INVOKER, 1, 0, '%s summons a Kor''kron Battle Standard.', 16, 0, 100, 0, 0, @SOUNDID, 'Kor''kron Invoker - SAY_SUMMON_BATTLE_STANDARD'),
+(@DEFENDER, 0, 0, 'Aka''Magosh, brave warriors. The alliance is in great number here.', 12, 0, 100, 0, 0, @SOUNDID, 'Kor''kron Defender - SAY_SECOND_SQUAD_RESCUED_HORDE_0'),
+(@DEFENDER, 1, 0, 'Captain Saurfang will be pleased to see you aboard Orgrim''s Hammer. Make haste, we will secure the area until you are ready for take-off.', 12, 0, 100, 0, 0, @SOUNDID, 'Kor''kron Defender - SAY_SECOND_SQUAD_RESCUED_HORDE_1'),
+(@DEFENDER, 2, 0, 'A screeching cry pierces the air above!',41, 0, 100, 0, 0, @SOUNDID, 'Frostwyrm - SAY_FROSTWYRM_SUMMON_0'),
+(@VINDICATOR, 0, 0, 'Thank goodness you arrived when you did, heroes. Orgrim''s Hammer has already left. Quickly now, to The Skybreaker! If you leave soon, you may be able to catch them.', 12, 0, 100, 0, 0, @SOUNDID, 'Skybreaker Vindicator - SAY_FIRST_SQUAD_RESCUED_ALLIANCE_0'),
+(@SORCERER, 0, 0, 'This ought to help!', 12, 0, 100, 0, 0, @SOUNDID, 'Skybreaker Sorcerer - SAY_FIRST_SQUAD_RESCUED_ALLIANCE_1'),
+(@SORCERER, 1, 0, '%s summons a Skybreaker Battle Standard.', 16, 0, 100, 0, 0, @SOUNDID, 'Skybreaker Sorcerer - SAY_SUMMON_BATTLE_STANDARD'),
+(@PROTECTOR,0, 0, 'You have my thanks. We were outnumbered until you arrived.', 12, 0, 100, 0, 0, @SOUNDID, 'Skybreaker Protector - SAY_SECOND_SQUAD_RESCUED_ALLIANCE_0'),
+(@PROTECTOR,1, 0, 'Captain Muradin is waiting aboard The Skybreaker. We''ll secure the area until you are ready for take off.', 12, 0, 100, 0, 0, @SOUNDID, 'Skybreaker Protector - SAY_SECOND_SQUAD_RESCUED_ALLIANCE_1'),
+(@PROTECTOR,2, 0, 'Skybreaker infantry, hold position!', 12, 0, 100, 0, 0, @SOUNDID, 'Skybreaker Protector - SAY_SECOND_SQUAD_RESCUED_ALLIANCE_2'),
+(@PROTECTOR,3, 0, 'A screeching cry pierces the air above!',41, 0, 100, 0, 0, @SOUNDID, 'Frostwyrm - SAY_FROSTWYRM_SUMMON_0'),
+(@FROSTWYRM,0, 0, 'A Spire Frostwyrm lands just before Orgrim''s Hammer.', 16, 0, 100, 0, 0, @SOUNDID, 'Frostwyrm - SAY_FROSTWYRM_LAND_H_1'),
+(@FROSTWYRM,1, 0, 'A Spire Frostwyrm lands just before The Skybreaker. ', 16, 0, 100, 0, 0, @SOUNDID, 'Frostwyrm - SAY_FROSTWYRM_LAND_A_2');
+
+
+
+-- CONDITIONS
+-- Additionnal Conditions (by 2010phenix - https://github.com/2010phenix)
+SET @ENTRYA := 37540;
+SET @ENTRYH := 37215;
+SET @ENTRYA10H := 38128;
+SET @ENTRYH10H := 38129;
+SET @ENTRYA25 := 38699;
+SET @ENTRYH25 := 38701;
+SET @ENTRYA25H := 38700;
+SET @ENTRYH25H := 38702;
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (69400, 70173, 69402, 70175, 70374, 70383, 72959, 69705);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceEntry`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`) VALUES
+('13', '69400', '18', '1', @ENTRYA), -- Horde Cannon (Cannon Blast) set to hit only Skybreaker (effect 2)
+('13', '69400', '18', '1', @ENTRYA10H), -- Horde Cannon (Cannon Blast) set to hit only Skybreaker - 10H (effect 2)
+('13', '69400', '18', '1', @ENTRYA25), -- Horde Cannon (Cannon Blast) set to hit only Skybreaker - 25Normal (effect 2)
+('13', '69400', '18', '1', @ENTRYA25H), -- Horde Cannon (Cannon Blast) set to hit only Skybreaker -- 25H (effect 2)
+('13', '70173', '18', '1', @ENTRYH), -- Alliance Cannon (Cannon Blast) set to hit only Orgrimms Hammer (effect 2)
+('13', '70173', '18', '1', @ENTRYH10H), -- Alliance Cannon (Cannon Blast) set to hit only Orgrimms Hammer 10H (effect 2)
+('13', '70173', '18', '1', @ENTRYH25), -- Alliance Cannon (Cannon Blast) set to hit only Orgrimms Hammer - 25Normal (effect 2)
+('13', '70173', '18', '1', @ENTRYH25H), -- Alliance Cannon (Cannon Blast) set to hit only Orgrimms Hammer -- 25H (effect 2)
+('13', '69402', '18', '1', @ENTRYA), -- Horde Cannon (Incinerating Blast) set to hit only Skybreaker (effect 2)
+('13', '69402', '18', '1', @ENTRYA10H), -- Horde Cannon (Incinerating Blast) set to hit only Skybreaker 10H(effect 2)
+('13', '69402', '18', '1', @ENTRYA25), -- Horde Cannon (Incinerating Blast) set to hit only Skybreaker - 25Normal (effect 2)
+('13', '69402', '18', '1', @ENTRYA25H), -- Horde Cannon (Incinerating Blast) set to hit only Skybreaker -- 25H (effect 2)
+('13', '70175', '18', '1', @ENTRYH), -- Alliance Cannon (Incinerating Blast) set to hit only Orgrimms Hammer (effect 2)
+('13', '70175', '18', '1', @ENTRYH10H), -- Alliance Cannon (Incinerating Blast) set to hit only Orgrimms Hammer 10H (effect 2)
+('13', '70175', '18', '1', @ENTRYH25), -- Alliance Cannon (Incinerating Blast) set to hit only Orgrimms Hammer - 25Normal (effect 2)
+('13', '70175', '18', '1', @ENTRYH25H), -- Alliance Cannon (Incinerating Blast) set to hit only Orgrimms Hammer -- 25H (effect 2)
+('13', '70374', '18', '1', @ENTRYA), -- Burning Pitch
+('13', '70374', '18', '1', @ENTRYA10H), -- Burning Pitch
+('13', '70374', '18', '1', @ENTRYA25), -- Burning Pitch
+('13', '70374', '18', '1', @ENTRYA25H), -- Burning Pitch
+('13', '70383', '18', '1', @ENTRYH), -- Burning Pitch
+('13', '70383', '18', '1', @ENTRYH10H), -- Burning Pitch
+('13', '70383', '18', '1', @ENTRYH25), -- Burning Pitch
+('13', '70383', '18', '1', @ENTRYH25H), -- Burning Pitch
+('13', '72959', '18', '1', 0), -- Achievement (Radius: 50000 yards)
+('13', '69705' ,'18', '1', 36838), -- Gunship Battle - Spell 69705 (Below Zero) target creature 36838
+('13', '69705' ,'18', '1', 36839); -- Gunship Battle - Spell 69705 (Below Zero) target creature 36839
+
+-- Update condition by TrinityCore:
+DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry IN (69400, 70173, 69402, 70175, 70374, 70383, 69705, 72959);
+INSERT INTO conditions (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorTextId, ScriptName, Comment) VALUES
+-- Alliance
+(13, 3, 69400, 0, 0, 31, 0, 3, 37540, 0, 0, 0, '', NULL),
+(13, 1, 70374, 0, 0, 31, 0, 3, 37540, 0, 0, 0, '', NULL),
+(13, 3, 69402, 0, 0, 31, 0, 3, 37540, 0, 0, 0, '', NULL),
+(13, 1, 69705, 0, 0, 31, 0, 3, 36838, 0, 0, 0, '', NULL),
+-- Horde
+(13, 3, 70175, 0, 1, 31, 0, 3, 37215, 0, 0, 0, '', NULL),
+(13, 1, 70383, 0, 1, 31, 0, 3, 37215, 0, 0, 0, '', NULL),
+(13, 3, 70173, 0, 1, 31, 0, 3, 37215, 0, 0, 0, '', NULL),
+(13, 1, 69705, 0, 1, 31, 0, 3, 36839, 0, 0, 0, '', NULL);
+
+
+
+-- Loot templates
+-- Fix by TrinityCore
+-- Set Variables
+SET @Gunship10N := 28057; -- Data1 for 201872 & 202177
+SET @Gunship10H := 28045; -- Data1 for 201873 & 202178
+SET @Gunship25N := 28072; -- Data1 for 201874 & 202179
+SET @Gunship25H := 28090; -- Data1 for 201875 & 202180
+SET @emblem := 49426; -- Emblem of Frost
+SET @SfShard := 50274; -- Shadowfrost Shard
+SET @PriSar := 49908; -- Primordial Saronite
+-- Dug up the old references i created for UP34:
+SET @Ref10J := 34329;
+SET @Ref25J := 34251;
+SET @RefJ10H := 34263;
+SET @RefJ25H := 34275;
+
+-- Gunship_Armory10N_reference
+DELETE FROM `reference_loot_template` WHERE `entry` IN (@Ref10J,@Ref25J,@RefJ10H,@RefJ25H);
+INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(@Ref10J,50791,0,1,1,1,1), -- Saronite Gargoyle Cloak
+(@Ref10J,50795,0,1,1,1,1), -- Cord of Dark Suffering
+(@Ref10J,50794,0,1,1,1,1), -- Neverending Winter
+(@Ref10J,50787,0,1,1,1,1), -- Frost Giant's Cleaver
+(@Ref10J,50793,0,1,1,1,1), -- Midnight Sun
+(@Ref10J,50788,0,1,1,1,1), -- Bone Drake's Enameled Boots
+(@Ref10J,50792,0,1,1,1,1), -- Pauldrons of Lost Hope
+(@Ref10J,50340,0,1,1,1,1), -- Muradin's Spyglass
+(@Ref10J,50797,0,1,1,1,1), -- Ice-Reinforced Vrykul Helm
+(@Ref10J,50790,0,1,1,1,1), -- Abomination's Bloody Ring
+(@Ref10J,50789,0,1,1,1,1), -- Icecrown Rampart Bracers
+(@Ref10J,50796,0,1,1,1,1), -- Bracers of Pale Illumination
+-- Gunship_Armory25N_reference
+(@Ref25J,50011,0,1,1,1,1), -- Gunship Captain's Mittens
+(@Ref25J,50002,0,1,1,1,1), -- Polar Bear Claw Bracers
+(@Ref25J,50006,0,1,1,1,1), -- Corp'rethar Ceremonial Crown
+(@Ref25J,50010,0,1,1,1,1), -- Waistband of Righteous Fury
+(@Ref25J,50003,0,1,1,1,1), -- Boneguard Commander's Pauldrons
+(@Ref25J,50000,0,1,1,1,1), -- Scourge Hunter's Vambraces
+(@Ref25J,50359,0,1,1,1,1), -- Althor's Abacus
+(@Ref25J,50352,0,1,1,1,1), -- Corpse Tongue Coin
+(@Ref25J,49999,0,1,1,1,1), -- Skeleton Lord's Circle
+(@Ref25J,50009,0,1,1,1,1), -- Boots of Unnatural Growth
+(@Ref25J,50008,0,1,1,1,1), -- Ring of Rapid Ascent
+(@Ref25J,49998,0,1,1,1,1), -- Shadowvault Slayer's Cloak
+(@Ref25J,50005,0,1,1,1,1), -- Amulet of the Silent Eulogy
+(@Ref25J,50411,0,1,1,1,1), -- Scourgeborne Waraxe
+(@Ref25J,50001,0,1,1,1,1), -- Ikfirus's Sack of Wonder
+-- Gunship_Armory10H_reference
+(@RefJ10H,51912,0,1,1,1,1), -- Saronite Gargoyle Cloak (heroic)
+(@RefJ10H,51908,0,1,1,1,1), -- Cord of Dark Suffering (heroic)
+(@RefJ10H,51909,0,1,1,1,1), -- Neverending Winter (heroic)
+(@RefJ10H,51916,0,1,1,1,1), -- Frost Giant's Cleaver (heroic)
+(@RefJ10H,51910,0,1,1,1,1), -- Midnight Sun (heroic)
+(@RefJ10H,51915,0,1,1,1,1), -- Bone Drake's Enameled Boots (heroic)
+(@RefJ10H,51911,0,1,1,1,1), -- Pauldrons of Lost Hope (heroic)
+(@RefJ10H,50345,0,1,1,1,1), -- Muradin's Spyglass (heroic)
+(@RefJ10H,51906,0,1,1,1,1), -- Ice-Reinforced Vrykul Helm (heroic)
+(@RefJ10H,51913,0,1,1,1,1), -- Abomination's Bloody Ring (heroic)
+(@RefJ10H,51914,0,1,1,1,1), -- Icecrown Rampart Bracers (heroic)
+(@RefJ10H,51907,0,1,1,1,1), -- Bracers of Pale Illumination (heroic)
+-- Gunship_Armory25H_reference
+(@RefJ25H,50663,0,1,1,1,1), -- Gunship Captain's Mittens (heroic)
+(@RefJ25H,50659,0,1,1,1,1), -- Polar Bear Claw Bracers (heroic)
+(@RefJ25H,50661,0,1,1,1,1), -- Corp'rethar Ceremonial Crown (heroic)
+(@RefJ25H,50667,0,1,1,1,1), -- Waistband of Righteous Fury (heroic)
+(@RefJ25H,50660,0,1,1,1,1), -- Boneguard Commander's Pauldrons (heroic)
+(@RefJ25H,50655,0,1,1,1,1), -- Scourge Hunter's Vambraces (heroic)
+(@RefJ25H,50366,0,1,1,1,1), -- Althor's Abacus (heroic)
+(@RefJ25H,50349,0,1,1,1,1), -- Corpse Tongue Coin (heroic)
+(@RefJ25H,50657,0,1,1,1,1), -- Skeleton Lord's Circle (heroic)
+(@RefJ25H,50665,0,1,1,1,1), -- Boots of Unnatural Growth (heroic)
+(@RefJ25H,50664,0,1,1,1,1), -- Ring of Rapid Ascent (heroic)
+(@RefJ25H,50653,0,1,1,1,1), -- Shadowvault Slayer's Cloak (heroic)
+(@RefJ25H,50658,0,1,1,1,1), -- Amulet of the Silent Eulogy (heroic)
+(@RefJ25H,50654,0,1,1,1,1), -- Scourgeborne Waraxe (heroic)
+(@RefJ25H,50656,0,1,1,1,1); -- Ikfirus's Sack of Wonder (heroic)
+
+-- Bind the refs to the objects
+DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@Gunship10N,@Gunship10H,@Gunship25N,@Gunship25H);
+INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+-- Gunship10N
+(@Gunship10N,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 10N
+(@Gunship10N,1,100,1,0,-@Ref10J,2), -- 2 from reference 10Normal
+-- Gunship25N
+(@Gunship25N,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 25N
+(@Gunship25N,1,100,1,0,-@Ref25J,2), -- 3 from reference 25Normal
+(@Gunship25N,@SfShard,-35,1,0,1,1), -- Shadowfrost Shard @ 38% chance
+(@Gunship25N,@PriSar,38,1,0,1,1), -- Primordial Saronite @ 10% chance
+-- Gunship10H
+(@Gunship10H,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 10H
+(@Gunship10H,1,100,1,0,-@RefJ10H,2), -- 2 from reference 10Heroic
+(@Gunship10H,@PriSar,38,1,0,1,1), -- Primordial Saronite @ 38% chance
+-- Gunship25H
+(@Gunship25H,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 25H
+(@Gunship25H,1,100,1,0,-@RefJ25H,2), -- 3 from reference 25Heroic
+(@Gunship25H,@SfShard,-75,1,0,1,1), -- Shadowfrost Shard @ 75% chance
+(@Gunship25H,@PriSar,50,1,0,1,1); -- Primordial Saronite @ 50% chance
+
+SET @Twins := 34329;
+SET @emblem := 49426;
+DELETE FROM `reference_loot_template` WHERE `entry`=@Twins;
+INSERT INTO `reference_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES
+(@Twins,47296,0,1,1,1,1), -- Greaves of Ruthless Judgment
+(@Twins,47297,0,1,1,1,1), -- The Executioner's Vice
+(@Twins,47298,0,1,1,1,1), -- Armguards of the Shieldmaiden
+(@Twins,47299,0,1,1,1,1), -- Belt of the Pitiless Killer
+(@Twins,47300,0,1,1,1,1), -- Gouge of the Frigid Heart
+(@Twins,47301,0,1,1,1,1), -- Skyweaver Vestments
+(@Twins,47302,0,1,1,1,1), -- Twin's Pact
+(@Twins,47303,0,1,1,1,1), -- Death's Choice
+(@Twins,47304,0,1,1,1,1), -- Legplates of Ascension
+(@Twins,47305,0,1,1,1,1); -- Legionnaire's Gorget
+SET @Gunship10N := 28057; -- Data1 for 201872 & 202177
+SET @Ref10J := 12036;
+-- Gunship_Armory10N_reference
+DELETE FROM `reference_loot_template` WHERE `entry`=@Ref10J;
+INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(@Ref10J,50791,0,1,1,1,1), -- Saronite Gargoyle Cloak
+(@Ref10J,50795,0,1,1,1,1), -- Cord of Dark Suffering
+(@Ref10J,50794,0,1,1,1,1), -- Neverending Winter
+(@Ref10J,50787,0,1,1,1,1), -- Frost Giant's Cleaver
+(@Ref10J,50793,0,1,1,1,1), -- Midnight Sun
+(@Ref10J,50788,0,1,1,1,1), -- Bone Drake's Enameled Boots
+(@Ref10J,50792,0,1,1,1,1), -- Pauldrons of Lost Hope
+(@Ref10J,50340,0,1,1,1,1), -- Muradin's Spyglass
+(@Ref10J,50797,0,1,1,1,1), -- Ice-Reinforced Vrykul Helm
+(@Ref10J,50790,0,1,1,1,1), -- Abomination's Bloody Ring
+(@Ref10J,50789,0,1,1,1,1), -- Icecrown Rampart Bracers
+(@Ref10J,50796,0,1,1,1,1); -- Bracers of Pale Illumination
+-- Bind the refs to the objects
+DELETE FROM `gameobject_loot_template` WHERE `entry`=@Gunship10N;
+INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+-- Gunship10N
+(@Gunship10N,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 10N
+(@Gunship10N,1,100,1,0,-@Ref10J,2); -- 2 from reference 10Normal
+
+DELETE FROM `creature_addon` WHERE `guid` IN (83459,78383,81170,81165,81531);
+DELETE FROM `gameobject_loot_template` WHERE `entry` IN (28045,28057,28072,28090);
+DELETE FROM `reference_loot_template` WHERE `entry` IN (34329,12036,34251,34263,34275);
+
+-- Make Muradin and Saufangs unattackable and unable to attack players (All difficulty modes)
+UPDATE `creature_template` SET `unit_flags`=2, `flags_extra`=2 WHERE `entry`=36948;
+UPDATE `creature_template` SET `unit_flags`=2, `flags_extra`=2 WHERE `entry`=36939;
+UPDATE `creature_template` SET `unit_flags`=2, `flags_extra`=2 WHERE `entry`=38156;
+UPDATE `creature_template` SET `unit_flags`=2, `flags_extra`=2 WHERE `entry`=38638;
+UPDATE `creature_template` SET `unit_flags`=2, `flags_extra`=2 WHERE `entry`=38637;
+UPDATE `creature_template` SET `unit_flags`=2, `flags_extra`=2 WHERE `entry`=38157;
+UPDATE `creature_template` SET `unit_flags`=2, `flags_extra`=2 WHERE `entry`=38639;
+UPDATE `creature_template` SET `unit_flags`=2, `flags_extra`=2 WHERE `entry`=38640;
+
+-- Prevent players from exploiting the Rocket pack item outside of raid
+UPDATE `item_template` SET `area` = 4812 WHERE `entry` = 49278;
+UPDATE `item_template` SET `map` = 631 WHERE `entry` = 49278;
--
1.8.1.msysgit.1
From 06a06806d24ba88ee947516695bdfb074a273075 Mon Sep 17 00:00:00 2001
From: Baeumchen <[email protected]>
Date: Mon, 29 Apr 2013 04:48:05 +0300
Subject: [PATCH 14/14] Create 2013_04_29_01_world_gunship_cannon.sql
---
.../world/2013_04_29_01_world_gunship_cannon.sql | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 sql/updates/world/2013_04_29_01_world_gunship_cannon.sql
diff --git a/sql/updates/world/2013_04_29_01_world_gunship_cannon.sql b/sql/updates/world/2013_04_29_01_world_gunship_cannon.sql
new file mode 100644
index 0000000..ea52f96
--- /dev/null
+++ b/sql/updates/world/2013_04_29_01_world_gunship_cannon.sql
@@ -0,0 +1,19 @@
+UPDATE `creature_template` SET `ScriptName` = 'npc_gunship_cannon' WHERE `entry` = 36838;
+UPDATE `creature_template` SET `ScriptName` = 'npc_gunship_cannon' WHERE `entry` = 36839;
+-- Cannon template
+UPDATE `creature_template` SET `exp` = 2, `VehicleId` = 554, `RegenHealth` = 0, `npcflag` = 16777216, `spell1` = 69399, `spell2` = 69401 WHERE entry = 36839;
+UPDATE `creature_template` SET `exp` = 2, `VehicleId` = 554, `RegenHealth` = 0, `npcflag` = 16777216, `spell1` = 70172, `spell2` = 70174 WHERE entry = 36838;
+DELETE FROM `npc_spellclick_spells` WHERE npc_entry IN (36838, 36839);
+INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`) VALUES
+('36838', '46598', '1'),
+('36839', '46598', '1');
+DELETE FROM `creature_template_addon` WHERE `entry` IN (36838, 36839);
+INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(36838, 0, 0, 0, 1, 0, 69470),
+(36839, 0, 0, 0, 1, 0, 69470);
+UPDATE `creature_template` SET `difficulty_entry_1` = '38129',`difficulty_entry_2` = '38701', `difficulty_entry_3` = '38702' WHERE `entry` =37215;
+UPDATE `creature_template` SET `faction_A` = 35, `faction_H` = 35, `minlevel` = 83, `maxlevel` = 83, `unit_flags` = 4, `flags_extra` = 2, `modelid1` = 1126, `modelid2` = 11686 WHERE `entry` IN (37215, 38129, 38701, 38702, 37540, 38128, 38699, 38700);
+
+-- Fix for Cannons
+UPDATE `creature_template` SET `difficulty_entry_1`=0 WHERE `entry`=36839 LIMIT 1;
+UPDATE `creature_template` SET `speed_walk`=0 ,`speed_run`=0 WHERE `entry` IN (36839,36838);
--
1.8.1.msysgit.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment