tower_point = { {453,256}, {451,242}, {466,243}, {468,255}, {1272,246}, {1273,235}, {1284,236}, {1286,246}, {233,257}, {231,242}, {249,242}, {251,256}, {460,250}, {1270,250}, {240,250}, {452,276}, {1267,278}, {237,271} } tower_monster = { {9010365,9010366}, {9010367,9010368}, {9010369,9010370}, {9010371,9010372}, {9010373,9010374}, {9010375,9010376}, {9010377,9010378}, {9010379,9010380}, {9010381,9010382}, {9010383,9010384} } -- ВРЕМЕННО ДЛЯ ТЕСТА: разрешить прохождение соло (без пати) -- Поставьте false, чтобы вернуть обычное поведение. local K1_TOWER_ALLOW_SOLO_TEST = false function c9010364_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) local rolelevel = role.GetRoleLevel(MapID, InstanceID, RoleID) local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) local LeaderID = 0 if TeamID ~= nil and TeamID ~= -1 and TeamID ~= 4294967295 and TeamID ~= 0 then LeaderID = team.GetTeamLeaderID(TeamID) end local a = role.GetRoleItemNum(RoleID,6600607) local MsgID = msg.BeginMsgEvent() if TalkIndex == -1 then msg.AddMsgEvent(MsgID, 20, 950400) --��� ����������� �� ����� Ҹ���� ����� ��� ����������� ����������� �����, ������� ����� �������� �� ���������� ����������� ������� � ����� �������� (�����, 497 446). ��� ����� � ���������� ������� ��������� ������ ����������� ����������� �����. ���������� �������� ��� ���������� ��������� ��������� �����: 60-79, 80-94, 95-110. � ���������� ����� ���������� 1 ���. � ���������� ����� ������� � ������ �� 2-6 ������� msg.AddMsgEvent(MsgID, 24, TargetID) msg.AddMsgEvent(MsgID, 21, 4) msg.AddMsgEvent(MsgID, 1, 100001) --�� msg.AddMsgEvent(MsgID, 21, 99) msg.AddMsgEvent(MsgID, 1, 100002) --������ elseif TalkIndex == 4 then local minlv = 0 local maxlv = 0 if rolelevel < 60 then msg.AddMsgEvent(MsgID, 20, 950400) --��� ����������� �� ����� Ҹ���� ����� ��� ����������� ����������� �����, ������� ����� �������� �� ���������� ����������� ������� � ����� �������� (�����, 497 446). ��� ����� � ���������� ������� ��������� ������ ����������� ����������� �����. ���������� �������� ��� ���������� ��������� ��������� �����: 60-79, 80-94, 95-110. � ���������� ����� ���������� 1 ���. � ���������� ����� ������� � ������ �� 2-6 ������� msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, -1) msg.AddMsgEvent(MsgID, 1, 100001) --�� else if TeamID ~= nil and TeamID ~= -1 and TeamID ~= 4294967295 and TeamID ~= 0 then local Role = {} Role[1], Role[2], Role[3], Role[4], Role[5], Role[6] = role.GetRoleTeamMemID(TeamID) for i=1, 6 do if Role[i] and Role[i] ~= 4294967295 then local Target_MapID, Target_InstanceID = role.GetRoleMapID(Role[i]) local rolelv = role.GetRoleLevel(Target_MapID, Target_InstanceID, Role[i]) if minlv == 0 then minlv = rolelv maxlv = rolelv end if maxlv < rolelv then maxlv = rolelv elseif minlv > rolelv then minlv = rolelv end end end if maxlv - minlv > 15 then msg.AddMsgEvent(MsgID, 20, 950402) --������ ������ ������ ��������������� ��������: \n 60-79 ��.\n 80-94 ��.\n 95-110 ��.\n����� ����� �� ������ �������� ���� � ���������. msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, -1) msg.AddMsgEvent(MsgID, 1, 100001) --�� else if a >0 then if role.GetEquipIDOnPos(RoleID, 14) == 4294967295 then if role.IsRoleInStatus(RoleID, 8192) == false then role.RoleGotoNewMap(MapID, InstanceID, RoleID, 3911351072, 240, 0, 250) role.RemoveFromRole(MapID, InstanceID, RoleID, 6600607, 1, 101) map.SetMapScriptData(3911351072,InstanceID,1,3,0) end else msg.AddMsgEvent(MsgID, 20, 950402) --������ ������ ������ ��������������� ��������: \n 60-79 ��.\n 80-94 ��.\n 95-110 ��.\n����� ����� �� ������ �������� ���� � ���������. msg.AddMsgEvent(MsgID, 21, -1) msg.AddMsgEvent(MsgID, 1, 100001) --�� msg.AddMsgEvent(MsgID, 24, TargetID) end else msg.AddMsgEvent(MsgID, 20, 420078) --��������� ������������ msg.AddMsgEvent(MsgID, 21, -1) msg.AddMsgEvent(MsgID, 1, 100001) --�� msg.AddMsgEvent(MsgID, 24, TargetID) end end elseif K1_TOWER_ALLOW_SOLO_TEST == true then -- Соло-режим для теста if a > 0 then if role.GetEquipIDOnPos(RoleID, 14) == 4294967295 then if role.IsRoleInStatus(RoleID, 8192) == false then role.RoleGotoNewMap(MapID, InstanceID, RoleID, 3911351072, 240, 0, 250) role.RemoveFromRole(MapID, InstanceID, RoleID, 6600607, 1, 101) map.SetMapScriptData(3911351072,InstanceID,1,3,0) end else msg.AddMsgEvent(MsgID, 20, 950402) msg.AddMsgEvent(MsgID, 21, -1) msg.AddMsgEvent(MsgID, 1, 100001) msg.AddMsgEvent(MsgID, 24, TargetID) end else msg.AddMsgEvent(MsgID, 20, 420078) msg.AddMsgEvent(MsgID, 21, -1) msg.AddMsgEvent(MsgID, 1, 100001) msg.AddMsgEvent(MsgID, 24, TargetID) end else msg.AddMsgEvent(MsgID, 20, 950402) --������ ������ ������ ��������������� ��������: \n 60-79 ��.\n 80-94 ��.\n 95-110 ��.\n����� ����� �� ������ �������� ���� � ���������. msg.AddMsgEvent(MsgID, 21, -1) msg.AddMsgEvent(MsgID, 1, 100001) --�� msg.AddMsgEvent(MsgID, 24, TargetID) end end end msg.DispatchRoleMsgEvent(RoleID, MsgID) end aux.RegisterCreatureEvent(9010364, 7, "c9010364_On_Talk") function c9010387_On_Talk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) local nomer = tonumber(map.GetMapScriptData(3911351072,InstanceID,1,3)) or 0 local a,b,c if nomer == 0 or nomer == 3 or nomer == 6 or nomer == 9 then a = 1 b = 4 c = 13 elseif nomer == 1 or nomer == 4 or nomer == 7 then a = 5 b = 8 c = 14 elseif nomer == 2 or nomer == 5 or nomer == 8 then a = 9 b = 12 c = 15 elseif nomer == 10 then if TeamID ~= nil and TeamID ~= -1 and TeamID ~= 4294967295 and TeamID ~= 0 then local Role = {} Role[1], Role[2], Role[3], Role[4], Role[5], Role[6] = role.GetRoleTeamMemID(TeamID) for i=1, 6 do if Role[i] and Role[i]~= 4294967295 then role.RoleGotoNewMap(MapID, InstanceID, Role[i], 3911351072, 1289, 7408, 144) end end elseif K1_TOWER_ALLOW_SOLO_TEST == true then role.RoleGotoNewMap(MapID, InstanceID, RoleID, 3911351072, 1289, 7408, 144) end elseif nomer == 11 then map.SetMapScriptData(3911351072,InstanceID,1,3,0) map.DeleteInstance(MapID, InstanceID) end if nomer < 10 then tower_func(TeamID,MapID,InstanceID,RoleID,c) for i = tonumber(a),tonumber(b) do for j = 1,2 do map.MapCreateCreature(3911351072, InstanceID, tower_monster[nomer+1][1], tower_point[i][1], 1064, tower_point[i][2], 1) end end map.MapCreateCreature(3911351072, InstanceID, tower_monster[nomer+1][2], tower_point[c+3][1], 1064, tower_point[c+3][2], 1) end end aux.RegisterCreatureEvent(9010387, 7, "c9010387_On_Talk") function k1_tower_OnPlayerEnter(MapID, InstanceID, RoleID) local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, RoleID) local LeaderID = 0 if TeamID ~= nil and TeamID ~= -1 and TeamID ~= 4294967295 and TeamID ~= 0 then LeaderID = team.GetTeamLeaderID(TeamID) end if ((LeaderID ~= nil and LeaderID ~= 4294967295 and LeaderID == RoleID) or (K1_TOWER_ALLOW_SOLO_TEST == true and (TeamID == nil or TeamID == -1 or TeamID == 4294967295 or TeamID == 0))) then local nomer = map.GetMapScriptData(3911351072,InstanceID,1,3) if nomer == 0 or nomer == nil then local bashnya = map.MapCreateCreature(3911351072, InstanceID, 9010387, 248, 2608, 332) map.SetMapScriptData(3911351072,InstanceID,1,1,bashnya) end end end aux.RegisterMapEvent("k1_tower", 2, "k1_tower_OnPlayerEnter") function tower_func(TeamID,MapID,InstanceID,RoleID,c) if TeamID ~= nil and TeamID ~= -1 and TeamID ~= 4294967295 and TeamID ~= 0 then local Role = {} Role[1], Role[2], Role[3], Role[4], Role[5], Role[6] = role.GetRoleTeamMemID(TeamID) for i=1, 6 do if Role[i] and Role[i]~= 4294967295 then role.RoleGotoNewMap(MapID, InstanceID, Role[i], 3911351072, tower_point[c][1], 0, tower_point[c][2]) end end elseif K1_TOWER_ALLOW_SOLO_TEST == true then role.RoleGotoNewMap(MapID, InstanceID, RoleID, 3911351072, tower_point[c][1], 0, tower_point[c][2]) end local bashnya = map.GetMapScriptData(3911351072,InstanceID,1,1) if bashnya ~= nil and bashnya ~= 0 and bashnya ~= 4294967295 then map.MapDeleteCreature(3911351072, InstanceID, bashnya) map.SetMapScriptData(3911351072,InstanceID,1,1,0) end end