Core/Spells: Fix talent Deep Wounds. Original idea by DrTenma
Closes #395 Closes #954 Closes #1188
This commit is contained in:
@@ -8689,6 +8689,33 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
// Custom triggered spells
|
||||
switch (auraSpellInfo->Id)
|
||||
{
|
||||
// Deep Wounds
|
||||
case 12834:
|
||||
case 12849:
|
||||
case 12867:
|
||||
{
|
||||
if (GetTypeId() != TYPEID_PLAYER)
|
||||
return false;
|
||||
|
||||
// now compute approximate weapon damage by formula from wowwiki.com
|
||||
Item* item = NULL;
|
||||
if (procFlags & PROC_FLAG_DONE_OFFHAND_ATTACK)
|
||||
item = ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
|
||||
else
|
||||
item = ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
|
||||
|
||||
// dunno if it's really needed but will prevent any possible crashes
|
||||
if (!item)
|
||||
return false;
|
||||
|
||||
ItemTemplate const* weapon = item->GetTemplate();
|
||||
|
||||
float weaponDPS = weapon->getDPS();
|
||||
float attackPower = GetTotalAttackPowerValue(BASE_ATTACK) / 14.0f;
|
||||
float weaponSpeed = float(weapon->Delay) / 1000.0f;
|
||||
basepoints0 = int32((weaponDPS + attackPower) * weaponSpeed);
|
||||
break;
|
||||
}
|
||||
// Persistent Shield (Scarab Brooch trinket)
|
||||
// This spell originally trigger 13567 - Dummy Trigger (vs dummy efect)
|
||||
case 26467:
|
||||
@@ -10385,6 +10412,11 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellEntry const* spellProto, uint32
|
||||
if (!spellProto || !victim || damagetype == DIRECT_DAMAGE)
|
||||
return pdamage;
|
||||
|
||||
// small exception for Deep Wounds, can't find any general rule
|
||||
// should ignore ALL damage mods, they already calculated in trigger spell
|
||||
if (spellProto->Id == 12721) // Deep Wounds
|
||||
return pdamage;
|
||||
|
||||
// For totems get damage bonus from owner
|
||||
if (GetTypeId() == TYPEID_UNIT && ToCreature()->isTotem())
|
||||
if (Unit* owner = GetOwner())
|
||||
@@ -10898,7 +10930,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellEntry const* spellProto, uint32
|
||||
DoneTotalMod = 1.0f;
|
||||
}
|
||||
|
||||
// Some spells don't benefit from from pct done mods
|
||||
// Some spells don't benefit from pct done mods
|
||||
// maybe should be implemented like SPELL_ATTR3_NO_DONE_BONUS,
|
||||
// but then it may break spell power coeffs work on spell 31117
|
||||
if (spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS)
|
||||
|
||||
Reference in New Issue
Block a user