*Rewrite 8b3ffb1dd504 with info from QAston

--HG--
branch : trunk
This commit is contained in:
maximius
2009-11-19 01:49:03 -08:00
parent 13d954cc88
commit 9953ff49b8
+13 -18
View File
@@ -10056,8 +10056,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[0] & 0x40)
{
// Search for Healing Way on Victim
AuraEffect const* HealingWay = pVictim->GetAuraEffect(29203, 0);
if (HealingWay)
if (AuraEffect const* HealingWay = pVictim->GetAuraEffect(29203, 0))
TakenTotalMod *= (HealingWay->GetAmount() + 100.0f) / 100.0f;
}
@@ -13614,7 +13613,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co
}
}
// Get chance from spell
float chance = (float)spellProto->procChance;
float chance = float(spellProto->procChance);
// If in spellProcEvent exist custom chance, chance = spellProcEvent->customChance;
if (spellProcEvent && spellProcEvent->customChance)
chance = spellProcEvent->customChance;
@@ -13663,26 +13662,15 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( AuraEffect* triggeredByAura )
else
radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster(), sSpellRangeStore.LookupEntry(spellProto->rangeIndex));
if(Player* caster = ((Player*)triggeredByAura->GetCaster()))
if(Player *caster = (Player*)triggeredByAura->GetCaster())
{
caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius, NULL);
heal = caster->SpellHealingBonus(this, spellProto, heal, HEAL);
if(Player *target = ((Player*)this)->GetNextRandomRaidMember(radius))
if (Unit *target = GetNextRandomRaidMemberOrPet(radius))
{
// aura will applied from caster, but spell casted from current aura holder
SpellModifier *mod = new SpellModifier;
mod->op = SPELLMOD_CHARGES;
mod->value = jumps-5; // negative
mod->type = SPELLMOD_FLAT;
mod->spellId = spellProto->Id;
mod->mask = spellProto->SpellFamilyFlags;
mod->charges = 0;
caster->AddSpellMod(mod, true);
CastCustomSpell(target, spellProto->Id, &heal, NULL, NULL, true, NULL, triggeredByAura, caster->GetGUID());
caster->AddSpellMod(mod, false);
if (Aura *aur = target->GetAura(spellProto->Id, caster->GetGUID()))
aur->SetAuraCharges(jumps);
heal = caster->SpellHealingBonus(this, spellProto, heal, HEAL);
}
}
@@ -13716,6 +13704,13 @@ bool Unit::HandleAuraRaidProcFromCharge( AuraEffect* triggeredByAura )
return false;
}
//Currently only Prayer of Mending
if (!(spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && spellProto->SpellFamilyFlags[1] & 0x20))
{
sLog.outDebug("Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id);
return false;
}
uint64 caster_guid = triggeredByAura->GetCasterGUID();
uint32 effIdx = triggeredByAura->GetEffIndex();