Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.30 KB | None | 0 0
  1. function(fury_warrior)
  2.    
  3.     -- Fury Warrior One Target
  4.     local fury_fury_warrior = "ww3 rp bt rb2 rb1 ww1 ww2"
  5.    
  6.     -- Globale Warteschlangen Tabelle leeren
  7.     WA_qtable_fury_warrior = {}
  8.    
  9.     -- Prioritäts Tabelle löschen
  10.     local prio_table = {}
  11.    
  12.     -- Reset Status Vars
  13.     WA_rage = 0
  14.     WA_er = 0
  15.     WA_bc = 0
  16.     WA_ww = 0
  17.    
  18.     -- Get SpellName
  19.     local BC_N = GetSpellInfo(1719) -- Battle Cry
  20.     local MC_N = GetSpellInfo(85739) -- Meat Cleaver
  21.    
  22.     local BT_N = GetSpellInfo(23881)    -- Bloodthirst CD
  23.     local BT_startTime, BT_duration=GetSpellCooldown(BT_N)
  24.     local BT_CD = (BT_startTime + BT_duration) -  GetTime()
  25.    
  26.     local RB_N = GetSpellInfo(85288)    -- Raging Blow CD
  27.     local RB_startTime, RB_duration=GetSpellCooldown(RB_N)
  28.     local RB_CD = (RB_startTime + RB_duration) -  GetTime()
  29.    
  30.     local RB_S = select(1,GetSpellCharges("Raging Blow"))    -- Raging Blow Charges
  31.    
  32.     local WA_rage = UnitPower("player", SPELL_POWER_RAGE) -- Rage
  33.    
  34.     local WA_gcd = 1.5/(UnitSpellHaste("player")*0.01+1) -- Calculate GCD
  35.     if WA_gcd <= 0.75 then  WA_gcd = 0.75 end  -- GCD if haste over 100%
  36.    
  37.     local count, spellID, _
  38.     for i = 1, 40 do
  39.         _, _, count, _, _, _, spellID = UnitAura("player", i, "HELPFUL|PLAYER")
  40.         if not spellID then
  41.             break
  42.         elseif spellID == 85739 then
  43.             WA_ww = count
  44.             break
  45.         end
  46.     end
  47.  
  48.  
  49.     -- Prio Liste in Tabelle schreiben
  50.     for v in string.gmatch(fury_fury_warrior, "[^ ]+") do
  51.         table.insert(prio_table, v)
  52.     end
  53.    
  54.     if prio_table[1] ~= nil then
  55.        
  56.         local s_max = #prio_table  -- Count All Steps
  57.        
  58.        
  59.         for i = 1, s_max do -- Get Priority List
  60.            
  61.             --------------------------- Fury Warrior Non Execute Rotation --------------------------    
  62.              -- Testing WA_ww count
  63.             if prio_table[i] == "ww3" then
  64.                 local spell_name = GetSpellInfo(190411)
  65.                 if WA_ww == 2 then
  66.                     table.insert(WA_qtable_fury_warrior, spell_name)
  67.                 end                
  68.             end
  69.            
  70.             -- Rampage          
  71.             if prio_table[i] == "rp" then
  72.                 local spell_name = GetSpellInfo(184367)
  73.                 if WA_rage >= 95 then
  74.                     table.insert(WA_qtable_fury_warrior, spell_name)
  75.                 end                
  76.             end
  77.            
  78.             -- Bloodthirst        
  79.             if prio_table[i] == "bt" then
  80.                 local spell_name = GetSpellInfo(23881)
  81.                 if BT_CD < WA_gcd then
  82.                     table.insert(WA_qtable_fury_warrior, spell_name)
  83.                 end                
  84.             end
  85.            
  86.             -- Raging Blow 1    
  87.             if prio_table[i] == "rb1" then
  88.                 local spell_name = GetSpellInfo(85288)
  89.                 if RB_CD < WA_gcd then
  90.                     table.insert(WA_qtable_fury_warrior, spell_name)
  91.                 end                
  92.             end
  93.            
  94.             -- Raging Blow 2    
  95.             if prio_table[i] == "rb2" then
  96.                 local spell_name = GetSpellInfo(85288)
  97.                 if RB_S == 2 then
  98.                     table.insert(WA_qtable_fury_warrior, 46917)
  99.                 end                
  100.             end
  101.            
  102.             -- Whirlwind 1
  103.             if prio_table[i] == "ww1" then
  104.                 local spell_name = GetSpellInfo(190411)
  105.                 if WA_rage >= 0 then
  106.                     table.insert(WA_qtable_fury_warrior, spell_name)
  107.                 end                
  108.             end
  109.            
  110.             -- Whirlwind 2
  111.             if prio_table[i] == "ww2" then
  112.                 local spell_name = GetSpellInfo(190411)
  113.                 if WA_rage >= 0 then
  114.                     table.insert(WA_qtable_fury_warrior, spell_name)
  115.                 end                
  116.             end    
  117.             --------------------------- Fury Warrior Execute Rotation --------------------------    
  118.            
  119.            
  120.         end
  121.     end
  122.    
  123.     -- Show/Hide Aura
  124.     if (UnitCanAttack("player","target")) == true then
  125.        
  126.        
  127.         return true
  128.     end
  129.     if (UnitCanAttack("player","target")) == nil then
  130.         return false
  131.     end
  132.    
  133. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement