fix(Script/Gossip) Mathredis Firestar (#8895)

This commit is contained in:
Malcrom
2021-11-05 02:15:33 -03:00
committed by GitHub
parent 6c1dc5596c
commit 366fd4653c
3 changed files with 129 additions and 0 deletions

View File

@@ -148,6 +148,7 @@ void AddSC_undercity();
void AddSC_western_plaguelands();
void AddSC_westfall();
//void AddSC_wetlands();
void AddSC_burning_steppes();
// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
@@ -285,4 +286,5 @@ void AddEasternKingdomsScripts()
AddSC_western_plaguelands();
AddSC_westfall();
//AddSC_wetlands();
AddSC_burning_steppes();
}

View File

@@ -14,3 +14,80 @@
* 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 "Player.h"
#include "ScriptMgr.h"
#include "ScriptedGossip.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();
}