diff --git a/data/sql/updates/pending_db_world/rev_1658567599833438900.sql b/data/sql/updates/pending_db_world/rev_1658567599833438900.sql new file mode 100644 index 000000000..22331dacc --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658567599833438900.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id`=56246; +INSERT INTO `spell_script_names` VALUES +(56246,'spell_warl_glyph_of_felguard'); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index dccb099bd..79ea17ede 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1154,7 +1154,9 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) { // xinef: Glyph of Felguard, so ugly im crying... no appropriate spell if (AuraEffect* aurEff = owner->GetAuraEffectDummy(SPELL_GLYPH_OF_FELGUARD)) - SetModifierValue(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, 1.0f + float(aurEff->GetAmount() / 100.0f)); + { + HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, aurEff->GetAmount(), true); + } break; } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index cfa787420..82a3e5e99 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -21,6 +21,7 @@ * Scriptnames of files in this file should be prefixed with "spell_warl_". */ +#include "Pet.h" #include "Player.h" #include "ScriptMgr.h" #include "SpellAuraEffects.h" @@ -1229,6 +1230,45 @@ class spell_warl_shadowburn : public AuraScript } }; +class spell_warl_glyph_of_felguard : public AuraScript +{ + PrepareAuraScript(spell_warl_glyph_of_felguard); + + void HandleApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Player* player = GetCaster()->ToPlayer()) + { + if (Pet* pet = player->GetPet()) + { + if (pet->GetEntry() == NPC_FELGUARD) + { + pet->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, aurEff->GetAmount(), true); + } + } + } + } + + void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Player* player = GetCaster()->ToPlayer()) + { + if (Pet* pet = player->GetPet()) + { + if (pet->GetEntry() == NPC_FELGUARD) + { + pet->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, aurEff->GetAmount(), false); + } + } + } + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_warl_glyph_of_felguard::HandleApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_warl_glyph_of_felguard::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } +}; + void AddSC_warlock_spell_scripts() { RegisterSpellScript(spell_warl_eye_of_kilrogg); @@ -1260,4 +1300,5 @@ void AddSC_warlock_spell_scripts() RegisterSpellScript(spell_warl_unstable_affliction); RegisterSpellScript(spell_warl_drain_soul); RegisterSpellScript(spell_warl_shadowburn); + RegisterSpellScript(spell_warl_glyph_of_felguard); }