tower_mob_point = { {462,332}, {1277,332}, {248,332} } drop_tower = { {3060004}, -- Дроп с мобов 63-77 {3060004},-- Дроп с мобов 83-97 {3060004},-- 103-110 {3060004}--Роланд } drop_tower_count = { {1}, {1}, {1}, {1} } drop_tower_pct = { {100}, {100}, {100}, {100} } function tower_Die(MapID, InstanceID, CreatureID, CreatureTypeID, KillerID) local monsterNum = map.GetMapScriptData(3911351072,InstanceID,1,4) local TeamID = role.IsRoleHaveTeam(MapID, InstanceID, KillerID) local i,j,k,c,d if CreatureTypeID == 9010365 or CreatureTypeID == 9010366 or CreatureTypeID == 9010367 or CreatureTypeID == 9010368 or CreatureTypeID == 9010369 or CreatureTypeID == 9010370 or CreatureTypeID == 9010371 or CreatureTypeID == 9010372 then k = 1 elseif CreatureTypeID == 9010373 or CreatureTypeID == 9010374 or CreatureTypeID == 9010375 or CreatureTypeID == 9010376 or CreatureTypeID == 9010377 or CreatureTypeID == 9010378 or CreatureTypeID == 9010379 or CreatureTypeID == 9010380 then k = 2 elseif CreatureTypeID == 9010381 or CreatureTypeID == 9010382 or CreatureTypeID == 9010383 or CreatureTypeID == 9010384 then k = 3 end if TeamID ~= nil and TeamID ~= 4294967295 then local Role = {} Role[1], Role[2], Role[3], Role[4], Role[5], Role[6] = role.GetRoleTeamMemID(TeamID) local a = 0 for i=1, 6 do if Role[i] and Role[i]~= 4294967295 then a=a+1 end end local b = math.random(a) c = #drop_tower[k] d = math.random(c) if math.random(100) < drop_tower_pct[k][d] then role.AddRoleItem(MapID, InstanceID, Role[b],drop_tower[k][d], drop_tower_count[k][d], 6, 8, 420) end end if monsterNum == nil or monsterNum < 0 then monsterNum = 0 end local num = 8 - monsterNum if num > 0 then map.SetMapScriptData(3911351072,InstanceID,1,4,monsterNum+1) else if CreatureTypeID == 9010365 or CreatureTypeID == 9010366 then i = 1 j = 1 elseif CreatureTypeID == 9010367 or CreatureTypeID == 9010368 then i = 2 j = 2 elseif CreatureTypeID == 9010369 or CreatureTypeID == 9010370 then i = 3 j = 3 elseif CreatureTypeID == 9010371 or CreatureTypeID == 9010372 then i = 4 j = 1 elseif CreatureTypeID == 9010373 or CreatureTypeID == 9010374 then i = 5 j = 2 elseif CreatureTypeID == 9010375 or CreatureTypeID == 9010376 then i = 6 j = 3 elseif CreatureTypeID == 9010377 or CreatureTypeID == 9010378 then i = 7 j = 1 elseif CreatureTypeID == 9010379 or CreatureTypeID == 9010380 then i = 8 j = 2 elseif CreatureTypeID == 9010381 or CreatureTypeID == 9010382 then i = 9 j = 3 elseif CreatureTypeID == 9010383 or CreatureTypeID == 9010384 then i = 10 j = 1 end local teleport = map.MapCreateColCreature(3911351072, InstanceID, 9010387, tower_mob_point[j][1], 2608, tower_mob_point[j][2], 1) map.SetMapScriptData(3911351072,InstanceID,1,1,teleport) map.SetMapScriptData(3911351072,InstanceID,1,3,i) map.SetMapScriptData(3911351072,InstanceID,1,4,0) end end aux.RegisterCreatureEvent(9010365, 4, "tower_Die") aux.RegisterCreatureEvent(9010366, 4, "tower_Die") aux.RegisterCreatureEvent(9010367, 4, "tower_Die") aux.RegisterCreatureEvent(9010368, 4, "tower_Die") aux.RegisterCreatureEvent(9010369, 4, "tower_Die") aux.RegisterCreatureEvent(9010370, 4, "tower_Die") aux.RegisterCreatureEvent(9010371, 4, "tower_Die") aux.RegisterCreatureEvent(9010372, 4, "tower_Die") aux.RegisterCreatureEvent(9010373, 4, "tower_Die") aux.RegisterCreatureEvent(9010374, 4, "tower_Die") aux.RegisterCreatureEvent(9010375, 4, "tower_Die") aux.RegisterCreatureEvent(9010376, 4, "tower_Die") aux.RegisterCreatureEvent(9010377, 4, "tower_Die") aux.RegisterCreatureEvent(9010378, 4, "tower_Die") aux.RegisterCreatureEvent(9010379, 4, "tower_Die") aux.RegisterCreatureEvent(9010380, 4, "tower_Die") aux.RegisterCreatureEvent(9010381, 4, "tower_Die") aux.RegisterCreatureEvent(9010382, 4, "tower_Die") aux.RegisterCreatureEvent(9010383, 4, "tower_Die") aux.RegisterCreatureEvent(9010384, 4, "tower_Die")