aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-01-14 09:23:34 -0300
committerariel- <ariel-@users.noreply.github.com>2018-01-14 09:23:34 -0300
commitf1986c6aafdf2457902a7a4cc7acc903cbbdc7bb (patch)
tree16d186ec1f2ace71ab3611a06f3c7ff5fe346f18 /src/server/scripts
parent24cf532557b07dbcd90180dea098fa2c86576152 (diff)
Core/Entities: implement secondary damage for some weapons and removal of old voodoo
- Fixed correct Retaliation damage spell according to sniffs is 20240 - CalcArmorReducedDamage insisted on dealing a minimum of 1 damage even if damage was 0 - CalculateDamage was zero-phobic too: it defaulted to arbitrary max 5 damage Closes #19081
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp2
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp3
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp13
3 files changed, 13 insertions, 5 deletions
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index aa6f1c7b5f3..459aed93621 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -2336,7 +2336,7 @@ public:
{
Unit::DealDamage(handler->GetSession()->GetPlayer(), target, damage, nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
if (target != handler->GetSession()->GetPlayer())
- handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0);
+ handler->GetSession()->GetPlayer()->SendAttackStateUpdate(HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0);
return true;
}
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index 8f7ad770517..e909e9f0780 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -1724,7 +1724,8 @@ public:
if (pet->IsGuardian())
((Guardian*)pet)->SetBonusDamage(owner->GetTotalAttackPowerValue(BASE_ATTACK));
- amount += owner->CalculateDamage(BASE_ATTACK, true, true);
+ for (uint8 i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
+ amount += owner->CalculateDamage(BASE_ATTACK, true, true, i);
}
}
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index 9c303319037..ac3ddb25e6f 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -22,6 +22,7 @@
*/
#include "ScriptMgr.h"
+#include "ItemTemplate.h"
#include "Optional.h"
#include "Player.h"
#include "Random.h"
@@ -50,7 +51,7 @@ enum WarriorSpells
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976,
- SPELL_WARRIOR_RETALIATION_DAMAGE = 22858,
+ SPELL_WARRIOR_RETALIATION_DAMAGE = 20240,
SPELL_WARRIOR_SLAM = 50783,
SPELL_WARRIOR_SLAM_GCD_REDUCED = 71072,
SPELL_WARRIOR_SUDDEN_DEATH_R1 = 29723,
@@ -743,8 +744,14 @@ class spell_warr_rend : public SpellScriptLoader
// $0.2 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS) bonus per tick
float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK);
int32 mws = caster->GetAttackTime(BASE_ATTACK);
- float mwbMin = caster->GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE);
- float mwbMax = caster->GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE);
+ float mwbMin = 0.f;
+ float mwbMax = 0.f;
+ for (uint8 i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
+ {
+ mwbMin += caster->GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE, i);
+ mwbMax += caster->GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE, i);
+ }
+
float mwb = ((mwbMin + mwbMax) / 2 + ap * mws / 14000) * 0.2f;
amount += int32(caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), mwb));