• 🏆 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] Switch System - Control over passive abilities (Critical, Bash, Cleave, Evasion, etc)

Status
Not open for further replies.
Level 5
Joined
May 24, 2009
Messages
55
A simple method of controlling passive abilities(critical. etc) to an extent that even
buffs/items can contribute to the chance that a critical strike would score.
Based on the switch method (on/off).

1. Create a Critical strike ability with (2) levels:
Level 1 - 0% chance critical strike
Level 2 - 100% chance critical strike

2. Equip a unit you want to have this controlled critical.
(In this case i'm putting it into a hero unit)

3. Determine the amount of chance you want for the critical.
(I'm going for a 30 out of a 100, probably 30%)

3. Create a trigger to generate the random chance to score the critical strike.
  • Critical
  • Events
    • Unit - A unit is attacked
  • Conditions
    • ((Attacking unit) is a Hero) equal to True
  • Actions
    • Set RANDOM = (Random integer number between 1 and 100)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • 30 Greater than or equal to RANDOM
      • Then - Actions
        • Unit - Set level of Critical Strike for attacking unit to 2
      • Else - Actions
        • Unit - Set level of Critical Strike for attacking unit to 1
What this trigger does is whenever a hero unit attacks,
it will set RANDOM as an integer between 1 and 100, and whenever RANDOM
is equal to 30 or lower, Critical ability will be increased to 2,
which is 100% chance to score a critical.

Don't worry about resetting the Critical back to 0% as when the hero makes
the next attack, if it doesn't get RANDOM to 30 or less,
the Critical ability will be automatically set at level 1,
which is 0% to score critical.

Implementation

-Can be used with bash (you can make units with certain conditions cannot be bashed).
-Can be used with Evasion.
-Can be used with Magic Reflect / Magic resistance.
-Can be controlled by buffs.
-Buffs can increase RANDOM integer or straight gives you 100% chance
to score critical strikes for 15 seconds.
 

Attachments

  • Switch_System.w3x
    22.9 KB · Views: 69
Last edited:
Level 15
Joined
Jul 19, 2007
Messages
618
That is damn ingenius. The alternatives using abilities usually use masses of levels while you're using only 2, which should result in faster loading time.

+rep for you :)

o rly? then tell me how could i make an critical with two levels and following data:

Level 1: 2x damage
Level 2: 3x damage
Level 3: 4x damage
...

with only two levels?...

no his system works only for one level an needs 2 levels for one level!

so he will need 6 levels for this and quite a lot of if then else actions...
+ triggers objects which are loaded on map startup and increase handle id!
 
Level 5
Joined
May 24, 2009
Messages
55
Thanks for compliments, greatly appreciated. I'm sorry if this didn't help anyone much.

As for..
Level 1: 2x damage
Level 2: 3x damage
Level 3: 4x damage

In this case, yes i would have to:-

1)Increase the switch critical to 4 levels:-
Level 1: 0 damage - 0%
Level 2: 2x damage - 100%
Level 3: 3x damage - 100%
Level 4: 4x damage - 100%

2)Create a dummy ability for the hero(name Special Critical in this case),
with 3 levels.

3)And further modify the set RANDOM trigger to such.

  • Critical
    • Events
      • Unit - A unit is attacked
    • Conditions
      • ((Attacking unit) is a Hero) equal to True
    • Action
      • Set RANDOM = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • 30 Greater than or equal to RANDOM
        • Then - Actions
          • If(All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Special Critical for (Attacking unit)) Greater than or equal to 2
            • Then - Actions
              • Unit - Set level of Critical Strike for attacking unit to (1+ ((Level of Special Critical for (Attacking unit))
            • Else - Actions
              • Unit - Set level of Critical Strike for attacking unit to 2
        • Else - Actions
          • Unit - Set level of Critical Strike for attacking unit to 1
In this case, aside from the 0% at level 1, i do need 1 level for each of our hero's Special Critical.
Working on an example map, will upload it soon.
 
Last edited:
Level 15
Joined
Jul 19, 2007
Messages
618
hellburke said:
I'm sorry if this didn't help anyone much..

well its not like i want to say this sucks but rather i just dont know how can this be better then original passive abilities! for example i said u will need 6 levels but u can do it with 4!

but this:

Code:
Level 1: 10% chance, 2x damage
Level 2: 12% chance, 3x damage
Level 3: 17% chance, 4x damage

now is even more complex... so thats why i dont see it to much usefull but still you did a nice try... ofc i did not attempt to insult you in any way!

Greets!
~Dark Dragon
 
Level 9
Joined
Mar 25, 2005
Messages
252
--
Code:
Level 1: 10% chance, 2x damage
Level 2: 12% chance, 3x damage
Level 3: 17% chance, 4x damage

now is even more complex... so thats why i dont see it to much usefull but still you did a nice try... ofc i did not attempt to insult you in any way!

Greets!
~Dark Dragon

The key feature here is that this can be controlled with triggers. Imagine:
Code:
Level 1: (1*agility)% chance, 2x damage
Level 2: (2*agility)% chance, 3x damage
Level 3: (3*agility)% chance, 4x damage
hellburke's way seems ideal for this kind of thing.
You're right though, in that having different effects (2x, 3x, 4x damage) make it more complicated and require more abilities than I first realized, but to my knowledge this is still the best choice for a lot of stuff.
 
Status
Not open for further replies.
Top