Creature/Script: Add text target for npc_shadowfang_prisoner

This commit is contained in:
Killyana
2020-01-03 15:55:26 +01:00
parent 6561229d16
commit 10ba39e626
2 changed files with 45 additions and 29 deletions

View File

@@ -0,0 +1,13 @@
--
UPDATE `creature_template` SET `gossip_menu_id`=301 WHERE `entry`=3849;
UPDATE `creature_template` SET `gossip_menu_id`=300 WHERE `entry`=3850;
DELETE FROM `gossip_menu` WHERE `MenuID` IN (21213, 21214, 300, 301) AND `TextID` IN (798,799);
INSERT INTO `gossip_menu` (`MenuID`, `TextID`) VALUES
(300,798),
(301,799);
DELETE FROM `gossip_menu_option` WHERE `MenuID` IN (21213, 21214, 300, 301);
INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, BoxBroadcastTextID, `VerifiedBuild`) VALUES
(300, 0, 0, "Please unlock the courtyard door.", 2802, 1, 1, 0, 0, 0, 0, "", 0, 0),
(301, 0, 0, "Please unlock the courtyard door.", 2802, 1, 1, 0, 0, 0, 0, "", 0, 0);

View File

@@ -77,36 +77,39 @@ public:
void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
{
switch (waypointId)
if (Player* player = GetPlayerForEscort())
{
case 0:
if (me->GetEntry() == NPC_ASH)
Talk(SAY_FREE_AS);
else
Talk(SAY_FREE_AD);
break;
case 10:
if (me->GetEntry() == NPC_ASH)
Talk(SAY_OPEN_DOOR_AS);
else
Talk(SAY_OPEN_DOOR_AD);
break;
case 11:
if (me->GetEntry() == NPC_ASH)
DoCast(me, SPELL_UNLOCK);
break;
case 12:
if (me->GetEntry() == NPC_ASH)
Talk(SAY_POST_DOOR_AS);
else
Talk(SAY_POST1_DOOR_AD);
switch (waypointId)
{
case 0:
if (me->GetEntry() == NPC_ASH)
Talk(SAY_FREE_AS, player);
else
Talk(SAY_FREE_AD, player);
break;
case 10:
if (me->GetEntry() == NPC_ASH)
Talk(SAY_OPEN_DOOR_AS, player);
else
Talk(SAY_OPEN_DOOR_AD, player);
break;
case 11:
if (me->GetEntry() == NPC_ASH)
DoCast(me, SPELL_UNLOCK);
break;
case 12:
if (me->GetEntry() == NPC_ASH)
Talk(SAY_POST_DOOR_AS, player);
else
Talk(SAY_POST1_DOOR_AD, player);
instance->SetData(TYPE_FREE_NPC, DONE);
break;
case 13:
if (me->GetEntry() != NPC_ASH)
Talk(SAY_POST2_DOOR_AD);
break;
instance->SetData(TYPE_FREE_NPC, DONE);
break;
case 13:
if (me->GetEntry() != NPC_ASH)
Talk(SAY_POST2_DOOR_AD, player);
break;
}
}
}
@@ -120,7 +123,7 @@ public:
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
CloseGossipMenuFor(player);
Start(false, false);
Start(false, false, player->GetGUID());
}
return true;
}