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

How to detect a unit "casting/starting/beginning" a certain PASSIVE spell ?

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Well, if you have an active-type ability, you can always use this trigger for example:

  • Events
    • Unit - A unit Starts the effect of an ability
BUT HOW to detect a unit casting a passive ability ?
I mean like, if you have a passive ability, let's say, Critical Strike, upon the chance hit, I want to add some extra effect to it, let's say, add a dummy unit and cast storm bolt to the Critical Strik-ed unit
I just need to know HOW and WHAT trigger should I use ?
Or is it just... IMPOSSIBLE ?

EDIT:
SOLVED.
 
Last edited:
Level 13
Joined
Mar 24, 2010
Messages
950
I believe theres a buff given for a very short time like Bash for example.
Make a trigger that when a unit is attacked see if it has that buff for that split second and then make the dummy unit cast or whatever to that unit.
If thats not the case with crit strike i believe you can make a custom buff and add it to it. and then do it that way ^^
Hope that helps
 
The thing is, defskull, you can't. The only way is to simulate the effect with triggers. The damage detection system won't be that helpful either.
Here is a Critical Strike simulation as an example.
  • Trigger CS 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Critical Strike for (Attacking unit)) Greater than 0
    • Actions
      • Trigger - Add to Trigger CS 2 <gen> the event (Unit - (Triggering unit) Takes damage)
The above adds events to the below trigger, and the below trigger triggers the Critical Strike.
  • Trigger CS 2
    • Events
    • Conditions
      • (Level of Critical Strike for (Damage source)) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than 15
          • (Damage taken) Greater than or equal to 1.00
        • Then - Actions
          • -------- Stops an endless loop of damaging --------
          • Trigger - Turn off (This trigger)
          • -------- Combined with the above trigger, this trigger multiplies your damage dealt --------
          • -------- Since you already damaged this guy, you just have to decrease the life --------
          • -------- Level increases multiplier --------
          • For each (Integer A) from 1 to (Level of Critical Strike for (Damage source)), do (Actions)
            • Loop - Actions
              • Unit - Cause (Damage source) to damage (Triggering unit), dealing (Damage taken) damage of attack type Chaos and damage type Universal
          • -------- Floating Text! YAYYY! --------
          • Floating Text - Create floating text that reads (String(((Integer((Damage taken))) x ((Level of Critical Strike for (Damage source)) + 1)))) above (Triggering unit) with Z offset 64.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.70 seconds
          • -------- Stops an endless loop of damaging --------
          • Trigger - Turn on (This trigger)
        • Else - Actions
 
Level 13
Joined
Mar 24, 2010
Messages
950
I'm pretty sure my way woulda worked just fine and it wouldnt need a huge trigger filled with unit events from every unit that hero attacks. Granted if my way doesnt work yours would be the next best bet. :)
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
The thing is, defskull, you can't. The only way is to simulate the effect with triggers. The damage detection system won't be that helpful either.
Here is a Critical Strike simulation as an example.
  • Trigger CS 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Critical Strike for (Attacking unit)) Greater than 0
    • Actions
      • Trigger - Add to Trigger CS 2 <gen> the event (Unit - (Triggering unit) Takes damage)
The above adds events to the below trigger, and the below trigger triggers the Critical Strike.
  • Trigger CS 2
    • Events
    • Conditions
      • (Level of Critical Strike for (Damage source)) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than 15
          • (Damage taken) Greater than or equal to 1.00
        • Then - Actions
          • -------- Stops an endless loop of damaging --------
          • Trigger - Turn off (This trigger)
          • -------- Combined with the above trigger, this trigger multiplies your damage dealt --------
          • -------- Since you already damaged this guy, you just have to decrease the life --------
          • -------- Level increases multiplier --------
          • For each (Integer A) from 1 to (Level of Critical Strike for (Damage source)), do (Actions)
            • Loop - Actions
              • Unit - Cause (Damage source) to damage (Triggering unit), dealing (Damage taken) damage of attack type Chaos and damage type Universal
          • -------- Floating Text! YAYYY! --------
          • Floating Text - Create floating text that reads (String(((Integer((Damage taken))) x ((Level of Critical Strike for (Damage source)) + 1)))) above (Triggering unit) with Z offset 64.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.70 seconds
          • -------- Stops an endless loop of damaging --------
          • Trigger - Turn on (This trigger)
        • Else - Actions

for each attack you will get a new event and increase the chance to trigger stuff
either add all units to a group which have the event already or add the event for all units once

The trigger you showed will work for spells too and not only for attacks.

add an orb effect (slow, corruption, etc..) to every unit and if a unit takes damage check and remove that buff
if unit had buff it was normal attack else it was spell dmg
unfortunately you can't use more than 1 orb effect per unit (usually) but with a damage detection system it is way better to trigger them all anyway
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Sorry for such a long response !

@All
Thanks for replying and spend your time on this thread over here
But I'm still confused, what method should I choose ?

Review:

@Axarion
Well, I know that the system you linked me was a leakless system and simple yet, I still want an easy way out of it
That system looks... tough (I don't know if I'm noob or what =.=)

@GhostThruster
Won't your 1st trigger (Trigger CS 1) works 100% of the time ?
To prevent this, you've added 2nd trigger (Trigger CS 2)
Ok, here's the question:
Will the trigger works/performs at the same time as Critical Strike ability ?
OR you must create a custom spell that does nothing (but if added with triggers, the "Critical Strike" works) ?

@D4RK G4ND4LF
"...for each attack you will get a new event and increase the chance to trigger stuff..."
I like to know MORE about this stuff
I've created a passive-chance ability and make it 15% out of time
BUT, as the time passes, I noticed that the passive spell occurs 3-4x its %
It is like, occurs for 30~40% of the time
WHAT is the problem ?
Or is it just my hallucination ?

Overall:
Added +rep for all that helped me ;D
 
You can delete all the events with 'call DestroyTrigger(GetTriggeringTrigger())', but I wouldn't recommend it(can cause issues).

That was just an example of how to implement a passive spell, but yeah, you would need to use a custom CS with no values(still needs a description). But that's why it is an example; the spell already exists, so no one would bother making another trigger-based spell that works less-than better than the normal spell.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I want my spell to be like (refer to my 1st post, it is like Critical Strike + Stun ability)
So, the solution is:
Create 1 custom spell (non-workable spell WITHOUT TRIGGER)
Then, follow your trigger method (an addition would be create a dummy unit casting storm bolt to the enemy)
Can this be done ?
 
Level 5
Joined
Jan 4, 2007
Messages
103
If you're using GhostThruster's trigger, just create a dummy unit with a Storm Bolt ability that does no damage and remove all effects and missile arts ect. Then add this to your trigger:

  • Actions
    • Set StormPoint = (Position of (Damage source))
    • Unit - Create 1 Your Unit for (Owner of (Damage source)) at StormPoint facing Default building facing degrees
    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Triggering unit)
    • Custom script: call RemoveLocation (udg_StormPoint)
If that is what you want:) Hope it helps:)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
If you're using GhostThruster's trigger, just create a dummy unit with a Storm Bolt ability that does no damage and remove all effects and missile arts ect. Then add this to your trigger:

  • Actions
    • Set StormPoint = (Position of (Damage source))
    • Unit - Create 1 Your Unit for (Owner of (Damage source)) at StormPoint facing Default building facing degrees
    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Triggering unit)
    • Custom script: call RemoveLocation (udg_StormPoint)
If that is what you want:) Hope it helps:)

Thanks for trying to help ;D
But I already knew about this trigger
I'm just asking for CONFIRMATION about those triggers
 
Level 11
Joined
Sep 12, 2008
Messages
657
hmm.. basicly, if you want a answer to

I want my spell to be like (refer to my 1st post, it is like Critical Strike + Stun ability)
So, the solution is:
Create 1 custom spell (non-workable spell WITHOUT TRIGGER)
Then, follow your trigger method (an addition would be create a dummy unit casting storm bolt to the enemy)
Can this be done ?

it can be done, but your most friendly advice is that use a dds to find if its an attack or spell.

and also, you must make sure your spell HAS NO effect at all (no crit, nothing)
and basicly, you trigger the double damage.
with X percent depending on level, or w/e you want.
then making a dummy cast a spell on the target like the person above sayd.
 
Level 13
Joined
Mar 24, 2010
Messages
950
Wait.. if you just want a crit strike with a stun combo why not just use Bash and make the hit damage a % and then for the storm bolt have it be that % chance of bash? I think that can all be done within the Bash ability. Ill test some stuff out when i get home though.
 
Status
Not open for further replies.
Top