*Make shattered barrier and prayer of mending work again, Refresh aura when recasted on target with full stackamount.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-04-10 14:35:17 +02:00
parent ef5c511087
commit 9ba44b7eb8
2 changed files with 21 additions and 25 deletions
+14 -13
View File
@@ -1192,22 +1192,23 @@ void Aura::SetStackAmount(uint8 stackAmount)
{ {
Unit *target = GetTarget(); Unit *target = GetTarget();
Unit *caster = GetCaster(); Unit *caster = GetCaster();
if (!target || !caster) if (target && caster)
return;
m_stackAmount = stackAmount;
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{ {
if (AuraEffect * part = GetPartAura(i)) m_stackAmount = stackAmount;
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{ {
int32 amount = m_stackAmount * caster->CalculateSpellDamage(m_spellProto, part->GetEffIndex(), part->GetBasePoints(), target); if (AuraEffect * part = GetPartAura(i))
// Reapply if amount change
if (amount!=part->GetAmount())
{ {
bool Real = bool (part->m_spellmod); int32 amount = m_stackAmount * caster->CalculateSpellDamage(m_spellProto, part->GetEffIndex(), part->GetBasePoints(), target);
// Auras which are applying spellmod should have removed spellmods for real // Reapply if amount change
part->ApplyModifier(false,Real); if (amount!=part->GetAmount())
part->SetAmount(amount); {
part->ApplyModifier(true, Real); bool Real = bool (part->m_spellmod);
// Auras which are applying spellmod should have removed spellmods for real
part->ApplyModifier(false,Real);
part->SetAmount(amount);
part->ApplyModifier(true, Real);
}
} }
} }
} }
+7 -12
View File
@@ -2081,7 +2081,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
if (auraeff->GetAmount()<=0) if (auraeff->GetAmount()<=0)
{ {
uint32 removedAuras = pVictim->m_removedAuras.size(); uint32 removedAuras = pVictim->m_removedAuras.size();
pVictim->RemoveAura(aura); pVictim->RemoveAura(aura, AURA_REMOVE_BY_ENEMY_SPELL);
if (removedAuras+1<pVictim->m_removedAuras.size()) if (removedAuras+1<pVictim->m_removedAuras.size())
i=vSchoolAbsorb.begin(); i=vSchoolAbsorb.begin();
} }
@@ -2118,7 +2118,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
(*i)->SetAmount((*i)->GetAmount()-currentAbsorb); (*i)->SetAmount((*i)->GetAmount()-currentAbsorb);
if((*i)->GetAmount() <= 0) if((*i)->GetAmount() <= 0)
{ {
pVictim->RemoveAurasDueToSpell((*i)->GetId()); pVictim->RemoveAura((*i)->GetParentAura(), AURA_REMOVE_BY_ENEMY_SPELL);
next = vManaShield.begin(); next = vManaShield.begin();
} }
@@ -3756,6 +3756,8 @@ bool Unit::AddAura(Aura *Aur)
{ {
if(foundAura->GetStackAmount() < aurSpellInfo->StackAmount) if(foundAura->GetStackAmount() < aurSpellInfo->StackAmount)
foundAura->SetStackAmount(foundAura->GetStackAmount()+1); foundAura->SetStackAmount(foundAura->GetStackAmount()+1);
else
foundAura->RefreshAura();
delete Aur; delete Aur;
return true; return true;
} }
@@ -12363,8 +12365,6 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( AuraEffect* triggeredByAura )
else else
radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex)); radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex));
//Get max possible jumps for aura to get proper charges amount for target
if(Player* caster = ((Player*)triggeredByAura->GetCaster())) if(Player* caster = ((Player*)triggeredByAura->GetCaster()))
{ {
caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius,NULL); caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius,NULL);
@@ -12372,7 +12372,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( AuraEffect* triggeredByAura )
if (Unit* target= GetNextRandomRaidMemberOrPet(radius)) if (Unit* target= GetNextRandomRaidMemberOrPet(radius))
{ {
CastCustomSpell(target,spellProto->Id,&heal,NULL,NULL,true,NULL,triggeredByAura,caster->GetGUID()); CastCustomSpell(target,spellProto->Id,&heal,NULL,NULL,true,NULL,triggeredByAura,caster->GetGUID());
if (Aura * aur = GetAura(spellProto->Id, caster->GetGUID())) if (Aura * aur = target->GetAura(spellProto->Id, caster->GetGUID()))
aur->SetAuraCharges(jumps); aur->SetAuraCharges(jumps);
//bonus must be applied after aura cast on target //bonus must be applied after aura cast on target
@@ -12426,19 +12426,14 @@ bool Unit::HandleAuraRaidProcFromCharge( AuraEffect* triggeredByAura )
else else
radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex)); radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex));
//Get max possible jumps for aura to get proper charges amount for target
int32 maxJumps = spellProto->procCharges;
if(Player* caster = ((Player*)triggeredByAura->GetCaster())) if(Player* caster = ((Player*)triggeredByAura->GetCaster()))
{ {
caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius,NULL); caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius,NULL);
caster->ApplySpellMod(spellProto->Id, SPELLMOD_CHARGES, maxJumps, NULL);
if (Unit* target= GetNextRandomRaidMemberOrPet(radius)) if (Unit* target= GetNextRandomRaidMemberOrPet(radius))
{ {
CastSpell(this, spellProto, true,NULL,triggeredByAura,caster_guid); CastSpell(target, spellProto, true,NULL,triggeredByAura,caster_guid);
if (Aura * aur = GetAura(spellProto->Id, caster->GetGUID())) if (Aura * aur = target->GetAura(spellProto->Id, caster->GetGUID()))
aur->SetAuraCharges(jumps); aur->SetAuraCharges(jumps);
} }
} }