mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[9057] Implement some damage related spell attributes support.
* SPELL_ATTR_EX4_STACK_DOT_MODIFIER * SPELL_ATTR_EX6_NO_DMG_PERCENT_MODS Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
a1bba62e88
commit
d990644151
4 changed files with 49 additions and 51 deletions
|
|
@ -749,44 +749,6 @@ void Spell::EffectDummy(uint32 i)
|
|||
((Creature*)unitTarget)->setDeathState(JUST_ALIVED);
|
||||
return;
|
||||
}
|
||||
case 12162: // Deep wounds
|
||||
case 12850: // (now good common check for this spells)
|
||||
case 12868:
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
float damage;
|
||||
// DW should benefit of attack power, damage percent mods etc.
|
||||
// TODO: check if using offhand damage is correct and if it should be divided by 2
|
||||
if (m_caster->haveOffhandWeapon() && m_caster->getAttackTimer(BASE_ATTACK) > m_caster->getAttackTimer(OFF_ATTACK))
|
||||
damage = (m_caster->GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE))/2;
|
||||
else
|
||||
damage = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE))/2;
|
||||
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
case 12162: damage *= 0.16f; break; // Rank 1
|
||||
case 12850: damage *= 0.32f; break; // Rank 2
|
||||
case 12868: damage *= 0.48f; break; // Rank 3
|
||||
default:
|
||||
sLog.outError("Spell::EffectDummy: Spell %u not handled in DW",m_spellInfo->Id);
|
||||
return;
|
||||
};
|
||||
|
||||
// get remaining damage of old Deep Wound aura
|
||||
Aura* deepWound = unitTarget->GetAura(12721, 0);
|
||||
if (deepWound)
|
||||
{
|
||||
int32 remainingTicks = deepWound->GetAuraDuration() / deepWound->GetModifier()->periodictime;
|
||||
damage += remainingTicks * deepWound->GetModifier()->m_amount;
|
||||
}
|
||||
|
||||
// 1 tick/sec * 6 sec = 6 ticks
|
||||
int32 deepWoundsDotBasePoints0 = int32(damage / 6);
|
||||
m_caster->CastCustomSpell(unitTarget, 12721, &deepWoundsDotBasePoints0, NULL, NULL, true, NULL);
|
||||
return;
|
||||
}
|
||||
case 13120: // net-o-matic
|
||||
{
|
||||
if (!unitTarget)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue