|
根据调查,在烈焰开服表里的很多烈焰私服的GM都想搞个装备合成有几率失败的脚本,以下脚本是小编写好的一个实例,可供参考
function ontalk2034_110162(npc,event,player)
if player:num_item(20905,1) >= 1 and player:num_item_level(19105,1) >= 2 and player:num_item_level(19106,1) >= 2 and player:num_item_level(19107,1) >= 2 and player:num_item_level(19108,1) >= 2 and player:num_item_level(19109,1) >= 5 then
local i = math.random(1,100);
if i <= 10 then --设置几率,可随意更改你所需要的几率
player:remove_item(19105,2,1);
player:remove_item(19106,2,1);
player:remove_item(19107,2,1);
player:remove_item(19109,5,1);
player:update_item(20905,20909,1);
player:alert(10,0,0,"恭喜您,成功锻造:【神兵】圣★剑");
g_alert("<font color='#FFFF00'>玩家</font>以<font color='#84C1FF'>百分之十</font>的概率<font color='#84C1FF'>"..player:GetName().."</font>成功升级了:<font color='#FF00FF'>【神兵】圣★剑</font>",2,1000,0,1);
player:alert(4,1000,1,"玩家["..player:GetName().."]成功升级了:【神兵】圣★剑");
else
player:remove_item(19105,2,1);
player:remove_item(19106,2,1);
player:remove_item(19107,2,1);
player:remove_item(19109,5,1);
player:alert(10,0,0,"锻造:【神兵】圣★剑 失败,材料消失");
g_alert("<font color='#FFFF00'>玩家</font>以<font color='#84C1FF'>百分之十</font>的概率<font color='#84C1FF'>"..player:GetName().."</font>锻造:<font color='#FF00FF'>【神兵】圣★剑</font> <font color='#8F8F8F'>失败</font>",2,1000,0,1);
end
else
player:alert(10,0,0,"升级失败失败!<br>锻造条件:【战圣】开天·圣剑+玄铁x2+沃玛之心x2+祖玛头像x2+补天石x2+【神兵】圣★剑碎片x5!");
end
ontalk2034_50(npc,0,player,0);
end
520页游论坛 www.ye520.com 欢迎您常来!!
|
|