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

Charge type spell help

Status
Not open for further replies.
Level 8
Joined
Dec 7, 2008
Messages
363
Hi there,

I would like to make a spell where the hero runs to a target unit quickly and deals 200 damage to the unit once he arrives, then revert back to normal speed.

I would like to know the triggers that would be used for this.
I need to know how to stop the player from moving him mid spell, how to detect when he gets to the unit and anything else you see as important.
 
Level 4
Joined
Nov 7, 2009
Messages
83
It ocurrs to me that you can remove unit selection from player, make unit attack once and modify speed.

Triggers are:
-> Selection - Remove unit from selection for player
-> Selection - Add to selection for player
> You can use other selection triggers
-> Unit - Set Movement Speed
-> Unit - Issue order targecting a unit
-> Unit - Order unit to damage target

So you will do something like this
  • CastAbility
  • Events
    • Unit casts an ability
  • Conditions
    • Ability being cast equal to (your ability)
  • Actions
    • set caster=triggering unit
    • set target=target unit of ability being cast
    • Remove (caster) from selection for (Owner of (caster))
    • Order (caster) to attack once (target)
    • Set unit movement speed to xxx
Then create another trigger that goes like this
  • Collision
  • Events
    • Unit is attacked
  • Conditions
    • Attacked unit = target
    • Attacking unit = caster
  • Actions
    • set unit movement speed to default
    • effects/pushback/etc
    • damage
    • Add (caster) selection to (owner of (caster))
    • set caster = no unit
    • set target = no unit
Something like this should work in GUI.

Play a little with the editor and it will work

You can try searching for keywords.

Maybe you want the unit to accelerate while charging, you can do this by using one more trigger, which executes every xxx time and increases current speed in a certain amount until it reaches a certain speed.
 
Level 6
Joined
Aug 26, 2009
Messages
221
It ocurrs to me that you can remove unit selection from player, make unit attack once and modify speed.

Triggers are:
-> Selection - Remove unit from selection for player
-> Selection - Add to selection for player
> You can use other selection triggers
-> Unit - Set Movement Speed
-> Unit - Issue order targecting a unit
-> Unit - Order unit to damage target

So you will do something like this
  • CastAbility
  • Events
    • Unit casts an ability
  • Conditions
    • Ability being cast equal to (your ability)
  • Actions
    • set caster=triggering unit
    • set target=target unit of ability being cast
    • Remove (caster) from selection for (Owner of (caster))
    • Order (caster) to attack once (target)
    • Set unit movement speed to xxx
Then create another trigger that goes like this
  • Collision
  • Events
    • Unit is attacked
  • Conditions
    • Attacked unit = target
    • Attacking unit = caster
  • Actions
    • set unit movement speed to default
    • effects/pushback/etc
    • damage
    • Add (caster) selection to (owner of (caster))
    • set caster = no unit
    • set target = no unit
Something like this should work in GUI.

Play a little with the editor and it will work

You can try searching for keywords.

Maybe you want the unit to accelerate while charging, you can do this by using one more trigger, which executes every xxx time and increases current speed in a certain amount until it reaches a certain speed.

i think it's not MUI because when a unit cast that spell, the variable sets, and when another unit cast before the first arrive in target, and the variable sets again, replacing the before.
as the result, the first caster will never get his normal speed

use indexing system
 
Level 4
Joined
Nov 7, 2009
Messages
83
That's quite right, but I don't know better, and if he is going to have only one of this units in his map, he'll have no trouble at all.
 
Status
Not open for further replies.
Top