Guest User

FFXI Lua for Haste Calculations

a guest
Apr 24th, 2025
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.03 KB | None | 0 0
  1. function determine_haste_group()
  2.  
  3.     classes.CustomMeleeGroups:clear()
  4.     -- assuming +4 for marches (ghorn has +5)
  5.     -- Haste (white magic) is 14.65% (15%)
  6.     -- Haste II (white magic) is 29.98% (30%)
  7.     -- Haste Samba (Sub) 5%
  8.     -- Haste (Merited DNC) 10% (never account for this)
  9.     -- Honor March is now considered in 'Hi'
  10.     -- Honor March +0/+1/+2/+3/+4            ||  12.30% /13.48% / 14.65% / 15.82% / 16.99%
  11.     -- Victory March +0/+3/+4/+5/+6/+7/+8    ||  15.92% /17.48% / 19.04% / 20.61% / 22.27% / 23.83% / 25.39% / 27.05% / 28.61%
  12.     -- Advancing March +0/+3/+4/+5/+6/+7/+8  ||  10.55% /11.52% / 12.60% / 13.67% / 14.75% / 15.82% / 16.60% / 17.87% / 18.95%
  13.     -- Embrava 30% with 500 enhancing skill
  14.     -- buffactive[580] = geo haste - 30% (does not assume idris since it will not cap on its own w/o rare circumstance i.e /dnc)
  15.     -- buffactive[33] = regular haste - 15%
  16.     -- buffactive[604] = mighty guard - 15%
  17.     -- state.HasteMode = toggle for when you know Haste II is being cast on you as well as 2hr buffs like SV and Bolster
  18.     -- Hi = Haste II and/or H.M. is being cast. This is clunky to use when both haste II and haste I are being cast (default to Hi)
  19.  
  20.     if state.CombatWeapon.value == 'DW' then
  21.         if player.equipment.main == "Farsha" and buffactive['Aftermath: Lv.3'] then
  22.                 if state.HasteMode.value == 'Hi' then
  23.                     if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
  24.                          ( buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
  25.                          ( buffactive.march == 2 and buffactive[604] ) ) then
  26.                         add_to_chat(8, '-------------Aftermath - Max-Haste Mode Enabled--------------')
  27.                         classes.CustomMeleeGroups:append('Farsha_Max')
  28.                     elseif ( (buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba'] ) then
  29.                         add_to_chat(8, '-------------Aftermath - Haste 35%-------------')
  30.                         classes.CustomMeleeGroups:append('Farsha_35')
  31.                     elseif ( ( buffactive[580] or buffactive[33] or buffactive.march == 2 ) or
  32.                              ( buffactive.march == 1 and buffactive[604] ) ) then
  33.                         add_to_chat(8, '-------------Aftermath - Haste 30%-------------')
  34.                         classes.CustomMeleeGroups:append('Farsha_30')
  35.                     elseif ( buffactive.march == 1 or buffactive[604] ) then
  36.                         add_to_chat(8, '-------------AFtermath - Haste 15%-------------')
  37.                         classes.CustomMeleeGroups:append('Farsha_15')
  38.                     end
  39.                 else
  40.                     if ( buffactive[580] and ( buffactive.march or buffactive[33] or buffactive.embrava or buffactive[604]) ) or  -- geo haste + anything
  41.                        ( buffactive.embrava and (buffactive.march or buffactive[33] or buffactive[604]) ) or  -- embrava + anything
  42.                        ( buffactive.march == 2 and (buffactive[33] or buffactive[604]) ) or  -- two marches + anything
  43.                        ( buffactive[33] and buffactive[604] and buffactive.march ) then -- haste + mighty guard + any marches
  44.                         add_to_chat(8, '-------------Aftermath - Max Haste Mode Enabled--------------')
  45.                         classes.CustomMeleeGroups:append('Farsha_Max')
  46.                     elseif ( (buffactive[604] or buffactive[33]) and buffactive['haste samba'] and buffactive.march == 1) or -- MG or haste + samba with 1 march
  47.                            ( buffactive.march == 2 and buffactive['haste samba'] ) or
  48.                            ( buffactive[580] and buffactive['haste samba'] ) then
  49.                         add_to_chat(8, '-------------Aftermath - Haste 35%-------------')
  50.                         classes.CustomMeleeGroups:append('Farsha_35')
  51.                     elseif ( buffactive.march == 2 ) or -- two marches from ghorn
  52.                            ( (buffactive[33] or buffactive[604]) and buffactive.march == 1 ) or  -- MG or haste + 1 march
  53.                            ( buffactive[580] ) or  -- geo haste
  54.                            ( buffactive[33] and buffactive[604] ) then  -- haste with MG
  55.                         add_to_chat(8, '-------------Aftermath - Haste 30%-------------')
  56.                         classes.CustomMeleeGroups:append('Farsha_30')
  57.                     elseif buffactive[33] or buffactive[604] or buffactive.march == 1 then
  58.                         add_to_chat(8, '-------------Aftermath - Haste 15%-------------')
  59.                         classes.CustomMeleeGroups:append('Farsha_15')
  60.                     end
  61.                 end
  62.         elseif not buffactive['Aftermath: Lv.3'] or player.equipment.main ~= "Farsha" then
  63.             if state.HasteMode.value == 'Hi' then
  64.                 if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
  65.                      ( buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
  66.                      ( buffactive.march == 2 and buffactive[604] ) ) then
  67.                     add_to_chat(8, '------------- Max-Haste Mode Enabled--------------')
  68.                     classes.CustomMeleeGroups:append('MaxHaste')
  69.                 elseif ( (buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba'] ) then
  70.                     add_to_chat(8, '-------------Haste 35%-------------')
  71.                     classes.CustomMeleeGroups:append('Haste_35')
  72.                 elseif ( ( buffactive[580] or buffactive[33] or buffactive.march == 2 ) or
  73.                          ( buffactive.march == 1 and buffactive[604] ) ) then
  74.                     add_to_chat(8, '-------------Haste 30%-------------')
  75.                     classes.CustomMeleeGroups:append('Haste_30')
  76.                 elseif ( buffactive.march == 1 or buffactive[604] ) then
  77.                     add_to_chat(8, '-------------Haste 15%-------------')
  78.                     classes.CustomMeleeGroups:append('Haste_15')
  79.                 end
  80.             else
  81.                 if ( buffactive[580] and ( buffactive.march or buffactive[33] or buffactive.embrava or buffactive[604]) ) or  -- geo haste + anything
  82.                    ( buffactive.embrava and (buffactive.march or buffactive[33] or buffactive[604]) ) or  -- embrava + anything
  83.                    ( buffactive.march == 2 and (buffactive[33] or buffactive[604]) ) or  -- two marches + anything
  84.                    ( buffactive[33] and buffactive[604] and buffactive.march ) then -- haste + mighty guard + any marches
  85.                     add_to_chat(8, '-------------Max Haste Mode Enabled--------------')
  86.                     classes.CustomMeleeGroups:append('MaxHaste')
  87.                 elseif ( (buffactive[604] or buffactive[33]) and buffactive['haste samba'] and buffactive.march == 1) or -- MG or haste + samba with 1 march
  88.                        ( buffactive.march == 2 and buffactive['haste samba'] ) or
  89.                        ( buffactive[580] and buffactive['haste samba'] ) then
  90.                     add_to_chat(8, '-------------Haste 35%-------------')
  91.                     classes.CustomMeleeGroups:append('Haste_35')
  92.                 elseif ( buffactive.march == 2 ) or -- two marches from ghorn
  93.                        ( (buffactive[33] or buffactive[604]) and buffactive.march == 1 ) or  -- MG or haste + 1 march
  94.                        ( buffactive[580] ) or  -- geo haste
  95.                        ( buffactive[33] and buffactive[604] ) then  -- haste with MG
  96.                     add_to_chat(8, '-------------Haste 30%-------------')
  97.                     classes.CustomMeleeGroups:append('Haste_30')
  98.                 elseif buffactive[33] or buffactive[604] or buffactive.march == 1 then
  99.                     add_to_chat(8, '-------------Haste 15%-------------')
  100.                     classes.CustomMeleeGroups:append('Haste_15')
  101.                 end
  102.             end
  103.         end
  104.     end
  105.     if state.CombatWeapon.value ~= 'DW' then
  106.     end
  107. end
  108.  
Add Comment
Please, Sign In to add comment