aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/VC71/71ScriptDev2.vcproj12
-rw-r--r--src/bindings/scripts/VC80/80ScriptDev2.vcproj12
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj12
-rw-r--r--src/game/Player.cpp2
-rw-r--r--src/game/Spell.cpp2
-rw-r--r--src/game/SpellEffects.cpp4
-rw-r--r--src/game/SpellMgr.cpp15
-rw-r--r--src/game/Unit.cpp33
-rw-r--r--src/game/Unit.h1
9 files changed, 77 insertions, 16 deletions
diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
index e495a0a3656..302d97c9736 100644
--- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
@@ -2051,6 +2051,18 @@
Name="Utgarde Keep">
<Filter
Name="Utgarde Keep">
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_keleseth.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_keep.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\instance_utgarde_keep.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Utgarde Pinnacle">
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index 5dc59e0274d..62fa4d240e6 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -1156,6 +1156,18 @@
Name="Utgarde Keep">
<Filter
Name="Utgarde Keep">
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_keleseth.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_keep.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\instance_utgarde_keep.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Utgarde Pinnacle">
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index 3060ebc2ed6..dfb4b147848 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -849,6 +849,18 @@
<Filter
Name="Utgarde Keep"
>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_keleseth.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_keep.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\instance_utgarde_keep.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Utgarde Pinnacle"
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index d3db16934f7..2ddd89d7b2f 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -7006,7 +7006,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
ApplyFeralAPBonus(feral_bonus, apply);
}
- if(!IsUseEquipedWeapon(slot==EQUIPMENT_SLOT_MAINHAND))
+ if(!IsInFeralForm() || !CanUseAttackType(attType))
return;
if (proto->Delay)
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index cbde7b7023c..8d8f47f6379 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2284,6 +2284,8 @@ void Spell::handle_immediate()
int32 duration = GetSpellDuration(m_spellInfo);
if (duration)
{
+ //apply haste mods
+ m_caster->ModSpellCastTime(m_spellInfo, duration);
// Apply duration mod
if(Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 9bd7a32e498..f67a2bd730f 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2262,6 +2262,10 @@ void Spell::EffectApplyAura(uint32 i)
//apply mods only here, area auras don't have duration
duration = caster->ModSpellDuration(m_spellInfo, i, unitTarget, duration);
+ //mod duration of channeled aura by spell haste
+ if (IsChanneledSpell(m_spellInfo))
+ m_caster->ModSpellCastTime(m_spellInfo, duration);
+
// if Aura removed and deleted, do not continue.
if(duration== 0 && !(Aur->IsPermanent()))
{
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 07f9c781d69..d6e324bdf6f 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -244,19 +244,8 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell)
int32 castTime = spellCastTimeEntry->CastTime;
- if (spell)
- {
- if(Player* modOwner = spell->GetCaster()->GetSpellModOwner())
- modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell);
-
- if( !(spellInfo->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_UNK5)) )
- castTime = int32(castTime * spell->GetCaster()->GetFloatValue(UNIT_MOD_CAST_SPEED));
- else
- {
- if (spell->IsRangedSpell() && !spell->IsAutoRepeat())
- castTime = int32(castTime * spell->GetCaster()->m_modAttackSpeedPct[RANGED_ATTACK]);
- }
- }
+ if (spell && spell->GetCaster())
+ spell->GetCaster()->ModSpellCastTime(spellInfo, castTime);
if (spellInfo->Attributes & SPELL_ATTR_RANGED && (!spell || !(spell->IsAutoRepeat())))
castTime += 500;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 2e20be37844..42334a817ae 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -8126,12 +8126,17 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
else if (DoneAdvertisedBenefit || TakenAdvertisedBenefit)
{
// Damage Done from spell damage bonus
- uint32 CastingTime = !IsChanneledSpell(spellProto) ? GetSpellCastTime(spellProto) : GetSpellDuration(spellProto);
+ int32 CastingTime = !IsChanneledSpell(spellProto) ? GetSpellCastTime(spellProto) : GetSpellDuration(spellProto);
+ if (IsChanneledSpell(spellProto))
+ ModSpellCastTime(spellProto, CastingTime);
// Damage over Time spells bonus calculation
float DotFactor = 1.0f;
if(damagetype == DOT)
{
int32 DotDuration = GetSpellDuration(spellProto);
+ //apply casting time mods for channeled spells
+ if (IsChanneledSpell(spellProto))
+ ModSpellCastTime(spellProto, DotDuration);
// 200% limit
if(DotDuration > 0)
{
@@ -8614,12 +8619,17 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
else if (DoneAdvertisedBenefit || TakenAdvertisedBenefit)
{
// Damage Done from spell damage bonus
- uint32 CastingTime = !IsChanneledSpell(spellProto) ? GetSpellCastTime(spellProto) : GetSpellDuration(spellProto);
+ int32 CastingTime = !IsChanneledSpell(spellProto) ? GetSpellCastTime(spellProto) : GetSpellDuration(spellProto);
+ if (IsChanneledSpell(spellProto))
+ ModSpellCastTime(spellProto, CastingTime);
// Damage over Time spells bonus calculation
float DotFactor = 1.0f;
if(damagetype == DOT)
{
int32 DotDuration = GetSpellDuration(spellProto);
+ //apply casting time mods for channeled spells
+ if (IsChanneledSpell(spellProto))
+ ModSpellCastTime(spellProto, DotDuration);
// 200% limit
if(DotDuration > 0)
{
@@ -10084,6 +10094,23 @@ int32 Unit::ModSpellDuration(SpellEntry const* spellProto, uint8 effect_index, U
return duration>0 ? duration : 0;
}
+void Unit::ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime)
+{
+ if (!spellProto || castTime<0)
+ return;
+ //called from caster
+ if(Player* modOwner = GetSpellModOwner())
+ modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CASTING_TIME, castTime);
+
+ if( !(spellProto->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_UNK5)) )
+ castTime = float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED);
+ else
+ {
+ if (spellProto->Attributes & SPELL_ATTR_RANGED && !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG))
+ castTime = float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK];
+ }
+}
+
DiminishingLevels Unit::GetDiminishing(DiminishingGroup group)
{
for(Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i)
@@ -11586,6 +11613,8 @@ uint32 Unit::GetCastingTimeForBonus( SpellEntry const *spellProto, DamageEffectT
case SPELL_AURA_PERIODIC_LEECH:
if ( GetSpellDuration(spellProto) )
overTime = GetSpellDuration(spellProto);
+ if (IsChanneledSpell(spellProto))
+ ModSpellCastTime(spellProto, overTime);
break;
default:
// -5% per additional effect
diff --git a/src/game/Unit.h b/src/game/Unit.h
index bf061bdf4d0..eb8041dd672 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1453,6 +1453,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
int32 CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_index, int32 basePoints, Unit const* target);
int32 CalcSpellDuration(SpellEntry const* spellProto);
int32 ModSpellDuration(SpellEntry const* spellProto, uint8 effect_index, Unit const* target, int32 duration);
+ void ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime);
float CalculateLevelPenalty(SpellEntry const* spellProto) const;
void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); }