diff options
author | QAston <none@none> | 2010-07-15 23:20:41 +0200 |
---|---|---|
committer | QAston <none@none> | 2010-07-15 23:20:41 +0200 |
commit | 0252202504bfeea0591b8c9ee03527d0495d4afd (patch) | |
tree | d31cd327bd862679975f73f4107d9fc5ae9e2420 | |
parent | d2b4ffbec37499259f1c26cf8e2142b012f9f6bd (diff) |
*Correctly set basepoints of Learn spells - patch by Toni.Shocker.
*Make sure that Spell::m_currentBasePoints are used correctly in any other place of the code.
--HG--
branch : trunk
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellEffects.cpp | 6 | ||||
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Spells/Spell.h | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b491eec7508..9c63c2f73c8 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7845,7 +7845,7 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c Spell *spell = new Spell(this, spellInfo,false); spell->m_CastItem = item; spell->m_cast_count = cast_count; //set count of casts - spell->m_currentBasePoints[0] = learning_spell_id; + spell->m_currentBasePoints[0] = SpellMgr::CalculateSpellEffectBaseAmount(learning_spell_id); spell->prepare(&targets); return; } diff --git a/src/server/game/Spells/Auras/SpellEffects.cpp b/src/server/game/Spells/Auras/SpellEffects.cpp index 88e1ac72928..3a80ce458f8 100644 --- a/src/server/game/Spells/Auras/SpellEffects.cpp +++ b/src/server/game/Spells/Auras/SpellEffects.cpp @@ -521,7 +521,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) damage += pdamage * aura->GetTotalTicks() * pct_dir / 100; uint32 pct_dot = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effect_idx + 2)) / 3; - m_currentBasePoints[1] = pdamage * aura->GetTotalTicks() * pct_dot / 100; + m_currentBasePoints[1] = SpellMgr::CalculateSpellEffectBaseAmount(pdamage * aura->GetTotalTicks() * pct_dot / 100); apply_direct_bonus = false; // Glyph of Conflagrate @@ -2121,7 +2121,7 @@ void Spell::EffectDummy(uint32 i) if (m_targets.HasDst()) targets.setDst(&m_targets.m_dstPos); - spell_id = m_currentBasePoints[0]; + spell_id = CalculateDamage(0, NULL); } // Corpse Explosion else if (m_spellInfo->SpellIconID == 1737) @@ -2173,7 +2173,7 @@ void Spell::EffectDummy(uint32 i) targets.setUnitTarget(unitTarget); Spell* spell = new Spell(m_caster, spellInfo, triggered, m_originalCasterGUID, NULL, true); - if (bp) spell->m_currentBasePoints[0] = bp; + if (bp) spell->m_currentBasePoints[0] = SpellMgr::CalculateSpellEffectBaseAmount(bp); spell->prepare(&targets); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index c371d518a04..5f55b52d85c 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6852,8 +6852,8 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk if (skillId != SKILL_NONE) { // skill bonus provided by casting spell (mostly item spells) - // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) (use m_currentBasePoints, CalculateDamage returns wrong value) - uint32 spellSkillBonus = uint32(m_currentBasePoints[effIndex]); + // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) + uint32 spellSkillBonus = uint32(CalculateDamage(effIndex, NULL)); reqSkillValue = lockInfo->Skill[j]; // castitem check: rogue using skeleton keys. the skill values should not be added in this case. diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 61014343878..d41f4309263 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -462,7 +462,7 @@ class Spell void HandleThreatSpells(uint32 spellId); const SpellEntry * const m_spellInfo; - int32 m_currentBasePoints[3]; // cache SpellEntry::EffectBasePoints and use for set custom base points + int32 m_currentBasePoints[3]; // overrides SpellEntry::EffectBasePoints IMPORTANT: base points != points calculated Item* m_CastItem; uint64 m_castItemGUID; uint8 m_cast_count; |