Advertisement
ThunderFreak

Untitled

Apr 12th, 2012
106
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[------------------------------------------------------------------------------------------------
  2.  File       : Attack Script.script
  3.  Description: Military raids will start every 6 to 8 hours for im14
  4.  Copyright  : Thunder Freak (c) 2009
  5.  Author     : Thunder Freak (c) 2009
  6.  Last edit  : 18.10.2009 ThunderFreak
  7. --]]------------------------------------------------------------------------------------------------
  8.  
  9.  
  10. local attack_time = 0
  11. function raid()
  12.     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"}
  13.     local KoordinateA = {[1] = {x= 270.04, y = 14.10, z = 8.02},
  14.                          [2] = {x = 150.97, y = -1.62, z = 265.04},
  15.                          [3] = {x = 273.74, y = 1.84, z = 0.69},
  16.                          [4] = {x = 182.19, y = 1.65, z = -275.59},
  17.                          [5] = {x = 32.01, y = 1.53, z = 191.56},
  18.                          [6] = {x = -257.33, y = 1.52, z = 18.95},
  19.                          [7] = {x = -235.09, y = -15.69, z = -7.87},
  20.                          [8] = {x = 200.53, y = 7.85, z = -244.68}
  21.                         }
  22.     local KoordinateB = {[1] = {x = -222.02, y = -31.08, z = -239.38},
  23.                          [2] = {x = -271.45, y = 1.97, z = -18.88},
  24.                          [3] = {x = 31.69, y = -0.59, z = -180.22},
  25.                          [4] = {x = 130.62, y = 1.71, z = -20.96},
  26.                          [5] = {x = 275.17, y = 2.21, z = -91.53},
  27.                          [6] = {x = 31.94, y = 0.90, z = 140.50},
  28.                          [7] = {x = -176.40, y = -14.48, z = 379.33},
  29.                          [8] = {x = 145.74, y = -0.93, z = 69.3}
  30.                         }
  31.     local military = {"pri_respawn_military", "rad_specnaz_respawn_specnaz", "rad_soldier_master", "val_soldier_respawn_1", "agr_soldier_regular"}
  32.     local level_name = level.name()
  33.     local actor_rank = ranks.get_obj_rank_name(db.actor)
  34.     local which_spawn = math.random(1, 2)
  35.     local Koordinate ={}
  36.     local soldiers = military[math.random(1,5)]
  37.     local hmnpc = 4
  38.     if actor_rank == "experienced" then
  39.         hmnpc   = 4
  40.     elseif actor_rank == "veteran" then
  41.         hmnpc   = 6
  42.     elseif actor_rank == "master" then
  43.         hmnpc   = 8
  44.     end
  45.     if attack_time == 0 then attack_time = level.get_time_hours() + math.random(6,8) end
  46.     if db.actor:alive() then
  47.         if level.get_time_hours() > attack_time then
  48.             attack_time = 0
  49.             for indx, lvl in pairs(levels) do
  50.                 if level_name == lvl then
  51.                     for hm = 1, hmnpc do   
  52.                         if which_spawn == 1 then
  53.                             alife():create(soldiers, vector():set(KoordinateA[indx].x, KoordinateA[indx].y, KoordinateA[indx].z), db.actor:level_vertex_id(), db.actor:game_vertex_id())
  54.                         else
  55.                             alife():create(soldiers, vector():set(KoordinateB[indx].x, KoordinateB[indx].y, KoordinateB[indx].z), db.actor:level_vertex_id(), db.actor:game_vertex_id())
  56.                         end
  57.                     end
  58.                 end
  59.             end
  60.         end
  61.     end
  62. end
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement