Advertisement
Daemonion

bind_stalker changes w/ZRP

Oct 27th, 2012
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  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. --*******************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement