@@ -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+
15201568void 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}
0 commit comments