• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Spell upon attack

Status
Not open for further replies.
Level 20
Joined
Nov 20, 2005
Messages
1,181
I was trying to find this around. Maybe there is, maybe not. Well, i gave up and decided to open a new one. Forgive me if there is another similar.

Simply i'd like to know how to cast a spell upon attack. What i need is that when a unit is hit by X unit, curse spell is cast on the target.
I want to actually cast spells on targets so that each target will have their own nerf automatically removed due to spell duration.
Can someone help me out on this, please?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You can create a dummy unit and order it to cast the ability.
The ability should not cost mana or have requirements.
The dummy unit should have the ability added via triggers and must have 0 movement and 0 cast point.

You can use a DDS to catch when a unit has taken damage from a basic attack or just use the "A unit is attacked" event.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
DDS stands for Damage Detection System.
It detects when damage has been taken.

For example, when you use the event "A unit takes damage", you will see that this happens when a unit is starting the attack animation (Start swinging sword), but the DDS will give you an event that fires when the sword hits the target (when he takes damage).

lfh's PDD is probably the most stable DDS released.
 
Level 20
Joined
Nov 20, 2005
Messages
1,181
So, "A unit is attacked" event will cause the dummy to cast the spell on units that have just suffered any damage from the even tiggering unit? or not?

EDIT: Ok i give up. I'll just add the spell to the unit and that's it. Damn, this is ridiculous. This editor is something awesome, something's potential i feel i'm neither using 50%, and it doesn't have this apparently simple functions.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
No, a unit is attacked is before that.
There is a drawback from it which we call the "stop order abuse".
The event is fired when you start swinging your sword.
However if you order the unit to stop after that moment but before it dealt the damage, that means that your unit's basic attack did not go on cooldown.
So you can use this thing over and over again to a maximum of how many times you can order the unit.

My personal record is 3 times per second.

Download the DDS in the link I gave you and try to understand what you can do with it.
It is not the most flexible DDS that I have seen but neither do I know if there is one that is better to start with.
 
Level 20
Joined
Nov 20, 2005
Messages
1,181
Ya, this is what I was going to mention. This ability is an orb effect, though, so you cannot have multiple of these effects on one unit.

w8w8w8w8w8w8 what you mean "you cannot have multiple of these effects on one unit"? You mean that if a unit has an "orb ability like this" it can't get another "orb ability like this", right? Or you mean the units hit and affected by the unit using the orb ability?
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
DDS is still a lot better solution.
The passive thingy will not fire when your unit doesnt acquire its target by direct right click(Attack order), but from smart order(so you attack ground somewhere).

Unit Is Attacked fires when your unit starts its attack animation, so that can be extensivelly abused by right clicking unit and stopping immediately afterwards, and spamming it this way. You can cast it probably 10 times a second using this method.

DDS is the way to go if you want it to work properly
 
Level 12
Joined
May 22, 2015
Messages
1,051
w8w8w8w8w8w8 what you mean "you cannot have multiple of these effects on one unit"? You mean that if a unit has an "orb ability like this" it can't get another "orb ability like this", right? Or you mean the units hit and affected by the unit using the orb ability?

Orb effects basically make a unit's attack have a special effect. The ability in that tutorial is an orb effect. A unit cannot have more than one orb effect, even if it is from an item. This is only an issue for the unit that has spells being cast from its attacks.

Units hit by units with the orb effect can have multiple effects / spells, no problem.
 
Level 20
Joined
Nov 20, 2005
Messages
1,181
Orb effects basically make a unit's attack have a special effect. The ability in that tutorial is an orb effect. A unit cannot have more than one orb effect, even if it is from an item. This is only an issue for the unit that has spells being cast from its attacks.

Units hit by units with the orb effect can have multiple effects / spells, no problem.

oh well, that's not a problem then! :) One passive ability on attack was just what i needed, and now i have it. I tested it, and works awesomely!
 
Status
Not open for further replies.
Top