• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Skill: 10% chance to silence target for 1 sec upon attack

Status
Not open for further replies.
Level 2
Joined
Mar 9, 2020
Messages
6
Hey. I am wondering how i can make an ability like that? I am not so good with trigger editor, so i would gladly use your help guys. For example, when ranged unit attacks enemy unit, it has 10% chance to cast silence on that unit for 1 sec and it works with buffs like fire arrows, cold arrows etc.
 
Level 2
Joined
May 25, 2020
Messages
13
Hi,

Basically you need to use a Dummy unit to cast the spell for you.
How that works -
Dummy unit is a unit which is invisible to players, has maximum rotation speed, no model, locust spell (not targetable), 9999k mana (optional)

Great tutorial on Dummy unit : Spells - Dummy Casters

The script is going to look like this:




  • Events
    • Unit - A unit is attacked
  • Conditions
    • Your condition
  • Actions
    IF (Random integer number between 1 and 10 equals 1 THEN
    {
    • -------- Create dummy unit and make it cast a spell --------
    • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
    • Unit - Add YOURSPELL to (Last created unit)
    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last created unit) to Neutral Fire Lord - Soul Burn (Last created unit)
      }
ELSE {}




The only spell I could find viable for the silence is the SOUL BURN of Fire Lord. Just change the buff of the spell to Silence and it's damage overtime to 0.
Also you need to set the cooldown of the spell, mana cost and casting time to 0. Also remove any requirements for the spell so the DUMMY will actualy cast it.

What happens is whenever a unit by your condition is attacked you are checking if random number from 1-10 is 1 (10%) and then creating a spell dummy unit invisible to you on the attacked unit location to cast Silence (Soul burn) on the unit that was attacking.


I believe you are Czech, hit me up on Discord if you do not understand this and I will try to help -> Chickn#7658
 
Level 2
Joined
Mar 9, 2020
Messages
6
Thanks, however i think you didn't understand me. I want the unit to cast silence while attacking, not while its attacked. For example a Drow Ranger attacks enemy unit, she has 10% chance to silence her target upon each attack. I would need event called ''unit is attacking'' but there's no such event in trigger editor :(

Btw i am Polish, not Czech, but i guess my nickname made you wonder. That cartoon was very popular in Poland too, haha :p
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
Damage Engine is what you're looking for: Damage Engine 5.7.1.2

It allows you to detect when damage is dealt.

The trigger would look something like this:
  • Events:
  • DamageEvent becomes equal to 1.00
  • Conditions:
  • Level of Silence Ability for DamageEventSource >= 1
  • Actions:
  • Create 1 Dummy for owner of DamageEventSource
  • Add Soul Burn to Last created unit
  • Order Last created unit to Soul Burn DamageEventTarget
That Event runs whenever a unit takes damage.
DamageEventSource and DamageEventTarget are variables provided by the system.

DamageEventSource = unit that dealt the damage.
DamageEventTarget = unit that was damaged.
 
Level 2
Joined
Mar 9, 2020
Messages
6
Thanks, i will try to do something with that. It's a shame that reforged has been out year ago and still a lot of stuff is missing in GUI. Also funny thing - there's ''attacking unit'' in condition which allows you to pick attacking unit, but no event with attacking unit. Ridicolous.

Also no event ''unit is selected'' i would gladly use to make some actions when a player selects the unit.
 
Level 10
Joined
Mar 26, 2017
Messages
376
If you can consider dropping the compatibility with Searing Arrows and other orb effects, you could base the ability off Orb of Lightning. Then you need no triggering, and it is very efficient.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
Thanks, i will try to do something with that. It's a shame that reforged has been out year ago and still a lot of stuff is missing in GUI. Also funny thing - there's ''attacking unit'' in condition which allows you to pick attacking unit, but no event with attacking unit. Ridicolous.

Also no event ''unit is selected'' i would gladly use to make some actions when a player selects the unit.
Those Events do exist though.

This Event runs when a unit starts an attack, before damage is dealt:
  • Attack example
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is A structure) Equal to True
    • Actions
      • Unit - Kill (Attacking unit)
      • Unit - Kill (Attacked unit)
This is a Player Event, it runs whenever the specified player selects a unit:
  • Select example
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Unit - Kill (Triggering unit)
Now here's why you still need a Damage Engine for this type of skill. The Event "A unit is attacked" runs before damage is dealt.
This means that the attack never actually has to finish for the Event to run. A player can order their unit to attack a target, cancel the attack by breaking the order (By pressing Stop for example), and the Event will still run. This could be done again and again causing the trigger to run rapidly. It also doesn't take into consideration things like Evasion and Misses.

What that Attack Event is really good for is doing things like preventing attacks. Any map that prevents you from attacking your allies uses this Event: A unit is attacked -> Attacked unit belongs to an ally of owner of attacking unit -> Order attacking unit to Stop.

So for your proc ability the only good solution is using a Damage Engine.

Luckily, Bribe's Damage Engine is a great system and it's very easy to use once you get the hang of it. It looks intimidating at first because it comes with so many variables and requires a unique approach, but most of that stuff can be ignored.
There's really only a few variables that you'll be using most of the time. I have some examples in this thread that I recommend checking out: Damage systems obsolete?

Creating your own "Example" trigger that you can reference later on is extremely helpful. You can always check back on it to see which Variables to use and how the Damage trigger needs to be structured.

@pr114
Not only does Orb of Lightning prevent orbs effects, it also has a bug that prevents it from proccing unless you manually order your unit to attack a target. In other words, it won't ever go off if your unit is auto attacking a target it acquired on it's own. It's not a pretty solution if you want things to work bug free.
 
Last edited:
Status
Not open for further replies.
Top