Guest User

Untitled

a guest
Dec 10th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. function tools.heal2(unit)
  2. if unit==nil then
  3. unit=getCreatureAtPos(getxyz())
  4. end
  5. unit.body.wounds:resize(0) -- memory leak here :/
  6. unit.body.blood_count=unit.body.blood_max
  7. --set flags for standing and grasping...
  8. unit.status2.able_stand=4
  9. unit.status2.able_stand_impair=4
  10. unit.status2.able_grasp=4
  11. unit.status2.able_grasp_impair=4
  12. --should also set temperatures, and flags for breath etc...
  13. unit.flags1.dead=false
  14. unit.flags2.calculated_bodyparts=false
  15. unit.flags2.calculated_nerves=false
  16. unit.flags2.circulatory_spray=false
  17. unit.flags2.vision_good=true
  18. unit.flags2.vision_damaged=false
  19. unit.flags2.vision_missing=false
  20. unit.flags2.breathing_good=true
  21. unit.counters.winded=0
  22. unit.counters.unconscious=0
  23. for k,v in pairs(unit.body.components) do
  24. for kk,vv in pairs(v) do
  25. v[kk]=0
  26. end
  27. end
  28. end
  29. tools.menu:add("heal2",tools.heal2)
Add Comment
Please, Sign In to add comment