diff options
| -rw-r--r-- | src/authserver/Thumbs.db | bin | 17408 -> 0 bytes | |||
| -rw-r--r-- | src/game/Entities/Unit/Unit.cpp | 37 | ||||
| -rw-r--r-- | src/game/Spells/Spell.cpp | 5 |
3 files changed, 28 insertions, 14 deletions
diff --git a/src/authserver/Thumbs.db b/src/authserver/Thumbs.db Binary files differdeleted file mode 100644 index a7bf7199aa..0000000000 --- a/src/authserver/Thumbs.db +++ /dev/null diff --git a/src/game/Entities/Unit/Unit.cpp b/src/game/Entities/Unit/Unit.cpp index 164775656b..5508d5fce2 100644 --- a/src/game/Entities/Unit/Unit.cpp +++ b/src/game/Entities/Unit/Unit.cpp @@ -13635,25 +13635,38 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in return std::max(duration, 0); } -void Unit::ModSpellCastTime(SpellInfo const* spellProto, int32 & castTime, Spell* spell) -{ - if (!spellProto || castTime < 0) +void Unit::ModSpellCastTime(SpellInfo const* spellInfo, int32 & castTime, Spell* spell) +{ + if (!spellInfo || castTime < 0) + return; + + if (spellInfo->IsChanneled() && !(spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)) return; + // called from caster 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()) - castTime = 0; - else + case SPELL_DAMAGE_CLASS_NONE: + if (spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) // required double check castTime = int32(float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED)); - } - else if (spellProto->HasAttribute(SPELL_ATTR0_REQ_AMMO) && !spellProto->HasAttribute(SPELL_ATTR2_AUTOREPEAT_FLAG)) + else if (spellInfo->SpellVisual[0] == 3881 && HasAura(67556)) // cooking with Chef Hat. + 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]); - else if (spellProto->SpellVisual[0] == 3881 && HasAura(67556)) // cooking with Chef Hat. - castTime = 500; + break; + default: + break; + } } DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index a72675b7c8..255283c611 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -3758,6 +3758,7 @@ void Spell::handle_immediate() // Apply duration mod if (Player* modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); + // Apply haste mods 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)); @@ -3780,10 +3781,10 @@ void Spell::handle_immediate() // process immediate effects (items, ground, etc.) also initialize some variables _handle_immediate_phase(); - for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) + for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) DoAllEffectOnTarget(&(*ihit)); - for (std::list<GOTargetInfo>::iterator ihit= m_UniqueGOTargetInfo.begin(); ihit != m_UniqueGOTargetInfo.end(); ++ihit) + for (std::list<GOTargetInfo>::iterator ihit = m_UniqueGOTargetInfo.begin(); ihit != m_UniqueGOTargetInfo.end(); ++ihit) DoAllEffectOnTarget(&(*ihit)); FinishTargetProcessing(); |
