LauEra

RDM.lua

Mar 17th, 2017
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.22 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Lau's Custom ERA RDM Lua -- 75 Cap Server --
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. -- Initialization function for this job file.
  6. function get_sets()
  7.     mote_include_version = 2
  8.    
  9.     sets.obi = {
  10.         Fire = {waist="Karin Obi"},
  11.         Earth = {waist="Dorin Obi"},
  12.         Water = {waist="Suirin Obi"},
  13.         Wind = {waist="Furin Obi"},
  14.         Ice = {waist="Hyorin Obi"},
  15.         Lightning = {waist="Rairin Obi"},
  16.         Light = {waist="Korin Obi"},
  17.         Dark = {waist="Anrin Obi"}}
  18.        
  19.     sets.grips = {
  20.         Fire = {sub="Fire Grip"},
  21.         Earth = {sub="Earth Grip"},
  22.         Water = {sub="Water Grip"},
  23.         Wind = {sub="Wind Grip"},
  24.         Ice = {sub="Ice Grip"},
  25.         Lightning = {sub="Thunder Grip"},
  26.         Light = {sub="Light Grip"},
  27.         Dark = {sub="Dark Grip"}}
  28.  
  29.     -- Load and initialize the include file.
  30.     include('Mote-Include.lua')
  31. end
  32.  
  33.  
  34. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  35.  
  36. -------------------------------------------------------------------------------------------------------------------
  37. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  38. -------------------------------------------------------------------------------------------------------------------
  39.  
  40. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  41. function user_setup()
  42.     state.OffenseMode:options('Normal')
  43.     state.HybridMode:options('Normal')
  44.     state.CastingMode:options('Normal')
  45.     state.IdleMode:options('Normal')
  46.  
  47.     select_default_macro_book()
  48. end
  49.  
  50.  
  51. -- Define sets and vars used by this job file.
  52. function init_gear_sets()
  53.     --------------------------------------
  54.     -- Start defining the sets
  55.     --------------------------------------
  56.    
  57.     -- Precast Sets
  58.    
  59.     sets.precast.FC = {
  60.         head="Warlock's Chapeau +1",
  61.         ear1="Loquacious Earring",
  62.         body="Duelist's Tabard +1"}
  63.  
  64.     -- Weaponskill sets
  65.    
  66.     sets.precast.WS = {}
  67.    
  68.     -- Midcast Sets
  69.    
  70.     sets.midcast.FastRecast = {
  71.         head="Walahra Turban",
  72.         body="Nashira Manteel",
  73.         waist="Velocious belt",
  74.         hands="Dusk Gloves +1"}
  75.    
  76.     sets.midcast.Utsusemi = {
  77.         head="Walahra Turban",
  78.         body="Nashira Manteel",
  79.         waist="Velocious belt",
  80.         hands="Dusk Gloves +1"}
  81.    
  82.     sets.midcast.Cure = {
  83.         main="Chatoyant Staff",
  84.         sub="Raptor Strap +1",
  85.         ammo="Phtm. Tathlum",
  86.         head="Nashira Turban",
  87.         body="Duelist's Tabard +1",
  88.         hands="Bricta's Cuffs",
  89.         legs="Warlock's Tights",
  90.         feet="Mahatma Pigaches",
  91.         neck="Healing Torque",
  92.         waist="Witch Sash",
  93.         left_ear="Celestial Earring",
  94.         right_ear="Static Earring",
  95.         left_ring="Tamas Ring",
  96.         right_ring="Aqua Ring",
  97.         back="Altruistic Cape"}
  98.        
  99.     sets.midcast.Curaga = sets.midcast.Cure
  100.  
  101.     sets.midcast['Enhancing Magic'] = {
  102.         main="Chatoyant Staff",
  103.         ammo="Phtm. Tathlum",
  104.         head="Walahra Turban",
  105.         body="Nashira Manteel",
  106.         hands="Duelist's Gloves +1",
  107.         legs="Warlock's Tights",
  108.         feet="Mahatma Pigaches",
  109.         neck="Faith Torque",
  110.         waist="Velocious Belt",
  111.         left_ear="Celestial Earring",
  112.         right_ear="Static Earring",
  113.         left_ring="Tamas Ring",
  114.         right_ring="Aqua Ring",
  115.         back="Prism Cape"}
  116.            
  117.     sets.midcast.Stoneskin = {
  118.         main="Chatoyant Staff",
  119.         sub="Raptor Strap +1",
  120.         ammo="Phtm. Tathlum",
  121.         head="Duelist's Chapeau +1",
  122.         body="Mahatma Hpl.",
  123.         hands="Duelist's Gloves +1",
  124.         legs="Warlock's Tights",
  125.         feet="Mahatma Pigaches",
  126.         neck="Faith Torque",
  127.         waist="Penitent's Rope",
  128.         left_ear="Celestial Earring",
  129.         right_ear="Static Earring",
  130.         left_ring="Tamas Ring",
  131.         right_ring="Aqua Ring",
  132.         back="Prism Cape"}
  133.        
  134.     sets.midcast.IntEnfeebles = {
  135.         main="Chatoyant Staff",
  136.         ammo="Sturm's Report",
  137.         head="Duelist's Chapeau +1",
  138.         body="Warlock's Tabard +1",
  139.         hands="Duelist's Gloves +1",
  140.         legs="Mahatma Slops",
  141.         feet="Avocat Pigaches",
  142.         neck="Enfeebling Torque",
  143.         waist="Witch Sash",
  144.         left_ear="Loquac. Earring",
  145.         right_ear="Abyssal Earring",
  146.         left_ring="Tamas Ring",
  147.         right_ring="Snow Ring",
  148.         back="Altruistic Cape"}
  149.  
  150.     sets.midcast.MndEnfeebles = {
  151.         main="Chatoyant Staff",
  152.         ammo="Sturm's Report",
  153.         head="Duelist's Chapeau +1",
  154.         body="Warlock's Tabard +1",
  155.         hands="Bricta's Cuffs",
  156.         legs="Mahatma Slops",
  157.         feet="Avocat Pigaches",
  158.         neck="Enfeebling Torque",
  159.         waist="Witch Sash",
  160.         left_ear="Celestial Earring",
  161.         right_ear="Static Earring",
  162.         left_ring="Tamas Ring",
  163.         right_ring="Aqua Ring",
  164.         back="Altruistic Cape"}
  165.      
  166.     sets.midcast['Haste'] = {
  167.         main="Seveneyes",
  168.         sub="Genbu's Shield",
  169.         ammo="Phtm. Tathlum",
  170.         head="Walahra Turban",
  171.         body="Nashira Manteel",
  172.         hands="Dusk Gloves +1",
  173.         legs="Blood Cuisses",
  174.         feet="Mahatma Pigaches",
  175.         neck="Enfeebling Torque",
  176.         waist="Velocious Belt",
  177.         left_ear="Loquac. Earring",
  178.         right_ear="Static Earring",
  179.         left_ring="Tamas Ring",
  180.         right_ring="Aqua Ring",
  181.         back="Altruistic Cape"}
  182.    
  183.     sets.midcast['Refresh'] = {
  184.         main="Seveneyes",
  185.         sub="Genbu's Shield",
  186.         ammo="Phtm. Tathlum",
  187.         head="Walahra Turban",
  188.         body="Nashira Manteel",
  189.         hands="Dusk Gloves +1",
  190.         legs="Blood Cuisses",
  191.         feet="Mahatma Pigaches",
  192.         neck="Enfeebling Torque",
  193.         waist="Velocious Belt",
  194.         left_ear="Loquac. Earring",
  195.         right_ear="Static Earring",
  196.         left_ring="Tamas Ring",
  197.         right_ring="Aqua Ring",
  198.         back="Altruistic Cape"}
  199.        
  200.     sets.midcast['Regen'] = {
  201.         main="Seveneyes",
  202.         sub="Genbu's Shield",
  203.         ammo="Phtm. Tathlum",
  204.         head="Walahra Turban",
  205.         body="Nashira Manteel",
  206.         hands="Dusk Gloves +1",
  207.         legs="Blood Cuisses",
  208.         feet="Mahatma Pigaches",
  209.         neck="Enfeebling Torque",
  210.         waist="Velocious Belt",
  211.         left_ear="Loquac. Earring",
  212.         right_ear="Static Earring",
  213.         left_ring="Tamas Ring",
  214.         right_ring="Aqua Ring",
  215.         back="Altruistic Cape"}
  216.        
  217.     sets.midcast['Protect IV'] = {
  218.         main="Seveneyes",
  219.         sub="Genbu's Shield",
  220.         ammo="Phtm. Tathlum",
  221.         head="Walahra Turban",
  222.         body="Nashira Manteel",
  223.         hands="Dusk Gloves +1",
  224.         legs="Blood Cuisses",
  225.         feet="Mahatma Pigaches",
  226.         neck="Enfeebling Torque",
  227.         waist="Velocious Belt",
  228.         left_ear="Loquac. Earring",
  229.         right_ear="Static Earring",
  230.         left_ring="Tamas Ring",
  231.         right_ring="Aqua Ring",
  232.         back="Altruistic Cape"}
  233.        
  234.     sets.midcast['Shell IV'] = {
  235.         main="Seveneyes",
  236.         sub="Genbu's Shield",
  237.         ammo="Phtm. Tathlum",
  238.         head="Walahra Turban",
  239.         body="Nashira Manteel",
  240.         hands="Dusk Gloves +1",
  241.         legs="Blood Cuisses",
  242.         feet="Mahatma Pigaches",
  243.         neck="Enfeebling Torque",
  244.         waist="Velocious Belt",
  245.         left_ear="Loquac. Earring",
  246.         right_ear="Static Earring",
  247.         left_ring="Tamas Ring",
  248.         right_ring="Aqua Ring",
  249.         back="Altruistic Cape"}
  250.    
  251.     sets.midcast['Elemental Magic'] = {
  252.         main="Chatoyant Staff",
  253.         ammo="Sturm's Report",
  254.         head="Warlock's Chapeau +1",
  255.         body="Mahatma Hpl.",
  256.         hands="Zenith Mitts +1",
  257.         legs="Duelist's Tights +1",
  258.         feet="Duelist's Boots",
  259.         neck="Lemegeton Medallion +1",
  260.         waist="Witch Sash",
  261.         left_ear="Novio Earring",
  262.         right_ear="Moldavite Earring",
  263.         left_ring="Tamas Ring",
  264.         right_ring="Snow Ring",
  265.         back="Merciful Cape"}
  266.        
  267.     sets.midcast['Dark Magic'] = {
  268.         main="Chatoyant Staff",
  269.         ammo="Sturm's Report",
  270.         head="Nashira Turban",
  271.         body="Nashira Manteel",
  272.         hands="Crimson Fng. Gnt.",
  273.         legs="Shadow Trews",
  274.         feet="Mahatma Pigaches",
  275.         neck="Dark Torque",
  276.         waist="Witch Sash",
  277.         left_ear="Loquac. Earring",
  278.         right_ear="Abyssal Earring",
  279.         left_ring="Tamas Ring",
  280.         right_ring="Insect Ring",
  281.         back="Merciful Cape"}
  282.  
  283.     sets.midcast.Stun = sets.midcast['Dark Magic']
  284.  
  285.     sets.midcast.Drain = sets.midcast['Dark Magic']
  286.  
  287.     sets.midcast.Aspir = sets.midcast['Dark Magic']
  288.    
  289.     -- Resting sets
  290.    
  291.     sets.resting = {
  292.         main="Chatoyant Staff",
  293.         sub="Raptor Strap +1",
  294.         ammo="Bibiki Seashell",
  295.         head="Duelist's Chapeau +1",
  296.         body="Dalmatica",
  297.         hands="Hydra Gloves",
  298.         legs="Baron's Slops",
  299.         feet="Avocat Pigaches",
  300.         neck="Beak Necklace +1",
  301.         waist="Qiqirn Sash +1",
  302.         left_ear="Rapture Earring",
  303.         right_ear="Relaxing Earring",
  304.         left_ring="Star Ring",
  305.         right_ring="Star Ring",
  306.         back="Prism Cape"}
  307.    
  308.  
  309.     -- Idle sets
  310.    
  311.     sets.idle = {
  312.         main="Terra's Staff",
  313.         sub="Raptor Strap +1",
  314.         ammo="Sturm's Report",
  315.         head="Duelist's Chapeau +1",
  316.         body="Dalmatica",
  317.         hands="Zenith Mitts +1",
  318.         legs="Blood Cuisses",
  319.         feet="Mahatma Pigaches",
  320.         neck="Orochi Nodowa",
  321.         waist="Witch Sash",
  322.         left_ear="Loquac. Earring",
  323.         right_ear="Static Earring",
  324.         left_ring="Tamas Ring",
  325.         right_ring="Defending Ring",
  326.         back="Hexerei Cape"}
  327.  
  328.     sets.idle.Town = {
  329.         main="Chatoyant Staff",
  330.         sub="Raptor Strap +1",
  331.         ammo="Sturm's Report",
  332.         head="Duelist's Chapeau +1",
  333.         body="Dalmatica",
  334.         hands="Bricta's Cuffs",
  335.         legs="Blood Cuisses",
  336.         feet="Mahatma Pigaches",
  337.         neck="Enfeebling Torque",
  338.         waist="Witch Sash",
  339.         left_ear="Loquac. Earring",
  340.         right_ear="Static Earring",
  341.         left_ring="Tamas Ring",
  342.         right_ring="Aqua Ring",
  343.         back="Altruistic Cape"}
  344.    
  345.     -- Defense sets
  346.  
  347.     sets.Kiting = {legs="Blood Cuisses"}
  348.  
  349.     -- Engaged sets
  350.    
  351.     sets.engaged = {}
  352.    
  353. end
  354.  
  355. -------------------------------------------------------------------------------------------------------------------
  356. -- Job-specific hooks for standard casting events.
  357. -------------------------------------------------------------------------------------------------------------------
  358.  
  359. -- Run after the default midcast() is done.
  360. -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  361.  
  362. function job_midcast(spell, action, spellMap, eventArgs)
  363.     if spell.action_type == "Magic" then
  364.       equip(sets.grips[spell.element])
  365.     end
  366. end
  367.  
  368. function job_post_midcast(spell, action, spellMap, eventArgs)
  369.    if spell.skill == 'Elemental Magic' or spell.skill == 'Dark Magic' then
  370.       if spell.element == world.weather_element or spell.element == world.day_element then
  371.          equip(sets.obi[spell.element])
  372.         end
  373.     end  
  374. end
  375.  
  376. function job_aftercast(spell)
  377.     if spell.english == 'Sleep' or spell.english == 'Sleepga' then
  378.         send_command('@wait 50;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
  379.         send_command('@wait 55;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
  380.         send_command('@wait 57;input /echo ------- '..spell.english..' is wearing off in 3 seconds -------')
  381.         send_command('@wait 59;input /echo ------- '..spell.english..' is wearing off in 1 seconds -------')
  382.     elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
  383.         send_command('@wait 80;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
  384.         send_command('@wait 85;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
  385.         send_command('@wait 87;input /echo ------- '..spell.english..' is wearing off in 3 seconds -------')
  386.     end
  387. end
  388.  
  389. -------------------------------------------------------------------------------------------------------------------
  390. -- Job-specific hooks for non-casting events.
  391. -------------------------------------------------------------------------------------------------------------------
  392.  
  393. -- Handle notifications of general user state change.
  394.  
  395. function job_get_spell_map(spell, default_spell_map)
  396.     if spell.action_type == 'Magic' then
  397.         if spell.skill == 'Enfeebling Magic' then
  398.             if spell.type == 'WhiteMagic' then
  399.                 return 'MndEnfeebles'
  400.             else
  401.                 return 'IntEnfeebles'
  402.             end
  403.         end
  404.     end
  405. end
  406. function job_state_change(stateField, newValue, oldValue)
  407.     if stateField == 'Offense Mode' then
  408.         if newValue == 'None' then
  409.             enable('main','sub','range')
  410.         else
  411.             disable('main','sub','range')
  412.         end
  413.     end
  414. end
  415.  
  416. -------------------------------------------------------------------------------------------------------------------
  417. -- User code that supplements standard library decisions.
  418. -------------------------------------------------------------------------------------------------------------------
  419.  
  420. -- Modify the default idle set after it was constructed.
  421. function customize_idle_set(idleSet)
  422.     if player.mpp < 51 then
  423.         idleSet = set_combine(idleSet, sets.latent_refresh)
  424.     end
  425.    
  426.     return idleSet
  427. end
  428.  
  429. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  430. function display_current_job_state(eventArgs)
  431.     display_current_caster_state()
  432.     eventArgs.handled = true
  433. end
  434.  
  435. -------------------------------------------------------------------------------------------------------------------
  436. -- Utility functions specific to this job.
  437. -------------------------------------------------------------------------------------------------------------------
  438.  
  439. -- Select default macro book on initial load or subjob change.
  440. function select_default_macro_book()
  441.     -- Default macro set/book
  442.     if player.sub_job == 'DNC' then
  443.         set_macro_page(1, 2)
  444.     elseif player.sub_job == 'NIN' then
  445.         set_macro_page(1, 2)
  446.     elseif player.sub_job == 'THF' then
  447.         set_macro_page(1, 2)
  448.     else
  449.         set_macro_page(1, 2)
  450.     end
  451. end
Advertisement
Add Comment
Please, Sign In to add comment