-- определение объекта -- объекты поля боя могут открыть несколько боя King_Battle = {} -- лагерь объекта King_Side = {} --Игроки объекты King_Role = {} --Обновить область реквизита объекта King_Area = {} King_Roletotal = 0 King_Exp = {} King_Exp[40]= 43000 King_Exp[41]= 55000 King_Exp[42]= 65000 King_Exp[43]= 76000 King_Exp[44]= 89000 King_Exp[45]= 114000 King_Exp[46]= 127000 King_Exp[47]= 139000 King_Exp[48]= 152000 King_Exp[49]= 188000 King_Exp[50]= 243000 King_Exp[51]= 255000 King_Exp[52]= 265000 King_Exp[53]= 276000 King_Exp[54]= 289000 King_Exp[55]= 314000 King_Exp[56]= 327000 King_Exp[57]= 339000 King_Exp[58]= 352000 King_Exp[59]= 388000 King_Exp[60]= 507000 King_Exp[61]= 525000 King_Exp[62]= 544000 King_Exp[63]= 564000 King_Exp[64]= 582000 King_Exp[65]= 606000 King_Exp[66]= 627000 King_Exp[67]= 648000 King_Exp[68]= 670000 King_Exp[69]= 720000 King_Exp[70]= 1073000 King_Exp[71]= 1107000 King_Exp[72]= 1147000 King_Exp[73]= 1180000 King_Exp[74]= 1217000 King_Exp[75]= 1256000 King_Exp[76]= 1293000 King_Exp[77]= 1331000 King_Exp[78]= 1370000 King_Exp[79]= 2116000 King_Exp[80]= 2178000 King_Exp[81]= 2241000 King_Exp[82]= 2303000 King_Exp[83]= 2370000 King_Exp[84]= 2438000 King_Exp[85]= 2505000 King_Exp[86]= 2572000 King_Exp[87]= 2640000 King_Exp[88]= 2709000 King_Exp[89]= 2782000 King_Exp[90]= 3490000 King_Exp[91]= 3546000 King_Exp[92]= 3602000 King_Exp[93]= 3662000 King_Exp[94]= 3720000 King_Exp[95]= 3777000 King_Exp[96]= 3833000 King_Exp[97]= 3887000 King_Exp[98]= 3941000 King_Exp[99]= 3996000 King_Exp[100]= 4050000 King_Exp[101]= 4100000 King_Exp[102]= 4150000 King_Exp[103]= 4200000 King_Exp[104]= 4250000 King_Exp[105]= 4300000 King_Exp[106]= 4350000 King_Exp[107]= 4400000 King_Exp[108]= 4450000 King_Exp[109]= 4500000 King_Exp[110]= 4550000 King_Exp[111]= 4600000 King_Exp[112]= 4650000 King_Exp[113]= 4700000 King_Exp[114]= 4750000 King_Exp[115]= 4800000 King_Exp[116]= 4950000 King_Exp[117]= 5000000 King_Exp[118]= 5050000 King_Exp[119]= 5100000 King_Exp[120]= 5150000 --Вход на локацию function br_OnPlayerEnter(MapID, InstanceID, RoleID) local RoleObj = King_Role[RoleID] RoleObj:ShowKingTime() role.SetRoleState(RoleID, 16777216, 1) local RoleTbl = map.GetMapAllRoleID(MapID,InstanceID) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 951055) msg.AddMsgEvent(MsgID, 9, table.maxn(RoleTbl)) msg.AddMsgEvent(MsgID, 9, 50) msg.DispatchRoleMsgEvent(RoleID, MsgID) RoleObj:PlayerEnterKing() local BattleObj = King_Battle[InstanceID] end br_MapID = 1644196352 --Убийство персонажа function br_KillPeople(MapID, InstanceID, RoleID, KillerID) if unit.IsPlayer(RoleID) and unit.IsPlayer(KillerID) then equipkrulo(MapID, InstanceID, RoleID, KillerID) end if unit.IsPlayer(KillerID) and unit.IsPlayer(RoleID) and RoleID ~= KillerID then local RoleObj = King_Role[KillerID] RoleObj:GetKillExp_King() local point = 1 local RoleTbl = map.GetMapAllRoleID(MapID,InstanceID) ---local MsgID = msg.BeginMsgEvent() ---msg.AddMsgEvent(MsgID, 101, 951055) ---msg.AddMsgEvent(MsgID, 9, table.maxn(RoleTbl)-1) ---msg.AddMsgEvent(MsgID, 9, 50) ---msg.DispatchRoleMsgEvent(KillerID, MsgID) --Вы убили игрока и получили опты ---local MsgID2 = msg.BeginMsgEvent() ---msg.AddMsgEvent(MsgID2, 101, 951055) ---msg.AddMsgEvent(MsgID2, 9, table.maxn(RoleTbl)) ---msg.AddMsgEvent(MsgID2, 9, 50) ---msg.DispatchRoleMsgEvent(RoleID, MsgID2) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101, 951055) msg.AddMsgEvent(MsgID, 9, table.maxn(RoleTbl)-1) msg.AddMsgEvent(MsgID, 9, table.maxn(RoleTbl)) msg.DispatchMapMsgEvent(MsgID, MapID, InstanceID) local crea_kill = {} crea_kill[1] = {9010661} crea_kill[2] = {9010662} crea_kill[3] = {9010663} crea_kill[4] = {9010664} crea_kill[5] = {9010665} crea_kill[6] = {9010666} crea_kill[7] = {9010667} crea_kill[8] = {9010668} crea_kill[9] = {9010669} crea_kill[10] = {9010670} crea_kill[11] = {9010671} crea_kill[12] = {9010672} crea_kill[13] = {9010673} crea_kill[14] = {9010674} local crea_kill2 = {} crea_kill2[1] = {9010661} crea_kill2[2] = {9010662} crea_kill2[3] = {9010663} crea_kill2[4] = {9010664} crea_kill2[5] = {9010665} crea_kill2[6] = {9010666} crea_kill2[7] = {9010667} crea_kill2[8] = {9010668} crea_kill2[9] = {9010669} crea_kill2[10] = {9010670} crea_kill2[11] = {9010671} crea_kill2[12] = {9010672} crea_kill2[13] = {9010673} crea_kill2[14] = {9010674} local r = math.random(1,14) local r1 = math.random(1,14) local x, y ,z = unit.GetPosition(MapID, InstanceID, RoleID) map.MapCreateColCreature(MapID, InstanceID,crea_kill[r][1],x+10, y ,z, true, "") map.MapCreateColCreature(MapID, InstanceID,crea_kill2[r1][1],x+5, y ,z, true, "") role.SetRoleScriptData(KillerID, 1, RoleDataType["King_win"], 1) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) if table.maxn(RoleTbl) == 10 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],10) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 9 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],9) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 8 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],8) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 7 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],7) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 6 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],6) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 5 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],5) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 4 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],4) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 3 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],3) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 2 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],2) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) role.SetRoleScriptData(KillerID, 1, RoleDataType["King_point"],1) role.SetRoleScriptData(KillerID, 1, RoleDataType["King_win"], 1) role.RoleGotoNewMap(MapID, InstanceID, KillerID, 3424073512, 630, 1000, 630) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101,951038) msg.AddMsgEvent(MsgID, 2, KillerID) msg.DispatchWorldMsgEvent(MsgID) elseif table.maxn(RoleTbl) == 1 then role.SetRoleScriptData(KillerID, 1, RoleDataType["King_point"],1) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) role.SetRoleScriptData(KillerID, 1, RoleDataType["King_win"], 1) role.RoleGotoNewMap(MapID, InstanceID, KillerID, 3424073512, 630, 1000, 630) role.RoleGotoNewMap(MapID, InstanceID, RoleID, 3424073512, 630, 1000, 630) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 101,951038) msg.AddMsgEvent(MsgID, 2, KillerID) msg.DispatchWorldMsgEvent(MsgID) elseif table.maxn(RoleTbl) > 10 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],11) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) role.SetRoleScriptData(KillerID, 1, RoleDataType["King_win"], 1) end role.RoleGotoNewMap(MapID, InstanceID, RoleID, 3424073512, 630, 1000, 630) local BattleObj = King_Battle[InstanceID] end end --Игрок покидает поле боя function br_LeaveMap(MapID, InstanceID, RoleID) role.UnSetRoleState(RoleID, 16777216, 1) local RoleObj = King_Role[RoleID] if RoleObj ~= nil then RoleObj:PlayerLeaveKing() local BattleObj = King_Battle[InstanceID] end end --Воскрешение игрока function br_RoloRevive(MapID, InstanceID, RoleID, Type, ReviveHP, ReviveMP, x, y, z, RebornMapID) local RoleTbl = map.GetMapAllRoleID(MapID,InstanceID) if table.maxn(RoleTbl) == 10 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],10) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 9 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],9) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 8 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],8) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 7 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],7) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 6 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],6) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 5 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],5) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 4 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],4) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 3 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],3) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 2 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],2) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) elseif table.maxn(RoleTbl) == 1 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],1) elseif table.maxn(RoleTbl) > 10 then role.SetRoleScriptData(RoleID, 1, RoleDataType["King_point"],11) role.SetRoleScriptData(RoleID, 1, RoleDataType["King_win"], 1) end ReviveHP = role.GetRoleAttValue(MapID, InstanceID, RoleID, 8) ReviveMP = role.GetRoleAttValue(MapID, InstanceID, RoleID, 10) local k = math.random(9) local RoleObj = King_Role[RoleID] return ReviveHP, ReviveMP,br_ExitPoint.x, br_ExitPoint.y*51,br_ExitPoint.z, br_ExitMapID end -- Проверка на отношения function br_FriendEnemy(MapID, InstanceID, SrcID, TargetID) return true, true, true, true end --Регистрация скриптов aux.RegisterMapEvent("br", 2, "br_OnPlayerEnter") aux.RegisterMapEvent("br", 5, "br_KillPeople") aux.RegisterMapEvent("br", 3, "br_LeaveMap") aux.RegisterMapEvent("br", 11, "br_RoloRevive") aux.RegisterMapEvent("br", 16, "br_FriendEnemy")