diff --git a/data/sql/updates/pending_db_world/rev_1698419449037051800.sql b/data/sql/updates/pending_db_world/rev_1698419449037051800.sql new file mode 100644 index 000000000..eb59bf86d --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1698419449037051800.sql @@ -0,0 +1,3 @@ +-- Carinda's Scroll of Retribution +DELETE FROM `spell_script_names` WHERE `spell_id`=30077 AND `ScriptName` = 'spell_item_scroll_of_retribution'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (30077, 'spell_item_scroll_of_retribution'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 41adace29..f6adc09be 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -3948,6 +3948,31 @@ class spell_item_venomhide_feed : public SpellScript } }; +// 30077 - Carinda's Scroll of Retribution +enum ScrollOfRetribution +{ + NPC_VIERA_SUNWHISPER = 17226 +}; + +class spell_item_scroll_of_retribution : public SpellScript +{ + PrepareSpellScript(spell_item_scroll_of_retribution) + + SpellCastResult CheckCast() + { + if (Unit* target = GetExplTargetUnit()) + if (target->GetEntry() == NPC_VIERA_SUNWHISPER) + return SPELL_CAST_OK; + + return SPELL_FAILED_BAD_TARGETS; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_item_scroll_of_retribution::CheckCast); + } +}; + void AddSC_item_spell_scripts() { RegisterSpellScript(spell_item_massive_seaforium_charge); @@ -4069,4 +4094,5 @@ void AddSC_item_spell_scripts() RegisterSpellScript(spell_item_elixir_of_shadows); RegisterSpellScript(spell_item_worn_troll_dice); RegisterSpellScript(spell_item_venomhide_feed); + RegisterSpellScript(spell_item_scroll_of_retribution); }