datsexyanon

NPC killer

Apr 24th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.28 KB | None | 0 0
  1. --100% copied from the actor hit function, with a few small changes
  2. function blowout_hit(npc)
  3.     local psy_hit = hit()
  4.     psy_hit.direction = vector():set(0,0,0)
  5.     psy_hit.impulse = 0
  6.     psy_hit.draftsman = npc
  7.  
  8.     local hit_scale = 1000 --since it's a single hit and it needs to seriously hurt/kill
  9.  
  10.     if npc:character_community() == "zombied" or npc:character_community() == "monolith" then
  11.         hit_scale = 0.1
  12.     end
  13.  
  14.     if level.name() == "l01_escape" then
  15.         psy_hit.power = 0.0005 * hit_scale
  16.         psy_hit.type = hit.radiation
  17.         npc:hit(psy_hit)
  18.         -- Extra damage
  19.         psy_hit.type = hit.burn
  20.         npc:hit(psy_hit)
  21.         psy_hit.type = hit.chemical_burn
  22.         npc:hit(psy_hit)
  23.     end
  24.  
  25.     if level.name() == "l02_garbage" then
  26.         psy_hit.power = 0.0008 * hit_scale
  27.         psy_hit.type = hit.radiation
  28.         npc:hit(psy_hit)
  29.         -- Extra damage
  30.         psy_hit.type = hit.burn
  31.         npc:hit(psy_hit)
  32.         psy_hit.type = hit.chemical_burn
  33.         npc:hit(psy_hit)
  34.     end
  35.  
  36.     if level.name() == "l03_agroprom" then
  37.         psy_hit.power = 0.001 * hit_scale
  38.         psy_hit.type = hit.radiation
  39.         npc:hit(psy_hit)
  40.         -- Extra damage
  41.         psy_hit.type = hit.burn
  42.         npc:hit(psy_hit)
  43.         psy_hit.type = hit.chemical_burn
  44.         npc:hit(psy_hit)
  45.     end
  46.  
  47.     if level.name() == "l04_darkvalley" then
  48.         psy_hit.power = 0.0012 * hit_scale
  49.         psy_hit.type = hit.radiation
  50.         npc:hit(psy_hit)
  51.         -- Extra damage
  52.         psy_hit.type = hit.burn
  53.         npc:hit(psy_hit)
  54.         psy_hit.type = hit.chemical_burn
  55.         npc:hit(psy_hit)
  56.     end
  57.  
  58.     if level.name() == "l05_bar" then
  59.         psy_hit.power = 0.0015 * hit_scale
  60.         psy_hit.type = hit.radiation
  61.         npc:hit(psy_hit)
  62.         -- Extra damage
  63.         psy_hit.type = hit.burn
  64.         npc:hit(psy_hit)
  65.         psy_hit.type = hit.chemical_burn
  66.         npc:hit(psy_hit)
  67.     end
  68.  
  69.     if level.name() == "l06_rostok" then
  70.         psy_hit.power = 0.002 * hit_scale
  71.         psy_hit.type = hit.radiation
  72.         npc:hit(psy_hit)
  73.         -- Extra damage
  74.         psy_hit.type = hit.burn
  75.         npc:hit(psy_hit)
  76.         psy_hit.type = hit.chemical_burn
  77.         npc:hit(psy_hit)
  78.     end
  79.  
  80.     if level.name() == "l08_yantar" then
  81.         psy_hit.power = 0.003 * hit_scale
  82.         psy_hit.type = hit.radiation
  83.         npc:hit(psy_hit)
  84.         psy_hit.power = 0.0001 * hit_scale
  85.           psy_hit.type = hit.shock
  86.         npc:hit(psy_hit)
  87.         -- Extra damage
  88.         psy_hit.type = hit.burn
  89.         npc:hit(psy_hit)
  90.         psy_hit.type = hit.chemical_burn
  91.         npc:hit(psy_hit)
  92.     end
  93.  
  94.     if level.name() == "l07_military" then
  95.         psy_hit.power = 0.005 * hit_scale
  96.         psy_hit.type = hit.radiation
  97.         npc:hit(psy_hit)
  98.         psy_hit.power = 0.0002 * hit_scale
  99.           psy_hit.type = hit.shock
  100.         npc:hit(psy_hit)
  101.         -- Extra damage
  102.         psy_hit.type = hit.burn
  103.         npc:hit(psy_hit)
  104.         psy_hit.type = hit.chemical_burn
  105.         npc:hit(psy_hit)
  106.     end
  107.  
  108.     if level.name() == "l10_radar" then
  109.         psy_hit.power = 0.008 * hit_scale
  110.         psy_hit.type = hit.radiation
  111.         npc:hit(psy_hit)
  112.         psy_hit.power = 0.0004 * hit_scale
  113.         psy_hit.type = hit.shock
  114.         npc:hit(psy_hit)
  115.         -- Extra damage
  116.         psy_hit.type = hit.burn
  117.         npc:hit(psy_hit)
  118.         psy_hit.type = hit.chemical_burn
  119.         npc:hit(psy_hit)
  120.     end
  121.  
  122.     if level.name() == "l11_pripyat" then
  123.         psy_hit.power = 0.01 * hit_scale
  124.         psy_hit.type = hit.radiation
  125.         npc:hit(psy_hit)
  126.         psy_hit.power = 0.0007 * hit_scale
  127.         psy_hit.type = hit.shock
  128.         npc:hit(psy_hit)
  129.         -- Extra damage
  130.         psy_hit.type = hit.burn
  131.         npc:hit(psy_hit)
  132.         psy_hit.type = hit.chemical_burn
  133.         npc:hit(psy_hit)
  134.     end
  135. end
Advertisement
Add Comment
Please, Sign In to add comment