最新最全最权威的各类手游,端游,页游游戏信息开服信息,尽在游民之家. 订阅微信

烈焰私服服务端增加元宝抽奖脚本

发表时间:2017-12-15 07:09点击人气:责任编辑:admin
zsjs = 1000;	--总随机数
dc1 = 700;		--低档装备随机数
dc2 = 144;		--中档装备随机数
dc3 = 100;		--高档装备随机数
dc4 = 50;		--中档装备随机数
dc5 = 5;		--中档装备随机数
dc6 = 1;		--高档装备随机数
bzjf = 500000;	--积分
id = {
	{40222,50222,60222,70222,40223,50223,60223,70223,40224,50224,60224,70224,90222,100222,90223,100223,90224,100224},
	{150005,160005,170005,180005,150006,160006,170006,180006,20902,30905,18100,18101},
	{40227,50227,60227,70227,90227,100227,40226,50226,60226,70226,90226,100226,40225,50225,60226,70225,90226,100225,10058,10902},
	{10287,10288,10059},
	{40229,70229,60229,50229,90229,100229,40228,70228,60228,50228,90228,100228,40230,50230,60230,70230,90230,100230},
	{40231,50231,60231,70231,90231,100231,40232,50232,60232,70232,90232,100232,40233,50233,60233,70233,90233,100233,20911,30921,30922},
}
mz = {
{"六合归一战盔","六合归一战戒","六合归一战手","六合归一战手","六合归一战链","六合归一道盔","六合归一道戒","六合归一道手","六合归一道手","六合归一道链","六合归一法盔","六合归一法戒","六合归一法手","六合归一法手","六合归一法链","六合归一战带","六合归一战靴","六合归一道带","六合归一道靴","六合归一法带","六合归一法靴"},
{"【主宰】烈焰·头巾(战)","【主宰】烈焰·吊坠(战)","【主宰】烈焰·护肩(战)","【主宰】烈焰·护膝(战)","【主宰】烈焰·头巾(法)","【主宰】烈焰·吊坠(法)","【主宰】烈焰·护肩(法)","【主宰】烈焰·护膝(法)","【主宰】烈焰·神剑","【主宰】烈焰·神甲(男)","烈焰锻造石","锻造石碎片"},
{"【心】八荒破灭道盔","【心】八荒破灭道戒","【心】八荒破灭道手","【心】八荒破灭道链","【心】八荒破灭道带","【心】八荒破灭道靴","【心】八荒破灭法盔","【心】八荒破灭法戒","【心】八荒破灭法手","【心】八荒破灭法链","【心】八荒破灭法带","【心】八荒破灭法靴","【心】八荒破灭战盔","【心】八荒破灭战戒","【心】八荒破灭战手","【心】八荒破灭战链","【心】八荒破灭战带","【心】八荒破灭战靴","上古锻造石","混元转身丹(中)"},
{"灭世水晶","龙鳞碎片","补天石"},
{"【心】十介灭世法盔","【心】十介灭世法链","【心】十介灭世法手","【心】十介灭世法戒","【心】十介灭世法带","【心】十介灭世法靴","【心】十介灭世战盔","【心】十介灭世战链","【心】十介灭世战手","【心】十介灭世战戒","【心】十介灭世战带","【心】十介灭世战靴","【心】十介灭世道盔","【心】十介灭世道戒","【心】十介灭世道手","【心】十介灭世道链","【心】十介灭世道带","【心】十介灭世道靴"},
{"【心】金麟.狂战盔","【心】金麟.狂战戒","【心】金麟.狂战手","【心】金麟.狂战链","【心】金麟.狂战带","【心】金麟.狂战靴","【心】金麟.狂法盔","【心】金麟.狂法戒","【心】金麟.狂法手","【心】金麟.狂法链","【心】金麟.狂法带","【心】金麟.狂法靴","【心】金麟.狂道盔","【心】金麟.狂道戒","【心】金麟.狂道手","【心】金麟.狂道链","【心】金麟.狂道带","【心】金麟.狂道靴","(金麟)霸者●神兵","(金麟)霸者●时装男","(金麟)霸者●时装女"},
}
ItemA55= {
{40222,50222,60222,70222,40223,50223,60223,70223,40224,50224,60224,70224,90222,100222,90223,100223,90224,100224},
};
ItemA66= {
{150005,160005,170005,180005,150006,160006,170006,180006,20902,30905},
};
ItemA77= {
{40227,50227,60227,60225,90225,70227,90227,100227,40226,50226,60226,70226,90226,100226,40225,50225,60226,70225,90226,100225},
};
ItemA88= {
{40229,70229,60229,50229,90229,100229,40228,70228,60228,50228,90228,100228,40230,50230,60230,70230,90230,100230},
};

function ontalk1935(npc,event,player)

player:echo(0,npc:GetLowGUID(),[[
#&talk_line#& 
抽奖玩法介绍:50W抽一次
抽出装备几率:6介 8介  10介心法 功勋装备 
              主宰武器 衣服 4格 英雄碎片
材料几率:锻造石 上古 补天 水晶 补天 龙鳞碎片  
转身几率:转身经验丹 小 中  休仙石
<font color="#FFCC00">更有几率抽到金鳞心法套终极装备  金鳞时装  金鳞神兵</font> 
<font color="#FF0000">注: 本服金鳞心法套装备  金鳞神兵 金鳞时装不出售,</font> 
     可用抽奖积分兑换或者打金鳞魔域地图爆出!

#&talk_line#&
   抽奖积分换取物品:    <u><a href='event:M2402,2'>点击查看积分兑换</a></u>
#&talk_line#&

  开始抽奖: <u><a href='event:M2402,888'>【1次】</a></u>    <u><a href='event:M2402,10'>【10次】</a></u>    <u><a href='event:M2402,50'>【50次】</a></u>
#&talk_line#&

  <a href='event:M2402,30'>回收六合</a>    <a href='event:M2402,31'>回收主宰</a>    <a href='event:M2402,32'>回收八荒</a>    <a href='event:M2402,33'>回收十介</a>
]]);
end

function ontalk1935_30(npc,player)	
	local ItemNum = 0; 
	local Expr = 0;
	local Goldr = 0;
	local xxjy = 0;
	for k = 1,#ItemA55 do
		for i = 1,#ItemA55[k] do
			local n = player:num_item_level(ItemA55[k][i],1);
			if n >= 1 then
				player:remove_item_level(ItemA55[k][i],n,1);
				ItemNum = ItemNum + n;
				Expr = Expr + 10000000 * n;
				Goldr = Goldr + 1000 * n;
				xxjy = xxjy + 10 * n;
			end
		end
	end
	if ItemNum >= 1 then
		player:add_exp(Expr);
		player:add_vcoin(Goldr);
		player:set_param(237,player:get_param(237)+xxjy);
		player:alert(10,0,0,"您一共回收了" .. ItemNum .. "件装备!");
		player:alert(10,0,0,"经验+" .. Expr .. "  元宝+" .. Goldr .."  修仙经验+" .. xxjy .."");
	else
		player:alert(10,0,0,"您没有可回收装备!");
	end
	ontalk1935(npc,event,player);
