Merge commit 'origin/master' into 320

This commit is contained in:
tomrus88 2009-08-28 17:26:09 +04:00
commit 2d65ce8b87
30 changed files with 1149 additions and 355 deletions

View file

@ -1317,13 +1317,18 @@ void Aura::HandleAddModifier(bool apply, bool Real)
((Player*)m_target)->AddSpellMod(m_spellmod, apply);
// reapply some passive spells after add/remove related spellmods
if(m_spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && (spellFamilyMask & UI64LIT(0x0000100000000000)))
{
m_target->RemoveAurasDueToSpell(45471);
// reaplly talents to own passive persistent auras
std::set<uint32> affectedPassives;
if(apply)
m_target->CastSpell(m_target, 45471, true);
for(Unit::AuraMap::const_iterator itr = m_target->GetAuras().begin(); itr != m_target->GetAuras().end(); ++itr)
if (itr->second->IsPassive() && itr->second->IsPermanent() &&
itr->second->GetCasterGUID() == m_target->GetGUID() && isAffectedOnSpell(itr->second->GetSpellProto()))
affectedPassives.insert(itr->second->GetId());
for(std::set<uint32>::const_iterator set_itr = affectedPassives.begin(); set_itr != affectedPassives.end(); ++set_itr)
{
m_target->RemoveAurasDueToSpell(*set_itr);
m_target->CastSpell(m_target, *set_itr, true);
}
}
void Aura::HandleAddTargetTrigger(bool apply, bool /*Real*/)
@ -5993,93 +5998,102 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
if(!caster)
return;
// prevent double apply bonuses
if(apply && (m_target->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading()))
if (apply)
{
float DoneActualBenefit = 0.0f;
switch(m_spellProto->SpellFamilyName)
// prevent double apply bonuses
if (m_target->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())
{
case SPELLFAMILY_PRIEST:
// Power Word: Shield
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001))
//+80.68% from +spell bonus
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.8068f;
break;
case SPELLFAMILY_MAGE:
// Frost Ward, Fire Ward
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000108))
//+10% from +spell bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f;
// Ice Barrier
else if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000100000000))
//+80.67% from +spell bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.8067f;
break;
case SPELLFAMILY_WARLOCK:
// Shadow Ward
if (m_spellProto->SpellFamilyFlags2 & 0x00000040)
//+30% from +spell bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.30f;
break;
default:
break;
}
DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto());
m_modifier.m_amount += (int32)DoneActualBenefit;
}
// Ice Barrier (remove effect from Shattered Barrier)
if(!apply && m_spellProto->SpellIconID == 32 && m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE)
{
if (!((m_removeMode == AURA_REMOVE_BY_DEFAULT && !m_modifier.m_amount) || m_removeMode == AURA_REMOVE_BY_DISPEL))
return;
if (m_target->HasAura(44745,0)) // Shattered Barrier, rank 1
{
if(roll_chance_i(50))
m_target->CastSpell(m_target, 55080, true, NULL, this);
}
else if (m_target->HasAura(54787,0)) // Shattered Barrier, rank 2
{
m_target->CastSpell(m_target, 55080, true, NULL, this);
}
}
if (!apply && caster &&
// Power Word: Shield
m_spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellProto->Mechanic == MECHANIC_SHIELD &&
(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001)) &&
// completely absorbed or dispelled
((m_removeMode == AURA_REMOVE_BY_DEFAULT && !m_modifier.m_amount) || m_removeMode == AURA_REMOVE_BY_DISPEL))
{
Unit::AuraList const& vDummyAuras = caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); itr++)
{
SpellEntry const* vSpell = (*itr)->GetSpellProto();
// Rapture (main spell)
if(vSpell->SpellFamilyName == SPELLFAMILY_PRIEST && vSpell->SpellIconID == 2894 && vSpell->Effect[1])
float DoneActualBenefit = 0.0f;
switch(m_spellProto->SpellFamilyName)
{
switch((*itr)->GetEffIndex())
{
case 0:
{
// energize caster
int32 manapct1000 = 5 * ((*itr)->GetModifier()->m_amount + spellmgr.GetSpellRank(vSpell->Id));
int32 basepoints0 = caster->GetMaxPower(POWER_MANA) * manapct1000 / 1000;
caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true);
break;
}
case 1:
{
// energize target
if (!roll_chance_i((*itr)->GetModifier()->m_amount) || caster->HasAura(63853))
break;
case SPELLFAMILY_PRIEST:
// Power Word: Shield
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001))
//+80.68% from +spell bonus
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.8068f;
break;
case SPELLFAMILY_MAGE:
// Frost Ward, Fire Ward
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000108))
//+10% from +spell bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f;
// Ice Barrier
else if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000100000000))
//+80.67% from +spell bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.8067f;
break;
case SPELLFAMILY_WARLOCK:
// Shadow Ward
if (m_spellProto->SpellFamilyFlags2 & 0x00000040)
//+30% from +spell bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.30f;
break;
case SPELLFAMILY_DRUID:
// Savage Defense (amount store original percent of attack power applied)
if (m_spellProto->SpellIconID == 50) // only spell with this aura fit
m_modifier.m_amount = int32(m_modifier.m_amount * m_target->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
break;
default:
break;
}
switch(m_target->getPowerType())
DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto());
m_modifier.m_amount += (int32)DoneActualBenefit;
}
}
else
{
// Ice Barrier (remove effect from Shattered Barrier)
if (m_spellProto->SpellIconID == 32 && m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE)
{
if (!((m_removeMode == AURA_REMOVE_BY_DEFAULT && !m_modifier.m_amount) || m_removeMode == AURA_REMOVE_BY_DISPEL))
return;
if (m_target->HasAura(44745,0)) // Shattered Barrier, rank 1
{
if(roll_chance_i(50))
m_target->CastSpell(m_target, 55080, true, NULL, this);
}
else if (m_target->HasAura(54787,0)) // Shattered Barrier, rank 2
{
m_target->CastSpell(m_target, 55080, true, NULL, this);
}
}
if (caster &&
// Power Word: Shield
m_spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellProto->Mechanic == MECHANIC_SHIELD &&
(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001)) &&
// completely absorbed or dispelled
((m_removeMode == AURA_REMOVE_BY_DEFAULT && !m_modifier.m_amount) || m_removeMode == AURA_REMOVE_BY_DISPEL))
{
Unit::AuraList const& vDummyAuras = caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); itr++)
{
SpellEntry const* vSpell = (*itr)->GetSpellProto();
// Rapture (main spell)
if(vSpell->SpellFamilyName == SPELLFAMILY_PRIEST && vSpell->SpellIconID == 2894 && vSpell->Effect[1])
{
switch((*itr)->GetEffIndex())
{
case 0:
{
// energize caster
int32 manapct1000 = 5 * ((*itr)->GetModifier()->m_amount + spellmgr.GetSpellRank(vSpell->Id));
int32 basepoints0 = caster->GetMaxPower(POWER_MANA) * manapct1000 / 1000;
caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true);
break;
}
case 1:
{
// energize target
if (!roll_chance_i((*itr)->GetModifier()->m_amount) || caster->HasAura(63853))
break;
switch(m_target->getPowerType())
{
case POWER_RUNIC_POWER:
m_target->CastSpell(m_target, 63652, true, NULL, NULL, m_caster_guid);
break;
@ -6087,25 +6101,26 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
m_target->CastSpell(m_target, 63653, true, NULL, NULL, m_caster_guid);
break;
case POWER_MANA:
{
int32 basepoints0 = m_target->GetMaxPower(POWER_MANA) * 2 / 100;
m_target->CastCustomSpell(m_target, 63654, &basepoints0, NULL, NULL, true);
break;
}
{
int32 basepoints0 = m_target->GetMaxPower(POWER_MANA) * 2 / 100;
m_target->CastCustomSpell(m_target, 63654, &basepoints0, NULL, NULL, true);
break;
}
case POWER_ENERGY:
m_target->CastSpell(m_target, 63655, true, NULL, NULL, m_caster_guid);
break;
default:
break;
}
}
//cooldwon aura
caster->CastSpell(caster, 63853, true);
break;
//cooldwon aura
caster->CastSpell(caster, 63853, true);
break;
}
default:
sLog.outError("Changes in R-dummy spell???: effect 3");
break;
}
default:
sLog.outError("Changes in R-dummy spell???: effect 3");
break;
}
}
}