Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[------------------------------------------------------------------------------------------------
- File : Attack Script.script
- Description: Military raids will start every 6 to 8 hours for im14
- Copyright : Thunder Freak (c) 2009
- Author : Thunder Freak (c) 2009
- Last edit : 18.10.2009 ThunderFreak
- --]]------------------------------------------------------------------------------------------------
- local attack_time = 0
- function raid()
- local levels = {[1] = "l01_escape", [2] = "l02_garbage", [3] = "l03_agroprom", [4] = "l04_darkvalley", [5] = "l05_bar", [6] = "l06_rostok", [7] = "l07_military", [8] = "l08_yantar"}
- local KoordinateA = {[1] = {x= 270.04, y = 14.10, z = 8.02},
- [2] = {x = 150.97, y = -1.62, z = 265.04},
- [3] = {x = 273.74, y = 1.84, z = 0.69},
- [4] = {x = 182.19, y = 1.65, z = -275.59},
- [5] = {x = 32.01, y = 1.53, z = 191.56},
- [6] = {x = -257.33, y = 1.52, z = 18.95},
- [7] = {x = -235.09, y = -15.69, z = -7.87},
- [8] = {x = 200.53, y = 7.85, z = -244.68}
- }
- local KoordinateB = {[1] = {x = -222.02, y = -31.08, z = -239.38},
- [2] = {x = -271.45, y = 1.97, z = -18.88},
- [3] = {x = 31.69, y = -0.59, z = -180.22},
- [4] = {x = 130.62, y = 1.71, z = -20.96},
- [5] = {x = 275.17, y = 2.21, z = -91.53},
- [6] = {x = 31.94, y = 0.90, z = 140.50},
- [7] = {x = -176.40, y = -14.48, z = 379.33},
- [8] = {x = 145.74, y = -0.93, z = 69.3}
- }
- local military = {"pri_respawn_military", "rad_specnaz_respawn_specnaz", "rad_soldier_master", "val_soldier_respawn_1", "agr_soldier_regular"}
- local level_name = level.name()
- local actor_rank = ranks.get_obj_rank_name(db.actor)
- local which_spawn = math.random(1, 2)
- local Koordinate ={}
- local soldiers = military[math.random(1,5)]
- local hmnpc = 4
- if actor_rank == "experienced" then
- hmnpc = 4
- elseif actor_rank == "veteran" then
- hmnpc = 6
- elseif actor_rank == "master" then
- hmnpc = 8
- end
- if attack_time == 0 then attack_time = level.get_time_hours() + math.random(6,8) end
- if db.actor:alive() then
- if level.get_time_hours() > attack_time then
- attack_time = 0
- for indx, lvl in pairs(levels) do
- if level_name == lvl then
- for hm = 1, hmnpc do
- if which_spawn == 1 then
- alife():create(soldiers, vector():set(KoordinateA[indx].x, KoordinateA[indx].y, KoordinateA[indx].z), db.actor:level_vertex_id(), db.actor:game_vertex_id())
- else
- alife():create(soldiers, vector():set(KoordinateB[indx].x, KoordinateB[indx].y, KoordinateB[indx].z), db.actor:level_vertex_id(), db.actor:game_vertex_id())
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement