Advertisement
Guest User

Untitled

a guest
Feb 4th, 2014
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.59 KB | None | 0 0
  1. --[[**********************************************************
  2.  
  3. Ranger gearswap file for Suji.Phoenix.
  4.  
  5. Save this file as RNG.lua or Yourname_RNG.lua and place it in:
  6. Windower4.1\addons\GearSwap\data
  7.  
  8. **************************************************************]]
  9.  
  10. -- Configure sets below.
  11. function get_sets(...)
  12. sets.idle = {}
  13. sets.idle.standing = {
  14. head = "Orion Beret +1",
  15. neck = "Twilight Torque",
  16. lear = "Merman's Earring",
  17. rear = "Merman's Earring",
  18. body = "Kyujutsugi",
  19. hands = "Orion Bracers +1",
  20. lring = "Sheltered Ring",
  21. rring = "Defending Ring",
  22. back = "Lutian cape",
  23. legs = "Orion Braccae +1",
  24. waist = "Flume Belt",
  25. feet = "Fajin Boots"
  26. }
  27. sets.idle.shooting = {
  28. head = "Orion Beret +1",
  29. neck = "Twilight Torque",
  30. lear = "Merman's Earring",
  31. rear = "Merman's Earring",
  32. body = "Mextli harness",
  33. hands = "Orion Bracers +1",
  34. lring = "Sheltered Ring",
  35. rring = "Defending Ring",
  36. back = "Mollusca mantle",
  37. legs = "Orion Braccae +1",
  38. waist = "Flume Belt",
  39. feet = "Orion socks +1"
  40. }
  41.  
  42. sets.pdt = {
  43. head = "Iuitl headgear",
  44. neck = "twilight torque",
  45. body = "Orion Jerkin +1",
  46. hands = "Iuitl Wristbands",
  47. lring = "Defending Ring",
  48. rring = "Dark Ring",
  49. back = "Mollusca mantle",
  50. waist = "Flume Belt",
  51. legs = "Osmium Cuisses",
  52. feet = "Orion Socks +1"
  53. }
  54. sets.mdt = set_combine(sets.pdt, {
  55. head = "Orion beret +1",
  56. lear = "Merman's Earring",
  57. rear = "Merman's Earring",
  58. hands = "Orion Bracers +1",
  59. })
  60.  
  61. sets.tp = {}
  62. sets.tp.yoichi = {}
  63. sets.tp.yoichi.low_acc = {
  64. head = "Sct. Beret +2",
  65. neck = "Ocachi Gorget",
  66. lear = "Tripudio Earring",
  67. rear = "Volley Pearl",
  68. body = "Kyujutsugi",
  69. hands = "Syl. Glvltte. +2",
  70. lring = "Rajas Ring",
  71. rring = "K'ayres Ring",
  72. back = "Sylvan Chlamys",
  73. waist = "Elanid Belt",
  74. legs = "Nahtirah trousers",
  75. feet = "Orion Socks +1"
  76. }
  77. sets.tp.yoichi.med_acc = {
  78. head = "Sct. Beret +2",
  79. neck = "Ocachi Gorget",
  80. lear = "Tripudio Earring",
  81. rear = "Volley earring",
  82. body = "Kyujutsugi",
  83. hands = "Iuitl Wristbands",
  84. lring = "Rajas Ring",
  85. rring = "Paqichikaji Ring",
  86. back = "Sylvan Chlamys",
  87. waist = "Elanid Belt",
  88. legs = "Nahtirah trousers",
  89. feet = "Orion Socks +1"
  90. }
  91. sets.tp.yoichi.high_acc = {
  92. head = "Sct. Beret +2",
  93. neck = "Ocachi Gorget",
  94. lear = "Clearview Earring",
  95. rear = "Volley earring",
  96. body = "Orion Jerkin +1",
  97. hands = "Seiryu's Kote",
  98. lring = "Hajduk Ring",
  99. rring = "Paqichikaji Ring",
  100. back = "Lutian Cape",
  101. waist = "Elanid Belt",
  102. legs = "Orion Braccae +1",
  103. feet = "Orion Socks +1"
  104. }
  105.  
  106. local barrage_layer = {
  107. hands = "Orion Bracers +1",
  108. legs = "Desultor Tassets"
  109. }
  110. sets.tp.yoichi.barrage = {}
  111. sets.tp.yoichi.barrage.low_acc = set_combine(sets.tp.yoichi.low_acc, barrage_layer)
  112. sets.tp.yoichi.barrage.med_acc = set_combine(sets.tp.yoichi.med_acc, barrage_layer)
  113. sets.tp.yoichi.barrage.high_acc = set_combine(sets.tp.yoichi.high_acc, barrage_layer)
  114.  
  115. sets.tp.dualwield = {}
  116. local hybrid_dt = {
  117. neck = "Twilight Torque",
  118. back = "Mollusca Mantle",
  119. waist = "Flume Belt",
  120. lring = "Defending Ring"
  121. }
  122. sets.tp.dualwield.low_acc = {
  123. head = "Iuitl Headgear",
  124. neck = "Asperity Necklace",
  125. lear = "Brutal Earring",
  126. rear = "Suppanomimi",
  127. body = "Thaumas Coat",
  128. hands = "Iuitl Wristbands",
  129. lring = "Rajas Ring",
  130. rring = "Epona's Ring",
  131. back = "Atheling Mantle",
  132. waist = "Patentia Sash",
  133. legs = "Manibozho Brais",
  134. feet = "Manibozho Boots"
  135. }
  136. sets.tp.dualwield.low_acc.hybrid = set_combine(sets.tp.dualwield.low_acc, hybrid_dt)
  137.  
  138. sets.tp.dualwield.med_acc = {
  139. head = "Whirlpool mask",
  140. neck = "Asperity Necklace",
  141. lear = "Heartseeker earring",
  142. rear = "Dudgeon Earring",
  143. body = "Thaumas Coat",
  144. hands = "Iuitl Wristbands",
  145. lring = "Rajas Ring",
  146. rring = "Epona's Ring",
  147. back = "Letalis Mantle",
  148. waist = "Patentia Sash",
  149. legs = "Manibozho Brais",
  150. feet = "Manibozho Boots"
  151. }
  152. sets.tp.dualwield.med_acc.hybrid = set_combine(sets.tp.dualwield.med_acc, hybrid_dt)
  153. sets.tp.dualwield.high_acc = sets.tp.dualwield.med_acc
  154. sets.tp.dualwield.high_acc.hybrid = set_combine(sets.tp.dualwield.high_acc, hybrid_dt)
  155. sets.tp.singlewield = {}
  156. sets.tp.singlewield = dualwield
  157.  
  158. sets.ws = {}
  159. sets.ws.namas = {}
  160. sets.ws.namas.low_acc = {
  161. head = "Orion Beret +1",
  162. neck = "Light Gorget",
  163. lear = "Vulcan's Pearl",
  164. rear = "Vulcan's pearl",
  165. body = "Orion Jerkin +1",
  166. hands = "Orion Bracers +1",
  167. lring = "Rajas Ring",
  168. rring = "Pyrosoul Ring",
  169. back = "Buquwik Cape",
  170. waist = "Light Belt",
  171. legs = "Nahtirah Trousers",
  172. feet = "Orion Socks +1"
  173. }
  174.  
  175. sets.ws.namas.med_acc = {
  176. head = "Orion Beret +1",
  177. neck = "Light Gorget",
  178. rear = "Clearview earring",
  179. lear = "Volley Earring",
  180. body = "Orion Jerkin +1",
  181. hands = "Iuitl Wristbands",
  182. lring = "Paqichikaji Ring",
  183. rring = "Pyrosoul Ring",
  184. back = "Lutian Cape",
  185. waist = "Light Belt",
  186. legs = "Orion braccae +1",
  187. feet = "Orion Socks +1"
  188. }
  189.  
  190. sets.ws.namas.high_acc = {
  191. head = "Orion Beret +1",
  192. neck = "Light Gorget",
  193. rear = "Clearview earring",
  194. lear = "Volley Earring",
  195. body = "Orion Jerkin +1",
  196. hands = "Iuitl Wristbands",
  197. lring = "Paqichikaji Ring",
  198. rring = "Pyrosoul Ring",
  199. back = "Lutian Cape",
  200. waist = "Light Belt",
  201. legs = "Orion braccae +1",
  202. feet = "Orion Socks +1"
  203. }
  204.  
  205. sets.ws.jishnu = {}
  206. sets.ws.jishnu.low_acc = {
  207. head = "Orion Beret +1",
  208. neck = "Light Gorget",
  209. rear = "Vulcan's pearl",
  210. lear = "Moonshade Earring",
  211. body = "Orion Jerkin +1",
  212. hands = "Orion Bracers +1",
  213. lring = "Rajas Ring",
  214. rring = "Pyrosoul Ring",
  215. back = "Rancorous mantle",
  216. waist = "Light Belt",
  217. legs = "Nahtirah Trousers",
  218. feet = "Orion Socks +1"
  219. }
  220.  
  221. sets.ws.jishnu.med_acc = {
  222. head = "Orion Beret +1",
  223. neck = "Light Gorget",
  224. rear = "Moonshade Earring",
  225. lear = "Volley Earring",
  226. body = "Orion Jerkin +1",
  227. hands = "Iuitl Wristbands",
  228. lring = "Rajas Ring",
  229. rring = "Paqichikaji Ring",
  230. back = "Lutian Cape",
  231. waist = "Light Belt",
  232. legs = "Orion braccae +1",
  233. feet = "Orion Socks +1"
  234. }
  235. sets.ws.jishnu.high_acc = sets.ws.jishnu.med_acc
  236.  
  237. sets.snapshot = {
  238. head = "Sylvan Gapette +2",
  239. body = "Sylvan Caban +2",
  240. hands = "Iuitl Wristbands",
  241. waist = "Impulse belt",
  242. feet = "Wurrukatte Boots"
  243. }
  244.  
  245. sets.jobability = {}
  246. sets.jobability['Scavenge'] = {
  247. feet = "Orion Socks +1"
  248. }
  249. sets.jobability['Camouflage'] = {
  250. body = "Orion Jerkin +1"
  251. }
  252. sets.jobability['Sharpshot'] = {
  253. legs = "Orion Braccae +1"
  254. }
  255.  
  256. sets.jobability['Eagle Eye Shot'] = T{}
  257. sets.jobability['Eagle Eye Shot'].low_acc = {
  258. head = "Orion Beret +1",
  259. neck = "Ocachi Gorget",
  260. rear = "Vulcan's pearl",
  261. lear = "Vulcan's pearl",
  262. body = "Orion Jerkin +1",
  263. hands = "Iuitl Wristbands",
  264. lring = "Rajas Ring",
  265. rring = "Pyrosoul Ring",
  266. back = "Buquwik Cape",
  267. waist = "Elanid Belt",
  268. legs = "Nahtirah Trousers",
  269. feet = "Orion Socks +1"
  270. }
  271. sets.jobability['Eagle Eye Shot'].med_acc = set_combine(sets.jobability['Eagle Eye Shot'].low_acc, {
  272. rear = "Clearview Earring",
  273. lring = "Paqichikaji Ring",
  274. })
  275. sets.jobability['Eagle Eye Shot'].high_acc = set_combine(sets.jobability['Eagle Eye Shot'].med_acc, {
  276. back = "Lutian Cape",
  277. legs = "Orion Braccae +1"
  278. })
  279.  
  280. sets.jobability['Shadowbind'] = {
  281. hands = "Orion Bracers +1"
  282. }
  283. sets.jobability['Bounty Shot'] = {
  284. hands = "Syl. Glvltte. +2",
  285. }
  286.  
  287. notice('Ranger Binding Interface:')
  288. notice(' F9 Cycles accuracy level')
  289. notice(' F9+Ctrl Cycles combat style')
  290. notice(' F9+Alt Cycles hybrid level')
  291. notice(' F10 Enables PDT layer')
  292. notice(' F11 Enables MDT layer')
  293. notice(' F12 Resets to current best set.')
  294. notice(' F12+Alt Reset and clears PDT/MDT.')
  295. windower.send_command('bind F9 gs c cycle accuracy')
  296. windower.send_command('bind ^F9 gs c cycle style')
  297. windower.send_command('bind !F9 gs c cycle hybrid')
  298. windower.send_command('bind F10 gs c defense pdt')
  299. windower.send_command('bind F11 gs c defense mdt')
  300. windower.send_command('bind F12 gs c reset')
  301. windower.send_command('bind !F12 gs c hardreset')
  302. end
  303.  
  304. function notice(msg, color)
  305. if color == nil then
  306. color = 158
  307. end
  308. windower.add_to_chat(color, msg)
  309. end
  310.  
  311. function file_unload()
  312. windower.send_command('unbind F9')
  313. windower.send_command('unbind ^F9')
  314. windower.send_command('unbind !F9')
  315. windower.send_command('unbind F10')
  316. windower.send_command('unbind F11')
  317. windower.send_command('unbind F12')
  318. windower.send_command('unbind !F12')
  319. notice('Unbinding Interface.')
  320. end
  321.  
  322. --[[******************************************************************************************]]
  323. --[[ Configuration variables. More options can be added here and wired into sets accordingly. ]]
  324.  
  325. local AccuracyLevels = T{'low', 'med', 'high'}
  326. local AccuracyLevel = AccuracyLevels[1]
  327.  
  328. local CombatStyles = T{'yoichi', 'dualwield'}
  329. local CombatStyle = CombatStyles[1]
  330.  
  331. local HybridStyles = T{'normal', 'low'}
  332. local HybridStyle = HybridStyles[1]
  333. --[[******************************************************************************************]]
  334. --[[******************************************************************************************]]
  335.  
  336. local PDTEnabled = false;
  337. local MDTEnabled = false;
  338.  
  339.  
  340. function precast(spell, action)
  341. if spell.type == 'JobAbility' then
  342. if spell.name == 'Eagle Eye Shot' then
  343. equip(sets.jobability[spell.name][AccuracyLevel .. '_acc'])
  344. else
  345. equip(sets.jobability[spell.name])
  346. end
  347. elseif spell.type == 'WeaponSkill' then
  348. if spell.name == "Namas Arrow" then
  349. equip(sets.ws.namas[AccuracyLevel .. '_acc'])
  350. elseif spell.name == "Jishnu's Radiance" then
  351. equip(sets.ws.jishnu[AccuracyLevel .. '_acc'])
  352. end
  353. elseif spell.name == 'Ranged' then
  354. equip(sets.snapshot)
  355. end
  356. end
  357.  
  358. function midcast(spell,action)
  359. if spell.name == 'Ranged' then
  360. if buffactive['Barrage'] then
  361. -- Barrage in one acc level higher than we currently use.
  362. local acc = S{AccuracyLevel, AccuracyLevel % #AccuracyLevels +1}:max()
  363. equip(sets.tp.yoichi.barrage[acc .. '_acc'])
  364. else
  365. equip(sets.tp.yoichi[AccuracyLevel .. '_acc'])
  366. end
  367. end
  368. end
  369.  
  370. function update_current_set(status)
  371. if status == nil then
  372. status = player.status
  373. end
  374.  
  375. local current = nil
  376. if status == 'Idle' then
  377. current = sets.idle.standing
  378. elseif status == 'Engaged' and CombatStyle == 'yoichi' then
  379. current = sets.idle.shooting
  380. elseif status == 'Engaged' and CombatStyle == 'dualwield' then
  381. current = sets.tp.dualwield[AccuracyLevel .. '_acc']
  382. end
  383.  
  384. if current then
  385. if PDTEnabled then
  386. current = set_combine(current, sets.pdt)
  387. elseif MDTEnabled then
  388. current = set_combine(current, sets.mdt)
  389. elseif HybridStyle ~= HybridStyles[1] then
  390. if current['hybrid'] ~= nil then
  391. current = current.hybrid
  392. end
  393. end
  394. equip(current)
  395. end
  396.  
  397. end
  398.  
  399. function aftercast(spell,action)
  400. update_current_set()
  401. end
  402.  
  403. function status_change(new,old)
  404. update_current_set(new)
  405. end
  406.  
  407. function buff_change(status,gain_or_loss)
  408. end
  409.  
  410. function self_command(command)
  411. local params = command:psplit('%s')
  412.  
  413. if params[1] == 'cycle' then
  414. if params[2] == 'accuracy' then
  415. local next = cycle(AccuracyLevels, AccuracyLevel)
  416. AccuracyLevel = AccuracyLevels[next]
  417. notice('Accuracy Level: ' .. AccuracyLevel:ucfirst())
  418. update_current_set()
  419. elseif params[2] == 'style' then
  420. local next = cycle(CombatStyles, CombatStyle)
  421. CombatStyle = CombatStyles[next]
  422. notice('Combat Style: ' .. CombatStyle:ucfirst())
  423. update_current_set()
  424. elseif params[2] == 'hybrid' then
  425. local next = cycle(HybridStyles, HybridStyle)
  426. HybridStyle = HybridStyles[next]
  427. notice('Hybrid level: ' .. HybridStyle:ucfirst())
  428. update_current_set()
  429. end
  430. elseif params[1] == 'reset' then
  431. update_current_set()
  432. elseif params[1] == 'hardreset' then
  433. PDTEnabled = false
  434. MDTEnabled = false
  435. notice('PDT/MDT reset.')
  436. update_current_set()
  437. elseif params[1] == 'defense' then
  438. if params[2] == 'pdt' then
  439. PDTEnabled = true
  440. notice('PDT enabled.')
  441. update_current_set()
  442. elseif params[2] == 'mdt' then
  443. MDTEnabled = true
  444. notice('MDT enabled.')
  445. update_current_set()
  446. end
  447. end
  448. end
  449.  
  450. -- Finds current in possible and returns the index to the
  451. -- next element in the table, circularly.
  452. function cycle(possibles, current)
  453. local c = 0
  454. for k, v in ipairs(possibles) do
  455. if v == current then
  456. c = k
  457. end
  458. end
  459. return c % #possibles +1
  460. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement