教程--烈焰私服里面添加鉴定大师NPC
发表时间:2015-02-26 15:35点击人气:责任编辑:admin
首先在烈焰私服里面添加NPC的ID,然后增加如下脚本:
--鉴定大师
function ontalk2161(npc,event,player)
player:echo(0,npc:GetLowGUID(),[[
<img border="0"
src="../data/swnll/jd.jpg"></a>
#&talk_line#&
<font
color="#Fff2161">少侠,老夫就是神马都是浮云的鉴定大师</font></u>
#&talk_line#&
少侠如果你在世界冒险得到了不知道用途的东西那么就来找我吧
#&talk_line#&
<a
href='event:M2402,1'>鉴定</a>(需要金条一根)
<a href='event:M2402,2'>兑换</a>
]]);
end
ItemA = {
{1000,1001,1002,1003,1004,1005,1006,1007,1008,1009},
};
ItemA1 = {
{10075,11190},
};
function ontalk2161_1(npc,event,player)
if
player:get_item(ItemA1) >= 1 then
local i = math.random(1,3000);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(10132,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:vip12");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>vip12</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,2500);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(2000,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:中国心");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>中国心</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,2000);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1013,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:100元");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>100元</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,1500);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1012,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:50元");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>50元</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,1000);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1011,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:20元");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>20元</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,500);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1010,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:5元");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>5元</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,400);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1000,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:【古物碎片①】");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>【古物碎片①】</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,400);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1001,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:【古物碎片②】");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>【古物碎片②】</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,400);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1002,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:【古物碎片③】");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>【古物碎片③】</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,350);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1003,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:【古物碎片④】");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>【古物碎片④】</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,350);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1004,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:【古物碎⑤】");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>【古物碎片⑤】</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,350);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1005,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:【古物碎片⑥】");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>【古物碎片⑥】</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,300);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1006,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:【古物碎片⑦】");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>【古物碎片⑦】</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,300);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1007,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:【古物碎片⑧】");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>【古物碎片⑧】</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,300);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1008,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:【古物碎片⑨】");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>【古物碎片⑨】</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,300);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(1009,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:【古物碎片⑩】");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>【古物碎片⑩】</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,200);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(10076,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:骰子");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>骰子</font>",2,1000,0,1);
return 0;
end
local i = math.random(1,100);
if
i == 1 then
player:remove_item_level(ItemA1,1);
player:add_item(19098,1,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]鉴定【?????】获得:1000元宝");g_alert("<font
color='#FFFF00'>玩家</font><font
color='#FF0033'>["..player:GetName().."]</font><font
color='#FFFF00'>鉴定【?????】获得:</font><font
color='#FF0033'>1000元宝</font>",2,1000,0,1);
return 0;
else
player:alert(10,0,0,"您没有?????");
return 0;
end
else
player:alert(10,0,0,"您没有金条,我不能帮你鉴定");
return 0;
end
end
function ontalk2161_2(npc,event,player)
player:echo(0,npc:GetLowGUID(),[[
#&talk_line#&
#&item2000#& 需要 中国心 <u><a
href='event:M2402,5'>兑换</a></u>
#&item1000#& 需要 古物碎片 <u><a
href='event:M2402,6'>兑换</a></u>
<u><a href='event:M2402,0'><font
color="#ff2161">返回首页</font></a></u>
#&talk_line#&
]]);
end
function ontalk2161_6(npc,event,player)
if
player:get_item(ItemA,1) >= 1 then
player:remove_item_level(ItemA,1);
player:add_vcoin(5000000);
player:alert(10,0,0, "元宝+5000000");
else
player:alert(10,0,0,"您的古物碎片不足!");
ontalk2161(npc,0,player,0);
end
end
function ontalk2161_5(npc,event,player)
if
player:get_item(2000) >= 1 then
player:remove_item_level(2000,1)
player:add_vcoin(10000000);
player:alert(110,0,0,"恭喜你兑换成功,获得1000w元宝");
else
player:alert(10,0,0,"您没有中国心,无法兑换");
end
player:alert(10,0,0, "元宝+1000w");
ontalk2161(npc,0,player,0);
end
Npc2161Funid =
{
[0] = ontalk2161;
[1] = ontalk2161_1;
[2] = ontalk2161_2;
[5] = ontalk2161_5;
[6] = ontalk2161_6;
}
function CreatureNpcFun(npc,event,player,funid)
if
funid == 12161 then
ontalk2161(npc,0,player,0);
return;
end
if
Npc2161Funid[funid] ~= nil then
Npc2161Funid[funid](npc,event,player);
end
end
RegisterUnitEvent(2161,20,"ontalk2161")
RegisterUnitEvent(2161,29,"CreatureNpcFun")
这里的NPC代码是2161,添加后点保存即可
- 上一篇:烈焰服务端充值福利官充值返利脚本
- 下一篇:烈焰召唤宠物BB的NPC脚本方法