[3.3.5] Core/Scripts/DB: move core script 'npc_parqual_fintallas' to SAI

Additional change: menu options are changed from containing only names
to include the text " is my answer.", based on the lines in `broadcast_text`.

- replaced core text with DB SAI script
- created DB creature_text entries for Parqual Fintallas
- created DB gossip_menu_option entries for the NPC
- implemented NPC say lines in reply to all the answers
- added conditions for which gossip should show, depending on quest status
- added conditions to avoid exploits in the time it takes for NPC to say his texts

This PR is tested several times on a horde character (horde-only quest).
It now works as originally intended, with option-specific NPC replies.
This commit is contained in:
tkrokli
2016-01-24 19:05:49 +01:00
parent cb8f64cb63
commit 7a101bcf00
2 changed files with 65 additions and 54 deletions

View File

@@ -316,59 +316,6 @@ public:
};
};
/*######
## npc_parqual_fintallas
######*/
enum ParqualFintallas
{
SPELL_MARK_OF_SHAME = 6767
};
#define GOSSIP_HPF1 "Gul'dan"
#define GOSSIP_HPF2 "Kel'Thuzad"
#define GOSSIP_HPF3 "Ner'zhul"
class npc_parqual_fintallas : public CreatureScript
{
public:
npc_parqual_fintallas() : CreatureScript("npc_parqual_fintallas") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
creature->CastSpell(player, SPELL_MARK_OF_SHAME, false);
}
if (action == GOSSIP_ACTION_INFO_DEF+2)
{
player->CLOSE_GOSSIP_MENU();
player->AreaExploredOrEventHappens(6628);
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(5822, creature->GetGUID());
}
else
player->SEND_GOSSIP_MENU(5821, creature->GetGUID());
return true;
}
};
/*######
## AddSC
######*/
@@ -377,5 +324,4 @@ void AddSC_undercity()
{
new npc_lady_sylvanas_windrunner();
new npc_highborne_lamenter();
new npc_parqual_fintallas();
}