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

help with auto cast

Status
Not open for further replies.
Level 9
Joined
Jun 10, 2013
Messages
473
Hey >:D I've made a custom rejuvenation spell and 1 dummy heal spell that has no values but the targets allowed, mana cost, cast range and cooldown now how do I trigger it so that when the Dummy heal auto cast on a unit, the unit gets the effects of my custom rejuvenation?
 
Last edited:
Level 23
Joined
Apr 16, 2012
Messages
4,041
When the unit auto casts the heal(I assume it does, despite it doing nothing) it should still fire "Unit starts effect of ability", so you can catch which ability it is there, and who is the target, and apply your magic in there.

If it doesnt work, let me know :D
 
Level 13
Joined
Oct 18, 2013
Messages
691
  • HealTrigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Heal
    • Actions
      • Unit - Order DummyUnit to Night Elf Druid Of The Claw - Rejuvenation (Target unit of ability being cast)
I think this is what they are suggesting. DummyUnit would be the unit you want casting your rejuvenation.
 
Level 20
Joined
Feb 23, 2015
Messages
243
It should work:
  • spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equals to DummyAbility
    • Actions
      • Set DummyCaster = (Triggering unit)
      • Set DummyTarget = (Target unit of ability being cast)
      • Set DummyPoint = (Position of DummyCaster)
      • Unit - Create 1 SpawnDummyUnit for (Owner of DummyCaster) at DummyPoint facing Default building facing degrees
      • Unit - Add a 3.00 second default expiration timer to (Last created unit)
      • Unit - Add Rejuvenation to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf - Druid of the Claw: Rejuvenation DummyTarget
      • Custom script: call RemoveLocation(udg_DummyPoint)
It works if you want your caster to autocast heal, but without having non-autocast rejuvenation ability. SpawnDummyUnit is an empty unit without anything and with locust ability. Also, in this line:
  • Unit - Add Rejuvenation to (Last created unit)
you have to give it YOUR Rejuvenation.

EDIT: don't forget to delete mana cost of your rejuvenation ability
 
Level 6
Joined
Aug 5, 2015
Messages
202
say thank you to MatiS please, sarumanthecursed?
 

Attachments

  • 1.png
    1.png
    22.2 KB · Views: 82
Level 13
Joined
Oct 18, 2013
Messages
691
  • Unit - Create 1 SpawnDummyUnit for (Owner of DummyCaster) at DummyPoint facing Default building facing degrees
  • Unit - Add a 3.00 second default expiration timer to (Last created unit)
  • Unit - Add Rejuvenation to (Last created unit)
  • Unit - Order (Last created unit) to Night Elf - Druid of the Claw: Rejuvenation DummyTarget
-->
  • Unit - Create 1 SpawnDummyUnit for (Owner of DummyCaster) at DummyPoint facing Default building facing degrees
  • Set TempUnit=(Last Created Unit)
  • Unit - Add a 3.00 second default expiration timer to TempUnit
  • Unit - Add Rejuvenation to TempUnit
  • Unit - Order TempUnit to Night Elf - Druid of the Claw: Rejuvenation DummyTarget
Edit: Also, you only use DummyCaster once so it is probably more efficient to not use a variable to grab Triggering Unit. Another thing I kind of want to mention is that the point variable is really unnecessary too. If the spell has a huge range, it doesn't really matter where you put the unit. It could simply be spawned at a non-volatile point variable, which means you wouldn't need to set the point variable and clear it. I would personally just do it like this:

  • Unit - Create 1 SpawnDummyUnit for (Owner of Triggering Unit) at CenterofMap facing Default building facing degrees
  • Set TempUnit=(Last Created Unit)
  • Unit - Add a 3.00 second default expiration timer to TempUnit
  • Unit - Add Rejuvenation to TempUnit
  • Unit - Order TempUnit to Night Elf - Druid of the Claw: Rejuvenation DummyTarget
 
Level 12
Joined
May 22, 2015
Messages
1,051
You could also just reuse the unit. I know some spells can't target enemies, so if that's an issue, just change its owner before casting. Spawn the unit at the start or at the time someone creates a unit with the auto-cast ability. Then reuse that unit for the rest of the game. No need to make a new unit each time.
 
Status
Not open for further replies.
Top