Jump to content
This site uses cookies! Learn More

This site uses cookies!

By continuing to use this site, you agree to allow us to store cookies on your computer. :)

Droidz

Snippets C# codes for Fight Classes

Recommended Posts

Check if character/target have or not buff/debuff by spell id:

Use condition type "C Sharp Code" with Value:

wManager.Wow.ObjectManager.ObjectManager.Me.HaveBuff(69369)
  • Replace "69369" by your buff/debuff ID.
  • Replace "Me" by "Target" to check buff/debuff on current target (you can also replace "Me" by "Pet" to check on the pet).
  • Add "!" before this code to check if not have (de)buff ( http://www.tutorialspoint.com/csharp/csharp_logical_operators.htm ).
  • To get list of player/target (de)buff id, you can go to tab "Tools" > "Development Tools" > (if you want check your target (de)buff select npc in game) > click on "Player/target buff/debuff".

Share this post


Link to post
Share on other sites

Check if character/target buff/debuff stack count by spell id:

Use condition type "C Sharp Code" with Value:

wManager.Wow.ObjectManager.ObjectManager.Me.BuffStack(44544) >= 1
  • Replace "44544" by your buff/debuff ID.
  • Replace "Me" by "Target" to check buff/debuff on current target (you can also replace "Me" by "Pet" to check on the pet).
  • ">= 1" check if stack count is "Bigger or Equal at 1", you can replace "1" by required stack count. You can also replace ">=" by "<=" to check if "Smaller or Equal", or by "==" to check if "Equal" - http://www.tutorialspoint.com/csharp/csharp_relational_operators.htm ).
  • To get list of player/target (de)buff id, you can go to tab "Tools" > "Development Tools" > (if you want check your target (de)buff select npc in game) > click on "Player/target buff/debuff".

Share this post


Link to post
Share on other sites

Check character/target buff/debuff time left by spell id:

Use condition type "C Sharp Code" with Value:

wManager.Wow.ObjectManager.ObjectManager.Me.BuffTimeLeft(new List<uint> { 69369 }) >= 1000
  • Replace "69369" by your buff/debuff ID.
  • Replace "Me" by "Target" to check buff/debuff on current target (you can also replace "Me" by "Pet" to check on the pet).
  • ">= 1000" check if time left is "Bigger or Equal at 1000 millisecond", you can replace "1000" by required time left in millisacond. You can also replace ">=" by "<=" to check if "Smaller or Equal", or by "==" to check if "Equal" - http://www.tutorialspoint.com/csharp/csharp_relational_operators.htm ).
  • To get list of player/target (de)buff id, you can go to tab "Tools" > "Development Tools" > (if you want check your target (de)buff select npc in game) > click on "Player/target buff/debuff".

Share this post


Link to post
Share on other sites
On 8/7/2016 at 12:30 PM, Droidz said:

Check character/target buff/debuff time left by spell id:

Use condition type "C Sharp Code" with Value:

wManager.Wow.ObjectManager.ObjectManager.Me.BuffTimeLeft(new List<uint> { 69369 }) >= 1000
  • Replace "69369" by your buff/debuff ID.
  • Replace "Me" by "Target" to check buff/debuff on current target (you can also replace "Me" by "Pet" to check on the pet).
  • ">= 1000" check if time left is "Bigger or Equal at 1000 millisecond", you can replace "1000" by required time left in millisacond. You can also replace ">=" by "<=" to check if "Smaller or Equal", or by "==" to check if "Equal" - http://www.tutorialspoint.com/csharp/csharp_relational_operators.htm ).
  • To get list of player/target (de)buff id, you can go to tab "Tools" > "Development Tools" > (if you want check your target (de)buff select npc in game) > click on "Player/target buff/debuff".

If I use this, the time left is always zero. The development Tools output also shows:

PLAYER Buff/Debuff:

Retribution Aura: ID=7294, Stack=1, TimeLeft=0 ms, Owner=0
Blessing of Might: ID=19834, Stack=1, TimeLeft=0 ms, Owner=0
Seal of the Crusader: ID=20162, Stack=1, TimeLeft=0 ms, Owner=0

Share this post


Link to post
Share on other sites
3 hours ago, DrSeltsam said:

If I use this, the time left is always zero. The development Tools output also shows:

PLAYER Buff/Debuff:

Retribution Aura: ID=7294, Stack=1, TimeLeft=0 ms, Owner=0
Blessing of Might: ID=19834, Stack=1, TimeLeft=0 ms, Owner=0
Seal of the Crusader: ID=20162, Stack=1, TimeLeft=0 ms, Owner=0

Funny I recently came back after a couple of months off and had to remove the TimeLeft check in my cc because it would always be 0. Thought the bug was on my side. Using vanilla.

Share this post


Link to post
Share on other sites
13 hours ago, pasdoy said:

Funny I recently came back after a couple of months off and had to remove the TimeLeft check in my cc because it would always be 0. Thought the bug was on my side. Using vanilla.

I am using Vanilla too.

Share this post


Link to post
Share on other sites

... vanilla doesn't have a timer on buffs/debuffs, with the exception of your own. But they don't fall under the regular aura API so you have to use Lua to get specific timers.

Share this post


Link to post
Share on other sites
1 hour ago, someshit said:

need to calculate number of opponents within 8 yards of current target. any tips?

if(ObjectManager.GetWoWUnitAttackables().Any(x=> x.Position.DistanceTo(ObjectManager.Me.Position) < 20))
{
    MovementManager.StopMove();
    Fight.StartFight(ObjectManager.GetWoWUnitAttackables().OrderBy(x => x.Position.DistanceTo(ObjectManager.Me.Position)).FirstOrDefault().Guid);
}

 

Share this post


Link to post
Share on other sites
5 minutes ago, someshit said:

so,

if(ObjectManager.GetWoWUnitAttackables().Any(x=> x.Position.DistanceTo(ObjectManager.Target.Position) <= 8 ))

should work?

Yeah

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...