Advertisement
Drennthew

Oracle algorithm for probability of item drops

Jul 29th, 2014
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. 3f:4779:
  2.  
  3. when execution reaches here, hl has been set to a specific value (483d for digging). Points to some kind of probability table?
  4.  
  5. call 041A ; get random number in A
  6. and a,3f
  7. call 0205
  8. jr z,47ae ; if zero flag is set, no item appears
  9. ...
  10.  
  11. 00:0205:
  12.  
  13. push hl
  14. push bc
  15. call 0223
  16. and (hl) ; this instruction will set or unset the zero flag
  17. pop bc
  18. pop hl
  19. ret
  20.  
  21. 00:0223:
  22.  
  23. ld b,a
  24. and a,f8
  25. rlca
  26. swap a
  27. ld c,a
  28. ld a,b
  29. ld b,00
  30. add hl,bc
  31. and a,07
  32. ld bc,00f8
  33. add c
  34. ld c,a
  35. ld a,(bc)
  36. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement