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

I need some help with this skill.

Level 6
Joined
Mar 28, 2018
Messages
128
I want to make an ability on a hero that revives the allied hero after he dies. the thing is that I want it to be a little different. after an ally dies, a timer will appear in the place where he died, and if he is not resurrected during that time, he cannot be resurrected. If he is resurrected, the timer disappears.
I want it to have 3 levels and the time to be 3 minutes.
Appear only when you play with the hero who has this ability and not always. to be able to revive the hero at a distance of 2000. if you are not at that distance... when you activate the ability it will tell you that you are too far.

Can such a thing be done?
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
Sure, ezpz.

You basically want Auriel's ulti from Heroes of the Storm, no?

Timers on the ground are easy to produce via Floating Texts.
Have an ability based on Channel.
When Channel (Resurrection) fires find the closest hero from the spelltarget coordinates.
JASS:
function UDistance takes real AX, real AY, real BX, real BY returns real
    local real dx = BX - AX
    local real dy = BY - AY
    return SquareRoot(dx * dx + dy * dy)
endfunction
If the dead unit found is within 2000 range of the caster resurrect the unit. Etc. etc.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,580
There's a GUI function for getting the Distance between two Points. What emperor posted is the Jass equivalent - although more efficient since it uses coordinates rather than Points. If you didn't know already, a Point is just a container of coordinates, so it's essentially the same thing.

Here is the function:
  • Actions
    • Set Variable Revive_Distance = (Distance between Revive_Point[0] and Revive_Point[1])
Then you can check this Distance value with some basic math:
  • Conditions
    • Revive_Distance Less than or equal to 2000.00
I forget if you're on the latest patch or not but here's a demo map with the ability. Not sure if it's exactly what you had in mind.
 

Attachments

  • Revive 1.w3m
    30.1 KB · Views: 4
Last edited:
Top