mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Scripts/Outland: Migrate Shattrath City NPCs to SAI (#20596)
- Zephyr and Flask Vendors to SAI
- Update gossip menu options to proper values
(thx Killyana for digging into this)
(cherry picked from commit 5558bd27c6)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
--
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` IN (25967,23483,23484);
|
||||
|
||||
DELETE FROM `gossip_menu` WHERE `MenuID` = 8752 AND `TextID` = 11085;
|
||||
INSERT INTO `gossip_menu` (`MenuID`, `TextID`, `VerifiedBuild`) VALUES
|
||||
(8752,11085,0);
|
||||
|
||||
DELETE FROM `gossip_menu_option` WHERE `MenuID` IN (8751,8752);
|
||||
INSERT INTO `gossip_menu_option` (`MenuID`, `OptionIndex`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `VerifiedBuild`) VALUES
|
||||
(8751, 0, 1, 'I have marks to redeem.', 21915, 3, 128, 0),
|
||||
(8752, 0, 1, 'I have marks to redeem.', 21915, 3, 128, 0);
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 25967);
|
||||
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
|
||||
(25967, 0, 0, 0, 62, 0, 100, 0, 9205, 0, 0, 0, 11, 37778, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Zephyr - On Gossip Option 0 Selected - Cast \'Quest - Teleport: Caverns of Time\'');
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` IN (8751,8752,9205);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(15, 9205, 0, 0, 0, 5, 0, 989, 192, 0, 0, 0, 0, '', 'Show gossip menu 9205 option id 0 if player is Revered or Exalted with faction Keepers of Time.'),
|
||||
(14, 8751, 11085, 0, 1, 5, 0, 932, 128, 0, 0, 0, 0, '', 'Show gossip menu 8751 text id 11085 if player is Exalted with faction The Aldor.'),
|
||||
(14, 8751, 11085, 0, 1, 5, 0, 935, 128, 0, 0, 0, 0, '', 'Show gossip menu 8751 text id 11085 if player is Exalted with faction The Sha\'tar.'),
|
||||
(14, 8751, 11085, 0, 1, 5, 0, 942, 128, 0, 0, 0, 0, '', 'Show gossip menu 8751 text id 11085 if player is Exalted with faction Cenarion Expedition.'),
|
||||
(14, 8752, 11085, 0, 1, 5, 0, 934, 128, 0, 0, 0, 0, '', 'Show gossip menu 8752 text id 11085 if player is Exalted with faction The Scryers.'),
|
||||
(14, 8752, 11085, 0, 1, 5, 0, 935, 128, 0, 0, 0, 0, '', 'Show gossip menu 8752 text id 11085 if player is Exalted with faction The Sha\'tar.'),
|
||||
(14, 8752, 11085, 0, 1, 5, 0, 942, 128, 0, 0, 0, 0, '', 'Show gossip menu 8752 text id 11085 if player is Exalted with faction Cenarion Expedition.'),
|
||||
(15, 8751, 0, 0, 1, 5, 0, 932, 128, 0, 0, 0, 0, '', 'Show gossip menu 8751 option id 0 if player is Exalted with faction The Aldor.'),
|
||||
(15, 8751, 0, 0, 1, 5, 0, 935, 128, 0, 0, 0, 0, '', 'Show gossip menu 8751 option id 0 if player is Exalted with faction The Sha\'tar.'),
|
||||
(15, 8751, 0, 0, 1, 5, 0, 942, 128, 0, 0, 0, 0, '', 'Show gossip menu 8751 option id 0 if player is Exalted with faction Cenarion Expedition.'),
|
||||
(15, 8752, 0, 0, 1, 5, 0, 934, 128, 0, 0, 0, 0, '', 'Show gossip menu 8752 option id 0 if player is Exalted with faction The Scryers.'),
|
||||
(15, 8752, 0, 0, 1, 5, 0, 935, 128, 0, 0, 0, 0, '', 'Show gossip menu 8752 option id 0 if player is Exalted with faction The Sha\'tar.'),
|
||||
(15, 8752, 0, 0, 1, 5, 0, 942, 128, 0, 0, 0, 0, '', 'Show gossip menu 8752 option id 0 if player is Exalted with faction Cenarion Expedition.');
|
||||
@@ -18,15 +18,13 @@
|
||||
/* ScriptData
|
||||
SDName: Shattrath_City
|
||||
SD%Complete: 100
|
||||
SDComment: Quest support: 10004, 10009, 10211. Flask vendors, Teleport to Caverns of Time
|
||||
SDComment: Quest support: 10004, 10009, 10211.
|
||||
SDCategory: Shattrath City
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_raliq_the_drunk
|
||||
npc_salsalabim
|
||||
npc_shattrathflaskvendors
|
||||
npc_zephyr
|
||||
npc_kservant
|
||||
EndContentData */
|
||||
|
||||
@@ -225,137 +223,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
##################################################
|
||||
Shattrath City Flask Vendors provides flasks to people exalted with 3 fActions:
|
||||
Haldor the Compulsive
|
||||
Arcanist Xorith
|
||||
Both sell special flasks for use in Outlands 25man raids only,
|
||||
purchasable for one Mark of Illidari each
|
||||
Purchase requires exalted reputation with Scryers/Aldor, Cenarion Expedition and The Sha'tar
|
||||
##################################################
|
||||
*/
|
||||
|
||||
enum FlaskVendors
|
||||
{
|
||||
ALDOR_REPUTATION = 932,
|
||||
SCRYERS_REPUTATION = 934,
|
||||
THE_SHA_TAR_REPUTATION = 935,
|
||||
CENARION_EXPEDITION_REP = 942,
|
||||
NPC_TEXT_EXALTED_ALDOR = 11083, // (need to be exalted with Sha'tar, Cenarion Expedition and the Aldor)
|
||||
NPC_TEXT_EXALTED_SCRYERS = 11084, // (need to be exalted with Sha'tar, Cenarion Expedition and the Scryers)
|
||||
NPC_TEXT_WELCOME_NAME = 11085, // Access granted
|
||||
ARCANIST_XORITH = 23483, // Scryer Apothecary
|
||||
HALDOR_THE_COMPULSIVE = 23484 // Aldor Apothecary
|
||||
};
|
||||
|
||||
class npc_shattrathflaskvendors : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_shattrathflaskvendors() : CreatureScript("npc_shattrathflaskvendors") { }
|
||||
|
||||
struct npc_shattrathflaskvendorsAI : public ScriptedAI
|
||||
{
|
||||
npc_shattrathflaskvendorsAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_TRADE)
|
||||
player->GetSession()->SendListInventory(me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (me->GetEntry() == HALDOR_THE_COMPULSIVE)
|
||||
{
|
||||
// Aldor vendor
|
||||
if (me->IsVendor() && (player->GetReputationRank(ALDOR_REPUTATION) == REP_EXALTED) && (player->GetReputationRank(THE_SHA_TAR_REPUTATION) == REP_EXALTED) && (player->GetReputationRank(CENARION_EXPEDITION_REP) == REP_EXALTED))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
SendGossipMenuFor(player, NPC_TEXT_WELCOME_NAME, me->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
SendGossipMenuFor(player, NPC_TEXT_EXALTED_ALDOR, me->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
if (me->GetEntry() == ARCANIST_XORITH)
|
||||
{
|
||||
// Scryers vendor
|
||||
if (me->IsVendor() && (player->GetReputationRank(SCRYERS_REPUTATION) == REP_EXALTED) && (player->GetReputationRank(THE_SHA_TAR_REPUTATION) == REP_EXALTED) && (player->GetReputationRank(CENARION_EXPEDITION_REP) == REP_EXALTED))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
SendGossipMenuFor(player, NPC_TEXT_WELCOME_NAME, me->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
SendGossipMenuFor(player, NPC_TEXT_EXALTED_SCRYERS, me->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_shattrathflaskvendorsAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
# npc_zephyr
|
||||
######*/
|
||||
|
||||
enum Zephyr
|
||||
{
|
||||
OPTION_ID_TAKE_ME_TO_C_O_T = 0,
|
||||
KEEPERS_OF_TIME_REPUTATION = 989,
|
||||
MENU_ID_TAKE_ME_TO_C_O_T = 9205,
|
||||
TELEPORT_CAVERNS_OF_TIME = 37778
|
||||
};
|
||||
|
||||
class npc_zephyr : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_zephyr() : CreatureScript("npc_zephyr") { }
|
||||
|
||||
struct npc_zephyrAI : public ScriptedAI
|
||||
{
|
||||
npc_zephyrAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
player->CastSpell(player, TELEPORT_CAVERNS_OF_TIME, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (player->GetReputationRank(KEEPERS_OF_TIME_REPUTATION) >= REP_REVERED)
|
||||
AddGossipItemFor(player, MENU_ID_TAKE_ME_TO_C_O_T, OPTION_ID_TAKE_ME_TO_C_O_T, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_zephyrAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
# npc_kservant
|
||||
######*/
|
||||
@@ -505,7 +372,5 @@ void AddSC_shattrath_city()
|
||||
{
|
||||
new npc_raliq_the_drunk();
|
||||
new npc_salsalabim();
|
||||
new npc_shattrathflaskvendors();
|
||||
new npc_zephyr();
|
||||
new npc_kservant();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user