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

[Solved] Is it possible to make a spell like "Lock on" from the Cyclone in SC2?

Status
Not open for further replies.
Level 8
Joined
Mar 17, 2016
Messages
133
I have a hero in an RPG I'm making that would make the most sense to have this ability where she can continue to attack a target as she runs without having to do the normal "take a few steps, turn back, shoot, repeat" kind of thing most ranged heroes do in this sort of game.

She would run around a target and as long as it's within 600 range of her she would fire off autoattacks to that one target. (Kind of like Windranger's Focus fire change they had a while back in Dota 2)

Is this possible through the WC3 editor?
 
Level 5
Joined
Oct 16, 2007
Messages
67
I think you have 2 Possibilitys.
1) The easiest is to create a dummy spell that uses a trigger to add Phoenix Fire to the unit for a duration and then removes it. But that is random damage.

2) You create a dummy spell and save the unit that was targetet. Then you enable a second trigger that runs every X seconds and creates a dummy unit that attacks the target. After X seconds or runs you disable this trigger.

The second option isn't to hard if your heros are only once on the map and you can also copy critical stike effects and alike onto the dummy.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
Just about anything is possible, it's more so a matter of figuring out how to do it.

That being said, I attached a map containing a Lock On spell I threw together which I think you'll like.

How it works:

1) When you cast Lock On I order a Dummy unit to cast Wand of Illusion on the Hero, creating an illusion that deals full damage. The Dummy also casts a Debuff ability called Lock On on the target of the ability.
2) I then immediately make this Illusion invisible/unselectable by changing it's size and transparency as well as adding the Locust ability to it.
3) Then I turn on a timer that runs every 0.03 seconds, constantly moving the illusion to the position of the Hero.
4) I have another trigger that forces the Illusion to only attack the Lock On target.
5) The Hero can't attack during this time because I disarm it by adding the Cargo Hold (Orc Burrow) ability to it.
6) After 6 seconds I end the spell, destroying the illusion and enabling the ability to attack again by removing Cargo Hold from our Hero.

This is all made possible using a Unit Indexer, a great system to have for GUI mapmaking. Multiple units can use this spell as well. The only catch is that the cooldown of the ability MUST be greater than or equal to the duration of the spell. So if it lasts 10 seconds, the cooldown must be at least 10 seconds.

If you wanted to change the duration of the spell, you would need to increase the 6.00 second Wait in the Lock On trigger as well as the duration of the Lock On Debuff (it's based on Slow) in the Object Editor.

There are some other limitations due to the fact that it's an Illusion doing the attacking and not your Hero, but I think it's still pretty good. If you use a Damage Engine in your map then you can change the source of the damage from the Illusion to your Hero so that covers issues like who kills are credited to when an enemy unit dies. You could also modify this trigger to use a Hero copy of your Hero, like a new unit based on your Hero, but it would require extra work as you'd need to copy over the items and hero level as well.
 

Attachments

  • Lock On.w3m
    25.5 KB · Views: 31
Last edited:
Status
Not open for further replies.
Top