mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Remove cooldown of spells triggered on stance change - this fixes shadowform dot crit.
--HG-- branch : trunk
This commit is contained in:
@@ -4196,15 +4196,19 @@ void Spell::TriggerSpell()
|
||||
SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
// check cooldowns to prevent cheating
|
||||
if(m_caster->GetTypeId()==TYPEID_PLAYER && ((Player*)m_caster)->HasSpellCooldown(m_spellInfo->Id))
|
||||
if(m_caster->GetTypeId()==TYPEID_PLAYER)
|
||||
{
|
||||
//can cast triggered (by aura only?) spells while have this flag
|
||||
if (!m_IsTriggeredSpell && ((Player*)m_caster)->HasFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY))
|
||||
return SPELL_FAILED_SPELL_IN_PROGRESS;
|
||||
if(m_triggeredByAuraSpell)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
else
|
||||
return SPELL_FAILED_NOT_READY;
|
||||
|
||||
if (((Player*)m_caster)->HasSpellCooldown(m_spellInfo->Id))
|
||||
{
|
||||
if(m_triggeredByAuraSpell)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
else
|
||||
return SPELL_FAILED_NOT_READY;
|
||||
}
|
||||
}
|
||||
|
||||
// only allow triggered spells if at an ended battleground
|
||||
|
||||
@@ -1473,7 +1473,13 @@ void AuraEffect::HandleShapeshiftBoosts(bool apply)
|
||||
|
||||
if(apply)
|
||||
{
|
||||
// Remove cooldown of spells triggered on stance change - they may share cooldown with stance spell
|
||||
if(m_target->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player *)m_target)->RemoveSpellCooldown(spellId);
|
||||
if (spellId) m_target->CastSpell(m_target, spellId, true, NULL, this );
|
||||
|
||||
if(m_target->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player *)m_target)->RemoveSpellCooldown(spellId2);
|
||||
if (spellId2) m_target->CastSpell(m_target, spellId2, true, NULL, this);
|
||||
|
||||
if(m_target->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -7251,11 +7257,13 @@ void AuraEffect::HandleModPossessPet(bool apply, bool Real, bool /*changeAmount*
|
||||
Unit* caster = GetCaster();
|
||||
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
if(caster->GetGuardianPet() != m_target)
|
||||
return;
|
||||
|
||||
if(apply)
|
||||
{
|
||||
if(caster->GetGuardianPet() != m_target)
|
||||
return;
|
||||
m_target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_target->RemoveCharmedBy(caster);
|
||||
|
||||
Reference in New Issue
Block a user