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

Attack triggered spells

Status
Not open for further replies.
Level 6
Joined
Jul 10, 2016
Messages
167
How can I make a spell that triggers using attacks?
I want to make a war stomp that can be triggered by attacks, or entangling roots which is attack triggered.

I'm not really aware with the GUI and Dummy system but if you can refer any tutorials I have the time to read it.

Thank you!
 
Level 11
Joined
Jul 4, 2016
Messages
627
Do you want it to occur at the moment of damage or when the unit begins attacking(will trigger even if the attack is stopped and potential for abuse.) If the former, the most basic way would be to

1. Use Bribe's Damage Engine Damage Engine 3.8.0.0

2. Use the DamageEvent = 1.00 real variable event

3. Create a dummy unit at the location of the attacker or attacked( if the attacker is ranged) and make it cast roots or war stomp.)
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
As @Clanzion mentioned, with bribes engine you can see various events where the effect occurs when the unit takes damage.
This is really handy as Attacked unit event simply picks up when a unit rear's back to attack, on top of that you can redirect the damage to be dealt by your Hero allowing you to keep damage sourced to one unit!

For Dummy units I highly recommend this tutorial - Basics of Trigger Enhancing Spells
I think the most annoying part would be ordering the unit to which you need to find "Unit - Issue Order Target Unit" with the field "Nightelf - Hero Druid Entangle" the attacking unit.
Though for Aoe abilities you simply need to do "Unit Issue Order No target" and then find either "Orc - Tauren Warstomp" or "Orc - Hero Tauren Warstomp"
 
Level 8
Joined
May 21, 2019
Messages
435
By far the simplest way to do this is to use the Lightning Orb spells.
Lightning Orb basically casts a purge spell on attack. You just change it to a hero or normal spell (accounting for the relevant data fields in converting), and you've got yourself a spell that casts other spells on attacks. No triggers needed. Do be aware that this uses up the "on attack" effect slot for the unit, and each unit can only have 1 of those. (Others include all of the other orbs, lifesteal items, and most of the "arrow" spells).
If you don't want that to happen, then you gotta use a trigger.
 
Level 6
Joined
Jul 10, 2016
Messages
167
@Devalut let me get this straight, the only spells that can be triggered using attacks are the ones on the "list" which includes entangling roots and war stomp which are default spells in the game?
Also, thanks for the suggestions I'm going to check out the tutorial and map
 
Level 39
Joined
Feb 27, 2007
Messages
5,012
No, any spell can be cast on-attack using Devalut’s method. They are simply saying not to use the Orb of Lightning to do it because that ability doesn’t actually cast the spell when units passively acquire new targets during combat (only when I explicitly ordered to attack a specific target). It’s effectively bugged
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
let me get this straight, the only spells that can be triggered using attacks are the ones on the "list" which includes entangling roots and war stomp which are default spells in the game?

It's a list of the root spell orders of all the vanilla spells in the game, example:
Flamestrike has 3 variants, #1 bloodmage's hero flamestrike with 3 levels, and #2 & #3 being neutral hostile flame strikes (one most notably used by the forgotten one in the undead expansion campaign.)
Creating a copy of any of the aforementioned flamestrikes will still be activated by the trigger unit order "HUMAN BLOODMAGE - FLAMESTRIKE" under the "Unit order targeting a point."

Is there a spell you don't see on there that you want to experiment with?
 
Level 8
Joined
May 21, 2019
Messages
435
Not a good solution, it is really buggy, you need to physically order the unit to attack for it to trigger, if it autos it will not proc.
I said easiest, not best. :D
That being said, are Blizzard aware of this one/have any intentions to fix it?
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
I said easiest, not best. :D
That being said, are Blizzard aware of this one/have any intentions to fix it?

They did make a major change to orb of fire (healing reduction [whole new ability to warcraft 3 holy guac!]) on the current ptr.
So it's more than likely that once reforged is offically released that major bug fixes will start pouring through
 
Level 8
Joined
May 21, 2019
Messages
435
They did make a major change to orb of fire (healing reduction [whole new ability to warcraft 3 holy guac!]) on the current ptr.
So it's more than likely that once reforged is offically released that major bug fixes will start pouring through
I can barely contain my excitement! Here's to hoping that they will fix some of the memory leaks...
 
Level 6
Joined
Jul 10, 2016
Messages
167
Thanks for the help, but I think I'm going to settle with the simple one even if it can be abused.

Also, @Devalut the Damage Engine Config has its functions disabled. I think its because my world editor is out dated (1.29c). Where can I update? (I know you didnt ask but I was not able to catch up with all the warcraft updates due to college)
 
Level 6
Joined
Jul 10, 2016
Messages
167
It can’t be abused; it’s the opposite of that. The abilities will simply not be regularly cast.
On @Devalut's sample map, I managed to abuse the abilities since it can be triggered before the damage by stopping the unit before the attack has been done, and by doing so I managed to "abuse" it.
 
Level 8
Joined
May 21, 2019
Messages
435
Memory leaks are not bugs and are, in fact, JASS working as intended. Handle reference leaks are the sort of thing we're hoping might be fixed.
"Bad design" then. I see no real reason that a generated point doesn't get trash collected when it isn't stored in a variable, for example, as there is no way that it would ever be used again.
 
Level 11
Joined
Jul 4, 2016
Messages
627
They are planning on creating a garbage collector through Lua, Dr Super Good has already done a partial version of it displayed in the ptr thread.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
"Bad design" then. I see no real reason that a generated point doesn't get trash collected when it isn't stored in a variable, for example, as there is no way that it would ever be used again.
That's quite a closed-mind. How would the engine distinguish a generated point that that would be used once from a generated point that will be used later?
Even so, that's how wc3 works, you can either use GUI or move to full JASS if it bothers you so much, you don't need locations, you don't need to destroy groups.
 
Level 8
Joined
May 21, 2019
Messages
435
That's quite a closed-mind. How would the engine distinguish a generated point that that would be used once from a generated point that will be used later?
Even so, that's how wc3 works, you can either use GUI or move to full JASS if it bothers you so much, you don't need locations, you don't need to destroy groups.
You do realize that this type of garbage collection has been completely standard across all programming languages for the better part of 2 decades right? How is it close-minded to expect it with a game set to release in 2019? Also, to answer the question, the engine could quite simply check to see if the generated point is being assigned to a variable, and then delete it if it isn't once the action completes, as that is the definitive end of all possibility to ever use it again without a variable.
Also, you have to fix memory leaks in JASS too. Not sure why you think that you don't.
 
Level 8
Joined
May 21, 2019
Messages
435
They are planning on creating a garbage collector through Lua, Dr Super Good has already done a partial version of it displayed in the ptr thread.
Awesome, will definitely check it out. Thanks for bringing my attention to it.
 
Status
Not open for further replies.
Top