aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-05-17 19:39:10 +0200
committerOvahlord <dreadkiller@gmx.de>2025-05-26 20:49:48 +0200
commitb644a3ca1c80ecf013daa3c024fa339672105924 (patch)
treed1572aee1c319958f13b3d7d116323b28f5e0d81 /src
parent550f66658d72e69054cc8bf90218366ba9d10ae3 (diff)
Core/Spells: Expose spell channel duration to scripts
(cherry picked from commit aefdd67ed1a9ea91de053fb3321c8ea5bad865a7) # Conflicts: # src/server/game/Spells/Spell.cpp
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp6
-rw-r--r--src/server/game/Spells/Spell.h3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index c33c6c04f2b..3e54ed9cd3e 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -565,7 +565,7 @@ m_spellValue(new SpellValue(m_spellInfo, caster)), _spellEvent(nullptr)
m_runesState = 0;
m_casttime = 0; // setup to correct value in Spell::prepare, must not be used before.
m_timer = 0; // will set to castime in prepare
- m_channeledDuration = 0; // will be setup in Spell::handle_immediate
+ m_channelDuration = 0; // will be setup in Spell::handle_immediate
m_launchHandled = false;
m_immediateHandled = false;
@@ -4019,7 +4019,7 @@ void Spell::handle_immediate()
else
duration = *m_spellValue->Duration;
- m_channeledDuration = duration;
+ m_channelDuration = duration;
SendChannelStart(duration);
}
else if (duration == -1)
@@ -7849,7 +7849,7 @@ void Spell::DelayedChannel()
//check pushback reduce
// should be affected by modifiers, not take the dbc duration.
- int32 duration = ((m_channeledDuration > 0) ? m_channeledDuration : m_spellInfo->GetDuration());
+ int32 duration = ((m_channelDuration > 0) ? m_channelDuration : m_spellInfo->GetDuration());
int32 delaytime = CalculatePct(duration, 25); // channeling delay is normally 25% of its time per hit
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index bb33523eae5..15561f25bb3 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -615,6 +615,7 @@ class TC_GAME_API Spell
int32 GetCastTime() const { return m_casttime; }
int32 GetRemainingCastTime() const { return m_timer; }
+ int32 GetChannelDuration() const { return m_channelDuration; }
bool IsAutoRepeat() const { return m_autoRepeat; }
void SetAutoRepeat(bool rep) { m_autoRepeat = rep; }
void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; }
@@ -708,7 +709,7 @@ class TC_GAME_API Spell
std::vector<SpellPowerCost> m_powerCost; // Calculated spell cost initialized only in Spell::prepare
int32 m_casttime; // Calculated spell cast time initialized only in Spell::prepare
- int32 m_channeledDuration; // Calculated channeled spell duration in order to calculate correct pushback.
+ int32 m_channelDuration; // Calculated channeled spell duration in order to calculate correct pushback.
bool m_canReflect; // can reflect this spell?
bool m_autoRepeat;
bool m_spendComboPoints; // For finishing moves that should consume all combo points after cast