Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- *** Credit goes to Flippant for helping me with Gearswap *** --
- -- ** I Use Some of Motenten's Functions ** --
- -- Last Updated: 05/03/14 6:30 AM *Advanced Version* --
- function get_sets()
- AccIndex = 1
- AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For Shooting/QD/TP/WS. 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 --
- IdleIndex = 1
- IdleArray = {'Movement', 'Regen'} -- Default Idle Set Is Movement --
- Armor = 'None'
- define_roll_values()
- AutoMode = 'OFF' -- Set Default Auto RA/WS ON or OFF Here --
- Obi = 'ON' -- Turn Default Obi ON or OFF Here --
- target_distance = 5 -- Set Default Distance Here --
- select_default_macro_book() -- Change Default Macro Book At The End --
- ACC_Shots = S{"Light Shot","Dark Shot"}
- Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
- Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
- sc_map = {SC1="CoursersRoll", SC2="DiaII", SC3="LightShot"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
- -- Idle/Town Sets --
- sets.Idle = {}
- sets.Idle.Regen = {
- ammo="Adlivun Bullet",
- head="Lak. Hat +1",
- neck="Twilight Torque",
- body="Lak. Frac +1",
- ear1="Merman's Earring",
- ear2="Merman's Earring",
- hands="Umuthi gloves",
- ring1="Dark Ring",
- ring2="Dark Ring",
- back="Repulse Mantle",
- legs="Crimson Cuisses",
- waist="Aquiline belt",
- feet="Lak. bottes +1"}
- sets.Idle.Movement = set_combine(sets.Idle.Regen,{})
- -- QD Sets --
- sets.QD = {
- ammo="Animikii Bullet",
- head="Lak. Hat +1",
- neck="Atzintli necklace",
- ear1="Hecate's Earring",
- ear2="Moldavite Earring",
- body="Mirke wardecors",
- hands="Schutzen mittens",
- ring1="Breeze Ring",
- ring2="Breeze Ring",
- back="Gunslinger's Cape",
- waist="Aquiline Belt",
- legs="Shneddick tights +1",
- feet="Lak. bottes +1"}
- sets.QD.MidACC = set_combine(sets.QD,{})
- sets.QD.HighACC = set_combine(sets.QD.MidACC,{
- ammo="Animikii Bullet",
- head="Lak. Hat +1",
- neck="Atzintli necklace",
- body="Mirke wardecors",
- back="Gunslinger's Cape",
- waist="Aquiline Belt",
- feet="Lak. bottes +1",
- ear1="Lifestorm Earring",
- ear2="Psystorm Earring",
- hands="Sigyn's Bazubands",
- ring1="Balrahn's Ring",
- ring2="Sangoma Ring",
- legs="Iuitl tights"})
- -- PDT/MDT Sets --
- sets.PDT = {
- ammo="Adlivun Bullet",
- head="Lak. Hat +1",
- neck="Twilight Torque",
- ear1="Merman's Earring",
- ear2="Merman's Earring",
- hands="Umuthi gloves",
- ring1="Dark Ring",
- ring2="Dark Ring",
- back="Repulse Mantle",
- legs="Crimson Cuisses",
- feet="Iuitl Gaiters"}
- sets.MDT = set_combine(sets.PDT,{})
- -- Roll Set --
- sets.Rolls = {
- head="Comm. Tricorne +1",
- hands="Nvrch. Gants +2",
- legs="Desultor tassets",
- ring1="Luzaf's Ring",
- ring2="Barataria ring"}
- -- Preshot --
- sets.Preshot = {
- ammo="Adlivun Bullet",
- head="Aurore Beret",
- body="Laksamana's Frac",
- hands="Iuitl wristbands",
- back="Navarch's Mantle",
- waist="Impulse Belt"}
- -- Shooting Base Set --
- sets.Midshot = {}
- -- Death Penalty Sets --
- sets.Midshot['Death Penalty'] = {}
- sets.Midshot['Death Penalty'].MidACC = set_combine(sets.Midshot['Death Penalty'],{})
- sets.Midshot['Death Penalty'].HighACC = set_combine(sets.Midshot['Death Penalty'].MidACC,{})
- -- Deathlocke Sets --
- sets.Midshot.Deathlocke = {
- ammo="Adlivun Bullet",
- head="Lak. Hat +1",
- neck="Iqabi necklace",
- ear1="Navarch's earring",
- ear2="Volley Earring",
- body="Laksamana's Frac",
- hands="Buremte gloves",
- ring1="Paqichikaji Ring",
- ring2="Behemoth Ring +1",
- back="Gunslinger's Mantle",
- waist="Commodore belt",
- legs="Thur. tights +1",
- feet="Iuitl Gaiters"}
- sets.Midshot.Deathlocke.MidACC = set_combine(sets.Midshot.Deathlocke,{})
- sets.Midshot.Deathlocke.HighACC = set_combine(sets.Midshot.Deathlocke.MidACC,{})
- -- Armageddon Sets --
- sets.Midshot.Armageddon = {}
- sets.Midshot.Armageddon.MidACC = set_combine(sets.Midshot.Armageddon,{})
- sets.Midshot.Armageddon.HighACC = set_combine(sets.Midshot.Armageddon.MidACC,{})
- -- Melee Sets --
- sets.Melee = {
- ammo="Adlivun Bullet",
- head="Lak. Hat +1",
- neck="Asperity necklace",
- ear1="Brutal Earring",
- ear2="Suppanomimi",
- body="Lanun frac",
- hands="Buremte gloves",
- ring1="Epona's Ring",
- ring2="Rajas Ring",
- back="Letalis Mantle",
- waist="Twilight belt",
- legs="Kaabnax trousers",
- feet="Lanun bottes"}
- sets.Melee.MidACC = set_combine(sets.Melee,{})
- sets.Melee.HighACC = set_combine(sets.Melee.MidACC,{})
- -- WS Base Set --
- sets.WS = {}
- -- Last Stand Sets --
- sets.WS["Last Stand"] = {
- ammo="Achiyal. Bullet",
- head="Lak. Hat +1",
- neck="Light Gorget",
- ear1="Navarch's Earring",
- ear2="Volley earring",
- body="Lak. Frac +1",
- hands="Skadi's Bazubands +1",
- ring1="Breeze Ring",
- ring2="Breeze Ring",
- back="Gunslinger's cape",
- waist="Flame Belt",
- legs="Lanun culottes",
- feet="Iuitl gaiters"}
- sets.WS["Last Stand"].MidACC = set_combine(sets.WS["Last Stand"],{})
- sets.WS["Last Stand"].HighACC = set_combine(sets.WS["Last Stand"].MidACC,{
- ring1="Paqichikaji Ring",
- ring2="Behemoth's Ring +1",
- legs="Thur. Tights +1"})
- -- Wildfire Sets --
- sets.WS["Wildfire"] = {
- ammo="Bronze Bullet",
- head="Lak. Hat +1",
- neck="Atzintli necklace",
- ear1="Hecate's Earring",
- ear2="Moldavite Earring",
- body="Lanun frac",
- hands="Schutzen mittens",
- ring1="Breeze Ring",
- ring2="Breeze Ring",
- back="Gunslinger's Cape",
- waist="Aquiline Belt",
- legs="Shneddick tights +1",
- feet="Lanun Bottes"}
- sets.WS["Wildfire"].MidACC = set_combine(sets.WS["Wildfire"],{})
- sets.WS["Wildfire"].HighACC = set_combine(sets.WS["Wildfire"].MidACC,{
- ear1="Lifestorm Earring",
- ear2="Psystorm Earring",
- hands="Sigyn's Bazubands",
- ring1="Balrahn's Ring",
- ring2="Sangoma Ring",
- legs="Iuitl tights",
- feet="Iuitl gaiters"})
- -- Leaden Salute Sets --
- sets.WS['Leaden Salute'] = {
- ammo="Bronze Bullet",
- head="Lak. Hat +1",
- neck="Atzintli necklace",
- ear1="Hecate's Earring",
- ear2="Moldavite Earring",
- body="Lanun frac",
- hands="Schutzen mittens",
- ring1="Breeze Ring",
- ring2="Breeze Ring",
- back="Gunslinger's Cape",
- waist="Aquiline Belt",
- legs="Shneddick tights +1",
- feet="Lanun Bottes"}
- sets.WS['Leaden Salute'].MidACC = set_combine(sets.WS['Leaden Salute'],{})
- sets.WS['Leaden Salute'].HighACC = set_combine(sets.WS['Leaden Salute'].MidACC,{
- ear1="Lifestorm Earring",
- ear2="Psystorm Earring",
- hands="Sigyn's Bazubands",
- ring1="Balrahn's Ring",
- ring2="Sangoma Ring",
- legs="Iuitl tights",
- feet="Iuitl gaiters"})
- -- Elemental Obi --
- sets.Obi = {}
- sets.Obi.Thunder = {waist='Rairin Obi'}
- sets.Obi.Water = {waist='Suirin Obi'}
- sets.Obi.Fire = {waist='Karin Obi'}
- sets.Obi.Ice = {waist='Hyorin Obi'}
- sets.Obi.Wind = {waist='Furin Obi'}
- sets.Obi.Earth = {waist='Dorin Obi'}
- sets.Obi.Light = {waist='Korin Obi'}
- sets.Obi.Dark = {waist='Anrin Obi'}
- -- JA Sets --
- sets.JA = {}
- sets.JA["Random Deal"] = {body="Lanun Frac"}
- sets.JA["Snake Eye"] = {legs="Lanun Culottes"}
- sets.JA["Wild Card"] = {feet="Lanun Bottes"}
- -- Waltz Set --
- sets.Waltz = {}
- sets.Precast = {}
- --Fastcast Set --
- sets.Precast.FastCast = {}
- sets.Midcast = {}
- -- Magic Haste Set --
- sets.Midcast.Haste = set_combine(sets.PDT,{})
- end
- function pretarget(spell,action)
- if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
- cancel_spell()
- send_command('input /item "Echo Drops" <me>')
- elseif spell.type == "CorsairRoll" and buffactive[spell.english] then -- Change Any Rolls To Double-Up When You Have A Roll Up --
- cancel_spell()
- send_command('doubleup')
- elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
- cancel_spell()
- send_command('ThirdEye')
- elseif spell.english == "Meditate" and player.tp > 290 then -- Cancel Meditate If TP Is Above 290 --
- cancel_spell()
- add_to_chat(123, spell.name .. ' Canceled: ' .. player.tp)
- elseif spell.action_type == 'Ranged Attack' then -- Auto WS
- if player.tp >= 100 and AutoMode == 'ON' and not buffactive.amnesia then
- cancel_spell()
- autoWS()
- end
- elseif spell.action_type == 'Ranged Attack' and spell.target.distance > 24.9 then
- cancel_spell()
- add_to_chat(123, spell.name..' Canceled: [Out of Range]')
- return
- elseif spell.type == 'WeaponSkill' and player.status == 'Engaged' then
- if spell.skill == 'Marksmanship' then
- if spell.target.distance > 16+target_distance then
- cancel_spell()
- add_to_chat(123, spell.name..' Canceled: [Out of Range]')
- return
- end
- else
- if spell.target.distance > target_distance then
- cancel_spell()
- add_to_chat(123, spell.name..' Canceled: [Out of Range]')
- return
- end
- end
- end
- end
- function precast(spell,action)
- if spell.action_type == 'Ranged Attack' or spell.type == "WeaponSkill" then
- if player.equipment.ammo == "Animikii Bullet" then -- Cancel Ranged Attack or WS If You Have Animikii Bullet Equipped --
- cancel_spell()
- add_to_chat(123, spell.name .. ' Canceled: [Animikii Bullet Equipped!]')
- return
- else
- if spell.action_type == 'Ranged Attack' then
- equip(sets.Preshot)
- elseif spell.type == "WeaponSkill" then
- if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
- cancel_spell()
- add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
- return
- else
- equipSet = sets.WS
- if equipSet[spell.english] then
- equipSet = equipSet[spell.english]
- end
- if equipSet[AccArray[AccIndex]] then
- equipSet = equipSet[AccArray[AccIndex]]
- end
- if spell.english == "Last Stand" and (player.tp > 299 or buffactive.Sekkanoki) then -- Equip Altdorf's Earring and Wilhelm's Earring When You Have 300 TP or Sekkanoki For Last Stand --
- equipSet = set_combine(equipSet,{ear1="Altdorf's Earring",ear2="Wilhelm's Earring"})
- end
- equip(equipSet)
- end
- end
- end
- elseif spell.type == "JobAbility" then
- if sets.JA[spell.english] then
- equip(sets.JA[spell.english])
- if spell.english == "Snake Eye" then -- Auto Double-Up After You Use Snake Eye --
- send_command('@wait 1;input /ja Double-Up <me>')
- end
- end
- elseif spell.type == "CorsairRoll" then
- equip(sets.Rolls)
- if spell.english == "Tactician's Roll" then
- equip({body="Nvrch. Frac +2"})
- elseif spell.english == "Caster's Roll" then
- equip({legs="Nvrch. Culottes +2"})
- elseif spell.english == "Courser's Roll" then
- equip({feet="Nvrch. Bottes +2"})
- end
- elseif spell.english == "Double-Up" then
- equip(sets.Rolls)
- elseif spell.type == "CorsairShot" then
- equipSet = sets.QD
- if ACC_Shots:contains(spell.english) then
- equipSet = sets.QD.HighACC
- else
- if equipSet[AccArray[AccIndex]] then
- equipSet = equipSet[AccArray[AccIndex]]
- end
- if not ACC_Shots:contains(spell.english) and (world.day_element == spell.element or world.weather_element == spell.element) and sets.Obi[spell.element] and Obi == 'ON' then -- Use Obi Toggle To Unlock Elemental Obi --
- equipSet = set_combine(equipSet,sets.Obi[spell.element])
- end
- end
- equip(equipSet)
- elseif spell.action_type == 'Magic' then
- if string.find(spell.english,'Utsusemi') then
- if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
- cancel_spell()
- add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
- return
- else
- equip(sets.Precast.FastCast)
- end
- else
- equip(sets.Precast.FastCast)
- end
- elseif spell.type == "Waltz" then
- refine_waltz(spell,action)
- equip(sets.Waltz)
- elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
- cast_delay(0.2)
- send_command('cancel Sneak')
- end
- end
- function midcast(spell,action)
- if spell.action_type == 'Ranged Attack' then
- equipSet = sets.Midshot
- if equipSet[player.equipment.range] then
- equipSet = equipSet[player.equipment.range]
- end
- if equipSet[AccArray[AccIndex]] then
- equipSet = equipSet[AccArray[AccIndex]]
- end
- equip(equipSet)
- elseif spell.action_type == 'Magic' then
- if spell.english == "Stoneskin" then
- if buffactive.Stoneskin then
- send_command('@wait 2.8;cancel stoneskin')
- end
- equip(sets.Midcast.Stoneskin)
- elseif spell.english == "Sneak" then
- if spell.target.name == player.name and buffactive['Sneak'] then
- send_command('cancel sneak')
- end
- equip(sets.Midcast.Haste)
- elseif string.find(spell.english,'Utsusemi') then
- if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
- send_command('@wait 1.7;cancel Copy Image*')
- end
- equip(sets.Midcast.Haste)
- elseif spell.english == 'Monomi: Ichi' then
- if buffactive['Sneak'] then
- send_command('@wait 1.7;cancel sneak')
- end
- equip(sets.Midcast.Haste)
- else
- equip(sets.Midcast.Haste)
- end
- end
- end
- function aftercast(spell,action)
- if spell.action_type == 'Ranged Attack' and AutoMode == 'ON' then
- autoRA()
- elseif not spell.interrupted then
- if spell.type == "WeaponSkill" then
- send_command('wait 0.2;gs c TP')
- elseif spell.type == 'CorsairRoll' then
- display_roll_info(spell)
- elseif spell.english == 'Light Shot' then -- Sleep Countdown --
- send_command('wait 50;input /echo '..spell.name..' Effect: [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..' Effect: [OFF]')
- end
- else
- status_change(player.status)
- end
- end
- function status_change(new,old)
- if Armor == 'PDT' then
- equip(sets.PDT)
- elseif Armor == 'MDT' then
- equip(sets.MDT)
- elseif new == 'Engaged' then
- equipSet = sets.Melee
- if equipSet[AccArray[AccIndex]] then
- equipSet = equipSet[AccArray[AccIndex]]
- end
- equip(equipSet)
- elseif new == 'Idle' then
- equip(sets.Idle[IdleArray[IdleIndex]])
- elseif new == 'Resting' then
- equip(sets.Resting)
- end
- end
- function buff_change(buff,gain)
- buff = string.lower(buff)
- if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
- if gain then
- 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.]')
- else
- send_command('timers delete "Aftermath: Lv.3"')
- add_to_chat(123,'AM3: [OFF]')
- end
- elseif buff == 'weakness' then -- Weakness Timer --
- if gain then
- send_command('timers create "Weakness" 300 up')
- else
- send_command('timers delete "Weakness"')
- end
- end
- if not midaction() then
- status_change(player.status)
- end
- end
- -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
- function self_command(command)
- if command == 'C1' then -- Accuracy Level Toggle --
- AccIndex = (AccIndex % #AccArray) + 1
- status_change(player.status)
- add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
- elseif command == 'C5' then -- Auto Update Gear Toggle --
- status_change(player.status)
- add_to_chat(158,'Auto Update Gear')
- elseif command == 'C3' then -- Obi Toggle --
- if Obi == 'ON' then
- Obi = 'OFF'
- add_to_chat(123,'Obi: [OFF]')
- else
- Obi = 'ON'
- add_to_chat(158,'Obi: [ON]')
- end
- status_change(player.status)
- elseif command == 'C7' then -- PDT Toggle --
- if Armor == 'PDT' then
- Armor = 'None'
- add_to_chat(123,'PDT Set: [Unlocked]')
- else
- Armor = 'PDT'
- add_to_chat(158,'PDT Set: [Locked]')
- end
- status_change(player.status)
- elseif command == 'C15' then -- MDT Toggle --
- if Armor == 'MDT' then
- Armor = 'None'
- add_to_chat(123,'MDT Set: [Unlocked]')
- else
- Armor = 'MDT'
- add_to_chat(158,'MDT Set: [Locked]')
- end
- status_change(player.status)
- elseif command == 'C8' then -- Distance Toggle --
- if player.target.distance then
- target_distance = math.floor(player.target.distance*10)/10
- add_to_chat(158,'Distance: '..target_distance)
- else
- add_to_chat(123,'No Target Selected')
- end
- elseif command == 'C6' then -- Idle Toggle --
- IdleIndex = (IdleIndex % #IdleArray) + 1
- status_change(player.status)
- add_to_chat(158,'Idle Set: ' .. IdleArray[IdleIndex])
- elseif command == 'C2' then -- Auto RA/WS Toggle. *Don't Rely On This. It Isn't As Fast As Shooting Manually. It Is Mainly For AFK or When You Dualbox* --
- if AutoMode == 'ON' then
- AutoMode = 'OFF'
- add_to_chat(123,'Auto Mode: [OFF]')
- else
- AutoMode = 'ON'
- add_to_chat(158,'Auto Mode: [ON]')
- end
- elseif command == 'TP' then
- add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
- elseif command:match('^SC%d$') then
- send_command('//' .. sc_map[command])
- end
- end
- function autoRA()
- send_command('@wait 2.7; input /ra <t>')
- end
- function autoWS() -- Change Auto WS Here --
- send_command('input /ws "Last Stand" <t>')
- end
- function define_roll_values()
- rolls = {
- CorsairsRoll = {lucky=5, unlucky=9, bonus="Experience Points"},
- NinjaRoll = {lucky=4, unlucky=8, bonus="Evasion"},
- HuntersRoll = {lucky=4, unlucky=8, bonus="Accuracy"},
- ChaosRoll = {lucky=4, unlucky=8, bonus="Attack"},
- MagussRoll = {lucky=2, unlucky=6, bonus="Magic Defense"},
- HealersRoll = {lucky=3, unlucky=7, bonus="Cure Potency Received"},
- PuppetRoll = {lucky=4, unlucky=8, bonus="Pet Magic Accuracy/Attack"},
- ChoralRoll = {lucky=2, unlucky=6, bonus="Spell Interruption Rate"},
- MonksRoll = {lucky=3, unlucky=7, bonus="Subtle Blow"},
- BeastRoll = {lucky=4, unlucky=8, bonus="Pet Attack"},
- SamuraiRoll = {lucky=2, unlucky=6, bonus="Store TP"},
- EvokersRoll = {lucky=5, unlucky=9, bonus="Refresh"},
- RoguesRoll = {lucky=5, unlucky=9, bonus="Critical Hit Rate"},
- WarlocksRoll = {lucky=4, unlucky=8, bonus="Magic Accuracy"},
- FightersRoll = {lucky=5, unlucky=9, bonus="Double Attack Rate"},
- DrachenRoll = {lucky=3, unlucky=7, bonus="Pet Accuracy"},
- GallantsRoll = {lucky=3, unlucky=7, bonus="Defense"},
- WizardsRoll = {lucky=5, unlucky=9, bonus="Magic Attack"},
- DancersRoll = {lucky=3, unlucky=7, bonus="Regen"},
- ScholarsRoll = {lucky=2, unlucky=6, bonus="Conserve MP"},
- BoltersRoll = {lucky=3, unlucky=9, bonus="Movement Speed"},
- CastersRoll = {lucky=2, unlucky=7, bonus="Fast Cast"},
- CoursersRoll = {lucky=3, unlucky=9, bonus="Snapshot"},
- BlitzersRoll = {lucky=4, unlucky=9, bonus="Attack Delay"},
- TacticiansRoll = {lucky=5, unlucky=8, bonus="Regain"},
- AlliessRoll = {lucky=3, unlucky=10, bonus="Skillchain Damage"},
- MisersRoll = {lucky=5, unlucky=7, bonus="Save TP"},
- CompanionsRoll = {lucky=2, unlucky=10, bonus="Pet Regain and Regen"},
- AvengersRoll = {lucky=4, unlucky=8, bonus="Counter Rate"}
- }
- end
- function display_roll_info(spell)
- rollinfo = rolls[(string.gsub((string.gsub(spell.english, "%'+", "")), "%s+", ""))]
- if rollinfo then
- add_to_chat(158, spell.english..' = '..rollinfo.bonus..'. Lucky Roll is '..
- tostring(rollinfo.lucky)..', Unlucky Roll is '..tostring(rollinfo.unlucky)..'.')
- end
- end
- function refine_waltz(spell,action)
- if spell.type ~= 'Waltz' then
- return
- end
- if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" or spell.name == "Divine Waltz II" then
- return
- end
- local newWaltz = spell.english
- local missingHP = 0
- local targ
- if spell.target.type == "SELF" then
- targ = alliance[1][1]
- missingHP = player.max_hp - player.hp
- elseif spell.target.isallymember then
- targ = find_player_in_alliance(spell.target.name)
- local est_max_hp = targ.hp / (targ.hpp/100)
- missingHP = math.floor(est_max_hp - targ.hp)
- end
- if targ then
- if player.sub_job == 'DNC' then
- if missingHP < 40 then
- add_to_chat(123,'Full HP!')
- cancel_spell()
- return
- elseif missingHP < 150 then
- newWaltz = 'Curing Waltz'
- elseif missingHP < 300 then
- newWaltz = 'Curing Waltz II'
- else
- newWaltz = 'Curing Waltz III'
- end
- else
- return
- end
- end
- local waltzTPCost = {['Curing Waltz'] = 20,['Curing Waltz II'] = 35,['Curing Waltz III'] = 50,['Curing Waltz IV'] = 65,['Curing Waltz V'] = 80}
- local tpCost = waltzTPCost[newWaltz]
- local downgrade
- if player.tp < tpCost and not buffactive.trance then
- if player.tp < 20 then
- add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
- cancel_spell()
- return
- elseif player.tp < 35 then
- newWaltz = 'Curing Waltz'
- elseif player.tp < 50 then
- newWaltz = 'Curing Waltz II'
- elseif player.tp < 65 then
- newWaltz = 'Curing Waltz III'
- elseif player.tp < 80 then
- newWaltz = 'Curing Waltz IV'
- end
- downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
- end
- if newWaltz ~= spell.english then
- send_command('wait 0.03;input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
- if downgrade then
- add_to_chat(158, downgrade)
- end
- cancel_spell()
- return
- end
- if missingHP > 0 then
- add_to_chat(158,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
- end
- end
- function find_player_in_alliance(name)
- for i,v in ipairs(alliance) do
- for k,p in ipairs(v) do
- if p.name == name then
- return p
- end
- end
- end
- end
- function actualCost(originalCost)
- if buffactive["Penury"] then
- return originalCost*.5
- elseif buffactive["Light Arts"] then
- return originalCost*.9
- else
- return originalCost
- end
- end
- function degrade_spell(spell,degrade_array)
- spell_index = table.find(degrade_array,spell.name)
- if spell_index>1 then
- new_spell = degrade_array[spell_index - 1]
- change_spell(new_spell,spell.target.raw)
- add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
- end
- end
- function change_spell(spell_name,target)
- cancel_spell()
- send_command('//'..spell_name..' '..target)
- end
- function sub_job_change(newSubjob, oldSubjob)
- select_default_macro_book()
- end
- function set_macro_page(set,book)
- if not tonumber(set) then
- add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
- return
- end
- if set < 1 or set > 10 then
- add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
- return
- end
- if book then
- if not tonumber(book) then
- add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
- return
- end
- if book < 1 or book > 20 then
- add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
- return
- end
- send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
- else
- send_command('@input /macro set '..tostring(set))
- end
- end
- function select_default_macro_book()
- -- Default macro set/book
- if player.sub_job == 'SAM' then
- set_macro_page(1, 7)
- elseif player.sub_job == 'WHM' then
- set_macro_page(1, 7)
- elseif player.sub_job == 'DNC' then
- set_macro_page(1, 7)
- elseif player.sub_job == 'NIN' then
- set_macro_page(1, 7)
- elseif player.sub_job == 'RDM' then
- set_macro_page(1, 7)
- elseif player.sub_job == 'WAR' then
- set_macro_page(1, 7)
- elseif player.sub_job == 'DRG' then
- set_macro_page(1, 7)
- else
- set_macro_page(1, 7)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement