• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Need help with invulnerable/vulnerable

Status
Not open for further replies.
Level 3
Joined
Sep 26, 2012
Messages
39
Hey guys, I'm trying to make a trigger that will make a certain unit invulnerable for a spell duration. Let's say A casts spell X on B, then B is invulnerable only for the spell duration. I've read tutorials on here and I can't figure it out. The unit remains invulnerable and I can only cast it once, after that, the invulnerability doesn't affect other units even tho I'm recasting the spell. The spell is hurl boulder, I set the stun to 5 seconds and I'd like to turn that unit invul for 5 seconds basically. I'm really not good at this and I don't expect anyone to waste his time to help me out, but if you have a tiny second it'd be much appreciated.

Also, does anybody know what the best ability is to replace locust on roc since roc does not have locust?

Thanks ;)
 
Level 3
Joined
Apr 21, 2012
Messages
33
I think triggering you spell will solve that. like this:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YourAbility
    • Actions
      • Unit - Make (Target unit of ability being cast) Invulnerable
      • Wait 5.00 game-time seconds
      • Unit - Make (Target unit of ability being cast) Vulnerable
You can also change wait to timer or like that, and also change the time to rely on your spell's level and etc. However this is just an simple example.
Hope this help, and if you don't understand just ask ;)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I think triggering you spell will solve that. like this:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YourAbility
    • Actions
      • Unit - Make (Target unit of ability being cast) Invulnerable
      • Wait 5.00 game-time seconds
      • Unit - Make (Target unit of ability being cast) Vulnerable
You can also change wait to timer or like that, and also change the time to rely on your spell's level and etc. However this is just an simple example.
Hope this help, and if you don't understand just ask ;)
This will never work: "Target unit of ability being cast" is erased after any wait (it can only be accessed at the exact same moment a spell is cast, even a 0.00 second wait will make it fail).
To solve this, you can use a unit variable (only if your spell cannot be cast more than once every 5 seconds, otherwise it will still fail because it wouldn't be MUI).

But you implied that you already had a trigger for this, but it didn't work? If it is indeed a trigger you need help with, you're better off showing the trigger so we can find the error.

Also, does anybody know what the best ability is to replace locust on roc since roc does not have locust?
No idea. I think locust is a one-of-a-kind ability to be honest.
The "Ward" classification removes all command buttons, but it still shows the health bar and you're able to select / command the unit.
 
Level 3
Joined
Sep 26, 2012
Messages
39
Ah, thank you guys for replying. Yeah I suspected the wait time erased the ''target unit of ability being cast'', but I didn't know for sure. I had the same trigger than Galdr told me to try. Ok I'll try setting a variable right now. Thanks alot

Hmm this seems to be more complicated than I thought, how would you set up the variable? Ability will have a relatively long cooldown, most likely around 30-40 seconds.

Edit: I still havn't found out how to do this properly, if anybody cares to help it would be greatly appreciated.
 
Last edited:
Level 3
Joined
Apr 21, 2012
Messages
33
Oh yes, I forget to mention that the wait will erase the target unit.
Ap0calypse was right, you will need to set it into variable. I'm in school now, if you can't figure it out then wait until I got home and I will try to help.
 
Status
Not open for further replies.
Top