From c26c7395a1c1bcdbb7592b1fb6c8d628f5b221fb Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 17 Aug 2009 00:37:31 +0400 Subject: [PATCH] [8377] Resolve some spell_area problems in GM and non-GM mode. * Make spell 40216 and 42016 casted/remove at aura 40214 apply/remove. And drop related spell_area possible existed data. * In general restore apply area limitations to spell casting in GM mode. --- sql/mangos.sql | 2 +- sql/updates/8377_01_mangos_spell_area.sql | 3 +++ sql/updates/Makefile.am | 2 ++ src/game/SpellAuras.cpp | 15 +++++++++++++++ src/game/SpellMgr.cpp | 4 ---- src/shared/revision_nr.h | 2 +- 6 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 sql/updates/8377_01_mangos_spell_area.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index bc9a7c07c..9e22461ab 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -24,7 +24,7 @@ CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, `cache_id` int(10) default '0', - `required_8364_01_mangos_db_version` bit(1) default NULL + `required_8377_01_mangos_spell_area` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- diff --git a/sql/updates/8377_01_mangos_spell_area.sql b/sql/updates/8377_01_mangos_spell_area.sql new file mode 100644 index 000000000..9291bc7a3 --- /dev/null +++ b/sql/updates/8377_01_mangos_spell_area.sql @@ -0,0 +1,3 @@ +ALTER TABLE db_version CHANGE COLUMN required_8364_01_mangos_db_version required_8377_01_mangos_spell_area bit; + +DELETE FROM `spell_area` where spell in (40216,42016); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index a55e7b9b6..f25b2401f 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -82,6 +82,7 @@ pkgdata_DATA = \ 8342_01_mangos_spell_proc_event.sql \ 8361_01_mangos_spell_bonus_data.sql \ 8364_01_mangos_db_version.sql \ + 8377_01_mangos_spell_area.sql \ README ## Additional files to include when running 'make dist' @@ -144,4 +145,5 @@ EXTRA_DIST = \ 8342_01_mangos_spell_proc_event.sql \ 8361_01_mangos_spell_bonus_data.sql \ 8364_01_mangos_db_version.sql \ + 8377_01_mangos_spell_area.sql \ README diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 15c46944d..210e33524 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2313,6 +2313,21 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } return; } + //Dragonmaw Illusion + case 40214 : + { + if(apply) + { + m_target->CastSpell(m_target, 40216, true); + m_target->CastSpell(m_target, 42016, true); + } + else + { + m_target->RemoveAurasDueToSpell(40216); + m_target->RemoveAurasDueToSpell(42016); + } + return; + } // LK Intro VO (1) case 58204: if(m_target->GetTypeId() == TYPEID_PLAYER) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index b0e907553..0738f1d19 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2666,10 +2666,6 @@ void SpellMgr::LoadSpellAreas() SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spellInfo, uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player) { - // allow in GM-mode - if (player && player->isGameMaster()) - return SPELL_CAST_OK; - // normal case if (spellInfo->AreaGroupId > 0) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 4b87da847..51e874749 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8376" + #define REVISION_NR "8377" #endif // __REVISION_NR_H__