织梦CMS - 轻松建站从此开始!

天堂系列-新天堂II殿堂级|传奇天堂3发布网站 TT3SF.COM

当前位置: 主页 > 天堂2私服 >

魔兽私服NPC增加玩家属性

时间:2011-06-05 12:03来源: 作者: 点击:
#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, c

#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)

织梦二维码生成器
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
验证码: 点击我更换图片
栏目列表
推荐内容