Scripts/Eye of Eternity: Implemented script for Malygos encounter, please report any issue you find.

Thanks for the help to Machiavelli and Shauren.

Signed-off-by: Manuel <manue.l@live.com.ar>
This commit is contained in:
Manuel
2011-03-26 21:36:06 -03:00
parent 75bf08c081
commit 21a2c56af3
15 changed files with 1493 additions and 125 deletions

View File

@@ -0,0 +1,30 @@
DELETE FROM `creature_text` WHERE `entry` IN (32295,28859);
INSERT INTO `creature_text` (entry,groupid,id,text,type,language,sound,comment) VALUE
(28859,0,0,'My patience has reached its limit, I will be rid of you!',1,0,14517,'Malygos - Aggro (Phase 1)'),
(28859,1,0,'Your stupidity has finally caught up to you',1,0,14519,'Malygos - Killed Player (1) (Phase 1)'),
(28859,1,1,'More artifacts to confiscate...',1,0,14520,'Malygos - Killed Player (2) (Phase 1)'),
(28859,1,2,'<Laughs> How very... naïve...',1,0,14521,'Malygos - Killed Player (3) (Phase 1)'),
(28859,2,0,'I had hoped to end your lives quickly, but you have proven more... resilient then I had anticipated. Nonetheless, your efforts are in vain, it is you reckless, careless mortals who are to blame for this war! I do what I must... And if it means your... extinction... THEN SO BE IT',1,0,14522,'Malygos - End Phase One'),
(28859,3,0,'Few have experienced the pain I will now inflict upon you!',1,0,14523,'Malygos - Aggro (Phase 2)'),
(28859,4,0,'I will teach you IGNORANT children just how little you know of magic...',1,0,14524,'Malygos - Anti-Magic Shell'),
(28859,5,0,'Watch helplessly as your hopes are swept away...',1,0,14525,'Malygos - Magic Blast'),
(28859,6,0,'Your energy will be put to good use!',1,0,14526,'Malygos - Killed Player 1 (Phase 2)'),
(28859,6,1,'I am the spell-weaver! My power is infinite!',1,0,14527,'Malygos - Killed Player 2 (Phase 2)'),
(28859,6,2,'Your spirit will linger here forever!',1,0,14528,'Malygos - Killed Player 3 (Phase 2)'),
(28859,7,0,'ENOUGH! If you intend to reclaim Azeroth''s magic, then you shall have it...',1,0,14529,'Malygos - End Phase 2'),
(28859,8,0,'Now your benefactors make their appearance... But they are too late. The powers contained here are sufficient to destroy the world ten times over! What do you think they will do to you?',1,0,14530,'Intro Phase 3'),
(28859,9,0,'SUBMIT!',1,0,14531,'Malygos - Aggro (Phase 3)'),
(28859,10,0,'The powers at work here exceed anything you could possibly imagine!',1,0,14532,'Malygos - Surge of Power'),
(28859,11,0,'I AM UNSTOPPABLE!',1,0,14533,'Malygos - Buffed by a spark'),
(28859,12,0,'Alexstrasza! Another of your brood falls!',1,0,14534,'Malygos - Killed Player 1 (Phase 3)'),
(28859,12,1,'Little more then gnats!',1,0,14535,'Malygos - Killed Player 2 (Phase 3)'),
(28859,12,2,'Your red allies will share your fate...',1,0,14536,'Malygos - Killed Player 3 (Phase 3)'),
(28859,13,0,'Still standing? Not for long...',1,0,14537,'Malygos - Spell Casting 1(Phase 3)'),
(28859,13,1,'Your cause is lost',1,0,14538,'Malygos - Spell Casting 2 (Phase 3)'),
(28859,13,2,'Your fragile mind will be shattered!',1,0,14539,'Malygos - Spell Casting 3 (Phase 3)'),
(28859,14,0,'Unthinkable! The mortals will destroy... everything... my sister... what have you...',1,0,0,'Malygos - Death'),
(32295,0,0,'I did what I had to, brother. You gave me no alternative.',1,0,0,'Alexstrasza - Yell One'),
(32295,1,0,'And so ends the Nexus War.',1,0,0,'Alexstrasza - Yell Two'),
(32295,2,0,'This resolution pains me deeply, but the destruction, the monumental loss of life had to end. Regardless of Malygos'' recent transgressions, I will mourn his loss. He was once a guardian, a protector. This day, one of the world''s mightiest has fallen.',1,0,0,'Alexstrasza - Yell Three'),
(32295,3,0,'The red dragonflight will take on the burden of mending the devastation wrought on Azeroth. Return home to your people and rest. Tomorrow will bring you new challenges, and you must be ready to face them. Life... goes on.',1,0,0,'Alexstrasza - Yell Four');

