Invisibility Check

Aniconic

I am the very model of a modern major general!
Reaction score
3
Hey there everyone,

I'm currently working on a hero with the following abilities:

Smoke Bomb - Teleports the Ninja a short distance and makes him invisible for 5/6/7 seconds, allowing him to move in and out of combat.

Keen Eye - Gives the Ninja's Melee Attacks a 15/20/25% chance to deal 2 times normal melee damage.

Vital Stab - Gives the Ninja's next melee attack a 6 times damage boost. If the ninja is breaking from Smoke Bomb's invisibility, the multiplier is increased to 7 times normal damage.
Stacks with Keen Eye.

I have all of the abilities working pretty well using GDD damage detection, however, I have a problem with Vital Stab, I'd like to check to see if the melee attack that sparked the trigger for vital stab was the melee attack that removed the hero's stealth buff, but it appears as though the buff is removed before the damage is detected, so I can't change the multiplier from 6 to 7.

The invisibility buff is given to the hero via a dummy unit that spawns, is given a custom single target invisibility ability, and casts it on the hero.

Vital stab is a channel dummy ability that causes another dummy unit to spawn and give the player a similar buff that doesn't do anything. it's mostly just a flag.

Any suggestions as to how I might be able to detect if the player is invisible when the ability is triggered?

Thanks!
 

vypur85

Hibernate
Reaction score
803
Use 'A unit is attacked' event.

When the unit attacks and has buff, add the unit to a unitgroup. Then wait for 1 second, and remove the unit from the unitgroup. Don't think the unit can manage to attack more than once within the 1 second duration.

Then in your damage trigger, check if the unit is in the unitgroup or not. If it is, deal extra damage, else do less damage.
 

Aniconic

I am the very model of a modern major general!
Reaction score
3
Hey there Vypur, Thanks for the prompt reply.

That's a similar solution to the problem I was coming up with, but the problem seems to be that the buff is removed before the actual attack, meaning this condition:

((Attacking unit) has buff Invisibility) Equal to True

Returns false by the time the event fires and initiates the condition check. As a result, the hero isn't added to the unit group, ect.

What I'd love to find is some kind of event that checks when a unit loses the invisibility buff, then adds the unit to the unit group you suggested for a second, unfortunately, I don't see an event like that.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
There is a hard way around which is very error prone and not recommended by me but might still solve your problem:
When the unit uses his ability to gain invisibility add him to the unit group.
Then you have to remove the unit manually when:
- it dies
- it attacks anything
- gets attacked by anything
- uses any ability
- uses any item
- ...

You can hopefully see what the great problem to that would be, but it will definitely work.
 

Aniconic

I am the very model of a modern major general!
Reaction score
3
Thanks again for the replies guys.

I see what you mean vypur, but I am having trouble getting wind walk onto the unit. Is there a single target spell that I can use to apply the buff to the hero via a dummy unit? I am still a little new at ability creation...

EDIT: Nevermind! I figured it out. Instead of getting it to work with a dummy unit single target, I decided to have the ability added to the hero directly when smoke bomb procs, then have it removed.

Thanks a lot guys, I really appreciate it the points in the right direction! Ability works great now! if I have any other questions related to this hero, I'll be sure to post in here. I still have one more ability that will be stack-able with Smoke bomb to make! Hopefully I will be able to figure it out on my own. :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top