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

烈焰私服服务端增加BOSS击杀榜脚本

发表时间:2017-12-15 07:11点击人气:责任编辑:admin
banmapidlist = {88,505,506,508,509,510,511,512,515,520,525,526,528,532,533,534,542,545,546,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,672};--(禁止传送的地图)
function  in_array(b,list)
    if not list then
       return false;   
    end 
        if list then
			local fit=false;
           for k=1,#list do
               if list[k] ==b then
                fit=true;
				break;
				  
               end
           end
		  return fit;
        end
   end 
--定义全局数组变量
eren={};

function ontalk2208(npc,event,player)
  local t = tonumber(os.date("%m%d",os.time()));
	player:echo(0,npc:GetLowGUID(),[[

<font color="#F76809">击杀BOSS排行榜(只显示在线)每天24点清空击杀数,
单天击杀BOSS排行第一的玩家,可领取丰厚奖励,
兄弟还傻站着,赶紧行动呀!第一名奖励100W烈焰币!
领奖时间:22:00 - 22:30分,过时不候哦!
哦,对了,要击杀500级以上BOSS哦</font>
#&talk_line#&
]]);
	local isF = true;
	for k,v in pairs(GetPlayersInWorld()) do
		eren[k] = {};
		eren[k][0] = v:get_param(243);	--杀人数
		eren[k][1] = v:GetName();		    --角色名
		eren[k][2] = v:GetMapId();	    --地图ID
		eren[k][3] = v:GetX();			    --坐标X
		eren[k][4] = v:GetY();			    --坐标Y
	end
	local m = table.getn(eren);
	for n = m - 1,1,-1 do
		isF = true;
		for i = m - 1,1,-1 do
			if eren[i][0] < eren[i+1][0] then
				eren[i][0],eren[i+1][0] = eren[i+1][0],eren[i][0];
				eren[i][1],eren[i+1][1] = eren[i+1][1],eren[i][1];
				eren[i][2],eren[i+1][2] = eren[i+1][2],eren[i][2];
				eren[i][3],eren[i+1][3] = eren[i+1][3],eren[i][3];
				eren[i][4],eren[i+1][4] = eren[i+1][4],eren[i][4];
				isF = false;
			end
		end
		if isF then
		break end
	end
	if m >= 10 then
		for i = 1,10 do
		  if player:GetName() == eren[i][1] then
			player:echo(0,npc:GetLowGUID(),[[
 第[]]..i..[[]名 BOSS积分]]..eren[i][0]..[[点 ]]..eren[i][1]..[[  
]]);
    else
		  if player:GetName() ~= eren[i][1] then
        player:echo(0,npc:GetLowGUID(),[[
<a href='event:M2402,]]..i..[['>排行</a> 第[]]..i..[[]名 BOSS积分]]..eren[i][0]..[[点 ]]..eren[i][1]..[[  
]]);
		  end
	  end
	end
	else
		for i = 1,m do
		  if player:GetName() == eren[i][1] then
        player:echo(0,npc:GetLowGUID(),[[
排行 第[]]..i..[[]名 BOSS积分]]..eren[i][0]..[[点 ]]..eren[i][1]..[[  
]]);
        else
		    if player:GetName() ~= eren[i][1] then
        player:echo(0,npc:GetLowGUID(),[[
排行 第[]]..i..[[]名 BOSS积分]]..eren[i][0]..[[点 ]]..eren[i][1]..[[  
]]);
             end
        end
    end
end
			player:echo(0,npc:GetLowGUID(),[[
#&talk_line#&
  <font color="#FFCC00"><u><a href='event:M2402,100'>领取击杀榜第一奖励</font></a></u>		<u><a href='event:M2402,888'>刷新</a></u>
]]);
end






function ontalk2208_100(npc,event,player)
	local t = tonumber(os.date("%H%M",os.time()));
	if t >= 2200 and t <= 2230 then
		for k = 1,table.getn(eren) do
			if eren[k][1] ~= nil then
				if player:get_param(356) == 0 then
				    if g_get_param(61) < 1 then
				    if player:num_bag_black() >= 1 then	
					if player:GetName() == eren[1][1]  then  
						player:add_vcoin_bind(1000000);   ----烈焰币
						g_set_param(61,g_get_param(61) + 1);
						player:set_param(356,1);	  --记录领奖
						player:alert(10,0,0,"获得100W烈焰币奖励");
						g_alert("<font color='#FF0000'>玩家:  </font><font color='#00FF00'>"..player:GetName().."</font><font color='#FFCC00'>  领取了击杀BOSS排行第一奖励</font><font color='#FF0000'>获得100W烈焰币奖励</font>",2,1000,0,1);
						player:alert(4,1000,1,"玩家:[<font color='#FF0000'>"..player:GetName().."</font>]   领取了击杀BOSS排行第一奖励<font color='#FF0000'>获得100W烈焰币奖励</font>");
						player:push_task_data(10,1);
					break;
					else
					 player:alert(10,0,0,"你确定你是第一名?!");
					end
					else
					 player:alert(10,0,0,"你的背包小于1格");
					end					
					else
					 player:alert(10,0,0,"排行榜第一名奖励已经领取了!");
					end					
				else
					player:alert(10,0,0,"你已经领过今日击杀排行奖励");
					break;
				end
			else
				break;
			end
		end
	else
		player:alert(19,0,0,"每天领取奖励时间为:22点-22点30分 过时不厚!");
	end
	ontalk2208(npc,0,player);
end



function ontalk2208_888(npc,event,player)
	ontalk2208(npc,0,player);
	player:alert(11,0,0,"已获取最新排名数据");
end

Npc2208Funid = 
{
[0] = ontalk2208;
[1] = ontalk2208_1;
[2] = ontalk2208_2;
[3] = ontalk2208_3;
[4] = ontalk2208_4;
[5] = ontalk2208_5;
[6] = ontalk2208_6;
[7] = ontalk2208_7;
[8] = ontalk2208_8;
[9] = ontalk2208_9;
[10] = ontalk2208_10;
[100] = ontalk2208_100;
[777] = ontalk2208_777;
[888] = ontalk2208_888;
}

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

RegisterUnitEvent(2208,20,"ontalk2208")
RegisterUnitEvent(2208,29,"CreatureNpcFun")