Skip to content

Commit c7e752f

Browse files
NyeriahTrista
andauthored
fix(Scripts/EoE): Remove red dragon hack (azerothcore#24541)
Co-authored-by: Trista <aconstantgoal@abv.bg>
1 parent 640004b commit c7e752f

4 files changed

Lines changed: 71 additions & 33 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--
2+
DELETE FROM `spell_script_names` WHERE `spell_id` IN (56072, 56070);
3+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
4+
(56072, 'spell_wyrmrest_skytalon_ride_red_dragon_buddy_trigger'),
5+
(56070, 'spell_wyrmrest_skytalon_summon_red_dragon_buddy');

src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -703,20 +703,14 @@ class boss_malygos : public CreatureScript
703703
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
704704
if (!PlayerList.IsEmpty())
705705
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
706-
if (Player* pPlayer = i->GetSource())
706+
if (Player* player = i->GetSource())
707707
{
708-
sScriptMgr->AnticheatSetUnderACKmount(pPlayer);
708+
sScriptMgr->AnticheatSetUnderACKmount(player);
709709

710-
if (!pPlayer->IsAlive() || pPlayer->IsGameMaster())
710+
if (!player->IsAlive() || player->IsGameMaster())
711711
continue;
712712

713-
if (Creature* c = me->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
714-
{
715-
c->SetFaction(pPlayer->GetFaction());
716-
//pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
717-
c->m_Events.AddEventAtOffset(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), 500ms);
718-
AttackStart(c);
719-
}
713+
player->CastSpell(player, SPELL_SUMMON_RED_DRAGON_BUDDY, true);
720714
}
721715

722716
events.RescheduleEvent(EVENT_SAY_PHASE_3_INTRO, 3s, 1);
@@ -1433,6 +1427,19 @@ class npc_eoe_wyrmrest_skytalon : public CreatureScript
14331427
{
14341428
npc_eoe_wyrmrest_skytalonAI(Creature* pCreature) : VehicleAI(pCreature) { }
14351429

1430+
void IsSummonedBy(WorldObject* summoner) override
1431+
{
1432+
me->SetDisableGravity(true);
1433+
if (summoner && summoner->IsPlayer())
1434+
{
1435+
ObjectGuid summonerGUID = summoner->GetGUID();
1436+
me->m_Events.AddEventAtOffset([summonerGUID, this] {
1437+
if (Player* rider = ObjectAccessor::GetPlayer(*me, summonerGUID))
1438+
DoCast(rider, SPELL_RIDE_RED_DRAGON, true);
1439+
}, 2s);
1440+
}
1441+
}
1442+
14361443
void PassengerBoarded(Unit* pass, int8 /*seat*/, bool apply) override
14371444
{
14381445
if (apply)
@@ -1517,6 +1524,47 @@ class spell_eoe_ph3_surge_of_power : public SpellScript
15171524
}
15181525
};
15191526

1527+
// 56070 - Summon Red Dragon Buddy
1528+
class spell_wyrmrest_skytalon_summon_red_dragon_buddy : public SpellScript
1529+
{
1530+
PrepareSpellScript(spell_wyrmrest_skytalon_summon_red_dragon_buddy);
1531+
1532+
bool Load() override
1533+
{
1534+
return GetCaster()->IsPlayer();
1535+
}
1536+
1537+
void SetDest(SpellDestination& dest)
1538+
{
1539+
dest.Relocate(GetCaster()->GetPosition());
1540+
// Adjust effect summon position to lower Z
1541+
Position const offset = { 0.0f, 0.0f, -80.0f, 0.0f };
1542+
dest.RelocateOffset(offset);
1543+
}
1544+
1545+
void Register() override
1546+
{
1547+
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_wyrmrest_skytalon_summon_red_dragon_buddy::SetDest, EFFECT_0, TARGET_DEST_CASTER_RADIUS);
1548+
}
1549+
};
1550+
1551+
// 56072 - Ride Red Dragon Buddy
1552+
class spell_wyrmrest_skytalon_ride_red_dragon_buddy_trigger : public SpellScript
1553+
{
1554+
PrepareSpellScript(spell_wyrmrest_skytalon_ride_red_dragon_buddy_trigger);
1555+
1556+
void HandleScript(SpellEffIndex /*effIndex*/)
1557+
{
1558+
if (Unit* target = GetHitUnit())
1559+
target->CastSpell(GetCaster(), GetEffectValue(), true);
1560+
}
1561+
1562+
void Register() override
1563+
{
1564+
OnEffectHitTarget += SpellEffectFn(spell_wyrmrest_skytalon_ride_red_dragon_buddy_trigger::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
1565+
}
1566+
};
1567+
15201568
void AddSC_boss_malygos()
15211569
{
15221570
new boss_malygos();
@@ -1528,6 +1576,8 @@ void AddSC_boss_malygos()
15281576
new npc_scion_of_eternity();
15291577
new npc_hover_disk();
15301578
new npc_eoe_wyrmrest_skytalon();
1579+
RegisterSpellScript(spell_wyrmrest_skytalon_summon_red_dragon_buddy);
1580+
RegisterSpellScript(spell_wyrmrest_skytalon_ride_red_dragon_buddy_trigger);
15311581

15321582
RegisterSpellScript(spell_eoe_ph3_surge_of_power);
15331583
}

src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ enum NPCs
4646
NPC_HOVER_DISK = 30248,
4747
NPC_ARCANE_OVERLOAD = 30282,
4848
NPC_SURGE_OF_POWER = 30334,
49-
NPC_WYRMREST_SKYTALON = 30161,
5049
NPC_STATIC_FIELD = 30592,
5150
NPC_ALEXSTRASZA = 32295,
5251
};
@@ -75,6 +74,8 @@ enum eSpells
7574
SPELL_HASTE = 57060,
7675

