PDA

View Full Version : [Funservers NPC] Yolo Item Giver



Wise
01-10-13, 12:23 PM
[TC][Funservers NPC] Yolo Item Giver


#include "ScriptMgr.h"


class YOLO_NPC : public CreatureScript
{
public:
YOLO_NPC() : CreatureScript("YOLO_NPC") { }

bool OnGossipHello(Player* player, Creature* creature)
{
player->ADD_GOSSIP_ITEM(2, "I want to go yolo,give me my yolo item!", GOSSIP_SENDER_MAIN, 1);
player->ADD_GOSSIP_ITEM(9, "[CLOSE]", GOSSIP_SENDER_MAIN, 2);
player->SEND_GOSSIP_MENU(1, creature->GetGUID());
return true;

}

bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();

switch(uiAction)
{
case 1:
player->AddItem(urand(1,56500), 1);
player->CLOSE_GOSSIP_MENU();
break;
case 2:
player->CLOSE_GOSSIP_MENU();
break;
}
return true;
}
};
void AddSC_YOLO_NPC()
{
new YOLO_NPC();
}

Credits : tourette