aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp19
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp73
2 files changed, 71 insertions, 21 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index d7793df36e0..7da64b4ecf9 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -3561,25 +3561,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
{
switch (m_spellInfo->Id)
{
- // Glyph of Backstab
- case 63975:
- {
- // search our Rupture aura on target
- if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x00100000, 0, 0, m_caster->GetGUID()))
- {
- uint32 countMin = aurEff->GetBase()->GetMaxDuration();
- uint32 countMax = 12000; // this can be wrong, duration should be based on combo-points
- countMax += m_caster->HasAura(56801) ? 4000 : 0;
-
- if (countMin < countMax)
- {
- aurEff->GetBase()->SetDuration(uint32(aurEff->GetBase()->GetDuration() + 3000));
- aurEff->GetBase()->SetMaxDuration(countMin + 2000);
- }
-
- }
- return;
- }
// Glyph of Scourge Strike
case 69961:
{
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index 1abb6741e0d..40bb3c8ad42 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -44,7 +44,7 @@ enum RogueSpells
SPELL_ROGUE_HONOR_AMONG_THIEVES = 51698,
SPELL_ROGUE_HONOR_AMONG_THIEVES_PROC = 52916,
SPELL_ROGUE_HONOR_AMONG_THIEVES_2 = 51699,
- SPELL_ROGUE_T10_2P_BONUS = 70804,
+ SPELL_ROGUE_T10_2P_BONUS = 70804
};
// 13877, 33735, (check 51211, 65956) - Blade Flurry
@@ -523,10 +523,11 @@ class spell_rog_prey_on_the_weak : public SpellScriptLoader
};
// -1943 - Rupture
+#define RuptureScriptName "spell_rog_rupture"
class spell_rog_rupture : public SpellScriptLoader
{
public:
- spell_rog_rupture() : SpellScriptLoader("spell_rog_rupture") { }
+ spell_rog_rupture() : SpellScriptLoader(RuptureScriptName) { }
class spell_rog_rupture_AuraScript : public AuraScript
{
@@ -535,6 +536,7 @@ class spell_rog_rupture : public SpellScriptLoader
bool Load() override
{
Unit* caster = GetCaster();
+ BonusDuration = 0;
return caster && caster->GetTypeId() == TYPEID_PLAYER;
}
@@ -562,10 +564,20 @@ class spell_rog_rupture : public SpellScriptLoader
}
}
+ void ResetDuration(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ BonusDuration = 0;
+ }
+
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_rupture_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
+ AfterEffectApply += AuraEffectApplyFn(spell_rog_rupture_AuraScript::ResetDuration, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAPPLY);
}
+
+ public:
+ // For Glyph of Backstab use
+ uint32 BonusDuration;
};
AuraScript* GetAuraScript() const override
@@ -574,6 +586,62 @@ class spell_rog_rupture : public SpellScriptLoader
}
};
+// 63975 - Glyph of Backstab (triggered - serverside)
+class spell_rog_glyph_of_backstab_triggered : public SpellScriptLoader
+{
+ public:
+ spell_rog_glyph_of_backstab_triggered() : SpellScriptLoader("spell_rog_glyph_of_backstab_triggered") { }
+
+ class spell_rog_glyph_of_backstab_triggered_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_rog_glyph_of_backstab_triggered_SpellScript);
+
+ typedef spell_rog_rupture::spell_rog_rupture_AuraScript RuptureAuraScript;
+
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+
+ Unit* caster = GetCaster();
+ // search our Rupture aura on target
+ if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x00100000, 0, 0, caster->GetGUID()))
+ {
+ RuptureAuraScript* ruptureAuraScript = dynamic_cast<RuptureAuraScript*>(aurEff->GetBase()->GetScriptByName(RuptureScriptName));
+ if (!ruptureAuraScript)
+ return;
+
+ uint32& bonusDuration = ruptureAuraScript->BonusDuration;
+
+ // already includes duration mod from Glyph of Rupture
+ uint32 countMin = aurEff->GetBase()->GetMaxDuration();
+ uint32 countMax = countMin - bonusDuration;
+
+ // this glyph
+ countMax += 6000;
+
+ if (countMin < countMax)
+ {
+ bonusDuration += 2000;
+
+ aurEff->GetBase()->SetDuration(aurEff->GetBase()->GetDuration() + 2000);
+ aurEff->GetBase()->SetMaxDuration(countMin + 2000);
+ }
+
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_rog_glyph_of_backstab_triggered_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_rog_glyph_of_backstab_triggered_SpellScript();
+ }
+};
+
// 5938 - Shiv
class spell_rog_shiv : public SpellScriptLoader
{
@@ -888,6 +956,7 @@ void AddSC_rogue_spell_scripts()
new spell_rog_preparation();
new spell_rog_prey_on_the_weak();
new spell_rog_rupture();
+ new spell_rog_glyph_of_backstab_triggered();
new spell_rog_shiv();
new spell_rog_tricks_of_the_trade();
new spell_rog_tricks_of_the_trade_proc();