View File

@@ -0,0 +1,8 @@
-- conditions for spells used by Malygos
DELETE FROM `conditions` WHERE `SourceGroup`=0 AND `SourceEntry` IN (56263,55853,56505,56429,56152) AND `ConditionTypeOrReference`=18;
INSERT INTO `conditions` (SourceTypeOrReferenceId,ConditionTypeOrReference,SourceGroup,SourceEntry,ConditionValue1,ConditionValue2) VALUES
(13,18,0,55853,1,30090),
(13,18,0,56263,1,30090),
(13,18,0,56505,1,30334),
(13,18,0,56429,1,30334),
(13,18,0,56152,1,28859);

View File

@@ -0,0 +1,24 @@
-- vortex trigger
UPDATE `creature_template` SET `modelid1`=11686,`modelid2`=169,`InhabitType`=5,`unit_flags`=0x02000000,`VehicleId`=214,`flags_extra`=130 WHERE `entry`=30090;
UPDATE `creature` SET `modelid`=0 WHERE `id`=30090;
-- Portal (Malygos)
UPDATE `creature_template` SET `InhabitType`=5 WHERE `entry`=30118;
UPDATE `creature_template` SET `speed_walk`=2.4,`speed_run`=0.857142857 WHERE `entry`=30084;
-- Hover Disk
UPDATE `creature_template` SET `VehicleId`=224,`faction_A`=35,`faction_H`=35,`InhabitType`=5 WHERE `entry` IN (30234,30248);
-- Surge of Power
UPDATE `creature_template` SET flags_extra=130 WHERE entry=30334;
-- Wyrmrest Skytalon (Player's Mount)
UPDATE `creature_template` SET `InhabitType`=5 WHERE `entry`=30161;
-- Alexstrasza the Life-Binder
UPDATE `creature_template` SET `InhabitType`=5 WHERE `entry`=32295;
-- static Field
UPDATE `creature_template` SET `flags_extra`=130,`InhabitType`=5 WHERE `entry`=30592;
UPDATE `creature_template` SET `VehicleId`=220,`spell1`=56091,`spell2`=56092,`spell3`=57090,`spell4`=57143,`spell5`=57108,`spell6`=57092,`spell7`=60534 WHERE `entry`=30161;

View File

@@ -0,0 +1,2 @@
DELETE FROM `creature_template_addon` WHERE `entry`=30592;
INSERT INTO `creature_template_addon` (entry,auras) VALUES (30592,'57428 0');

View File

@@ -0,0 +1,9 @@
-- Spawning Focusing Iris
DELETE FROM `gameobject` WHERE `id`=193958;
INSERT INTO `gameobject` (guid,id,map,spawnMask,phaseMask,position_x,position_y,position_z,orientation,rotation0,rotation1,rotation2,rotation3,spawntimesecs,animprogress,state) VALUES
(151791,193958,616,1,1,754.2546,1301.71973,266.170319,-1.60570168,0,0,0,0,120,0,1);
-- Spawning chests
DELETE FROM `gameobject` WHERE `id` IN (193967,193905);
INSERT INTO `gameobject` (guid,id,map,spawnMask,phaseMask,position_x,position_y,position_z,orientation,spawntimesecs,animprogress,state) VALUES
(151792,193905,616,1,1,764.56,1284.63,269,1.82,-604800,100,1),
(151793,193967,616,2,1,764.56,1284.63,269,1.82,-604800,100,1);

View File

@@ -0,0 +1,5 @@
-- Hover Disk
DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (30248,30234);
INSERT INTO `npc_spellclick_spells` (npc_entry,spell_id,quest_start,quest_end,cast_flags) VALUES
(30234,61421,0,0,0),
(30248,61421,0,0,0);

View File

@@ -0,0 +1,15 @@
DELETE FROM `instance_template` WHERE `map`=616;
INSERT INTO `instance_template` (map,parent,script) VALUES (616,571,'instance_eye_of_eternity');
UPDATE `creature_template` SET `ScriptName`='boss_malygos' WHERE `entry`=28859;
UPDATE `creature_template` SET `ScriptName`='npc_power_spark' WHERE `entry`=30084;
UPDATE `creature_template` SET `ScriptName`='npc_portal_eoe' WHERE `entry`=30118;
UPDATE `creature_template` SET `ScriptName`='npc_hover_disk' WHERE `entry` IN (30234,30248);
UPDATE `creature_template` SET `ScriptName`='npc_arcane_overload' WHERE `entry`=30282;
UPDATE `creature_template` SET `ScriptName`='npc_wyrmrest_skytalon' WHERE `entry`=30161;
UPDATE `creature_template` SET `ScriptName`='npc_alexstrasza_eoe' WHERE `entry`=32295;
DELETE FROM `spell_script_names` WHERE `spell_id`=56105;
INSERT INTO `spell_script_names` VALUES (56105,'spell_malygos_vortex_dummy');
DELETE FROM `spell_script_names` WHERE `spell_id`=55873;
INSERT INTO `spell_script_names` VALUES (55873,'spell_malygos_vortex_visual');

View File

@@ -0,0 +1,11 @@
-- Scripts for Nexus Lord and Scion of Eternity
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (30249,30245);
DELETE FROM `smart_scripts` WHERE (`entryorguid`=30249 AND `source_type`=0);
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
(30249, 0, 0, 0, 0, 0, 100, 6, 3000, 5000, 4000, 6000, 11, 56397, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Scion of Eternity - Cast Arcane Barrage (Random)'),
(30249, 0, 1, 0, 7, 0, 100, 6, 1, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Scion of Eternity - Despawn in EvadeMode');
DELETE FROM `smart_scripts` WHERE (`entryorguid`=30245 AND `source_type`=0);
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
(30245, 0, 0, 0, 0, 0, 100, 6, 7000, 10000, 10000, 15000, 11, 57060, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Nexus Lord - Cast Haste (Self)'),
(30245, 0, 1, 0, 0, 0, 100, 6, 5000, 8000, 9000, 12000, 11, 57058, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Nexus Lord - Cast Arcane Shock (Random)'),
(30245, 0, 2, 0, 7, 0, 100, 6, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Nexus Lord - Despawn in EvadeMode');

View File

@@ -0,0 +1,5 @@
-- Hover Disk
DELETE FROM `vehicle_template_accessory` WHERE `entry` IN (30234,30248);
INSERT INTO `vehicle_template_accessory` (entry,accessory_entry,seat_id,minion,description) VALUES
(30234,30245,0,0,'Hover Disk - Nexus Lord'),
(30248,30249,0,0,'Hover Disk - Scion of Eternity');

View File

@@ -0,0 +1,3 @@
-- Spell Arcane Barrage
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=56397;
INSERT INTO `spell_linked_spell` (spell_trigger,spell_effect,type,comment) VALUES (56397,63934,1,'Arcane Barrage - Arcane Barrage');

View File

@@ -15242,6 +15242,9 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
sScriptMgr->OnPlayerKilledByCreature(killer, killed);
}
}
if (Vehicle* veh = pVictim->GetVehicle())
pVictim->ExitVehicle();
}
void Unit::SetControlled(bool apply, UnitState state)

View File

@@ -400,6 +400,8 @@ void AddSC_boss_varos();
void AddSC_boss_eregos();
void AddSC_instance_oculus();
void AddSC_oculus();
void AddSC_boss_malygos(); // The Nexus: Eye of Eternity
void AddSC_instance_eye_of_eternity();
void AddSC_boss_sartharion(); //Obsidian Sanctum
void AddSC_instance_obsidian_sanctum();
void AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning
@@ -1091,6 +1093,8 @@ void AddNorthrendScripts()
AddSC_boss_eregos();
AddSC_instance_oculus();
AddSC_oculus();
AddSC_boss_malygos(); // The Nexus: Eye of Eternity
AddSC_instance_eye_of_eternity();
AddSC_boss_sartharion(); //Obsidian Sanctum
AddSC_instance_obsidian_sanctum();
AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning

View File

@@ -18,4 +18,55 @@
#ifndef DEF_EYE_OF_ETERNITY_H
#define DEF_EYE_OF_ETERNITY_H
enum InstanceData
{
DATA_MALYGOS_EVENT,
MAX_ENCOUNTER,
DATA_VORTEX_HANDLING,
DATA_POWER_SPARKS_HANDLING
};
enum InstanceData64
{
DATA_TRIGGER,
DATA_MALYGOS,
DATA_PLATFORM
};
enum InstanceNpcs
{
NPC_MALYGOS = 28859,
NPC_VORTEX_TRIGGER = 30090,
NPC_PORTAL_TRIGGER = 30118,
NPC_POWER_SPARK = 30084,
NPC_HOVER_DISK_MELEE = 30234,
NPC_HOVER_DISK_CASTER = 30248,
NPC_ARCANE_OVERLOAD = 30282,
NPC_WYRMREST_SKYTALON = 30161,
NPC_ALEXSTRASZA = 32295
};
enum InstanceGameObjects
{
GO_NEXUS_RAID_PLATFORM = 193070,
GO_EXIT_PORTAL = 193908,
GO_FOCUSING_IRIS = 193958,
GO_ALEXSTRASZA_S_GIFT = 193905,
GO_ALEXSTRASZA_S_GIFT_2 = 193967
};
enum InstanceEvents
{
EVENT_FOCUSING_IRIS = 20711
};
enum InstanceSpells
{
SPELL_VORTEX_4 = 55853, // damage | used to enter to the vehicle
SPELL_VORTEX_5 = 56263, // damage | used to enter to the vehicle
SPELL_PORTAL_OPENED = 61236,
SPELL_RIDE_RED_DRAGON = 56071,
};
#endif

View File

@@ -21,22 +21,275 @@
class instance_eye_of_eternity : public InstanceMapScript
{
public:
instance_eye_of_eternity() : InstanceMapScript("instance_eye_of_eternity", 616) { }
instance_eye_of_eternity() : InstanceMapScript("instance_eye_of_eternity", 616) {}
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
InstanceScript* GetInstanceScript(InstanceMap* map) const
{
return new instance_eye_of_eternity_InstanceMapScript(pMap);
return new instance_eye_of_eternity_InstanceMapScript(map);
}
struct instance_eye_of_eternity_InstanceMapScript : public InstanceScript
{
instance_eye_of_eternity_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
};
instance_eye_of_eternity_InstanceMapScript(Map* map) : InstanceScript(map)
{
SetBossNumber(MAX_ENCOUNTER);
vortexTriggers.clear();
portalTriggers.clear();
malygosGUID = 0;
lastPortalGUID = 0;
platformGUID = 0;
exitPortalGUID = 0;
};
bool SetBossState(uint32 type, EncounterState state)
{
if (!InstanceScript::SetBossState(type, state))
return false;
if (type == DATA_MALYGOS_EVENT)
{
if (state == FAIL)
{
for (std::list<uint64>::const_iterator itr_trigger = portalTriggers.begin(); itr_trigger != portalTriggers.end(); ++itr_trigger)
{
if (Creature* trigger = instance->GetCreature(*itr_trigger))
{
// just in case
trigger->RemoveAllAuras();
trigger->AI()->Reset();
}
}
SpawnGameObject(GO_FOCUSING_IRIS,focusingIrisPosition);
SpawnGameObject(GO_EXIT_PORTAL,exitPortalPosition);
if (GameObject* platform = instance->GetGameObject(platformGUID))
platform->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
} else if (state == DONE)
{
if (Creature* malygos = instance->GetCreature(malygosGUID))
malygos->SummonCreature(NPC_ALEXSTRASZA,829.0679f,1244.77f,279.7453f,2.32f);
SpawnGameObject(GO_EXIT_PORTAL,exitPortalPosition);
// we make the platform appear again because at the moment we don't support looting using a vehicle
if (GameObject* platform = instance->GetGameObject(platformGUID))
platform->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
if (GameObject* chest = instance->GetGameObject(chestGUID))
chest->SetRespawnTime(chest->GetRespawnDelay());
}
}
return true;
}
// There is no other way afaik...
void SpawnGameObject(uint32 entry, Position& pos)
{
GameObject* go = new GameObject;
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, instance,
PHASEMASK_NORMAL, pos.GetPositionX(),pos.GetPositionY(),pos.GetPositionZ(),pos.GetOrientation(),
0,0,0,0,120,GO_STATE_READY))
{
delete go;
return;
}
instance->Add(go);
}
void OnGameObjectCreate(GameObject* go)
{
switch (go->GetEntry())
{
case GO_NEXUS_RAID_PLATFORM:
platformGUID = go->GetGUID();
break;
case GO_FOCUSING_IRIS:
go->GetPosition(&focusingIrisPosition);
break;
case GO_EXIT_PORTAL:
exitPortalGUID = go->GetGUID();
go->GetPosition(&exitPortalPosition);
break;
case GO_ALEXSTRASZA_S_GIFT:
case GO_ALEXSTRASZA_S_GIFT_2:
chestGUID = go->GetGUID();
break;
}
}
void OnCreatureCreate(Creature* creature)
{
switch (creature->GetEntry())
{
case NPC_VORTEX_TRIGGER:
vortexTriggers.push_back(creature->GetGUID());
break;
case NPC_MALYGOS:
malygosGUID = creature->GetGUID();
break;
case NPC_PORTAL_TRIGGER:
portalTriggers.push_back(creature->GetGUID());
break;
}
}
void ProcessEvent(GameObject* go, uint32 eventId)
{
if (eventId == EVENT_FOCUSING_IRIS)
{
go->Delete(); // this is not the best way.
if (Creature* malygos = instance->GetCreature(malygosGUID))
malygos->GetMotionMaster()->MovePoint(4,770.10f, 1275.33f, 267.23f); // MOVE_INIT_PHASE_ONE
if (GameObject* exitPortal = instance->GetGameObject(exitPortalGUID))
exitPortal->Delete();
}
}
void VortexHandling()
{
if (Creature* malygos = instance->GetCreature(malygosGUID))
{
std::list<HostileReference*> m_threatlist = malygos->getThreatManager().getThreatList();
for (std::list<uint64>::const_iterator itr_vortex = vortexTriggers.begin(); itr_vortex != vortexTriggers.end(); ++itr_vortex)
{
if (m_threatlist.empty())
return;
uint8 counter = 0;
if (Creature* trigger = instance->GetCreature(*itr_vortex))
{
// each trigger have to cast the spell to 5 players.
for (std::list<HostileReference*>::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
{
if (counter >= 5)
break;
if (Unit* target = (*itr)->getTarget())
{
Player* player = target->ToPlayer();
if (!player || player->isGameMaster() || player->HasAura(SPELL_VORTEX_4))
continue;
player->CastSpell(trigger,SPELL_VORTEX_4,true);
counter++;
}
}
}
}
}
}
void PowerSparksHandling()
{
bool next = (lastPortalGUID == portalTriggers.back() || !lastPortalGUID ? true : false);
for (std::list<uint64>::const_iterator itr_trigger = portalTriggers.begin(); itr_trigger != portalTriggers.end(); ++itr_trigger)
{
if (next)
{
if (Creature* trigger = instance->GetCreature(*itr_trigger))
{
lastPortalGUID = trigger->GetGUID();
trigger->CastSpell(trigger,SPELL_PORTAL_OPENED,true);
return;
}
}
if (*itr_trigger == lastPortalGUID)
next = true;
}
}
void SetData(uint32 data,uint32 /*value*/)
{
switch (data)
{
case DATA_VORTEX_HANDLING:
VortexHandling();
break;
case DATA_POWER_SPARKS_HANDLING:
PowerSparksHandling();
break;
}
}
uint64 GetData64(uint32 data)
{
switch (data)
{
case DATA_TRIGGER:
return vortexTriggers.front();
case DATA_MALYGOS:
return malygosGUID;
case DATA_PLATFORM:
return platformGUID;
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "E E " << GetBossSaveData();
OUT_SAVE_INST_DATA_COMPLETE;
return saveStream.str();
}
void Load(const char* str)
{
if (!str)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(str);
char dataHead1, dataHead2;
std::istringstream loadStream(str);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'E' && dataHead2 == 'E')
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
} else OUT_LOAD_INST_DATA_FAIL;
OUT_LOAD_INST_DATA_COMPLETE;
}
private:
std::list<uint64> vortexTriggers;
std::list<uint64> portalTriggers;
uint64 malygosGUID;
uint64 lastPortalGUID;
uint64 platformGUID;
uint64 exitPortalGUID;
uint64 chestGUID;
Position focusingIrisPosition;
Position exitPortalPosition;
};
};
void AddSC_instance_eye_of_eternity()
{
// doesn't exist in the database?
//new instance_eye_of_eternity();
new instance_eye_of_eternity();
}