Olá alguém tem script de um npc em C++
para remover cd após um duelo grato.
para remover cd após um duelo grato.
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("Você não pode usar isso em combate!");
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 e HP/Mana resetados!");
break;
case 1:
Player->PlayerTalkClass->SendCloseGossip();
break;
default:
Player->PlayerTalkClass->SendCloseGossip();
break;
}
return true;
}
};
void AddSC_DuelReset_NPC()
{
new Duel_Reset_NPC;
}