aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-06-23 12:56:17 +0200
committerShauren <shauren.trinity@gmail.com>2013-06-23 12:56:17 +0200
commit6cbced8e1665415f42de3f46164121fe26bbb984 (patch)
tree6f362cbb73fc3e986eaa5fcac753e5e0ff110cc2
parenta2855e84c50167f19bcd7d616b07497809d130b7 (diff)
Scripts/Spells: Removed obsolete scaling mount scripts
-rw-r--r--sql/updates/world/2013_06_23_00_world_spell_script_names_434.sql1
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp181
2 files changed, 1 insertions, 181 deletions
diff --git a/sql/updates/world/2013_06_23_00_world_spell_script_names_434.sql b/sql/updates/world/2013_06_23_00_world_spell_script_names_434.sql
new file mode 100644
index 00000000000..33b0e8981b9
--- /dev/null
+++ b/sql/updates/world/2013_06_23_00_world_spell_script_names_434.sql
@@ -0,0 +1 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_magic_broom','spell_headless_horseman_mount','spell_winged_steed_of_the_ebon_blade','spell_big_love_rocket','spell_invincible','spell_blazing_hippogryph','spell_celestial_steed','spell_x53_touring_rocket');
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 2ffd8c80601..446c2d43f00 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -3032,179 +3032,6 @@ class spell_gen_summon_elemental : public SpellScriptLoader
uint32 _spellId;
};
-enum Mounts
-{
- SPELL_COLD_WEATHER_FLYING = 54197,
-
- // Magic Broom
- SPELL_MAGIC_BROOM_60 = 42680,
- SPELL_MAGIC_BROOM_100 = 42683,
- SPELL_MAGIC_BROOM_150 = 42667,
- SPELL_MAGIC_BROOM_280 = 42668,
-
- // Headless Horseman's Mount
- SPELL_HEADLESS_HORSEMAN_MOUNT_60 = 51621,
- SPELL_HEADLESS_HORSEMAN_MOUNT_100 = 48024,
- SPELL_HEADLESS_HORSEMAN_MOUNT_150 = 51617,
- SPELL_HEADLESS_HORSEMAN_MOUNT_280 = 48023,
-
- // Winged Steed of the Ebon Blade
- SPELL_WINGED_STEED_150 = 54726,
- SPELL_WINGED_STEED_280 = 54727,
-
- // Big Love Rocket
- SPELL_BIG_LOVE_ROCKET_0 = 71343,
- SPELL_BIG_LOVE_ROCKET_60 = 71344,
- SPELL_BIG_LOVE_ROCKET_100 = 71345,
- SPELL_BIG_LOVE_ROCKET_150 = 71346,
- SPELL_BIG_LOVE_ROCKET_310 = 71347,
-
- // Invincible
- SPELL_INVINCIBLE_60 = 72281,
- SPELL_INVINCIBLE_100 = 72282,
- SPELL_INVINCIBLE_150 = 72283,
- SPELL_INVINCIBLE_310 = 72284,
-
- // Blazing Hippogryph
- SPELL_BLAZING_HIPPOGRYPH_150 = 74854,
- SPELL_BLAZING_HIPPOGRYPH_280 = 74855,
-
- // Celestial Steed
- SPELL_CELESTIAL_STEED_60 = 75619,
- SPELL_CELESTIAL_STEED_100 = 75620,
- SPELL_CELESTIAL_STEED_150 = 75617,
- SPELL_CELESTIAL_STEED_280 = 75618,
- SPELL_CELESTIAL_STEED_310 = 76153,
-
- // X-53 Touring Rocket
- SPELL_X53_TOURING_ROCKET_150 = 75957,
- SPELL_X53_TOURING_ROCKET_280 = 75972,
- SPELL_X53_TOURING_ROCKET_310 = 76154,
-};
-
-class spell_gen_mount : public SpellScriptLoader
-{
- public:
- spell_gen_mount(const char* name, uint32 mount0 = 0, uint32 mount60 = 0, uint32 mount100 = 0, uint32 mount150 = 0, uint32 mount280 = 0, uint32 mount310 = 0) : SpellScriptLoader(name),
- _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { }
-
- class spell_gen_mount_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_gen_mount_SpellScript);
-
- public:
- spell_gen_mount_SpellScript(uint32 mount0, uint32 mount60, uint32 mount100, uint32 mount150, uint32 mount280, uint32 mount310) : SpellScript(),
- _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { }
-
- bool Validate(SpellInfo const* /*spell*/)
- {
- if (_mount0 && !sSpellMgr->GetSpellInfo(_mount0))
- return false;
- if (_mount60 && !sSpellMgr->GetSpellInfo(_mount60))
- return false;
- if (_mount100 && !sSpellMgr->GetSpellInfo(_mount100))
- return false;
- if (_mount150 && !sSpellMgr->GetSpellInfo(_mount150))
- return false;
- if (_mount280 && !sSpellMgr->GetSpellInfo(_mount280))
- return false;
- if (_mount310 && !sSpellMgr->GetSpellInfo(_mount310))
- return false;
- return true;
- }
-
- void HandleMount(SpellEffIndex effIndex)
- {
- PreventHitDefaultEffect(effIndex);
-
- if (Player* target = GetHitPlayer())
- {
- // Prevent stacking of mounts and client crashes upon dismounting
- target->RemoveAurasByType(SPELL_AURA_MOUNTED, 0, GetHitAura());
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = false;
- uint32 map = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId());
- if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING)))
- canFly = true;
-
- float x, y, z;
- target->GetPosition(x, y, z);
- uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag);
- if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- uint32 mount = 0;
- switch (target->GetBaseSkillValue(SKILL_RIDING))
- {
- case 0:
- mount = _mount0;
- break;
- case 75:
- mount = _mount60;
- break;
- case 150:
- mount = _mount100;
- break;
- case 225:
- if (canFly)
- mount = _mount150;
- else
- mount = _mount100;
- break;
- case 300:
- if (canFly)
- mount = _mount280;
- else
- mount = _mount100;
- break;
- case 375:
- if (canFly)
- mount = _mount310;
- else
- mount = _mount100;
- break;
- default:
- break;
- }
-
- if (mount)
- {
- PreventHitAura();
- target->CastSpell(target, mount, true);
- }
- }
- }
-
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_gen_mount_SpellScript::HandleMount, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
- }
-
- private:
- uint32 _mount0;
- uint32 _mount60;
- uint32 _mount100;
- uint32 _mount150;
- uint32 _mount280;
- uint32 _mount310;
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_gen_mount_SpellScript(_mount0, _mount60, _mount100, _mount150, _mount280, _mount310);
- }
-
- private:
- uint32 _mount0;
- uint32 _mount60;
- uint32 _mount100;
- uint32 _mount150;
- uint32 _mount280;
- uint32 _mount310;
-};
-
enum FoamSword
{
ITEM_FOAM_SWORD_GREEN = 45061,
@@ -3810,14 +3637,6 @@ void AddSC_generic_spell_scripts()
new spell_gen_lifebloom("spell_faction_champion_dru_lifebloom", SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL);
new spell_gen_summon_elemental("spell_gen_summon_fire_elemental", SPELL_SUMMON_FIRE_ELEMENTAL);
new spell_gen_summon_elemental("spell_gen_summon_earth_elemental", SPELL_SUMMON_EARTH_ELEMENTAL);
- new spell_gen_mount("spell_magic_broom", 0, SPELL_MAGIC_BROOM_60, SPELL_MAGIC_BROOM_100, SPELL_MAGIC_BROOM_150, SPELL_MAGIC_BROOM_280);
- new spell_gen_mount("spell_headless_horseman_mount", 0, SPELL_HEADLESS_HORSEMAN_MOUNT_60, SPELL_HEADLESS_HORSEMAN_MOUNT_100, SPELL_HEADLESS_HORSEMAN_MOUNT_150, SPELL_HEADLESS_HORSEMAN_MOUNT_280);
- new spell_gen_mount("spell_winged_steed_of_the_ebon_blade", 0, 0, 0, SPELL_WINGED_STEED_150, SPELL_WINGED_STEED_280);
- new spell_gen_mount("spell_big_love_rocket", SPELL_BIG_LOVE_ROCKET_0, SPELL_BIG_LOVE_ROCKET_60, SPELL_BIG_LOVE_ROCKET_100, SPELL_BIG_LOVE_ROCKET_150, SPELL_BIG_LOVE_ROCKET_310);
- new spell_gen_mount("spell_invincible", 0, SPELL_INVINCIBLE_60, SPELL_INVINCIBLE_100, SPELL_INVINCIBLE_150, SPELL_INVINCIBLE_310);
- new spell_gen_mount("spell_blazing_hippogryph", 0, 0, 0, SPELL_BLAZING_HIPPOGRYPH_150, SPELL_BLAZING_HIPPOGRYPH_280);
- new spell_gen_mount("spell_celestial_steed", 0, SPELL_CELESTIAL_STEED_60, SPELL_CELESTIAL_STEED_100, SPELL_CELESTIAL_STEED_150, SPELL_CELESTIAL_STEED_280, SPELL_CELESTIAL_STEED_310);
- new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310);
new spell_gen_upper_deck_create_foam_sword();
new spell_gen_bonked();
new spell_gen_gift_of_naaru();