Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DK FightClass Runes

Featured Replies

Hello,

i try to create a fight class for dk on 3.3.5a and i have problems with the rune-related conditions. Rune X Ready Count and Rune Ready Slot X (i assume the Slot nr from GetRuneType?) doesn't work at al, Rune Power works though. I tried to solve it with a Lua-Condition with following code i've found on the internet:

RuneCheck = nil
function RuneCheck()
	local FrostRune = 0
	local UnholyRune = 0
	local BloodRune = 0
	local DeathRune = 0
	
	for i=1, 6 do
		if GetRuneType(i) == 1 and select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() < 1
			then BloodRune + 1 end
		if GetRuneType(i) == 2 and select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() < 1
			then UnholyRune + 1 end
		if GetRuneType(i) == 3 and select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() < 1
			then FrostRune + 1 end
		if GetRuneType(i) == 4 and select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() < 1
			then DeathRune + 1 end
	end
	return BloodRune, UnholyRune, FrostRune, DeathRune
end

local RuneCheck = RuneCheck

-- Obliterate if both Unholy Runes are ready or ready within 1 second
if select(2,RuneCheck()) > 1 then return true end

i have some coding skills but not in lua, what is the return value var in this case?

Regards

There are already two Death Knight FightClasses you can try out: 

http://wrobot.eu/files/file/642-335a-blood-dk-lvling/ 

http://wrobot.eu/files/file/610-335a-frost-dk-dps/

 

But here's some explanation of the code

for i=1, 6 do

This for loop goes through every rune slot number, starting from 1.

if GetRuneType(i) == 1 and select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() < 1

Calls the GetRuneType (http://wowprogramming.com/docs/api/GetRuneType) method, with a value of 1-6 (this is the rune slot ID), and checks if the function returns 1 (which is a blood rune). 

select(1,GetRuneCooldown(i)) - (http://wowprogramming.com/docs/api/GetRuneCooldown) selects the start time of the cooldown

select(2,GetRuneCooldown(i)) - selects the duration of the cooldown.

 

if select(2,RuneCheck()) > 1 then return true end

checks the second parameter returned by RuneCheck() which is Unholy runes, while the first would be blood, 3rd would be frost, 4th would be Death runes.

Greater than one means that there has to be 2 unholy runes. It's the same as == 2. 

  • Author

I had to do a little debug but finally i got it, the existing dk profiles from 3.3.5 are very shitty by the way or they dont work properly in my case.

Here's the code for checking if two unholy runes are ready:

 

RuneCheck = nil

function RuneCheck()
   local FrostRune = 0
   local UnholyRune = 0
   local BloodRune = 0
   local DeathRune = 0
   
   for i=1, 6 do
   
      if GetRuneType(i) == 1 and select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() < 1
      then BloodRune = BloodRune + 1 end
      if GetRuneType(i) == 2 and select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() < 1
      then UnholyRune = UnholyRune + 1 end
      if GetRuneType(i) == 3 and select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() < 1
      then FrostRune = FrostRune + 1 end
      if GetRuneType(i) == 4 and select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() < 1
      then DeathRune = DeathRune + 1 end
   end
   return BloodRune, UnholyRune, FrostRune, DeathRune
end

local RuneCheck = RuneCheck
local UnholyRunesReady = false;
-- Obliterate if both Unholy Runes are ready or ready within 1 second
if select(2,RuneCheck()) > 1 then UnholyRunesReady = true else UnholyRunesReady = false end

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.