Script/IoC: Move some spell scripts from spell_generic to isle_of_conquest cpp
Signed-off-by: DDuarte <dnpd.dd@gmail.com>
This commit is contained in:
1 parent
c541f4f5de
commit
26496375f8
2 files changed
+125
-123
No files matched your search
@@ -1640,93 +1640,6 @@ class spell_gen_gnomish_transporter : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_gunship_portal : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_gunship_portal() : SpellScriptLoader("spell_gen_gunship_portal") { }
|
||||
|
||||
class spell_gen_gunship_portal_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_gunship_portal_SpellScript);
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
if (Battleground* bg = caster->GetBattleground())
|
||||
if (bg->GetTypeID(true) == BATTLEGROUND_IC)
|
||||
bg->DoAction(1, caster->GetGUID());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_gunship_portal_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_gen_gunship_portal_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum Launch
|
||||
{
|
||||
SPELL_LAUNCH_NO_FALLING_DAMAGE = 66251
|
||||
};
|
||||
|
||||
class spell_gen_launch : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_launch() : SpellScriptLoader("spell_gen_launch") { }
|
||||
|
||||
class spell_gen_launch_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_launch_SpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* player = GetHitPlayer())
|
||||
player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage
|
||||
}
|
||||
|
||||
void Launch()
|
||||
{
|
||||
WorldLocation const* const position = GetExplTargetDest();
|
||||
|
||||
if (Player* player = GetHitPlayer())
|
||||
{
|
||||
player->ExitVehicle();
|
||||
|
||||
// A better research is needed
|
||||
// There is no spell for this, the following calculation was based on void Spell::CalculateJumpSpeeds
|
||||
|
||||
float speedZ = 10.0f;
|
||||
float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY());
|
||||
float speedXY = dist;
|
||||
|
||||
player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_launch_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_FORCE_CAST);
|
||||
AfterHit += SpellHitFn(spell_gen_launch_SpellScript::Launch);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_gen_launch_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class spell_gen_lifeblood : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -2783,39 +2696,6 @@ class spell_gen_parachute : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum ParachuteIC
|
||||
{
|
||||
SPELL_PARACHUTE_IC = 66657
|
||||
};
|
||||
|
||||
class spell_gen_parachute_ic : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_parachute_ic() : SpellScriptLoader("spell_gen_parachute_ic") { }
|
||||
|
||||
class spell_gen_parachute_ic_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_parachute_ic_AuraScript);
|
||||
|
||||
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Player* target = GetTarget()->ToPlayer())
|
||||
if (target->m_movementInfo.fallTime > 2000)
|
||||
target->CastSpell(target, SPELL_PARACHUTE_IC, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_ic_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_gen_parachute_ic_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum PetSummoned
|
||||
{
|
||||
NPC_DOOMGUARD = 11859,
|
||||
@@ -3766,8 +3646,6 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_gadgetzan_transporter_backfire();
|
||||
new spell_gen_gift_of_naaru();
|
||||
new spell_gen_gnomish_transporter();
|
||||
new spell_gen_gunship_portal();
|
||||
new spell_gen_launch();
|
||||
new spell_gen_lifeblood();
|
||||
new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL);
|
||||
new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL);
|
||||
@@ -3791,7 +3669,6 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_oracle_wolvar_reputation();
|
||||
new spell_gen_orc_disguise();
|
||||
new spell_gen_parachute();
|
||||
new spell_gen_parachute_ic();
|
||||
new spell_gen_pet_summoned();
|
||||
new spell_gen_profession_research();
|
||||
new spell_gen_remove_flight_auras();
|
||||
|
||||
Reference in new issue
Block a user