From b99344ebfc7adecaa211de3f54030b8a87a0ff6a Mon Sep 17 00:00:00 2001 From: ratkosrb Date: Sun, 11 Oct 2020 05:32:10 +0300 Subject: [PATCH] Add gossip menu for Nelson the Nice. --- sql/migrations/20200930133112_world.sql | 5 ++++ sql/migrations/20201005212100_world.sql | 8 ++++++ src/scripts/kalimdor/silithus/silithus.cpp | 32 +++++----------------- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/sql/migrations/20200930133112_world.sql b/sql/migrations/20200930133112_world.sql index 98f513b8d..e1f626519 100644 --- a/sql/migrations/20200930133112_world.sql +++ b/sql/migrations/20200930133112_world.sql @@ -35,6 +35,11 @@ UPDATE `spell_proc_event` SET `Cooldown`=1000 WHERE `entry`=23572; UPDATE `spell_proc_event` SET `Cooldown`=20000 WHERE `entry`=26341; UPDATE `spell_proc_event` SET `Cooldown`=9 WHERE `entry`=29074; +-- ERROR:Spell 12284 listed in `spell_proc_event` not have any useful data +DELETE FROM `spell_proc_event` WHERE `entry`=12284; +-- ERROR:Spell 12322 listed in `spell_proc_event` not have any useful data +DELETE FROM `spell_proc_event` WHERE `entry`=12322; + INSERT INTO `spell_proc_event` (`entry`, `Cooldown`, `build_min`) VALUES (7849, 5000, 0), -- Absorption (14796, 8000, 0), -- Burning Tar diff --git a/sql/migrations/20201005212100_world.sql b/sql/migrations/20201005212100_world.sql index 92b15b952..5eef0d693 100644 --- a/sql/migrations/20201005212100_world.sql +++ b/sql/migrations/20201005212100_world.sql @@ -579,6 +579,14 @@ INSERT INTO `gossip_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, INSERT INTO `gossip_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (4108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7649, 0, 0, 0, 0, 0, 0, 0, 0, 'Majordomo Executus - Say Text'); UPDATE `creature_template` SET `gossip_menu_id`=4093 WHERE `entry`=12018; +-- Nelson the Nice +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (5871, 9, 7636, 1, 0, 0, 0); +INSERT INTO `gossip_menu` (`entry`, `text_id`, `condition_id`) VALUES (5871, 7044, 0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_broadcast_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `box_broadcast_text`, `condition_id`) VALUES (5871, 0, 0, 'A gnome? How pathetic. Face me, demon!', 9753, 1, 1, -1, 0, 5871, 0, 0, '', 0, 5871); +DELETE FROM `gossip_scripts` WHERE `id`=5871; +INSERT INTO `gossip_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (5871, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Nelson the Nice - Start Event'); +UPDATE `creature_template` SET `gossip_menu_id`=5871 WHERE `entry`=14536; + -- Why is this in the world db? DROP TABLE `playerbot`; diff --git a/src/scripts/kalimdor/silithus/silithus.cpp b/src/scripts/kalimdor/silithus/silithus.cpp index 46028b8c3..bb97e2abe 100644 --- a/src/scripts/kalimdor/silithus/silithus.cpp +++ b/src/scripts/kalimdor/silithus/silithus.cpp @@ -326,12 +326,6 @@ enum QUEST_STAVE_OF_THE_ANCIENTS = 7636 }; -#define GOSSIP_ITEM "Show me your real face, demon." - -/*##### - ## npc_nelson_the_nice - ######*/ - /*##### ## npc_solenor_the_slayer ######*/ @@ -574,24 +568,14 @@ struct npc_solenorAI : public ScriptedAI DoMeleeAttackIfReady(); } + + void OnScriptEventHappened(uint32 uiEvent, uint32 uiData, WorldObject* pInvoker) override + { + if (pInvoker && pInvoker->IsPlayer()) + BeginEvent(pInvoker->GetObjectGuid()); + } }; -bool GossipHello_npc_solenor(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_STAVE_OF_THE_ANCIENTS) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetObjectGuid()); - return true; -} - -bool GossipSelect_npc_solenor(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction ) -{ - pPlayer->CLOSE_GOSSIP_MENU(); - ((npc_solenorAI*)pCreature->AI())->BeginEvent(pPlayer->GetObjectGuid()); - return true; -} - CreatureAI* GetAI_npc_solenor(Creature* pCreature) { return new npc_solenorAI(pCreature); @@ -3314,10 +3298,8 @@ void AddSC_silithus() pNewScript->RegisterSelf(); pNewScript = new Script; - pNewScript->Name = "npc_solenor"; // npc_solenor_the_slayer + pNewScript->Name = "npc_solenor"; pNewScript->GetAI = &GetAI_npc_solenor; - pNewScript->pGossipHello = &GossipHello_npc_solenor; - pNewScript->pGossipSelect = &GossipSelect_npc_solenor; pNewScript->RegisterSelf(); pNewScript = new Script;