Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. custom_require.call(%w(common common-arcana common-items common-travel drinfomon events spellmonitor equipmanager))
  2.  
  3. class Athletics
  4. include DRC
  5. include DRCA
  6. include DRCI
  7. include DRCS
  8. include DRCT
  9.  
  10. def initialize
  11. @settings = get_settings()
  12. @athletics_options = get_data('athletics').athletics_options
  13. @climbing_target = get_data('athletics').practice_options[@settings.climbing_target]
  14.  
  15. if DRSkill.getrank('Athletics') >= 515
  16. hlc_athletics
  17. elsif @climbing_target
  18. climb_practice(@climbing_target['target'], @climbing_target['hide'])
  19. elsif @settings.hometown == 'Crossing'
  20. crossing_athletics
  21. elsif @settings.hometown == 'Riverhaven'
  22. riverhaven_athletics
  23. elsif @settings.hometown == 'Shard'
  24. shard_athletics
  25. elsif @settings.hometown == 'Hibarnhvidar'
  26. hib_athletics
  27. elsif @settings.hometown == 'Ratha'
  28. ratha_athletics
  29. end
  30. end
  31.  
  32. def hlc_athletics
  33. start_script('skill-recorder') unless Script.running?('skill-recorder')
  34. walk_to(2245)
  35. if DRSkill.getxp('Athletics') < 29
  36. walk_to(2245)
  37. walk_to(9607)
  38. walk_to(19_464)
  39. while DRSkill.getxp('Athletics') < 29
  40. walk_to(2245)
  41. walk_to(9607)
  42. walk_to(11_126)
  43. walk_to(19_464)
  44. break if DRSkill.getxp('Athletics') >= 29
  45. end
  46. end
  47. end
  48.  
  49. def riverhaven_athletics
  50. while DRSkill.getxp('Athletics') < 29
  51. walk_to(473)
  52. walk_to(1375)
  53. break if DRSkill.getxp('Athletics') >= 29
  54. end
  55. end
  56.  
  57. def crossing_athletics
  58. if DRSkill.getrank('Athletics') >= 400
  59. return if @researching
  60. climb_branch
  61. else
  62. @athletics_options
  63. .reject { |data| @settings.avoid_athletics_in_justice && data['justice'] }
  64. .each do |data|
  65. break unless climb?(data['room'], data['targets'])
  66. end
  67. end
  68. end
  69.  
  70. def shard_athletics
  71. if @climbing_target
  72. walk_to(@climbing_target['id'])
  73. climb_practice(@climbing_target['target'], @climbing_target['hide'])
  74. else
  75. while DRSkill.getxp('Athletics') <= 30
  76. walk_to(11481)
  77. walk_to(11482)
  78. walk_to(11483)
  79. end
  80.  
  81. walk_to(@settings.safe_room)
  82. end
  83. end
  84.  
  85. def climb?(room, targets)
  86. targets.each do |target|
  87. walk_to(room)
  88. return true if DRRoom.npcs.length >= 3
  89.  
  90. fput "climb #{target}"
  91. pause
  92. waitrt?
  93. return false if DRSkill.getxp('Athletics') >= 30
  94. end
  95. true
  96. end
  97.  
  98. def hib_athletics
  99. walk_to(4155)
  100. move('nw')
  101.  
  102. while DRSkill.getxp('Athletics') <= 30
  103. fput('climb bank')
  104. 3.times do
  105. fput('south')
  106. waitrt?
  107. end
  108. #walk_to(4155)
  109. fput('climb bank')
  110. walk_to(4155)
  111. move('nw')
  112. end
  113. fput('climb bank')
  114. waitrt?
  115. walk_to(@settings.safe_room)
  116. end
  117.  
  118. def ratha_athletics
  119. while DRSkill.getxp('Athletics') <= 30
  120. walk_to(11549)
  121. walk_to(11550)
  122. walk_to(11551)
  123. walk_to(11552)
  124. end
  125. end
  126.  
  127. def climb_practice(target, to_hide = false)
  128. return unless target
  129. walk_to(@climbing_target['id'])
  130.  
  131. while DRSkill.getxp('Athletics') < 29
  132. retreat
  133. if to_hide
  134. attempts_to_hide = 5
  135. while attempts_to_hide > 0
  136. break if hide?
  137. attempts_to_hide -= 1
  138. end
  139. return if attempts_to_hide == 0
  140. end
  141. Flags.add('ct-climbing-finished', 'You finish practicing')
  142. Flags.add('ct-climbing-combat', 'You are engaged in combat')
  143. bput("climb practice #{target}", 'You begin to practice ')
  144. loop do
  145. pause 1
  146. break if Flags['ct-climbing-finished']
  147. return if Flags['ct-climbing-combat']
  148. if DRSkill.getxp('Athletics') > 28
  149. fput('stop climb')
  150. break
  151. end
  152. end
  153. end
  154.  
  155. bput('unhide', 'You come out of hiding', 'You slip out of hiding', 'But you are not')
  156. end
  157. end
  158.  
  159. Athletics.new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement