diff options
author | QAston <none@none> | 2009-06-06 12:53:38 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-06-06 12:53:38 +0200 |
commit | e6941a4f412a442ca97ef1b454837f74077e5f6c (patch) | |
tree | 52b15f1a811f80a885dff7a8021aabf13012b63f | |
parent | 8bc014b42d283376d4bb196543081ce91d9c0242 (diff) |
*Remove Arcane Blast on Arcane Missiles and Arcane Barrage cast
*Spell_affect entry for Fingers of frost - by Larva
*use spellaffect entries in every affect check
*Allow spell_affect table to modify affect data for any spell
--HG--
branch : trunk
-rw-r--r-- | sql/updates/3801_world_spell.sql | 7 | ||||
-rw-r--r-- | sql/world.sql | 23 | ||||
-rw-r--r-- | sql/world_spell_full.sql | 39 | ||||
-rw-r--r-- | src/game/Player.cpp | 30 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 36 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 1 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 35 | ||||
-rw-r--r-- | src/game/Unit.cpp | 5 |
8 files changed, 71 insertions, 105 deletions
diff --git a/sql/updates/3801_world_spell.sql b/sql/updates/3801_world_spell.sql new file mode 100644 index 00000000000..8fabcad1c58 --- /dev/null +++ b/sql/updates/3801_world_spell.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (44544, 60503, 36032); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(36032, 0x00, 3, 0x00000800, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0); -- Arcane Blast + +DELETE FROM `spell_affect` WHERE `entry` IN (44544); +INSERT INTO `spell_affect` (`entry`, `effectId`, `SpellClassMask0`, `SpellClassMask1`, `SpellClassMask2`) VALUES +(44544,0,685904631,1151048,0); -- Fingers of frost diff --git a/sql/world.sql b/sql/world.sql index 9813baf6ab4..a65d7d7fc53 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -13167,29 +13167,6 @@ LOCK TABLES `skinning_loot_template` WRITE; UNLOCK TABLES; -- --- Table structure for table `spell_affect` --- - -DROP TABLE IF EXISTS `spell_affect`; -CREATE TABLE `spell_affect` ( - `entry` smallint(5) unsigned NOT NULL default '0', - `effectId` tinyint(3) unsigned NOT NULL default '0', - `SpellClassMask0` int(5) unsigned NOT NULL default '0', - `SpellClassMask1` int(5) unsigned NOT NULL default '0', - `SpellClassMask2` int(5) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`effectId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `spell_affect` --- - -LOCK TABLES `spell_affect` WRITE; -/*!40000 ALTER TABLE `spell_affect` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_affect` ENABLE KEYS */; -UNLOCK TABLES; - --- -- Table structure for table `spell_required` -- diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql index a9fecbb4e07..503b5f0bc2e 100644 --- a/sql/world_spell_full.sql +++ b/sql/world_spell_full.sql @@ -1057,6 +1057,7 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell (35102, 0x00, 9, 0x00003001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Concussive Barrage (Rank 2) (35103, 0x00, 9, 0x00003001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Concussive Barrage (Rank 3) (35121, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Nether Power +(36032, 0x00, 3, 0x00000800, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Arcane Blast (36096, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Spell Reflection (36111, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- World Breaker (36541, 0x04, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Curse of Burning Shadows @@ -1163,7 +1164,6 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell (44471, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Burnout (Rank 4) (44472, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Burnout (Rank 5) (44543, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00010000, 0x00000000, 0, 7, 0), -- Fingers of Frost (Rank 1) -(44544, 0x00, 3, 0x00000000, 0x00100000, 0x00000000, 0x00010000, 0x00000000, 0, 0, 0), -- Fingers of Frost (44545, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00010000, 0x00000000, 0, 15, 0), -- Fingers of Frost (Rank 2) (44546, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 1) (44548, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 2) @@ -1492,7 +1492,6 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell (60176, 0x00, 4, 0x00000020, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Bleed Cost Reduction (60442, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Bandit's Insignia (60493, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Dying Curse -(60503, 0x00, 4, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Taste for Blood (60529, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Forethought Talisman (60537, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Soul of the Dead (60564, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Savage Gladiator's Totem of Survival @@ -1535,17 +1534,33 @@ CREATE TABLE `spell_enchant_proc_data` ( `procEx` FLOAT UNSIGNED NOT NULL DEFAULT '0' ) ENGINE=MYISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Spell enchant proc data'; --- Frostbrand Weapon -INSERT INTO spell_enchant_proc_data (`entry`, `customChance`, `PPMChance`,`procEx`) VALUES (2, 0, 8.8,0); -INSERT INTO spell_enchant_proc_data (`entry`, `customChance`, `PPMChance`,`procEx`) VALUES (12, 0, 8.8,0); -INSERT INTO spell_enchant_proc_data (`entry`, `customChance`, `PPMChance`,`procEx`) VALUES (524, 0, 8.8,0); -INSERT INTO spell_enchant_proc_data (`entry`, `customChance`, `PPMChance`,`procEx`) VALUES (1667, 0, 8.8,0); -INSERT INTO spell_enchant_proc_data (`entry`, `customChance`, `PPMChance`,`procEx`) VALUES (1668, 0, 8.8,0); -INSERT INTO spell_enchant_proc_data (`entry`, `customChance`, `PPMChance`,`procEx`) VALUES (2635, 0, 8.8,0); -INSERT INTO spell_enchant_proc_data (`entry`, `customChance`, `PPMChance`,`procEx`) VALUES (3782, 0, 8.8,0); -INSERT INTO spell_enchant_proc_data (`entry`, `customChance`, `PPMChance`,`procEx`) VALUES (3783, 0, 8.8,0); -INSERT INTO spell_enchant_proc_data (`entry`, `customChance`, `PPMChance`,`procEx`) VALUES (3784, 0, 8.8,0); +INSERT INTO spell_enchant_proc_data (`entry`, `customChance`, `PPMChance`,`procEx`) VALUES +(2, 0, 8.8,0), -- Frostbrand Weapon +(12, 0, 8.8,0), -- Frostbrand Weapon +(524, 0, 8.8,0), -- Frostbrand Weapon +(1667, 0, 8.8,0), -- Frostbrand Weapon +(1668, 0, 8.8,0), -- Frostbrand Weapon +(2635, 0, 8.8,0), -- Frostbrand Weapon +(3782, 0, 8.8,0), -- Frostbrand Weapon +(3783, 0, 8.8,0), -- Frostbrand Weapon +(3784, 0, 8.8,0); -- Frostbrand Weapon +-- -------- +-- SPELL AFFECT +-- -------- + +DROP TABLE IF EXISTS `spell_affect`; +CREATE TABLE `spell_affect` ( + `entry` smallint(5) unsigned NOT NULL default '0', + `effectId` tinyint(3) unsigned NOT NULL default '0', + `SpellClassMask0` int(5) unsigned NOT NULL default '0', + `SpellClassMask1` int(5) unsigned NOT NULL default '0', + `SpellClassMask2` int(5) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`effectId`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +INSERT INTO `spell_affect` (`entry`, `effectId`, `SpellClassMask0`, `SpellClassMask1`, `SpellClassMask2`) VALUES +(44544,0,685904631,1151048,0); -- Fingers of frost -- -------- -- PET diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 27b6ea337df..65cc7b3bd31 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -17073,10 +17073,36 @@ void Player::RestoreSpellMods(Spell * spell) void Player::RemoveSpellMods(Spell * spell) { - if (!spell || spell->m_appliedMods.empty()) + if (!spell) + return; + std::set <Aura *> checkedSpells; + + AuraEffectList const & auraList = GetAurasByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE); + for(AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr) + { + if (!(*itr)->GetParentAura()->GetAuraCharges()) + continue; + SpellEntry const * spellInfo = (*itr)->GetSpellProto(); + + if (spellInfo->SpellFamilyName != spell->m_spellInfo->SpellFamilyName || + checkedSpells.find((*itr)->GetParentAura()) != checkedSpells.end()) + continue; + flag96 const * mask = spellmgr.GetSpellAffect((*itr)->GetId(), (*itr)->GetEffIndex()); + if (!mask) + mask = &spellInfo->EffectSpellClassMask[(*itr)->GetEffIndex()]; + + if (spell->m_spellInfo->SpellFamilyFlags & *mask) + { + checkedSpells.insert((*itr)->GetParentAura()); + spell->m_appliedMods.erase((*itr)->GetParentAura()); + if ((*itr)->GetParentAura()->DropAuraCharge()) + itr = auraList.begin(); + } + } + + if (spell->m_appliedMods.empty()) return; - std::set <uint32> checkedSpells; for(int i=0;i<MAX_SPELLMOD;++i) { for (SpellModList::iterator itr = m_spellMods[i].begin(); itr != m_spellMods[i].end();) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 8e1ab386ae2..7c3fc42f32a 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -161,7 +161,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &AuraEffect::HandleAuraHover, //106 SPELL_AURA_HOVER &AuraEffect::HandleAddModifier, //107 SPELL_AURA_ADD_FLAT_MODIFIER &AuraEffect::HandleAddModifier, //108 SPELL_AURA_ADD_PCT_MODIFIER - &AuraEffect::HandleAddTargetTrigger, //109 SPELL_AURA_ADD_TARGET_TRIGGER + &AuraEffect::HandleNoImmediateEffect, //109 SPELL_AURA_ADD_TARGET_TRIGGER &AuraEffect::HandleModPowerRegenPCT, //110 SPELL_AURA_MOD_POWER_REGEN_PERCENT &AuraEffect::HandleNoImmediateEffect, //111 SPELL_AURA_ADD_CASTER_HIT_TRIGGER implemented in Unit::SelectMagnetTarget &AuraEffect::HandleNoImmediateEffect, //112 SPELL_AURA_OVERRIDE_CLASS_SCRIPTS @@ -1513,8 +1513,13 @@ bool AuraEffect::isAffectedOnSpell(SpellEntry const *spell) const // Check family name if (spell->SpellFamilyName != m_spellProto->SpellFamilyName) return false; - // Check EffectClassMask - if (m_spellProto->EffectSpellClassMask[m_effIndex] & spell->SpellFamilyFlags) + + // Check EffectClassMask and Spell_Affect table + flag96 const *spellAffect = spellmgr.GetSpellAffect(GetId(), m_effIndex); + if (!spellAffect) + spellAffect = &m_spellProto->EffectSpellClassMask[m_effIndex]; + + if (*spellAffect & spell->SpellFamilyFlags) return true; return false; } @@ -1589,7 +1594,7 @@ void AuraEffect::HandleAddModifier(bool apply, bool Real, bool changeAmount) Aura * aur = iter->second; // only passive auras-active auras should have amount set on spellcast and not be affected // if aura is casted by others, it will not be affected - if (aur->IsPassive() && aur->GetCasterGUID() == guid && isAffectedOnSpell(aur->GetSpellProto())) + if (aur->IsPassive() && aur->GetCasterGUID() == guid && spellmgr.IsAffectedByMod(aur->GetSpellProto(), m_spellmod)) { if (modOp == SPELLMOD_ALL_EFFECTS) { @@ -1621,29 +1626,6 @@ void AuraEffect::HandleAddModifier(bool apply, bool Real, bool changeAmount) break; } } -void AuraEffect::HandleAddTargetTrigger(bool apply, bool Real, bool /*changeAmount*/) -{ - // Use SpellModifier structure for check - // used only fields: - // spellId, mask, mask2 - if (apply) - { - SpellModifier *mod = new SpellModifier; - mod->spellId = GetId(); - - flag96 const *spellAffect = spellmgr.GetSpellAffect(GetId(), m_effIndex); - if (!spellAffect) - spellAffect = &m_spellProto->EffectSpellClassMask[m_effIndex]; - - mod->mask = *spellAffect; - m_spellmod = mod; - } - else - { - delete m_spellmod; - m_spellmod = NULL; - } -} void AuraEffect::TriggerSpell() { diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index ed6bb37fe2a..9deb25772d4 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -209,7 +209,6 @@ class TRINITY_DLL_SPEC AuraEffect void HandleAuraFeatherFall(bool Apply, bool Real, bool changeAmount); void HandleAuraHover(bool Apply, bool Real, bool changeAmount); void HandleAddModifier(bool Apply, bool Real, bool changeAmount); - void HandleAddTargetTrigger(bool Apply, bool Real, bool changeAmount); void HandleAuraModStun(bool Apply, bool Real, bool changeAmount); void HandleModDamageDone(bool Apply, bool Real, bool changeAmount); void HandleAuraUntrackable(bool Apply, bool Real, bool changeAmount); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index f356a2ea1a5..ae3f72cdcad 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1078,15 +1078,6 @@ void SpellMgr::LoadSpellAffects() continue; } - if( spellInfo->Effect[effectId] != SPELL_EFFECT_APPLY_AURA || - spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_FLAT_MODIFIER && - spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_PCT_MODIFIER && - spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_TARGET_TRIGGER ) - { - sLog.outErrorDb("Spell %u listed in `spell_affect` have not SPELL_AURA_ADD_FLAT_MODIFIER (%u) or SPELL_AURA_ADD_PCT_MODIFIER (%u) or SPELL_AURA_ADD_TARGET_TRIGGER (%u) for effect index (%u)", entry,SPELL_AURA_ADD_FLAT_MODIFIER,SPELL_AURA_ADD_PCT_MODIFIER,SPELL_AURA_ADD_TARGET_TRIGGER,effectId); - continue; - } - flag96 affect(fields[2].GetUInt32(), fields[3].GetUInt32(), fields[4].GetUInt32()); // Spell.dbc have own data @@ -1111,32 +1102,6 @@ void SpellMgr::LoadSpellAffects() sLog.outString(); sLog.outString( ">> Loaded %u custom spell affect definitions", count ); - - for (uint32 id = 0; id < sSpellStore.GetNumRows(); ++id) - { - SpellEntry const* spellInfo = sSpellStore.LookupEntry(id); - if (!spellInfo) - continue; - - for (int effectId = 0; effectId < 3; ++effectId) - { - if( spellInfo->Effect[effectId] != SPELL_EFFECT_APPLY_AURA || - (spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_FLAT_MODIFIER && - spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_PCT_MODIFIER && - spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_TARGET_TRIGGER) ) - continue; - - flag96 dbc_affect; - dbc_affect = spellInfo->EffectSpellClassMask[effectId]; - if(dbc_affect) - continue; - - if(mSpellAffectMap.find((id<<8) + effectId) != mSpellAffectMap.end()) - continue; - - sLog.outErrorDb("Spell %u (%s) misses spell_affect for effect %u",id,spellInfo->SpellName[sWorld.GetDefaultDbcLocale()], effectId); - } - } } bool SpellMgr::IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod) const diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b838ec90e44..aca3ea92ce5 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9168,10 +9168,6 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM if (!pVictim->HasAuraState(AURA_STATE_FROZEN, spellProto, this)) break; crit_chance+=modChance; - // Fingers of Frost - // TODO: Change this code to less hacky - if (Aura * aur = GetAura(44544)) - aur->DropAuraCharge(); break; case 7917: // Glyph of Shadowburn if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) @@ -12035,7 +12031,6 @@ bool InitTriggerAuraData() isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE] = true; isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE] = true; isTriggerAura[SPELL_AURA_MOD_DAMAGE_FROM_CASTER] = true; - isTriggerAura[SPELL_AURA_ABILITY_IGNORE_AURASTATE] = true; isTriggerAura[SPELL_AURA_MOD_SPELL_CRIT_CHANCE] = true; isNonTriggerAura[SPELL_AURA_MOD_POWER_REGEN]=true; |