Advertisement
TC24k

Kin_THF

Jan 4th, 2021
638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.58 KB | None | 0 0
  1. include('organizer-lib')
  2. include('includes/common-functions')
  3. include('includes/common-gearsets')
  4. include('includes/config')
  5.  
  6. --initialise local variables to inherit from master config
  7. local showFCInfo = config.showFastCastInfo
  8. local showSpellInfo = config.showSpellInfo
  9. local showCancelInfo = config.showCancelInfo
  10. local FastCast = 80
  11.  
  12. TPStyle = {"Default", "TH", "Accuracy", "Evasion"}
  13. TPStyleIndex = 1
  14.  
  15. function get_sets()
  16.     local mjob = player.main_job
  17.     init_gear_sets(mjob)
  18.  
  19.     sets.TH = {
  20.         sub="Sandung",
  21.         hands="Plun. Armlets +1",
  22.         feet="Skulk. Poulaines",
  23.     }
  24.     sets.JobAbility['Perfect Dodge'] = {}
  25.     sets.JobAbility['Sneak Attack'] = { }
  26.     sets.JobAbility['Trick Attack'] = { }
  27.     sets.JobAbility.Flee = { feet="Pillager's Poulaines +2"}
  28.     sets.JobAbility.Accomplice = { head={ name="Skulker's Bonnet" } }
  29.     sets.JobAbility.Collaborator = { head={ name="Skulker's Bonnet" } }
  30.    
  31.     sets.WeaponSkills['Dancing Edge'] = { }
  32.     sets.WeaponSkills['Mercy Stroke'] = { }
  33.     sets.WeaponSkills['Mandalic Stab'] = { }
  34.     sets.WeaponSkills['Rudra\'s Storm'] = {
  35.         neck = "Shadow Gorget",
  36.     }
  37.     sets.WeaponSkills['Aeolian Edge'] = {
  38.         neck="Breeze Gorget",
  39.         left_ear="Moldavite Earring",
  40.         right_ear="Sortiarius Earring",
  41.     }
  42.     sets.WeaponSkills['Exenterator'] = {}
  43.  
  44.     sets.midcast.Cure = {   }
  45.  
  46.     sets.aftercast = {}        
  47.     sets.aftercast.Resting = { }
  48.     sets.aftercast.Engaged = {}
  49.  
  50.     sets.aftercast.Engaged.Default = set_combine(sets.weapons[mjob]['Daggers'], {
  51.         ammo="Yetshila +1",
  52.         head="Pill. Bonnet +2",
  53.         body="Pillager's Vest +2",
  54.         hands="Pill. Armlets +2",
  55.         legs="Pill. Culottes +2",
  56.         feet="Plun. Poulaines +1",
  57.         neck="Ziel Charm",
  58.         back="Atheling Mantle",
  59.         waist="Twilight belt",
  60.         left_ear="Mache Earring +1",
  61.         right_ear="Mache Earring +1",
  62.         left_ring="Rajas Ring",
  63.         right_ring="Epona's Ring",
  64.     })
  65.        
  66.     sets.aftercast.Engaged.TH = set_combine(sets.aftercast.Engaged.Default, sets.TH)
  67.     sets.aftercast.Engaged.Accuracy = set_combine(sets.aftercast.Engaged.Default, { })
  68.     sets.aftercast.Engaged.Evasion= set_combine(sets.aftercast.Engaged.Default, { })
  69.  
  70.     sets.aftercast.Idle = set_combine(sets.aftercast.Engaged[TPStyle[TPStyleIndex]], {
  71.         left_ring="Defending Ring",
  72.         feet="Pillager's Poulaines +2",
  73.     })
  74.    
  75.  
  76.     enspell_list = S{"Enstone", "Enwater", "Enaero", "Enfire", "Enblizzard", "Enthunder"}
  77.  
  78.    
  79.     switchMacroSet(8,1)
  80.     send_command('gs enable all')
  81.     send_command('gs equip sets.aftercast.Idle')
  82.     send_command('input /echo [F9] Bound to Default TP Gear;bind F9 gs c default')
  83.     send_command('input /echo [F10] Bound to Set TH based TP Gear;bind F10 gs c th')
  84.     send_command('input /echo [F11] Bound to Set Accuracy heavy TP Gear;bind F11 gs c accuracy')
  85.     send_command('input /echo [F12] Bound to Set Evasion heavy TP Gear;bind F12 gs c evasion')
  86.  
  87.     --send_command('input /echo >> Need to finish SA/TA buff rules!! <<)
  88.    
  89.     disable('main','sub')  
  90. end
  91.  
  92.  
  93. function precast(spell)
  94.     if sets.JobAbility[spell.english] then
  95.         equip(sets.JobAbility[spell.english])
  96.     end
  97.  
  98.     if sets.WeaponSkills[spell.english] then
  99.         equip(sets.WeaponSkills[spell.english])
  100.     end
  101.     if sets.precast[spell.english] then
  102.         equip(sets.precast[spell.english])
  103.     end
  104.    
  105.     if spell.action_type == 'Magic' then
  106.         equip(sets.precast.FastCast.Default)
  107.     end
  108. end
  109. function midcast(spell)
  110.     cancelBuff(spell.english, spell.cast_time, FastCast)
  111.    
  112.     if sets.midcast[spell.english] then
  113.         equip(sets.midcast[spell.english])
  114.     elseif string.find(spell.english,'Cur') and spell.english ~='Cursna' then
  115.         equip(sets.midcast.Cure)
  116.     end
  117.  
  118.     if sets.midcast[spell.skill] then
  119.         equip(sets.midcast[spell.skill])
  120.     end
  121.     if (enspell_list:contains(spell.english)) then
  122.         equip(sets.midcast.Enspell)
  123.     end
  124. end
  125.  
  126. function aftercast(spell)
  127.     if spell.english == "Sneak Attack" then
  128.         add_to_chat(8, "<<Sneak Attack>>")
  129.         equip (sets.precast['Sneak Attack'])
  130.     elseif spell.english == "Trick Attack" then
  131.         add_to_chat(8, "<<Trick Attack>>")
  132.         equip (sets.precast['Trick Attack'])
  133.     else
  134.             equipGearByState()
  135.     end
  136. end
  137.  
  138. function status_change(new,old)
  139.         equipGearByState()
  140. end
  141.  
  142. function buff_change(name,gain)
  143.  
  144.     if name == "Trick Attack" and gain == "false" then
  145.             equip(sets.aftercast.Idle)
  146.     elseif name == "Sneak Attack" and gain == "false" then
  147.         if player.status == 'Idle' then
  148.             equip_idle_set()
  149.         elseif sets.aftercast[player.status][TPStyle[TPStyleIndex]] then
  150.             equip(sets.aftercast[player.status][TPStyle[TPStyleIndex]],sets.aftercast)
  151.         else
  152.             equip(sets.aftercast.Idle,sets.aftercast)
  153.         end
  154.     end
  155. end
  156.  
  157. function self_command(command)
  158.     if command:lower() == "default" then
  159.         TPStyleIndex = 1
  160.         add_to_chat(8, 'TP Style is now: '.. TPStyle[TPStyleIndex] .. '!')
  161.         send_command('gs enable sub')
  162.         equip(sets.aftercast.Engaged[TPStyle[TPStyleIndex]])
  163.     elseif command:lower() == "th" then
  164.         TPStyleIndex = 2       
  165.         add_to_chat(8, 'TP Style is now: '.. TPStyle[TPStyleIndex] .. '!')
  166.         equip(sets.aftercast.Engaged[TPStyle[TPStyleIndex]])
  167.         send_command('gs disable sub')
  168.     elseif command:lower() == "accuracy" then
  169.         TPStyleIndex = 3
  170.         add_to_chat(8, 'TP Style is now: '.. TPStyle[TPStyleIndex] .. '!')
  171.         send_command('gs enable sub')
  172.         equip(sets.aftercast.Engaged[TPStyle[TPStyleIndex]])
  173.     elseif command:lower() == "evasion" then
  174.         TPStyleIndex = 4
  175.         add_to_chat(8, 'TP Style is now: '.. TPStyle[TPStyleIndex] .. '!')
  176.         send_command('gs enable sub')
  177.         equip(sets.aftercast.Engaged[TPStyle[TPStyleIndex]])
  178.     end
  179.    
  180.     if player.status == "Engaged" then
  181.         equip(sets.aftercast[player.status][TPStyle[TPStyleIndex]])
  182.     else
  183.         equip(sets.aftercast[player.status])
  184.     end
  185. end
  186.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement