aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-06-24 15:58:44 +0200
committerQAston <none@none>2009-06-24 15:58:44 +0200
commit33b2917bb7cbf4512c5bd58d99ceb795ef7a1a10 (patch)
treedf055da250120e767ab7512eaa2e2e9f55738cd8 /src/game/Player.cpp
parent329b020af442240131f9d08d577f694e50bc9064 (diff)
*Fix Ferocious Bite energy to dmg conversion
*Remove duplicated AP coefficients for Hammer of Wrath and Avengers Shield *Correctly do effectaddcombopoints for spells which take them. *Do not proc spelleffects on player login. --HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 4adac94c946..f5b17016512 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -18624,17 +18624,19 @@ void Player::SendComboPoints()
}
}
-void Player::AddComboPoints(Unit* target, int8 count)
+void Player::AddComboPoints(Unit* target, int8 count, Spell * spell)
{
if(!count)
return;
+ int8 * comboPoints = spell ? &spell->m_comboPointGain : &m_comboPoints;
+
// without combo points lost (duration checked in aura)
RemoveAurasByType(SPELL_AURA_RETAIN_COMBO_POINTS);
if(target->GetGUID() == m_comboTarget)
{
- m_comboPoints += count;
+ *comboPoints += count;
}
else
{
@@ -18643,13 +18645,26 @@ void Player::AddComboPoints(Unit* target, int8 count)
target2->RemoveComboPointHolder(GetGUIDLow());
m_comboTarget = target->GetGUID();
- m_comboPoints = count;
+ *comboPoints = count;
target->AddComboPointHolder(GetGUIDLow());
}
+ if (*comboPoints > 5) *comboPoints = 5;
+ else if (*comboPoints < 0) *comboPoints = 0;
+
+ if (!spell)
+ SendComboPoints();
+}
+
+void Player::GainSpellComboPoints(int8 count)
+{
+ if(!count)
+ return;
+
+ m_comboPoints += count;
if (m_comboPoints > 5) m_comboPoints = 5;
- if (m_comboPoints < 0) m_comboPoints = 0;
+ else if (m_comboPoints < 0) m_comboPoints = 0;
SendComboPoints();
}