#include "StdAfx.h"
#include "Setup.h"
class SCRIPT_DECL BuffNPC1 : public GossipScript
{
public:
void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
void GossipEnd(Object * pObject, Player* Plr);
void Destroy()
{
delete this;
}
};
void BuffNPC1::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(0, " 10级保护 - 需要1金 " , 1);
Menu->AddItem(0, " 20级保护 - 需要2金 " , 2);
Menu->AddItem(0, " 30级保护 - 需要3金 " , 3);
Menu->AddItem(0, " 40级保护 - 需要4金 " , 4);
Menu->AddItem(0, " 50级保护 - 需要5金 " , 5);
if(AutoSend)
Menu->SendTo(Plr);
}
void BuffNPC1::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
if(pCreature==NULL)
return;
GossipMenu * Menu;
switch(IntId)
{
case 0: // Return to start
GossipHello(pObject, Plr, true);
break;
case 1:
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
if(Plr->getLevel() >= 10)
{
Menu->AddItem(5, " 力量 " , 8);
Menu->AddItem(5, " 智力 " , 9);
Menu->AddItem(5, " 毅力 " , 10);
Menu->AddItem(5, " 精神 " , 11);
Menu->AddItem(5, " 敏捷 " , 12);
Menu->AddItem(5, " 护甲 " , 43);
Menu->AddItem(0, " |cffff0000返回|r ", 99);
Menu->SendTo(Plr);
}
else{
pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, " 你必须到达10级才能使用这功能. " );
}
}
break;
case 2:
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
if(Plr->getLevel() >= 20)
{
Menu->AddItem(5, " 力量 " , 13);
Menu->AddItem(5, " 智力 " , 14);
Menu->AddItem(5, " 毅力 " , 15);
Menu->AddItem(5, " 精神 " , 16);
Menu->AddItem(5, " 敏捷 " , 17);
Menu->AddItem(5, " 护甲 " , 44);
Menu->AddItem(0, " |cffff0000返回|r ", 99);
Menu->SendTo(Plr);
}
else{
pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, " 你必须到达20级才能使用这功能. " );
}
}
break;
case 3:
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
if(Plr->getLevel() >= 30)
{
Menu->AddItem(5, " 力量 " , 18);
Menu->AddItem(5, " 智力 " , 19);
Menu->AddItem(5, " 毅力 " , 20);
Menu->AddItem(5, " 精神 " , 21);
Menu->AddItem(5, " 敏捷 " , 22);
(责任编辑:admin) |