From ea82506a25162fbccd8fe789481e22da99b3ef7c Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Wed, 12 Apr 2023 11:45:09 +0300 Subject: [PATCH 1/6] fix(Scripts/Netherstorm): Remove hardcode from zone_netherstorm. (#15805) * fix(Scripts/Core): Remove hardcode from zone_netherstorm. * gcc * double insert -.- --- .../rev_1680530349711913600.sql | 17 ++++ .../scripts/Outland/zone_netherstorm.cpp | 77 ++----------------- 2 files changed, 25 insertions(+), 69 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1680530349711913600.sql diff --git a/data/sql/updates/pending_db_world/rev_1680530349711913600.sql b/data/sql/updates/pending_db_world/rev_1680530349711913600.sql new file mode 100644 index 000000000..6ac468825 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1680530349711913600.sql @@ -0,0 +1,17 @@ +-- ID 20985 (Captain Saeed) +DELETE FROM `gossip_menu_option` WHERE `MenuID` = 8228; +INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES +(8228, 0, 0, 'I am that fleshling, Saeed. Let\'s go!', 18639, 0, 1, 0, 0, 0, 0, '', 0, 0), +(8228, 1, 0, 'I am ready. Let\'s make history!', 18641, 0, 1, 0, 0, 0, 0, '', 0, 0); + +-- ID 20907 (Professor Dabiri) +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 20907; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 20907); +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 +(20907, 0, 0, 1, 62, 0, 100, 0, 8207, 0, 0, 0, 0, 85, 35780, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Professor Dabiri - On Gossip Option 0 Selected - Invoker Cast \'Summon Phase Disruptor\''), +(20907, 0, 1, 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, 'Professor Dabiri - On Gossip Option 0 Selected - Close Gossip'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8207; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 8207, 0, 0, 0, 2, 0, 29778, 1, 0, 1, 0, 0, '', '(AND) Professor Dabiri - Show gossip option 0 if item 29778 is NOT in inventory.'), +(15, 8207, 0, 0, 0, 47, 0, 10438, 10, 0, 0, 0, 0, '', '(AND) Professor Dabiri - Show gossip option 0 if quest 10438 is complete or incomplete.'); diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index 06526c199..2f615ec50 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -15,20 +15,6 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Netherstorm -SD%Complete: 80 -SDComment: Quest support: 10337, 10438, 10652 (special flight paths), 10198, 10191 -SDCategory: Netherstorm -EndScriptData */ - -/* ContentData -npc_commander_dawnforge -npc_bessy -npc_maxx_a_million -go_captain_tyralius_prison -EndContentData */ - #include "GameObjectAI.h" #include "Player.h" #include "ScriptMgr.h" @@ -59,7 +45,11 @@ enum saeed QUEST_DIMENSIUS_DEVOURING = 10439, - SPELL_DIMENSIUS_TRANSFORM = 35939 + SPELL_DIMENSIUS_TRANSFORM = 35939, + + GOSSIP_MENU_SAEED = 8228, + TEXT_NPC_SAEED_DEFAULT = 10229, + TEXT_NPC_SAEED_START_FIGHT = 10232, }; class npc_captain_saeed : public CreatureScript @@ -280,12 +270,12 @@ public: if (player->GetQuestStatus(QUEST_DIMENSIUS_DEVOURING) == QUEST_STATUS_INCOMPLETE) { if (!creature->AI()->GetData(1)) - AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Let's move out.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + AddGossipItemFor(player, GOSSIP_MENU_SAEED, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); else - AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Let's start the battle.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + AddGossipItemFor(player, GOSSIP_MENU_SAEED, 1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); } - SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID()); + SendGossipMenuFor(player, creature->AI()->GetData(1) ? TEXT_NPC_SAEED_START_FIGHT : TEXT_NPC_SAEED_DEFAULT, creature->GetGUID()); return true; } @@ -587,56 +577,6 @@ public: } }; -/*###### -## npc_professor_dabiri -######*/ -enum ProfessorDabiriData -{ - SPELL_PHASE_DISTRUPTOR = 35780, - - //WHISPER_DABIRI = 0, not existing in database - - QUEST_DIMENSIUS = 10439, - QUEST_ON_NETHERY_WINGS = 10438, -}; - -#define GOSSIP_ITEM "I need a new phase distruptor, Professor" - -class npc_professor_dabiri : public CreatureScript -{ -public: - npc_professor_dabiri() : CreatureScript("npc_professor_dabiri") { } - - //OnQuestAccept: - //if (quest->GetQuestId() == QUEST_DIMENSIUS) - //creature->AI()->Talk(WHISPER_DABIRI, player); - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - ClearGossipMenuFor(player); - if (action == GOSSIP_ACTION_INFO_DEF + 1) - { - creature->CastSpell(player, SPELL_PHASE_DISTRUPTOR, false); - CloseGossipMenuFor(player); - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778)) - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - /*###### ## npc_phase_hunter ######*/ @@ -979,7 +919,6 @@ void AddSC_netherstorm() // Theirs new npc_commander_dawnforge(); new at_commander_dawnforge(); - new npc_professor_dabiri(); new npc_phase_hunter(); new npc_bessy(); new npc_maxx_a_million_escort(); From ce6ca597b54e64f328cacddae5f003cdc41a343d Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 12 Apr 2023 08:47:40 +0000 Subject: [PATCH 2/6] chore(DB): import pending files Referenced commit(s): ea82506a25162fbccd8fe789481e22da99b3ef7c --- .../rev_1680530349711913600.sql => db_world/2023_04_12_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1680530349711913600.sql => db_world/2023_04_12_00.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1680530349711913600.sql b/data/sql/updates/db_world/2023_04_12_00.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1680530349711913600.sql rename to data/sql/updates/db_world/2023_04_12_00.sql index 6ac468825..3c7e6d5a4 100644 --- a/data/sql/updates/pending_db_world/rev_1680530349711913600.sql +++ b/data/sql/updates/db_world/2023_04_12_00.sql @@ -1,3 +1,4 @@ +-- DB update 2023_04_09_12 -> 2023_04_12_00 -- ID 20985 (Captain Saeed) DELETE FROM `gossip_menu_option` WHERE `MenuID` = 8228; INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES From a8a3011278487f1e10017d082ceaa3f44a4e69b8 Mon Sep 17 00:00:00 2001 From: Timothy Vaccarelli Date: Wed, 12 Apr 2023 07:07:00 -0400 Subject: [PATCH 3/6] fix(Script/Spell): Fix animal blood pool effect and position (#15918) Adapted from TC Commits 3ddc6e70df0401a0677bef536e6b0e46e3dbf9e9 and cc3293c0023b36434747190103a1f0ffee0f8488 Co-authored-by: sirikfoll Co-authored-by: Rushor --- .../rev_1681232229972193910.sql | 5 ++++ src/server/scripts/Spells/spell_generic.cpp | 25 +++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1681232229972193910.sql diff --git a/data/sql/updates/pending_db_world/rev_1681232229972193910.sql b/data/sql/updates/pending_db_world/rev_1681232229972193910.sql new file mode 100644 index 000000000..6ff94cfb7 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1681232229972193910.sql @@ -0,0 +1,5 @@ +-- Add spell script to database for 63471 - Spawn Blood Pool +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_spawn_blood_pool'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(63471, 'spell_spawn_blood_pool'); + diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index ac326f538..e4acbc9a1 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2030,8 +2030,7 @@ class spell_gen_animal_blood : public AuraScript { if (Unit* owner = GetUnitOwner()) { - if (owner->IsInWater()) - owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true); + owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true); } } @@ -2042,6 +2041,27 @@ class spell_gen_animal_blood : public AuraScript } }; +// 63471 - Spawn Blood Pool +class spell_spawn_blood_pool : public SpellScript +{ + PrepareSpellScript(spell_spawn_blood_pool); + + void SetDest(SpellDestination &dest) + { + Unit* caster = GetCaster(); + LiquidData liquidStatus = caster->GetMap()->GetLiquidData(caster->GetPhaseMask(), caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), caster->GetCollisionHeight(), MAP_ALL_LIQUIDS); + + float level = liquidStatus.Level > INVALID_HEIGHT ? liquidStatus.Level : caster->GetPositionZ(); + Position pos = Position(caster->GetPositionX(), caster->GetPositionY(), level, caster->GetOrientation()); + dest.Relocate(pos); + } + + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_spawn_blood_pool::SetDest, EFFECT_0, TARGET_DEST_CASTER); + } +}; + enum DivineStormSpell { SPELL_DIVINE_STORM = 53385, @@ -4893,6 +4913,7 @@ void AddSC_generic_spell_scripts() RegisterSpellScript(spell_gen_feign_death_no_prevent_emotes); RegisterSpellScript(spell_pvp_trinket_wotf_shared_cd); RegisterSpellScript(spell_gen_animal_blood); + RegisterSpellScript(spell_spawn_blood_pool); RegisterSpellScript(spell_gen_divine_storm_cd_reset); RegisterSpellScript(spell_gen_profession_research); RegisterSpellScript(spell_gen_clone); From 51380d377db3401feb7804b93659cac2d8be6c42 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 12 Apr 2023 11:09:43 +0000 Subject: [PATCH 4/6] chore(DB): import pending files Referenced commit(s): a8a3011278487f1e10017d082ceaa3f44a4e69b8 --- .../rev_1681232229972193910.sql => db_world/2023_04_12_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1681232229972193910.sql => db_world/2023_04_12_01.sql} (84%) diff --git a/data/sql/updates/pending_db_world/rev_1681232229972193910.sql b/data/sql/updates/db_world/2023_04_12_01.sql similarity index 84% rename from data/sql/updates/pending_db_world/rev_1681232229972193910.sql rename to data/sql/updates/db_world/2023_04_12_01.sql index 6ff94cfb7..4e181ac94 100644 --- a/data/sql/updates/pending_db_world/rev_1681232229972193910.sql +++ b/data/sql/updates/db_world/2023_04_12_01.sql @@ -1,3 +1,4 @@ +-- DB update 2023_04_12_00 -> 2023_04_12_01 -- Add spell script to database for 63471 - Spawn Blood Pool DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_spawn_blood_pool'; INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES From 625c5e2bc57cb478d843182aa5e91e4b5ca4683e Mon Sep 17 00:00:00 2001 From: Tereneckla <50233983+Tereneckla@users.noreply.github.com> Date: Wed, 12 Apr 2023 12:29:23 +0000 Subject: [PATCH 5/6] fix(DB/Loot) Remove Netherweave Tunic drop (#15923) * Create rev_1681299606259817200.sql * Style --- data/sql/updates/pending_db_world/rev_1681299606259817200.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/sql/updates/pending_db_world/rev_1681299606259817200.sql diff --git a/data/sql/updates/pending_db_world/rev_1681299606259817200.sql b/data/sql/updates/pending_db_world/rev_1681299606259817200.sql new file mode 100644 index 000000000..c61772f9e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1681299606259817200.sql @@ -0,0 +1 @@ +DELETE FROM `creature_loot_template` WHERE `Item` = 21855 AND `Entry` IN (17796,20630); From 539801377fb96f2c3377e051fa9264315501fd1e Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 12 Apr 2023 12:31:56 +0000 Subject: [PATCH 6/6] chore(DB): import pending files Referenced commit(s): 625c5e2bc57cb478d843182aa5e91e4b5ca4683e --- .../rev_1681299606259817200.sql => db_world/2023_04_12_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1681299606259817200.sql => db_world/2023_04_12_02.sql} (66%) diff --git a/data/sql/updates/pending_db_world/rev_1681299606259817200.sql b/data/sql/updates/db_world/2023_04_12_02.sql similarity index 66% rename from data/sql/updates/pending_db_world/rev_1681299606259817200.sql rename to data/sql/updates/db_world/2023_04_12_02.sql index c61772f9e..8e223d5b9 100644 --- a/data/sql/updates/pending_db_world/rev_1681299606259817200.sql +++ b/data/sql/updates/db_world/2023_04_12_02.sql @@ -1 +1,2 @@ +-- DB update 2023_04_12_01 -> 2023_04_12_02 DELETE FROM `creature_loot_template` WHERE `Item` = 21855 AND `Entry` IN (17796,20630);