Advertisement
bongarippa

EvdaSAM

Nov 16th, 2023
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.52 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 +1",
  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 +1"}
  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={ name="Nyame Helm", augments={'Path: B',}},
  96. body={ name="Sakonji Domaru +3", augments={'Enhances "Overwhelm" effect',}},
  97. hands="Kasuga Kote +3",
  98. legs="Hiza. Hizayoroi +2",
  99. feet={ name="Sak. Sune-Ate +3", augments={'Enhances "Meikyo Shisui" effect',}},
  100. neck={ name="Sam. Nodowa +2", augments={'Path: A',}},
  101. waist={ name="Sailfi Belt +1", augments={'Path: A',}},
  102. left_ear="Moonshade Earring",
  103. right_ear={ name="Kasuga Earring +1", augments={'System: 1 ID: 1676 Val: 0','Accuracy+12','Mag. Acc.+12','Weapon skill damage +2%',}},
  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, {})
  122.  
  123. sets.precast.WS['Tachi: Gekko'] = set_combine(sets.precast.WS, {})
  124.  
  125. sets.precast.WS['Tachi: Yukikaze'] = set_combine(sets.precast.WS, {})
  126.  
  127. sets.precast.WS['Tachi: Ageha'] = set_combine(sets.precast.WS, {})
  128.  
  129. sets.precast.WS['Tachi: Jinpu'] = set_combine(sets.precast.WS, {hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
  130. neck="Sanctity Necklace",
  131. waist="Eschan Stone",
  132. left_ear="Novio Earring",
  133. right_ear="Friomisi Earring"})
  134.  
  135.  
  136. -- Midcast Sets
  137. sets.midcast.FastRecast = {
  138. head="Yaoyotl Helm",
  139. body="Otronif Harness +1",hands="Otronif Gloves",
  140. legs="Phorcys Dirs",feet="Otronif Boots +1"}
  141.  
  142.  
  143. -- Sets to return to when not performing an action.
  144.  
  145. -- Resting sets
  146. sets.resting = {neck="Wiglen Gorget",ring1="Sheltered Ring",ring2="Paguroidea Ring"}
  147.  
  148.  
  149. -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  150.  
  151. sets.idle.Field = {ammo="Staunch Tathlum",
  152. head={ name="Nyame Helm", augments={'Path: B',}},
  153. body="Nyame Mail",
  154. hands={ name="Nyame Gauntlets", augments={'Path: B',}},
  155. legs={ name="Nyame Flanchard", augments={'Path: B',}},
  156. feet="Nyame Sollerets",
  157. neck="Bathy Choker",
  158. waist="Plat. Mog. Belt",
  159. left_ear="Eabani Earring",
  160. right_ear="Odnowa Earring +1",
  161. left_ring="Shneddick Ring",
  162. right_ring="Paguroidea Ring",
  163. back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}}}
  164.  
  165. sets.idle.Town = set_combine(sets.idle.Field, {})
  166.  
  167. sets.idle.Weak = set_combine(sets.idle.Field, {})
  168.  
  169. -- Defense sets
  170. sets.defense.PDT = { }
  171.  
  172. sets.defense.Reraise = {}
  173.  
  174. sets.defense.MDT = {}
  175.  
  176. sets.Kiting = {left_ring="Shneddick Ring"}
  177.  
  178. sets.Reraise = {head="Twilight Helm",body="Twilight Mail"}
  179.  
  180. -- Engaged sets
  181.  
  182. -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
  183. -- sets if more refined versions aren't defined.
  184. -- If you create a set with both offense and defense modes, the offense mode should be first.
  185. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  186.  
  187. -- Normal melee group
  188. -- Delay 450 GK, 25 Save TP => 65 Store TP for a 5-hit (25 Store TP in gear)
  189. sets.engaged = { ammo="Aurgelmir Orb +1",
  190. head="Kasuga Kabuto +2",
  191. body="Kasuga Domaru +2",
  192. hands="Wakido Kote +2",
  193. legs="Kasuga Haidate +2",
  194. feet="Kas. Sune-Ate +2",
  195. neck="Sam. Nodowa +2",
  196. waist="Sweordfaetels +1",
  197. left_ear="Telos Earring",
  198. right_ear="Kasuga Earring +1",
  199. left_ring="Niqmaddu Ring",
  200. right_ring="Chirich Ring +1",
  201. back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},}
  202.  
  203. sets.engaged.Acc = set_combine(sets.engaged, {ammo="Ginsen",
  204. waist="Ioskeha Belt"})
  205.  
  206. sets.engaged.PDT = set_combine(sets.engaged, {})
  207. sets.engaged.Acc.PDT = set_combine(sets.engaged.PDT, {})
  208. sets.engaged.Reraise = {}
  209.  
  210.  
  211.  
  212.  
  213. sets.buff.Sekkanoki = {hands="Kasuga Kote +2"}
  214. sets.buff.Sengikori = {feet="Kasuga Sune-ate +"}
  215. sets.buff['Meikyo Shisui'] = {feet="Sak. Sune-Ate +3"}
  216. end
  217.  
  218.  
  219. -------------------------------------------------------------------------------------------------------------------
  220. -- Job-specific hooks for standard casting events.
  221. -------------------------------------------------------------------------------------------------------------------
  222.  
  223. -- Set eventArgs.handled to true if we don't want any automatic target handling to be done.
  224. function job_pretarget(spell, action, spellMap, eventArgs)
  225. if spell.type == 'WeaponSkill' then
  226. -- Change any GK weaponskills to polearm weaponskill if we're using a polearm.
  227. if player.equipment.main=='Quint Spear' or player.equipment.main=='Quint Spear' then
  228. if spell.english:startswith("Tachi:") then
  229. send_command('@input /ws "Impulse Drive" '..spell.target.raw)
  230. eventArgs.cancel = true
  231. end
  232. end
  233. end
  234. end
  235.  
  236. -- Run after the default precast() is done.
  237. -- eventArgs is the same one used in job_precast, in case information needs to be persisted.
  238. function job_post_precast(spell, action, spellMap, eventArgs)
  239. if spell.type:lower() == 'weaponskill' then
  240. if state.Buff.Sekkanoki then
  241. equip(sets.buff.Sekkanoki)
  242. end
  243. if state.Buff.Sengikori then
  244. equip(sets.buff.Sengikori)
  245. end
  246. if state.Buff['Meikyo Shisui'] then
  247. equip(sets.buff['Meikyo Shisui'])
  248. end
  249. end
  250. end
  251.  
  252.  
  253. -- Run after the default midcast() is done.
  254. -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  255. function job_post_midcast(spell, action, spellMap, eventArgs)
  256. -- Effectively lock these items in place.
  257. if state.HybridMode.value == 'Reraise' or
  258. (state.DefenseMode.value == 'Physical' and state.PhysicalDefenseMode.value == 'Reraise') then
  259. equip(sets.Reraise)
  260. end
  261. end
  262.  
  263. -------------------------------------------------------------------------------------------------------------------
  264. -- User code that supplements standard library decisions.
  265. -------------------------------------------------------------------------------------------------------------------
  266.  
  267. -- Called by the 'update' self-command, for common needs.
  268. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  269. function job_update(cmdParams, eventArgs)
  270. update_combat_form()
  271. end
  272.  
  273. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  274. function display_current_job_state(eventArgs)
  275.  
  276. end
  277.  
  278. -------------------------------------------------------------------------------------------------------------------
  279. -- Utility functions specific to this job.
  280. -------------------------------------------------------------------------------------------------------------------
  281.  
  282. function update_combat_form()
  283. if areas.Adoulin:contains(world.area) and buffactive.ionis then
  284. state.CombatForm:set('Adoulin')
  285. else
  286. state.CombatForm:reset()
  287. end
  288. end
  289.  
  290. -- Select default macro book on initial load or subjob change.
  291. function select_default_macro_book()
  292. -- Default macro set/book
  293. if player.sub_job == 'WAR' then
  294. set_macro_page(1, 2)
  295. end
  296. end
  297.  
  298.  
  299. -- Set eventArgs.handled to true if we don't want any automatic target handling to be done.
  300. function job_pretarget(spell, action, spellMap, eventArgs)
  301.  
  302. end
  303.  
  304. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  305. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  306. function job_precast(spell, action, spellMap, eventArgs)
  307.  
  308. end
  309.  
  310. function precast(spell,abil)
  311. --equips favorite weapon if disarmed
  312. if player.equipment.main == "empty" or player.equipment.sub == "empty" then
  313. equip({main="Masamune",
  314. sub="Utu Grip"})
  315. end
  316. end
  317.  
  318. -- Run after the default aftercast() is done.
  319. -- eventArgs is the same one used in job_aftercast, in case information needs to be persisted.
  320. function job_post_aftercast(spell, action, spellMap, eventArgs)
  321.  
  322. end
  323.  
  324. -------------------------------------------------------------------------------------------------------------------
  325. -- Job-specific hooks for non-casting events.
  326. -------------------------------------------------------------------------------------------------------------------
  327.  
  328. -- Called when the player's status changes.
  329. function job_status_change(newStatus, oldStatus, eventArgs)
  330. update_combat_weapon()
  331. update_melee_groups()
  332. end
  333.  
  334. -------------------------------------------------------------------------------------------------------------------
  335. -- Utility functions specific to this job.
  336. -------------------------------------------------------------------------------------------------------------------
  337. -- Called when a player gains or loses a buff.
  338. -- buff == buff gained or lost
  339. -- gain == true if the buff was gained, false if it was lost.
  340. function job_buff_change(buff,gain)
  341. if buff == "Aftermath: Lv.3" or buff == "Aftermath" then
  342. classes.CustomMeleeGroups:clear()
  343. if (buff == "Aftermath: Lv.3" and gain) or buffactive["Aftermath: Lv.3"] then
  344. if player.equipment.main == "Kogarasumaru" then
  345. classes.CustomMeleeGroups:append('AM3')
  346. if gain then
  347. 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.]')
  348. else
  349. send_command('timers delete "Aftermath: Lv.3"')
  350. add_to_chat(123,'AM3: [OFF]')
  351. end
  352. end
  353. end
  354. if (buff == "Aftermath" and gain) or buffactive.Aftermath then
  355. if player.equipment.main == "Kogarasumaru" and state.HybridMode.value == 'PDT' then
  356. classes.CustomMeleeGroups:append('AM')
  357. end
  358. end
  359. end
  360. if buff == "Aftermath: Lv.3" or buff == "Aftermath" then
  361. handle_equipping_gear(player.status)
  362. end
  363. if buff == "sleep" and gain and player.hp > 200 and player.status == "Engaged" then
  364. equip({head="Vim Torque +1"})
  365. else
  366. handle_equipping_gear(player.status)
  367. end
  368. end
  369.  
  370. -- Called by the 'update' self-command, for common needs.
  371. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  372. function job_update(cmdParams, eventArgs)
  373. update_combat_weapon()
  374. update_melee_groups()
  375. end
  376.  
  377. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  378. function display_current_job_state(eventArgs)
  379. local msg = 'Melee'
  380. if state.CombatForm.has_value then
  381. msg = msg .. ' (' .. state.CombatForm.value .. ')'
  382. end
  383. if state.CombatWeapon.has_value then
  384. msg = msg .. ' (' .. state.CombatWeapon.value .. ')'
  385. end
  386. msg = msg .. ': '
  387. msg = msg .. state.OffenseMode.value
  388. if state.HybridMode.value ~= 'Normal' then
  389. msg = msg .. '/' .. state.HybridMode.value
  390. end
  391. msg = msg .. ', WS: ' .. state.WeaponskillMode.value
  392. if state.DefenseMode.value ~= 'None' then
  393. msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
  394. end
  395. if state.Kiting.value == true then
  396. msg = msg .. ', Kiting'
  397. end
  398. if state.PCTargetMode.value ~= 'default' then
  399. msg = msg .. ', Target PC: '..state.PCTargetMode.value
  400. end
  401. if state.SelectNPCTargets.value == true then
  402. msg = msg .. ', Target NPCs'
  403. end
  404. add_to_chat(122, msg)
  405. eventArgs.handled = true
  406. end
  407.  
  408. function customize_idle_set(idleSet)
  409. if state.Auto_Kite.value == true then
  410. idleSet = set_combine(idleSet, sets.Kiting)
  411. end
  412.  
  413. return idleSet
  414. end
  415.  
  416. function job_handle_equipping_gear(playerStatus, eventArgs)
  417. check_gear()
  418. check_moving()
  419. end
  420.  
  421. function job_update(cmdParams, eventArgs)
  422. handle_equipping_gear(player.status)
  423. end
  424. -- Select default macro book on initial load or subjob change.
  425. function select_default_macro_book()
  426. set_macro_page(1, 5)
  427. end
  428. function update_combat_weapon()
  429. state.CombatWeapon:set(player.equipment.main)
  430. end
  431.  
  432. function update_melee_groups()
  433. classes.CustomMeleeGroups:clear()
  434. if buffactive['Aftermath: Lv.3'] and player.equipment.main == "Kogarasumaru" then
  435. classes.CustomMeleeGroups:append('AM3')
  436. end
  437. if buffactive.Aftermath and player.equipment.main == "Apocalypse" and state.HybridMode.value == 'PDT' then
  438. classes.CustomMeleeGroups:append('AM')
  439. end
  440. end
  441.  
  442. function is_sc_element_today(spell)
  443. if spell.type ~= 'WeaponSkill' then
  444. return
  445. end
  446.  
  447. local weaponskill_elements = S{}:
  448. union(skillchain_elements[spell.skillchain_a]):
  449. union(skillchain_elements[spell.skillchain_b]):
  450. union(skillchain_elements[spell.skillchain_c])
  451.  
  452. if weaponskill_elements:contains(world.day_element) then
  453. return true
  454. else
  455. return false
  456. end
  457. end
  458. function job_self_command(cmdParams, eventArgs)
  459. gearinfo(cmdParams, eventArgs)
  460. end
  461.  
  462. function gearinfo(cmdParams, eventArgs)
  463. if cmdParams[1] == 'gearinfo' then
  464. if type(cmdParams[4]) == 'string' then
  465. if cmdParams[4] == 'true' then
  466. moving = true
  467. elseif cmdParams[4] == 'false' then
  468. moving = false
  469. end
  470. end
  471. if not midaction() then
  472. job_update()
  473. end
  474. end
  475. end
  476.  
  477. function check_moving()
  478. if state.DefenseMode.value == 'None' and state.Kiting.value == false then
  479. if state.Auto_Kite.value == false and moving then
  480. state.Auto_Kite:set(true)
  481. elseif state.Auto_Kite.value == true and moving == false then
  482. state.Auto_Kite:set(false)
  483. end
  484. end
  485. end
  486.  
  487. function check_gear()
  488. if no_swap_gear:contains(player.equipment.left_ring) then
  489. disable("ring1")
  490. else
  491. enable("ring1")
  492. end
  493. if no_swap_gear:contains(player.equipment.right_ring) then
  494. disable("ring2")
  495. else
  496. enable("ring2")
  497. end
  498. end
  499.  
  500. windower.register_event('zone change',
  501. function()
  502. if no_swap_gear:contains(player.equipment.left_ring) then
  503. enable("ring1")
  504. equip(sets.idle)
  505. end
  506. if no_swap_gear:contains(player.equipment.right_ring) then
  507. enable("ring2")
  508. equip(sets.idle)
  509. end
  510. end
  511. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement