From 9ef069b0231cb4209367c1b0ec82315e4b374509 Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Mon, 20 Mar 2023 19:06:06 +0200 Subject: [PATCH] fix(DB/SAI): Move Ashyen & Keleth to SAI. (#15502) Co-authored-by: offl --- .../rev_1679303594025981500.sql | 53 +++++++ .../scripts/Outland/zone_zangarmarsh.cpp | 135 ------------------ 2 files changed, 53 insertions(+), 135 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1679303594025981500.sql diff --git a/data/sql/updates/pending_db_world/rev_1679303594025981500.sql b/data/sql/updates/pending_db_world/rev_1679303594025981500.sql new file mode 100644 index 000000000..a6554eee8 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1679303594025981500.sql @@ -0,0 +1,53 @@ +-- Delete wrong creature_text for Ashyen(17900) and Keleth(17901) and set as SAI. +DELETE FROM `creature_text` WHERE `CreatureID` IN (17900,17901); +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` IN (17900,17901); + +-- Ashyen +DELETE FROM `gossip_menu_option` WHERE `MenuID`=7559; +INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES +(7559, 0, 0, 'Grant me your mark, wise ancient.', 14739, 1, 1, 0, 0, 0, 0, '', 0, 0); + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 17900 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 +(17900, 0, 0, 5, 62, 0, 100, 0, 7559, 0, 0, 0, 0, 11, 31808, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Ashyen - On Gossip Option 0 Selected - Cast \'Mark of Lore\' (Friendly)'), +(17900, 0, 1, 5, 62, 0, 100, 0, 7559, 0, 0, 0, 0, 11, 31810, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Ashyen - On Gossip Option 0 Selected - Cast \'Mark of Lore\' (Honored)'), +(17900, 0, 2, 5, 62, 0, 100, 0, 7559, 0, 0, 0, 0, 11, 31811, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Ashyen - On Gossip Option 0 Selected - Cast \'Mark of Lore\' (Revered)'), +(17900, 0, 3, 5, 62, 0, 100, 0, 7559, 0, 0, 0, 0, 11, 31815, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Ashyen - On Gossip Option 0 Selected - Cast \'Mark of Lore\' (Exalted)'), +(17900, 0, 4, 5, 62, 0, 100, 0, 7559, 0, 0, 0, 0, 33, 17900, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Ashyen - On Gossip Option 0 Selected - Quest Credit \'Blessings of the Ancients\''), +(17900, 0, 5, 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, 'Ashyen - On Link - Close Gossip'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=17900; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 17900, 0, 0, 5, 0, 942, 16, 0, 0, 0, 0, '', 'Execute SAI (Action 0) if player is Friendly with Cenarion Expedition'), +(22, 2, 17900, 0, 0, 5, 0, 942, 32, 0, 0, 0, 0, '', 'Execute SAI (Action 1) if player is Honored with Cenarion Expedition'), +(22, 3, 17900, 0, 0, 5, 0, 942, 64, 0, 0, 0, 0, '', 'Execute SAI (Action 2) if player is Revered with Cenarion Expedition'), +(22, 4, 17900, 0, 0, 5, 0, 942, 128, 0, 0, 0, 0, '', 'Execute SAI (Action 3) if player is Exalted with Cenarion Expedition'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7559; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 7559, 0, 0, 0, 5, 0, 942, 240, 0, 0, 0, 0, '', 'Show Gossip Option 0 if player is at least Friendly with Cenarion Expedition'); + +-- Keleth +DELETE FROM `gossip_menu_option` WHERE `MenuID`=7560; +INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES +(7560, 0, 0, 'Grant me your mark, mighty ancient.', 14741, 1, 1, 0, 0, 0, 0, '', 0, 0); + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 17901 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 +(17901, 0, 0, 5, 62, 0, 100, 0, 7560, 0, 0, 0, 0, 11, 31807, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Keleth - On Gossip Option 0 Selected - Cast \'Mark of War\' (Friendly'), +(17901, 0, 1, 5, 62, 0, 100, 0, 7560, 0, 0, 0, 0, 11, 31812, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Keleth - On Gossip Option 0 Selected - Cast \'Mark of War\' (Honored)'), +(17901, 0, 2, 5, 62, 0, 100, 0, 7560, 0, 0, 0, 0, 11, 31813, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Keleth - On Gossip Option 0 Selected - Cast \'Mark of War\' (Revered)'), +(17901, 0, 3, 5, 62, 0, 100, 0, 7560, 0, 0, 0, 0, 11, 31814, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Keleth - On Gossip Option 0 Selected - Cast \'Mark of War\' (Exalted)'), +(17901, 0, 4, 5, 62, 0, 100, 0, 7560, 0, 0, 0, 0, 33, 17901, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Keleth - On Gossip Option 0 Selected - Quest Credit \'Blessings of the Ancients\''), +(17901, 0, 5, 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, 'Keleth - On Link - Close Gossip'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=17901; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 17901, 0, 0, 5, 0, 942, 16, 0, 0, 0, 0, '', 'Execute SAI (Action 0) if player is Friendly with Cenarion Expedition'), +(22, 2, 17901, 0, 0, 5, 0, 942, 32, 0, 0, 0, 0, '', 'Execute SAI (Action 1) if player is Honored with Cenarion Expedition'), +(22, 3, 17901, 0, 0, 5, 0, 942, 64, 0, 0, 0, 0, '', 'Execute SAI (Action 2) if player is Revered with Cenarion Expedition'), +(22, 4, 17901, 0, 0, 5, 0, 942, 128, 0, 0, 0, 0, '', 'Execute SAI (Action 3) if player is Exalted with Cenarion Expedition'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7560; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 7560, 0, 0, 0, 5, 0, 942, 240, 0, 0, 0, 0, '', 'Show Gossip Option 0 if player is at least Friendly with Cenarion Expedition'); diff --git a/src/server/scripts/Outland/zone_zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp index 8a5710cbe..f9bef01d0 100644 --- a/src/server/scripts/Outland/zone_zangarmarsh.cpp +++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp @@ -15,146 +15,12 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Zangarmarsh -SD%Complete: 100 -SDComment: Quest support: 9752, 9785, 9803, 10009. Mark Of ... buffs. -SDCategory: Zangarmarsh -EndScriptData */ - -/* ContentData -npcs_ashyen_and_keleth -npc_cooshcoosh -npc_elder_kuruti -npc_mortog_steamhead -npc_kayra_longmane -npc_timothy_daniels -EndContentData */ - #include "Player.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" -// Theirs -/*###### -## npcs_ashyen_and_keleth -######*/ - -#define GOSSIP_ITEM_BLESS_ASH "Grant me your mark, wise ancient." -#define GOSSIP_ITEM_BLESS_KEL "Grant me your mark, mighty ancient." - -enum AshyenAndKeleth -{ - GOSSIP_REWARD_BLESS = 0, - - NPC_ASHYEN = 17900, - NPC_KELETH = 17901, - - SPELL_BLESS_ASH_EXA = 31815, - SPELL_BLESS_ASH_REV = 31811, - SPELL_BLESS_ASH_HON = 31810, - SPELL_BLESS_ASH_FRI = 31808, - - SPELL_BLESS_KEL_EXA = 31814, - SPELL_BLESS_KEL_REV = 31813, - SPELL_BLESS_KEL_HON = 31812, - SPELL_BLESS_KEL_FRI = 31807 -}; - -class npcs_ashyen_and_keleth : public CreatureScript -{ -public: - npcs_ashyen_and_keleth() : CreatureScript("npcs_ashyen_and_keleth") { } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (player->GetReputationRank(942) > REP_NEUTRAL) - { - if (creature->GetEntry() == NPC_ASHYEN) - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (creature->GetEntry() == NPC_KELETH) - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - } - SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - ClearGossipMenuFor(player); - if (action == GOSSIP_ACTION_INFO_DEF + 1) - { - creature->setPowerType(POWER_MANA); - creature->SetMaxPower(POWER_MANA, 200); //set a "fake" mana value, we can't depend on database doing it in this case - creature->SetPower(POWER_MANA, 200); - - if (creature->GetEntry() == NPC_ASHYEN) //check which Creature we are dealing with - { - uint32 spell = 0; - switch (player->GetReputationRank(942)) - { - //mark of lore - case REP_FRIENDLY: - spell = SPELL_BLESS_ASH_FRI; - break; - case REP_HONORED: - spell = SPELL_BLESS_ASH_HON; - break; - case REP_REVERED: - spell = SPELL_BLESS_ASH_REV; - break; - case REP_EXALTED: - spell = SPELL_BLESS_ASH_EXA; - break; - default: - break; - } - - if (spell) - { - creature->CastSpell(player, spell, true); - creature->AI()->Talk(GOSSIP_REWARD_BLESS); - } - } - - if (creature->GetEntry() == NPC_KELETH) - { - uint32 spell = 0; - switch (player->GetReputationRank(942)) //mark of war - { - case REP_FRIENDLY: - spell = SPELL_BLESS_KEL_FRI; - break; - case REP_HONORED: - spell = SPELL_BLESS_KEL_HON; - break; - case REP_REVERED: - spell = SPELL_BLESS_KEL_REV; - break; - case REP_EXALTED: - spell = SPELL_BLESS_KEL_EXA; - break; - default: - break; - } - - if (spell) - { - creature->CastSpell(player, spell, true); - creature->AI()->Talk(GOSSIP_REWARD_BLESS); - } - } - CloseGossipMenuFor(player); - player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); - } - return true; - } -}; - /*###### ## npc_cooshcoosh ######*/ @@ -451,7 +317,6 @@ public: void AddSC_zangarmarsh() { // Theirs - new npcs_ashyen_and_keleth(); new npc_cooshcoosh(); new npc_elder_kuruti(); new npc_mortog_steamhead();