aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2014_12_15_00_world.sql18
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp127
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h9
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp6
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp60
6 files changed, 119 insertions, 103 deletions
diff --git a/sql/updates/world/2014_12_15_00_world.sql b/sql/updates/world/2014_12_15_00_world.sql
new file mode 100644
index 00000000000..8ed026454c6
--- /dev/null
+++ b/sql/updates/world/2014_12_15_00_world.sql
@@ -0,0 +1,18 @@
+SET @CGUID := 6747;
+DELETE FROM `creature` WHERE `guid`=@CGUID;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(@CGUID, 22418, 534, 1, 1, 5502.288, -3525.471, 1607.909, 2.617994, 7200, 0, 0);
+
+DELETE FROM `creature_text` WHERE `entry`=17968 AND `groupid`=8;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(17968, 8, 0, 'All of your efforts have been in vain, for the draining of the World Tree has already begun! Soon the heart of your world will beat no more!', 14, 0, 100, 0, 0, 10986, 20432, 3, 'Archimonde - Intro');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (39140,39141,39142);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13,1,39140,0,0,31,0,3,22418,0,0,0, '', 'Drain World Tree Visual'),
+(13,1,39141,0,0,31,0,3,17968,0,0,0, '', 'Drain World Tree Visual 2'),
+(13,1,39142,0,0,31,0,3,22418,0,0,0, '', 'Drain World Tree Dummy');
+
+DELETE FROM `spell_script_names` WHERE `spell_id`=39142;
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(39142, 'spell_archimonde_drain_world_tree_dummy');
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
index a0ff40c8a3c..e0416b56397 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
@@ -25,10 +25,9 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "hyjal.h"
-#include "SpellAuras.h"
-#include "hyjal_trash.h"
+#include "SpellScript.h"
#include "Player.h"
+#include "hyjal.h"
enum Texts
{
@@ -39,44 +38,44 @@ enum Texts
SAY_ENRAGE = 5,
SAY_DEATH = 6,
SAY_SOUL_CHARGE = 7,
+ // YELL_ARCHIMONDE_INTRO = 8
};
enum Spells
{
- SPELL_DENOUEMENT_WISP = 32124,
- SPELL_ANCIENT_SPARK = 39349,
- SPELL_PROTECTION_OF_ELUNE = 38528,
-
- SPELL_DRAIN_WORLD_TREE = 39140,
- SPELL_DRAIN_WORLD_TREE_2 = 39141,
-
- SPELL_FINGER_OF_DEATH = 31984,
- SPELL_HAND_OF_DEATH = 35354,
- SPELL_AIR_BURST = 32014,
- SPELL_GRIP_OF_THE_LEGION = 31972,
- SPELL_DOOMFIRE_STRIKE = 31903, //summons two creatures
- SPELL_DOOMFIRE_SPAWN = 32074,
- SPELL_DOOMFIRE = 31945,
- SPELL_SOUL_CHARGE_YELLOW = 32045,
- SPELL_SOUL_CHARGE_GREEN = 32051,
- SPELL_SOUL_CHARGE_RED = 32052,
- SPELL_UNLEASH_SOUL_YELLOW = 32054,
- SPELL_UNLEASH_SOUL_GREEN = 32057,
- SPELL_UNLEASH_SOUL_RED = 32053,
- SPELL_FEAR = 31970,
+ SPELL_DENOUEMENT_WISP = 32124,
+ SPELL_ANCIENT_SPARK = 39349,
+ SPELL_PROTECTION_OF_ELUNE = 38528,
+
+ SPELL_DRAIN_WORLD_TREE = 39140,
+ SPELL_DRAIN_WORLD_TREE_TRIGGERED = 39141,
+
+ SPELL_FINGER_OF_DEATH = 31984,
+ SPELL_HAND_OF_DEATH = 35354,
+ SPELL_AIR_BURST = 32014,
+ SPELL_GRIP_OF_THE_LEGION = 31972,
+ SPELL_DOOMFIRE_STRIKE = 31903, // summons two creatures
+ SPELL_DOOMFIRE_SPAWN = 32074,
+ SPELL_DOOMFIRE = 31945,
+ SPELL_SOUL_CHARGE_YELLOW = 32045,
+ SPELL_SOUL_CHARGE_GREEN = 32051,
+ SPELL_SOUL_CHARGE_RED = 32052,
+ SPELL_UNLEASH_SOUL_YELLOW = 32054,
+ SPELL_UNLEASH_SOUL_GREEN = 32057,
+ SPELL_UNLEASH_SOUL_RED = 32053,
+ SPELL_FEAR = 31970
};
enum Events
{
- EVENT_DRAIN_NORDRASSIL = 1,
- EVENT_HAND_OF_DEATH, // Raid wiper
+ EVENT_HAND_OF_DEATH = 1, // Raid wiper
EVENT_UNLEASH_SOUL_CHARGE,
EVENT_FINGER_OF_DEATH,
EVENT_GRIP_OF_THE_LEGION,
EVENT_FEAR,
EVENT_AIR_BURST,
EVENT_DOOMFIRE,
- EVENT_DISTANCE_CHECK, // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage
+ EVENT_DISTANCE_CHECK, // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage
EVENT_SUMMON_WHISP
};
@@ -84,8 +83,7 @@ enum Summons
{
NPC_DOOMFIRE = 18095,
NPC_DOOMFIRE_SPIRIT = 18104,
- NPC_ANCIENT_WISP = 17946,
- NPC_CHANNEL_TARGET = 22418
+ NPC_ANCIENT_WISP = 17946
};
enum Actions
@@ -94,8 +92,6 @@ enum Actions
ACTION_CHANNEL_WORLD_TREE
};
-Position const NordrassilLoc = {5503.713f, -3523.436f, 1608.781f, 0.0f};
-
class npc_ancient_wisp : public CreatureScript
{
public:
@@ -220,7 +216,6 @@ public:
}
void MoveInLineOfSight(Unit* who) override
-
{
//will update once TargetGUID is 0. In case noone actually moves(not likely) and this is 0
//when UpdateAI needs it, it will be forced to select randomPoint
@@ -279,10 +274,9 @@ public:
void Initialize()
{
DoomfireSpiritGUID.Clear();
- WorldTreeGUID.Clear();
SoulChargeCount = 0;
- WispCount = 0; // When ~30 wisps are summoned, Archimonde dies
+ WispCount = 0; // When ~30 wisps are summoned, Archimonde dies
_unleashSpell = 0;
_chargeSpell = 0;
@@ -290,13 +284,17 @@ public:
HasProtected = false;
}
+ void InitializeAI() override
+ {
+ BossAI::InitializeAI();
+ DoAction(ACTION_CHANNEL_WORLD_TREE);
+ }
+
void Reset() override
{
Initialize();
_Reset();
me->RemoveAllAuras(); // Reset Soul Charge auras.
- if (!me->isMoving())
- DoAction(ACTION_CHANNEL_WORLD_TREE);
}
void EnterCombat(Unit* /*who*/) override
@@ -317,11 +315,6 @@ public:
{
switch (eventId)
{
- case EVENT_DRAIN_NORDRASSIL:
- if (Unit* Nordrassil = ObjectAccessor::GetUnit(*me, WorldTreeGUID))
- Nordrassil->CastSpell(me, SPELL_DRAIN_WORLD_TREE_2, true);
- events.ScheduleEvent(EVENT_DRAIN_NORDRASSIL, 1000);
- break;
case EVENT_HAND_OF_DEATH:
DoCastAOE(SPELL_HAND_OF_DEATH);
events.ScheduleEvent(EVENT_HAND_OF_DEATH, 2000);
@@ -387,7 +380,7 @@ public:
events.ScheduleEvent(EVENT_DOOMFIRE, 20000);
break;
case EVENT_DISTANCE_CHECK:
- if (Creature* channelTrigger = ObjectAccessor::GetCreature(*me, WorldTreeGUID))
+ if (Creature* channelTrigger = instance->GetCreature(DATA_CHANNEL_TARGET))
if (me->IsWithinDistInMap(channelTrigger, 75.0f))
DoAction(ACTION_ENRAGE);
events.ScheduleEvent(EVENT_DISTANCE_CHECK, 5000);
@@ -503,18 +496,7 @@ public:
Talk(SAY_ENRAGE);
break;
case ACTION_CHANNEL_WORLD_TREE:
- if (Creature* temp = me->SummonCreature(NPC_CHANNEL_TARGET, NordrassilLoc, TEMPSUMMON_TIMED_DESPAWN, 1200000))
- {
- WorldTreeGUID = temp->GetGUID();
-
- if (Unit* Nordrassil = ObjectAccessor::GetUnit(*me, WorldTreeGUID))
- {
- Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Nordrassil->SetDisplayId(11686);
- DoCast(Nordrassil, SPELL_DRAIN_WORLD_TREE);
- }
- events.ScheduleEvent(EVENT_DRAIN_NORDRASSIL, 1000);
- }
+ DoCastAOE(SPELL_DRAIN_WORLD_TREE, true);
break;
default:
break;
@@ -538,7 +520,6 @@ public:
private:
ObjectGuid DoomfireSpiritGUID;
- ObjectGuid WorldTreeGUID;
uint8 SoulChargeCount;
uint8 WispCount;
uint32 _chargeSpell;
@@ -553,10 +534,46 @@ public:
}
};
+// 39142 - Drain World Tree Dummy
+class spell_archimonde_drain_world_tree_dummy : public SpellScriptLoader
+{
+ public:
+ spell_archimonde_drain_world_tree_dummy() : SpellScriptLoader("spell_archimonde_drain_world_tree_dummy") { }
+
+ class spell_archimonde_drain_world_tree_dummy_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_archimonde_drain_world_tree_dummy_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DRAIN_WORLD_TREE_TRIGGERED))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ target->CastSpell(GetCaster(), SPELL_DRAIN_WORLD_TREE_TRIGGERED, true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_archimonde_drain_world_tree_dummy_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_archimonde_drain_world_tree_dummy_SpellScript();
+ }
+};
+
void AddSC_boss_archimonde()
{
new boss_archimonde();
new npc_doomfire();
new npc_doomfire_targetting();
new npc_ancient_wisp();
+ new spell_archimonde_drain_world_tree_dummy();
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
index c5f4d4ae679..54a763573ed 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
@@ -44,7 +44,8 @@ enum DataTypes
DATA_HORDE_RETREAT = 17,
DATA_RAIDDAMAGE = 18,
DATA_RESET_RAIDDAMAGE = 19,
- TYPE_RETREAT = 20
+ TYPE_RETREAT = 20,
+ DATA_CHANNEL_TARGET = 21
};
enum WorldStateIds
@@ -77,7 +78,8 @@ enum CreaturesIds
KAZROGAL = 17888,
AZGALOR = 17842,
ARCHIMONDE = 17968,
- NPC_WORLD_TRIGGER_TINY = 21987
+ NPC_WORLD_TRIGGER_TINY = 21987,
+ NPC_CHANNEL_TARGET = 22418
};
enum GameobjectIds
@@ -89,5 +91,6 @@ enum GameobjectIds
GO_ROARING_FLAME = 182592
};
-#endif
+#define MINRAIDDAMAGE 700000 // minimal damage before trash can drop loot and reputation, resets if faction leader dies
+#endif
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
index c6adbd58c4a..d4b4061aaa8 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
@@ -26,7 +26,6 @@ enum Spells
SPELL_METEOR = 33814, //infernal visual
SPELL_IMMOLATION = 37059,
SPELL_FLAME_BUFFET = 31724,
- NPC_TRIGGER = 21987, //World Trigger (Tiny)
MODEL_INVIS = 11686, //invisible model
SPELL_DISEASE_CLOUD = 31607,
SPELL_KNOCKDOWN = 31610,
@@ -465,10 +464,7 @@ public:
}
if (!meteor)
{
- float x, y, z;
- me->GetPosition(x, y, z);
- Creature* trigger = me->SummonCreature(NPC_TRIGGER, x + 8, y + 8, z + 25 + rand32() % 10, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 1000);
- if (trigger)
+ if (Creature* trigger = me->SummonCreature(NPC_WORLD_TRIGGER_TINY, me->GetPositionWithOffset({ 8.0f, 8.0f, frand(25.0f, 35.0f), 0.0f }), TEMPSUMMON_TIMED_DESPAWN, 1000))
{
trigger->SetVisible(false);
trigger->setFaction(me->getFaction());
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
index 18122ba2b0c..62f82ebcee1 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
@@ -21,8 +21,6 @@
#include "hyjal.h"
#include "ScriptedEscortAI.h"
-#define MINRAIDDAMAGE 700000//minimal damage before trash can drop loot and reputation, resets if faction leader dies
-
struct hyjal_trashAI : public npc_escortAI
{
hyjal_trashAI(Creature* creature);
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
index fa8edf2c498..0aed9b049c8 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
@@ -26,10 +26,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "ScriptedCreature.h"
-#include "hyjal_trash.h"
-#include "Player.h"
-#include "WorldPacket.h"
-#include "Chat.h"
+#include "hyjal.h"
/* Battle of Mount Hyjal encounters:
0 - Rage Winterchill event
@@ -39,8 +36,16 @@ EndScriptData */
4 - Archimonde event
*/
-#define YELL_EFFORTS "All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more."
-#define YELL_EFFORTS_NAME "Archimonde"
+enum Yells
+{
+ YELL_ARCHIMONDE_INTRO = 8
+};
+
+ObjectData const creatureData[] =
+{
+ { NPC_CHANNEL_TARGET, DATA_CHANNEL_TARGET },
+ { 0, 0 } // END
+};
class instance_hyjal : public InstanceMapScript
{
@@ -57,6 +62,7 @@ public:
instance_mount_hyjal_InstanceMapScript(Map* map) : InstanceScript(map)
{
SetHeaders(DataHeader);
+ LoadObjectData(creatureData, nullptr);
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
RaidDamage = 0;
@@ -131,6 +137,8 @@ public:
TyrandeWhisperwind = creature->GetGUID();
break;
}
+
+ InstanceScript::OnCreatureCreate(creature);
}
ObjectGuid GetGuidData(uint32 identifier) const override
@@ -164,42 +172,18 @@ public:
m_auiEncounter[2] = data;
break;
case DATA_AZGALOREVENT:
+ m_auiEncounter[3] = data;
+ if (data == DONE)
{
- m_auiEncounter[3] = data;
- if (data == DONE)
+ instance->LoadGrid(5581.49, -3445.63);
+ if (Creature* archimonde = instance->GetCreature(Archimonde))
{
- if (Creature* archimonde = instance->GetCreature(Archimonde))
- archimonde->SetVisible(true);
-
- if (ArchiYell)
- break;
-
- ArchiYell = true;
+ archimonde->SetVisible(true);
- Creature* creature = instance->GetCreature(Azgalor);
- if (creature)
+ if (!ArchiYell)
{
- Creature* unit = creature->SummonCreature(NPC_WORLD_TRIGGER_TINY, creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000);
-
- Map* map = creature->GetMap();
- if (map->IsDungeon() && unit)
- {
- unit->SetVisible(false);
- Map::PlayerList const &PlayerList = map->GetPlayers();
- if (PlayerList.isEmpty())
- return;
-
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if (Player* player = i->GetSource())
- {
- WorldPacket packet;
- ChatHandler::BuildChatPacket(packet, CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, unit, player, YELL_EFFORTS);
- player->SendDirectMessage(&packet);
- player->PlayDirectSound(10986, player);
- }
- }
- }
+ ArchiYell = true;
+ archimonde->AI()->Talk(YELL_ARCHIMONDE_INTRO);
}
}
}