diff --git a/data/sql/updates/pending_db_world/rev_1689813586760998100.sql b/data/sql/updates/pending_db_world/rev_1689813586760998100.sql new file mode 100644 index 000000000..8cceb40b7 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1689813586760998100.sql @@ -0,0 +1,8 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_q10651_q10692_book_of_fel_names'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(36298, 'spell_q10651_q10692_book_of_fel_names'); + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 17) AND (`SourceGroup` = 0) AND (`SourceEntry` = 37906) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 31) AND (`ConditionTarget` = 1) AND (`ConditionValue1` = 3) AND (`ConditionValue2` = 21178) AND (`ConditionValue3` = 0); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 37906, 0, 0, 31, 1, 3, 21178, 0, 0, 0, 0, '', 'Book of Fel Names can only target Varedis'); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index c42d4e84d..10a1a417c 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2451,6 +2451,26 @@ class spell_q4735_collect_rookery_egg : public SpellScript } }; +enum book +{ + SPELL_METAMORPHOSIS = 36298 +}; + +class spell_q10651_q10692_book_of_fel_names : public SpellScript +{ + PrepareSpellScript(spell_q10651_q10692_book_of_fel_names); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->RemoveAurasDueToSpell(SPELL_METAMORPHOSIS); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q10651_q10692_book_of_fel_names::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_quest_spell_scripts() { RegisterSpellAndAuraScriptPair(spell_q11065_wrangle_some_aether_rays, spell_q11065_wrangle_some_aether_rays_aura); @@ -2522,4 +2542,5 @@ void AddSC_quest_spell_scripts() RegisterSpellScript(spell_q12919_gymers_throw); RegisterSpellScript(spell_q5056_summon_shy_rotam); RegisterSpellScript(spell_q4735_collect_rookery_egg); + RegisterSpellScript(spell_q10651_q10692_book_of_fel_names); }