Core/Spells now the spells for summon mount aren't affected by haste (#555)
* Core/Spells now the spells for summon mount aren't affected by haste * Convert tabs to space * Cleaning garbage of last commit
This commit is contained in:
Binary file not shown.
@@ -13635,25 +13635,38 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in
|
|||||||
return std::max(duration, 0);
|
return std::max(duration, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::ModSpellCastTime(SpellInfo const* spellProto, int32 & castTime, Spell* spell)
|
void Unit::ModSpellCastTime(SpellInfo const* spellInfo, int32 & castTime, Spell* spell)
|
||||||
{
|
{
|
||||||
if (!spellProto || castTime < 0)
|
if (!spellInfo || castTime < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (spellInfo->IsChanneled() && !(spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION))
|
||||||
|
return;
|
||||||
|
|
||||||
// called from caster
|
// called from caster
|
||||||
if (Player* modOwner = GetSpellModOwner())
|
if (Player* modOwner = GetSpellModOwner())
|
||||||
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CASTING_TIME, castTime, spell, bool(modOwner != this && !IsPet()));
|
// TODO:(MadAgos) Eventually check and delete the bool argument
|
||||||
|
modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell, bool(modOwner != this && !IsPet()));
|
||||||
|
|
||||||
if (!spellProto->HasAttribute(SpellAttr0(SPELL_ATTR0_ABILITY|SPELL_ATTR0_TRADESPELL)) && (spellProto->SpellFamilyName || GetTypeId() != TYPEID_PLAYER))
|
switch (spellInfo->DmgClass)
|
||||||
{
|
{
|
||||||
if (CanInstantCast())
|
case SPELL_DAMAGE_CLASS_NONE:
|
||||||
castTime = 0;
|
if (spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) // required double check
|
||||||
else
|
|
||||||
castTime = int32(float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED));
|
castTime = int32(float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED));
|
||||||
}
|
else if (spellInfo->SpellVisual[0] == 3881 && HasAura(67556)) // cooking with Chef Hat.
|
||||||
else if (spellProto->HasAttribute(SPELL_ATTR0_REQ_AMMO) && !spellProto->HasAttribute(SPELL_ATTR2_AUTOREPEAT_FLAG))
|
|
||||||
castTime = int32(float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK]);
|
|
||||||
else if (spellProto->SpellVisual[0] == 3881 && HasAura(67556)) // cooking with Chef Hat.
|
|
||||||
castTime = 500;
|
castTime = 500;
|
||||||
|
break;
|
||||||
|
case SPELL_DAMAGE_CLASS_MELEE:
|
||||||
|
break; // no known cases
|
||||||
|
case SPELL_DAMAGE_CLASS_MAGIC:
|
||||||
|
castTime = int32(float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED));
|
||||||
|
break;
|
||||||
|
case SPELL_DAMAGE_CLASS_RANGED:
|
||||||
|
castTime = int32(float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DiminishingLevels Unit::GetDiminishing(DiminishingGroup group)
|
DiminishingLevels Unit::GetDiminishing(DiminishingGroup group)
|
||||||
|
|||||||
@@ -3758,6 +3758,7 @@ void Spell::handle_immediate()
|
|||||||
// Apply duration mod
|
// Apply duration mod
|
||||||
if (Player* modOwner = m_caster->GetSpellModOwner())
|
if (Player* modOwner = m_caster->GetSpellModOwner())
|
||||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
|
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||||
|
|
||||||
// Apply haste mods
|
// Apply haste mods
|
||||||
if (m_caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION))
|
if (m_caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION))
|
||||||
duration = int32(duration * m_caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
|
duration = int32(duration * m_caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
|
||||||
|
|||||||
Reference in New Issue
Block a user