aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 19741ea7854..95345ed8b93 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3023,7 +3023,13 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
// calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail)
m_casttime = m_spellInfo->CalcCastTime(m_caster, this);
if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
+
+ // Set casttime to 0 if .cheat casttime is enabled.
+ if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_CASTTIME))
+ m_casttime = 0;
+ }
// don't allow channeled spells / spells with cast time to be casted while moving
// (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in)
@@ -3315,7 +3321,13 @@ void Spell::cast(bool skipCheck)
}
if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
+
+ //Clear spell cooldowns after every spell is cast if .cheat cooldown is enabled.
+ if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_COOLDOWN))
+ m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true);
+ }
SetExecutedCurrently(false);
}
@@ -4358,6 +4370,13 @@ void Spell::TakePower()
if (m_CastItem || m_triggeredByAuraSpell)
return;
+ //Don't take power if the spell is cast while .cheat power is enabled.
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_POWER))
+ return;
+ }
+
Powers powerType = Powers(m_spellInfo->PowerType);
bool hit = true;
if (m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -7193,6 +7212,10 @@ void Spell::TriggerGlobalCooldown()
if (!gcd)
return;
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_COOLDOWN))
+ return;
+
// Global cooldown can't leave range 1..1.5 secs
// There are some spells (mostly not casted directly by player) that have < 1 sec and > 1.5 sec global cooldowns
// but as tests show are not affected by any spell mods.