DB/Gossip: Moved Highlord Demitrian gossip to db.

npc had SmartAI and cpp script.
This commit is contained in:
Malcrom
2013-12-19 21:23:51 -03:30
parent cc79f279fd
commit d89a3b2fb2
2 changed files with 31 additions and 76 deletions

View File

@@ -0,0 +1,30 @@
-- Highlord Demitrian SAI
SET @ENTRY := 14347;
UPDATE `creature_template` SET `gossip_menu_id`=5689, `AIName`='SmartAI',`ScriptName`= '' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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
(@ENTRY,0,0,0,62,0,100,0,5704,0,0,0,56,19016,1,0,0,0,0,7,0,0,0,0,0,0,0,"Highlord Demitrian - On Gossip Select - Add item Vessel of Rebirth to player"),
(@ENTRY,0,1,0,20,0,100,0,7786,0,0,0,12,14435,2,0,0,0,0,7,0,0,0,0,0,0,0,"Highlord Demitrian - On Quest Thunderaan the Windseeker rewarded - Summon creature");
-- Add Gossip
DELETE FROM `gossip_menu` WHERE `entry` IN (5675,5687,5688,5689,5701,5702,5703,5704);
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
(5675,6812),(5687,6844),(5688,6843),(5689,6842),(5701,6868),(5702,6867),(5703,6870),(5704,6869);
-- Add Gossip Options
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (5675,5687,5688,5689,5701,5702,5704);
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES
(5675,0,0, 'What do you know of it?',1,1,5689),
(5689,0,0, 'I am listening, Demitrian.',1,1,5688),
(5688,0,0, 'Continue, please.',1,1,5687),
(5687,0,0, 'A battle?',1,1,5702),
(5702,0,0, '<Nod>',1,1,5701),
(5701,0,0, 'Caught unaware? How?',1,1,5704),
(5704,0,0, 'So what did Ragnaros do next?',1,1,5703);
-- Add Conditions
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=5675;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
-- Both of these must be true
(15,5675,0,0,0,14,0,7785,0,0,0,0,0, '', 'Gossip Option - Show Option if Quest 7785 is not taken'),
(15,5675,0,1,0,2,0,19016,1,0,1,0,0, '', 'Gossip Option - Show Option if player does not have Vessel of Rebirth'),
-- One of these must be true
(15,5675,0,2,0,2,0,18563,0,0,1,0,0, '', 'Gossip Option - Show Option if player has Bindings of the Windseeker'),
(15,5675,0,2,0,2,0,18564,0,0,1,0,0, '', 'Gossip Option - Show Option if player has Bindings of the Windseeker');

View File

@@ -19,12 +19,11 @@
/* ScriptData
SDName: Silithus
SD%Complete: 100
SDComment: Quest support: 7785, 8304, 8507.
SDComment: Quest support: 8304, 8507.
SDCategory: Silithus
EndScriptData */
/* ContentData
npc_highlord_demitrian
npcs_rutgar_and_frankal
quest_a_pawn_on_the_eternal_pawn
EndContentData */
@@ -35,79 +34,6 @@ EndContentData */
#include "Group.h"
#include "Player.h"
/*###
## npc_highlord_demitrian
###*/
#define GOSSIP_DEMITRIAN1 "What do you know of it?"
#define GOSSIP_DEMITRIAN2 "I am listening, Demitrian."
#define GOSSIP_DEMITRIAN3 "Continue, please."
#define GOSSIP_DEMITRIAN4 "A battle?"
#define GOSSIP_DEMITRIAN5 "<Nod>"
#define GOSSIP_DEMITRIAN6 "Caught unaware? How?"
#define GOSSIP_DEMITRIAN7 "So what did Ragnaros do next?"
class npc_highlord_demitrian : public CreatureScript
{
public:
npc_highlord_demitrian() : CreatureScript("npc_highlord_demitrian") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
{
player->PlayerTalkClass->ClearMenus();
switch (action)
{
case GOSSIP_ACTION_INFO_DEF:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(6842, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(6843, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
player->SEND_GOSSIP_MENU(6844, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
player->SEND_GOSSIP_MENU(6867, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
player->SEND_GOSSIP_MENU(6868, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
player->SEND_GOSSIP_MENU(6869, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+6:
player->SEND_GOSSIP_MENU(6870, creature->GetGUID());
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 19016, 1);
if (msg == EQUIP_ERR_OK)
player->StoreNewItem(dest, 19016, true);
break;
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (player->GetQuestStatus(7785) == QUEST_STATUS_NONE &&
(player->HasItemCount(18563, 1, false) || player->HasItemCount(18564, 1, false)))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(6812, creature->GetGUID());
return true;
}
};
/*###
## npcs_rutgar_and_frankal
###*/
@@ -1508,7 +1434,6 @@ void AddSC_silithus()
new npc_anachronos_quest_trigger();
new npc_anachronos_the_ancient();
new npc_qiraj_war_spawn();
new npc_highlord_demitrian();
new npcs_rutgar_and_frankal();
new go_wind_stone();
}