From 366fd4653cf64ebfd8d950b5fda5636b9630afdf Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 5 Nov 2021 02:15:33 -0300 Subject: [PATCH] fix(Script/Gossip) Mathredis Firestar (#8895) --- .../rev_1635856510467222141.sql | 50 ++++++++++++ .../eastern_kingdoms_script_loader.cpp | 2 + .../EasternKingdoms/zone_burning_steppes.cpp | 77 +++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1635856510467222141.sql diff --git a/data/sql/updates/pending_db_world/rev_1635856510467222141.sql b/data/sql/updates/pending_db_world/rev_1635856510467222141.sql new file mode 100644 index 000000000..86ccbd00d --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1635856510467222141.sql @@ -0,0 +1,50 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1635856510467222141'); + +-- Fix gossip for Mathredis Firestar +UPDATE `creature_template` SET `gossip_menu_id`=2298, `ScriptName`='npc_maredis_firestar' WHERE `entry`=9836; + +DELETE FROM `gossip_menu` WHERE `MenuID` IN (2298,2299,2300,2301,2302,2303); +INSERT INTO `gossip_menu` (`MenuID`,`TextID`) VALUES (2298,2993), (2299,2994),(2300,2995),(2301,2996),(2302,2997),(2303,2998); + +DELETE FROM `gossip_menu_option` WHERE `MenuID` IN (2298,2299,2300,2301,2302,2303); +INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES +(2299, 0, 0, 'I present to you the Libram of Rumination.', 5291, 1, 1, 0, 0, 0, 0, '', 0, 0), +(2300, 0, 0, 'I present to you the Libram of Constitution.', 5416, 1, 1, 0, 0, 0, 0, '', 0, 0), +(2301, 0, 0, 'I present to you the Libram of Tenacity.', 5417, 1, 1, 0, 0, 0, 0, '', 0, 0), +(2302, 0, 0, 'I present to you the Libram of Resilience.', 5418, 1, 1, 0, 0, 0, 0, '', 0, 0), +(2303, 0, 0, 'I present to you the Libram of Voracity.', 5419, 1, 1, 0, 0, 0, 0, '', 0, 0); + +-- Condition for source Quest available condition type Item +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceGroup`=0 AND `SourceEntry`=4463 AND `SourceId`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 4463, 0, 0, 2, 0, 11732, 1, 0, 0, 0, 0, '', 'Quest Libram of Rumination available if player has 1 of Libram of Rumination. Item cannot be in bank.'); + +-- Condition for source Quest available condition type Item +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceGroup`=0 AND `SourceEntry`=4481 AND `SourceId`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 4481, 0, 0, 2, 0, 11733, 1, 0, 0, 0, 0, '', 'Quest Libram of Constitution available if player has 1 of Libram of Constitution. Item cannot be in bank.'), +(19, 0, 4481, 0, 0, 2, 0, 11732, 1, 0, 1, 0, 0, '', 'Quest Libram of Constitution available if player does not have 1 of Libram of Rumination. Item cannot be in bank.'); + +-- Condition for source Quest available condition type Item +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceGroup`=0 AND `SourceEntry`=4482 AND `SourceId`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 4482, 0, 0, 2, 0, 11734, 1, 0, 0, 0, 0, '', 'Quest Libram of Tenacity available if player has 1 of Libram of Tenacity. Item cannot be in bank.'), +(19, 0, 4482, 0, 0, 2, 0, 11732, 1, 0, 1, 0, 0, '', 'Quest Libram of Tenacity available if player does not have 1 of Libram of Rumination. Item cannot be in bank.'), +(19, 0, 4482, 0, 0, 2, 0, 11733, 1, 0, 1, 0, 0, '', 'Quest Libram of Tenacity available if player does not have 1 of Libram of Constitution. Item cannot be in bank.'); + +-- Condition for source Quest available condition type Item +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceGroup`=0 AND `SourceEntry`=4483 AND `SourceId`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 4483, 0, 0, 2, 0, 11736, 1, 0, 0, 0, 0, '', 'Quest Libram of Resilience available if player has 1 of Libram of Resilience. Item cannot be in bank.'), +(19, 0, 4483, 0, 0, 2, 0, 11732, 1, 0, 1, 0, 0, '', 'Quest Libram of Resilience available if player does not have 1 of Libram of Rumination. Item cannot be in bank.'), +(19, 0, 4483, 0, 0, 2, 0, 11733, 1, 0, 1, 0, 0, '', 'Quest Libram of Resilience available if player does not have 1 of Libram of Constitution. Item cannot be in bank.'), +(19, 0, 4483, 0, 0, 2, 0, 11734, 1, 0, 1, 0, 0, '', 'Quest Libram of Resilience available if player does not have 1 of Libram of Tenacity. Item cannot be in bank.'); + +-- Condition for source Quest available condition type Item +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceGroup`=0 AND `SourceEntry`=4484 AND `SourceId`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 4484, 0, 0, 2, 0, 11737, 1, 0, 0, 0, 0, '', 'Quest Libram of Voracity available if player has 1 of Libram of Voracity. Item cannot be in bank.'), +(19, 0, 4484, 0, 0, 2, 0, 11732, 1, 0, 1, 0, 0, '', 'Quest Libram of Voracity available if player does not have 1 of Libram of Rumination. Item cannot be in bank.'), +(19, 0, 4484, 0, 0, 2, 0, 11733, 1, 0, 1, 0, 0, '', 'Quest Libram of Voracity available if player does not have 1 of Libram of Constitution. Item cannot be in bank.'), +(19, 0, 4484, 0, 0, 2, 0, 11734, 1, 0, 1, 0, 0, '', 'Quest Libram of Voracity available if player does not have 1 of Libram of Tenacity. Item cannot be in bank.'), +(19, 0, 4484, 0, 0, 2, 0, 11736, 1, 0, 1, 0, 0, '', 'Quest Libram of Voracity available if player does not have 1 of Libram of Resilience. Item cannot be in bank.'); diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp index 6c5ca0781..5862cc2c1 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp @@ -148,6 +148,7 @@ void AddSC_undercity(); void AddSC_western_plaguelands(); void AddSC_westfall(); //void AddSC_wetlands(); +void AddSC_burning_steppes(); // The name of this function should match: // void Add${NameOfDirectory}Scripts() @@ -285,4 +286,5 @@ void AddEasternKingdomsScripts() AddSC_western_plaguelands(); AddSC_westfall(); //AddSC_wetlands(); + AddSC_burning_steppes(); } diff --git a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp index 2c0d6782a..fe5e25a71 100644 --- a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp @@ -14,3 +14,80 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ + +#include "Player.h" +#include "ScriptMgr.h" +#include "ScriptedGossip.h" +#include "ScriptedCreature.h" + +/*###### +## NPC 9836: Maredis Firestar +######*/ + +enum MaredisFirestar +{ + ITEM_LIBRAM_OF_RUMINATION = 11732, + ITEM_LIBRAM_OF_CONSTITUTION = 11733, + ITEM_LIBRAM_OF_TENACITY = 11734, + ITEM_LIBRAM_OF_RESILIENCE = 11736, + ITEM_LIBRAM_OF_VORACITY = 11737, + GOSSIP_LIBRAM_OF_RUMINATION = 2299, + GOSSIP_LIBRAM_OF_CONSTITUTION = 2300, + GOSSIP_LIBRAM_OF_TENACITY = 2301, + GOSSIP_LIBRAM_OF_RESILIENCE = 2302, + GOSSIP_LIBRAM_OF_VORACITY = 2303 +}; + +class npc_maredis_firestar : public CreatureScript +{ +public: + npc_maredis_firestar() : CreatureScript("npc_maredis_firestar") {} + + struct npc_maredis_firestarAI : public CreatureAI + { + npc_maredis_firestarAI(Creature* creature) : CreatureAI(creature) {} + + void sGossipHello(Player* player) override + { + // If player has 2 different librams on him he will only see top most one. + // Count is default 1. In bank is default false. + if (player->HasItemCount(ITEM_LIBRAM_OF_RUMINATION)) + { + player->PrepareGossipMenu(me, GOSSIP_LIBRAM_OF_RUMINATION); + player->SendPreparedGossip(me); + } + else if (player->HasItemCount(ITEM_LIBRAM_OF_CONSTITUTION)) + { + player->PrepareGossipMenu(me, GOSSIP_LIBRAM_OF_CONSTITUTION); + player->SendPreparedGossip(me); + } + else if (player->HasItemCount(ITEM_LIBRAM_OF_TENACITY)) + { + player->PrepareGossipMenu(me, GOSSIP_LIBRAM_OF_TENACITY); + player->SendPreparedGossip(me); + } + else if (player->HasItemCount(ITEM_LIBRAM_OF_RESILIENCE)) + { + player->PrepareGossipMenu(me, GOSSIP_LIBRAM_OF_RESILIENCE); + player->SendPreparedGossip(me); + } + else if (player->HasItemCount(ITEM_LIBRAM_OF_VORACITY)) + { + player->PrepareGossipMenu(me, GOSSIP_LIBRAM_OF_VORACITY); + player->SendPreparedGossip(me); + } + } + + void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override + { + // All gossip menus only have one option. Conditions are handled in db. + player->PrepareQuestMenu(me->GetGUID()); + player->SendPreparedQuest(me->GetGUID()); + } + }; +}; + +void AddSC_burning_steppes() +{ + new npc_maredis_firestar(); +}