Scripts/Gnomeregan: moved Blastmaster Emi gossip to db

This commit is contained in:
joschiwald
2014-04-21 21:39:51 +02:00
parent 30e6b64551
commit 6c0ff5717f
5 changed files with 28 additions and 39 deletions

View File

@@ -0,0 +1,13 @@
UPDATE `creature_template` SET `gossip_menu_id`=1080, `speed_walk`=1, `speed_run`=1.142857, `rangeattacktime`=2000 WHERE `entry`=7998;
DELETE FROM `gossip_menu` WHERE `entry`=1080;
INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
(1080, 1693); -- 7998
DELETE FROM `gossip_menu_option` WHERE `menu_id`=1080;
INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES
(1080, 0, 0, 'I am ready to begin.', 4084, 1, 1, 0, 0, '', 0); -- 7998
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1080;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,1080,0,0,0,13,1,1,0,0,0,0,0,'','Show gossip option only if Blastmaster Emi Encounter is not started');

View File

@@ -91,13 +91,8 @@ public:
// ok, normal (creature/GO starting) quest
if (player->CanAddQuest(quest, true))
{
player->AddQuestAndCheckCompletion(quest, NULL);
if (player->CanCompleteQuest(entry))
player->CompleteQuest(entry);
}
return true;
}

View File

@@ -24,17 +24,13 @@ Script Data End */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "gnomeregan.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "Player.h"
#define GOSSIP_START_EVENT "I am ready to begin."
#include "gnomeregan.h"
enum BlastmasterEmi
{
GOSSIP_TEXT_EMI = 1693,
SAY_BLASTMASTER_0 = 0,
SAY_BLASTMASTER_1 = 1,
SAY_BLASTMASTER_2 = 2,
@@ -93,34 +89,6 @@ public:
return GetInstanceAI<npc_blastmaster_emi_shortfuseAI>(creature);
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
if (npc_escortAI* pEscortAI = CAST_AI(npc_blastmaster_emi_shortfuse::npc_blastmaster_emi_shortfuseAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID());
creature->setFaction(player->getFaction());
creature->AI()->SetData(1, 0);
player->CLOSE_GOSSIP_MENU();
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
{
InstanceScript* instance = creature->GetInstanceScript();
if (instance && instance->GetData(TYPE_EVENT) == NOT_STARTED)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(GOSSIP_TEXT_EMI, creature->GetGUID());
return true;
}
struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
{
npc_blastmaster_emi_shortfuseAI(Creature* creature) : npc_escortAI(creature)
@@ -152,6 +120,19 @@ public:
}
}
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) OVERRIDE
{
if (gossipListId == 0)
{
Start(true, false, player->GetGUID());
me->setFaction(player->getFaction());
SetData(1, 0);
player->PlayerTalkClass->SendCloseGossip();
}
}
void NextStep(uint32 uiTimerStep, bool bNextStep = true, uint8 uiPhaseStep = 0)
{
uiTimer = uiTimerStep;