diff options
| author | tobmaps <spambot42@yandex.ru> | 2011-07-23 00:10:44 +0700 |
|---|---|---|
| committer | tobmaps <spambot42@yandex.ru> | 2011-07-23 00:10:44 +0700 |
| commit | 4c9269cd54c4d360fa7e25bc4f3d90603528ee93 (patch) | |
| tree | ee3afefe924d4e7303572e6ce5cd961d03666004 /src/server/game/Entities/Unit | |
| parent | 6b1a7497dc2482a7d1d14bf37e715156890054ea (diff) | |
Core/Spells: Fix talent Deep Wounds. Original idea by DrTenma
Closes #395
Closes #954
Closes #1188
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f6db458e270..719331f610d 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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) |
