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

Cropse Target

Status
Not open for further replies.
Level 10
Joined
Aug 8, 2004
Messages
562
is there any way i can get and ability that can only target corpses, not an ability that effects a random corpse but one that is targetable.
i made it so the ability says when u use it " Must Target A Corpse" but when i click a corpse it comes up with the same mesage....
PLEASE HELP!!!
 
Level 2
Joined
Jul 25, 2005
Messages
15
"Dead" units could be reincarnating units or stuff that is still alive so this is impossible
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Reicarnate? Mostly improbable. Mostly heroes reincarnate (though it obviously can be used on normal unit). However, here is a simple yet efficient method:

Use channel with 0.01 duration and make it target a point. And now:

Event - An Unit Begins Casting an Ability
Conditions - Ability Being Cast equal to YourAbility

set var = pick a random unit within 50 range of the point matching condition ((Matching Unit) is Dead equal to true and (Matching Unit) is a Hero equal to false and (matching Unit) is a Structure equal to false)

And then you can of course check if var is null. And if it is you stop the caster immediately and write an error message. If not you remove var unit and do your spell. Don't forget to set var to null at the end of the trigger.

~Daelin
 
Level 13
Joined
Dec 29, 2004
Messages
597
How bout this, make spell based on target-position spell (e.g. Carrion Swarm) then when a unit start casting an ability, do:

set var = pick a random unit within 50 range of the target point of ability being cast matching condition ((Matching Unit) is Dead equal to true and (Matching Unit) is a Hero equal to false and (matching Unit) is a Structure equal to false)
/* same with Daelin though */

if var not equal to nothing then
--------spell action--------
else
--------message-------------


Just to make it clear.
 
Status
Not open for further replies.
Top