end
function ontalk1935_31(npc,player)	
	local ItemNum = 0; 
	local Expr = 0;
	local Goldr = 0;
	local xxjy = 0;
	for k = 1,#ItemA66 do
		for i = 1,#ItemA66[k] do
			local n = player:num_item_level(ItemA66[k][i],1);
			if n >= 1 then
				player:remove_item_level(ItemA66[k][i],n,1);
				ItemNum = ItemNum + n;
				Expr = Expr + 10000000 * n;
				Goldr = Goldr + 1000 * n;
				xxjy = xxjy + 10 * n;
			end
		end
	end
	if ItemNum >= 1 then
		player:add_exp(Expr);
		player:add_vcoin(Goldr);
		player:set_param(237,player:get_param(237)+xxjy);
		player:alert(10,0,0,"您一共回收了" .. ItemNum .. "件装备!");
		player:alert(10,0,0,"经验+" .. Expr .. "  元宝+" .. Goldr .."  修仙经验+" .. xxjy .."");
	else
		player:alert(10,0,0,"您没有可回收装备!");
	end
	ontalk1935(npc,event,player);
end
function ontalk1935_32(npc,player)	
	local ItemNum = 0; 
	local Expr = 0;
	local Goldr = 0;
	local xxjy = 0;
	for k = 1,#ItemA77 do
		for i = 1,#ItemA77[k] do
			local n = player:num_item_level(ItemA77[k][i],1);
			if n >= 1 then
				player:remove_item_level(ItemA77[k][i],n,1);
				ItemNum = ItemNum + n;
				Expr = Expr + 10000000 * n;
				Goldr = Goldr + 1000 * n;
				xxjy = xxjy + 10 * n;
			end
		end
	end
	if ItemNum >= 1 then
		player:add_exp(Expr);
		player:add_vcoin(Goldr);
		player:set_param(237,player:get_param(237)+xxjy);
		player:alert(10,0,0,"您一共回收了" .. ItemNum .. "件装备!");
		player:alert(10,0,0,"经验+" .. Expr .. "  元宝+" .. Goldr .."  修仙经验+" .. xxjy .."");
	else
		player:alert(10,0,0,"您没有可回收装备!");
	end
	ontalk1935(npc,event,player);
end
function ontalk1935_33(npc,player)	
	local ItemNum = 0; 
	local Expr = 0;
	local Goldr = 0;
	local xxjy = 0;
	local xxjy1 = 0;
	for k = 1,#ItemA88 do
		for i = 1,#ItemA88[k] do
			local n = player:num_item_level(ItemA88[k][i],1);
			if n >= 1 then
				player:remove_item_level(ItemA88[k][i],n,1);
				ItemNum = ItemNum + n;
				Expr = Expr + 10000000 * n;
				Goldr = Goldr + 1000 * n;
				xxjy = xxjy + 10 * n;
				xxjy1 = xxjy1 + 20 * n;
				
			end
		end
	end
	if ItemNum >= 1 then
		player:add_exp(Expr);
		player:add_vcoin(Goldr);
		player:set_param(237,player:get_param(237)+xxjy);
		player:set_param(232,player:get_param(232)+xxjy1);
		player:alert(10,0,0,"您一共回收了" .. ItemNum .. "件装备!");
		player:alert(10,0,0,"经验+" .. Expr .. " 混元转身经验值+" .. xxjy1 .." 元宝+" .. Goldr .."  修仙经验+" .. xxjy .."");
	else
		player:alert(10,0,0,"您没有可回收装备!");
	end
	ontalk1935(npc,event,player);
end

function ontalk1935_2(npc,player)	
player:echo(0,npc:GetLowGUID(),[[
#&talk_line#&
你当前的抽奖积分为:]]..player:get_param(234)..[[ 


#&item10902#& 200积分换:转身经验丹(中)  <u><a href='event:M2402,21'>换取</a></u>
#&item40231#& 800积分换:金鳞首饰        <u><a href='event:M2402,22'>换取</a></u> 
#&item20911#&1500积分换:金鳞神兵        <u><a href='event:M2402,23'>换取</a></u> 
#&item30921#&1000积分换:金鳞时装        <u><a href='event:M2402,24'>换取</a></u> 
#&item140015#&1000积分换:金鳞魂珠        <u><a href='event:M2402,25'>换取</a></u>     
#&talk_line#&
                                      <u><a href='event:M2402,0'>返回</a></u>
]]);
end
function ontalk1935_25(npc,player)
	if player:get_param(234) >= 1000 then
		player:add_item(140015,1,1);
		player:set_param(234,player:get_param(234)-1000 );
		player:alert(10,1000,1,"你兑换金鳞魂珠!");
	else
		player:alert(10,1000,1,"你的积分不足1000无法兑换!");	
	end
	ontalk1935_2(npc,player);
end
function ontalk1935_21(npc,player)
	if player:get_param(234) >= 200 then
		player:add_item(10902,1,0);
		player:set_param(234,player:get_param(234)-200 );
		player:alert(10,1000,1,"你兑换转身经验丹(中)!");
	else
		player:alert(10,1000,1,"你的积分不足200无法兑换!");	
	end
	ontalk1935_2(npc,player);
end
function ontalk1935_23(npc,player)
	if player:get_param(234) >= 1500 then
		player:add_item(20911,1,0);
		player:set_param(234,player:get_param(234)-1500 );
		player:alert(10,1000,1,"你兑换金鳞神兵!");
	else
		player:alert(10,1000,1,"你的积分不足1500无法兑换!");	
	end
	ontalk1935_2(npc,player);
end
function ontalk1935_24(npc,player)
	if player:get_param(234) >= 1000 then
		if player:get_gender() == 1 then 
			player:add_item(30921,1,0);
		else
			player:add_item(30922,1,0);
		end
		player:set_param(234,player:get_param(234)-1000 );
		player:alert(10,1000,1,"你兑换金鳞时装!");
	else
		player:alert(10,1000,1,"你的积分不足1000无法兑换!");	
	end
	ontalk1935_2(npc,player);
end

function ontalk1935_22(npc,player)	
if player:get_job() == 1 then
player:echo(0,npc:GetLowGUID(),[[
你当前的抽奖积分为:]]..player:get_param(234)..[[ 

#&item40231#&800积分换【心】金麟.狂战盔  <u><a href='event:M2402,101'>换取</a></u>
#&item50231#&800积分换【心】金麟.狂战戒  <u><a href='event:M2402,102'>换取</a></u> 
#&item60231#&800积分换【心】金麟.狂战手  <u><a href='event:M2402,103'>换取</a></u> 
#&item70231#&800积分换【心】金麟.狂战链  <u><a href='event:M2402,104'>换取</a></u> 
#&item90231#&800积分换【心】金麟.狂战带  <u><a href='event:M2402,105'>换取</a></u>  
#&item100231#&800积分换【心】金麟.狂战靴  <u><a href='event:M2402,106'>换取</a></u>     
#&talk_line#&
                                      <u><a href='event:M2402,0'>返回</a></u>
]]);
elseif player:get_job() == 2 then
player:echo(0,npc:GetLowGUID(),[[
你当前的抽奖积分为:]]..player:get_param(234)..[[  

#&item40232#&800积分换【心】金麟.圣魔盔  <u><a href='event:M2402,101'>换取</a></u>
#&item50232#&800积分换【心】金麟.圣魔戒  <u><a href='event:M2402,102'>换取</a></u> 
#&item60232#&800积分换【心】金麟.圣魔手  <u><a href='event:M2402,103'>换取</a></u> 
#&item70232#&800积分换【心】金麟.圣魔链  <u><a href='event:M2402,104'>换取</a></u> 
#&item90232#&800积分换【心】金麟.圣魔带  <u><a href='event:M2402,105'>换取</a></u>  
#&item100232#&800积分换【心】金麟.圣魔靴  <u><a href='event:M2402,106'>换取</a></u>     
#&talk_line#&
                                      <u><a href='event:M2402,0'>返回</a></u>
]]);
else
player:echo(0,npc:GetLowGUID(),[[
你当前的抽奖积分为:]]..player:get_param(234)..[[  

#&item40233#&800积分换【心】金麟.真魂盔  <u><a href='event:M2402,101'>换取</a></u>
#&item50233#&800积分换【心】金麟.真魂戒  <u><a href='event:M2402,102'>换取</a></u> 
#&item60233#&800积分换【心】金麟.真魂手  <u><a href='event:M2402,103'>换取</a></u> 
#&item70233#&800积分换【心】金麟.真魂链  <u><a href='event:M2402,104'>换取</a></u> 
#&item90233#&800积分换【心】金麟.真魂带  <u><a href='event:M2402,105'>换取</a></u>  
#&item100233#&800积分换【心】金麟.真魂靴  <u><a href='event:M2402,106'>换取</a></u>     
#&talk_line#&
                                      <u><a href='event:M2402,0'>返回</a></u>
]]);
end
end
function ontalk1935_101(npc,player)
	if player:get_param(234) >= 800 then
		player:set_param(234,player:get_param(234)-800 );
		if player:get_job() == 1 then 
			player:add_item(40231,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.狂战盔!");
		elseif player:get_job() == 2 then 
			player:add_item(40232,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.圣魔盔!");
		else
			player:add_item(40233,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.真魂盔!");
		end
	else
		player:alert(10,1000,1,"你的积分不足800无法兑换!");	
	end
	ontalk1935_22(npc,player);
end
function ontalk1935_102(npc,player)
	if player:get_param(234) >= 800 then
		player:set_param(234,player:get_param(234)-800 );
		if player:get_job() == 1 then 
			player:add_item(50231,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.狂战戒!");
		elseif player:get_job() == 2 then 
			player:add_item(50232,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.圣魔戒!");
		else
			player:add_item(50233,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.真魂戒!");
		end
	else
		player:alert(10,1000,1,"你的积分不足800无法兑换!");	
	end
	ontalk1935_22(npc,player);
end
function ontalk1935_103(npc,player)
	if player:get_param(234) >= 800 then
		player:set_param(234,player:get_param(234)-800 );
		if player:get_job() == 1 then 
			player:add_item(60231,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.狂战手!");
		elseif player:get_job() == 2 then 
			player:add_item(60232,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.圣魔手!");
		else
			player:add_item(60233,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.真魂手!");
		end
	else
		player:alert(10,1000,1,"你的积分不足800无法兑换!");	
	end
	ontalk1935_22(npc,player);
end
function ontalk1935_104(npc,player)
	if player:get_param(234) >= 800 then
		player:set_param(234,player:get_param(234)-800 );
		if player:get_job() == 1 then 
			player:add_item(70231,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.狂战链!");
		elseif player:get_job() == 2 then 
			player:add_item(70232,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.圣魔链!");
		else
			player:add_item(70233,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.真魂链!");
		end
	else
		player:alert(10,1000,1,"你的积分不足800无法兑换!");	
	end
	ontalk1935_22(npc,player);
end
function ontalk1935_105(npc,player)
	if player:get_param(234) >= 800 then
		player:set_param(234,player:get_param(234)-800 );
		if player:get_job() == 1 then 
			player:add_item(90231,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.狂战带!");
		elseif player:get_job() == 2 then 
			player:add_item(90232,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.圣魔带!");
		else
			player:add_item(90233,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.真魂带!");
		end
	else
		player:alert(10,1000,1,"你的积分不足800无法兑换!");	
	end
	ontalk1935_22(npc,player);
end
function ontalk1935_106(npc,player)
	if player:get_param(234) >= 800 then
		player:set_param(234,player:get_param(234)-800 );
		if player:get_job() == 1 then 
			player:add_item(100231,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.狂战靴!");
		elseif player:get_job() == 2 then 
			player:add_item(100232,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.圣魔靴!");
		else
			player:add_item(100233,1,0);
			player:alert(10,1000,1,"你兑换【心】金麟.真魂靴!");
		end
	else
		player:alert(10,1000,1,"你的积分不足800无法兑换!");	
	end
	ontalk1935_22(npc,player);
end
function ontalk1935_10(npc,player)
	local i = 10;
	for j=1,i do
		ontalk1935_888(npc,player);
    end
end
function ontalk1935_50(npc,player)
	local i = 50;
	for j=1,i do
		ontalk1935_888(npc,player);
    end
end
function ontalk1935_888(npc,player)
	if player:num_bag_black() >= 1 then
		if player:get_vcoin() >=  bzjf then
			player:sub_vcoin(bzjf);
			player:set_param(234,player:get_param(234)+1 );
			local n = math.random(1,zsjs);
			local n = math.random(1,zsjs);
			if n == dc6 then
				x = table.getn(id[6])
				local i = math.random(1,x);
				player:add_item(id[6][i],1,0);
				player:alert(19,0,0,"抽奖获得:"..mz[6][i].."");
				g_broadcast(14,0,0,"[<font color='#FF0000'>"..player:GetName().."</font>]抽奖获得:"..mz[6][i].."");
				
				g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]抽奖获得:"..mz[6][i].."",2,1000,0,1);
				return;
			elseif n <= dc1 then
				x = table.getn(id[1])
				local i = math.random(1,x);
				player:add_item(id[1][i],1,0);
								
			elseif n <= (dc1+dc2) then  --随机数 小于或者等于980
				x = table.getn(id[2])
				local i = math.random(1,x);
				player:add_item(id[2][i],1,0);
				player:alert(19,0,0,"抽奖获得:"..mz[2][i].."");
					
			elseif n <= (dc1+dc2+dc3) then  --随机数 小于或者等于980
				x = table.getn(id[3])
				local i = math.random(1,x);
				player:add_item(id[3][i],1,0);
				player:alert(19,0,0,"抽奖获得:"..mz[3][i].."");
				g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]抽奖获得:"..mz[3][i].."",2,1000,0,1);	
			elseif n <= (dc1+dc2+dc3+dc4) then  --随机数 小于或者等于980
				x = table.getn(id[4])
				local i = math.random(1,x);
				player:add_item(id[4][i],1,0);
				player:alert(19,0,0,"抽奖获得:"..mz[4][i].."");
				g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]抽奖获得:"..mz[4][i].."",2,1000,0,1);	
			else
				x = table.getn(id[5])
				local i = math.random(1,x);
				player:add_item(id[5][i],1,0);
				player:alert(19,0,0,"抽奖获得:"..mz[5][i].."");
				g_broadcast(14,0,0,"[<font color='#FF0000'>"..player:GetName().."</font>]抽奖获得:"..mz[5][i].."");
			end
		else
			player:alert(10,0,0,"抽奖失败,您没有"..bzjf.."元宝!");
		end
	else
		player:alert(10,0,0,"抽奖失败,您的背包已满!");
	end
  
end

Npc1935Funid = 
{
[0] = ontalk1935;
[1] = ontalk1935_1;
[2] = ontalk1935_2;
[22] = ontalk1935_22;
[23] = ontalk1935_23;
[24] = ontalk1935_24;
[25] = ontalk1935_25;
[21] = ontalk1935_21;
[30] = ontalk1935_30;
[31] = ontalk1935_31;
[32] = ontalk1935_32;
[33] = ontalk1935_33;
[101] = ontalk1935_101;
[102] = ontalk1935_102;
[103] = ontalk1935_103;
[104] = ontalk1935_104;
[105] = ontalk1935_105;
[106] = ontalk1935_106;
[10] = ontalk1935_10;
[50] = ontalk1935_50;
[888] = ontalk1935_888;
}

function funid(npc,event,player,funid)
	if Npc1935Funid[funid] ~= nil then
		Npc1935Funid[funid](npc,player);
	end
end

RegisterUnitEvent(1935,20,"ontalk1935")
RegisterUnitEvent(1935,29,"funid")