HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Making a Non-autocast ability autocast!!!!

02-21-2004, 04:03 AM#1
OneWinged4ngel
okay last thread didn't help me with ANYTHING
if fact... it started a big arguement.
ANYHOW, maybe I should make it more clear what I want.
I want a SINGLE UNIT to be able to click an ability called autocast *spell here* and... well, let's use a certain unit as an example: the tauren spirit walker.
Now then, the spirit walker has ancestral spirit, and two abilities called Autocast ON and Autocast OFF. when you click autocast on, that ONE UNIT will autocast ancestral spirit when a tauren dies. And if you click Autocast OFF it disables it FOR THAT UNIT ONLY. I DO NOT WANT TO AUTOCAST IT FOR EVERY UNIT. Single units. Sheesh. I mean, if I just wanted it to be like comes within range I wouldn't have any trouble -.-
I'm not a moron :nono:

what would I do to make a Tauren Spirit Walker cast ancestral spirit if he's within 700 range of a dying tauren?
I'm thinking the guy would cast only if custom value= 1 (you set custom value to 1 when they cast autocast on) but I can't seem to get the "casts if within range of dying unit" part 0.0emote_confused

also wanna autocast purge when something gets a positive buff or an enemy summoned unit comes within range...
also wanna autocast frenzy when near enemy...
also wanna autocast cannibalize when near a corpse and NO ENEMIES WITHIN A CERTAIN RANGE *say 500*
02-21-2004, 04:34 AM#2
Narwanza
the casts within range of dying unit part is easy

Code:
Events:
Unit dies

Conditions:
Unit-type of dying unit = tauren

Actions:
if number of units within 700 of dying unit matching((matching unit)-type = tauren) >= 1 then
order (Random unit from units within 700 of dying unit matching((matching unit)-type = tauren)) to *spell here* dying unit
Else
Do nothing

there ya go.
02-21-2004, 07:54 AM#3
Mazuli
Virtually any spell can be based off triggers or another autocast spell.

Inner Fire
Web
Slow
Raise Dead

Can create almost any trigger based autocast spell.
02-21-2004, 08:18 AM#4
sgtteflon
The easiest way to do it is create a dummy unit with your non-autocast spell, modified to have 0 cooldown, mana cost, etc. Then, have a dummy auto cast spell based off inner fire or whatever on your real unit.

then a simple trigger that detects when the modified inner fire is used, then causes your dummy unit to fire the real ability at the target.
02-21-2004, 10:34 AM#5
Anitarf
Yes, that would be the same general solution that I have written at the end of that flamed topic, but, in this specific case, it won't do. You need an autocast ability with the same targeting system. Like, for example, most autocast abilities are cast when a unit attacks (inner fire, bloodlust), some when the unit is attacked (frost armor), some when a unit in range has an enemy buff (abolish magic) etc...

What we need is an autocast ability that works when a corpse is in range! No inner fire is going to help you here.

Instead, give the tauren a custom ability on the base of the raise dead ability: give it the same mana cost as the ancestral spirit, same area of effect, so that it will only be cast when ancestral spirit can be cast; change it's allowed targets to only tauren corpses; change the art and everything; and make a trigger that, whenever the ability begins casting, interrupts the casting (since we don't want to loose the corpse that triggered the casting of the spell) and casts ancestrall spirit instead (with the tauren or a dummy spellcaster). This custom ability can directly replace the ancestrall spirit, as the ASpirit will be cast whenever this ability is cast. The ability itself will drain the mana that the ancestrall spirit would drain and it will only autocast-trigger when tauren corpses are near. It only needs a long enough casting time so that the trigger cancles the spell, before it destroys the tauren corpse.

Or, on a second thought, another, simpler way of doing things would be to just thorw away all the triggers and make the new ancestral spirit spell on the basis of carrion beetles with changed "art", "allowed targets" and "summoned unit-type". :ggani: Should have thought of that sooner.

Hmm, that is, of course, all highly theoretical, not quite sure if there won't be some problems (could happen with the "allowed targets" field or something) that would make it all inpossible, but, in theory, it should work! :D
02-21-2004, 01:01 PM#6
volatile
if you did the carrion beetle thing, it would raise tauren from ANY corpse not just from a tauren corpse. I agree with the triggers. Those are the way to make it work the way you want. There is no absolute easy solution to this one, (although some people would call triggering easy :P)
02-21-2004, 01:23 PM#7
sgtteflon
yes thats true i probably should read a full thread eh :)

but yes, doing it off carrion beatles does work. just add a check condition to the trigger that makes sure the corpse is a tauren corpse. that should be possible. only proble mis the spell would fire for all corpses, and only work for tauren corpses. so, you could add a loop in where if its not a tauren corpse, you add the mana back to the unit and reset the cooldown, with a suitable message saying "No approrpiate corpse found."

edit: no, dont add a message, thatd be bad. itd pop up constantly.
02-25-2004, 10:31 PM#8
OneWinged4ngel
well, I'm going to try that autocast thing by using slow with no real effect to do an autocast charm for the succubi in the demon race. Let's see if it works...