Advertisement
Guest User

wren_whm.lua

a guest
Dec 6th, 2022
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.58 KB | Gaming | 0 0
  1. --[[ *************************************************************
  2.  Wren's WHM gearswap .lua for SuperNova FFXI
  3.  Save as windower/addons/GearSwap/data/WHM.lua
  4.  
  5.   2016-07-25 OC  - First version. Commented to help newbies. :)
  6.   2016-08-01 OC  - Rostrum Pumps
  7.  2016-08-25 OC  - Sea Capes
  8.  2016-12-02 OC  - Loquacious Earring, Stone Gorget
  9. ************************************************************* --]]
  10.  
  11.  --[[ ******************************************************
  12.   Gearsets - define the various sets of gear we'll wear.
  13. ****************************************************** --]]
  14.  
  15.  function get_sets()
  16.  
  17.      -- fashion set is for looking nice while lockstyled.
  18.     -- make sure you include your top-row equipment,
  19.     -- especially if you use a ranged or throwing weapon.
  20.     sets.fashion = {
  21.         main        = "Mjollnir",
  22.         sub         = "Legion Scutum",
  23.         head        = "Lunar Cap",
  24.         body        = "Aristocrat's Coat",
  25.         hands       = "Blessed Mitts +1",
  26.         legs        = "Raven Hose",
  27.         feet        = "Mahatma Pigaches"
  28.     }
  29.  
  30.      -- idle set is worn when we're standing around doing
  31.     -- nothing.  we want auto-refresh, movement, MP
  32.     sets.idle = {
  33.         main        = "Mjollnir",
  34.         sub         = "Legion Scutum",
  35.         ammo        = "Hedgehog Bomb",
  36.         head        = "Walahra Turban",
  37.         neck        = "Beak Necklace +1",
  38.         left_ear    = "Loquac. Earring",
  39.         right_ear   = "Roundel Earring",
  40.         body        = "Aristocrat's Coat",
  41.         hands       = "Blessed Mitts +1",
  42.         left_ring   = "Celestial Ring",
  43.         right_ring  = "Celestial Ring",
  44.         back        = "Invigorating Cape",
  45.         waist       = "Cleric's Belt",
  46.         legs        = "Bls. Trousers +1",
  47.         feet        = "Herald's Gaiters"
  48.     }
  49.  
  50.      -- fast cast set is for casting quickly.  We put
  51.     -- this on before the spell is begun, then switch
  52.     -- to one of the other sets during cast.
  53.     sets.fc = {
  54.          main        = "Chatoyant Staff",
  55.         sub         = "Vivid Strap +1",
  56.         left_ear    = "Loquac. Earring",
  57.         feet        = "Rostrum Pumps"
  58.     }
  59.  
  60.      -- enfeebling set is for sleep, blind, and others.
  61.     -- mostly +Enfeebling Skill and MACC
  62.     sets.enfeebling = {
  63.         main        = "Chatoyant Staff",
  64.         sub         = "Vivid Strap +1",
  65.         head        = "Ree's Headgear",
  66.         neck        = "Enfeebling Torque",
  67.         right_ear   = "Enfeebling Earring",
  68.         body        = "Hlr. Briault +1",
  69.         hands       = "Cleric's Mitts +1",
  70.         back        = "Altruistic Cape",
  71.         waist       = "Witch Sash",
  72.         legs        = "Nashira Seraweels",
  73.         feet        = "Avocat Pigaches"
  74.     }
  75.  
  76.      -- enhancing set is mostly for stoneskin.
  77.     -- mostly +Enhancing Skill and Mind.
  78.     sets.enhancing = {
  79.         main        = "Chatoyant Staff",
  80.         sub         = "Reign Grip",
  81.         head        = "Walahra Turban",
  82.         neck        = "Enhancing Torque",
  83.         right_ear   = "Augment. Earring",
  84.         body        = "Mahatma Hpl.",
  85.         hands       = "Blessed Mitts +1",
  86.         back        = "Merciful Cape",
  87.         legs        = "Bls. Trousers +1",
  88.         feet        = "Clr. Duckbills +1"
  89.     }
  90.  
  91.      -- heal set for getting the most of our cures.
  92.     -- mostly +Cure Potency and Mind.
  93.     sets.heal = {
  94.         main        = "Mjollnir",
  95.         sub         = "Legion Scutum",
  96.         head        = "Walahra Turban",
  97.         neck        = "Fylgja Torque +1",
  98.         right_ear   = "Roundel Earring",
  99.         body        = "Aristocrat's Coat",
  100.         hands       = "Blessed Mitts +1",
  101.         back        = "Altruistic Cape",
  102.         waist       = "Pythia Sash +1",
  103.         legs        = "Bls. Trousers +1",
  104.         feet        = "Blessed Pumps +1"
  105.     }
  106.  
  107.      -- resting set is for recovering MP while /heal.
  108.     -- as much +hMP as possible.
  109.     sets.rest = {
  110.         main        = "Imperial Wand",
  111.         sub         = "Legion Scutum",
  112.         head        = "Mirror Tiara",
  113.         left_ear    = "Antivenom Earring",
  114.         right_ear   = "Relaxing Earring",
  115.         body        = "Mahatma Hpl.",
  116.         hands       = "Oracle's Gloves",
  117.         legs        = "Oracle's Braconi",
  118.         feet        = "Goliard Clogs"
  119.     }
  120.  end
  121.  
  122.  --[[ ******************************************************
  123.   Equip functions - put on the sets we defined above, and
  124.  echo a note to our chat log so we know it worked.
  125. ****************************************************** --]]
  126.  
  127.  -- equip our idle set
  128.  function equip_idle()
  129.      windower.add_to_chat(8,'[Idle]')
  130.     equip(sets.idle)
  131. end
  132.  
  133. -- equip our hMP set
  134. function equip_rest()
  135.     windower.add_to_chat(8,'[Resting]')
  136.     equip(sets.rest)
  137. end
  138.  
  139. -- equip our enfeebling set
  140. function equip_enfeebling()
  141.     windower.add_to_chat(8,'[Enfeebling]')
  142.     equip(sets.enfeebling)
  143. end
  144.  
  145. -- equip our enhancing set, including the relic pieces
  146. -- for barspells and regen
  147. function equip_enhancing(spell)
  148.     windower.add_to_chat(8,'[Enhancing]')
  149.     if spell.name:contains('Bar') then
  150.         equip(sets.enhancing,{legs="Clr. Pantaln. +1"})
  151.     elseif spell.name:contains('Regen') then
  152.         equip(sets.enhancing,{body="Clr. Briault +1"})
  153.     elseif spell.name == 'Stoneskin' then
  154.         equip(sets.enhancing,{neck="Stone Gorget"})
  155.     else
  156.          equip(sets.enhancing)
  157.     end
  158.  end
  159.  
  160.  -- equip our healing magic set
  161.  function equip_heal()
  162.      windower.add_to_chat(8,'[Healing]')
  163.     equip(sets.heal)
  164. end
  165.  
  166. --[[ ******************************************************
  167.  Casting functions - these functions run automatically when
  168.  we cast a spell, use a job ability, rest for MP, and so on
  169. ****************************************************** --]]
  170.  
  171.  -- the precast function runs automatically BEFORE we
  172.  -- begin casting a spell or job ability.  For our WHM,
  173.  -- we want to equip fast cast gear prior to casting.
  174.  -- If casting a cure spell, wear clogs instead of rostrum.
  175.  function precast(spell)
  176.      if spell.type:contains('Magic') then
  177.         if spell.name:contains('Cure') then
  178.             equip(sets.fc,{feet="Cure Clogs"})
  179.         else
  180.              equip(sets.fc)
  181.         end
  182.      end
  183.  end
  184.  
  185.  -- now that we've already gained the benefit of fast cast,
  186.  -- the midcast function swaps in a new set of gear during
  187.  -- the cast, which will make the spell effect more potent.
  188.  function midcast(spell)
  189.      if spell.skill == 'Healing Magic' then
  190.         equip_heal()
  191.     elseif spell.skill == 'Enfeebling Magic' then
  192.         equip_enfeebling()
  193.     elseif spell.skill == 'Enhancing Magic' then
  194.         equip_enhancing(spell)
  195.     end
  196.  end
  197.  
  198.  -- we're done with our spell or job ability, so the aftercast
  199.  -- function makes sure we return to our idle gear to benefit
  200.  -- from auto-refresh and movement speed.
  201.  function aftercast(spell)
  202.      equip_idle()
  203. end
  204.  
  205. -- the status_change function runs automatically whenever we
  206. -- engage, disengage, kneel, or stand.  As a WHM we use this
  207. -- to equip our +hMP gear when we /heal, and return to our
  208. -- idle gear when we stand up.
  209. function status_change(new,old)
  210.     if new == 'Resting' then
  211.         equip_rest()
  212.     else
  213.          equip_idle()
  214.     end
  215.  end
  216.  
  217.  --[[ ******************************************************
  218.   Code that runs once, when we first swap to our WHM job
  219. ****************************************************** --]]
  220.  
  221.  -- Puts on our fashion set, lockstyle it, then switch
  222.  -- to our idle set.
  223.  send_command('wait 1;gs equip fashion;wait 1;input /lockstyle on;wait 1;gs equip idle')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement