• 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.

Spell auto cast on attk

Status
Not open for further replies.
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
 
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