mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +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
|
|
@ -358,7 +358,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = {
|
|||
#define SPELL_ATTR_EX4_UNK5 0x00000020 // 5
|
||||
#define SPELL_ATTR_EX4_NOT_STEALABLE 0x00000040 // 6 although such auras might be dispellable, they cannot be stolen
|
||||
#define SPELL_ATTR_EX4_UNK7 0x00000080 // 7
|
||||
#define SPELL_ATTR_EX4_UNK8 0x00000100 // 8
|
||||
#define SPELL_ATTR_EX4_STACK_DOT_MODIFIER 0x00000100 // 8 no effect on non DoTs?
|
||||
#define SPELL_ATTR_EX4_UNK9 0x00000200 // 9
|
||||
#define SPELL_ATTR_EX4_SPELL_VS_EXTEND_COST 0x00000400 // 10 Rogue Shiv have this flag
|
||||
#define SPELL_ATTR_EX4_UNK11 0x00000800 // 11
|
||||
|
|
@ -445,7 +445,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = {
|
|||
#define SPELL_ATTR_EX6_UNK26 0x04000000 // 26 not set in 3.0.3
|
||||
#define SPELL_ATTR_EX6_UNK27 0x08000000 // 27 not set in 3.0.3
|
||||
#define SPELL_ATTR_EX6_UNK28 0x10000000 // 28 not set in 3.0.3
|
||||
#define SPELL_ATTR_EX6_UNK29 0x20000000 // 29 not set in 3.0.3
|
||||
#define SPELL_ATTR_EX6_NO_DMG_PERCENT_MODS 0x20000000 // 29 do not apply damage percent mods (usually in cases where it has already been applied)
|
||||
#define SPELL_ATTR_EX6_UNK30 0x40000000 // 30 not set in 3.0.3
|
||||
#define SPELL_ATTR_EX6_UNK31 0x80000000 // 31 not set in 3.0.3
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -3608,16 +3608,25 @@ bool Unit::AddAura(Aura *Aur)
|
|||
{
|
||||
for(AuraMap::iterator i2 = m_Auras.lower_bound(spair); i2 != m_Auras.upper_bound(spair); ++i2)
|
||||
{
|
||||
if(i2->second->GetCasterGUID()==Aur->GetCasterGUID())
|
||||
Aura* aur2 = i2->second;
|
||||
if(aur2->GetCasterGUID()==Aur->GetCasterGUID())
|
||||
{
|
||||
// Aura can stack on self -> Stack it;
|
||||
if(aurSpellInfo->StackAmount)
|
||||
{
|
||||
// can be created with >1 stack by some spell mods
|
||||
i2->second->modStackAmount(Aur->GetStackAmount());
|
||||
aur2->modStackAmount(Aur->GetStackAmount());
|
||||
delete Aur;
|
||||
return false;
|
||||
}
|
||||
// Carry over removed Aura's remaining damage if Aura still has ticks remaining
|
||||
else if (aur2->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_STACK_DOT_MODIFIER && aurName == SPELL_AURA_PERIODIC_DAMAGE && aur2->GetAuraDuration() > 0)
|
||||
{
|
||||
int32 remainingTicks = 1 + (aur2->GetAuraDuration() / aur2->GetModifier()->periodictime);
|
||||
int32 maxTicks = aur2->GetAuraMaxDuration() / aur2->GetModifier()->periodictime;
|
||||
|
||||
Aur->GetModifier()->m_amount += int32(remainingTicks * aur2->GetModifier()->m_amount / maxTicks);
|
||||
}
|
||||
// can be only single (this check done at _each_ aura add
|
||||
RemoveAura(i2,AURA_REMOVE_BY_STACK);
|
||||
break;
|
||||
|
|
@ -7007,6 +7016,30 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
|
|||
}
|
||||
break;
|
||||
case SPELLFAMILY_WARRIOR:
|
||||
// Deep Wounds (replace triggered spells to directly apply DoT), dot spell have finilyflags
|
||||
if (auraSpellInfo->SpellFamilyFlags == UI64LIT(0x0) && auraSpellInfo->SpellIconID == 243)
|
||||
{
|
||||
float weaponDamage;
|
||||
// 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 (haveOffhandWeapon() && getAttackTimer(BASE_ATTACK) > getAttackTimer(OFF_ATTACK))
|
||||
weaponDamage = (GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE) + GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE))/2;
|
||||
else
|
||||
weaponDamage = (GetFloatValue(UNIT_FIELD_MINDAMAGE) + GetFloatValue(UNIT_FIELD_MAXDAMAGE))/2;
|
||||
|
||||
switch (auraSpellInfo->Id)
|
||||
{
|
||||
case 12834: basepoints[0] = int32(weaponDamage * 16 / 100); break;
|
||||
case 12849: basepoints[0] = int32(weaponDamage * 32 / 100); break;
|
||||
case 12867: basepoints[0] = int32(weaponDamage * 48 / 100); break;
|
||||
// Impossible case
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
trigger_spell_id = 12721;
|
||||
break;
|
||||
}
|
||||
if (auraSpellInfo->Id == 50421) // Scent of Blood
|
||||
trigger_spell_id = 50422;
|
||||
break;
|
||||
|
|
@ -8520,6 +8553,8 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
|||
if( GetTypeId() == TYPEID_UNIT && !((Creature*)this)->isPet() )
|
||||
DoneTotalMod *= ((Creature*)this)->GetSpellDamageMod(((Creature*)this)->GetCreatureInfo()->rank);
|
||||
|
||||
if (!(spellProto->AttributesEx6 & SPELL_ATTR_EX6_NO_DMG_PERCENT_MODS))
|
||||
{
|
||||
AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
||||
for(AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
|
||||
{
|
||||
|
|
@ -8532,6 +8567,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
|||
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 creatureTypeMask = pVictim->GetCreatureTypeMask();
|
||||
// Add flat bonus from spell damage versus
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9056"
|
||||
#define REVISION_NR "9057"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue