团队传送lua脚本(zjlua版本)

  • A+
所属分类:LUA脚本
function transman_Init( _MeIndex )
	Char.SetData(_MeIndex, %对像_形象%, 101530);
	Char.SetData(_MeIndex, %对像_原形%, 101530);
	Char.SetData(_MeIndex, %对像_地图%, 3000);
	Char.SetData(_MeIndex, %对像_X%, 104);
	Char.SetData(_MeIndex, %对像_Y%, 97);
	Char.SetData(_MeIndex, %对像_方向%, %左下%);
	Char.SetData(_MeIndex, %对像_原名%, "练级传送");
	if (Char.SetTalkedEvent(nil, "transman_Talked", _MeIndex) < 0) then
		print("transman_Talked 注册事件失败。");
		return false;
	end
	if (Char.SetWindowTalkedEvent(nil, "transman_WindowTalked", _MeIndex) < 0) then
		print("transman_WindowTalked 注册事件失败。");
		return false;
	end
	
	transman_data = 
	    {
	    {"柯奥山的小洞(1~10级)", 11001,3,43},
			{"阿布洞窟(10~20级)", 10001,10,10},
			{"海主人(30~40级)", 31401,91,30},
			{"五兄弟1楼(50~60级)", 31701,37,42},
			{"无名地下(70~80级)", 30301,18,35},
			{"英雄岛海边(90~110级)", 500,230,328},
			{"凯菈村(120~130级)", 7402,155,75},
			{"地城雷区(130~135级)", 60050,14,20},
			{"泪之海(135~140级)", 817,25,117},
			{"金暴洞(140级)", 60054,60,45}
			};
	Msg = "";
 	return true; 
 end 
 if maxpage == 1 then
		button = %按钮_确定%;
	elseif page == 1 and page <maxpage then
		button = %按钮_下一页%;
	elseif page > 1 and page <maxpage then
		button = 48 ;
	elseif page == maxpage then
		button = 16 ;
	end
function transman_Talked( _MeIndex, _TalkIndex, _Msg, _Color, _Channel)
	if(NLG.CheckInFront(_TalkIndex, _MeIndex, 1) == false) then
		return ;
	end
	Msg = "这里是传送工会\n\n请你先熟读下列规则:\n传送按等级不同需要不同的石币,你要带够喔";
	NLG.ShowWindowTalked(_TalkIndex, 0, 12, 1, Msg,_MeIndex);
	return ;
end

function transman_WindowTalked( _MeIndex, _TalkIndex, _Seqno, _Select, _Data)
	if(NLG.CheckInFront(_TalkIndex, _MeIndex, 1) == false) then
		return ;
	end
	if (_Select==8) then
		return;
	end
	if (_Seqno==1) then
		if (_Select == 4) then
			Msg = "1\n选择目的地:\n";
			for i = 1,table.getn(transman_data) do
				Msg = Msg .. "    " .. transman_data[i][1] .. "\n" ;
			end
			NLG.ShowWindowTalked(_TalkIndex, 2, 8, 2, Msg, _MeIndex);
		end
	elseif (_Seqno==2) then
		local num = tonumber(_Data);
		if num > 0 then
			local transman_map = transman_data[num][2];
			local transman_x = transman_data[num][3];
			local transman_y = transman_data[num][4];
			NLG.Warp(_TalkIndex,transman_map,transman_x,transman_y);
			NLG.TalkToCli(_TalkIndex, "全队顺利传送到目的地,请开启外挂上的快速遇敌即可打怪升级!",%黄色% );
			NLG.TalkToCli(_TalkIndex, "祝您游戏愉快!",%黄色% );
			if( Char.GetData(_TalkIndex,%对像_队模式%)~=1 ) then
				return;
			end
			local tempindex = -1;
			for i=1,4 do
				tempindex = Char.GetTeamIndex(_TalkIndex,i);
				if tempindex > -1 then
					NLG.Warp(tempindex,transman_map,transman_x,transman_y);
				end
			end
		end
	end
	return ;
end

function transman_Reload()
	if (transman_index == nil) then
		transman_index = NL.CreateNpc(nil, "transman_Init");
		NLG.UpChar(transman_index);
	else
		NL.DelNpc(transman_index);
		NLG.UpChar(transman_index);
		transman_index = nil;
	end
end

transman_Reload();
  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin

发表评论

您必须登录才能发表评论!