Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 34.01 KB | None | 0 0
  1. ----- <keybinds> --
  2. -- CTRL Keybinds
  3. send_command('bind ^%numpad. input /ja "Unbridled Learning" <me>;wait 1.2;input /ja "Diffusion" <me>;wait 2;input /ma "Mighty Guard" <me>;wait 0.3;input /p Casting diffusion Mighty Guard.; wait 307;input /echo Diffusion Mighty Guard wearing in 10 seconds.')
  4.  
  5.     --buffs--
  6. send_command('bind !x input /ma "Erratic flutter" <me>;wait 4.3;input //barriertusk;wait 5;input //cocoon;wait 4.5;input //natmeditation;wait 4.5;input //berserk')
  7. send_command('alias solodark input /ja "Efflux" <me>;wait 1.2;input /ja "Chain affinity" <me>;wait 1.2;input /ja "Burst affinity" <me>;wait 2;input /ws "Chant du cygne" <t>;wait 3.8;input /ma "Sinker drill" <t>;wait 4;input /ma "Tenebral crush" <t>')
  8.  
  9.  
  10. -- </keybinds> --
  11.  
  12.  
  13. function file_unload()
  14.     if binds_on_unload then
  15.         binds_on_unload()
  16.     end
  17.     send_command('unbind !%numpad.')
  18.     send_command('unbind ^%numpad.')
  19. end
  20.  
  21. -------------------------------------------------------------------------------------------------------------------
  22. -- Customizable OnEvent features for this job.
  23. -------------------------------------------------------------------------------------------------------------------
  24.  
  25. --OnEvent Function
  26.     --Use '..wav..' to point to wav directory. Assign wav directory in blu_user_setup
  27. pdt_command = "nothing for nowwww"
  28. utsusemi_command = "Copy.-Image.- effect wears off."
  29. warn_command = "].- .-Angry.-Seas"
  30. osmosis_command = "readies Howl"
  31. stunr_command = "readies Thunderbolt"
  32. dread_command = "Dread.-Spikes.- .-"
  33. test_command = "nothing at allll"
  34. windower.raw_register_event('incoming text',function(original, modified, original_mode, modified_mode, blocked)
  35.     if string.find(original,pdt_command) and not buffactive.blink then
  36.         windower.send_command('wait 1.5;gs c C15;wait 2;gs c C15')
  37.     elseif string.find(original,utsusemi_command) then
  38.         if Utsusemi then
  39.             windower.send_command('input /ma "Utsusemi: Ni" <me>;wait 0.3;input /ma "Utsusemi: Ichi" <me>')
  40.         end
  41.     elseif string.find(original,warn_command) then
  42.         if ShowM then
  43.             add_to_chat(123, 'Warning! Warning!')
  44.         end
  45.        windower.play_sound(''..wav..'Chime.wav')
  46.     elseif string.find(original,osmosis_command) then
  47.         windower.send_command('wait 2;input //osmosis')
  48.     elseif string.find(original,stunr_command) then
  49.         windower.send_command('gs c C15;wait 3;gs c C15')
  50.     elseif string.find(original,dread_command) then
  51.         if DreadW then
  52.             if DreadH then
  53.             DreadH = not DreadH
  54.                 windower.send_command('input /attackoff; wait 2; input /p He just casted dread spikes, guys.')
  55.                 add_to_chat(123, 'Dread spikes being cast! Dispel! Dispel!')
  56.                 windower.play_sound(''..wav..'Expired.wav')
  57.             end
  58.         end
  59.         windower.play_sound(''..wav..'Chime.wav')
  60.     elseif string.find(original,test_command) then
  61.         windower.send_command('input /echo The test worked!')
  62.     end
  63. end)
  64. --/OnEvent Function--
  65.  
  66. --Auto CDC & TH Function--
  67. windower.register_event('tp change', function(tp, new, old)
  68. if aCDC == 'Fast' or aCDC == 'Standard' then
  69.     if aWS then
  70.         if player.status == 'Engaged' and player.tp >= 1000 then
  71.             aWS = false
  72.             if ShowD then
  73.                 add_to_chat(158,'aCDC activation debug message.')
  74.             end
  75.             rng()
  76.             windower.send_command('wait '..N..';input /ws "Chant du Cygne" <t>;gs c aWSon')
  77.         end
  78.     end
  79. end
  80. if THTP then
  81.     if EngagedTP > -1 and player.tp > (EngagedTP+80) and player.status == 'Engaged' then
  82.         windower.send_command('gs c TPchange')
  83.     end
  84. end
  85. end)
  86. --/Auto CDC & TH Function--
  87.  
  88. -------------------------------------------------------------------------------------------------------------------
  89. -- Setup functions for this job.  Generally should not be modified.
  90. -------------------------------------------------------------------------------------------------------------------
  91.  
  92. -- Setup vars used by this job
  93. function blu_user_setup()
  94.     MagicBurst = false
  95.     aCDC = 'Standard' -- Standard is suggested
  96.     aWS = true
  97.     TreasureHunter = 'None'
  98.     THTP = false
  99.     EngagedTP = -1 -- For automatic TH gear during first hit of every fight.
  100.     Utsusemi = false
  101.     ShowM = true
  102.     ShowD = false
  103.     DreadW = false
  104.     DreadH = true
  105.     Sword = 'Melee' -- For sword refresh while cleaving
  106.     AccIndex = 1
  107.     AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid. Default ACC Set Is LowACC. The First TP Set Of Your Main Weapon Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
  108.     IdleIndex = 1
  109.     IdleArray = {"Movement","Regen"} -- Default Idle Set Is Movement
  110.     Armor = 'None'
  111.     target_distance = 5 -- Set Default Distance Here
  112.    
  113.     -- Set directory for .wavs
  114.     wav = 'D:/Games/ffxi/Windower4/addons/GearSwap/libs/wav/'
  115.    
  116.     -- Load sidecar file
  117.     include(""..player.name.."/BLU_"..player.name..".lua")
  118.    
  119.     -- Define spellmaps for use with pre/midcast
  120.     blu_spell_maps()
  121.    
  122.     -----------------------------
  123.     -- Toggles
  124.     -----------------------------
  125.     send_command('bind f9 gs c C1') --ACC toggle
  126.     send_command('bind ^f12 gs c C2') --Hybrid toggle
  127.     send_command('bind ^f10 gs c C4') --PDT II toggle
  128.     send_command('bind f12 gs c C6') --Idle toggle
  129.     send_command('bind f10 gs c C7') --PDT toggle
  130.     send_command('bind %\ gs c C8') --Gear Auto Update
  131.     send_command('bind f11 gs c C15') --MDT toggle
  132.     --My Toggles
  133.     send_command('alias cleave gs c CLV') -- Cleave Mode
  134.     send_command('alias brute gs c BRT') -- Brute Mode
  135.     send_command('alias sword gs c C17') --Sword Mode Toggle
  136.     send_command('bind ^%numpad1 gs c TH') --TH toggle
  137.     send_command('alias shadows gs c AU') --Auto Utsusemi Toggle
  138.     send_command('bind ] gs c ACDC') --Auto CDC toggl
  139.     send_command('alias dread gs c DrW') --Dread Spikes Toggle
  140.     send_command('alias showm gs c showm') --Message Toggle
  141.     send_command('alias showd gs c showd') --Debug Toggle
  142.     send_command('alias dist gs c dist') --Distance toggle
  143. end
  144.  
  145. -- Auto-initialize the user setup
  146. blu_user_setup()
  147.  
  148. -- Define sets used by this job file.
  149. function get_sets()
  150.     -- Grab gearsets from sidecar
  151.     sidecar_get_sets()
  152. end
  153.  
  154. -------------------------------------------------------------------------------------------------------------------
  155. -- Job-specific hooks for standard casting events.
  156. -------------------------------------------------------------------------------------------------------------------
  157.  
  158. function pretarget(spell,action)
  159.     if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  160.         cancel_spell()
  161.         send_command('input /item "Echo Drops" <me>')
  162.     elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
  163.         cancel_spell()
  164.         send_command('Aggressor')
  165.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  166.         degrade_spell(spell,Cure_Spells)
  167.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  168.         degrade_spell(spell,Curaga_Spells)
  169.     elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
  170.         cancel_spell()
  171.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  172.         return
  173.     end
  174. end
  175.  
  176. function precast(spell,action)
  177.     if spell.type == "WeaponSkill" then
  178.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  179.             cancel_spell()
  180.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  181.             return
  182.         else
  183.             equipSet = sets.WS
  184.             if equipSet[spell.english] then
  185.                 equipSet = equipSet[spell.english]
  186.             end
  187.             if equipSet[AccArray[AccIndex]] then
  188.                 equipSet = equipSet[AccArray[AccIndex]]
  189.             end
  190.             equip(equipSet)
  191.         end
  192.     elseif spell.type == "JobAbility" then
  193.         if sets.JA[spell.english] then
  194.             equip(sets.JA[spell.english])
  195.         end
  196.     elseif spell.english == "Subduction" then
  197.         if Sword == 'Cleave' then
  198.             equip(set_combine(sets.Midcast.MagicalBlueMagic,{main="Nibiru cudgel",sub="Nibiru cudgel"}))
  199.             cast_delay(0.2)
  200.         else
  201.             equip(sets.Midcast.MagicalBlueMagic)
  202.             cast_delay(0.2)
  203.         end
  204.     elseif spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
  205.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  206.             cancel_spell()
  207.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  208.             return
  209.         else
  210.             if string.find(spell.english,'Utsusemi') then
  211.                 if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  212.                     if not Utsusemi then
  213.                         cancel_spell()
  214.                         add_to_chat(123, spell.english .. ' Canceled: [3+ Images]')
  215.                     end
  216.                     return
  217.                 else
  218.                     equip(sets.Precast.FastCast)
  219.                 end
  220.             elseif sets.Precast[spell.skill] then
  221.                 equip(sets.Precast[spell.skill])
  222.             else
  223.                 equip(sets.Precast.FastCast)
  224.             end
  225.         end
  226.     elseif spell.type == "Waltz" then
  227.         equip(sets.Waltz)
  228.     elseif spell.type == "Step" then
  229.         equip(sets.Step)
  230.     elseif spell.type == "Flourish" then
  231.         equip(sets.Flourish)
  232.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  233.         cast_delay(0.2)
  234.         send_command('cancel Sneak')
  235.     elseif spell.type == "Trust" then
  236.         equip(sets.Precast.FastCast)
  237.     end
  238. end
  239.  
  240. function midcast(spell,action)
  241.     equipSet = {}
  242.     if spell.action_type == 'Magic' then
  243.         equipSet = sets.Midcast
  244.         if spell.skill=='Elemental Magic' or spell.name == 'Sanguine Blade'  or MagicalBlueMagic:contains(spell.english) or MagicalBlueMagicDark:contains(spell.english) or MagicalBlueMagicLight:contains(spell.english) then
  245.             if world.day_element == spell.element or world.weather_element == spell.element then
  246.                elemental_waist.name=elemental_obi_day[spell.element]
  247.             else
  248.                elemental_waist.name="Eschan stone"
  249.             end
  250.         end
  251.         if equipSet[spell.english] then
  252.             equipSet = equipSet[spell.english]
  253.         elseif (string.find(spell.english,'Cure') or BlueMagic_Healing:contains(spell.english)) and spell.english ~= "Cursna" then
  254.             if string.find(spell.english,'Cura') then
  255.                 equipSet = equipSet.Cure
  256.             elseif spell.target.type == 'SELF' then
  257.                 equipSet = equipSet.CureSelf
  258.             elseif spell.target.type == 'PLAYER' then
  259.                 equipSet = equipSet.Cure
  260.             end
  261.         elseif PhysicalBlueMagic:contains(spell.english) or PhysicalBlueMagic_STR:contains(spell.english) or PhysicalBlueMagic_STRAcc:contains(spell.english) or PhysicalBlueMagic_DEX:contains(spell.english) or PhysicalBlueMagic_VIT:contains(spell.english) or PhysicalBlueMagic_AGI:contains(spell.english) then
  262.             if PhysicalBlueMagic_STR:contains(spell.english) then
  263.                     equipSet = equipSet.PhysicalBlueMagic_STR
  264.             elseif PhysicalBlueMagic_DEX:contains(spell.english) then
  265.                     equipSet = equipSet.PhysicalBlueMagic_DEX
  266.             elseif PhysicalBlueMagic_STRAcc:contains(spell.english) then
  267.                     equipSet = equipSet.PhysicalBlueMagic_STRAcc
  268.             elseif PhysicalBlueMagic_VIT:contains(spell.english) then
  269.                     equipSet = equipSet.PhysicalBlueMagic_VIT
  270.             elseif PhysicalBlueMagic_AGI:contains(spell.english) then
  271.                     equipSet = equipSet.PhysicalBlueMagic_AGI
  272.             elseif PhysicalBlueMagic:contains(spell.english) then
  273.                     equipSet = equipSet.PhysicalBlueMagic
  274.             end
  275.             if buffactive['Chain Affinity'] then
  276.                 equipSet = set_combine(equipSet,{head="Hashishin Kavuk +1",feet="Assim. charuqs +1"})
  277.             end
  278.             if buffactive.Efflux then
  279.                 equipSet = set_combine(equipSet,{legs="Hashishin tayt +1"})
  280.             end
  281.         elseif MagicalBlueMagic:contains(spell.english) then
  282.             equipSet = equipSet.MagicalBlueMagic
  283.                 if MagicBurst then
  284.                     equipSet = equipSet.MagicBurst or equipSet
  285.                 elseif buffactive['Burst Affinity'] then
  286.                     equipSet = set_combine(equipSet,{feet="Hashishin basmak +1"})
  287.                 end
  288.                 if buffactive.Convergence then
  289.                 equipSet = set_combine(equipSet,{})
  290.                 end
  291.                 if Sword == 'Cleave' then
  292.                 equipSet = set_combine(equipSet,{main="Nibiru cudgel",sub="Nibiru cudgel"})
  293.                 end
  294.                 if TreasureHunter == 'Cleave' then
  295.                     equipSet = equipSet.TreasureHunter
  296.                     add_to_chat(003,'Cleaving in treasure hunter gear.')
  297.                 end
  298.         elseif MagicalBlueMagicDark:contains(spell.english) then
  299.             equipSet = equipSet.MagicalBlueMagicDark
  300.             if MagicBurst then
  301.                 equipSet = equipSet.MagicBurst or equipSet
  302.             elseif buffactive['Burst Affinity'] then
  303.                 equipSet = set_combine(equipSet,{feet="Hashishin basmak +1"})
  304.             end
  305.             if buffactive.Convergence then
  306.                 equipSet = set_combine(equipSet,{})
  307.             end
  308.             if Sword == 'Cleave' then
  309.                 equipSet = set_combine(equipSet,{main="Nibiru cudgel",sub="Nibiru cudgel"})
  310.             end
  311.             if TreasureHunter == 'Cleave' then
  312.                     equipSet = equipSet.TreasureHunter
  313.                     add_to_chat(003,'Cleaving in treasure hunter gear.')
  314.                 end
  315.         elseif MagicalBlueMagicLight:contains(spell.english) then
  316.             equipSet = equipSet.MagicalBlueMagicLight
  317.             if MagicBurst then
  318.             equipSet = equipSet.MagicBurst or equipSet
  319.         elseif buffactive['Burst Affinity'] then
  320.             equipSet = set_combine(equipSet,{feet="Hashishin basmak +1"})
  321.             end
  322.             if buffactive.Convergence then
  323.                 equipSet = set_combine(equipSet,{})
  324.             end
  325.         elseif BlueMagic_Accuracy:contains(spell.english) then
  326.             equipSet = equipSet.BlueMagic_Accuracy
  327.         elseif BlueMagic_AccuracyRecast:contains(spell.english) then
  328.             equipSet = equipSet.BlueMagic_AccuracyRecast
  329.         elseif BlueMagic_AccuracyRecastDark:contains(spell.english) then
  330.             equipSet = equipSet.BlueMagic_AccuracyRecastDark
  331.         elseif BlueMagic_Stun:contains(spell.english) then
  332.             equipSet = equipSet.BlueMagic_Stun
  333.         elseif BlueMagic_HealingWW:contains(spell.english) then
  334.             equipSet = equipSet.BlueMagic_HealingWW
  335.         elseif BlueMagicBuffRecast:contains(spell.english) then
  336.             equipSet = equipSet.BlueMagicBuffRecast
  337.         elseif BlueMagic_BuffSkill:contains(spell.english) then
  338.             equipSet = equipSet.BlueMagic_BuffSkill
  339.         elseif BlueMagic_BuffRefresh:contains(spell.english) then
  340.             equipSet = equipSet.BlueMagic_BuffRefresh
  341.         elseif BlueMagic_Diffusion:contains(spell.english) and buffactive.Diffusion then
  342.             equipSet = set_combine(equipSet,{feet="Luhlaza charuqs"})
  343.         elseif BlueMagic_Breath:contains(spell.english) then
  344.             equipSet = equipSet.BlueMagic_Breath
  345.         elseif BlueMagic_Regen:contains(spell.english) then
  346.             equipSet = equipSet.BlueMagic_Regen
  347.         elseif spell.english == "Stoneskin" then
  348.             if buffactive.Stoneskin then
  349.                 send_command('@wait 2.8;cancel stoneskin')
  350.             end
  351.             equipSet = equipSet.Stoneskin
  352.         elseif spell.english == "Sneak" then
  353.             if spell.target.name == player.name and buffactive['Sneak'] then
  354.                 send_command('cancel sneak')
  355.             end
  356.             equipSet = equipSet.Haste
  357.         elseif string.find(spell.english,'Utsusemi') then
  358.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  359.                 send_command('@wait 0.7;cancel Copy Image*')
  360.             end
  361.             equipSet = equipSet.Haste
  362.         elseif spell.english == 'Monomi: Ichi' then
  363.             if buffactive['Sneak'] then
  364.                 send_command('@wait 0.7;cancel sneak')
  365.             end
  366.             equipSet = equipSet.Haste
  367.         elseif equipSet[spell.skill] then
  368.             equipSet = equipSet[spell.skill]
  369.         end
  370.     elseif equipSet[spell.english] then
  371.         equipSet = equipSet[spell.english]
  372.     end
  373.     equip(equipSet)
  374. end
  375.  
  376. function aftercast(spell,action)
  377.     if spell.type == "WeaponSkill" and not spell.interrupted then
  378.         send_command('wait 0.2;gs c TP')
  379.     end
  380.     if MagicalBlueMagic:contains(spell.english) then
  381.         if Sword == 'Cleave' then
  382.             equip({main ="Medeina kilij",sub="Bolelabunga"})
  383.         end
  384.     elseif MagicalBlueMagicDark:contains(spell.english) then
  385.         if Sword == 'Cleave' then
  386.             equip({main ="Medeina kilij",sub="Bolelabunga"})
  387.         end
  388.         end
  389.     if not spell.interrupted then
  390.         if spell.english == 'Dream Flower' then
  391.         send_command('input /echo Dream Flower has been cast.')
  392.         send_command('wait 60;gs c DFa;wait 15;gs c DFb;wait 15;gs c DFc')
  393.         end
  394.     end
  395.     status_change(player.status)
  396. end
  397.  
  398. function status_change(new,old)
  399.     if Armor == 'PDT' then
  400.         equip(sets.PDT)
  401.     elseif Armor == 'PDTII' then
  402.         equip(sets.PDTII)
  403.     elseif Armor == 'MDT' then
  404.         equip(sets.MDT)
  405.     elseif new == 'Engaged' then
  406.         if aWS then
  407.             if player.tp == 3000 and not buffactive.amnesia then
  408.                 if ShowD then
  409.                     add_to_chat(154,'aWS 3k TP upon engagement failsafe activation debug message.')
  410.                 end
  411.                 rng()
  412.                 windower.send_command('wait 2;wait '..N..';input /ws "Chant du Cygne" <t>;gs c aWSfs')
  413.             end
  414.         end
  415.         if TreasureHunter == 'Tag' or TreasureHunter == 'Cleave' then
  416.         equipSet = sets.TH
  417.         EngagedTP = player.tp
  418.         add_to_chat(003,'Equipping Treasure Hunter gear.')
  419.         else
  420.         equipSet = sets.TP
  421.         end
  422.        
  423.         if Armor == 'Hybrid' and equipSet["Hybrid"] then
  424.             equipSet = equipSet["Hybrid"]
  425.         end
  426.         if equipSet[AccArray[AccIndex]] then
  427.             equipSet = equipSet[AccArray[AccIndex]]
  428.         end
  429.         if buffactive.March == 2 or buffactive.March == 1 or buffactive[580] or buffactive['Mighty Guard']  and (buffactive.Embrava or buffactive.Haste) and equipSet["HighHaste"] then
  430.             equipSet = equipSet["HighHaste"]
  431.         end
  432.         equip(equipSet)
  433.     elseif new == 'Idle' then
  434.         equip(sets.Idle[IdleArray[IdleIndex]])
  435.     elseif new == 'Resting' then
  436.         equip(sets.Resting)
  437.     end
  438. end
  439.  
  440. function buff_change(buff,gain)
  441.     buff = string.lower(buff)
  442.     if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  443.         if gain then
  444.             send_command('timers create "Aftermath: Lv.3" 180 down;wait 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];wait 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 20;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  445.         else
  446.             send_command('timers delete "Aftermath: Lv.3"')
  447.             add_to_chat(123,'AM3: [OFF]')
  448.         end
  449.     elseif buff == 'weakness' then -- Weakness Timer --
  450.         if gain then
  451.             send_command('timers create "Weakness" 300 up')
  452.         else
  453.             send_command('timers delete "Weakness"')
  454.         end
  455.     elseif buff == 'aquaveil' then -- Aquaveil Timer --
  456.         if gain then
  457.             add_to_chat(123,'Aquaveil has been cast.')
  458.             send_command('wait 1047;gs c CAa;wait 22;gs c CAb')
  459.         else
  460.             add_to_chat(123,'Aquaveil has expired.')
  461.             windower.play_sound('C:/Users/Shirley/Documents/Windower4/addons/GearSwap/data/wav/Expired.wav')
  462.         end
  463.     elseif buff == 'stun' then -- Stun PDT --
  464.         if gain and armor == 'None' then
  465.             send_command('gs c C7;wait 8;gs c C7')
  466.         end
  467.     end
  468. end
  469.  
  470. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  471. function self_command(orig_command)
  472.     if type(orig_command) == 'string' then
  473.         command = T(orig_command:split(' '))
  474.         if #command == 0 then
  475.             return
  476.         end
  477.     end
  478.    
  479.     if command[1] == 'C1' then -- Accuracy Level Toggle --
  480.         AccIndex = (AccIndex % #AccArray) + 1
  481.         add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
  482.         status_change(player.status)
  483.     elseif command[1] == 'C3' then -- Magic Burst Toggle --
  484.         MagicBurst = not MagicBurst
  485.                 add_to_chat(MagicBurst and 158 or 123, 'Magic Burst: ' .. (MagicBurst and  '[Activated]' or '[Deactivated]'))
  486.     elseif command[1] == 'C5' then -- Auto Update Gear Toggle --
  487.         status_change(player.status)
  488.         add_to_chat(158,'Auto Update Gear')
  489.     elseif command[1] == 'C2' then -- Hybrid Toggle --
  490.         if Armor == 'Hybrid' then
  491.             Armor = 'None'
  492.             add_to_chat(123,'Hybrid Set: [Unlocked]')
  493.         else
  494.             Armor = 'Hybrid'
  495.             add_to_chat(158,'Hybrid Set: '..AccArray[AccIndex])
  496.         end
  497.         status_change(player.status)
  498.     elseif command[1] == 'C7' then -- PDT Toggle --
  499.         if Armor == 'PDT' then
  500.             Armor = 'None'
  501.             add_to_chat(123,'PDT Set: [Unlocked]')
  502.         else
  503.             Armor = 'PDT'
  504.             add_to_chat(158,'PDT Set: [Locked]')
  505.         end
  506.         status_change(player.status)
  507.     elseif command[1] == 'C4' then -- PDTII Toggle --
  508.         if Armor == 'PDTII' then
  509.             Armor = 'None'
  510.             add_to_chat(123,'PDTII Set: [Unlocked]')
  511.         else
  512.             Armor = 'PDTII'
  513.             add_to_chat(158,'PDTII Set: [Locked]')
  514.         end
  515.         status_change(player.status)
  516.     elseif command[1] == 'C15' then -- MDT Toggle --
  517.         if Armor == 'MDT' then
  518.             Armor = 'None'
  519.             add_to_chat(123,'MDT Set: [Unlocked]')
  520.         else
  521.             Armor = 'MDT'
  522.             add_to_chat(158,'MDT Set: [Locked]')
  523.         end
  524.         status_change(player.status)
  525.     elseif command[1] == 'dist' then -- Distance Toggle //dist 6 to set to 6
  526.             target_distance = command[2]
  527.             add_to_chat(158,'Distance: '..target_distance)
  528.     elseif command[1] == 'C6' then -- Idle Toggle --
  529.         IdleIndex = (IdleIndex % #IdleArray) + 1
  530.         add_to_chat(158,'Idle Set: ' .. IdleArray[IdleIndex])
  531.         status_change(player.status)
  532.     elseif command[1] == 'C17' then -- Sword Mode Toggle --
  533.         if Sword == 'Melee' then
  534.             Sword = 'Cleave'
  535.             add_to_chat(158,'Sword Mode: Cleave')
  536.         else
  537.             Sword = 'Melee'
  538.             add_to_chat(158,'Sword Mode: Melee')
  539.         end
  540.     elseif command[1] == 'TP' then
  541.         add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
  542.     elseif command[1] == 'ACDC' then -- Auto CDC Toggle --
  543.         if aCDC == 'None' then
  544.             aWS = true
  545.             aCDC = 'Standard'
  546.             add_to_chat(158, '[Standard]')
  547.             send_command('gs c aWSfs')
  548.         elseif aCDC == 'Standard' then
  549.             aWS = true
  550.             aCDC = 'Fast'
  551.             add_to_chat(158, '[Fast]')
  552.         elseif aCDC =='Fast' then
  553.             aWS = false
  554.             aCDC = 'None'
  555.             add_to_chat(123, '[Deactivated]')
  556.         end
  557.     elseif command[1] == 'aWSon' then -- aWS reactivation
  558.         send_command('wait 2;gs c aWSfs')
  559.         aWS = true
  560.         if ShowD then
  561.             add_to_chat(158,'Returning aWS to true.')
  562.         end
  563.     elseif command[1] == 'aWSfs' then -- aWS failsafe
  564.         if test then
  565.         if player.status == 'Engaged' and player.tp == 3000 then
  566.             if ShowD then
  567.                 add_to_chat(154,'aWS 3k TP failsafe activation debug message.')
  568.             end
  569.             rng()
  570.             windower.send_command('wait 2;wait '..N..';input /ws "Chant du Cygne" <t>;gs c aWSfs')
  571.         else
  572.             if ShowD then
  573.                 add_to_chat(154,'aCDC\'s 3k TP failsafe not required.')
  574.             end
  575.         end
  576.         end
  577.     elseif command[1] == 'showm' then --Debug Message Toggle
  578.         ShowM = not ShowM
  579.         add_to_chat(ShowM and 158 or 123, 'Roland\'s Messages: ' .. (ShowD and  '[Activated]' or '[Deactivated]'))
  580.     elseif command[1] == 'showd' then --Debug Message Toggle
  581.         ShowD = not ShowD
  582.         add_to_chat(ShowD and 158 or 123, 'Roland\'s Debug Messages: ' .. (ShowD and  '[Activated]' or '[Deactivated]'))
  583.     elseif command[1] == 'TH' then -- Treasure Hunter Toggle --
  584.         if TreasureHunter == 'None' then
  585.             TreasureHunter = 'Tag'
  586.             THTP = true
  587.             add_to_chat(158, 'Treasure Hunter: Tag [Activated]')
  588.         elseif TreasureHunter == 'Tag' then
  589.             TreasureHunter = 'Cleave'
  590.             THTP = true
  591.             add_to_chat(158, 'Treasure Hunter: Tag & Cleave [Activated]')
  592.         elseif TreasureHunter == 'Cleave' then
  593.             TreasureHunter = 'None'
  594.             THTP = false
  595.             add_to_chat(123, 'Treasure Hunter: [Deactivated]')
  596.         end
  597.         status_change(player.status)
  598.     elseif command[1] == "TPchange" then --Treasure Hunter asset--
  599.         EngagedTP = -1
  600.         equip(sets.TP)
  601.         add_to_chat(003,'The enemy has been tagged, switching to TP set.')
  602.     elseif command[1] == "AU" then --Utsusemi toggle
  603.         Utsusemi = not Utsusemi
  604.             add_to_chat(Utsusemi and 158 or 123, 'Auto Utsusemi: ' .. (Utsusemi and  '[Activated]' or '[Deactivated]'))
  605.     elseif command[1] == "DrW" then --Dread Spikes warning toggle
  606.         DreadW = not DreadW
  607.         add_to_chat(DreadW and 158 or 123, 'Dread Warning: ' .. (DreadW and  '[Activated]' or '[Deactivated]'))
  608.     elseif command[1] == 'W1' then
  609.         add_to_chat(123,'Warning')
  610.         windower.play_sound('C:/Users/Shirley/Documents/Windower4/addons/GearSwap/data/wav/Chime.wav')
  611.     elseif command[1] == "CLV" then -- Cleave Mode Initialization --
  612.         add_to_chat(201,'Cleave Mode Activated.')
  613.         set_macro_page(2, 16)
  614.         send_command('input //aset spellset cleave2;wait 3;gs equip sets.Medeina')
  615.         Armor = 'PDTII'
  616.         add_to_chat(158,'PDTII Set: [Locked]')
  617.         Sword = 'Cleave'
  618.         add_to_chat(158,'Sword Mode: Cleave')
  619.         add_to_chat(160,'Setting spells...')
  620.         status_change(player.status)
  621.     elseif command[1] == "BRT" then -- Brute Mode Initialization --
  622.         add_to_chat(201,'Brute Mode Activated.')
  623.         set_macro_page(2, 17)
  624.         send_command('input //aset spellset brute;wait 3;gs equip sets.Coladas')
  625.         Armor = 'None'
  626.         add_to_chat(158,'Armor: [Unlocked]')
  627.         Sword = 'Melee'
  628.         add_to_chat(158,'Sword Mode: Melee')
  629.         add_to_chat(160,'Setting spells...')
  630.         status_change(player.status)
  631.     elseif command[1] == 'DFa' then
  632.         add_to_chat(123,'Warning: Dream Flower has 30-60 seconds remaining.')
  633.     elseif command[1] == 'DFb' then
  634.         add_to_chat(123,'Warning: Dream Flower has 15-45 seconds remaining.')
  635.         windower.play_sound('C:/Users/Shirley/Documents/Windower4/addons/GearSwap/data/wav/Honk.wav')
  636.     elseif command[1] == 'DFc' then
  637.         add_to_chat(123,'Warning: Dream Flower will wear soon!')
  638.         windower.play_sound('C:/Users/Shirley/Documents/Windower4/addons/GearSwap/data/wav/Bike.wav')
  639.     elseif command[1] == 'EstLuo' then
  640.         add_to_chat(005,'Estherr\'s luopan has vanished!')
  641.     elseif command[1] == 'LevLuo' then
  642.         add_to_chat(005,'Levii\'s luopan has vanished!')
  643.     end
  644. end
  645.  
  646. function actualCost(originalCost)
  647.     if buffactive["Penury"] then
  648.         return originalCost*.5
  649.     elseif buffactive["Light Arts"] then
  650.         return originalCost*.9
  651.     else
  652.         return originalCost
  653.     end
  654. end
  655.  
  656. function degrade_spell(spell,degrade_array)
  657.     spell_index = table.find(degrade_array,spell.name)
  658.     if spell_index > 1 then
  659.         new_spell = degrade_array[spell_index - 1]
  660.         change_spell(new_spell,spell.target.raw)
  661.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  662.     end
  663. end
  664.  
  665. function change_spell(spell_name,target)
  666.     cancel_spell()
  667.     send_command('//'..spell_name..' '..target)
  668. end
  669.  
  670. -----------------------------------------------------------------
  671. -- Spell maps for this job
  672. -----------------------------------------------------------------
  673.  
  674. function blu_spell_maps()
  675. PhysicalBlueMagic = S{
  676.         'Asuran Claws','Bludgeon','Body Slam','Feather Storm','Mandibular Bite',
  677.         'Queasyshroom','Power Attack','Ram Charge','Screwdriver','Sickle Slash',
  678.         'Smite of Rage','Spinal Cleave','Spiral Spin','Terror Touch'}
  679.  
  680.     PhysicalBlueMagic_STR = S{
  681.         'Sinker Drill','Thrashing Assault','Battle Dance','Bloodrake','Death Scissors','Dimensional Death','Empty Thrash',
  682.         'Quadrastrike','Uppercut','Vertical Cleave'}
  683.  
  684.     PhysicalBlueMagic_STRAcc = S{
  685.         'Heavy Strike'}
  686.  
  687.     PhysicalBlueMagic_DEX = S{
  688.         'Amorphic Spikes','Claw Cyclone','Disseverment','Foot Kick',
  689.         'Frenetic Rip','Goblin Rush','Hysteric Barrage','Seedspray',
  690.         'Vanity Dive'}
  691.  
  692.     PhysicalBlueMagic_VIT = S{
  693.         'Cannonball','Glutinous Dart','Grand Slam','Quad. Continuum',
  694.         'Sprout Smack'}
  695.  
  696.     PhysicalBlueMagic_AGI = S{
  697.         'Helldive','Hydro Shot','Jet Stream','Pinecone Bomb',
  698.         'Wild Oats'}
  699.  
  700.     MagicalBlueMagic = S{
  701.         'Blitzstrahl','Tearing Gust','Cesspool','Searing Tempest','Spectral Floe','Scouring Spate','Anvil Lightning','Silent Storm','Entomb','Charged Whisker','Ice Break','Molting Plumage','Nectarous Deluge','Polar Roar','Crashing Thunder','Cursed Sphere','Bomb Toss','Maelstrom','Blazing Bound','Thunderbolt','Acrid Stream','Droning Whirlwind','Embalming Earth',
  702.         'Sandspin','Firespit','Foul Waters','Gates of Hades','Leafstorm','Subduction','Mind Blast','Corrosive Ooze',
  703.         'Regurgitation','Rending Deluge','Tem. Upheaval','Thermal Pulse','Water Bomb'}
  704.        
  705.     MagicalBlueMagicDark = S{
  706.         'Tenebral Crush','Palling Salvo','Eyes On Me','Dark Orb','Evryone. Grudge','Death Ray'}
  707.  
  708.     MagicalBlueMagicLight = S{
  709.         'Retinal Glare','Blinding Fulgor','Magic Hammer','Uproot','Rail Cannon','Diffusion Ray',}
  710.        
  711.     BlueMagic_Accuracy = S{
  712.         'Temporal Shift','Cruel Joke','Absolute Terror','1000 Needles','Actinic Burst','Auroral Drape','Awful Eye',
  713.         'Dream Flower','Blank Gaze','Blistering Roar','Chaotic Eye',
  714.         'Cimicine Discharge','Cold Wave','Demoralizing Roar',
  715.         'Enervation','Feather Tickle','Filamented Hold','Frightful Roar',
  716.         'Geist Wall','Hecatomb Wave','Infrasonics','Jettatura','Light of Penance','Lowing',
  717.         'Mortal Ray','Reaving Wind',
  718.         'Sandspray','Sheep Song','Soporific','Sound Blast','Stinking Gas','Sub-zero Smash',
  719.         'Venom Shell','Yawn'}
  720.  
  721.     BlueMagic_AccuracyRecast= S{
  722.         'Voracious Trunk'}
  723.    
  724.     BlueMagic_AccuracyRecastDark = S{
  725.         'Digest','Blood Saber','Blood Drain','Osmosis','MP Drainkiss',}
  726.  
  727.     BlueMagic_Breath = S{
  728.         'Bad Breath','Flying Hip Press','Final Sting','Frost Breath','Heat Breath',
  729.         'Magnetite Cloud','Poison Breath','Radiant Breath','Self Destruct','Thunder Breath',
  730.         'Wind Breath'}
  731.    
  732.     BlueMagic_Regen = S{'Regeneration'}
  733.  
  734.     BlueMagicBuffRecast = S{
  735.         'Erratic Flutter','Cocoon','Memento Mori','Harden Shell','Amplification','Zephyr Mantle','Animating Wail','Winds of Promy.','Carcharian Verve',
  736.         'Orcish Counterstance','Nature\'s Meditation','Plasma Charge','Saline Coat',
  737.         'Pyric Bulwark','Warm-Up','Reactor Cool','Triumphant Roar'}
  738.        
  739.     BlueMagic_BuffSkill = S{
  740.         'Diamondhide','Magic Barrier','Barrier Tusk','Occultation','Metallic Body'}
  741.    
  742.     BlueMagic_BuffRefresh = S{'Battery Charge','Refresh'}
  743.  
  744.     BlueMagic_Diffusion = S{
  745.         'Mighty Guard','Amplification','Cocoon','Exuviation','Feather Barrier','Harden Shell','Memento Mori',
  746.         'Metallic Body','Plasma Charge','Reactor Cool','Refueling','Saline Coat','Animating Wail','Battery Charge','Warm-Up',
  747.         'Zephyr Mantle'}
  748.  
  749.     BlueMagic_Healing = S{
  750.         'Restoral','Healing Breeze','Magic Fruit','Plenilune Embrace','Pollen',
  751.         'Wild Carrot'}
  752.        
  753.     BlueMagic_HealingWW = S{
  754.         'White Wind',}
  755.  
  756.  
  757.     BlueMagic_Stun = S{
  758.         'Benthic Typhoon','Bilgestorm','Barbed Crescent','Paralyzing Triad','Tourbillion','Saurian Slide','Sweeping Gouge','Frypan','Head Butt',
  759.         'Sudden Lunge','Tail slap','Delta Thrust','Whirl of Rage'}
  760.    
  761.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation
  762.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation
  763.     select_default_macro_book() -- Change Default Macro Book At The End
  764. end
  765.  
  766. -----------------------------------------------------------------
  767. -- Utiilty functions for this job
  768. -----------------------------------------------------------------
  769.  
  770. function rng()
  771.     if aCDC == 'Fast' then
  772.         if ShowD then
  773.             add_to_chat(158,'aCDC\'s fast RNG activation.')
  774.         end
  775.         N = (math.random(20,60)/100)
  776.         if N == 0.6 then
  777.             N = (math.random(150,180)/100)
  778.         elseif N == 0.59 then
  779.             N = (math.random(100,140)/100)
  780.         elseif N >= 0.57 then
  781.             N = (math.random(60,90)/100)
  782.         end
  783.         if ShowD then
  784.             add_to_chat(158,'ACDC\'s fast N value was equal to '..N..' prior to rounding.')
  785.         end
  786.     else
  787.         if ShowD then
  788.             add_to_chat(158,'aCDC\' standard RNG activation.')
  789.         end
  790.         N = (math.random(40,90)/100)   
  791.         if N >= 0.88 then
  792.             N = (math.random(150,180)/100)
  793.         elseif N >= 0.81 then
  794.             N = (math.random(100,140)/100)
  795.         end
  796.         if ShowD then
  797.             add_to_chat(158,'ACDC\'s standard N value was equal to '..N..' prior to rounding.')
  798.         end
  799.     end
  800.     N = math.floor(N*10+0.5)/10
  801.     if ShowD then
  802.         add_to_chat(158,'aCDC\'s rounded N value was '..N..'.')
  803.     end
  804. end
  805.  
  806. function sub_job_change(newSubjob, oldSubjob)
  807.     select_default_macro_book()
  808. end
  809.  
  810. function set_macro_page(set,book)
  811.     if not tonumber(set) then
  812.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  813.         return
  814.     end
  815.     if set < 1 or set > 10 then
  816.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  817.         return
  818.     end
  819.  
  820.     if book then
  821.         if not tonumber(book) then
  822.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  823.             return
  824.         end
  825.         if book < 1 or book > 20 then
  826.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  827.             return
  828.         end
  829.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  830.     else
  831.         send_command('@input /macro set '..tostring(set))
  832.     end
  833. end
  834.  
  835. function select_default_macro_book()
  836.     -- Default macro set/book
  837.     if player.sub_job == 'WAR' or player.sub_job == 'NIN' or player.sub_job == 'THF' then
  838.         set_macro_page(2, 17)
  839.         send_command('wait 7;input /lockstyleset 56')
  840.     else
  841.         set_macro_page(2, 16)
  842.         send_command('wait 7;input /lockstyleset 56')
  843.     end
  844. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement