Guest User

meceniy_work.script

a guest
Feb 2nd, 2013
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --TB3D 1.0.9e
  2. function my_ver() return "1.0.9.0" end
  3. --Work Addon Script For People Solyanka (Spot (arrows). Using developments from Another Story mod 0.2 (only a dream and zombies), as well Adobe InContext damirazo (but with modifications) ..)
  4.  
  5. --nafig rewritten all but invisible by Monnoroch
  6. -----------------------------------
  7. --Spawn From the beginning urbi
  8. -----------------------------------
  9.  
  10. --Invisibility in the costume
  11. local idle_time
  12. local range = 60
  13.  
  14. function set_invisible()
  15. if db.invisible == true then
  16.  
  17. local outfit_act = db.actor:item_in_slot(6)
  18. local hud = get_hud()
  19. local cs = hud:GetCustomStatic("cs_inviz")
  20. if cs == nil then
  21. hud:AddCustomStatic("cs_inviz", true)
  22. cs = hud:GetCustomStatic("cs_inviz")
  23. end
  24.  
  25.  
  26. if (outfit_act == nil) then
  27. if db.not_inviz == false then
  28. idle_time = 1
  29. range = 60
  30. db.game_time = game.get_game_time()
  31. local msg = string.format("You wear no suit")
  32. if cs ~= nil then
  33. cs:wnd():SetText(msg)
  34. cs = nil
  35. end
  36. bind_stalker.restore_weapon()
  37. level.remove_pp_effector(1111)
  38. db.not_inviz = true
  39. db.make_inviz = false
  40. end
  41. else
  42. if outfit_act:section()=="meceniy_outfit_new" then
  43. if db.make_inviz == false then
  44. range = 2
  45. idle_time = 27*60
  46. db.game_time = game.get_game_time()
  47. local msg = string.format("Your wear the camouflage suit and you are invisible")
  48. if cs ~= nil then
  49. cs:wnd():SetText(msg)
  50. cs = nil
  51. end
  52. bind_stalker.hide_weapon()
  53. level.add_pp_effector ("teleport.ppe", 1111, false)
  54. level.set_pp_effector_factor(1111, 1.0)
  55. db.make_inviz = true
  56. db.not_inviz = false
  57. db.tell_90_inviz = false
  58. db.tell_finish_inviz = false
  59. end
  60. else
  61. if db.not_inviz == false then
  62. idle_time = 1
  63. range = 60
  64. db.game_time = game.get_game_time()
  65. local msg = string.format("You wear a suit other than the camouflage suit")
  66. if cs ~= nil then
  67. cs:wnd():SetText(msg)
  68. cs = nil
  69. end
  70. bind_stalker.restore_weapon()
  71. level.remove_pp_effector(1111)
  72. db.not_inviz = true
  73. db.make_inviz = false
  74. end
  75. end
  76. end
  77.  
  78.  
  79. if (db.make_inviz and not db.tell_finish_inviz and not db.not_inviz) then
  80. local diff_sec = game.get_game_time():diffSec(db.game_time)
  81.  
  82. if not db.tell_90_inviz and diff_sec >= idle_time*0.9 then
  83. local msg = string.format("In 90 seconds, you will again be visible.")
  84. if cs ~= nil then cs:wnd():SetText(msg) end
  85. db.tell_90_inviz = true
  86. end
  87.  
  88. if db.tell_90_inviz and diff_sec >= idle_time then
  89. range = 60
  90. local msg = string.format("You are visible again")
  91. if cs ~= nil then cs:wnd():SetText(msg) end
  92. cs = nil
  93. db.tell_finish_inviz = true
  94. bind_stalker.restore_weapon()
  95. level.remove_pp_effector(1111)
  96. end
  97. end
  98.  
  99. db.tormoz = db.tormoz + 1
  100.  
  101. if db.tormoz >= 500 then
  102. --[[local object_all
  103. for id = 0,65534,1 do
  104. object_all = level.object_by_id(id)
  105. if object_all ~= nil and (IAmAStalker[object_all:clsid()] or IAmAMonster[object_all:clsid()]) then
  106. object_all:set_range(range)
  107. end
  108. end]]
  109. local object_all
  110. for k, v in pairs (db.storage) do
  111. object_all = level.object_by_id(k)
  112. --if object_all and (IAmAMonster[object_all:clsid()] or IAmAStalker[object_all:clsid()] and object_all:alive() then
  113. if object_all and (IAmAMonster[object_all:clsid()] or IAmAStalker[object_all:clsid()]) and object_all:alive() then
  114. object_all:set_range(range)
  115. end
  116. end
  117. db.tormoz = 0
  118. end
  119. end
  120. end
RAW Paste Data