function SpawnFlowers() map.MapCreateColCreature(3440850216, 1, 6040333, 1075, 7725, 3134, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1435, 7178, 3378, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1649, 7398, 2876, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1500, 9453, 2606, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1807, 9686, 2405, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1893, 9784, 2013, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1738, 10913, 1656, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1498, 12844, 1444, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 942, 15194, 1642, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1351, 9565, 1986, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1571, 9572, 2273, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1384, 9464, 2611, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1469, 8370, 3021, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1622, 7071, 3432, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3035, 7598, 3754, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3007, 9556, 3431, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2621, 10926, 3499, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2685, 10711, 3744, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3276, 7031, 2881, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3184, 6696, 2560, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3278, 7098, 2160, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3216, 6996, 2815, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3391, 6810, 3131, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3715, 6947, 3212, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3556, 8393, 2905, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3413, 11455, 2639, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3497, 11536, 2403, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3424, 11845, 2254, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3196, 10257, 2376, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2969, 5889, 2154, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2658, 6359, 1082, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2526, 6324, 951, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2667, 7043, 707, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2762, 7046, 602, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2838, 6915, 1030, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3026, 7334, 882, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3263, 7307, 916, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3448, 6960, 936, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3280, 7064, 769, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3138, 8413, 1187, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3346, 11632, 1350, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3585, 12034, 1359, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3522, 11999, 1255, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1445, 5904, 910, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1442, 6590, 1098, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1207, 6817, 1169, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1137, 6059, 998, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1230, 9533, 1644, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1418, 9736, 1756, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1624, 9646, 1760, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1758, 10055, 2077, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1668, 9273, 2270, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1606, 11119, 2607, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1457, 9554, 2515, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1536, 9425, 2701, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1736, 9554, 2914, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1819, 9556, 2968, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1868, 9519, 2808, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1721, 9500, 2704, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1547, 8119, 2825, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1578, 8096, 2984, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1352, 7672, 3095, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1114, 7986, 3074, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 876, 8793, 2793, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 948, 9131, 2622, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 748, 8948, 2643, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 771, 8844, 2503, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1022, 9184, 2391, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1204, 9386, 2589, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1457, 7885, 3124, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1511, 7419, 3287, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3088, 8969, 3638, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2928, 8976, 3343, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2592, 10077, 3605, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3000, 6168, 2450, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3400, 9376, 2933, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3207, 8559, 1136, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3430, 12145, 1311, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1365, 9630, 1778, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1346, 9398, 2650, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1254, 8908, 2847, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1274, 7849, 3171, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1533, 7332, 3322, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1532, 8106, 2869, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1639, 9680, 2011, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1878, 9797, 2172, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3116, 6371, 2459, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3307, 7128, 2974, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3582, 7318, 3100, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3670, 7385, 3029, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3389, 10038, 2811, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3348, 11272, 2588, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3505, 11343, 2297, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2954, 7104, 1038, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2759, 6990, 615, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1305, 5787, 865, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1310, 6634, 1085, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1793, 9838, 2056, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1881, 9783, 2179, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1283, 9488, 2475, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1420, 7951, 3111, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1789, 9692, 2372, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1666, 7231, 3154, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 1892, 5816, 3354, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3183, 5869, 3617, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2994, 9283, 3508, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2668, 10551, 3688, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2992, 6052, 2332, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3097, 6114, 2152, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3291, 5874, 2056, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2772, 5853, 1180, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2511, 5859, 1110, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2479, 6073, 891, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 2630, 6739, 653, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3126, 7001, 919, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3305, 7185, 876, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3215, 8935, 1196, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3507, 12148, 1344, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3402, 7162, 3011, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3338, 9756, 2816, 1) map.MapCreateColCreature(3440850216, 1, 6040333, 3381, 11566, 2430, 1) end function s10_LeaveMap(MapID, InstanceID, RoleID) local FamilyID = role.GetRoleFamilyID(MapID, InstanceID, RoleID) local f = role.GetRoleScriptData(RoleID, 1, RoleDataType["DragonMonNum"]) local a = tonumber(BroData(FamilyID,0,0)) local b = role.GetRoleItemNum(RoleID,6600990) BroData(FamilyID,1,a-f) role.SetRoleScriptData(RoleID, 1, RoleDataType["DragonMonNum"],0) role.RemoveFromRole(MapID, InstanceID, RoleID, 6600990, b, 101) end aux.RegisterMapEvent("s10", 3, "s10_LeaveMap") function zFlowers_OnInvest(MapID, InstanceID, TargetID, TargetTypeID, RoleID) local Act = 0 local Ent = 0 if act.GetActIsStart(1196) == true then Act = 1196 Ent = 1 elseif act.GetActIsStart(1197) == true then Act = 1197 Ent = 1 elseif act.GetActIsStart(1198) == true then Act = 1198 Ent = 1 end if Ent == 1 then local a = tonumber(GonkaAct2(Act,0,0)) if a == 99 then map.MapCreateColCreature(3440850216, 1, 6040334, 655 , 9487 , 907, 1) end role.AddRoleItem(MapID, InstanceID, RoleID, 6600990, 1, -1, 8, 404) GonkaAct2(Act,2,1) --- Подсчет нпс end end aux.RegisterCreatureEvent(6040333, 6, "zFlowers_OnInvest") function zFlowers_On_Disappear(MapID, InstanceID, TargetID, TargetTypeID) local Act = 0 local Ent = 0 if act.GetActIsStart(1196) == true then Act = 1196 Ent = 1 elseif act.GetActIsStart(1197) == true then Act = 1197 Ent = 1 elseif act.GetActIsStart(1198) == true then Act = 1198 Ent = 1 end if Ent == 1 then SpawnFlowers() --- Когда все нпс закончились , спавн заного GonkaAct2(Act,1,0) --- Когда все нпс закончились , Обнуление end end aux.RegisterCreatureEvent(6040334, 13, "zFlowers_On_Disappear") function aDragonEnt_OnTimerMin(actID) local curmon = tonumber(os.date("%m")) local curday = tonumber(os.date("%d")) local curyear = tonumber(os.date("%Y")) local curhour = tonumber(os.date("%H")) local curmin = tonumber(os.date("%M")) local day = os.date("%A") if curhour == 23 and curmin == 59 then GonkaActRole_Delete() BroActRole_Delete() GreziActRole_Delete() CheckDragonActive() end if curmin >= 1 then CheckDragonExp() end end aux.RegisterActEvent(1194, 4, "aDragonEnt_OnTimerMin") function c6040335_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) Envt_SoldatStart(MapID, InstanceID, RoleID) end aux.RegisterCreatureEvent(6040335, 4, "c6040335_OnDie") function Vagon_Start(actID) local MsgID = msg.BeginMsgEvent() if actID == 1202 then -- Ужас островов local Family_Boss = map.MapCreateColCreature(3440850216, -1, 6040336, 3306, 7160, 849, 1) map.SetMapScriptData(3440850216, -1, 1, 13, Family_Boss) elseif actID >= 1199 and actID <= 1201 then BroData_Delete() -- Очистка данных GonkaAct_Delete() -- Очистка данных BroDataSave_Delete() -- Очистка данных msg.AddMsgEvent(MsgID, 102, 900265) msg.DispatchWorldMsgEvent(MsgID) elseif actID >= 1196 and actID <= 1198 then msg.AddMsgEvent(MsgID, 102, 900261) msg.DispatchWorldMsgEvent(MsgID) SpawnFlowers() elseif actID >= 1203 and actID <= 1205 then msg.AddMsgEvent(MsgID, 102, 900266) msg.DispatchWorldMsgEvent(MsgID) local vagonetka1 = map.MapCreateColCreature(3440850216, 1, 6040337, 65577/50, 9487, 90724/50, 1) local vagonetka2 = map.MapCreateColCreature(3440850216, 1, 6040337, 94300/50, 5961, 169349/50, 1) map.SetMapScriptData(3440850216, 1, 1, 3, vagonetka1) map.SetMapScriptData(3440850216, 1, 1, 2, vagonetka2) GonkaData_Delete() -- Очистка данных GonkaAct_Delete() -- Очистка данных GonkaDataSave_Delete() -- Очистка данных end for i = 1196, 1205 do GonkaAct(i, 1, 0) -- Заносим данные ивента GonkaAct2(i, 1, 0) end end aux.RegisterActEvent(1196, 2, "Vagon_Start") aux.RegisterActEvent(1197, 2, "Vagon_Start") aux.RegisterActEvent(1198, 2, "Vagon_Start") aux.RegisterActEvent(1199, 2, "Vagon_Start") aux.RegisterActEvent(1200, 2, "Vagon_Start") aux.RegisterActEvent(1201, 2, "Vagon_Start") aux.RegisterActEvent(1203, 2, "Vagon_Start") aux.RegisterActEvent(1204, 2, "Vagon_Start") aux.RegisterActEvent(1205, 2, "Vagon_Start") function Vagon_End(actID) if actID == 1202 then local Family_Boss = map.GetMapScriptData(3440850216, -1, 1, 13) map.MapDeleteCreature(3440850216, -1, Family_Boss) elseif actID >= 1199 and actID <= 1201 then BroData_Delete() -- Очистка данных GonkaAct_Delete() -- Очистка данных BroDataSave_Delete() -- Очистка данных elseif actID >= 1203 and actID <= 1205 then local vagonetka1 = map.GetMapScriptData(3440850216, 1, 1, 3) local vagonetka2 = map.GetMapScriptData(3440850216, 1, 1, 2) map.MapDeleteCreature(3440850216, 1, vagonetka1) map.MapDeleteCreature(3440850216, 1, vagonetka2) GonkaData_Delete() -- Очистка данных GonkaAct_Delete() -- Очистка данных GonkaDataSave_Delete() -- Очистка данных end end aux.RegisterActEvent(1196, 3, "Vagon_End") aux.RegisterActEvent(1197, 3, "Vagon_End") aux.RegisterActEvent(1198, 3, "Vagon_End") aux.RegisterActEvent(1199, 3, "Vagon_End") aux.RegisterActEvent(1200, 3, "Vagon_End") aux.RegisterActEvent(1201, 3, "Vagon_End") aux.RegisterActEvent(1203, 3, "Vagon_End") aux.RegisterActEvent(1204, 3, "Vagon_End") aux.RegisterActEvent(1205, 3, "Vagon_End") function Envt_SoldatStart(MapID, InstanceID, RoleID) local Act = 0 if act.GetActIsStart(1199) == true then Act = 1199 elseif act.GetActIsStart(1200) == true then Act = 1200 elseif act.GetActIsStart(1201) == true then Act = 1201 end local FamilyID = role.GetRoleFamilyID(MapID, InstanceID, RoleID) local a = tonumber(BroData(FamilyID,0,0)) local d = tonumber(BroSaveAct(FamilyID,0,0)) local f = role.GetRoleScriptData(RoleID, 1, RoleDataType["DragonMonNum"]) if d == 0 or d == nil then if FamilyID ~= nil and FamilyID ~= 4294967295 then --- Проверка в семье или нет if act.GetActIsStart(1199) == true or act.GetActIsStart(1200) == true or act.GetActIsStart(1201) == true then --- Проверка на ивент if a < 600 then BroData(FamilyID,2,1) --- Поинт role.SetRoleScriptData(RoleID, 1, RoleDataType["DragonMonNum"],f+1) ---- Личный поинт local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 13, 0) msg.AddMsgEvent(MsgID, 1, 950715) msg.AddMsgEvent(MsgID, 9, f+1) msg.AddMsgEvent(MsgID, 9, 600-(a+1)) msg.DispatchRoleMsgEvent(RoleID, MsgID) local c = tonumber(GonkaAct(Act,0,0)) if a == 599 then BroSaveAct(FamilyID,1,c+1) if c >= 0 and c <= 2 then GonkaAct(Act,2,1) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900262+c) msg.AddMsgEvent(MsgID, 2, RoleID) msg.DispatchWorldMsgEvent(MsgID) end end end end end end end function Envt_GonkaGetVagonStart(MapID, InstanceID, RoleID, ObjAreaID) if ObjAreaID == 1985 then local FamilyID = role.GetRoleFamilyID(MapID, InstanceID, RoleID) local a = tonumber(GonkaData(FamilyID,0,0)) local b = role.IsRoleHaveBuff(MapID, InstanceID, RoleID, 69436) local p = role.GetSelectedRidePet(MapID, InstanceID, RoleID) local d = tonumber(GonkaSaveAct(FamilyID,0,0)) if d == 0 or d == nil then if FamilyID ~= nil and FamilyID ~= 4294967295 then --- Проверка в семье или нет if act.GetActIsStart(1203) == true or act.GetActIsStart(1204) == true or act.GetActIsStart(1205) == true then --- Проверка на ивент if p == 23394 then if a < 50 and b == true then unit.AddBuff(MapID, InstanceID, RoleID, 6943701, RoleID) end end end end end end end function Envt_GonkaGetVagonEnd(MapID, InstanceID, RoleID, ObjAreaID) local Act = 0 if act.GetActIsStart(1203) == true then Act = 1203 elseif act.GetActIsStart(1204) == true then Act = 1204 elseif act.GetActIsStart(1205) == true then Act = 1205 end if ObjAreaID == 1988 then local FamilyID = role.GetRoleFamilyID(MapID, InstanceID, RoleID) local a = tonumber(GonkaData(FamilyID,0,0)) local b = role.IsRoleHaveBuff(MapID, InstanceID, RoleID, 69437) local d = tonumber(GonkaSaveAct(FamilyID,0,0)) if d == 0 or d == nil then if FamilyID ~= nil and FamilyID ~= 4294967295 then --- Проверка в семье или нет if act.GetActIsStart(1203) == true or act.GetActIsStart(1204) == true or act.GetActIsStart(1205) == true then --- Проверка на ивент if a < 50 and b == true then GonkaData(FamilyID,2,1) --- 1 поинт unit.CancelBuff(MapID, InstanceID, RoleID, 6943701) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 13, 0) msg.AddMsgEvent(MsgID, 1, 950720) msg.AddMsgEvent(MsgID, 9, a+1) msg.DispatchRoleMsgEvent(RoleID, MsgID) local c = tonumber(GonkaAct(Act,0,0)) if a == 49 then GonkaSaveAct(FamilyID,1,c+1) if c >= 0 and c <= 2 then GonkaAct(Act,2,1) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 900262+c) msg.AddMsgEvent(MsgID, 2, RoleID) msg.DispatchWorldMsgEvent(MsgID) end end end end end end end end