Scripting/Ghostlands: Moved some gossip to db and fixed some magic numbers.

This commit is contained in:
Malcrom
2013-12-24 08:39:35 -03:30
parent 5e8f829181
commit eacc165a12
2 changed files with 33 additions and 87 deletions

View File

@@ -0,0 +1,26 @@
-- Budd Nedreck SAI
SET @ENTRY := 23559;
UPDATE `creature_template` SET `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,1,62,0,100,0,8775,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Keristrasza - On Gossip Option - Close Gossip"),
(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,11,42540,0,0,0,0,0,7,0,0,0,0,0,0,0,"Keristrasza - On Gossip Option - Cast Zul'aman Disguise Creation");
-- Gossip Option for Budd Nedreck
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (8775);
INSERT INTO `gossip_menu_option` (menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, action_menu_id, action_poi_id, box_coded, box_money, box_text) VALUES
(8775,0,0, 'You gave the crew disguises?',1,1,0,0,0,0, '');
-- Add Conditions for Budd Nedreck gossip
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8775;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15,8775,0,0,0,9,0,11166,0,0,0,0,0, '', 'Gossip Option - Show Option if Quest 11166 is taken');
-- Remove script for Rathis Tomber
UPDATE `creature_template` SET `AIName`='', `ScriptName`= '' WHERE `entry`=16224;
-- Gossip Option for Rathis Tomber
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7162);
INSERT INTO `gossip_menu_option` (menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, action_menu_id, action_poi_id, box_coded, box_money, box_text) VALUES
(7162,0,0, 'I want to browse your goods.',3,128,0,0,0,0, '');
-- Add Conditions for Rathis Tomber gossip
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7162;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15,7162,0,0,0,8,0,9152,0,0,0,0,0, '', 'Gossip Option - Show Option if Quest 9152 is rewarded');

View File

@@ -19,14 +19,11 @@
/* ScriptData
SDName: Ghostlands
SD%Complete: 100
SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber
SDComment: Quest support: 9212.
SDCategory: Ghostlands
EndScriptData */
/* ContentData
npc_blood_knight_dawnstar
npc_budd_nedreck
npc_rathis_tomber
npc_ranger_lilatha
EndContentData */
@@ -37,81 +34,12 @@ EndContentData */
#include "Player.h"
#include "WorldSession.h"
/*######
## npc_budd_nedreck
######*/
#define GOSSIP_HBN "You gave the crew disguises?"
class npc_budd_nedreck : public CreatureScript
{
public:
npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF)
{
player->CLOSE_GOSSIP_MENU();
creature->CastSpell(player, 42540, false);
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (player->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
};
/*######
## npc_rathis_tomber
######*/
class npc_rathis_tomber : public CreatureScript
{
public:
npc_rathis_tomber() : CreatureScript("npc_rathis_tomber") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_TRADE)
player->GetSession()->SendListInventory(creature->GetGUID());
return true;
}
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (creature->IsVendor() && player->GetQuestRewardStatus(9152))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
player->SEND_GOSSIP_MENU(8432, creature->GetGUID());
}else
player->SEND_GOSSIP_MENU(8431, creature->GetGUID());
return true;
}
};
/*######
## npc_ranger_lilatha
######*/
enum RangerLilatha
{
// Yells
SAY_START = 0,
SAY_PROGRESS1 = 1,
SAY_PROGRESS2 = 2,
@@ -119,18 +47,12 @@ enum RangerLilatha
SAY_END1 = 4,
SAY_END2 = 5,
SAY_CAPTAIN_ANSWER = 0,
// Quests
QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212,
// Gameobjects
GO_CAGE = 181152,
// Creature
NPC_CAPTAIN_HELIOS = 16220,
// Factions
FACTION_SMOON_E = 1603
NPC_MUMMIFIED_HEADHUNTER = 16342,
NPC_SHADOWPINE_ORACLE = 16343,
FACTION_QUEST_ESCAPE = 113
};
class npc_ranger_lilatha : public CreatureScript
@@ -166,8 +88,8 @@ public:
case 18:
{
Talk(SAY_PROGRESS3, player);
Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ1 = me->SummonCreature(NPC_MUMMIFIED_HEADHUNTER, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = me->SummonCreature(NPC_SHADOWPINE_ORACLE, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Summ1 && Summ2)
{
Summ1->Attack(me, true);
@@ -210,7 +132,7 @@ public:
{
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{
creature->setFaction(113);
creature->setFaction(FACTION_QUEST_ESCAPE);
if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID());
@@ -227,7 +149,5 @@ public:
void AddSC_ghostlands()
{
new npc_budd_nedreck();
new npc_rathis_tomber();
new npc_ranger_lilatha();
}