aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/base/world_database.sql2
-rw-r--r--sql/updates/9205_world_spell_script_names.sql3
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp4
-rw-r--r--src/server/game/Spells/SpellMgr.cpp4
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp38
5 files changed, 41 insertions, 10 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql
index 656f1ead05c..379477cb949 100644
--- a/sql/base/world_database.sql
+++ b/sql/base/world_database.sql
@@ -14712,6 +14712,8 @@ CREATE TABLE `spell_script_names` (
LOCK TABLES `spell_script_names` WRITE;
/*!40000 ALTER TABLE `spell_script_names` DISABLE KEYS */;
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+-- generic
+( 58601, 'spell_gen_remove_flight_auras'),
-- warrior
( 12975,'spell_warr_last_stand'),
( 21977,'spell_warr_warriors_wrath'),
diff --git a/sql/updates/9205_world_spell_script_names.sql b/sql/updates/9205_world_spell_script_names.sql
new file mode 100644
index 00000000000..15ec8063c06
--- /dev/null
+++ b/sql/updates/9205_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=58601 AND `ScriptName`='spell_gen_remove_flight_auras';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(58601, 'spell_gen_remove_flight_auras');
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 0af5b043fd7..fec801b5b67 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -5715,6 +5715,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
case 60244: // Blood Parrot Despawn Aura
target->CastSpell((Unit*)NULL, GetAmount(), true, NULL, this);
break;
+ case 58600: // Restricted Flight Area
+ if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
+ target->CastSpell(target, 58601, true);
+ break;
case 68839: // Corrupt Soul
target->CastSpell(target, 68846, true, NULL, this, GetCasterGUID());
break;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index c4870a9b92f..907494ada23 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3089,14 +3089,14 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
// Extra conditions -- leaving the possibility add extra conditions...
switch(spellId)
{
- case 58600: // No fly Zone - Dalaran (Krasus Landing exception)
+ case 58600: // No fly Zone - Dalaran
if (!player)
return false;
AreaTableEntry const* pArea = GetAreaEntryByAreaID(player->GetAreaId());
if (!(pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE))
return false;
- if (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY) || player->HasAura(44795))
+ if (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY))
return false;
break;
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 99e43d732b5..313a9b6dbfd 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -24,14 +24,36 @@
#include "ScriptPCH.h"
+class spell_gen_remove_flight_auras : public SpellHandlerScript
+{
+ public:
+
+ spell_gen_remove_flight_auras() : SpellHandlerScript("spell_gen_remove_flight_auras") {}
+
+ class spell_gen_remove_flight_auras_SpellScript : public SpellScript
+ {
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ Unit *target = GetHitUnit();
+ if (!target)
+ return;
+ target->RemoveAurasByType(SPELL_AURA_FLY);
+ target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
+ }
+
+ void Register()
+ {
+ EffectHandlers += EffectHandlerFn(spell_gen_remove_flight_auras_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_remove_flight_auras_SpellScript;
+ }
+}
+
void AddSC_generic_spell_scripts()
{
- //Script *newscript;
-
- /*
- newscript = new Script;
- newscript->Name = "spell_gen_";
- newscript->GetSpellScript = &GetSpellScript_spell_gen_;
- newscript->RegisterSelf();
- */
+ new spell_gen_remove_flight_auras;
}