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

[Trigger] Detecting if a passive ability is casted

Status
Not open for further replies.
Level 9
Joined
Oct 11, 2009
Messages
477
Hello, could I ask on how to detect if a passive ability is casted, like for example: Bash, Critical Strike, etc...

I am creating a Greater Bash ability(knockbacks unit instead of stunning it), I created already my own knockback system. My only problem now is how to activate a trigger using passive abilities. Any help will be appreciated and +rep even if attempt... Thanks in advance!!!:grin:
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
i think i know a good way for critical strike but i think it could work for other abilities too

X - chance to do Critical Strike
Fake Critical Strike - chance 0%
Critical Strike - chance 100%
TRIGGER

EVENT
unit is attacked
CONDITION
<yours if you need>
ACTION
If/Than/Else
THAN
level of Fake Critical Strike for attacking unit equal to 1
random integer between 100 and 0 greater than or equal to X
than
remove Fake Critical Strike
add Critical Strike
ELSE
level of Fake Fake Critical Strike for attacking unit equal to 1
remove Critical Strike
add Fake Critical Strike
 
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • 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 Trigger 3 <gen> the event (Unit - (Picked unit) takes damage)
  • Trigger2
  • Events
    • Unit - A unit enters (Playable Map Area)
  • Conditions
  • Actions
    • Trigger - Add to Trigger3 <gen> the event (Unit - (Triggering unit) takes damage)
  • Trigger3
  • Events
  • Conditions
    • (Level of Bash/Critical Strike for (Damage source)) Greater than 0
    • (Random integer number between 1 and 100) Less than or Equal to (Level*Chance)
  • Actions
    • //Actions here
Basically, this works. It happens when the critical or the bash happen. Apparently, the same randomness is applied on both trigger and skill.
Those conditions are both Integer Comparisons. The second one (Level*Chance) is the formula you will define, up to the level of the skill and its chance.
For example, if the chances are:
Level 1 - 10%
Level 2 - 19%
Level 3 - 28%
Level 4 - 37%

then the formula would be: (((9*(Level of Bash for (Damage source))) + 1)

Finally, passives are not "casted", they "come into effect". Moreover, Bash or Critical Strike are not considered 'spells' to be casted, they are considered 'skills/abilities'.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • 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 Trigger 3 <gen> the event (Unit - (Picked unit) takes damage)
  • Trigger2
  • Events
    • Unit - A unit enters (Playable Map Area)
  • Conditions
  • Actions
    • Trigger - Add to Trigger3 <gen> the event (Unit - (Triggering unit) takes damage)
i think it can be a bad way because trigger will have 1000 events
is it bad if it has that much events?
 
This is the GUI detection damage system. Of course, it's not of the most efficient ones, but A unit is attacked event is the most inefficient. I see you use that a lot and you really shouldn't. The trigger I gave detects when the damage is dealt, while a unit is attacked detects when a unit is ordered an attack or a unit plays its attack animation to start attacking. If you move the unit though, before the attack is made, your trigger will fire up and the effect you want will set up, even if the unit hasn't actually dealt any damage to your unit. This is why you need a damage detection system, because this one will let you know for sure when the damage is dealt.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
This is the GUI detection damage system. Of course, it's not of the most efficient ones, but A unit is attacked event is the most inefficient. I see you use that a lot and you really shouldn't. The trigger I gave detects when the damage is dealt, while a unit is attacked detects when a unit is ordered an attack or a unit plays its attack animation to start attacking. If you move the unit though, before the attack is made, your trigger will fire up and the effect you want will set up, even if the unit hasn't actually dealt any damage to your unit. This is why you need a damage detection system, because this one will let you know for sure when the damage is dealt.
no,it will not happen
the only thing that will happen it that the next unit you hit will get critical damage witch is fine :gg:
players cant know about that too
 
no,it will not happen
the only thing that will happen it that the next unit you hit will get critical damage witch is fine :gg:
players cant know about that too

Search the forums first of why a damage detection system is better than a Unit is attacked event. Everyone states so; at least do that, if you don't trust my words.
 
Level 9
Joined
Jun 25, 2009
Messages
427
Search the forums first of why a damage detection system is better than a Unit is attacked event. Everyone states so; at least do that, if you don't trust my words.

It's better, because Unit is attacked is the moment when you start your attack animation, so if you do stuff like add let's say damage every 12 seconds, dispells on attack, if you choose attacked, then if you attack, you get stunned before landing the attack, the thing would be removed. If you use damage detection system, it would detect DONE damage, not the attacking moment ;)
 
Critical Strike and Bash occur upon damage, not upon attack. Please, if you are not sure of what you're saying, have a search first. It becomes ridiculous getting arguments for something I've worked on for a long time and the bad thing is that you make Alien95 actually believe he's right = None of you will ever know. Do you know how many resources got rejected for using that event "Unit - A unit is attacked"? Try that trigger and upload it as a spell on the Spells section; if you get it approved with no comment of type "Inefficient/ Damage detection system required", I will shut my mouth.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Search the forums first of why a damage detection system is better than a Unit is attacked event. Everyone states so; at least do that, if you don't trust my words.


tough it would be good for critical strike but sometimes critical strike will not display damage dealt :bored:,however is would work great that it does
 
Last edited:
Status
Not open for further replies.
Top