mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 01:53:47 +00:00
fix(Scripts/EoE): Remove red dragon hack (#24541)
Co-authored-by: Trista <aconstantgoal@abv.bg>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
--
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` IN (56072, 56070);
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(56072, 'spell_wyrmrest_skytalon_ride_red_dragon_buddy_trigger'),
|
||||
(56070, 'spell_wyrmrest_skytalon_summon_red_dragon_buddy');
|
||||
@@ -703,20 +703,14 @@ public:
|
||||
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
|
||||
if (!PlayerList.IsEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* pPlayer = i->GetSource())
|
||||
if (Player* player = i->GetSource())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(pPlayer);
|
||||
sScriptMgr->AnticheatSetUnderACKmount(player);
|
||||
|
||||
if (!pPlayer->IsAlive() || pPlayer->IsGameMaster())
|
||||
if (!player->IsAlive() || player->IsGameMaster())
|
||||
continue;
|
||||
|
||||
if (Creature* c = me->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
|
||||
{
|
||||
c->SetFaction(pPlayer->GetFaction());
|
||||
//pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
|
||||
c->m_Events.AddEventAtOffset(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), 500ms);
|
||||
AttackStart(c);
|
||||
}
|
||||
player->CastSpell(player, SPELL_SUMMON_RED_DRAGON_BUDDY, true);
|
||||
}
|
||||
|
||||
events.RescheduleEvent(EVENT_SAY_PHASE_3_INTRO, 3s, 1);
|
||||
@@ -1433,6 +1427,19 @@ public:
|
||||
{
|
||||
npc_eoe_wyrmrest_skytalonAI(Creature* pCreature) : VehicleAI(pCreature) { }
|
||||
|
||||
void IsSummonedBy(WorldObject* summoner) override
|
||||
{
|
||||
me->SetDisableGravity(true);
|
||||
if (summoner && summoner->IsPlayer())
|
||||
{
|
||||
ObjectGuid summonerGUID = summoner->GetGUID();
|
||||
me->m_Events.AddEventAtOffset([summonerGUID, this] {
|
||||
if (Player* rider = ObjectAccessor::GetPlayer(*me, summonerGUID))
|
||||
DoCast(rider, SPELL_RIDE_RED_DRAGON, true);
|
||||
}, 2s);
|
||||
}
|
||||
}
|
||||
|
||||
void PassengerBoarded(Unit* pass, int8 /*seat*/, bool apply) override
|
||||
{
|
||||
if (apply)
|
||||
@@ -1517,6 +1524,47 @@ class spell_eoe_ph3_surge_of_power : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 56070 - Summon Red Dragon Buddy
|
||||
class spell_wyrmrest_skytalon_summon_red_dragon_buddy : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_wyrmrest_skytalon_summon_red_dragon_buddy);
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->IsPlayer();
|
||||
}
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
dest.Relocate(GetCaster()->GetPosition());
|
||||
// Adjust effect summon position to lower Z
|
||||
Position const offset = { 0.0f, 0.0f, -80.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_wyrmrest_skytalon_summon_red_dragon_buddy::SetDest, EFFECT_0, TARGET_DEST_CASTER_RADIUS);
|
||||
}
|
||||
};
|
||||
|
||||
// 56072 - Ride Red Dragon Buddy
|
||||
class spell_wyrmrest_skytalon_ride_red_dragon_buddy_trigger : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_wyrmrest_skytalon_ride_red_dragon_buddy_trigger);
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), GetEffectValue(), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_wyrmrest_skytalon_ride_red_dragon_buddy_trigger::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_malygos()
|
||||
{
|
||||
new boss_malygos();
|
||||
@@ -1528,6 +1576,8 @@ void AddSC_boss_malygos()
|
||||
new npc_scion_of_eternity();
|
||||
new npc_hover_disk();
|
||||
new npc_eoe_wyrmrest_skytalon();
|
||||
RegisterSpellScript(spell_wyrmrest_skytalon_summon_red_dragon_buddy);
|
||||
RegisterSpellScript(spell_wyrmrest_skytalon_ride_red_dragon_buddy_trigger);
|
||||
|
||||
RegisterSpellScript(spell_eoe_ph3_surge_of_power);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ enum NPCs
|
||||
NPC_HOVER_DISK = 30248,
|
||||
NPC_ARCANE_OVERLOAD = 30282,
|
||||
NPC_SURGE_OF_POWER = 30334,
|
||||
NPC_WYRMREST_SKYTALON = 30161,
|
||||
NPC_STATIC_FIELD = 30592,
|
||||
NPC_ALEXSTRASZA = 32295,
|
||||
};
|
||||
@@ -75,6 +74,8 @@ enum eSpells
|
||||
SPELL_HASTE = 57060,
|
||||
|
||||
SPELL_ALEXSTRASZA_GIFT = 61028,
|
||||
SPELL_SUMMON_RED_DRAGON_BUDDY = 56070,
|
||||
SPELL_RIDE_RED_DRAGON = 56072
|
||||
};
|
||||
|
||||
enum eAchiev
|
||||
|
||||
@@ -21,18 +21,6 @@
|
||||
#include "Vehicle.h"
|
||||
#include "eye_of_eternity.h"
|
||||
|
||||
bool EoEDrakeEnterVehicleEvent::Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
|
||||
{
|
||||
if (Player* p = ObjectAccessor::GetPlayer(_owner, _playerGUID))
|
||||
if (p->IsInWorld() && !p->IsDuringRemoveFromWorld() && !p->isBeingLoaded() && p->FindMap() == _owner.FindMap())
|
||||
{
|
||||
p->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, &_owner, true);
|
||||
return true;
|
||||
}
|
||||
_owner.DespawnOrUnsummon(1ms);
|
||||
return true;
|
||||
}
|
||||
|
||||
class instance_eye_of_eternity : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
@@ -68,7 +56,7 @@ public:
|
||||
return EncounterStatus == IN_PROGRESS;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* pPlayer) override
|
||||
void OnPlayerEnter(Player* player) override
|
||||
{
|
||||
if (EncounterStatus == DONE)
|
||||
{
|
||||
@@ -79,18 +67,12 @@ public:
|
||||
go->SetPhaseMask(2, true);
|
||||
|
||||
// no floor, so put players on drakes
|
||||
if (pPlayer)
|
||||
if (player)
|
||||
{
|
||||
if (!pPlayer->IsAlive())
|
||||
if (!player->IsAlive())
|
||||
return;
|
||||
|
||||
if (Creature* c = pPlayer->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
|
||||
{
|
||||
c->SetCanFly(true);
|
||||
c->SetFaction(pPlayer->GetFaction());
|
||||
//pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
|
||||
c->m_Events.AddEventAtOffset(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), 500ms);
|
||||
}
|
||||
player->CastSpell(player, SPELL_SUMMON_RED_DRAGON_BUDDY, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user