mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Apply procPatch
This commit is contained in:
parent
bdf7fb8394
commit
4a07c0c6c2
9 changed files with 2298 additions and 421 deletions
|
|
@ -541,61 +541,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
|||
}
|
||||
|
||||
if(damage >= 0)
|
||||
{
|
||||
uint32 finalDamage;
|
||||
if(m_originalCaster) // m_caster only passive source of cast
|
||||
finalDamage = m_originalCaster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, damage, m_IsTriggeredSpell, true);
|
||||
else
|
||||
finalDamage = m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, damage, m_IsTriggeredSpell, true);
|
||||
|
||||
// post effects
|
||||
switch(m_spellInfo->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_WARRIOR:
|
||||
{
|
||||
// Bloodthirst
|
||||
if(m_spellInfo->SpellFamilyFlags & 0x40000000000LL)
|
||||
{
|
||||
uint32 BTAura = 0;
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
case 23881: BTAura = 23885; break;
|
||||
case 23892: BTAura = 23886; break;
|
||||
case 23893: BTAura = 23887; break;
|
||||
case 23894: BTAura = 23888; break;
|
||||
case 25251: BTAura = 25252; break;
|
||||
case 30335: BTAura = 30339; break;
|
||||
default:
|
||||
sLog.outError("Spell::EffectSchoolDMG: Spell %u not handled in BTAura",m_spellInfo->Id);
|
||||
break;
|
||||
}
|
||||
|
||||
if (BTAura)
|
||||
m_caster->CastSpell(m_caster,BTAura,true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_PRIEST:
|
||||
{
|
||||
// Shadow Word: Death
|
||||
if(finalDamage > 0 && (m_spellInfo->SpellFamilyFlags & 0x0000000200000000LL) && unitTarget->isAlive())
|
||||
// deals damage equal to damage done to caster if victim is not killed
|
||||
m_caster->SpellNonMeleeDamageLog( m_caster, m_spellInfo->Id, finalDamage, m_IsTriggeredSpell, false);
|
||||
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_PALADIN:
|
||||
{
|
||||
// Judgement of Blood
|
||||
if(finalDamage > 0 && (m_spellInfo->SpellFamilyFlags & 0x0000000800000000LL) && m_spellInfo->SpellIconID==153)
|
||||
{
|
||||
int32 damagePoint = finalDamage * 33 / 100;
|
||||
m_caster->CastCustomSpell(m_caster, 32220, &damagePoint, NULL, NULL, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_damage+= damage;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1355,7 +1301,7 @@ void Spell::EffectDummy(uint32 i)
|
|||
}
|
||||
|
||||
if(found)
|
||||
m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, damage, m_IsTriggeredSpell, true);
|
||||
m_damage+= damage;
|
||||
return;
|
||||
}
|
||||
// Kill command
|
||||
|
|
@ -2308,7 +2254,7 @@ void Spell::EffectPowerBurn(uint32 i)
|
|||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier);
|
||||
|
||||
new_damage = int32(new_damage*multiplier);
|
||||
m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, new_damage, m_IsTriggeredSpell, true);
|
||||
m_damage+=new_damage;
|
||||
}
|
||||
|
||||
void Spell::EffectHeal( uint32 /*i*/ )
|
||||
|
|
@ -2376,27 +2322,7 @@ void Spell::EffectHeal( uint32 /*i*/ )
|
|||
else
|
||||
addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth,HEAL, unitTarget);
|
||||
|
||||
bool crit = caster->isSpellCrit(unitTarget, m_spellInfo, m_spellSchoolMask, m_attackType);
|
||||
if (crit)
|
||||
addhealth = caster->SpellCriticalBonus(m_spellInfo, addhealth, unitTarget);
|
||||
caster->SendHealSpellLog(unitTarget, m_spellInfo->Id, addhealth, crit);
|
||||
|
||||
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
|
||||
unitTarget->getHostilRefManager().threatAssist(m_caster, float(gain) * 0.5f, m_spellInfo);
|
||||
|
||||
if(caster->GetTypeId()==TYPEID_PLAYER)
|
||||
if(BattleGround *bg = ((Player*)caster)->GetBattleGround())
|
||||
bg->UpdatePlayerScore(((Player*)caster), SCORE_HEALING_DONE, gain);
|
||||
|
||||
// ignore item heals
|
||||
if(m_CastItem)
|
||||
return;
|
||||
|
||||
uint32 procHealer = PROC_FLAG_HEAL;
|
||||
if (crit)
|
||||
procHealer |= PROC_FLAG_CRIT_HEAL;
|
||||
|
||||
m_caster->ProcDamageAndSpell(unitTarget,procHealer,PROC_FLAG_HEALED,addhealth,SPELL_SCHOOL_MASK_NONE,m_spellInfo,m_IsTriggeredSpell);
|
||||
m_healing+=addhealth;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2473,6 +2399,8 @@ void Spell::EffectHealthLeech(uint32 i)
|
|||
if(m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
m_caster->SendHealSpellLog(m_caster, m_spellInfo->Id, uint32(new_damage));
|
||||
}
|
||||
// m_healthLeech+=tmpvalue;
|
||||
// m_damage+=new_damage;
|
||||
}
|
||||
|
||||
void Spell::DoCreateItem(uint32 i, uint32 itemtype)
|
||||
|
|
@ -4317,35 +4245,9 @@ void Spell::EffectWeaponDmg(uint32 i)
|
|||
// prevent negative damage
|
||||
uint32 eff_damage = uint32(bonus > 0 ? bonus : 0);
|
||||
|
||||
const uint32 nohitMask = HITINFO_ABSORB | HITINFO_RESIST | HITINFO_MISS;
|
||||
|
||||
uint32 hitInfo = 0;
|
||||
VictimState victimState = VICTIMSTATE_NORMAL;
|
||||
uint32 blocked_dmg = 0;
|
||||
uint32 absorbed_dmg = 0;
|
||||
uint32 resisted_dmg = 0;
|
||||
CleanDamage cleanDamage = CleanDamage(0, BASE_ATTACK, MELEE_HIT_NORMAL );
|
||||
|
||||
m_caster->DoAttackDamage(unitTarget, &eff_damage, &cleanDamage, &blocked_dmg, m_spellSchoolMask, &hitInfo, &victimState, &absorbed_dmg, &resisted_dmg, m_attackType, m_spellInfo, m_IsTriggeredSpell);
|
||||
|
||||
if ((hitInfo & nohitMask) && m_attackType != RANGED_ATTACK) // not send ranged miss/etc
|
||||
m_caster->SendAttackStateUpdate(hitInfo & nohitMask, unitTarget, 1, m_spellSchoolMask, eff_damage, absorbed_dmg, resisted_dmg, VICTIMSTATE_NORMAL, blocked_dmg);
|
||||
|
||||
bool criticalhit = (hitInfo & HITINFO_CRITICALHIT);
|
||||
m_caster->SendSpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, eff_damage, m_spellSchoolMask, absorbed_dmg, resisted_dmg, false, blocked_dmg, criticalhit);
|
||||
|
||||
if (eff_damage > (absorbed_dmg + resisted_dmg + blocked_dmg))
|
||||
{
|
||||
eff_damage -= (absorbed_dmg + resisted_dmg + blocked_dmg);
|
||||
}
|
||||
else
|
||||
{
|
||||
cleanDamage.damage += eff_damage;
|
||||
eff_damage = 0;
|
||||
}
|
||||
|
||||
// SPELL_SCHOOL_NORMAL use for weapon-like threat and rage calculation
|
||||
m_caster->DealDamage(unitTarget, eff_damage, &cleanDamage, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, true);
|
||||
// Add melee damage bonuses (also check for negative)
|
||||
m_caster->MeleeDamageBonus(unitTarget, &eff_damage, m_attackType, m_spellInfo);
|
||||
m_damage+= eff_damage;
|
||||
|
||||
// Hemorrhage
|
||||
if(m_spellInfo->SpellFamilyName==SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags & 0x2000000))
|
||||
|
|
@ -4409,10 +4311,7 @@ void Spell::EffectHealMaxHealth(uint32 /*i*/)
|
|||
|
||||
uint32 heal = m_caster->GetMaxHealth();
|
||||
|
||||
int32 gain = unitTarget->ModifyHealth(heal);
|
||||
unitTarget->getHostilRefManager().threatAssist(m_caster, float(gain) * 0.5f, m_spellInfo);
|
||||
|
||||
m_caster->SendHealSpellLog(unitTarget, m_spellInfo->Id, heal);
|
||||
m_healing+=heal;
|
||||
}
|
||||
|
||||
void Spell::EffectInterruptCast(uint32 /*i*/)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue