Dae Galera ! , Vou postar um NPC que no básico tem estas funções :
Reseta Spells
Reseta talentos.
Regenera o Health.
Reseta gold.
Reseta Honor.
Reseta Spells
Reseta talentos.
Regenera o Health.
Reseta gold.
Reseta Honor.
Código:
#include "ScriptPCH.h"
// By Arphenion
class reset_npc : public CreatureScript
{
public:
reset_npc() : CreatureScript("reset_npc"){}
bool OnGossipHello(Player * pPlayer, Creature * pCreature)
{
pPlayer->ADD_GOSSIP_ITEM(7, "I would like to reset my talent.", GOSSIP_SENDER_MAIN, 0);
pPlayer->ADD_GOSSIP_ITEM(7, "I would like to reset my spells.", GOSSIP_SENDER_MAIN, 1);
pPlayer->ADD_GOSSIP_ITEM(7, "Regenerate my Health.", GOSSIP_SENDER_MAIN, 2);
pPlayer->ADD_GOSSIP_ITEM(7, "Reset my honor.", GOSSIP_SENDER_MAIN, 3);
pPlayer->ADD_GOSSIP_ITEM(7, "Reset my gold.", GOSSIP_SENDER_MAIN, 4);
pPlayer->PlayerTalkClass->SendGossipMenu(900, pCreature->GetGUID());
return true;
}
bool OnGossipSelect(Player * pPlayer, Creature * pCreature, uint32 sender, uint32 uiAction)
{
pPlayer->PlayerTalkClass->ClearMenus();
switch(uiAction)
{
case 0:
pPlayer->resetTalents(true);
pCreature->MonsterWhisper("Your talents has been reset.", pPlayer->GetGUID());
break;
case 1:
pPlayer->resetSpells(false);
pCreature->MonsterWhisper("Your spells has been reset.", pPlayer->GetGUID());
break;
case 2:
pPlayer->RegenerateHealth();
pCreature->MonsterWhisper("You have been healed.", pPlayer->GetGUID());
break;
case 3:
pPlayer->SetHonorPoints(0);
pCreature->MonsterWhisper("Your honor has been reset.", pPlayer->GetGUID());
break;
case 4:
pPlayer->SetMoney(0);
pCreature->MonsterWhisper("Your gold has been reset.", pPlayer->GetGUID());
break;
}
return true;
}
};
void AddSC_reset_npc()
{
new reset_npc();
}
Print : [Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]
Créditos : Arphenion
Créditos : Arphenion