7776
SPELL_ALEXSTRASZA_GIFT = 61028,
77+
SPELL_SUMMON_RED_DRAGON_BUDDY = 56070,
78+
SPELL_RIDE_RED_DRAGON = 56072
7879
};
7980

8081
enum eAchiev

src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@
2121
#include "Vehicle.h"
2222
#include "eye_of_eternity.h"
2323

24-
bool EoEDrakeEnterVehicleEvent::Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
25-
{
26-
if (Player* p = ObjectAccessor::GetPlayer(_owner, _playerGUID))
27-
if (p->IsInWorld() && !p->IsDuringRemoveFromWorld() && !p->isBeingLoaded() && p->FindMap() == _owner.FindMap())
28-
{
29-
p->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, &_owner, true);
30-
return true;
31-
}
32-
_owner.DespawnOrUnsummon(1ms);
33-
return true;
34-
}
35-
3624
class instance_eye_of_eternity : public InstanceMapScript
3725
{
3826
public:
@@ -68,7 +56,7 @@ class instance_eye_of_eternity : public InstanceMapScript
6856
return EncounterStatus == IN_PROGRESS;
6957
}
7058

71-
void OnPlayerEnter(Player* pPlayer) override
59+
void OnPlayerEnter(Player* player) override
7260
{
7361
if (EncounterStatus == DONE)
7462
{
@@ -79,18 +67,12 @@ class instance_eye_of_eternity : public InstanceMapScript
7967
go->SetPhaseMask(2, true);
8068

8169
// no floor, so put players on drakes
82-
if (pPlayer)
70+
if (player)
8371
{
84-
if (!pPlayer->IsAlive())
72+
if (!player->IsAlive())
8573
return;
8674

87-
if (Creature* c = pPlayer->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
88-
{
89-
c->SetCanFly(true);
90-
c->SetFaction(pPlayer->GetFaction());
91-
//pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
92-
c->m_Events.AddEventAtOffset(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), 500ms);
93-
}
75+
player->CastSpell(player, SPELL_SUMMON_RED_DRAGON_BUDDY, true);
9476
}
9577
}
9678
}

0 commit comments

Comments
 (0)