Código:
#include "ScriptPCH.h"
class Duel_Reset_NPC : public CreatureScript
{
public:
Duel_Reset_NPC() : CreatureScript("Duel_Reset_NPC"){}
bool OnGossipHello(Player * Player, Creature * pCreature)
{
if(Player->isInCombat())
{
WorldSession * m_session = Player->GetSession();
m_session->SendNotification("You can't use me while in combat!");
return false;
}
Player->ADD_GOSSIP_ITEM(4, "Reset my cooldowns!", GOSSIP_SENDER_MAIN, 0);
Player->ADD_GOSSIP_ITEM(4, "Nevermind.", GOSSIP_SENDER_MAIN, 1);
Player->PlayerTalkClass->SendGossipMenu(8548, pCreature->GetGUID());
return true;
}
bool OnGossipSelect(Player * Player, Creature * Creature, uint32 /*uiSender*/, uint32 uiAction)
{
if(!Player)
return true;
WorldSession * m_session = Player->GetSession();
switch(uiAction)
{
case 0:
Player->RemoveAllSpellCooldown();
Player->SetHealth(Player->GetMaxHealth());
if ( Player->getPowerType() == POWER_MANA )
Player->SetPower(POWER_MANA, Player->GetMaxPower(POWER_MANA));
Player->PlayerTalkClass->SendCloseGossip();
m_session->SendNotification("Cooldowns and Heatlh/Mana reset!");
break;
case 1:
Player->PlayerTalkClass->SendCloseGossip();
break;
default:
Player->PlayerTalkClass->SendCloseGossip();
break;
}
return true;
}
};
void AddSC_DuelReset_NPC()
{
new Duel_Reset_NPC;
}
OBS: Você precisa ter o Script de Duel Reset, ja implantado em seu Servidor.
Créditos: Inertia