Advertisement
Guest User

Untitled

a guest
May 17th, 2018
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 26.54 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job.  Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. -- Initialization function for this job file.
  6. function get_sets()
  7.         mote_include_version = 2
  8.  
  9.         -- Load and initialize the include file.
  10.         include('Mote-Include.lua')
  11. end
  12.  
  13. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  14. function job_setup()
  15.         indi_timer = ''
  16.         indi_duration = 280
  17. end
  18.  
  19. -------------------------------------------------------------------------------------------------------------------
  20. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  21. -------------------------------------------------------------------------------------------------------------------
  22.  
  23. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  24. function user_setup()
  25.                 state.OffenseMode:options('Normal', 'Acc', 'DW', 'DWAcc', 'PDT', 'Staff', 'Refresh')
  26.                 state.CastingMode:options('Normal', 'Resistant', 'Burst', 'BurstResist', 'Proc')
  27.                 state.IdleMode:options('Normal', 'Refresh', 'PDT', 'MDT', 'PetRegen')
  28.  
  29.                 send_command('bind ^F input /bomb')
  30.                 send_command('bind !F input /dismount')
  31.                 send_command('bind !O input /equip ring1 "Warp Ring"; wait 7; input /item "Warp Ring" <me> ')
  32.                            
  33.                 select_default_macro_book()
  34.                 define_nuke_downgrades()
  35. end
  36.  
  37. function define_nuke_downgrades()
  38.         t1              =       S{      'Stone',                'Water',                'Aero',                 'Fire',                 'Blizzard',             'Thunder'}
  39.         t2              =       S{      'Stone II',             'Water II',             'Aero II',              'Fire II',              'Blizzard II',  'Thunder II'}
  40.         t3              =       S{      'Stone III',    'Water III',    'Aero III',             'Fire III',             'Blizzard III', 'Thunder III'}
  41.         t4              =       S{      'Stone IV',             'Water IV',             'Aero IV',              'Fire IV',              'Blizzard IV',  'Thunder IV'}
  42.         t5              =       S{      'Stone V',              'Water V',              'Aero V',               'Fire V',               'Blizzard V',   'Thunder V'}
  43.         t6              =       S{      'Stone VI',             'Water VI',             'Aero VI',              'Fire VI',              'Blizzard VI',  'Thunder VI'}
  44.         ra1             =       S{      'Stonera',              'Watera',               'Aera',               'Fira',                 'Blizzara',             'Thundara'}
  45.         ra2             =       S{      'Stonera II',   'Watera II',    'Aera II',    'Fira II',              'Blizzara II',  'Thundara II'}
  46.         ra3             =       S{      'Stonera III',  'Watera III',   'Aera III',   'Fira III',             'Blizzara III', 'Thundara III'}
  47.         no_down =       S{      'Quake',                'Flood',                'Tornado',              'Flare',                'Freeze',               'Burst',
  48.                                         'Quake II',             'Flood II',             'Tornado II',   'Flare II',             'Freeze II',    'Burst II',
  49.                                         'Stonega',              'Waterga',              'Aeroga',               'Firaga',               'Blizzaga',             'Thundaga',
  50.                                         'Stonega II',   'Waterga II',   'Aeroga II',    'Firaga II',    'Blizzaga II',  'Thundaga II',
  51.                                         'Stonega III',  'Waterga III',  'Aeroga III',   'Firaga III',   'Blizzaga III', 'Thundaga III',
  52.                                         'Stoneja',              'Waterja',              'Aeroja',               'Firaja',               'Blizzaja',             'Thundaja',
  53.                                         'Rasp',                 'Drown',                'Choke',                'Burn',                 'Frost',                'Shock',
  54.                                         'Geohelix',             'Hydrohelix',   'Anemohelix',   'Pyrohelix',    'Cryohelix',    'Ionohelix',
  55.                                         'Luminohelix',  'Noctohelix',   'Comet',                'Meteor',               'Impact'}
  56.         aras    =       S{      'Stonera',              'Watera',               'Aera',               'Fira',                 'Blizzara',             'Thundara',
  57.                                         'Stonera II',   'Watera II',    'Aera II',    'Fira II',              'Blizzara II',  'Thundara II',
  58.                                         'Stonera III',  'Watera III',   'Aera III',   'Fira III',             'Blizzara III', 'Thundara III'}
  59. end
  60.  
  61.  
  62. -- Define sets and vars used by this job file.
  63. function init_gear_sets()
  64. end
  65. -------------------------------------------------------------------------------------------------------------------
  66. -- Job-specific hooks for standard casting events.
  67. -------------------------------------------------------------------------------------------------------------------
  68. function precast(spell,action)
  69. -- Auto-Echo drop :D --
  70.     if spell.action_type == 'Magic' and buffactive['Silence'] then
  71.       cancel_spell()
  72.       send_command('input /item "Echo Drops" <me>')
  73. -- Auto Blaze of Glory for lazies :p --    
  74.     elseif string.find(spell.english, 'Geo-') then
  75.         if not buffactive['Bolster'] and not buffactive['Amnesia'] and not pet.isvalid and windower.ffxi.get_ability_recasts()[247] < 1 then
  76.             cancel_spell()
  77.             send_command('input /ja "Blaze of Glory" <me>;wait 2;input /ma "'..spell.english..'" '..spell.target.name)
  78.         end
  79. -- Auto Entrust if you are targeting someone else than you --  
  80.     elseif string.find(spell.english, 'Indi-') then
  81.         if spell.target.type == 'PLAYER' and windower.ffxi.get_ability_recasts()[93] < 1 and not buffactive['Entrust'] and not buffactive['Amnesia']  then
  82.             cancel_spell()
  83.             send_command('input /ja "entrust" <me>;wait 1.5;input /ma "'..spell.name..'" '..spell.target.name..';')    
  84.         end
  85.     end
  86. end
  87.  
  88. function job_precast(spell, action, spellMap, eventArgs)
  89.         refine_nukes(spell, action, spellMap, eventArgs)
  90.         refine_various_spells(spell, action, spellMap, eventArgs)
  91. end
  92.  
  93. function refine_various_spells(spell, action, spellMap, eventArgs)
  94.         aspirs = S{'Aspir','Aspir II','Aspir III'}
  95.         sleeps = S{'Sleep','Sleep II'}
  96.         sleepgas = S{'Sleepga','Sleepga II'}
  97.  
  98.         if not sleepgas:contains(spell.english) and not sleeps:contains(spell.english) and not aspirs:contains(spell.english) then
  99.                 return
  100.         end
  101.  
  102.         local newSpell = spell.english
  103.         local spell_recasts = windower.ffxi.get_spell_recasts()
  104.         local cancelling = 'All '..spell.english..' spells are on cooldown. Cancelling spell casting.'
  105.  
  106.         if spell_recasts[spell.recast_id] > 0 then
  107.                 if aspirs:contains(spell.english) then
  108.                         if spell.english == 'Aspir' then
  109.                                 add_to_chat(122,cancelling)
  110.                                 eventArgs.cancel = true
  111.                                 return
  112.                         elseif spell.english == 'Aspir II' then newSpell = 'Aspir'
  113.                         elseif spell.english == 'Aspir III' then newSpell = 'Aspir II'
  114.                         end                    
  115.                 elseif sleeps:contains(spell.english) then
  116.                         if spell.english == 'Sleep' then
  117.                                 add_to_chat(122,cancelling)
  118.                                 eventArgs.cancel = true
  119.                                 return
  120.                         elseif spell.english == 'Sleep II' then newSpell = 'Sleep'
  121.                         end
  122.                 elseif sleepgas:contains(spell.english) then
  123.                         if spell.english == 'Sleepga' then
  124.                                 add_to_chat(122,cancelling)
  125.                                 eventArgs.cancel = true
  126.                                 return
  127.                         elseif spell.english == 'Sleepga II' then newSpell = 'Sleepga'
  128.                         end
  129.                 end
  130.         end
  131.  
  132.         if newSpell ~= spell.english then
  133.                 send_command('@input /ma "'..newSpell..'" '..tostring(spell.target.raw))
  134.                 eventArgs.cancel = true
  135.                 return
  136.         end
  137. end
  138.  
  139. function midcast(spell)
  140.     if spell.action_type == 'Magic' then
  141.         if spell.skill == 'Geomancy' then
  142.             if string.find(spell.english, 'Geo-') then
  143.                 equip(sets.midcast.Geomancy)
  144.             elseif string.find(spell.english, 'Indi-') then
  145.                 equip(sets.midcast.Geomancy.Indi)          
  146.                 if buffactive['Entrust'] then
  147.                     sets.midcast.Geomancy.Indi = set_combine(sets.midcast.Geomancy.Indi, {main="Solstice"})        
  148.                 end
  149.             end
  150.         end
  151.     end
  152. end
  153.    
  154. function job_aftercast(spell, action, spellMap, eventArgs)
  155.         if not spell.interrupted then
  156.                 if spell.english:startswith('Indi') then
  157.                         if not classes.CustomIdleGroups:contains('Indi') then
  158.                                 classes.CustomIdleGroups:append('Indi')
  159.                         end
  160.                         send_command('@timers d "'..indi_timer..'"')
  161.                         indi_timer = spell.english
  162.                         send_command('@timers c "'..indi_timer..'" '..indi_duration..' down spells/00136.png')
  163.                 elseif spell.english == 'Sleep' or spell.english == 'Sleepga' then
  164.                         send_command('@timers c "'..spell.english..' ['..spell.target.name..']" 60 down spells/00220.png')
  165.                 elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
  166.                         send_command('@timers c "'..spell.english..' ['..spell.target.name..']" 90 down spells/00220.png')
  167.                 end
  168.         elseif not player.indi then
  169.                 classes.CustomIdleGroups:clear()
  170.         end
  171. end
  172.  
  173. -------------------------------------------------------------------------------------------------------------------
  174. -- Job-specific hooks for non-casting events.
  175. -------------------------------------------------------------------------------------------------------------------
  176.  
  177. -- Called when a player gains or loses a buff.
  178. -- buff == buff gained or lost
  179. -- gain == true if the buff was gained, false if it was lost.
  180. function job_buff_change(buff, gain)
  181.         if player.indi and not classes.CustomIdleGroups:contains('Indi')then
  182.                 classes.CustomIdleGroups:append('Indi')
  183.                 handle_equipping_gear(player.status)
  184.         elseif classes.CustomIdleGroups:contains('Indi') and not player.indi then
  185.                 classes.CustomIdleGroups:clear()
  186.                 handle_equipping_gear(player.status)
  187.         end
  188. end
  189.  
  190.  
  191. -------------------------------------------------------------------------------------------------------------------
  192. -- User code that supplements standard library decisions.
  193. -------------------------------------------------------------------------------------------------------------------
  194.  
  195. function job_get_spell_map(spell, default_spell_map)
  196.         if spell.action_type == 'Magic' then
  197.                 if spell.skill == 'Enfeebling Magic' then
  198.                         if spell.type == 'WhiteMagic' then
  199.                                 return 'MndEnfeebles'
  200.                         else
  201.                                 return 'IntEnfeebles'
  202.                         end
  203.                 elseif spell.skill == 'Geomancy' then
  204.                         if spell.english:startswith('Indi') then
  205.                                 return 'Indi'
  206.                         end
  207.                 end
  208.         end
  209. end
  210.  
  211. function customize_idle_set(idleSet)
  212.         if player.mpp < 51 then
  213.                 idleSet = set_combine(idleSet, sets.latent_refresh)
  214.         end
  215.         return idleSet
  216. end
  217.  
  218. -- Called by the 'update' self-command.
  219. function job_update(cmdParams, eventArgs)
  220.         classes.CustomIdleGroups:clear()
  221.         if player.indi then
  222.                 classes.CustomIdleGroups:append('Indi')
  223.         end
  224. end
  225.  
  226. -- Function to display the current relevant user state when doing an update.
  227. function display_current_job_state(eventArgs)
  228.         display_current_caster_state()
  229.         eventArgs.handled = true
  230. end
  231.  
  232. -------------------------------------------------------------------------------------------------------------------
  233. -- Utility functions specific to this job.
  234. -------------------------------------------------------------------------------------------------------------------
  235.  
  236. -- Select default macro book on initial load or subjob change.
  237. function select_default_macro_book()
  238.         set_macro_page(1, 3)
  239. end
  240.  
  241. function refine_nukes(spell, action, spellMap, eventArgs)
  242.         local nuke_mp_cost = {  ['Stone'] = 4, ['Stone II'] = 16, ['Stone III'] = 46, ['Stone IV'] = 88,                          ['Stone V'] = 135,                      ['Stone VI'] = 237,
  243.                                                         ['Water'] = 5, ['Water II'] = 19, ['Water III'] = 46, ['Water IV'] = 99,                          ['Water V'] = 175,                      ['Water VI'] = 266,
  244.                                                         ['Aero'] = 6, ['Aero II'] = 22, ['Aero III'] = 54, ['Aero IV'] = 115,                     ['Aero V'] = 198,                        ['Aero VI'] = 299,
  245.                                                         ['Fire'] = 7, ['Fire II'] = 26, ['Fire III'] = 63, ['Fire IV'] = 135,                     ['Fire V'] = 228,                        ['Fire VI'] = 339,
  246.                                                         ['Blizzard'] = 8, ['Blizzard II'] = 31, ['Blizzard III'] = 75, ['Blizzard IV'] = 162,  ['Blizzard V'] = 267,   ['Blizzard VI'] = 386,
  247.                                                         ['Thunder'] = 9, ['Thunder II'] = 37, ['Thunder III'] = 91, ['Thunder IV'] = 195,   ['Thunder V'] = 306,        ['Thunder VI'] = 437,
  248.                                                         ['Stonera'] = 54, ['Stonera II'] = 143, ['Stonera III'] = 276,
  249.                                                         ['Watera'] = 66, ['Watera II'] = 163, ['Watera III'] = 312,
  250.                                                         ['Aera'] = 79, ['Aera II'] = 184, ['Aera III'] = 350,
  251.                                                         ['Fira'] = 93, ['Fira II'] = 206, ['Fira III'] = 390,
  252.                                                         ['Blizzara'] = 108, ['Blizzara II'] = 229, ['Blizzara III'] = 432,
  253.                                                         ['Thundara'] = 123, ['Thundara II'] = 253, ['Thundara III'] = 476,}
  254.  
  255.         if spell.skill ~= 'Elemental Magic' or no_down:contains(spell.english) then
  256.                 return
  257.         end
  258.  
  259.         local elementType
  260.  
  261.         if spell.element == 'Earth' then elementType = 'Stone'
  262.         elseif spell.element == 'Water' then elementType = 'Water'
  263.         elseif spell.element == 'Wind' then elementType = 'Aero'
  264.         elseif spell.element == 'Fire' then elementType = 'Fire'
  265.         elseif spell.element == 'Ice' then elementType = 'Blizzard'
  266.         elseif spell.element == 'Lightning' then elementType = 'Thunder'
  267.         end
  268.  
  269.         local newAra
  270.  
  271.         if aras:contains(spell.english)then
  272.                 if elementType == 'Stone' then newAra = 'Stonera'
  273.                 elseif elementType == 'Water' then newAra = 'Watera'
  274.                 elseif elementType == 'Aero' then newAra = 'Aera'
  275.                 elseif elementType == 'Fire' then newAra = 'Fira'
  276.                 elseif elementType == 'Blizzard' then newAra = 'Blizzara'
  277.                 elseif elementType == 'Thunder' then newAra = 'Thundara'
  278.                 end
  279.         end
  280.  
  281.         local newNuke = spell.english
  282.  
  283.         local nukeMpCost = nuke_mp_cost[newNuke]
  284.  
  285.         if buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  286.                 nukeMpCost = math.floor(nukeMpCost * 0.9)
  287.         elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  288.                 nukeMpCost = math.ceil(nukeMpCost * 1.2)
  289.         end
  290.  
  291.         local downgrade
  292.  
  293.         -- Downgrade the spell to what we can actually afford
  294.         if player.mp < nukeMpCost and not buffactive['Mana Well'] then
  295.                 if spell.element == 'Earth' then
  296.                         if aras:contains(spell.english) then
  297.                                 if player.mp < 54 then
  298.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  299.                                         eventArgs.cancel = true
  300.                                         return
  301.                                 elseif player.mp < 143 then newNuke = ''..newAra..''
  302.                                 elseif player.mp < 276 then newNuke = ''..newAra..' II'
  303.                                 end
  304.                         elseif not aras:contains(spell.english) then
  305.                                 if player.mp < 4 then
  306.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  307.                                         eventArgs.cancel = true
  308.                                         return
  309.                                 elseif player.mp < 16 then newNuke = 'Stone'
  310.                                 elseif player.mp < 40 then newNuke = 'Stone II'
  311.                                 elseif player.mp < 88 then newNuke = 'Stone III'
  312.                                 elseif player.mp < 156 then newNuke = 'Stone IV'
  313.                                 elseif player.mp < 237 then newNuke = 'Stone V'
  314.                                 end
  315.                         end
  316.                 elseif spell.element == 'Water' then
  317.                         if aras:contains(spell.english) then
  318.                                 if player.mp < 66 then
  319.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  320.                                         eventArgs.cancel = true
  321.                                         return
  322.                                 elseif player.mp < 163 then newNuke = ''..newAra..''
  323.                                 elseif player.mp < 312 then newNuke = ''..newAra..' II'
  324.                                 end
  325.                         elseif not aras:contains(spell.english) then
  326.                                 if player.mp < 5 then
  327.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  328.                                         eventArgs.cancel = true
  329.                                         return
  330.                                 elseif player.mp < 19 then newNuke = 'Water'
  331.                                 elseif player.mp < 46 then newNuke = 'Water II'
  332.                                 elseif player.mp < 99 then newNuke = 'Water III'
  333.                                 elseif player.mp < 175 then newNuke = 'Water IV'
  334.                                 elseif player.mp < 266 then newNuke = 'Water V'
  335.                                 end
  336.                         end
  337.                 elseif spell.element == 'Wind' then
  338.                         if aras:contains(spell.english) then
  339.                                 if player.mp < 79 then
  340.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  341.                                         eventArgs.cancel = true
  342.                                         return
  343.                                 elseif player.mp < 184 then newNuke = ''..newAra..''
  344.                                 elseif player.mp < 350 then newNuke = ''..newAra..' II'
  345.                                 end
  346.                         elseif not aras:contains(spell.english) then
  347.                                 if player.mp < 6 then
  348.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  349.                                         eventArgs.cancel = true
  350.                                         return
  351.                                 elseif player.mp < 22 then newNuke = 'Aero'
  352.                                 elseif player.mp < 54 then newNuke = 'Aero II'
  353.                                 elseif player.mp < 115 then newNuke = 'Aero III'
  354.                                 elseif player.mp < 198 then newNuke = 'Aero IV'
  355.                                 elseif player.mp < 299 then newNuke = 'Aero V'
  356.                                 end
  357.                         end
  358.                 elseif spell.element == 'Fire' then
  359.                         if aras:contains(spell.english) then
  360.                                 if player.mp < 93 then
  361.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  362.                                         eventArgs.cancel = true
  363.                                         return
  364.                                 elseif player.mp < 206 then newNuke = ''..newAra..''
  365.                                 elseif player.mp < 390 then newNuke = ''..newAra..' II'
  366.                                 end
  367.                         elseif not aras:contains(spell.english) then
  368.                                 if player.mp < 7 then
  369.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  370.                                         eventArgs.cancel = true
  371.                                         return
  372.                                 elseif player.mp < 26 then newNuke = 'Fire'
  373.                                 elseif player.mp < 63 then newNuke = 'Fire II'
  374.                                 elseif player.mp < 135 then newNuke = 'Fire III'
  375.                                 elseif player.mp < 228 then newNuke = 'Fire IV'
  376.                                 elseif player.mp < 339 then newNuke = 'Fire V'
  377.                                 end
  378.                         end
  379.                 elseif spell.element == 'Ice' then
  380.                         if aras:contains(spell.english) then
  381.                                 if player.mp < 108 then
  382.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  383.                                         eventArgs.cancel = true
  384.                                         return
  385.                                 elseif player.mp < 229 then newNuke = ''..newAra..''
  386.                                 elseif player.mp < 432 then newNuke = ''..newAra..' II'
  387.                                 end
  388.                         elseif not aras:contains(spell.english) then
  389.                                 if player.mp < 8 then
  390.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  391.                                         eventArgs.cancel = true
  392.                                         return
  393.                                 elseif player.mp < 31 then newNuke = 'Blizzard'
  394.                                 elseif player.mp < 75 then newNuke = 'Blizzard II'
  395.                                 elseif player.mp < 162 then newNuke = 'Blizzard III'
  396.                                 elseif player.mp < 267 then newNuke = 'Blizzard IV'
  397.                                 elseif player.mp < 386 then newNuke = 'Blizzard V'
  398.                                 end
  399.                         end
  400.                 elseif spell.element == 'Lightning' then
  401.                         if aras:contains(spell.english) then
  402.                                 if player.mp < 123 then
  403.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  404.                                         eventArgs.cancel = true
  405.                                         return
  406.                                 elseif player.mp < 253 then newNuke = ''..newAra..''
  407.                                 elseif player.mp < 476 then newNuke = ''..newAra..' II'
  408.                                 end
  409.                         elseif not aras:contains(spell.english) then
  410.                                 if player.mp < 9 then
  411.                                         add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
  412.                                         eventArgs.cancel = true
  413.                                         return
  414.                                 elseif player.mp < 37 then newNuke = 'Thunder'
  415.                                 elseif player.mp < 91 then newNuke = 'Thunder II'
  416.                                 elseif player.mp < 195 then newNuke = 'Thunder III'
  417.                                 elseif player.mp < 306 then newNuke = 'Thunder IV'
  418.                                 elseif player.mp < 437 then newNuke = 'Thunder V'
  419.                                 end
  420.                         end
  421.                 end
  422.  
  423.                 downgrade = 'Insufficient MP ['..tostring(player.mp)..'] to cast '..spell.english..'. Changing spell to '..newNuke..'.'
  424.         end
  425.  
  426.         -- Downgrade the spell to what we can actually cast
  427.         local spell_recasts = windower.ffxi.get_spell_recasts()
  428.         if spell_recasts[spell.recast_id] > 0 then
  429.                 if t1:contains(spell.english) then
  430.                         add_to_chat(122, ''..spell.english..' is on cooldown. Cancelling.')
  431.                         eventArgs.cancel = true
  432.                         return
  433.                 elseif t2:contains(spell.english) then newNuke = ''..elementType..''
  434.                 elseif t3:contains(spell.english) then newNuke = ''..elementType..' II'
  435.                 elseif t4:contains(spell.english) then newNuke = ''..elementType..' III'
  436.                 elseif t5:contains(spell.english) then newNuke = ''..elementType..' IV'
  437.                 elseif t6:contains(spell.english) then newNuke = ''..elementType..' V'
  438.                 elseif ra2:contains(spell.english) then newNuke = ''..newAra..''
  439.                 elseif ra3:contains(spell.english) then newNuke = ''..newAra..' II'
  440.                 end
  441.  
  442.                 downgrade = '***'..spell.english..'*** is on cooldown. Downgrading spell to ***'..newNuke..'***.'
  443.         end
  444.  
  445.         if newNuke ~= spell.english then
  446.                 send_command('@input /ma "'..newNuke..'" '..tostring(spell.target.raw))
  447.                 if downgrade then
  448.                         add_to_chat(122, downgrade)
  449.                 end
  450.                 eventArgs.cancel = true
  451.                 return
  452.         end
  453. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement