Guest User

meceniy_work

a guest
Feb 2nd, 2013
68
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function stealthy_approach(npc_id)
  2.  
  3. if not npc_id then return end
  4.  
  5. local enemy = db.storage[npc_id].enemy
  6. if enemy and enemy:id() == db.actor:id() then -- only check if actor is the enemy
  7. local outfit_act = db.actor:get_current_outfit()
  8. if outfit_act:section() == "meceniy_outfit_new" then
  9. if distance_between(db.actor,enemy) >= 16 then -- distance more or equal to 16 m
  10. db.storage[npc_id].enemy = nil -- ignore actor
  11. bind_stalker.hide_weapon()
  12. end
  13. else -- less than 16 m
  14. if db.actor:is_weapon_hidden() then
  15. db.actor.restore_weapon() -- only hide weapon here, else if actor detected he will be defenceless
  16. end
  17. end
  18. else
  19. if db.actor:is_weapon_hidden() then -- just incase
  20. db.actor.restore_weapon()
  21. end
  22. end
  23. end
  24. end
RAW Paste Data