diff options
-rw-r--r-- | sql/updates/world/3.3.5/2022_03_07_01_world.sql | 32 | ||||
-rw-r--r-- | src/server/scripts/Outland/zone_terokkar_forest.cpp | 117 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 34 |
3 files changed, 128 insertions, 55 deletions
diff --git a/sql/updates/world/3.3.5/2022_03_07_01_world.sql b/sql/updates/world/3.3.5/2022_03_07_01_world.sql new file mode 100644 index 00000000000..3bc24471f24 --- /dev/null +++ b/sql/updates/world/3.3.5/2022_03_07_01_world.sql @@ -0,0 +1,32 @@ +-- From 2.0.12 DBC +UPDATE `spell_dbc` SET `Attributes` = 384, `AttributesEx2` = 128, `ProcChance` = 101, `RangeIndex` = 12, `Effect1` = 77, `EffectImplicitTargetA1` = 25, `SpellName` = 'Cancel Shadowy Disguise', `DmgMultiplier1` = 1 WHERE `Id` = 32780; + +UPDATE `spell_script_names` SET `ScriptName` = 'spell_terokkar_free_webbed' WHERE `ScriptName` = 'spell_free_webbed_terokkar'; +UPDATE `spell_script_names` SET `ScriptName` = 'spell_terokkar_free_webbed_on_quest' WHERE `ScriptName` = 'spell_free_webbed_terokkar_on_quest'; +UPDATE `spell_script_names` SET `ScriptName` = 'spell_terokkar_shadowy_disguise_cast_from_questgiver' WHERE `ScriptName` = 'spell_q10041_q10040_who_are_they'; + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_terokkar_shadowy_disguise','spell_terokkar_cancel_shadowy_disguise'); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(32756,'spell_terokkar_shadowy_disguise'), +(32780,'spell_terokkar_cancel_shadowy_disguise'); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = -32756; + +UPDATE `quest_template_addon` SET `SourceSpellID` = 0 WHERE `ID` IN (10040,10041); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18714,18715) AND `source_type` = 0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(18714,0,0,0,19,0,100,0,10041,0,0,0,0,11,48917,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Scout Neftis - On Quest 'Who Are They?' Taken - Cast 'Who Are They: Cast from Questgiver'"), +(18714,0,1,2,62,0,100,0,7772,0,0,0,0,11,48917,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Scout Neftis - On Gossip Option 0 Selected - Cast 'Who Are They: Cast from Questgiver'"), +(18714,0,2,0,61,0,100,0,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Scout Neftis - On Gossip Option 0 Selected - Close Gossip"), + +(18715,0,0,0,19,0,100,0,10040,0,0,0,0,11,48917,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Private Weeks - On Quest 'Who Are They?' Taken - Cast 'Who Are They: Cast from Questgiver'"), +(18715,0,1,2,62,0,100,0,7771,0,0,0,0,11,48917,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Private Weeks - On Gossip Option 0 Selected - Cast 'Who Are They: Cast from Questgiver'"), +(18715,0,2,0,61,0,100,0,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Private Weeks - On Gossip Option 0 Selected - Close Gossip"); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` IN (7771,7772); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,7771,0,0,0,47,0,10040,10,0,0,0,0,'',"Group 0: Show Gossip Option 0 if player has taken quest 'Who Are They?'"), +(15,7771,0,0,0,1,0,32756,0,0,1,0,0,"","Group 0: Show Gossip Option 0 if player does not have aura 'Shadowy Disguise'"), +(15,7772,0,0,0,47,0,10041,10,0,0,0,0,'',"Group 0: Show Gossip Option 0 if player has taken quest 'Who Are They?'"), +(15,7772,0,0,0,1,0,32756,0,0,1,0,0,"","Group 0: Show Gossip Option 0 if player does not have aura 'Shadowy Disguise'"); diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index d654a5139b0..985e0105341 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -15,17 +15,6 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Terokkar_Forest -SD%Complete: 85 -SDComment: Quest support: 9889 -SDCategory: Terokkar Forest -EndScriptData */ - -/* ContentData -npc_unkor_the_ruthless -EndContentData */ - #include "ScriptMgr.h" #include "GameObject.h" #include "Group.h" @@ -181,7 +170,7 @@ class spell_skyguard_flare : public SpellScript ## Quest 10873: Taken in the Night ######*/ -enum FreeWebbedTerokkar +enum TakenInTheNight { SPELL_FREE_WEBBED_1 = 38953, SPELL_FREE_WEBBED_2 = 38955, @@ -191,15 +180,15 @@ enum FreeWebbedTerokkar SPELL_FREE_WEBBED_6 = 38978 }; -uint32 const CocoonSummonSpells[5] = +std::array<uint32, 5> const CocoonSummonSpells = { SPELL_FREE_WEBBED_1, SPELL_FREE_WEBBED_2, SPELL_FREE_WEBBED_3, SPELL_FREE_WEBBED_4, SPELL_FREE_WEBBED_5 }; // 38949 - Terrokar Free Webbed Creature -class spell_free_webbed_terokkar : public SpellScript +class spell_terokkar_free_webbed : public SpellScript { - PrepareSpellScript(spell_free_webbed_terokkar); + PrepareSpellScript(spell_terokkar_free_webbed); bool Validate(SpellInfo const* /*spellInfo*/) override { @@ -213,14 +202,14 @@ class spell_free_webbed_terokkar : public SpellScript void Register() override { - OnEffectHit += SpellEffectFn(spell_free_webbed_terokkar::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHit += SpellEffectFn(spell_terokkar_free_webbed::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; // 38950 - Terokkar Free Webbed Creature ON QUEST -class spell_free_webbed_terokkar_on_quest : public SpellScript +class spell_terokkar_free_webbed_on_quest : public SpellScript { - PrepareSpellScript(spell_free_webbed_terokkar_on_quest); + PrepareSpellScript(spell_terokkar_free_webbed_on_quest); bool Validate(SpellInfo const* /*spellInfo*/) override { @@ -240,7 +229,90 @@ class spell_free_webbed_terokkar_on_quest : public SpellScript void Register() override { - OnEffectHitTarget += SpellEffectFn(spell_free_webbed_terokkar_on_quest::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_terokkar_free_webbed_on_quest::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +/*###### +## Quest 10040 & 10041: Who Are They? +######*/ + +enum WhoAreThey +{ + SPELL_SHADOWY_DISGUISE = 32756, + SPELL_MALE_SHADOWY_DISGUISE = 38080, + SPELL_FEMALE_SHADOWY_DISGUISE = 38081 +}; + +// 48917 - Who Are They: Cast from Questgiver +class spell_terokkar_shadowy_disguise_cast_from_questgiver : public SpellScript +{ + PrepareSpellScript(spell_terokkar_shadowy_disguise_cast_from_questgiver); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SHADOWY_DISGUISE }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_SHADOWY_DISGUISE); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_terokkar_shadowy_disguise_cast_from_questgiver::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 32756 - Shadowy Disguise +class spell_terokkar_shadowy_disguise : public AuraScript +{ + PrepareAuraScript(spell_terokkar_shadowy_disguise); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MALE_SHADOWY_DISGUISE, SPELL_FEMALE_SHADOWY_DISGUISE }); + } + + void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Player* target = GetTarget()->ToPlayer()) + target->CastSpell(target, target->GetNativeGender() == GENDER_MALE ? SPELL_MALE_SHADOWY_DISGUISE : SPELL_FEMALE_SHADOWY_DISGUISE); + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->RemoveAurasDueToSpell(SPELL_MALE_SHADOWY_DISGUISE); + target->RemoveAurasDueToSpell(SPELL_FEMALE_SHADOWY_DISGUISE); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_terokkar_shadowy_disguise::AfterApply, EFFECT_0, SPELL_AURA_FORCE_REACTION, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectApplyFn(spell_terokkar_shadowy_disguise::AfterRemove, EFFECT_0, SPELL_AURA_FORCE_REACTION, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 32780 - Cancel Shadowy Disguise +class spell_terokkar_cancel_shadowy_disguise : public SpellScript +{ + PrepareSpellScript(spell_terokkar_cancel_shadowy_disguise); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SHADOWY_DISGUISE }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->RemoveAurasDueToSpell(SPELL_SHADOWY_DISGUISE); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_terokkar_cancel_shadowy_disguise::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -248,6 +320,9 @@ void AddSC_terokkar_forest() { new npc_unkor_the_ruthless(); RegisterSpellScript(spell_skyguard_flare); - RegisterSpellScript(spell_free_webbed_terokkar); - RegisterSpellScript(spell_free_webbed_terokkar_on_quest); + RegisterSpellScript(spell_terokkar_free_webbed); + RegisterSpellScript(spell_terokkar_free_webbed_on_quest); + RegisterSpellScript(spell_terokkar_shadowy_disguise_cast_from_questgiver); + RegisterSpellScript(spell_terokkar_shadowy_disguise); + RegisterSpellScript(spell_terokkar_cancel_shadowy_disguise); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 3f34a008845..71c9589438c 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -587,39 +587,6 @@ class spell_q12851_going_bearback : public AuraScript } }; -enum Whoarethey -{ - SPELL_MALE_DISGUISE = 38080, - SPELL_FEMALE_DISGUISE = 38081, - SPELL_GENERIC_DISGUISE = 32756 -}; - -// 48917 - Who Are They: Cast from Questgiver -class spell_q10041_q10040_who_are_they : public SpellScript -{ - PrepareSpellScript(spell_q10041_q10040_who_are_they); - - bool Validate(SpellInfo const* /*spellEntry*/) override - { - return ValidateSpellInfo({ SPELL_MALE_DISGUISE, SPELL_FEMALE_DISGUISE, SPELL_GENERIC_DISGUISE }); - } - - void HandleScript(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - if (Player* target = GetHitPlayer()) - { - target->CastSpell(target, target->GetNativeGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true); - target->CastSpell(target, SPELL_GENERIC_DISGUISE, true); - } - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q10041_q10040_who_are_they::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } -}; - // http://www.wowhead.com/quest=12659 Scalps! enum Quest12659Data { @@ -2081,7 +2048,6 @@ void AddSC_quest_spell_scripts() RegisterSpellScript(spell_q12459_seeds_of_natures_wrath); RegisterSpellScript(spell_q12634_despawn_fruit_tosser); RegisterSpellScript(spell_q12851_going_bearback); - RegisterSpellScript(spell_q10041_q10040_who_are_they); RegisterSpellScript(spell_q12659_ahunaes_knife); RegisterSpellScript(spell_q9874_liquid_fire); RegisterSpellScript(spell_q12805_lifeblood_dummy); |