Scripts/Outland: migrate Elder Kuruti to SAI

This commit is contained in:
Andrew Letson authored and Aokromes committed 2017-10-14 14:55:03 +02:00
1 parent 94c4489856
commit cac9fba64b
2 files changed
+19 -61

No files matched your search

@@ -0,0 +1,18 @@
--
DELETE FROM `gossip_menu_option` WHERE `MenuID` IN (7582,7583,7585);
INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES
(7582,0,0,'Greetings, elder. It is time for your people to end their hostility toward the draenei and their allies.',14872,1,3,7583,0,0,0,'',0,-1),
(7583,0,0,'I did not mean to deceive you, elder. The draenei of Telredor thought to approach you in a way that would be familiar to you.',14874,1,3,7585,0,0,0,'',0,-1),
(7585,0,0,'I will tell them. Farewell, elder.',14879,1,3,7586,0,0,0,'',0,-1);
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 18197;
DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 18197);
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
(18197, 0, 0, 0, 62, 0, 100, 0, 7585, 0, 0, 0, 11, 32152, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elder Kuruti - On Gossip Option 0 Selected - Add \'Elder Kuruti\'s Response\'');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 7582;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,7582,0,0,1,8,0,9803,0,0,1,0,'','Elder Kuruti - Show Gossip Option 0 if Quest 9803 is not rewarded'),
(15,7582,0,0,1,9,0,9803,0,0,0,0,'','Elder Kuruti - Show Gossip Option 0 if Quest 9803 is taken'),
(15,7582,0,0,1,2,0,24573,1,0,1,0,'','Elder Kuruti - Show Gossip Option 0 if player does not have item 24573 in inventory');
@@ -19,14 +19,13 @@
/* ScriptData /* ScriptData
SDName: Zangarmarsh SDName: Zangarmarsh
SD%Complete: 100 SD%Complete: 100
SDComment: Quest support: 9752, 9785, 9803, 10009. Mark Of ... buffs. SDComment: Quest support: 9752, 9785, 10009. Mark Of ... buffs.
SDCategory: Zangarmarsh SDCategory: Zangarmarsh
EndScriptData */ EndScriptData */
/* ContentData /* ContentData
npcs_ashyen_and_keleth npcs_ashyen_and_keleth
npc_cooshcoosh npc_cooshcoosh
npc_elder_kuruti
npc_kayra_longmane npc_kayra_longmane
EndContentData */ EndContentData */
@@ -233,64 +232,6 @@ public:
} }
}; };
/*######
## npc_elder_kuruti
######*/
#define GOSSIP_ITEM_KUR1 "Greetings, elder. It is time for your people to end their hostility towards the draenei and their allies."
#define GOSSIP_ITEM_KUR2 "I did not mean to deceive you, elder. The draenei of Telredor thought to approach you in a way that would seem familiar to you."
#define GOSSIP_ITEM_KUR3 "I will tell them. Farewell, elder."
class npc_elder_kuruti : public CreatureScript
{
public:
npc_elder_kuruti() : CreatureScript("npc_elder_kuruti") { }
bool OnGossipHello(Player* player, Creature* creature) override
{
if (player->GetQuestStatus(9803) == QUEST_STATUS_INCOMPLETE)
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
SendGossipMenuFor(player, 9226, creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
ClearGossipMenuFor(player);
switch (action)
{
case GOSSIP_ACTION_INFO_DEF:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
SendGossipMenuFor(player, 9227, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 1:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
SendGossipMenuFor(player, 9229, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2:
{
if (!player->HasItemCount(24573))
{
ItemPosCountVec dest;
uint32 itemId = 24573;
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1, NULL);
if (msg == EQUIP_ERR_OK)
{
player->StoreNewItem(dest, itemId, true);
}
else
player->SendEquipError(msg, NULL, NULL, itemId);
}
SendGossipMenuFor(player, 9231, creature->GetGUID());
break;
}
}
return true;
}
};
/*###### /*######
## npc_kayra_longmane ## npc_kayra_longmane
######*/ ######*/
@@ -377,6 +318,5 @@ void AddSC_zangarmarsh()
{ {
new npcs_ashyen_and_keleth(); new npcs_ashyen_and_keleth();
new npc_cooshcoosh(); new npc_cooshcoosh();
new npc_elder_kuruti();
new npc_kayra_longmane(); new npc_kayra_longmane();
} }