refactor(Core/Scripts): move npc_maredis_firestar to DB gossip (#25192)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cfeb6d8551
commit
dc10485d8a
3 changed files with 24 additions and 94 deletions
|
|
@ -0,0 +1,22 @@
|
|||
-- Move npc_maredis_firestar (Mathredis Firestar, entry 9836) from C++ script to DB gossip
|
||||
|
||||
-- Remove C++ ScriptName
|
||||
UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=9836;
|
||||
|
||||
-- Move gossip options from sub-menus (2299-2303) to the NPC's main menu (2298) with conditions
|
||||
DELETE FROM `gossip_menu_option` WHERE `MenuID` IN (2298,2299,2300,2301,2302,2303);
|
||||
INSERT INTO `gossip_menu_option` (`MenuID`,`OptionID`,`OptionIcon`,`OptionText`,`OptionBroadcastTextID`,`OptionType`,`OptionNpcFlag`,`ActionMenuID`,`ActionPoiID`,`BoxCoded`,`BoxMoney`,`BoxText`,`BoxBroadcastTextID`,`VerifiedBuild`) VALUES
|
||||
(2298,0,0,'I present to you the Libram of Rumination.',5291,1,1,2299,0,0,0,'',0,0),
|
||||
(2298,1,0,'I present to you the Libram of Constitution.',5416,1,1,2300,0,0,0,'',0,0),
|
||||
(2298,2,0,'I present to you the Libram of Tenacity.',5417,1,1,2301,0,0,0,'',0,0),
|
||||
(2298,3,0,'I present to you the Libram of Resilience.',5418,1,1,2302,0,0,0,'',0,0),
|
||||
(2298,4,0,'I present to you the Libram of Voracity.',5419,1,1,2303,0,0,0,'',0,0);
|
||||
|
||||
-- Add conditions: show each option only if player has the corresponding Libram
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=2298;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
|
||||
(15,2298,0,0,0,2,0,11732,1,0,0,0,0,'','Show gossip option if player has Libram of Rumination'),
|
||||
(15,2298,1,0,0,2,0,11733,1,0,0,0,0,'','Show gossip option if player has Libram of Constitution'),
|
||||
(15,2298,2,0,0,2,0,11734,1,0,0,0,0,'','Show gossip option if player has Libram of Tenacity'),
|
||||
(15,2298,3,0,0,2,0,11736,1,0,0,0,0,'','Show gossip option if player has Libram of Resilience'),
|
||||
(15,2298,4,0,0,2,0,11737,1,0,0,0,0,'','Show gossip option if player has Libram of Voracity');
|
||||
|
|
@ -162,7 +162,7 @@ void AddSC_undercity();
|
|||
void AddSC_western_plaguelands();
|
||||
void AddSC_westfall();
|
||||
//void AddSC_wetlands();
|
||||
void AddSC_burning_steppes();
|
||||
//void AddSC_burning_steppes();
|
||||
|
||||
// The name of this function should match:
|
||||
// void Add${NameOfDirectory}Scripts()
|
||||
|
|
@ -314,5 +314,5 @@ void AddEasternKingdomsScripts()
|
|||
AddSC_western_plaguelands();
|
||||
AddSC_westfall();
|
||||
//AddSC_wetlands();
|
||||
AddSC_burning_steppes();
|
||||
//AddSC_burning_steppes();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "CreatureScript.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
/*######
|
||||
## NPC 9836: Maredis Firestar
|
||||
######*/
|
||||
|
||||
enum MaredisFirestar
|
||||
{
|
||||
ITEM_LIBRAM_OF_RUMINATION = 11732,
|
||||
ITEM_LIBRAM_OF_CONSTITUTION = 11733,
|
||||
ITEM_LIBRAM_OF_TENACITY = 11734,
|
||||
ITEM_LIBRAM_OF_RESILIENCE = 11736,
|
||||
ITEM_LIBRAM_OF_VORACITY = 11737,
|
||||
GOSSIP_LIBRAM_OF_RUMINATION = 2299,
|
||||
GOSSIP_LIBRAM_OF_CONSTITUTION = 2300,
|
||||
GOSSIP_LIBRAM_OF_TENACITY = 2301,
|
||||
GOSSIP_LIBRAM_OF_RESILIENCE = 2302,
|
||||
GOSSIP_LIBRAM_OF_VORACITY = 2303
|
||||
};
|
||||
|
||||
class npc_maredis_firestar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_maredis_firestar() : CreatureScript("npc_maredis_firestar") {}
|
||||
|
||||
struct npc_maredis_firestarAI : public CreatureAI
|
||||
{
|
||||
npc_maredis_firestarAI(Creature* creature) : CreatureAI(creature) {}
|
||||
|
||||
void sGossipHello(Player* player) override
|
||||
{
|
||||
// If player has 2 different librams on him he will only see top most one.
|
||||
// Count is default 1. In bank is default false.
|
||||
if (player->HasItemCount(ITEM_LIBRAM_OF_RUMINATION))
|
||||
{
|
||||
player->PrepareGossipMenu(me, GOSSIP_LIBRAM_OF_RUMINATION);
|
||||
player->SendPreparedGossip(me);
|
||||
}
|
||||
else if (player->HasItemCount(ITEM_LIBRAM_OF_CONSTITUTION))
|
||||
{
|
||||
player->PrepareGossipMenu(me, GOSSIP_LIBRAM_OF_CONSTITUTION);
|
||||
player->SendPreparedGossip(me);
|
||||
}
|
||||
else if (player->HasItemCount(ITEM_LIBRAM_OF_TENACITY))
|
||||
{
|
||||
player->PrepareGossipMenu(me, GOSSIP_LIBRAM_OF_TENACITY);
|
||||
player->SendPreparedGossip(me);
|
||||
}
|
||||
else if (player->HasItemCount(ITEM_LIBRAM_OF_RESILIENCE))
|
||||
{
|
||||
player->PrepareGossipMenu(me, GOSSIP_LIBRAM_OF_RESILIENCE);
|
||||
player->SendPreparedGossip(me);
|
||||
}
|
||||
else if (player->HasItemCount(ITEM_LIBRAM_OF_VORACITY))
|
||||
{
|
||||
player->PrepareGossipMenu(me, GOSSIP_LIBRAM_OF_VORACITY);
|
||||
player->SendPreparedGossip(me);
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override
|
||||
{
|
||||
// All gossip menus only have one option. Conditions are handled in db.
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
player->SendPreparedQuest(me->GetGUID());
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_burning_steppes()
|
||||
{
|
||||
new npc_maredis_firestar();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue