- Premeditation is now working properly, no longer gives unlimited combo points for the duration of applied aura and removing combo points if aura duration has expired without loss of combo points generated in this time, except the ones generated by spell using this aura. Closing issue #59.
From 4edebe4a6f63e79bc36c3befdf6dcc8cb20c6248 Mon Sep 17 00:00:00 2001
From: Neo_mat <neomat.github@gmail.com>
Date: Sat, 3 Dec 2011 02:53:12 +0400
Subject: [PATCH] Rogue: Premeditation is now working properly, no longer
gives unlimited combo points for the duration of applied
aura and removing combo points if aura duration has expired
without loss of combo points generated in this time, except
the ones generated by spell using this aura. Closing issue
#59.
---
src/arcemu-world/Player.cpp | 15 +++++++++++++++
src/arcemu-world/Player.h | 12 +-----------
src/arcemu-world/SpellAuras.cpp | 16 +++++++++++++++-
3 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/src/arcemu-world/Player.cpp b/src/arcemu-world/Player.cpp
index 09e6275..f283f7d 100644
--- a/src/arcemu-world/Player.cpp
+++ b/src/arcemu-world/Player.cpp
@@ -9680,6 +9680,21 @@ void Player::EventPortToGM(Player* p)
SafeTeleport(p->GetMapId(), p->GetInstanceID(), p->GetPosition());
}
+void Player::AddComboPoints(uint64 target, int8 count)
+{
+ // GetTimeLeft() checked in SpellAura, so we won't lose points
+ RemoveAllAuraType(SPELL_AURA_RETAIN_COMBO_POINTS);
+
+ if(m_comboTarget == target)
+ m_comboPoints += count;
+ else
+ {
+ m_comboTarget = target;
+ m_comboPoints = count;
+ }
+ UpdateComboPoints();
+}
+
void Player::UpdateComboPoints()
{
// **** bytebuffers :)
diff --git a/src/arcemu-world/Player.h b/src/arcemu-world/Player.h
index 69cafae..7db2628 100644
--- a/src/arcemu-world/Player.h
+++ b/src/arcemu-world/Player.h
@@ -2116,17 +2116,7 @@ class SERVER_DECL Player : public Unit
int8 m_spellcomboPoints; // rogue talent Ruthlessness will change combopoints while consuming them. solutions 1) add post cast prochandling, 2) delay adding the CP
void UpdateComboPoints();
- void AddComboPoints(uint64 target, uint8 count)
- {
- if(m_comboTarget == target)
- m_comboPoints += count;
- else
- {
- m_comboTarget = target;
- m_comboPoints = count;
- }
- UpdateComboPoints();
- }
+ void AddComboPoints(uint64 target, int8 count);
void NullComboPoints() { if(!m_retainComboPoints) { m_comboTarget = 0; m_comboPoints = 0; m_spellcomboPoints = 0; } UpdateComboPoints(); }
uint32 m_speedChangeCounter;
diff --git a/src/arcemu-world/SpellAuras.cpp b/src/arcemu-world/SpellAuras.cpp
index eced2e5..edacf17 100644
--- a/src/arcemu-world/SpellAuras.cpp
+++ b/src/arcemu-world/SpellAuras.cpp
@@ -6807,7 +6807,21 @@ void Aura::SpellAuraModResistanceExclusive(bool apply)
void Aura::SpellAuraRetainComboPoints(bool apply)
{
if(p_target != NULL)
- p_target->m_retainComboPoints = apply;
+ {
+ if(apply)
+ {
+ p_target->m_retainComboPoints = true;
+ }
+ else
+ {
+ p_target->m_retainComboPoints = false; //Let points to be consumed
+
+ //Remove points if aura duration has expired, no combo points will be lost if there were some
+ //except the ones that were generated by this spell
+ if(GetTimeLeft() == 0)
+ p_target->AddComboPoints(p_target->GetSelection(), -mod->m_amount);
+ }
+ }
}
void Aura::SpellAuraResistPushback(bool apply)
--
1.7.7.1.msysgit.0
Attached File(s)
-
0009-Rogue-Premeditation-is-now-working-properly-no-longe.patch (3.08K)
Number of downloads: 1

Help

















