fix(Script/SAI/Conditions): move npcs_dithers_and_arbington script to SAI (#8909)

This commit is contained in:
Malcrom
2021-11-05 14:47:56 -03:00
committed by GitHub
parent a6340d5b11
commit f63f9ce078
2 changed files with 49 additions and 73 deletions

View File

@@ -0,0 +1,49 @@
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1635873886464817740');
-- Condition for source Gossip menu condition type Quest taken
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup` IN (3223,3228) AND `SourceEntry` IN (3978,3979,3984,3985) AND `SourceId`=0;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (3223,3228) AND `SourceEntry` IN (0,1,2,3,4) AND `SourceId`=0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(14, 3223, 3978, 0, 0, 8, 0, 5230, 0, 0, 1, 0, 0, '', 'Gossip text requires quest ''Return to the Bulwark'' NOT rewarded'),
(14, 3223, 3979, 0, 0, 8, 0, 5230, 0, 0, 0, 0, 0, '', 'Gossip text requires quest ''Return to the Bulwark'' rewarded'),
(14, 3228, 3984, 0, 0, 8, 0, 5217, 0, 0, 1, 0, 0, '', 'Gossip text requires quest ''Return to Chillwind Camp'' NOT rewarded'),
(14, 3228, 3985, 0, 0, 8, 0, 5217, 0, 0, 0, 0, 0, '', 'Gossip text requires quest ''Return to Chillwind Camp'' rewarded'),
(15, 3223, 0, 0, 0, 8, 0, 5230, 0, 0, 0, 0, 0, '', 'Gossip option 0 requires quest ''Return to the Bulwark'' rewarded'),
(15, 3223, 1, 0, 0, 8, 0, 5230, 0, 0, 0, 0, 0, '', 'Gossip option 1 requires quest ''Return to the Bulwark'' rewarded'),
(15, 3223, 2, 0, 0, 8, 0, 5232, 0, 0, 0, 0, 0, '', 'Gossip option 2 requires quest ''Return to the Bulwark'' rewarded'),
(15, 3223, 3, 0, 0, 8, 0, 5234, 0, 0, 0, 0, 0, '', 'Gossip option 3 requires quest ''Return to the Bulwark'' rewarded'),
(15, 3223, 4, 0, 0, 8, 0, 5236, 0, 0, 0, 0, 0, '', 'Gossip option 4 requires quest ''Return to the Bulwark'' rewarded'),
(15, 3228, 0, 0, 0, 8, 0, 5217, 0, 0, 0, 0, 0, '', 'Gossip option 0 requires quest ''Return to Chillwind Camp'' rewarded'),
(15, 3228, 1, 0, 0, 8, 0, 5217, 0, 0, 0, 0, 0, '', 'Gossip option 1 requires quest ''Return to Chillwind Camp'' rewarded'),
(15, 3228, 2, 0, 0, 8, 0, 5220, 0, 0, 0, 0, 0, '', 'Gossip option 2 requires quest ''Return to Chillwind Camp'' rewarded'),
(15, 3228, 3, 0, 0, 8, 0, 5223, 0, 0, 0, 0, 0, '', 'Gossip option 3 requires quest ''Return to Chillwind Camp'' rewarded'),
(15, 3228, 4, 0, 0, 8, 0, 5226, 0, 0, 0, 0, 0, '', 'Gossip option 4 requires quest ''Return to Chillwind Camp'' rewarded');
UPDATE `creature_template` SET `AIName`="SmartAI", `ScriptName`='' WHERE `entry` IN (11056,11057);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (11056,11057) AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid`=1105600 AND `source_type`=9;
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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(11056, 0, 0, 1, 62, 0, 100, 0, 3224, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington - On Gossip Option Selected - Close Gossip'),
(11056, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 17529, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington - On Gossip Option Selected - Cast ''Vitreous Focuser'''),
(11056, 0, 2, 3, 62, 0, 100, 0, 3225, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington - On Gossip Option Selected - Close Gossip'),
(11056, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 17529, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington - On Gossip Option Selected - Cast ''Vitreous Focuser'''),
(11056, 0, 4, 5, 62, 0, 100, 0, 3226, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington - On Gossip Option Selected - Close Gossip'),
(11056, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 17529, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington - On Gossip Option Selected - Cast ''Vitreous Focuser'''),
(11056, 0, 6, 7, 62, 0, 100, 0, 3227, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington - On Gossip Option Selected - Close Gossip'),
(11056, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 17529, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington - On Gossip Option Selected - Cast ''Vitreous Focuser'''),
(11056, 0, 8, 0, 20, 0, 100, 0, 5803, 0, 0, 0, 80, 1105600, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington - On Quest ''Araj''s Scarab'' Rewarded - Run Script'),
(11057, 0, 0, 1, 62, 0, 100, 0, 3224, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Dithers - On Gossip Option Selected - Close Gossip'),
(11057, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 17529, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Dithers - On Gossip Option Selected - Cast ''Vitreous Focuser'''),
(11057, 0, 2, 3, 62, 0, 100, 0, 3225, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Dithers - On Gossip Option Selected - Close Gossip'),
(11057, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 17529, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Dithers - On Gossip Option Selected - Cast ''Vitreous Focuser'''),
(11057, 0, 4, 5, 62, 0, 100, 0, 3226, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Dithers - On Gossip Option Selected - Close Gossip'),
(11057, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 17529, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Dithers - On Gossip Option Selected - Cast ''Vitreous Focuser'''),
(11057, 0, 6, 7, 62, 0, 100, 0, 3227, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Dithers - On Gossip Option Selected - Close Gossip'),
(11057, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 17529, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Dithers - On Gossip Option Selected - Cast ''Vitreous Focuser'''),
(11057, 0, 8, 0, 20, 0, 100, 0, 5804, 0, 0, 0, 80, 1105600, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Dithers - On Quest ''Araj''s Scarab'' Rewarded - Run Script'),
(1105600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington and Apothecary Dithers - On Script - Remove Npc Flag Questgiver'),
(1105600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington and Apothecary Dithers - On Script - Say Line 0'),
(1105600, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 15050, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington and Apothecary Dithers - On Script - Cast ''Psychometry'''),
(1105600, 9, 3, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington and Apothecary Dithers - On Script - Say Line 1'),
(1105600, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 82, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Alchemist Arbington and Apothecary Dithers - On Script - Add Npc Flag Questgiver');

View File

@@ -23,7 +23,6 @@ SDCategory: Western Plaguelands
EndScriptData */
/* ContentData
npcs_dithers_and_arbington
npc_myranda_the_hag
npc_the_scourge_cauldron
npc_andorhal_tower
@@ -35,77 +34,6 @@ EndContentData */
#include "ScriptMgr.h"
#include "WorldSession.h"
/*######
## npcs_dithers_and_arbington
######*/
#define GOSSIP_HDA1 "What does the Felstone Field Cauldron need?"
#define GOSSIP_HDA2 "What does the Dalson's Tears Cauldron need?"
#define GOSSIP_HDA3 "What does the Writhing Haunt Cauldron need?"
#define GOSSIP_HDA4 "What does the Gahrron's Withering Cauldron need?"
#define GOSSIP_SDA1 "Thanks, i need a Vitreous Focuser"
class npcs_dithers_and_arbington : public CreatureScript
{
public:
npcs_dithers_and_arbington() : CreatureScript("npcs_dithers_and_arbington") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
ClearGossipMenuFor(player);
switch (action)
{
case GOSSIP_ACTION_TRADE:
player->GetSession()->SendListInventory(creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+1:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
SendGossipMenuFor(player, 3980, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
SendGossipMenuFor(player, 3981, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
SendGossipMenuFor(player, 3982, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
SendGossipMenuFor(player, 3983, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
CloseGossipMenuFor(player);
creature->CastSpell(player, 17529, false);
break;
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (creature->IsVendor())
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
if (player->GetQuestRewardStatus(5237) || player->GetQuestRewardStatus(5238))
{
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HDA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
SendGossipMenuFor(player, 3985, creature->GetGUID());
}
else
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
};
/*######
## npc_myranda_the_hag
######*/
@@ -280,7 +208,6 @@ public:
void AddSC_western_plaguelands()
{
new npcs_dithers_and_arbington();
new npc_myranda_the_hag();
new npc_the_scourge_cauldron();
new npc_andorhal_tower();