aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2010-08-27 06:40:23 +0200
committerQAston <none@none>2010-08-27 06:40:23 +0200
commitc1ac063ba129302fe0ef6ab43092304fc29bbd5a (patch)
tree31f08c6f645edd214cbd99e4c28164dc815b5c9b /src
parentbed85f565b853b13576258adcd585c9753e3e10f (diff)
*Remove m_currentBasePoints from spell class, use m_spellValue instead.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
-rw-r--r--src/server/game/Spells/Spell.cpp11
-rw-r--r--src/server/game/Spells/Spell.h5
-rw-r--r--src/server/game/Spells/SpellEffects.cpp6
4 files changed, 7 insertions, 17 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 6afebfe2260..ef851fe2523 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -7947,7 +7947,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] = SpellMgr::CalculateSpellEffectBaseAmount(learning_spell_id, spellInfo, 0);
+ spell->SetSpellValue(SPELLVALUE_BASE_POINT0, learning_spell_id);
spell->prepare(&targets);
return;
}
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 3a467069592..f9a39618207 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -435,7 +435,6 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
m_delayStart = 0;
m_delayAtDamageCount = 0;
- m_applyMultiplierMask = 0;
m_effectMask = 0;
m_auraScaleMask = 0;
@@ -485,9 +484,6 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
if (m_originalCaster && !m_originalCaster->IsInWorld()) m_originalCaster = NULL;
}
- for (int i=0; i <3; ++i)
- m_currentBasePoints[i] = m_spellInfo->EffectBasePoints[i];
-
m_spellState = SPELL_STATE_NULL;
m_IsTriggeredSpell = triggered;
@@ -1514,7 +1510,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
if (m_originalCaster)
{
m_spellAura = Aura::TryCreate(aurSpellInfo, effectMask, unit,
- m_originalCaster,(aurSpellInfo == m_spellInfo)? &m_currentBasePoints[0] : &basePoints[0], m_CastItem);
+ m_originalCaster,(aurSpellInfo == m_spellInfo)? &m_spellValue->EffectBasePoints[0] : &basePoints[0], m_CastItem);
if (m_spellAura)
{
// Now Reduce spell duration using data received at spell hit
@@ -2937,7 +2933,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere
if (IsPositiveEffect(m_spellInfo->Id, i))
{
m_auraScaleMask |= (1<<i);
- if (m_currentBasePoints[i] != m_spellInfo->EffectBasePoints[i])
+ if (m_spellValue->EffectBasePoints[i] != m_spellInfo->EffectBasePoints[i])
{
m_auraScaleMask = 0;
break;
@@ -7113,15 +7109,12 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value)
{
case SPELLVALUE_BASE_POINT0:
m_spellValue->EffectBasePoints[0] = SpellMgr::CalculateSpellEffectBaseAmount(value, m_spellInfo, 0);
- m_currentBasePoints[0] = m_spellValue->EffectBasePoints[0]; //this should be removed in the future
break;
case SPELLVALUE_BASE_POINT1:
m_spellValue->EffectBasePoints[1] = SpellMgr::CalculateSpellEffectBaseAmount(value, m_spellInfo, 1);
- m_currentBasePoints[1] = m_spellValue->EffectBasePoints[1];
break;
case SPELLVALUE_BASE_POINT2:
m_spellValue->EffectBasePoints[2] = SpellMgr::CalculateSpellEffectBaseAmount(value, m_spellInfo, 2);
- m_currentBasePoints[2] = m_spellValue->EffectBasePoints[2];
break;
case SPELLVALUE_RADIUS_MOD:
m_spellValue->RadiusMod = (float)value / 10000;
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 23c2c62148d..f6e037a7de8 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -446,7 +446,7 @@ class Spell
SpellCastResult CheckRuneCost(uint32 runeCostID);
SpellCastResult CheckCasterAuras() const;
- int32 CalculateDamage(uint8 i, Unit* target) { return m_caster->CalculateSpellDamage(target, m_spellInfo, i, &m_currentBasePoints[i]); }
+ int32 CalculateDamage(uint8 i, Unit* target) { return m_caster->CalculateSpellDamage(target, m_spellInfo, i, &m_spellValue->EffectBasePoints[i]); }
bool HaveTargetsForEffect(uint8 effect) const;
void Delayed();
@@ -485,7 +485,6 @@ class Spell
void HandleThreatSpells(uint32 spellId);
const SpellEntry * const m_spellInfo;
- int32 m_currentBasePoints[3]; // overrides SpellEntry::EffectBasePoints IMPORTANT: base points != points calculated
Item* m_CastItem;
uint64 m_castItemGUID;
uint8 m_cast_count;
@@ -576,8 +575,6 @@ class Spell
bool m_executedCurrently; // mark as executed to prevent deleted and access by dead pointers
bool m_needSpellLog; // need to send spell log?
bool m_needComboPoints;
- uint8 m_applyMultiplierMask; // by effect: damage multiplier needed?
- float m_damageMultipliers[3]; // by effect: damage multiplier
// Current targets, to be used in SpellEffects (MUST BE USED ONLY IN SPELL EFFECTS)
Unit* unitTarget;
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 31e01641553..dbabd957c1c 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/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] = SpellMgr::CalculateSpellEffectBaseAmount(pdamage * aura->GetTotalTicks() * pct_dot / 100, m_spellInfo, 1);
+ m_spellValue->EffectBasePoints[1] = SpellMgr::CalculateSpellEffectBaseAmount(pdamage * aura->GetTotalTicks() * pct_dot / 100, m_spellInfo, 1);
apply_direct_bonus = false;
// Glyph of Conflagrate
@@ -1759,7 +1759,7 @@ void Spell::EffectDummy(uint32 i)
targets.setUnitTarget(unitTarget);
Spell* spell = new Spell(m_caster, spellInfo, triggered, m_originalCasterGUID, true);
- if (bp) spell->m_currentBasePoints[0] = SpellMgr::CalculateSpellEffectBaseAmount(bp, spellInfo, 0);
+ if (bp) spell->SetSpellValue(SPELLVALUE_BASE_POINT0, bp);
spell->prepare(&targets);
}
@@ -2778,7 +2778,7 @@ void Spell::EffectPersistentAA(uint32 i)
caster->AddDynObject(dynObj);
dynObj->GetMap()->Add(dynObj);
- if (Aura * aura = Aura::TryCreate(m_spellInfo, dynObj, caster, &m_currentBasePoints[0]))
+ if (Aura * aura = Aura::TryCreate(m_spellInfo, dynObj, caster, &m_spellValue->EffectBasePoints[0]))
m_spellAura = aura;
else
{