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

Spell auto cast on attk

Status
Not open for further replies.
Level 26
Joined
Mar 19, 2008
Messages
3,140
I do not recomend Event Unit - unit is attacked, because its buggy.
You can sit, let your unit start attack animation (if it has attack order already) and spam buttom 'stop'. Your trigger will cause so many knives..

Thats why damage detection systems has been invented.
Use GUI friendly damage detection system.

Its easy to get familiar with, your trigger will look like this:

  • Init
    • Events
      • Game - GDD_Event becomes equal to 0.00
    • Conditions
      • GDD_DamageSource Equal to your_unit
    • Actions
      • Unit - Order unit to Night Elf Warden - Fan of Knives
Remember that if given unit does not have ability you want to cast, trigger will do nothing.
You can also use dummies to cast ability, if you do not want that spell to exist on your hero/unit.
To do that method, in actions in trigger above enter:

  • Set temp_point = (Position of (GDD_DamageSource)
  • Unit - Create 1 dummy for (Owner of (GDD_DamageSource) at temp_point facing Default building facing degress
  • Unit - Add your_ability to (Last created unit)
  • Unit - Order (Last created unit) to Night Elf Warden - Fan of Knives
  • Unit - Add 1.00 generic expiration timer to (Last created unit)
  • Custom script: call RemoveLocation(udg_temp_point)
Make sure dummy and your_ability are made properly.
 
Level 11
Joined
Aug 1, 2009
Messages
714
I do not recomend Event Unit - unit is attacked, because its buggy.
You can sit, let your unit start attack animation (if it has attack order already) and spam buttom 'stop'. Your trigger will cause so many knives..

Thats why damage detection systems has been invented.
Use GUI friendly damage detection system.

Its easy to get familiar with, your trigger will look like this:

  • Init
    • Events
      • Game - GDD_Event becomes equal to 0.00
    • Conditions
      • GDD_DamageSource Equal to your_unit
    • Actions
      • Unit - Order unit to Night Elf Warden - Fan of Knives

It won't spam if the ability has cooldown like 0.1 second
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
You do exact the same action, the only thing you have to consider is the ability ID - or just basically whats the ability you've based your customized ability on.

So if you used Storm Bolt for creating lets say instant damage spell with other AoE effects you still use action Issue Targetting A Unit with Human - Mountain King - Storm Bolt for your spell.
 
Status
Not open for further replies.
Top