Syelas 0 Posted January 17, 2021 Share Posted January 17, 2021 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 Link to comment https://wrobot.eu/forums/topic/12785-refresh-savage-roar-before-it-expires/ Share on other sites More sharing options...
Koalemos23 0 Posted January 18, 2021 Share Posted January 18, 2021 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. Link to comment https://wrobot.eu/forums/topic/12785-refresh-savage-roar-before-it-expires/#findComment-61031 Share on other sites More sharing options...
Zer0 148 Posted January 19, 2021 Share Posted January 19, 2021 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"); } Link to comment https://wrobot.eu/forums/topic/12785-refresh-savage-roar-before-it-expires/#findComment-61033 Share on other sites More sharing options...
TheSmokie 242 Posted January 19, 2021 Share Posted January 19, 2021 (edited) @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, 2021 by TheSmokie Link to comment https://wrobot.eu/forums/topic/12785-refresh-savage-roar-before-it-expires/#findComment-61034 Share on other sites More sharing options...
Syelas 0 Posted January 20, 2021 Author Share Posted January 20, 2021 @Zer0 and @TheSmokie Thank you both, incredibly helpful! I'll have to learn Lua myself at some point. Link to comment https://wrobot.eu/forums/topic/12785-refresh-savage-roar-before-it-expires/#findComment-61052 Share on other sites More sharing options...
Syelas 0 Posted January 20, 2021 Author Share Posted January 20, 2021 @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. Link to comment https://wrobot.eu/forums/topic/12785-refresh-savage-roar-before-it-expires/#findComment-61053 Share on other sites More sharing options...
WanderingStar 0 Posted June 20, 2023 Share Posted June 20, 2023 bump Link to comment https://wrobot.eu/forums/topic/12785-refresh-savage-roar-before-it-expires/#findComment-68420 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now