• 🏆 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!

[Trigger] Detect Passive Abilities

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2007
Messages
189
Alright. Im mad. Yea, mad. i cant detect passive spells. But i know it can be done. DotA has done it. I cant remember what hero or spells (i never play it) but they did it. something like a passive skill that gives a chance to create an allusion of urself or something. I know there is are many more but how would i detect when that spell has "triggered"? And i know there is some system out there for gui but it uses orb abilities. Any ideas? or is it all jass crap?
 
Level 14
Joined
Apr 21, 2007
Messages
1,465
Well I don't know how good you are in gui, but it goes something like this:

Code:
Event - A unit attacks
Condition - Attacking unit equal to YOURUNIT
             - Attacking unit has PASSIVEABILITY(you can also set a level for it)
Action - Do a random integer between 1 and 100(or other numbers, e.g if your ability has 10% you can do between 1 and 10)

Lets say your ability has 15% to succeed. If the random integer picks numbers 1-15 then you should create an illusion of the hero(or whatever you want your spell to do)

Also note that you should set your passive ability to do nothing(if you want to only get the triggered part of it).
 
Level 7
Joined
Mar 12, 2006
Messages
407
Way 1 would be to do it like CMarket said
Way 2 would be doing it with orbs ;)
Ah yeah and maybe you could use bash with a different effect instead of stun
and then have an event refering to that effect, but i dont have experience with that, i only did the first 2 things
 
Level 6
Joined
Jan 2, 2007
Messages
189
Hey i think i got something. I gave a hero the bash ability and gave the bash a buff that did nothing. Then i did a trigger like this:
  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Attacking unit) Equal to Mountain King <gen>
  • Actions
    • Wait 0.25 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Attacked unit) has buff Stunned (Pause)) Equal to True
      • Then - Actions
        • Game - Display to (All players) the text: Passive Abilily
      • Else - Actions
The bash ability gives the attacked unit the buff. then the trigger activates whenever a unit is attacked but will only run its actions if the unit has the buff. does this work. i dont see any flaws. if there is please tell me.
 
Level 7
Joined
Mar 12, 2006
Messages
407
when i experimented around with 'Unit is attacked' events i experienced that triggers sometimes run before the target is actually hit
Seems like trigger is run when a unit starts attacking
So i dont know but maybe it might happen that this trigger runs before your target gets the buff ?
I think you should use the regular stun and just control if the text is displayed each time your victim gets stunned

If it works 100%:
Congratulations ! ;)
 
Level 6
Joined
Jan 2, 2007
Messages
189
Your right apocalypse_dude, the trigger does fire before the unit is hit. Thats what the wait action is for. it waits .25 seconds (u can change this) after an attack is detected. After the .25 seconds the trigger checks if the unit has the buff gotten from bash. If the unit has the buff then your desired actions are triggered. And so far it works 100% of the time. I can only see it buggy when with ranged heroes.
 
Level 7
Joined
Mar 12, 2006
Messages
407
cant u refer to
Generic Unit event
A unit starts the effect of an ability ?
Maybe it works for stun effects
THis would be much more accurate ;)

Ah and for the wait... waits are bad :D
But if there is only one of those heroes and just one of those passive abilities it should work
If you have a ranged unit or multiple heroes using it you will get buggy behaviour on that skill
 
Level 5
Joined
Mar 13, 2008
Messages
126
I've made and example map to show you guys how it's done.
Endurance aura DOESN'T DO ANYTHING,it is just used to give a Hero buff.
On 20% of hits(not started attacks) a footman will be spawned.

If I helped u pls give rep.:cool:
 
Last edited:
Level 22
Joined
Dec 31, 2006
Messages
2,216
turaak, the way you made it works, but if another unit hits the unit before you the trigger will still fire. You also didn't check if the attacking unit had the spell so anyone can trigger it. And it isn't MUI nor MPI.

GodsHand, one thing you could do is to download WEU and do this
  • Detect Passive
  • Events: Advanced - Any unit takes damage
  • Conditions: (Level of YOURABILITY for (Damage source)) Greater than 0
  • Actions:
  • Your actions....
Or you can make it in JASS which is what I recommend if you are able to do it.
 
Last edited:
Level 5
Joined
Mar 13, 2008
Messages
126
i didn't want to check anything btw,it's just an example...
i know it's fired but i don't know how to prevent that and WEU is BAD,BAD,BAD!!
oh yeah.u can make conditions u want so that it wont fire off when anyone attacks it.
as i said: THIS IS JUST AN EXAMPLE. modify it as u need
copy/paste if u want many units use this cuz it isn't mpi or mui (2 things u were right about). ;)
 
Last edited:
Level 5
Joined
Mar 13, 2008
Messages
126
hmm... i have noticed that if u lvl up any aura it stays on previous lvl for few seconds before it lvls up... is this a bug or does it have anything to do with duration time?

btw,berzerker why would i do that?if u think i'm trying to do that juxtapose spell u are wrong.i already made it before. ^^
 
Level 5
Joined
Mar 13, 2008
Messages
126
well... u have done same stuff as i did... just used different % trigger. but u used when unit is attacked event. :O :O :O
don't use that ever! it triggers before unit is hit,it just requires that unit attack so you can order your Hero to attack and then just smash Stop and see what happens... -.-
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Well as you perhaps have noticed there are no general damage/hit detection event, but can be used for a specific unit "Event - unit <Your_unit> is taking damage.
The main issue with this is that it cant be triggered with a variable, "the event selection way".

