From 19c5f4a03a86712591f8680d70e8d0afc0e9f6c5 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 27 Aug 2009 19:37:19 -0500 Subject: [PATCH] [8416] Fixed problem with double cast form passives at loading. Author: VladimirMangos * Drop learning form passives at form psell learning, and cast it explictly from code in all cases. * Drop cast form passives at learning. * Note: talents that have dependent form time passives still work in original way: learned and casted at learn if need. * Drop hack for spell 24907 casting at form apply: it casted fines as result normal triggered effect in related form spell. Original patch provided by nos4r2zod. --HG-- branch : trunk --- .../5426_8416_world_spell_learn_spell.sql | 21 +++++++++++++++++++ src/game/Player.cpp | 20 +++--------------- src/game/SpellAuras.cpp | 2 -- 3 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 sql/updates/5426_8416_world_spell_learn_spell.sql diff --git a/sql/updates/5426_8416_world_spell_learn_spell.sql b/sql/updates/5426_8416_world_spell_learn_spell.sql new file mode 100644 index 0000000000..4057fb6535 --- /dev/null +++ b/sql/updates/5426_8416_world_spell_learn_spell.sql @@ -0,0 +1,21 @@ +-- ALTER TABLE db_version CHANGE COLUMN required_8412_01_mangos_mangos_string required_8416_01_mangos_spell_learn_spell bit; + +/* All form passives */ +DELETE FROM spell_learn_spell WHERE SpellID in ( +1178, /* Bear Form (Passive) */ +3025, /* Cat Form (Passive) */ +5419, /* Travel Form (Passive) */ +5420, /* Tree of Life _passive_ */ +5421, /* Aquatic Form (Passive) */ +7376, /* Defensive Stance Passive */ +7381, /* Berserker Stance Passive */ +9635, /* Dire Bear Form (Passive) */ +21156, /* Battle Stance Passive */ +21178, /* Bear Form (Passive2) */ +24905, /* Moonkin Form (Passive) */ +34123, /* Tree of Life _pasive_ */ +33948, /* Flight Form (Passive) */ +34764, /* Flight Form (Passive) */ +40121, /* Swift Flight Form (Passive) */ +40122 /* Swift Flight Form (Passive) */ +); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b13999991f..61e3895cbb 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -3315,23 +3315,9 @@ void Player::RemoveTemporarySpell(uint32 spellId) bool Player::IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const { - bool need_cast = false; - - switch(spellInfo->Id) - { - // some spells not have stance data expected cast at form change or present - case 5419: need_cast = (m_form == FORM_TRAVEL); break; - case 7376: need_cast = (m_form == FORM_DEFENSIVESTANCE); break; - case 7381: need_cast = (m_form == FORM_BERSERKERSTANCE); break; - case 21156: need_cast = (m_form == FORM_BATTLESTANCE); break; - case 21178: need_cast = (m_form == FORM_BEAR || m_form == FORM_DIREBEAR); break; - case 33948: need_cast = (m_form == FORM_FLIGHT); break; - case 34764: need_cast = (m_form == FORM_FLIGHT); break; - case 40121: need_cast = (m_form == FORM_FLIGHT_EPIC); break; - case 40122: need_cast = (m_form == FORM_FLIGHT_EPIC); break; - // another spells have proper stance data - default: need_cast = !spellInfo->Stances || m_form != 0 && (spellInfo->Stances & (1<<(m_form-1))); break; - } + // note: form passives activated with shapeshift spells be implemented by HandleShapeshiftBoosts instead of spell_learn_spell + // talent dependent passives activated at form apply have proper stance data + bool need_cast = !spellInfo->Stances || m_form != 0 && (spellInfo->Stances & (1<<(m_form-1))); //Check CasterAuraStates return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState))); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index bbed9ef985..f697f618b9 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1936,8 +1936,6 @@ void AuraEffect::HandleShapeshiftBoosts(bool apply) break; case FORM_MOONKIN: spellId = 24905; - // aura from effect trigger spell - spellId2 = 24907; break; case FORM_FLIGHT: spellId = 33948;