aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-12-23 08:34:10 -0500
committerSubv <s.v.h21@hotmail.com>2012-12-23 08:34:10 -0500
commiteff2a994b1f0e65dc4298ce55a7a63d8731e7ea7 (patch)
treee8939d196683b93a9f6a26b931643a0bdc685f0f /src
parent3869bb7b3a96751b463ecec2d9ac663b792a0703 (diff)
parent8c53f042ad02259b0cd6a49a9730b9bd0cdfe04a (diff)
Merge branch '4.3.4' of https://github.com/TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp16
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
-rw-r--r--src/server/game/Entities/Unit/Unit.h2
-rw-r--r--src/server/game/Spells/SpellMgr.cpp12
-rw-r--r--src/server/game/Spells/SpellMgr.h2
5 files changed, 20 insertions, 16 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 42e6d38aca6..b3f05ab9733 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -5829,7 +5829,7 @@ float Player::GetRatingBonusValue(CombatRating cr) const
float baseResult = float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) * GetRatingMultiplier(cr);
if (cr != CR_RESILIENCE_PLAYER_DAMAGE_TAKEN)
return baseResult;
- return float(1.0f - pow(0.99f, baseResult));
+ return float(1.0f - pow(0.99f, baseResult)) * 100.0f;
}
float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const
@@ -5867,7 +5867,7 @@ float Player::OCTRegenMPPerSpirit()
void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
{
- m_baseRatingValue[cr]+=(apply ? value : -value);
+ m_baseRatingValue[cr] +=(apply ? value : -value);
// explicit affected values
switch (cr)
@@ -5883,14 +5883,12 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
}
case CR_HASTE_RANGED:
{
- float RatingChange = value * GetRatingMultiplier(cr);
- ApplyAttackTimePercentMod(RANGED_ATTACK, RatingChange, apply);
+ ApplyAttackTimePercentMod(RANGED_ATTACK, value * GetRatingMultiplier(cr), apply);
break;
}
case CR_HASTE_SPELL:
{
- float RatingChange = value * GetRatingMultiplier(cr);
- ApplyCastTimePercentMod(RatingChange, apply);
+ ApplyCastTimePercentMod(value * GetRatingMultiplier(cr), apply);
break;
}
default:
@@ -6220,6 +6218,9 @@ void Player::UpdateSkillsForLevel()
if (GetSkillRangeType(pSkill, false) != SKILL_RANGE_LEVEL)
continue;
+ if (IsWeaponSkill(pSkill->id))
+ continue;
+
uint16 field = itr->second.pos / 2;
uint8 offset = itr->second.pos & 1; // itr->second.pos % 2
@@ -6248,6 +6249,9 @@ void Player::UpdateSkillsToMaxSkillsForLevel()
if (IsProfessionOrRidingSkill(pskill))
continue;
+ if (IsWeaponSkill(pskill))
+ continue;
+
uint16 field = itr->second.pos / 2;
uint8 offset = itr->second.pos & 1; // itr->second.pos % 2
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index ff6c8e4709c..ad4ada215d9 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -15678,8 +15678,8 @@ void Unit::ApplyResilience(Unit const* victim, int32* damage, bool isCrit) const
return;
if (isCrit)
- *damage = target->GetCritDamageReduction(*damage);
- *damage = target->GetDamageReduction(*damage);
+ *damage -= target->GetCritDamageReduction(*damage);
+ *damage -= target->GetDamageReduction(*damage);
}
// Melee based spells can be miss, parry or dodge on this step
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index c00fa03a4ea..5b086747442 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1451,8 +1451,6 @@ class Unit : public WorldObject
// player or player's pet resilience (-1%)
uint32 GetCritDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_CRIT_TAKEN, 2.2f, 33.0f, damage); }
-
- // player or player's pet resilience (-1%), cap 100%
uint32 GetDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, 2.0f, 100.0f, damage); }
void ApplyResilience(const Unit* victim, int32 * damage, bool isCrit) const;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 38570022cdf..088a112fd3b 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -37,13 +37,13 @@
bool IsPrimaryProfessionSkill(uint32 skill)
{
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill);
- if (!pSkill)
- return false;
-
- if (pSkill->categoryId != SKILL_CATEGORY_PROFESSION)
- return false;
+ return pSkill && pSkill->categoryId == SKILL_CATEGORY_PROFESSION;
+}
- return true;
+bool IsWeaponSkill(uint32 skill)
+{
+ SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill);
+ return pSkill && pSkill->categoryId == SKILL_CATEGORY_WEAPON;
}
bool IsPartOfSkillLine(uint32 skillId, uint32 spellId)
diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h
index cec9d4650f5..2cfc8aad624 100644
--- a/src/server/game/Spells/SpellMgr.h
+++ b/src/server/game/Spells/SpellMgr.h
@@ -578,6 +578,8 @@ typedef std::map<int32, std::vector<int32> > SpellLinkedMap;
bool IsPrimaryProfessionSkill(uint32 skill);
+bool IsWeaponSkill(uint32 skill);
+
inline bool IsProfessionSkill(uint32 skill)
{
return IsPrimaryProfessionSkill(skill) || skill == SKILL_FISHING || skill == SKILL_COOKING || skill == SKILL_FIRST_AID;