Skip to content

Instantly share code, notes, and snippets.

@SeTM
Created May 21, 2011 18:16
Show Gist options
  • Save SeTM/984743 to your computer and use it in GitHub Desktop.
Save SeTM/984743 to your computer and use it in GitHub Desktop.
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 8d2e26f..ad17048 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12333,7 +12333,7 @@ void Unit::SetVehicleId(uint32 entry)
}
}
-uint32 Unit::CalculateAuraPeriodicTimeWithHaste(SpellEntry const* spellProto, uint32 oldPeriodicTime, SpellEffectIndex eff_idx)
+uint32 Unit::CalculateAuraPeriodicTimeWithHaste(SpellEntry const* spellProto, uint32 oldPeriodicTime)
{
if (!spellProto || oldPeriodicTime == 0)
return 0;
@@ -12356,14 +12356,9 @@ uint32 Unit::CalculateAuraPeriodicTimeWithHaste(SpellEntry const* spellProto, ui
if (!applyHaste)
return oldPeriodicTime;
- uint32 _periodicTime = oldPeriodicTime;
+ oldPeriodicTime = ceil(float(oldPeriodicTime) * GetFloatValue(UNIT_MOD_CAST_SPEED));
- if(IsChanneledSpell(spellProto) && spellProto->EffectAmplitude[eff_idx])
- _periodicTime = ceil(float(spellProto->EffectAmplitude[eff_idx]) * GetFloatValue(UNIT_MOD_CAST_SPEED));
- else
- _periodicTime = ceil(float(oldPeriodicTime) * GetFloatValue(UNIT_MOD_CAST_SPEED));
-
- return _periodicTime;
+ return oldPeriodicTime;
}
uint32 Unit::CalculateSpellDurationWithHaste(SpellEntry const* spellProto, uint32 oldduration)
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 929b136..6b9e84a 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1964,7 +1964,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
uint32 CalcNotIgnoreAbsorbDamage( uint32 damage, SpellSchoolMask damageSchoolMask, SpellEntry const* spellInfo = NULL);
uint32 CalcNotIgnoreDamageRedunction( uint32 damage, SpellSchoolMask damageSchoolMask);
int32 CalculateAuraDuration(SpellEntry const* spellProto, uint32 effectMask, int32 duration, Unit const* caster);
- uint32 CalculateAuraPeriodicTimeWithHaste(SpellEntry const* spellProto, uint32 periodicTime, SpellEffectIndex eff_idx);
+ uint32 CalculateAuraPeriodicTimeWithHaste(SpellEntry const* spellProto, uint32 periodicTime);
uint32 CalculateSpellDurationWithHaste(SpellEntry const* spellProto, uint32 duration);
float CalculateLevelPenalty(SpellEntry const* spellProto) const;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment