Backports from 400 branch.

This commit is contained in:
tomrus88 2010-11-15 18:01:45 +03:00
parent bf774f49ce
commit 76dfdd336f
32 changed files with 223 additions and 210 deletions

View file

@ -482,7 +482,7 @@ Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, holder,
m_areaAuraType = AREA_AURA_RAID;
if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsTotem())
m_modifier.m_auraname = SPELL_AURA_NONE;
// Light's Beacon not applied to caster itself (TODO: more generic check for another simialr spell if any?)
// Light's Beacon not applied to caster itself (TODO: more generic check for another similar spell if any?)
else if (target == caster_ptr && spellproto->Id == 53651)
m_modifier.m_auraname = SPELL_AURA_NONE;
break;
@ -2481,7 +2481,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{
// NOTE: for avoid use additional field damage stored in dummy value (replace unused 100%
if (apply)
m_modifier.m_amount = 0; // use value as damage counter instead redundent 100% percent
m_modifier.m_amount = 0; // use value as damage counter instead redundant 100% percent
else
{
int32 bp0 = m_modifier.m_amount;
@ -2834,7 +2834,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
Unit *target = GetTarget();
SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form);
SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form);
if (!ssEntry)
{
sLog.outError("Unknown shapeshift form %u in spell %u", form, GetId());
@ -6433,7 +6433,7 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
break;
}
//cooldwon aura
//cooldown aura
caster->CastSpell(caster, 63853, true);
break;
}
@ -6521,7 +6521,6 @@ void Aura::PeriodicTick()
else
pdamage = uint32(target->GetMaxHealth()*amount/100);
// SpellDamageBonus for magic spells
if(spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE || spellProto->DmgClass == SPELL_DAMAGE_CLASS_MAGIC)
pdamage = target->SpellDamageBonusTaken(pCaster, spellProto, pdamage, DOT, GetStackAmount());
@ -6693,7 +6692,6 @@ void Aura::PeriodicTick()
if (spell->m_spellInfo->Id == GetId())
spell->cancel();
if(Player *modOwner = pCaster->GetSpellModOwner())
modOwner->ApplySpellMod(GetId(), SPELLMOD_MULTIPLE_VALUE, multiplier);
@ -7951,7 +7949,6 @@ void SpellAuraHolder::_AddSpellAuraHolder()
// Enrage aura state
if(m_spellProto->Dispel == DISPEL_ENRAGE)
m_target->ModifyAuraState(AURA_STATE_ENRAGE, true);
}
}
@ -8107,14 +8104,16 @@ void SpellAuraHolder::CleanupTriggeredSpells()
bool SpellAuraHolder::ModStackAmount(int32 num)
{
uint32 protoStackAmount = m_spellProto->StackAmount;
// Can`t mod
if (!m_spellProto->StackAmount)
if (!protoStackAmount)
return true;
// Modify stack but limit it
int32 stackAmount = m_stackAmount + num;
if (stackAmount > (int32)m_spellProto->StackAmount)
stackAmount = m_spellProto->StackAmount;
if (stackAmount > (int32)protoStackAmount)
stackAmount = protoStackAmount;
else if (stackAmount <=0) // Last aura from stack removed
{
m_stackAmount = 0;