*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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user