Advertisement
Guest User

Kassaiemi_RDM.lua

a guest
Nov 24th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.96 KB | None | 0 0
  1. function get_sets()
  2.    
  3.     -------------------  JA Sets  ----------------------
  4.     -- Any JA you want a specific set for, enter it in here.
  5.     -- For example, if there was, for some reason, a specific set of equipment
  6.     -- you wanted to wear for activating Divine Seal, you would add a set named
  7.     -- sets.JA['Divine Seal']
  8.     -- If the JA is a single word, like Benediction, the [' '] is not needed
  9.     -- and you can simply do sets.JA.Benediction
  10.    
  11.     sets.JA = {}
  12.    
  13.     ------------------  Idle Sets  ---------------------
  14.     -- Your idle set is the set which you will wear at all times when you are not engaged in combat
  15.     -- and by engaged I mean weapon out and attacking.
  16.     -- The Resting set is a secondary set of gear which will be applied over your Idle set
  17.     -- when you rest, so you can swap in +MP/HP regained while healing gear, or the like, there
  18.     -- The Idle Set is where you'd also want to add stuff like Sheltered Ring, Wiglen Torque,
  19.     -- or any other +refresh/regen piece.
  20.    
  21.     sets.Idle = {main="Tamaxchi", sub="Sors Shield", ammo="Impatiens",
  22.         head="Gendewitha Caubeen +1", neck="Nuna Gorget +1", ear1="Roundel Earring",ear2="Brachyura Earring",
  23.         body="Gendewitha Bliaut +1",hands="Yaoyotl gloves",ring1="Sirona's Ring",ring2="Defending Ring",
  24.         back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats +1",feet="Gendewitha Galoshes +1"}
  25.    
  26.     sets.Resting = {}
  27.    
  28.     -------------------  TP Sets  ----------------------
  29.     -- TP sets are various sets of gear you want to wear in combat.
  30.     -- I have no idea if you have a specific set of 'combat WHM' gear you'd like to use
  31.     -- and am merely leaving these in here as they are part of my template.
  32.     -- the "Normal" set is the base set.  The other ones (ACC, EVA, etc) are applied over it
  33.    
  34.     sets.TP = {}
  35.     sets.TP.index = {'Normal','Accuracy','Evasion','PDT','MDT','DT'}
  36.     TP_ind = 1
  37.    
  38.     sets.TP.Normal = {}
  39.    
  40.     sets.TP.Accuracy = {}
  41.    
  42.     sets.TP.Evasion = {}
  43.    
  44.     sets.TP.PDT = {}
  45.    
  46.     sets.TP.MDT = {}
  47.    
  48.     sets.TP.DT = {}
  49.  
  50.     -------------------  WS Sets  ----------------------
  51.     -- Any WS-specific gear goes here.  You'd need to make a set for each WS
  52.     -- sets.WS.Dagan, sets.WS.Hexastrike, etc
  53.    
  54.    
  55.     sets.WS = {}
  56.    
  57.     -------------------  MA Sets  ----------------------
  58.     -- Sets for spells go here.  Precast is gear that will be swapped in before ANY spellcasting
  59.     -- The Cure set will be swapped in before Cure/Curaga/Cura spells are cast, and ON TOP
  60.     -- of the generalized Precast set.
  61.     -- The Enhancing set would be where you'd want to stick any +enhancing gear for spells that are
  62.     -- affected by it.
  63.     -- The Regen set is special in that it will be activated whenever you cast any regen spell.
  64.     -- Other than that, you can specify specific gear sets for specific spells, such as Cursna has below
  65.    
  66.     sets.MA = {}
  67.    
  68.     sets.MA.Precast = {}
  69.    
  70.     sets.MA.Precast.Cure = {}
  71.    
  72.     sets.MA.Enhancing = {}
  73.    
  74.     sets.MA.Cursna = {ring2="Haoma's Ring",neck="Malison Medallion"}
  75.    
  76.     sets.MA.Regen = {}
  77.    
  78.     sets.MA.Cure = {main="Tamaxchi", sub="Sors Shield"}
  79.    
  80.     sets.MA.Enfeebling = {main="Twebuliij", sub="Achaq Grip", neck="Nuna Gorget +1", head="Kaabnax Hat",
  81.         body="Artsieq Jubbah", ear1="Lifestorm Earring",ear2="Psystorm Earring", ring1="Strendu Ring",
  82.         legs="Hagondes pants +1", feet="Uk'uxkaj boots"}
  83.    
  84.     sets.MA.Elemental = {head="Hagondes Hat +1", neck="Quanpur necklace", ear1="Friomisi Earring", ear2="Hecate's Earring",
  85.         body="Artsieq Jubbah", ring1="Strendu Ring", legs="Hagondes pants +1"}
  86.    
  87.     -----------------  Vanity Sets  --------------------
  88.     --If you have some costume set you want equipped whenever you zone before stylelock is
  89.     --automatically applied, put it here.
  90.    
  91.     sets.Vanity = {}
  92.  
  93.     --This tells windower to call the 'equip_vanity' function whenever a zone change is detected.
  94.     --This does not fire on logging in, as that is not a 'zone change'.
  95.     windower.register_event('Zone change', equip_vanity)
  96. end
  97.  
  98. function equip_vanity()
  99.     equip(sets.Idle, sets.Vanity)
  100.     send_command('@wait 5; input /lockstyle on;')
  101.     send_command('@wait 7; gs c equip Idle set')
  102.    
  103. end
  104.  
  105. -- Gearswap considers everything, from JAs to WSes to actuall spells, to be 'spells' for the purposes of
  106. -- the precast, midcast, and aftercast functions.  There are a couple of ways to determine what is actually being
  107. -- 'cast'.  One of them is to check the prefix.  Below, to catch magic and curing magic, and to apply the appropriate
  108. -- set of precast fastcast gear, we check to see if the 'spell' is of the kind that uses the /magic prefix
  109. -- and then we check to see if 'Cur' is part of the spell name, which catches Cure, Curaga, Cura, and their higher tier versions.
  110. -- Note you don't actually have to use /magic to cast the spells.  /ma works just fine.  The '/magic' used below
  111. -- is because the resource files for Windower define non-ninjutsu, non-song magic as using the '/magic' prefix, even if cast as
  112. -- /ma cure 4 p1
  113. function precast(spell)
  114.     if spell.prefix=='/magic' then
  115.         if string.find(spell.name,'Cur') then
  116.             equip(sets.MA.Precast, sets.MA.Precast.Cure)
  117.         else
  118.         equip(sets.MA.Precast)
  119.         end
  120.     end
  121. end
  122.  
  123. -- I don't know what this does but I'm not taking it out.
  124. function filtered_action(spell)
  125.     cancel_spell()
  126. end
  127.  
  128. -- This function checks, one by one, to see if there is a JA or WS set for the 'spell' being cast,
  129. -- if it's enhancing magic, which gets the generic enhancing set, if it's a regen spell of any tier,
  130. -- which will get the generic regen set, or if there is a specific set for that specific spell,
  131. -- and equips it if there is.  So if you eventually got a set of stoneskin gear, you could add a
  132. -- sets.MA.Stoneskin up above, list the gear, and then that gear would automatically be equipped
  133. -- when casting Stoneskin without having to edit anything else.  Same for any other spell.
  134. function midcast(spell)
  135.     if sets.JA[spell.name] then
  136.         equip(sets.Idle, sets.JA[spell.name])
  137.     elseif sets.WS[spell.name] then
  138.         equip(sets.Idle, sets.WS[spell.name])
  139.     elseif spell.skill=='Enhancing Magic' then
  140.         equip(sets.Idle, sets.MA.Enhancing)
  141.     elseif spell.skill=='Enfeebling Magic' then
  142.         equip(sets.Idle, sets.MA.Enhancing)
  143.     elseif spell.skill=='Elemental Magic' then
  144.         equip(sets.Idle, sets.MA.Enhancing)
  145.     elseif string.find(spell.name,'Regen') then
  146.         equip(sets.Idle, sets.MA.Regen)
  147.     elseif sets.MA[spell.name] then
  148.         equip(sets.Idle, sets.MA[spell.name])
  149.     elseif string.find(spell.name,'Cur') then
  150.             equip(sets.Idle, sets.MA.Cure)
  151.     end
  152. end
  153.  
  154. --function toggle_vanity()
  155. --    send_command('input /lockstyle off')
  156. --    vanity_ind = vanity_ind + 1
  157. --    if vanity_ind > #sets.Vanity.index then vanity_ind = 1 end
  158. --    send_command('@input /echo ----- Vanity '..sets.Vanity.index[vanity_ind]..' Set equipped -----')
  159. --    equip(sets.Idle, sets.Vanity[sets.Vanity.index[vanity_ind]])
  160. --    send_command('wait 2;input /lockstyle on;wait 2;gs c equip TP set')
  161. --end
  162.  
  163.  
  164. -- After you have finished your spell casting, returns you to whatever 'proper' set you should
  165. -- be wearing between actions.  If you're a tank in your -DT set, you don't want it not reapplied after you
  166. -- swap half of it out for +enmity gear for provoke, etc.
  167. function aftercast(spell)
  168.     if player.status=='Engaged' then
  169.         equip_TP_set()
  170.     else
  171.         equip(sets.Idle)
  172.     end
  173. end
  174.  
  175. -- This fires whenever your status changes, such as when you sit, stand, die, get on a chocobo, fish, craft, etc.
  176. -- It's useful for seeing if you've attacked something to equip your TP set, or to automatically equip a resting set
  177. -- when you rest, and remove it when you stand.
  178. function status_change(new,old)
  179.     if new == 'Engaged' then
  180.         equip_TP_set()
  181.     elseif new == 'Resting' then
  182.         equip(sets.Idle, sets.Resting)
  183.     else
  184.         equip(sets.Idle)
  185.     end
  186. end
  187.  
  188. -- Here one could add things to automatically change gear on acquiring certain statuses
  189. -- For example, in my RUN and DNC and COR sets, if I recieve the status effect Doom, my Saida ring is swapped in
  190. -- and that slot in which it goes is 'disabled' by gearswap so that it won't be removed.
  191. -- When I lose the Doom 'buff', the slot is unlocked again so normal gear can go back in place.
  192. function buff_change(buff,gain)
  193. end
  194.  
  195.  
  196. -- This equips your TP set.
  197. function equip_TP_set()
  198.     sets.TP.index = {'Normal','Accuracy','Evasion','PDT','MDT','DT'}
  199.  
  200.     if TP_ind == 7 then TP_ind = 1 end
  201.    
  202.     if TP_ind == 1 then
  203.         equip(sets.TP.Normal)
  204.     else
  205.         equip(sets.TP.Normal,sets.TP[sets.TP.index[TP_ind]])
  206.     end
  207. end
  208.  
  209.  
  210. -- This function is where you can define specific things you want carried out when you supply
  211. -- a command to gearswap via //gs c CommandGoesHere (/console gs c CommandGoesHere also works)
  212. -- For example, if you had multiple TP sets, as I do for DNC and RUN, you could set up a macro button
  213. -- which was called "ToggleTP" and contained the line /console gs c toggle TP set
  214. -- And then whenever you pressed that button, it would cycle to the next set in your list of TP sets.
  215. -- This set would then not only be applied, but also reapplied after actions were taken, as after
  216. -- every action you take, if enganged, the 'equip_TP_set()' function is called.
  217. --
  218. -- This is a useful place to add commands for troubleshooting, such as to make sure a set is equipping properly.
  219. -- An example of that is added below for cursna.  Typing in /console gs c equip Cursna set
  220. -- or //gs c equip Cursna set
  221. -- will cause the set to be equipped.  You can keep your equipment window open and type this from the chat line,
  222. -- and, as gearswap uses packets, your equipment will change while you watch to verify it works.
  223.  
  224. function self_command(command)
  225.     if command == 'toggle TP set' then
  226.         TP_ind = TP_ind +1
  227.         if TP_ind > #sets.TP.index then TP_ind = 1 end
  228.         send_command('@input /echo ----- TP Set changed to '..sets.TP.index[TP_ind]..' -----')
  229.         equip_TP_set()
  230.     elseif command == 'equip TP set' then
  231.         equip_TP_set()
  232.     elseif command == 'equip Idle set' then
  233.         equip(sets.Idle)
  234.     elseif command == 'equip Cursna set' then
  235.         equip(sets.MA.Cursna)
  236.     end
  237. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement