mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Scripts/MGT: rewrite Kael'thas Sunstrider encounter
This commit is contained in:
36
sql/updates/world/custom/custom_2019_01_27_00_world.sql
Normal file
36
sql/updates/world/custom/custom_2019_01_27_00_world.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
-- Arcane Sphere
|
||||
UPDATE `creature_template` SET `speed_run`= 0.4286, `InhabitType`= 4, `faction`= 16, `flags_extra`= 0 WHERE `entry` IN (24708, 25543);
|
||||
UPDATE `creature_template` SET `ScriptName`= '', `AIName`= 'NullCreatureAI' WHERE `entry`= 24708;
|
||||
-- Flame Strike
|
||||
UPDATE `creature_template` SET `ScriptName`= '', `AIName`= 'NullCreatureAI' WHERE `entry`= 24666;
|
||||
UPDATE `creature_template` SET `flags_extra`= 2 WHERE `entry` IN (24666, 25554);
|
||||
-- Phoenix
|
||||
UPDATE `creature_template` SET `unit_flags`= 32768, `ScriptName`= 'npc_felblood_kaelthas_phoenix' WHERE `entry`= 24674;
|
||||
-- Phoenix Egg
|
||||
UPDATE `creature_template` SET `ScriptName`= '', `AIName`= 'PassiveAI' WHERE `entry`= 24675;
|
||||
|
||||
-- Template Addons
|
||||
DELETE FROM `creature_template_addon` WHERE `entry` IN (24708, 25543);
|
||||
INSERT INTO `creature_template_addon` (`entry`, `bytes1`, `bytes2`, `auras`) VALUES
|
||||
(24708, 0, 1, '44263'),
|
||||
(25543, 0, 1, '44263');
|
||||
|
||||
-- Texts
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`= 24664;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `comment`) VALUES
|
||||
(24664, 0, 0, 'Don\'t look so smug! I know what you\'re thinking, but Tempest Keep was merely a setback. Did you honestly believe I would trust the future to some blind, half-night elf mongrel?', 14, 0, 100, 0, 0, 12413, 25386, 'Kael\'thas Sunstrider - Intro 1'),
|
||||
(24664, 1, 0, 'Oh no, he was merely an instrument, a stepping stone to a much larger plan! It has all led to this... and this time you will not interfere!', 14, 0, 100, 0, 0, 0, 25387, 'Kael\'thas Sunstrider - Intro 2'),
|
||||
(24664, 2, 0, 'I\'ll turn your world... upside... down.', 14, 0, 100, 0, 0, 12418, 25390, 'Kael\'thas Sunstrider - Gravity Lapse Intro 2'),
|
||||
(24664, 3, 0, 'Do not get... too comfortable.', 14, 0, 100, 0, 0, 12420, 25392, 'Kael\'thas Sunstrider to Kael\'thas Sunstrider - Gravity lapse Intro 2'),
|
||||
(24664, 4, 0, 'Master, grant me strength.', 14, 0, 100, 0, 0, 12419, 25391, 'Kael\'thas Sunstrider to Kael\'thas Sunstrider - Power Feedback'),
|
||||
(24664, 5, 0, 'Vengeance burns!', 14, 0, 100, 0, 0, 12415, 25388, 'Kael\'thas Sunstrider - Summon Phoenix'),
|
||||
(24664, 6, 0, '%s begins to cast Pyroblast!', 41, 0, 100, 0, 0, 0, 20775, 'Kael\'thas Sunstrider - Announce Pyroblast'),
|
||||
(24664, 7, 0, 'My demise accomplishes nothing! The master will have you! You will drown in your own blood! The world shall burn! Aaaghh!', 14, 0, 100, 5, 0, 12421, 25393, 'Kael\'thas Sunstrider - Death');
|
||||
|
||||
UPDATE `spell_target_position` SET `PositionX`= 148.5, `PositionY`= 181, `PositionZ`= -16.7, `Orientation`= 4.79965 WHERE `ID`= 44218;
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
|
||||
('spell_felblood_kaelthas_flame_strike');
|
||||
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(44191, 'spell_felblood_kaelthas_flame_strike');
|
||||
@@ -4478,20 +4478,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
}
|
||||
break;
|
||||
case 36730: // Flame Strike
|
||||
{
|
||||
target->CastSpell(target, 36731, true, nullptr, this);
|
||||
break;
|
||||
}
|
||||
case 44191: // Flame Strike
|
||||
{
|
||||
if (target->GetMap()->IsDungeon())
|
||||
{
|
||||
uint32 spellId = target->GetMap()->IsHeroic() ? 46163 : 44190;
|
||||
|
||||
target->CastSpell(target, spellId, true, nullptr, this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 43681: // Inactive
|
||||
{
|
||||
if (target->GetTypeId() != TYPEID_PLAYER || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||
|
||||
@@ -5182,6 +5182,8 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
properties->Type = SUMMON_TYPE_TOTEM;
|
||||
if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(3069))) // Wild Mushroom
|
||||
properties->Type = SUMMON_TYPE_MINION;
|
||||
if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(61))) // Summon Arcane Spheres
|
||||
properties->Type = SUMMON_TYPE_NONE;
|
||||
if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(628))) // Hungry Plaguehound
|
||||
properties->Category = SUMMON_CATEGORY_PET;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,17 +33,24 @@
|
||||
3 - Kael'thas Sunstrider
|
||||
*/
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
{
|
||||
{ BOSS_KAELTHAS_SUNSTRIDER, DATA_KAELTHAS_SUNSTRIDER },
|
||||
{ 0, 0 } // END
|
||||
};
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_SELIN_DOOR, DATA_SELIN, DOOR_TYPE_PASSAGE },
|
||||
{ GO_SELIN_ENCOUNTER_DOOR, DATA_SELIN, DOOR_TYPE_ROOM },
|
||||
{ GO_VEXALLUS_DOOR, DATA_VEXALLUS, DOOR_TYPE_PASSAGE },
|
||||
{ GO_DELRISSA_DOOR, DATA_DELRISSA, DOOR_TYPE_PASSAGE },
|
||||
{ GO_KAEL_DOOR, DATA_KAELTHAS, DOOR_TYPE_ROOM },
|
||||
{ 0, 0, DOOR_TYPE_ROOM } // END
|
||||
{ GO_SELIN_DOOR, DATA_SELIN, DOOR_TYPE_PASSAGE },
|
||||
{ GO_SELIN_ENCOUNTER_DOOR, DATA_SELIN, DOOR_TYPE_ROOM },
|
||||
{ GO_VEXALLUS_DOOR, DATA_VEXALLUS, DOOR_TYPE_PASSAGE },
|
||||
{ GO_DELRISSA_DOOR, DATA_DELRISSA, DOOR_TYPE_PASSAGE },
|
||||
{ GO_ASYLUM_DOOR, DATA_KAELTHAS_SUNSTRIDER, DOOR_TYPE_ROOM },
|
||||
{ 0, 0, DOOR_TYPE_ROOM } // END
|
||||
};
|
||||
|
||||
Position const KalecgosSpawnPos = { 164.3747f, -397.1197f, 2.151798f, 1.66219f };
|
||||
Position const KaelthasTrashGroupDistanceComparisonPos = { 150.0f, 141.0f, -14.4f };
|
||||
|
||||
class instance_magisters_terrace : public InstanceMapScript
|
||||
{
|
||||
@@ -56,9 +63,15 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
{
|
||||
SetHeaders(DataHeader);
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadObjectData(creatureData, nullptr);
|
||||
LoadDoorData(doorData);
|
||||
Initialize();
|
||||
}
|
||||
|
||||
DelrissaDeathCount = 0;
|
||||
void Initialize()
|
||||
{
|
||||
_delrissaDeathCount = 0;
|
||||
_kaelthasIntroState = 0;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
@@ -66,7 +79,9 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
switch (type)
|
||||
{
|
||||
case DATA_DELRISSA_DEATH_COUNT:
|
||||
return DelrissaDeathCount;
|
||||
return _delrissaDeathCount;
|
||||
case DATA_KAELTHAS_INTRO_STATE:
|
||||
return _kaelthasIntroState;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -79,13 +94,13 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
{
|
||||
case DATA_DELRISSA_DEATH_COUNT:
|
||||
if (data == SPECIAL)
|
||||
++DelrissaDeathCount;
|
||||
_delrissaDeathCount++;
|
||||
else
|
||||
DelrissaDeathCount = 0;
|
||||
_delrissaDeathCount = 0;
|
||||
break;
|
||||
case DATA_KAELTHAS_STATUES:
|
||||
HandleGameObject(KaelStatue[0], data != 0);
|
||||
HandleGameObject(KaelStatue[1], data != 0);
|
||||
case DATA_KAELTHAS_INTRO_STATE:
|
||||
_kaelthasIntroState = data;
|
||||
SaveToDB();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -94,6 +109,8 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
InstanceScript::OnCreatureCreate(creature);
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_SELIN:
|
||||
@@ -106,6 +123,45 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
case NPC_HUMAN_KALECGOS:
|
||||
KalecgosGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_COILSKAR_WITCH:
|
||||
case NPC_SUNBLADE_WARLOCK:
|
||||
case NPC_SUNBLADE_MAGE_GUARD:
|
||||
case NPC_SISTER_OF_TORMENT:
|
||||
case NPC_ETHEREUM_SMUGGLER:
|
||||
case NPC_SUNBLADE_BLOOD_KNIGHT:
|
||||
if (creature->GetDistance(KaelthasTrashGroupDistanceComparisonPos) < 10.0f)
|
||||
_kaelthasPreTrashGUIDs.insert(creature->GetGUID());
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnUnitDeath(Unit* unit) override
|
||||
{
|
||||
if (unit->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
switch (unit->GetEntry())
|
||||
{
|
||||
case NPC_COILSKAR_WITCH:
|
||||
case NPC_SUNBLADE_WARLOCK:
|
||||
case NPC_SUNBLADE_MAGE_GUARD:
|
||||
case NPC_SISTER_OF_TORMENT:
|
||||
case NPC_ETHEREUM_SMUGGLER:
|
||||
case NPC_SUNBLADE_BLOOD_KNIGHT:
|
||||
if (_kaelthasPreTrashGUIDs.find(unit->GetGUID()) != _kaelthasPreTrashGUIDs.end())
|
||||
{
|
||||
_kaelthasPreTrashGUIDs.erase(unit->GetGUID());
|
||||
if (_kaelthasPreTrashGUIDs.size() == 0)
|
||||
{
|
||||
if (Creature* kaelthas = GetCreature(DATA_KAELTHAS_SUNSTRIDER))
|
||||
{
|
||||
kaelthas->AI()->SetData(DATA_KAELTHAS_INTRO, IN_PROGRESS);
|
||||
SetData(DATA_KAELTHAS_INTRO_STATE, DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -113,23 +169,13 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
InstanceScript::OnGameObjectCreate(go);
|
||||
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_VEXALLUS_DOOR:
|
||||
case GO_SELIN_DOOR:
|
||||
case GO_SELIN_ENCOUNTER_DOOR:
|
||||
case GO_DELRISSA_DOOR:
|
||||
case GO_KAEL_DOOR:
|
||||
AddDoor(go, true);
|
||||
break;
|
||||
case GO_KAEL_STATUE_1:
|
||||
KaelStatue[0] = go->GetGUID();
|
||||
break;
|
||||
case GO_KAEL_STATUE_2:
|
||||
KaelStatue[1] = go->GetGUID();
|
||||
break;
|
||||
case GO_ESCAPE_ORB:
|
||||
EscapeOrbGUID = go->GetGUID();
|
||||
_statueGUIDs.push_back(go->GetGUID());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -138,18 +184,7 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
|
||||
void OnGameObjectRemove(GameObject* go) override
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_VEXALLUS_DOOR:
|
||||
case GO_SELIN_DOOR:
|
||||
case GO_SELIN_ENCOUNTER_DOOR:
|
||||
case GO_DELRISSA_DOOR:
|
||||
case GO_KAEL_DOOR:
|
||||
AddDoor(go, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
InstanceScript::OnGameObjectRemove(go);
|
||||
}
|
||||
|
||||
void ProcessEvent(WorldObject* obj, uint32 eventId) override
|
||||
@@ -180,7 +215,14 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
{
|
||||
case DATA_DELRISSA:
|
||||
if (state == IN_PROGRESS)
|
||||
DelrissaDeathCount = 0;
|
||||
_delrissaDeathCount = 0;
|
||||
break;
|
||||
case DATA_KAELTHAS_SUNSTRIDER:
|
||||
if (state == NOT_STARTED)
|
||||
{
|
||||
for (ObjectGuid guid : _statueGUIDs)
|
||||
HandleGameObject(guid, false);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -196,10 +238,6 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
return SelinGUID;
|
||||
case DATA_DELRISSA:
|
||||
return DelrissaGUID;
|
||||
case DATA_KAEL_STATUE_LEFT:
|
||||
return KaelStatue[0];
|
||||
case DATA_KAEL_STATUE_RIGHT:
|
||||
return KaelStatue[1];
|
||||
case DATA_ESCAPE_ORB:
|
||||
return EscapeOrbGUID;
|
||||
default:
|
||||
@@ -208,14 +246,26 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void WriteSaveDataMore(std::ostringstream& data) override
|
||||
{
|
||||
data << _kaelthasIntroState;
|
||||
}
|
||||
|
||||
void ReadSaveDataMore(std::istringstream& data) override
|
||||
{
|
||||
data >> _kaelthasIntroState;
|
||||
}
|
||||
|
||||
protected:
|
||||
EventMap Events;
|
||||
ObjectGuid SelinGUID;
|
||||
ObjectGuid DelrissaGUID;
|
||||
ObjectGuid KaelStatue[2];
|
||||
ObjectGuid EscapeOrbGUID;
|
||||
ObjectGuid KalecgosGUID;
|
||||
uint32 DelrissaDeathCount;
|
||||
GuidVector _statueGUIDs;
|
||||
GuidSet _kaelthasPreTrashGUIDs;
|
||||
uint8 _delrissaDeathCount;
|
||||
uint8 _kaelthasIntroState;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
@@ -28,26 +28,47 @@ uint32 const EncounterCount = 4;
|
||||
|
||||
enum MTDataTypes
|
||||
{
|
||||
// Encounter states
|
||||
DATA_SELIN,
|
||||
DATA_VEXALLUS,
|
||||
DATA_DELRISSA,
|
||||
DATA_KAELTHAS,
|
||||
|
||||
DATA_KAEL_STATUE_LEFT,
|
||||
DATA_KAEL_STATUE_RIGHT,
|
||||
DATA_KAELTHAS_SUNSTRIDER,
|
||||
|
||||
// Encounter related
|
||||
DATA_KAELTHAS_INTRO,
|
||||
DATA_DELRISSA_DEATH_COUNT,
|
||||
DATA_KAELTHAS_STATUES,
|
||||
|
||||
// Additional data
|
||||
DATA_KAELTHAS_INTRO_STATE,
|
||||
|
||||
DATA_ESCAPE_ORB
|
||||
};
|
||||
|
||||
enum MTCreatureIds
|
||||
{
|
||||
NPC_SELIN = 24723,
|
||||
NPC_DELRISSA = 24560,
|
||||
NPC_FEL_CRYSTAL = 24722,
|
||||
NPC_KALECGOS = 24844,
|
||||
NPC_HUMAN_KALECGOS = 24848
|
||||
// Bosses
|
||||
BOSS_KAELTHAS_SUNSTRIDER = 24664,
|
||||
|
||||
// Encounter related
|
||||
/*Kael'thas Sunstrider*/
|
||||
NPC_ARCANE_SPHERE = 24708,
|
||||
NPC_FLAME_STRIKE = 24666,
|
||||
NPC_PHOENIX = 24674,
|
||||
NPC_PHOENIX_EGG = 24675,
|
||||
|
||||
NPC_SELIN = 24723,
|
||||
NPC_DELRISSA = 24560,
|
||||
NPC_FEL_CRYSTAL = 24722,
|
||||
NPC_KALECGOS = 24844,
|
||||
|
||||
// Event related
|
||||
NPC_HUMAN_KALECGOS = 24848,
|
||||
NPC_COILSKAR_WITCH = 24696,
|
||||
NPC_SUNBLADE_WARLOCK = 24686,
|
||||
NPC_SUNBLADE_MAGE_GUARD = 24683,
|
||||
NPC_SISTER_OF_TORMENT = 24697,
|
||||
NPC_ETHEREUM_SMUGGLER = 24698,
|
||||
NPC_SUNBLADE_BLOOD_KNIGHT = 24684,
|
||||
};
|
||||
|
||||
enum MTGameObjectIds
|
||||
@@ -56,7 +77,7 @@ enum MTGameObjectIds
|
||||
GO_SELIN_DOOR = 187979,
|
||||
GO_SELIN_ENCOUNTER_DOOR = 188065,
|
||||
GO_DELRISSA_DOOR = 187770,
|
||||
GO_KAEL_DOOR = 188064,
|
||||
GO_ASYLUM_DOOR = 188064,
|
||||
GO_KAEL_STATUE_1 = 188165,
|
||||
GO_KAEL_STATUE_2 = 188166,
|
||||
GO_ESCAPE_ORB = 188173
|
||||
@@ -83,4 +104,6 @@ inline AI* GetMagistersTerraceAI(T* obj)
|
||||
return GetInstanceAI<AI>(obj, MGTScriptName);
|
||||
}
|
||||
|
||||
#define RegisterMagistersTerraceCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetMagistersTerraceAI)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user