There is actually a way to go around this, both in Jass and Gui.
What we need is a "sub-trigger" registering the event for a single unit.
(I saw the way of using WEU, but indeed, its bad, bad, bad!)

Also, there was a damage detection tutorial before if I remember right, but surprisingly I cant find it anymore.

Anyway here we go:
  • Subtrigger Damage Detection
    • Events
      • Map initialization
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MapInitHasRan Equal to False
        • Then - Actions
          • Set MapInitHasRan = True
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            • Loop - Actions
              • Trigger - Add to Your Spell <gen> the event (Unit - (Picked unit) Takes damage)
        • Else - Actions
          • Trigger - Add to Your Spell <gen> the event (Unit - (Triggering unit) Takes damage)
And then for your passive spell:
  • Your Spell
    • Events
    • Conditions
      • (Level of <SPELL> for (Damage source)) Greater than 0
    • Actions
      • -------- Do Actions --------
As this maybe could be an inffective way, by registring the event to all your triggered damage/hit spells, you could add them all in one:
  • On Attack Spells
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of <Spell 1> for (Damage source)) Greater than 0
        • Then - Actions
          • -------- Do Actions --------
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of <Spell 2> for (Damage source)) Greater than 0
            • Then - Actions
              • -------- Do Actions --------
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of <Spell 3> for (Damage source)) Greater than 0
                • Then - Actions
                  • -------- Do Actions --------
                • Else - Actions
                  • //Do more
There is only one problem with the things I've just posted: It detects all kinds of attacks, even when you cast a spell.

While investigation the whole system I saw a way around this problem.
By using a dummy buff, you can determine whenever your damage is triggered by a spell, or by the passive ability. The best passive "dummy" ability for this would be Frost Attack or Slow Poison, but since you cant modify the frost attack's percent of slowing, Slow Poison would be a better suggestion.
-> When changing the spell, set all values to 0, stacking type to none, and the duration to 0.5 (is enough, you could try smaller value).
-> Also create a dummy buff which is replacing the preexisting buffs used there. (1 buff will be enough even if it is using two otherwise.
  • On Attack Spells
    • Events
    • Conditions
      • ((Triggering unit) has buff Buff (dummy buff)) Equal to True
      • (Damage taken) Greater than 0.00 //this should actually be added no matter what
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of <Spell 1> for (Damage source)) Greater than 0
        • Then - Actions
          • -------- Do Actions --------
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of <Spell 2> for (Damage source)) Greater than 0
            • Then - Actions
              • -------- Do Actions --------
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of <Spell 3> for (Damage source)) Greater than 0
                • Then - Actions
                  • -------- Do Actions --------
                • Else - Actions
                  • // Do more
This would work, thus it did when I tested it.
However you may consider to perhaps not do like I suggested, adding all passive spells into one, since then you cant determine if the right unit casts the right buff.
Otherwise do a trigger for every passive skill, and a dummy buff for all of them

/Regards
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Slow attack is an orbal ability?

Im not sure, what flaws do you say it has?

And Razorbrain, using "A unit is attacked" is really the worst you could use, since everyone can abuse it.
If you press stop multiply times, then the "attack" will start over, and register multiply times of the event, within a small amount of time, making the spell completely unuseless and unbalanced.
"unit is damaged" wont work that way.

(oO ive never find the way of adding buffs... Only to remove them...)
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
Slow Attack, sadly enoughs, causes some Orb-Effects not to function(in my knowledge :S)

anyhow, let me explain myself a bit better(thought i could get away with it in a fast post :p)

Okay, Unit A attacks Unit B

Unit A has ability Passive Thunder Clap(which is a dummy ability)

Trigger A(Unit is attacked) is fires first upon the attack of Unit A(since it checks for level of Passive Thunder Clap)

Trigger A adds a Buff to Unit B through a dummy spell(whether its Slow or Bloodlust or whatever)

Trigger B(Unit is Damaged) is fires second(since Unit is Attacked comes first) upon the attack of Unit B(since it checks for the target to have the Buff)

Trigger B does its things and removes the Buff

now the Unit is Attacked is not abusable since it only applies a Buff, and doesnt fire the Thunder Clap or deals any Damage
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Aha, yes I got your point =)

Then I think, yours are better, but if the fact is that he wont use orbal-abilities (hard to avoid to use them perhaps) mine would work exactly the same.

-BerZeKeR-, by the way, your trigger is suffering the abuse bug. So it wouldnt be the best ._.
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
turaak, the problem is that you didnt finish the triggers

the current problems:
1. it leaks(1 Unit Position)
2. Several units can spawn on 1 attack(this will also take up massive amounts of memory)
3. Its missing MANY conditions

but the idea is good, maybe better than ours, since not all units will be added to the trigger
 
Level 5
Joined
Mar 13, 2008
Messages
126
1.i forgot about leak ^^
2.that was example, i don't intend to use this as spawn trigger
3.i told u about missing conditions...
and i don't think adding all units in trigger is a problem,my only problem with your way is...it's too long ^^
 
Status
Not open for further replies.
Top