bongarippa

EvdaSAM

Nov 16th, 2023 (edited)
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.04 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job. Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. -- Initialization function for this job file.
  6. function get_sets()
  7. include('organizer-lib')
  8. mote_include_version = 2
  9.  
  10. -- Load and initialize the include file.
  11. include('Mote-Include.lua')
  12. end
  13.  
  14.  
  15. -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
  16. function job_setup()
  17. state.Buff.Hasso = buffactive.Hasso or false
  18. state.Buff.Seigan = buffactive.Seigan or false
  19. state.Buff.Sekkanoki = buffactive.Sekkanoki or false
  20. state.Buff.Sengikori = buffactive.Sengikori or false
  21. state.Buff['Meikyo Shisui'] = buffactive['Meikyo Shisui'] or false
  22.  
  23. state.Buff['Aftermath'] = buffactive['Aftermath: Lv.1'] or
  24. buffactive['Aftermath: Lv.2'] or
  25. buffactive['Aftermath: Lv.3'] or false
  26.  
  27. no_swap_gear = S{"Warp Ring", "Dim. Ring (Dem)", "Dim. Ring (Holla)", "Dim. Ring (Mea)",
  28. "Trizek Ring", "Echad Ring", "Facility Ring", "Capacity Ring"}
  29.  
  30. include('Mote-TreasureHunter')
  31. state.TreasureMode:set('Tag')
  32. end
  33.  
  34. -------------------------------------------------------------------------------------------------------------------
  35. -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
  36. -------------------------------------------------------------------------------------------------------------------
  37.  
  38. -- Setup vars that are user-dependent.
  39. function user_setup()
  40. state.OffenseMode:options('Normal', 'Acc')
  41. state.HybridMode:options('Normal', 'PDT', 'Reraise')
  42. state.WeaponskillMode:options('Normal', 'Acc', 'Mod')
  43. state.PhysicalDefenseMode:options('PDT', 'Reraise')
  44.  
  45. update_combat_form()
  46.  
  47. -- Additional local binds
  48. send_command('bind ^` input /ja "Hasso" <me>')
  49. send_command('bind !` input /ja "Seigan" <me>')
  50.  
  51. state.Auto_Kite = M(false, 'Auto_Kite')
  52. moving = false
  53.  
  54. send_command('lua l gearinfo')
  55.  
  56. select_default_macro_book()
  57. end
  58.  
  59.  
  60. -- Called when this job file is unloaded (eg: job change)
  61. function user_unload()
  62. send_command('unbind ^`')
  63. send_command('unbind !-')
  64. end
  65.  
  66. function user_unload()
  67. send_command('lua u gearinfo')
  68. end
  69.  
  70.  
  71. -- Define sets and vars used by this job file.
  72. function init_gear_sets()
  73. --------------------------------------
  74. -- Start defining the sets
  75. --------------------------------------
  76.  
  77. -- Precast Sets
  78. -- Precast sets to enhance JAs
  79. sets.precast.JA.Meditate = {head="Wakido Kabuto +3",
  80. hands="Sakonji Kote +3",
  81. back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}}}
  82. sets.precast.JA['Warding Circle'] = {head="Wakido Kabuto +3"}
  83. sets.precast.JA['Blade Bash'] = {hands="Sakonji Kote +3"}
  84. sets.precast.JA['Meikyo Shisui'] = {feet="Sak. Sune-Ate +3"}
  85. -- Waltz set (chr and vit)
  86. sets.precast.Waltz = {}
  87.  
  88. -- Don't need any special gear for Healing Waltz.
  89. sets.precast.Waltz['Healing Waltz'] = {}
  90.  
  91.  
  92. -- Weaponskill sets
  93. -- Default set for any weaponskill that isn't any more specifically defined
  94. sets.precast.WS = { ammo="Knobkierrie",
  95. head="Nyame Helm",
  96. body="Nyame Mail",
  97. hands="Kasuga Kote +3",
  98. legs="Nyame Flanchard",
  99. feet="Nyame Sollerets",
  100. neck="Sam. Nodowa +2",
  101. waist="Sailfi Belt +1",
  102. left_ear={ name="Moonshade Earring", augments={'Accuracy+4','TP Bonus +250',}},
  103. right_ear="Kasuga Earring +1",
  104. left_ring="Epaminondas's Ring",
  105. right_ring="Sroda Ring",
  106. back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  107.  
  108. -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
  109. sets.precast.WS['Tachi: Fudo'] = set_combine(sets.precast.WS, {})
  110. sets.precast.WS['Tachi: Fudo'].Acc = set_combine(sets.precast.WS.Acc, {})
  111. sets.precast.WS['Tachi: Fudo'].Mod = set_combine(sets.precast.WS['Tachi: Fudo'], {})
  112.  
  113. sets.precast.WS['Tachi: Shoha'] = set_combine(sets.precast.WS, {})
  114. sets.precast.WS['Tachi: Shoha'].Acc = set_combine(sets.precast.WS.Acc, {})
  115. sets.precast.WS['Tachi: Shoha'].Mod = set_combine(sets.precast.WS['Tachi: Shoha'], {})
  116.  
  117. sets.precast.WS['Tachi: Rana'] = set_combine(sets.precast.WS, {})
  118. sets.precast.WS['Tachi: Rana'].Acc = set_combine(sets.precast.WS.Acc, {})
  119. sets.precast.WS['Tachi: Rana'].Mod = set_combine(sets.precast.WS['Tachi: Rana'], {})
  120.  
  121. sets.precast.WS['Tachi: Kasha'] = set_combine(sets.precast.WS, {head="Mpaca's Cap"})
  122.  
  123. sets.precast.WS['Tachi: Gekko'] = set_combine(sets.precast.WS, {head="Mpaca's Cap"})
  124.  
  125. sets.precast.WS['Tachi: Yukikaze'] = set_combine(sets.precast.WS, {head="Mpaca's Cap"})
  126.  
  127. sets.precast.WS['Tachi: Ageha'] = set_combine(sets.precast.WS, {neck="Sanctity Necklace",
  128. left_ring="Medada's Ring",
  129. right_ring="Metamor. Ring +1"})
  130.  
  131.  
  132. sets.precast.WS['Tachi: Jinpu'] = {ammo="Knobkierrie",
  133. head="Nyame Helm",
  134. body="Nyame Mail",
  135. hands="Nyame Gauntlets",
  136. legs="Nyame Flanchard",
  137. feet="Nyame Sollerets",
  138. neck="Sam. Nodowa +2",
  139. waist="Orpheus's Sash",
  140. left_ear="Moonshade Earring",
  141. right_ear="Friomisi Earring",
  142. left_ring="Epaminondas's Ring",
  143. right_ring="Medada's Ring",
  144. back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}}}
  145.  
  146. sets.precast.WS['Tachi: Kagero'] = set_combine(sets.precast.WS['Tachi: Jinpu'], {})
  147.  
  148. sets.precast.WS['Tachi: Koki'] = set_combine(sets.precast.WS['Tachi: Jinpu'], {})
  149.  
  150. sets.precast.WS['Tachi: Hobaku'] = set_combine(sets.precast.WS['Tachi: Ageha'], {})
  151.  
  152. sets.precast.WS['Impulse Drive'] = set_combine(sets.precast.WS, {})
  153.  
  154. -- Midcast Sets
  155. sets.midcast.FastRecast = {
  156. head="Yaoyotl Helm",
  157. body="Otronif Harness +1",hands="Otronif Gloves",
  158. legs="Phorcys Dirs",feet="Otronif Boots +1"}
  159.  
  160.  
  161. -- Sets to return to when not performing an action.
  162.  
  163. -- Resting sets
  164. sets.resting = {neck="Wiglen Gorget",ring1="Sheltered Ring",ring2="Paguroidea Ring"}
  165.  
  166.  
  167. -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  168.  
  169. sets.idle.Field = {ammo="Staunch Tathlum",
  170. head="Nyame Helm",
  171. body="Nyame Mail",
  172. hands="Nyame Gauntlets",
  173. legs="Nyame Flanchard",
  174. feet="Danzo Sune-Ate",
  175. neck="Bathy Choker",
  176. waist="Plat. Mog. Belt",
  177. left_ear="Eabani Earring",
  178. right_ear="Odnowa Earring +1",
  179. left_ring="Gelatinous Ring +1",
  180. right_ring="Paguroidea Ring",
  181. back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}}}
  182.  
  183. sets.idle.Town = set_combine(sets.idle.Field, {})
  184.  
  185. sets.idle.Weak = set_combine(sets.idle.Field, {})
  186.  
  187. -- Defense sets
  188. sets.defense.PDT = { }
  189.  
  190. sets.defense.Reraise = {}
  191.  
  192. sets.defense.MDT = {}
  193.  
  194. sets.Kiting = {left_ring="Shneddick Ring"}
  195.  
  196. sets.Reraise = {head="Twilight Helm",body="Twilight Mail"}
  197.  
  198. -- Engaged sets
  199.  
  200. -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
  201. -- sets if more refined versions aren't defined.
  202. -- If you create a set with both offense and defense modes, the offense mode should be first.
  203. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  204.  
  205. -- Normal melee group
  206. -- Delay 450 GK, 25 Save TP => 65 Store TP for a 5-hit (25 Store TP in gear)
  207. sets.engaged = {ammo="Aurgelmir Orb +1",
  208. head="Kasuga Kabuto +3",
  209. body="Kasuga Domaru +3",
  210. hands="Mpaca's Gloves",
  211. legs="Kasuga Haidate +3",
  212. feet={ name="Ryuo Sune-Ate +1", augments={'HP+65','"Store TP"+5','"Subtle Blow"+8',}},
  213. neck="Sam. Nodowa +2",
  214. waist="Sweordfaetels +1",
  215. left_ear="Telos Earring",
  216. right_ear="Kasuga Earring +1",
  217. left_ring="Niqmaddu Ring",
  218. right_ring="Chirich Ring +1",
  219. back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}}}
  220.  
  221. sets.engaged.Acc = set_combine(sets.engaged, {hands="Kasuga Kote +3",
  222. feet="Nyame Sollerets",
  223. waist="Ioskeha Belt +1",
  224. left_ring="Chirich Ring +1"})
  225.  
  226. sets.engaged.PDT = set_combine(sets.engaged, {
  227. feet="Nyame Sollerets"})
  228. sets.engaged.Acc.PDT = set_combine(sets.engaged.PDT, {})
  229. sets.engaged.Reraise = {}
  230.  
  231.  
  232.  
  233.  
  234. sets.buff.Sekkanoki = {hands="Kasuga Kote +2"}
  235. sets.buff.Sengikori = {feet="Kas. Sune-Ate +2"}
  236. sets.buff['Meikyo Shisui'] = {feet="Sak. Sune-Ate +3"}
  237. end
  238.  
  239.  
  240. -------------------------------------------------------------------------------------------------------------------
  241. -- Job-specific hooks for standard casting events.
  242. -------------------------------------------------------------------------------------------------------------------
  243.  
  244. -- Set eventArgs.handled to true if we don't want any automatic target handling to be done.
  245. function job_pretarget(spell, action, spellMap, eventArgs)
  246. if spell.type == 'WeaponSkill' then
  247. -- Change any GK weaponskills to polearm weaponskill if we're using a polearm.
  248. if player.equipment.main=='Quint Spear' or player.equipment.main=='Quint Spear' then
  249. if spell.english:startswith("Tachi:") then
  250. send_command('@input /ws "Impulse Drive" '..spell.target.raw)
  251. eventArgs.cancel = true
  252. end
  253. end
  254. end
  255. end
  256.  
  257. -- Run after the default precast() is done.
  258. -- eventArgs is the same one used in job_precast, in case information needs to be persisted.
  259. function job_post_precast(spell, action, spellMap, eventArgs)
  260. if spell.type:lower() == 'weaponskill' then
  261. if state.Buff.Sekkanoki then
  262. equip(sets.buff.Sekkanoki)
  263. end
  264. if state.Buff.Sengikori then
  265. equip(sets.buff.Sengikori)
  266. end
  267. if state.Buff['Meikyo Shisui'] then
  268. equip(sets.buff['Meikyo Shisui'])
  269. end
  270. end
  271. end
  272.  
  273.  
  274. -- Run after the default midcast() is done.
  275. -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  276. function job_post_midcast(spell, action, spellMap, eventArgs)
  277. -- Effectively lock these items in place.
  278. if state.HybridMode.value == 'Reraise' or
  279. (state.DefenseMode.value == 'Physical' and state.PhysicalDefenseMode.value == 'Reraise') then
  280. equip(sets.Reraise)
  281. end
  282. end
  283.  
  284. -------------------------------------------------------------------------------------------------------------------
  285. -- User code that supplements standard library decisions.
  286. -------------------------------------------------------------------------------------------------------------------
  287.  
  288. -- Called by the 'update' self-command, for common needs.
  289. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  290. function job_update(cmdParams, eventArgs)
  291. update_combat_form()
  292. end
  293.  
  294. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  295. function display_current_job_state(eventArgs)
  296.  
  297. end
  298.  
  299. -------------------------------------------------------------------------------------------------------------------
  300. -- Utility functions specific to this job.
  301. -------------------------------------------------------------------------------------------------------------------
  302.  
  303. function update_combat_form()
  304. if areas.Adoulin:contains(world.area) and buffactive.ionis then
  305. state.CombatForm:set('Adoulin')
  306. else
  307. state.CombatForm:reset()
  308. end
  309. end
  310.  
  311. -- Select default macro book on initial load or subjob change.
  312. function select_default_macro_book()
  313. -- Default macro set/book
  314. if player.sub_job == 'WAR' then
  315. set_macro_page(1, 2)
  316. end
  317. end
  318.  
  319.  
  320. -- Set eventArgs.handled to true if we don't want any automatic target handling to be done.
  321. function job_pretarget(spell, action, spellMap, eventArgs)
  322.  
  323. end
  324.  
  325. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  326. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  327. function job_precast(spell, action, spellMap, eventArgs)
  328.  
  329. end
  330.  
  331. function precast(spell,abil)
  332. --equips favorite weapon if disarmed
  333. if player.equipment.main == "empty" or player.equipment.sub == "empty" then
  334. equip({main="Masamune",
  335. sub="Utu Grip"})
  336. end
  337. end
  338.  
  339. -- Run after the default aftercast() is done.
  340. -- eventArgs is the same one used in job_aftercast, in case information needs to be persisted.
  341. function job_post_aftercast(spell, action, spellMap, eventArgs)
  342.  
  343. end
  344.  
  345. -------------------------------------------------------------------------------------------------------------------
  346. -- Job-specific hooks for non-casting events.
  347. -------------------------------------------------------------------------------------------------------------------
  348.  
  349. -- Called when the player's status changes.
  350. function job_status_change(newStatus, oldStatus, eventArgs)
  351. update_combat_weapon()
  352. update_melee_groups()
  353. end
  354.  
  355. -------------------------------------------------------------------------------------------------------------------
  356. -- Utility functions specific to this job.
  357. -------------------------------------------------------------------------------------------------------------------
  358. -- Called when a player gains or loses a buff.
  359. -- buff == buff gained or lost
  360. -- gain == true if the buff was gained, false if it was lost.
  361. function job_buff_change(buff,gain)
  362. if buff == "Aftermath: Lv.3" or buff == "Aftermath" then
  363. classes.CustomMeleeGroups:clear()
  364. if (buff == "Aftermath: Lv.3" and gain) or buffactive["Aftermath: Lv.3"] then
  365. if player.equipment.main == "Kogarasumaru" then
  366. classes.CustomMeleeGroups:append('AM3')
  367. if gain then
  368. send_command('timers create "Aftermath: Lv.3" 180 down;wait 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];wait 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 20;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  369. else
  370. send_command('timers delete "Aftermath: Lv.3"')
  371. add_to_chat(123,'AM3: [OFF]')
  372. end
  373. end
  374. end
  375. if (buff == "Aftermath" and gain) or buffactive.Aftermath then
  376. if player.equipment.main == "Kogarasumaru" and state.HybridMode.value == 'PDT' then
  377. classes.CustomMeleeGroups:append('AM')
  378. end
  379. end
  380. end
  381. if buff == "Aftermath: Lv.3" or buff == "Aftermath" then
  382. handle_equipping_gear(player.status)
  383. end
  384. if buff == "sleep" and gain and player.hp > 200 and player.status == "Engaged" then
  385. equip({head="Vim Torque +1"})
  386. else
  387. handle_equipping_gear(player.status)
  388. end
  389. end
  390.  
  391. -- Called by the 'update' self-command, for common needs.
  392. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  393. function job_update(cmdParams, eventArgs)
  394. update_combat_weapon()
  395. update_melee_groups()
  396. end
  397.  
  398. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  399. function display_current_job_state(eventArgs)
  400. local msg = 'Melee'
  401. if state.CombatForm.has_value then
  402. msg = msg .. ' (' .. state.CombatForm.value .. ')'
  403. end
  404. if state.CombatWeapon.has_value then
  405. msg = msg .. ' (' .. state.CombatWeapon.value .. ')'
  406. end
  407. msg = msg .. ': '
  408. msg = msg .. state.OffenseMode.value
  409. if state.HybridMode.value ~= 'Normal' then
  410. msg = msg .. '/' .. state.HybridMode.value
  411. end
  412. msg = msg .. ', WS: ' .. state.WeaponskillMode.value
  413. if state.DefenseMode.value ~= 'None' then
  414. msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
  415. end
  416. if state.Kiting.value == true then
  417. msg = msg .. ', Kiting'
  418. end
  419. if state.PCTargetMode.value ~= 'default' then
  420. msg = msg .. ', Target PC: '..state.PCTargetMode.value
  421. end
  422. if state.SelectNPCTargets.value == true then
  423. msg = msg .. ', Target NPCs'
  424. end
  425. add_to_chat(122, msg)
  426. eventArgs.handled = true
  427. end
  428.  
  429. function customize_idle_set(idleSet)
  430. if state.Auto_Kite.value == true then
  431. idleSet = set_combine(idleSet, sets.Kiting)
  432. end
  433.  
  434. return idleSet
  435. end
  436.  
  437. function job_handle_equipping_gear(playerStatus, eventArgs)
  438. check_gear()
  439. check_moving()
  440. end
  441.  
  442. function job_update(cmdParams, eventArgs)
  443. handle_equipping_gear(player.status)
  444. end
  445. -- Select default macro book on initial load or subjob change.
  446. function select_default_macro_book()
  447. set_macro_page(1, 5)
  448. end
  449. function update_combat_weapon()
  450. state.CombatWeapon:set(player.equipment.main)
  451. end
  452.  
  453. function update_melee_groups()
  454. classes.CustomMeleeGroups:clear()
  455. if buffactive['Aftermath: Lv.3'] and player.equipment.main == "Kogarasumaru" then
  456. classes.CustomMeleeGroups:append('AM3')
  457. end
  458. if buffactive.Aftermath and player.equipment.main == "Apocalypse" and state.HybridMode.value == 'PDT' then
  459. classes.CustomMeleeGroups:append('AM')
  460. end
  461. end
  462.  
  463. function is_sc_element_today(spell)
  464. if spell.type ~= 'WeaponSkill' then
  465. return
  466. end
  467.  
  468. local weaponskill_elements = S{}:
  469. union(skillchain_elements[spell.skillchain_a]):
  470. union(skillchain_elements[spell.skillchain_b]):
  471. union(skillchain_elements[spell.skillchain_c])
  472.  
  473. if weaponskill_elements:contains(world.day_element) then
  474. return true
  475. else
  476. return false
  477. end
  478. end
  479. function job_self_command(cmdParams, eventArgs)
  480. gearinfo(cmdParams, eventArgs)
  481. end
  482.  
  483. function gearinfo(cmdParams, eventArgs)
  484. if cmdParams[1] == 'gearinfo' then
  485. if type(cmdParams[4]) == 'string' then
  486. if cmdParams[4] == 'true' then
  487. moving = true
  488. elseif cmdParams[4] == 'false' then
  489. moving = false
  490. end
  491. end
  492. if not midaction() then
  493. job_update()
  494. end
  495. end
  496. end
  497.  
  498. function check_moving()
  499. if state.DefenseMode.value == 'None' and state.Kiting.value == false then
  500. if state.Auto_Kite.value == false and moving then
  501. state.Auto_Kite:set(true)
  502. elseif state.Auto_Kite.value == true and moving == false then
  503. state.Auto_Kite:set(false)
  504. end
  505. end
  506. end
  507.  
  508. function check_gear()
  509. if no_swap_gear:contains(player.equipment.left_ring) then
  510. disable("ring1")
  511. else
  512. enable("ring1")
  513. end
  514. if no_swap_gear:contains(player.equipment.right_ring) then
  515. disable("ring2")
  516. else
  517. enable("ring2")
  518. end
  519. end
  520.  
  521. windower.register_event('zone change',
  522. function()
  523. if no_swap_gear:contains(player.equipment.left_ring) then
  524. enable("ring1")
  525. equip(sets.idle)
  526. end
  527. if no_swap_gear:contains(player.equipment.right_ring) then
  528. enable("ring2")
  529. equip(sets.idle)
  530. end
  531. end
  532. )
Advertisement
Add Comment
Please, Sign In to add comment