Core/Spells: convert some spell effects to SpellScripts

This commit is contained in:
joschiwald committed 2012-05-28 04:07:51 +02:00
1 parent 58f63509cd
commit ca07f30d03
26 files changed
+1099 -455

No files matched your search

-81
View File
@@ -3629,87 +3629,6 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId
// Call AfterDispel hook on AuraScript
aura->CallScriptAfterDispel(&dispelInfo);
switch (aura->GetSpellInfo()->SpellFamilyName)
{
case SPELLFAMILY_WARLOCK:
{
// Unstable Affliction (crash if before removeaura?)
if (aura->GetSpellInfo()->SpellFamilyFlags[1] & 0x0100)
{
Unit* caster = aura->GetCaster();
if (!caster)
break;
if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_0))
{
int32 damage = aurEff->GetAmount() * 9;
// backfire damage and silence
caster->CastCustomSpell(dispeller, 31117, &damage, NULL, NULL, true, NULL, aurEff);
}
}
break;
}
case SPELLFAMILY_DRUID:
{
// Lifebloom
if (aura->GetSpellInfo()->SpellFamilyFlags[1] & 0x10)
{
if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_1))
{
// final heal
int32 healAmount = aurEff->GetAmount();
if (Unit* caster = aura->GetCaster())
{
healAmount = caster->SpellHealingBonusDone(this, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges());
healAmount = this->SpellHealingBonusTaken(aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges());
}
CastCustomSpell(this, 33778, &healAmount, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID());
// mana
if (Unit* caster = aura->GetCaster())
{
int32 mana = CalculatePctU(caster->GetCreateMana(), aura->GetSpellInfo()->ManaCostPercentage) * chargesRemoved / 2;
caster->CastCustomSpell(caster, 64372, &mana, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID());
}
}
}
break;
}
case SPELLFAMILY_SHAMAN:
{
// Flame Shock
if (aura->GetSpellInfo()->SpellFamilyFlags[0] & 0x10000000)
{
if (Unit* caster = aura->GetCaster())
{
uint32 triggeredSpellId = 0;
// Lava Flows
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 3087, 0))
{
switch (aurEff->GetId())
{
case 51482: // Rank 3
triggeredSpellId = 65264;
break;
case 51481: // Rank 2
triggeredSpellId = 65263;
break;
case 51480: // Rank 1
triggeredSpellId = 64694;
break;
default:
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