Advertisement
Guest User

wren_rdm.lua

a guest
Dec 6th, 2022
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.35 KB | Gaming | 0 0
  1. --[[ *************************************************************
  2.  Wren's RDM gearswap .lua for SuperNova FFXI
  3.  Save as windower/addons/GearSwap/data/RDM.lua
  4.  
  5.   2016-07-28 OC  - First version. Commented to help newbies. :)
  6.   2016-08-01 OC  - Hachirin-no-Obi
  7.  2016-08-06 OC  - Melee (RDM/nin), Shadow Mantle
  8.  2016-08-25 OC  - Sea Capes, added Dark Magic gearset
  9.  2016-10-09 OC  - Hachirin-no-Obi is now situational
  10.  2016-12-02 OC  - Loquac. Earring, Stone Gorget
  11. ************************************************************* --]]
  12.  
  13.  --[[ ******************************************************
  14.   Gearsets - define the various sets of gear we'll wear.
  15. ****************************************************** --]]
  16.  
  17.  function get_sets()
  18.  
  19.      -- idle set is worn when we're standing around doing
  20.     -- nothing.  auto-refresh, movement, MP, -PDT
  21.     -- for RDM this doubles as my fashion set!
  22.     sets.idle = {
  23.         main        = "Terra's Staff",
  24.         sub         = "Reign Grip",
  25.         ammo        = "Hedgehog Bomb",
  26.         head        = "Dls. Chapeau +1",
  27.         neck        = "Fylgja Torque +1",
  28.         left_ear    = "Loquac. Earring",
  29.         right_ear   = "Celestial Earring",
  30.         body        = "Dalmatica +1",
  31.         hands       = "Wise Gloves +1",
  32.         left_ring   = "Celestial Ring",
  33.         right_ring  = "Celestial Ring",
  34.         back        = "Shadow Mantle",
  35.         waist       = "Pythia Sash +1",
  36.         legs        = "Blood Cuisses",
  37.         feet        = "Dls. Boots +1"
  38.     }
  39.  
  40.      -- fast cast set is for casting quickly.  We put
  41.     -- this on before the spell is begun, then switch
  42.     -- to one of the other sets during cast.
  43.     sets.fc = {
  44.          sub         = "Vivid Strap +1",
  45.         head        = "Wlk. Chapeau +1",
  46.         left_ear    = "Loquac. Earring",
  47.         body        = "Dls. Tabard +1"
  48.     }
  49.  
  50.      -- nuke set is for high damage nukes. +MAB and Int.
  51.     -- Note that we only need to specify gear that
  52.     -- differs from our idle set.
  53.     sets.nuke = {
  54.         main        = "Chatoyant Staff",
  55.         sub         = "Wise Strap",
  56.         ammo        = "Phtm. Tathlum",
  57.         head        = "Wlk. Chapeau +1",
  58.         neck        = "Lmg. Medallion +1",
  59.         left_ear    = "Crapaud Earring",
  60.         right_ear   = "Moldavite Earring",
  61.         body        = "Mahatma Hpl.",
  62.         hands       = "Zenith Mitts +1",
  63.         left_ring   = "Omn. Ring +1",
  64.         back        = "Hecate's Cape",
  65.         waist       = "Witch Sash",
  66.         legs        = "Mahatma Slops",
  67.         feet        = "Dls. Boots +1"
  68.     }
  69.  
  70.      -- enfeebling set is for sleep, blind, and others.
  71.     -- mostly +Enfeebling Skill and MACC
  72.     sets.enfeebling = {
  73.         main        = "Chatoyant Staff",
  74.         sub         = "Vivid Strap +1",
  75.         ammo        = "Phtm. Tathlum",
  76.         head        = "Dls. Chapeau +1",
  77.         neck        = "Enfeebling Torque",
  78.         right_ear   = "Enfeebling Earring",
  79.         body        = "Wlk. Tabard +1",
  80.         hands       = "Bricta's Cuffs",
  81.         right_ring  = "Omn. Ring +1",
  82.         back        = "Altruistic Cape",
  83.         waist       = "Witch Sash",
  84.         legs        = "Nashira Seraweels",
  85.         feet        = "Avocat Pigaches"
  86.     }
  87.  
  88.      -- enhancing set is mostly for stoneskin.
  89.     -- mostly +Enhancing Skill and Mind.
  90.     sets.enhancing = {
  91.         main        = "Terra's Staff",
  92.         sub         = "Reign Grip",
  93.         head        = "Goliard Chapeau",
  94.         neck        = "Enhancing Torque",
  95.         right_ear   = "Augment. Earring",
  96.         body        = "Mahatma Hpl.",
  97.         hands       = "Dls. Gloves +1",
  98.         back        = "Merciful Cape",
  99.         legs        = "Wlk. Tights +1",
  100.         feet        = "Mahatma Pigaches"        
  101.     }
  102.  
  103.      -- heal set for getting the most of our cures.
  104.     -- mostly +Cure Potency and Mind.
  105.     sets.heal = {
  106.         main        = "Chatoyant Staff",
  107.         sub         = "Reign Grip",
  108.         head        = "Goliard Chapeau",
  109.         neck        = "Fylgja Torque +1",
  110.         body        = "Dls. Tabard +1",
  111.         hands       = "Wise Gloves +1",
  112.         left_ring   = "Celestial Ring",
  113.         right_ring  = "Celestial Ring",
  114.         back        = "Altruistic Cape",
  115.         waist       = "Pythia Sash +1",
  116.         legs        = "Wlk. Tights +1",
  117.         feet        = "Mahatma Pigaches"
  118.     }
  119.  
  120.      -- dark set is for drain, aspir, and other dark magic
  121.     -- mostly +Dark Skill, MACC, and Int.
  122.     sets.dark = {
  123.         sub         = "Dark Grip",
  124.         head        = "Ree's Headgear",
  125.         neck        = "Dark Torque",
  126.         right_ear   = "Dark Earring",
  127.         hands       = "Blood Fng. Gnt.",
  128.         back        = "Merciful Cape",
  129.         waist       = "Witch Sash",
  130.         legs        = "Nashira Seraweels",
  131.         feet        = "Goliard Clogs"
  132.     }
  133.  
  134.      -- resting set is for recovering MP while /heal.
  135.     -- as much +hMP as possible.
  136.     sets.rest = {
  137.         main        = "Imperial Wand",
  138.         sub         = "Legion Scutum",
  139.         head        = "Mirror Tiara",
  140.         neck        = "Beak Necklace +1",
  141.         left_ear    = "Antivenom Earring",
  142.         right_ear   = "Relaxing Earring",
  143.         body        = "Mahatma Hpl.",
  144.         hands       = "Genie Gages",
  145.         left_ring   = "Celestial Ring",
  146.         right_ring  = "Celestial Ring",
  147.         back        = "Invigorating Cape",
  148.         waist       = "Duelist's Belt",
  149.         legs        = "Libra Subligar",
  150.         feet        = "Goliard Clogs"
  151.     }
  152.  
  153.      -- our convert set swaps a lot of HP for MP, to
  154.     -- get our max HP and MP as close as possible, so
  155.     -- we get the most MP out of convert.
  156.     sets.convert = {
  157.         ammo        = "Hedgehog Bomb",
  158.         head        = "Zenith Crown +1",
  159.         body        = "Dalmatica +1",
  160.         hands       = "Zenith Mitts +1",
  161.         left_ring   = "Celestial Ring",
  162.         right_ring  = "Celestial Ring",
  163.         legs        = "Mahatma Slops",
  164.         feet        = "Zenith Pumps +1"
  165.     }
  166.      
  167.      -- weapons for RDM/NIN melee stance
  168.     sets.melee = {
  169.         main        = "Excalibur",
  170.         sub         = "Joyeuse"
  171.     }
  172.      
  173.      -- gear for melee as RDM/nin.
  174.     -- haste, accuracy, attack
  175.     sets.engaged = {
  176.         neck        = "Peacock Amulet",
  177.         right_ear   = "Suppanomimi",
  178.         hands       = "Dusk Gloves +1",
  179.         left_ring   = "Rajas Ring",
  180.         right_ring  = "Toreador's Ring",
  181.         back        = "Cuchulain's Mantle",
  182.         waist       = "Sonic Belt +1",
  183.         legs        = "Blood Cuisses",
  184.         feet        = "Dusk Ledelsens +1"
  185.     }
  186.      
  187.      sets.ws = {
  188.          head        = "Gnadbhod's Helm",
  189.         neck        = "Soil Gorget",
  190.         right_ear   = "Tmph. Earring +1",
  191.         body        = "Antares Harness",
  192.         waist       = "Warwolf Belt"
  193.     }
  194.      
  195.  end
  196.  
  197.  --[[ ******************************************************
  198.   Equip functions - put on the sets we defined above, and
  199.  echo a note to our chat log so we know it worked.
  200. ****************************************************** --]]
  201.  
  202.  -- all of our equip set macros for RDM must consider whether
  203.  -- we have just converted.  we want to keep on our HP-to-MP
  204.  -- gear until we use the extra MP.  Otherwise it's wasted!
  205.  -- this equips our idle set.
  206.  function equip_idle()
  207.      if melee then
  208.         windower.add_to_chat(8,'[Idle - Melee]')
  209.         equip(sets.idle,sets.melee)
  210.     elseif converted then
  211.         windower.add_to_chat(8,'[Idle - Convert]')
  212.         equip(sets.idle,sets.convert)
  213.     else
  214.          windower.add_to_chat(8,'[Idle]')
  215.         equip(sets.idle)
  216.     end
  217.  end
  218.  
  219.  -- equip our hMP set for /heal
  220.  function equip_rest()
  221.      windower.add_to_chat(8,'[Resting]')
  222.     equip(sets.rest)
  223. end
  224.  
  225. -- equip our fast cast set
  226. function equip_fc()
  227.     if converted then
  228.         equip(sets.fc,sets.convert)
  229.     else
  230.          equip(sets.fc)
  231.     end
  232.  end
  233.  
  234.  -- equip our enhancing set
  235.  function equip_enhancing(spell)
  236.      if converted then
  237.         windower.add_to_chat(8,'[Enhancing - Convert]')
  238.         equip(sets.enhancing,sets.convert)
  239.     else
  240.          windower.add_to_chat(8,'[Enhancing]')
  241.         if spell.name == 'Stoneskin' then
  242.             equip(sets.enhancing,{neck="Stone Gorget"})
  243.         else
  244.              equip(sets.enhancing)
  245.         end
  246.      end
  247.  end
  248.  
  249.  -- equip our enfeebling set
  250.  function equip_enfeebling()
  251.      if converted then
  252.         windower.add_to_chat(8,'[Enfeebling - Convert]')
  253.         equip(sets.enfeebling,sets.convert)
  254.     else
  255.          windower.add_to_chat(8,'[Enfeebling]')
  256.         equip(sets.enfeebling)
  257.     end
  258.  end
  259.  
  260.  -- equip our nuke set. if weather or day matches
  261.  -- the spell element, put on hachirin-no-obi
  262.  function equip_nuke(spell)
  263.      if spell.element == world.day_element then
  264.         windower.add_to_chat(8,'[Nuke - on matching day]')
  265.         equip(sets.nuke,{waist="Hachirin-no-Obi"})
  266.     elseif spell.element == world.weather_element then
  267.         windower.add_to_chat(8,'[Nuke - with matching weather]')
  268.         equip(sets.nuke,{waist="Hachirin-no-Obi"})
  269.     else
  270.          windower.add_to_chat(8,'[Nuke]')
  271.         equip(sets.nuke)
  272.     end
  273.  end
  274.  
  275.  -- equip our healing magic set
  276.  function equip_heal()
  277.      if converted then
  278.         windower.add_to_chat(8,'[Healing - Convert]')
  279.         equip(sets.heal,sets.convert)
  280.     else
  281.          windower.add_to_chat(8,'[Healing]')
  282.         equip(sets.heal)
  283.     end
  284.  end
  285.  
  286.  -- equip our Dark Magic set
  287.  function equip_dark()
  288.      windower.add_to_chat(8,'[Dark]')
  289.     equip(sets.dark)
  290. end
  291.  
  292. -- equip our engaged set
  293. function equip_engaged()
  294.     windower.add_to_chat(8,'[Engaged]')
  295.     equip(sets.engaged)
  296. end
  297.  
  298. -- equip our ws set
  299. function equip_ws()
  300.     windower.add_to_chat(8,'[WS]')
  301.     equip(sets.ws)
  302. end
  303.  
  304. -- a catchall equip function that puts on the correct set
  305. -- whether we are engaged or idle, in melee mode or not
  306. function choose_set()
  307.     if player.status == "Engaged" then
  308.         equip_engaged()
  309.     else
  310.          equip_idle()
  311.     end
  312.  end
  313.  
  314.  --[[ ******************************************************
  315.   Casting functions - these functions run automatically when
  316.  we cast a spell, use a job ability, rest for MP, and so on
  317. ****************************************************** --]]
  318.  
  319.  -- the precast function runs automatically BEFORE we
  320.  -- begin casting a spell or job ability.  For our RDM,
  321.  -- we use this function primarily to set some status
  322.  -- variables to indicate we've entered "converted" mode,
  323.  -- which will last until we spend the extra MP.
  324.  -- also throws on our fast cast gear for spells.
  325.  function precast(spell)
  326.      if converted and player.mp < 804 then
  327.         converting = false
  328.         converted = false
  329.     end
  330.      if spell.name == 'Convert' then
  331.         if not converting then
  332.             converting = true
  333.             windower.add_to_chat(8,'[Convert]')
  334.             cancel_spell()
  335.             equip(sets.convert)
  336.             send_command('wait .5;input /ja Convert <me>')
  337.         else
  338.              converting = false
  339.             converted = true
  340.         end
  341.      elseif (spell.type:contains('Magic') or spell.type:contains('Ninjutsu')) then
  342.         equip_fc()
  343.     elseif spell.type == 'WeaponSkill' then
  344.         equip_ws()
  345.     end
  346.  end
  347.  
  348.  -- midcast, we put on our potency gear depending on
  349.  -- the type of spell being cast.
  350.  function midcast(spell)
  351.      if spell.skill == 'Healing Magic' then
  352.         equip_heal()
  353.     elseif spell.skill == 'Enfeebling Magic' then
  354.         equip_enfeebling()
  355.     elseif spell.skill == 'Enhancing Magic' then
  356.         equip_enhancing(spell)
  357.     elseif spell.skill == 'Elemental Magic' then
  358.         equip_nuke(spell)
  359.     elseif spell.skill == 'Dark Magic' then
  360.         equip_dark()
  361.     end
  362.  end
  363.  
  364.  -- after we finish our spell or ability, return to our
  365.  -- idle set.
  366.  function aftercast(spell)
  367.      if not converting then
  368.         choose_set()
  369.     end
  370.  end
  371.  
  372.  -- as usual, we use the status_change function to swap in
  373.  -- hMP gear when we rest, and remove it when we stand,
  374.  -- engaged set when engaged, and idle when not.
  375.  function status_change(new,old)
  376.      if new == 'Resting' then
  377.         equip_rest()
  378.     else
  379.          choose_set()
  380.     end
  381.  end
  382.  
  383.  -- the self_command function can be called from
  384.  -- a Yush or in-game macro.  I call this function
  385.  -- from a keybind in my Yush file, to swap into
  386.  -- melee stance.  While in this stance we lock our
  387.  -- weapons so that gearswaps won't cause us to lose
  388.  -- any TP we might have.
  389.  function self_command(m)
  390.      if m == "M" then
  391.         if melee == false then
  392.             melee = true
  393.             choose_set()
  394.             disable('main')
  395.             disable('sub')
  396.         else
  397.              melee = false
  398.             enable('main')
  399.             enable('sub')
  400.             choose_set()
  401.         end
  402.      end
  403.  end
  404.  
  405.  --[[ ******************************************************
  406.   Code that runs once, when we first swap to our RDM job
  407. ****************************************************** --]]
  408.  
  409.  -- these variables indicate whether we're in the middle of
  410.  -- converting, or have already converted and need to stay in
  411.  -- our HP to MP gear until we exhaust our extra MP.
  412.  converting = false
  413.  converted = false
  414.  melee = false
  415.  
  416.  -- equip and lockstyle our idle set
  417.  send_command('wait 1;gs equip idle;wait 1;input /lockstyle on')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement