Shadowstep only active when unit is in stealth mode

weisdewad

New Member
Reaction score
0
Hello,

I am making a CTF-style map. There will be a rogue typed hero in the map with a spell called shadowstep (WOW-Rogue-like), in which the unit is moved to the targeted unit, and stunning and attacking it. My spell works great, but now i would like to make it usable only when my Rogue is in Stealth mode and also, if my hero learns the spell and is stealthed, then learn the spell in active mode, and if he isnt stealthed then learn it inactivated.

For stealth mode i have used the following triggers (Stealth_Invisibility equals "ghost ability" used by ud shades)
Trigger:
  • StealthOn
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Stealth
    • Actions
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
      • Sound - Play StealthOn <gen> at 100.00% volume, attached to (Triggering unit)
      • Unit - Add Stealth_Invisibility to (Triggering unit)
      • Unit - Set (Triggering unit) movement speed to (Default movement speed of StealthDummy 0016 <gen>)
      • Hero - Drop (Item carried by (Triggering unit) of type FlagType1) from (Triggering unit)
      • Hero - Drop (Item carried by (Triggering unit) of type FlagType2) from (Triggering unit)
      • Wait 0.10 seconds
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on StealthOff <gen>

Trigger:
  • StealthOff
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Stealth
    • Actions
      • Sound - Play StealthOn <gen> at 100.00% volume, attached to (Triggering unit)
      • Unit - Remove Stealth_Invisibility from (Triggering unit)
      • Unit - Set (Triggering unit) movement speed to (Default movement speed of (Triggering unit))
      • Wait 0.10 seconds
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on StealthOn <gen>

Shadowstep:
Trigger:
  • Shadowstep
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Shadowstep
    • Actions
      • Set ShadowstepStunned = (Target unit of ability being cast)
      • Set ShadowstepLastPos = (Position of (Triggering unit))
      • Unit - Create 1 StepDummyAttack for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Target point of ability being cast)
      • Set ShadowstepStunner = (Last created unit)
      • Unit - Order ShadowstepStunner to Attack ShadowstepStunned
      • Unit - Add a 1.00 second Generic expiration timer to ShadowstepStunner
      • Special Effect - Create a special effect at ShadowstepLastPos using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Create a special effect at ShadowstepLastPos using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Unit - Move (Triggering unit) instantly to (Position of ShadowstepStunned)
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Unit - Order (Triggering unit) to Attack ShadowstepStunned
      • Custom script: call RemoveLocation (udg_ShadowstepLastPos)


One possible solution which i dont like so much is to build in a condition like: if unit is invisible then use spell, else do nothing..... but by that, the unit would have to get in range of the target to make the player recognize he cant use the spell right now..... very annoying.

thanks in advance for your help,
weisdewad
 

theDTD

Active Member
Reaction score
8
>how about a (boolean) variable
>if (stealth) is on set (boolean) to true, otherwise set it to false
>then in your (shadowstep) trigger
>add this in your first line
*if (boolean) = false then skip remaining actions
 

Joccaren

You can change this now in User CP.
Reaction score
54
Welcome to the Helper!!!

If your ability gives a buff, you can just check for the buff (Boolean Comparisson-Unit-Unit has buff)
Otherwise, do what theDTD said: Make a boolean variable, set it to true when the unit casts your ability, set it to false when your unit deactivates your ability and add 'YourBoolean is equal to True' in your conditions :)
 

weisdewad

New Member
Reaction score
0
i already had the same idea about the boolean, but this would cause a lot of problems when there are more than 1 rogue in the game..... i already tried to use "set custom value of unit to x" for

0=shadowstep is not learned
1=stealth is on -->add ability stealth
2=stealth is off -->remove ability stealth add stealth_off (a passive spell that does nothing)

kinda like that.... but somehow it never worked as i wanted :/

then i tried the buff thingie, added "Stats- Buff: Invisibility" and added a boolean condition checking if unit has the buff "invisibility" but somehow neither worked.... then i got crazy about it and posted my thread.

