Fabolous1 8 Posted July 8, 2014 Share Posted July 8, 2014 How can I check if a player has a specific debuff, for example I am interating through wowplayers that are friendly and want to check if user has "Curse of Weakness" for example, how would I do that? Link to comment https://wrobot.eu/forums/topic/1488-check-wow-unit-or-wow-player-for-debuff/ Share on other sites More sharing options...
Droidz 2738 Posted July 8, 2014 Share Posted July 8, 2014 Hello, In the FightClass? If yes: Add condition at yout spell "Target Buff" like this: Link to comment https://wrobot.eu/forums/topic/1488-check-wow-unit-or-wow-player-for-debuff/#findComment-7741 Share on other sites More sharing options...
Fabolous1 8 Posted July 8, 2014 Author Share Posted July 8, 2014 I'm trying to do it in a plugin I am working on I was messing with a lot of things but none of em worked to find players debuffs, I have foreach(WoWPlayer Player in ObjectManager.ObjectList) { // Friendly, InLineOfSight, HasDebuff if (Player.Reaction == Reaction.Friendly) { Logging.Write("[MyPlugin] Player Name: " + Player.Name); //LuaEventsId.UNIT_AURA } } to interate through characters, haven't fully tested it yet if WoWPlayer is all players near character or if its only localplayer and if it is I will change that to wowunit. How would I run a whole lua function or use the libraries to return all of the debuffs a player has Link to comment https://wrobot.eu/forums/topic/1488-check-wow-unit-or-wow-player-for-debuff/#findComment-7742 Share on other sites More sharing options...
Fabolous1 8 Posted July 9, 2014 Author Share Posted July 9, 2014 Anybody able to help? Link to comment https://wrobot.eu/forums/topic/1488-check-wow-unit-or-wow-player-for-debuff/#findComment-7749 Share on other sites More sharing options...
Droidz 2738 Posted July 10, 2014 Share Posted July 10, 2014 Hello, try this: List<WoWPlayer> playerList = ObjectManager.GetObjectWoWPlayer(); string debuffName = "SpellNameInEnglish"; foreach (var player in playerList) { if (player.IsValid && ObjectManager.Me.PlayerFaction == player.PlayerFaction) { if (player.HaveBuff(debuffName)) Logging.Write("[MyPlugin] Player " + player.Name + " have debuff " + debuffName); } } AudreyH 1 Link to comment https://wrobot.eu/forums/topic/1488-check-wow-unit-or-wow-player-for-debuff/#findComment-7754 Share on other sites More sharing options...
Fabolous1 8 Posted July 10, 2014 Author Share Posted July 10, 2014 Much appreciated, thanks Droidz. Link to comment https://wrobot.eu/forums/topic/1488-check-wow-unit-or-wow-player-for-debuff/#findComment-7759 Share on other sites More sharing options...
Droidz 2738 Posted July 11, 2014 Share Posted July 11, 2014 For get player role for the moment you can use lua: http://wowprogramming.com/docs/api/UnitGetAvailableRoles In the next version I have added "AvailableRoles" function, you can use it like: List<WoWPlayer> playerList = ObjectManager.GetObjectWoWPlayer(); bool canTank, canHealer, canDps; string debuffName = "SpellNameInEnglish"; foreach (var player in playerList) { if (player.IsValid && ObjectManager.Me.PlayerFaction == player.PlayerFaction) { player.AvailableRoles(out canTank, out canHealer, out canDps); Logging.Write("[MyPlugin] Player " + player.Name + " canTank: " + canTank + ", canHealer: " + canHealer + ", canDps: " + canDps); if (player.HaveBuff(debuffName)) Logging.Write("[MyPlugin] Player " + player.Name + " have debuff " + debuffName); } } AudreyH 1 Link to comment https://wrobot.eu/forums/topic/1488-check-wow-unit-or-wow-player-for-debuff/#findComment-7763 Share on other sites More sharing options...
Droidz 2738 Posted July 11, 2014 Share Posted July 11, 2014 ps: If you want get group players you can use this code: List<WoWPlayer> playerList = Party.GetParty(); foreach (var player in playerList) { // ... } Link to comment https://wrobot.eu/forums/topic/1488-check-wow-unit-or-wow-player-for-debuff/#findComment-7764 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