valetine 4 Posted April 7, 2018 Share Posted April 7, 2018 I want to add Remove Lesser Curse to mage FightClass by Fight Class Editor. Which “ conditions” i need to ues? It seems impossible to add all the curses by the conditions:Buff And Check if any buff/debuff by type seems not work in vanilla. LuaScript: anyCurse = false; for i=1,40 do local name, rank, icon, count, debuffAuraType = UnitAura("player", i); if name and debuffAuraType and debuffAuraType == "Curse" then anyCurse = true; return; end end Return Value Research: true Return Value Var: anyCurse Link to comment Share on other sites More sharing options...
valetine 4 Posted April 8, 2018 Author Share Posted April 8, 2018 Can someone give me a suggestion? Link to comment Share on other sites More sharing options...
Droidz 2674 Posted April 8, 2018 Share Posted April 8, 2018 Hello, on Vanilla use http://vanilla-wow.wikia.com/wiki/API_UnitBuff or http://vanilla-wow.wikia.com/wiki/API_UnitDebuff (instead "UnitAura") Link to comment Share on other sites More sharing options...
valetine 4 Posted April 8, 2018 Author Share Posted April 8, 2018 2 hours ago, Droidz said: Hello, on Vanilla use http://vanilla-wow.wikia.com/wiki/API_UnitBuff or http://vanilla-wow.wikia.com/wiki/API_UnitDebuff (instead "UnitAura") Thanks for your help, I have replaced UnitAura with UnitDebuff,but still not work. Even if I try to replace debuffAuraType with debuffType, it is still not work. There is a debug message in the log: [D] 19:57:18 - [FightClass] Remove Lesser Curse - NeedToRun = false - condition debuffAuraType.xml debuffType.xml Link to comment Share on other sites More sharing options...
Droidz 2674 Posted April 8, 2018 Share Posted April 8, 2018 https://forum.elysium-project.org/topic/34281-getting-debufftype-out-of-unitdebuff/?do=findComment&comment=315238 Not tested: anyCurse = false; for i = 1, 16 do local debuffTexture, debuffApplications, debuffDispelType = UnitDebuff("player", i); if debuffDispelType and debuffDispelType == "Curse" then anyCurse = true; return; end end Link to comment Share on other sites More sharing options...
valetine 4 Posted April 8, 2018 Author Share Posted April 8, 2018 12 minutes ago, Droidz said: https://forum.elysium-project.org/topic/34281-getting-debufftype-out-of-unitdebuff/?do=findComment&comment=315238 Not tested: anyCurse = false; for i = 1, 16 do local debuffTexture, debuffApplications, debuffDispelType = UnitDebuff("player", i); if debuffDispelType and debuffDispelType == "Curse" then anyCurse = true; return; end end Thanks,but......still not work. Same debug message in the log: [D] 20:37:37 - [FightClass] Remove Lesser Curse - NeedToRun = false - condition [D] 20:37:37 - [FightClass] Remove Lesser Curse - NeedToRun time to execute: 31 debuffApplications.xml Link to comment Share on other sites More sharing options...
valetine 4 Posted April 9, 2018 Author Share Posted April 9, 2018 @Droidz Hello,Can i get more help? Use the following macro in the game can get a message ‘Curse’ ,Why in Wrobot conditions can not work? /run for i = 1, 16 do local debuffTexture, debuffApplications, debuffDispelType = UnitDebuff("player", i); if debuffDispelType then DEFAULT_CHAT_FRAME:AddMessage(debuffDispelType); end end And How to detect debuff Type also not work in vanilla. Link to comment Share on other sites More sharing options...
valetine 4 Posted April 11, 2018 Author Share Posted April 11, 2018 Still no any idea..... Link to comment Share on other sites More sharing options...
a11ister 0 Posted September 6, 2018 Share Posted September 6, 2018 Hey, wanted to ask, did you find solution ? Link to comment Share on other sites More sharing options...
Matenia 602 Posted September 6, 2018 Share Posted September 6, 2018 Droidz solution works, you just need to add the condition properly. I use this: hasDebuff = false; for i=1,40 do local texture, count, debuffType = UnitDebuff("player", i); if debuffType == "Poison" then hasDebuff = true break; end end Link to comment Share on other sites More sharing options...
Randy 0 Posted September 24, 2018 Share Posted September 24, 2018 On 9/6/2018 at 9:21 AM, Matenia said: Droidz solution works, you just need to add the condition properly. I use this: hasDebuff = false; for i=1,40 do local texture, count, debuffType = UnitDebuff("player", i); if debuffType == "Poison" then hasDebuff = true break; end end I'm a bit of a noob so please have patience. I'm using C# for my fightclass which is a modification of a free one. How would I go about accomplishing this same thing but in a C# fightclass? I want my pala FC to be able to use dispels for poisons/diseases. Does anyone have a similar snippet for C#? Link to comment Share on other sites More sharing options...
Matenia 602 Posted September 24, 2018 Share Posted September 24, 2018 You wrap that code I gave you in Lua.LuaDoString<bool>("codeHere", "hasDebuff") and if that evaluates to true - there you go Link to comment Share on other sites More sharing options...
Randy 0 Posted September 24, 2018 Share Posted September 24, 2018 Oh sweet, I figured there was a LUA wrapper of some kind. Thanks! Link to comment 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