January 17, 20215 yr Hi there, I'm new to fight class editing, so excuse my level of knowledge. I'm designing a feral druid combat rotation for 3.3.5, and wondering if there was anyway to refresh Savage Roar "x" amount of seconds before expiring / or if it has fully expired? (I've managed to do the latter, but would obviously need the contingency if the event of it expiring. Fight Classes Attached. P.S If there is any code to be used, I would prefer it in C format, however if Lua is the only way to achieve so, either is great. Many thanks in advance. Feral DPS.xml
January 18, 20215 yr I could be wrong and don't have the app in front of me to check, but I was thinking there was a "buff time remaining" or something similar as an option in the fight class creator.
January 19, 20215 yr I almost exclusively work on TBC but I think this should work in WotLK too: // Returns the time left on a buff in seconds, buff name is passed as string public static int BuffTimeLeft(string buffName) { return Lua.LuaDoString<int> ($"for i=1,25 do " + "local n, _, _, _, _, duration, _ = UnitBuff('player',i); " + "if n == '" + buffName + "' then " + "return duration " + "end " + "end"); }
January 19, 20215 yr @Zer0 i dont believe people can use Csharp functions in fighclass editor. but yes, you code will work for wotlk. This is lua code. (Tested) works good. Change the timer and Combo Points amount with whatever you choose. local RS, _, _, _, _, _, timer = UnitBuff("player", "Savage Roar"); if (not RS or RS and timer - GetTime() <= 3) and GetComboPoints("player", "target") >= 2 then CastSpellByName("Savage Roar"); end Update file. Feral DPS.xml Edited January 19, 20215 yr by TheSmokie
January 20, 20215 yr Author @Zer0 and @TheSmokie Thank you both, incredibly helpful! I'll have to learn Lua myself at some point.
January 20, 20215 yr Author @Koalemos23 I had tried this, but the function didn't seem to work properly when I tried, it would still wait for the buff to expire. - Not sure if I was doing something incorrectly though.
Create an account or sign in to comment