*Fix healing amount for Haunt

--HG--
branch : trunk
This commit is contained in:
QAston
2009-04-13 19:51:37 +02:00
parent 52571d6d48
commit b972327979
6 changed files with 16 additions and 9 deletions
-1
View File
@@ -571,7 +571,6 @@ void Pet::Update(uint32 diff)
default: default:
break; break;
} }
uint32 guidlow = GetGUIDLow();
Creature::Update(diff); Creature::Update(diff);
} }
+11 -1
View File
@@ -380,6 +380,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
m_glyphIndex = 0; m_glyphIndex = 0;
m_preCastSpell = 0; m_preCastSpell = 0;
m_triggeredByAuraSpell = NULL; m_triggeredByAuraSpell = NULL;
m_spellAura = NULL;
//Auto Shot & Shoot (wand) //Auto Shot & Shoot (wand)
m_autoRepeat = IsAutoRepeatRangedSpell(m_spellInfo); m_autoRepeat = IsAutoRepeatRangedSpell(m_spellInfo);
@@ -938,6 +939,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
uint32 procAttacker = m_procAttacker; uint32 procAttacker = m_procAttacker;
uint32 procVictim = m_procVictim; uint32 procVictim = m_procVictim;
uint32 procEx = PROC_EX_NONE; uint32 procEx = PROC_EX_NONE;
m_spellAura = NULL; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied
if (missInfo==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target if (missInfo==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
DoSpellHitOnUnit(unit, mask); DoSpellHitOnUnit(unit, mask);
@@ -981,6 +983,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT) if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo); caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo);
if (m_spellAura)
m_spellAura->SetProcDamage(addhealth);
int32 gain = unitTarget->ModifyHealth( int32(addhealth) ); int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
unitTarget->getHostilRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo); unitTarget->getHostilRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo);
@@ -1007,6 +1012,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT) if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo); caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo);
if (m_spellAura)
m_spellAura->SetProcDamage(damageInfo.damage);
caster->DealSpellDamage(&damageInfo, true); caster->DealSpellDamage(&damageInfo, true);
// Judgement of Blood // Judgement of Blood
@@ -1186,7 +1194,9 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags[1] & 0x000020)) if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags[1] & 0x000020))
m_caster->CastSpell(unit, 41637, true, NULL, NULL, m_originalCasterGUID); m_caster->CastSpell(unit, 41637, true, NULL, NULL, m_originalCasterGUID);
} }
unit->AddAura(Aur); // Set aura only when successfully applied
if (unit->AddAura(Aur))
m_spellAura = Aur;
} }
t_effmask = effectMask& ~t_effmask; t_effmask = effectMask& ~t_effmask;
for(uint32 effectNumber=0;effectNumber<3;effectNumber++) for(uint32 effectNumber=0;effectNumber<3;effectNumber++)
+1
View File
@@ -517,6 +517,7 @@ class Spell
Item* itemTarget; Item* itemTarget;
GameObject* gameObjTarget; GameObject* gameObjTarget;
int32 damage; int32 damage;
Aura * m_spellAura; // only used in DoAllEffectOnTarget
// this is set in Spell Hit, but used in Apply Aura handler // this is set in Spell Hit, but used in Apply Aura handler
DiminishingLevels m_diminishLevel; DiminishingLevels m_diminishLevel;
+2 -1
View File
@@ -2434,8 +2434,9 @@ void AuraEffect::HandleAuraDummy(bool apply, bool Real)
// Haunt // Haunt
if(m_spellProto->SpellFamilyFlags[1] & 0x40000) if(m_spellProto->SpellFamilyFlags[1] & 0x40000)
{ {
int32 bp0 = GetParentAura()->GetProcDamage() * m_amount / 100;
if(caster) if(caster)
caster->CastCustomSpell(caster, 48210, &m_currentBasePoints, 0, 0, true); caster->CastCustomSpell(caster, 48210, &bp0, 0, 0, true, NULL, this);
return; return;
} }
break; break;
+2
View File
@@ -74,6 +74,8 @@ class TRINITY_DLL_SPEC Aura
uint8 GetAuraCharges() const { return m_procCharges; } uint8 GetAuraCharges() const { return m_procCharges; }
void SetAuraCharges(uint8 charges); void SetAuraCharges(uint8 charges);
bool DropAuraCharge(); bool DropAuraCharge();
void SetProcDamage(uint32 val) { m_procDamage = val; }
uint32 GetProcDamage() const { return m_procDamage; }
int8 GetStackAmount() const {return m_stackAmount;} int8 GetStackAmount() const {return m_stackAmount;}
void SetStackAmount(uint8 num); void SetStackAmount(uint8 num);
-6
View File
@@ -448,12 +448,6 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE, m_spellInfo, m_caster)) if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE, m_spellInfo, m_caster))
damage += int32(damage*0.25f); damage += int32(damage*0.25f);
} }
// Haunt
else if (m_spellInfo->SpellFamilyFlags[1] & 0x40000)
{
m_currentBasePoints[1] = int32(damage * m_currentBasePoints[1] / 100);
}
// Conflagrate - consumes immolate // Conflagrate - consumes immolate
if (m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE) if (m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE)
{ {