maybe i will try those two possibilities later again :/
anyone with a totally new idea..... something like NE bearform, with a alternate unit that has the exact same level as the normal unit apart of the shadowstep aswell.... but i could not figure out how to trigger that. damn.... this one's really tricky...
 

Joccaren

You can change this now in User CP.
Reaction score
54
No triggers needed. Just create your normal rogue, copy it, paste it, add a editor suffix of 'cloaked', add 'permanent invisibility' to your new unit, Then just edit bear form. Level, items ect. are kept the same beween forms when using this spell
 

weisdewad

New Member
Reaction score
0
horray!!! thanks man, i will try that later today.... if it works that way, you'll have made my day!
 

Avaleirra

Is back. Probably.
Reaction score
128
/offtopic


Lol I'm using almost the same spell in my map :p just only no stun


EDIT: and it's sortof a CTF :p
 

weisdewad

New Member
Reaction score
0
well, i started to play around with a modified bearform ability and came as far as the following:

i created a shadowstep (stealthed) and shadowstep (not stealthed) ability, typo roar and roar (morphed), while the latter needs an upgrade which the palyer can never update and hence has his shadowstep (not stealthed) always inactivated. works perfectly. only thing now is, that i can't use the spell as a hero ability :banghead:

any ideas on how to get that damned baby working?
thanks

wdw
 

Yizzy

New Member
Reaction score
20
if it works with an unit ability then make a dummy hero ability, and trigger on learn/levelup ability..
 

weisdewad

New Member
Reaction score
0
kk...

only thing i cant handle now, is to connect the level of shadowstep (not stealthed) with the level of shadowstep (stealthed).

this is my new trigger:
Trigger:
  • shadowstep
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Level of Shadowstep (dummy) for (Triggering unit)) Greater than or equal to 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to RogueHorde (stealthed)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Shadowstep (stealthed) for (Triggering unit)) Equal to 0
            • Then - Actions
              • Unit - Add Shadowstep (stealthed) to (Triggering unit)
            • Else - Actions
              • Unit - Set level of Shadowstep (stealthed) for (Triggering unit) to ((Level of Shadowstep (stealthed) for (Triggering unit)) + 1)
          • Unit - Remove Shadowstep (dummy) from (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to RogueHorde (not stealthed)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Shadowstep (not stealthed) for (Triggering unit)) Equal to 0
            • Then - Actions
              • Unit - Add Shadowstep (not stealthed) to (Triggering unit)
            • Else - Actions
              • Unit - Set level of Shadowstep (not stealthed) for (Triggering unit) to ((Level of Shadowstep (not stealthed) for (Triggering unit)) + 1)
          • Unit - Remove Shadowstep (dummy) from (Triggering unit)
        • Else - Actions


so, when my not stealthed rogue learns the shadowstep (dummy) spell it will increase the level of its spell shadowstep (not stealthed), BUT NOT spell shadowstep (stealthed) of its alternate unit form rogue (stealthed).

i can feel im close to what i want to achieve.... so pls ppl be patient and keep up with the good support!<3

thanks, wdw

-edit-
damn -.- .... recently i realised another major problem: when changing from one to the other form and back.... of course all learned abilities are gone.... so i'd have to work with a thing kinda like that: add ability to "player-owned unit-type" but i cant find such a thing. any suggetions on that?
 

Joccaren

You can change this now in User CP.
Reaction score
54
Firstly, you don't need anything for the learned abilities. If the two units are heroes, they will carry across the abilities. For your level of spells problem, create an integer variable and each time one of the spells is learned, set the variable to the variable +1. Then, when the unit morphs/unmorphs, set the level of the spell to the integer variable.
 

weisdewad

New Member
Reaction score
0
Firstly, you don't need anything for the learned abilities. If the two units are heroes, they will carry across the abilities.

the thing is, shadowstep (stealthed) and shadowstep (not stealthed) are different spells, so they aren't carried across on shifiting, or did i missunderstand you?
 

weisdewad

New Member
Reaction score
0
well.... i still dont get it. maybe i am too dump for this stuff :banghead: .
maybe someone could help me out with using the variables and show me where to add which variable (respecting that there will be several rogues, not only one)

many many thanks!
wdw
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top