Core/Spells: Fixed Lifebloom final heal when caster goes offline

This commit is contained in:
Shauren
2011-05-07 10:51:23 +02:00
parent 64c8fb2b42
commit b087741959
+33 -16
View File
@@ -3637,10 +3637,26 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit
else
RemoveAuraFromStack(iter, AURA_REMOVE_BY_ENEMY_SPELL, chargesRemoved);
//Lifebloom
if (aura->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID && (aura->GetSpellProto()->SpellFamilyFlags[1] & 0x10))
switch (aura->GetSpellProto()->SpellFamilyName)
{
if (Unit * caster = aura->GetCaster())
case SPELLFAMILY_WARLOCK:
{
// Unstable Affliction (crash if before removeaura?)
if (aura->GetSpellProto()->SpellFamilyFlags[1] & 0x0100)
{
if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_0))
{
int32 damage = aurEff->GetAmount() * 9;
// backfire damage and silence
dispeller->CastCustomSpell(dispeller, 31117, &damage, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID());
}
}
break;
}
case SPELLFAMILY_DRUID:
{
//Lifebloom
if (aura->GetSpellProto()->SpellFamilyFlags[1] & 0x10)
{
if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_1))
{
@@ -3650,26 +3666,21 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit
CastCustomSpell(this, 33778, &healAmount, &stack, NULL, true, NULL, NULL, aura->GetCasterGUID());
// mana
if (Unit* caster = aura->GetCaster())
{
int32 mana = CalculatePctU(caster->GetCreateMana(), aura->GetSpellProto()->ManaCostPercentage) * chargesRemoved / 2;
caster->CastCustomSpell(caster, 64372, &mana, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID());
}
}
}
// Unstable Affliction (crash if before removeaura?)
if (aura->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (aura->GetSpellProto()->SpellFamilyFlags[1] & 0x0100))
{
if (AuraEffect const * aurEff = aura->GetEffect(EFFECT_0))
{
int32 damage = aurEff->GetAmount()*9;
// backfire damage and silence
dispeller->CastCustomSpell(dispeller, 31117, &damage, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID());
}
break;
}
case SPELLFAMILY_SHAMAN:
{
// Flame Shock
if (aura->GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && (aura->GetSpellProto()->SpellFamilyFlags[0] & 0x10000000))
if (aura->GetSpellProto()->SpellFamilyFlags[0] & 0x10000000)
{
Unit * caster = aura->GetCaster();
if (caster)
if (Unit* caster = aura->GetCaster())
{
uint32 triggeredSpellId = 0;
// Lava Flows
@@ -3687,13 +3698,19 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit
triggeredSpellId = 64694;
break;
default:
sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Lava Flows (%d) found", aurEff->GetId());
sLog->outError("Unit::RemoveAurasDueToSpellByDispel: Unknown rank of Lava Flows (%d) found", aurEff->GetId());
}
}
if (triggeredSpellId)
caster->CastSpell(caster, triggeredSpellId, true);
}
}
break;
}
default:
break;
}
return;
}
else