aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnubisss <none@none>2010-05-14 14:32:43 +0200
committerAnubisss <none@none>2010-05-14 14:32:43 +0200
commit2425edfdab85e6c24978c679b1803cd4cf796f80 (patch)
tree83517268c46f273cf730891e24365015c944e9e0 /src
parent98a5c09af038798f196d7283a4112bc69d27462f (diff)
Fix Glyph of Shred.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellEffects.cpp19
-rw-r--r--src/game/Unit.cpp27
2 files changed, 25 insertions, 21 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 5b42998ddfe..bfc858809e5 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -4937,25 +4937,6 @@ void Spell::EffectScriptEffect(uint32 effIndex)
}
return;
}
- // Glyph of Shred
- case 63974:
- {
- if (AuraEffect const * aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE,SPELLFAMILY_DRUID,0x00800000,0,0,m_caster->GetGUID()))
- {
- uint32 countMin = aurEff->GetBase()->GetMaxDuration();
- uint32 countMax = 20000;
- countMax += m_caster->HasAura(54818) ? 4000 : 0;
- countMax += m_caster->HasAura(60141) ? 4000 : 0;
-
- if (countMin < countMax)
- {
- aurEff->GetBase()->SetDuration(uint32(aurEff->GetBase()->GetDuration()+3000));
- aurEff->GetBase()->SetMaxDuration(countMin+2000);
- }
-
- }
- return;
- }
// Glyph of Backstab
case 63975:
{
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index da0a9a4ae4c..1bb63a9212b 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -6222,8 +6222,31 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
// Glyph of Shred
case 54815:
{
- triggered_spell_id = 63974;
- break;
+ // try to find spell Rip on the target
+ if (AuraEffect const *AurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00800000, 0x0, 0x0, GetGUID()))
+ {
+ // Rip's max duration, note: spells which modifies Rip's duration also counted like Glyph of Rip
+ uint32 CountMin = AurEff->GetBase()->GetMaxDuration();
+
+ // just Rip's max duration without other spells
+ uint32 CountMax = GetSpellMaxDuration(AurEff->GetSpellProto());
+
+ // add possible auras' and Glyph of Shred's max duration
+ CountMax += 3 * triggerAmount * 1000; // Glyph of Shred -> +6 seconds
+ CountMax += HasAura(54818) ? 4 * 1000 : 0; // Glyph of Rip -> +4 seconds
+ CountMax += HasAura(60141) ? 4 * 1000 : 0; // Rip Duration/Lacerate Damage -> +4 seconds
+
+ // if min < max -> that means caster didn't cast 3 shred yet
+ // so set Rip's duration and max duration
+ if (CountMin < CountMax)
+ {
+ AurEff->GetBase()->SetDuration(AurEff->GetBase()->GetDuration() + triggerAmount * 1000);
+ AurEff->GetBase()->SetMaxDuration(CountMin + triggerAmount * 1000);
+ return true;
+ }
+ }
+ // if not found Rip
+ return false;
}
// Glyph of Rake
case 54821: