Want more features on Pastebin? Sign Up, it's FREE!
Guest

bind_stalker changes w/ZRP

By: Daemonion on Oct 27th, 2012  |  syntax: None  |  size: 1.43 KB  |  views: 293  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --*******************************************************************
  2. function actor_binder:on_item_take (obj)
  3.     level_tasks.proceed(self.object)
  4.     --game_stats.update_take_item (obj, self.object)
  5.         if (isWeapon(obj)) then
  6.                 local sec = obj:section()
  7.                 local ini = system_ini()
  8.                 -- Check system ini if section with the postfix "_actor" exists
  9.                 if (ini:section_exist(sec.."_actor")) then
  10.                         alife():release( alife():object(obj:id()),true )
  11.                         alife():create(sec.."_actor",db.actor:position(),0,0,0)
  12.                 end
  13.         end    
  14. end
  15.  
  16. function actor_binder:on_item_drop (obj)
  17.     level_tasks.proceed(self.object)
  18.     --game_stats.update_drop_item (obj, self.object)
  19.         if (isWeapon(obj) and string.find(obj:section(),"_actor")) then
  20.                 local sec = string.gsub(obj:section(),"_actor","")
  21.                 alife():release( alife():object(obj:id()),true )
  22.                 alife():create(sec,db.actor:position(),db.actor:level_vertex_id(),db.actor:game_vertex_id())
  23.         end
  24.         if _z.item_drop_is_intentional(obj, self.object) then
  25.                 if _z.on_item_drop(obj, self.object) then return end -- true = used item
  26.                 if use_sleeping_bag and abc_sleep and obj:section()=="sleep_bag" then
  27.                         if not has_alife_info("ui_inventory") then return end
  28.                         if _dev then
  29.                                 _dev.queue_delayed_event({delay=1200,event="abc_sleep.show_sleep_dialog()"})
  30.                         else
  31.                                 dbglog("sleep_bag needs valid _dev.script")
  32.                         end
  33.                 end
  34.         end
  35. end
  36. --*******************************************************************
clone this paste RAW Paste Data