Skip to content

Commit

Permalink
Rogue: Implement missing glyphs
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Jan 12, 2024
1 parent 3b1dfe0 commit 57d8938
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 13 deletions.
18 changes: 17 additions & 1 deletion sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,23 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(51688,'spell_prey_on_the_weak'),
(51689,'spell_prey_on_the_weak'),
(31130,'spell_nerves_of_steel'),
(31131,'spell_nerves_of_steel');
(31131,'spell_nerves_of_steel'),
(58033,'spell_glyph_of_safe_fall'),
(53,'spell_backstab'),
(2589,'spell_backstab'),
(2590,'spell_backstab'),
(2591,'spell_backstab'),
(8721,'spell_backstab'),
(11279,'spell_backstab'),
(11280,'spell_backstab'),
(11281,'spell_backstab'),
(25300,'spell_backstab'),
(26863,'spell_backstab'),
(48656,'spell_backstab'),
(48657,'spell_backstab'),
(2983,'spell_sprint_rogue'),
(8696,'spell_sprint_rogue'),
(11305,'spell_sprint_rogue');

-- Shaman
INSERT INTO spell_scripts(Id, ScriptName) VALUES
Expand Down
55 changes: 54 additions & 1 deletion src/game/Spells/Scripts/Scripting/ClassScripts/Rogue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ struct Preparation : public SpellScript
{
if (spell->GetCaster()->IsPlayer())
{
uint64 mask = uint64(0x0000024000000860);
if (spell->GetCaster()->HasAura(56819)) // Glyph of Preparation
mask |= 0x0010080000000010;
// immediately finishes the cooldown on certain Rogue abilities
auto cdCheck = [](SpellEntry const & spellEntry) -> bool { return (spellEntry.SpellFamilyName == SPELLFAMILY_ROGUE && (spellEntry.SpellFamilyFlags & uint64(0x0000024000000860))); };
auto cdCheck = [](SpellEntry const & spellEntry) -> bool { return (spellEntry.SpellFamilyName == SPELLFAMILY_ROGUE && (spellEntry.SpellFamilyFlags & )); };
static_cast<Player*>(spell->GetCaster())->RemoveSomeCooldown(cdCheck);
}
}
Expand Down Expand Up @@ -306,6 +309,53 @@ struct NervesOfSteel : public AuraScript
}
};

// 58033 - Glyph of Safe Fall
struct GlyphOfSafeFall : public AuraScript
{
void OnApply(Aura* aura, bool apply) const override
{
if (Aura* safeFall = aura->GetTarget()->GetAura(1860, EFFECT_INDEX_0))
safeFall->GetModifier()->m_amount += (apply ? aura->GetAmount() : -aura->GetAmount());
}
};

// 53 - Backstab
struct BackstabRogue : public SpellScript
{
void OnHit(Spell* spell, SpellMissInfo missInfo) const override
{
if (missInfo == SPELL_MISS_NONE)
{
if (Aura* glyphOfBackstab = spell->GetCaster()->GetAura(56800, EFFECT_INDEX_0)) // Glyph of Backstab
{
Unit* target = spell->GetUnitTarget();
if (Aura* rupture = target->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x0, 0x00100000, spell->GetCaster()->GetObjectGuid()))
{
int32 increaseAmount = glyphOfBackstab->GetAmount();
int32 maxIncreaseAmount = spell->GetCaster()->CalculateSpellEffectValue(target, glyphOfBackstab->GetSpellProto(), EFFECT_INDEX_1);
if (rupture->GetScriptValue() >= maxIncreaseAmount)
return;
SpellAuraHolder* holder = rupture->GetHolder();
holder->SetAuraMaxDuration(holder->GetAuraMaxDuration() + increaseAmount);
holder->SetAuraDuration(holder->GetAuraDuration() + increaseAmount);
holder->SendAuraUpdate(false);
rupture->SetScriptValue(rupture->GetScriptValue() + increaseAmount);
}
}
}
}
};

// 2983 - Sprint
struct SprintRogue : public AuraScript
{
void OnApply(Aura* aura, bool apply) const override
{
if (apply && aura->GetTarget()->HasAura(58039)) // Glyph of Blurred Speed
aura->GetTarget()->CastSpell(nullptr, 61922, TRIGGERED_OLD_TRIGGERED);
}
};

void LoadRogueScripts()
{
RegisterSpellScript<Preparation>("spell_preparation");
Expand All @@ -319,4 +369,7 @@ void LoadRogueScripts()
RegisterSpellScript<KillingSpree>("spell_killing_spree");
RegisterSpellScript<PreyOnTheWeak>("spell_prey_on_the_weak");
RegisterSpellScript<NervesOfSteel>("spell_nerves_of_steel");
RegisterSpellScript<GlyphOfSafeFall>("spell_glyph_of_safe_fall");
RegisterSpellScript<BackstabRogue>("spell_backstab");
RegisterSpellScript<SprintRogue>("spell_sprint_rogue");
}
12 changes: 1 addition & 11 deletions src/game/Spells/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10555,17 +10555,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply)
break;
}
case SPELLFAMILY_ROGUE:
// Sprint (skip non player casted spells by category)
if (GetSpellProto()->SpellFamilyFlags & uint64(0x0000000000000040) && GetSpellProto()->Category == 44)
{
if (!apply || m_target->HasAura(58039)) // Glyph of Blurred Speed
boostSpells.push_back(61922); // Sprint (waterwalk)
else
return;
}
else
return;
break;
return;
case SPELLFAMILY_HUNTER:
{
switch (GetId())
Expand Down

0 comments on commit 57d8938

Please sign in to comment.