Add Hard Mode support to Flame Leviathan. more code cleanup.

Big Thanks to all who participated.

--HG--
branch : trunk
This commit is contained in:
Supabad
2010-06-28 14:05:32 +02:00
parent 0485d99e5d
commit 418360d8f9
5 changed files with 875 additions and 193 deletions
@@ -0,0 +1,3 @@
INSERT INTO areatrigger_scripts VALUES
(5369,'at_RX_214_repair_o_matic_station'),
(5423,'at_RX_214_repair_o_matic_station');
@@ -0,0 +1,8 @@
-- waypoint for mimron inferno
INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES
(33370, 1, 331.674, -68.6878, 409.804, 0, '0'),
(33370, 2, 274.578, -92.1829, 409.804, 0, '0'),
(33370, 3, 226.433, -66.6652, 409.793, 0, '0'),
(33370, 4, 206.092, -34.7447, 409.801, 0, '0'),
(33370, 5, 240.208, 1.10346, 409.802, 0, '0'),
(33370, 6, 337.199, 11.7051, 409.802, 0, '0');
+12
View File
@@ -0,0 +1,12 @@
UPDATE `creature_template` SET `ScriptName` = 'npc_thorims_hammer' WHERE `entry` =33365;
UPDATE `creature_template` SET `MovementType` =2, `ScriptName` = 'npc_mimirons_inferno' WHERE `entry` =33370;
UPDATE `creature_template` SET `ScriptName` = 'npc_hodirs_fury' WHERE `entry` =33312;
UPDATE `creature_template` SET `ScriptName` = 'npc_freyas_ward' WHERE `entry` =33367;
UPDATE `creature_template` SET `ScriptName` = 'npc_lorekeeper' WHERE `entry` =33686;
UPDATE `creature_template` SET `ScriptName` = 'npc_brann_bronzebeard' WHERE `entry` =33579;
UPDATE `creature_template` SET `ScriptName` = 'npc_freya_ward_summon' WHERE `entry` =34275;
UPDATE `creature_template` SET `ScriptName` = 'npc_mechanolift' WHERE `entry` =33214;
UPDATE `gameobject_template` SET `ScriptName` = 'go_ulduar_tower' WHERE `entry` =194375;
UPDATE `gameobject_template` SET `ScriptName` = 'go_ulduar_tower' WHERE `entry` =194371;
UPDATE `gameobject_template` SET `ScriptName` = 'go_ulduar_tower' WHERE `entry` =194370;
UPDATE `gameobject_template` SET `ScriptName` = 'go_ulduar_tower' WHERE `entry` =194377;
File diff suppressed because it is too large Load Diff
@@ -16,6 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "ScriptedEscortAI.h"
#include "ScriptPCH.h" #include "ScriptPCH.h"
#include "ulduar.h" #include "ulduar.h"
@@ -64,8 +65,7 @@ struct instance_ulduar : public ScriptedInstance
uint64 uiFreyaChestGUID; uint64 uiFreyaChestGUID;
void Initialize() void Initialize()
{ {
uiLeviathanGUID = 0;
uiIgnisGUID = 0; uiIgnisGUID = 0;
uiRazorscaleGUID = 0; uiRazorscaleGUID = 0;
uiXT002GUID = 0; uiXT002GUID = 0;
@@ -106,7 +106,7 @@ struct instance_ulduar : public ScriptedInstance
switch(pCreature->GetEntry()) switch(pCreature->GetEntry())
{ {
case NPC_LEVIATHAN: case NPC_LEVIATHAN:
uiLeviathanGUID = pCreature->GetGUID(); uiLeviathanGUID = pCreature->GetGUID();
break; break;
case NPC_IGNIS: case NPC_IGNIS:
uiIgnisGUID = pCreature->GetGUID(); uiIgnisGUID = pCreature->GetGUID();
@@ -187,22 +187,24 @@ struct instance_ulduar : public ScriptedInstance
if (flag == 7) if (flag == 7)
flag =0; flag =0;
break; break;
case GO_LEVIATHAN_GATE: case GO_LEVIATHAN_GATE:
uiLeviathanGateGUID = pGO->GetGUID(); uiLeviathanGateGUID = add ? pGO->GetGUID() : NULL;
HandleGameObject(NULL, false, pGO); HandleGameObject(NULL, false, pGO);
break; break;
} }
} }
void ProcessEvent(GameObject* pGO, uint32 uiEventId) void ProcessEvent(GameObject* pGO, uint32 uiEventId)
{ {
// Flame Leviathan's Tower Event triggers // Flame Leviathan's Tower Event triggers
Creature* pFlameLeviathan = instance->GetCreature(NPC_LEVIATHAN); Creature* pFlameLeviathan = instance->GetCreature(uiLeviathanGUID);
if (pFlameLeviathan && pFlameLeviathan->isAlive()) //No leviathan, no event triggering ;) if (pFlameLeviathan && pFlameLeviathan->isAlive()) //No leviathan, no event triggering ;)
switch(uiEventId) switch(uiEventId)
{ {
case EVENT_TOWER_OF_STORM_DESTROYED: case EVENT_TOWER_OF_STORM_DESTROYED:
pFlameLeviathan->AI()->DoAction(1); //pGO->GetInstanceData()->SetData(DATA_TOWER_STORMS,DESTROYED);
pFlameLeviathan->AI()->DoAction(1);
break; break;
case EVENT_TOWER_OF_FROST_DESTROYED: case EVENT_TOWER_OF_FROST_DESTROYED:
pFlameLeviathan->AI()->DoAction(2); pFlameLeviathan->AI()->DoAction(2);
@@ -210,7 +212,7 @@ struct instance_ulduar : public ScriptedInstance
case EVENT_TOWER_OF_FLAMES_DESTROYED: case EVENT_TOWER_OF_FLAMES_DESTROYED:
pFlameLeviathan->AI()->DoAction(3); pFlameLeviathan->AI()->DoAction(3);
break; break;
case EVENT_TOWER_OF_NATURE_DESTROYED: case EVENT_TOWER_OF_LIFE_DESTROYED:
pFlameLeviathan->AI()->DoAction(4); pFlameLeviathan->AI()->DoAction(4);
break; break;
} }
@@ -218,9 +220,6 @@ struct instance_ulduar : public ScriptedInstance
void SetData(uint32 type, uint32 data) void SetData(uint32 type, uint32 data)
{ {
if (type != TYPE_COLOSSUS)
uiEncounter[type] = data;
switch(type) switch(type)
{ {
/*case TYPE_IGNIS: /*case TYPE_IGNIS:
@@ -235,12 +234,12 @@ struct instance_ulduar : public ScriptedInstance
case TYPE_LEVIATHAN: case TYPE_LEVIATHAN:
if (data == IN_PROGRESS) if (data == IN_PROGRESS)
{ {
for (uint8 uiI = 0; uiI < 7; uiI++) for (uint8 uiI = 0; uiI < 7; ++uiI)
HandleGameObject(uiLeviathanDoor[uiI],false); HandleGameObject(uiLeviathanDoor[uiI],false);
} }
else else
{ {
for (uint8 uiI = 0; uiI < 7; uiI++) for (uint8 uiI = 0; uiI < 7; ++uiI)
HandleGameObject(uiLeviathanDoor[uiI],true); HandleGameObject(uiLeviathanDoor[uiI],true);
} }
break; break;
@@ -265,14 +264,15 @@ struct instance_ulduar : public ScriptedInstance
pGO->SetRespawnTime(pGO->GetRespawnDelay()); pGO->SetRespawnTime(pGO->GetRespawnDelay());
break; break;
case TYPE_COLOSSUS: case TYPE_COLOSSUS:
uiEncounter[TYPE_COLOSSUS] = data;
if (data == 2) if (data == 2)
{ {
if (Creature* pBoss = instance->GetCreature(uiLeviathanGUID)) if (Creature* pBoss = instance->GetCreature(uiLeviathanGUID))
pBoss->AI()->DoAction(10); pBoss->AI()->DoAction(10);
if (GameObject* pGate = instance->GetGameObject(uiLeviathanGateGUID)) if (GameObject* pGate = instance->GetGameObject(uiLeviathanGateGUID))
pGate->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); pGate->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
} }
break; break;
default: default:
break; break;
} }