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

Autocast custom skills (for computers/AI)

Status
Not open for further replies.
Level 2
Joined
Feb 10, 2008
Messages
11
Hi everyone,

How can a unit autocast a custom skill? (Like the wizards from castle fight).

For example a shaman that can autocast a customized chain lightning named Lightning stikes.

Greetz!!
 
Level 3
Joined
Dec 18, 2008
Messages
36
I havn't messed around with autocasting abilities as of yet but it doesnt look like it allows you to edit that property in the object editor. I would make a dummy spell based on an autocast spell (i.e. faerie fire: but alter stats so it does nothing). Then make a trigger that runs whenever that ability is cast. In the trigger create a dummy unit, give it the chain lightning, and have him cast it on the target unit. It should be pretty simple.
 
Level 9
Joined
Apr 3, 2008
Messages
700
How can he edit fire arrow to chain lighting? (or what do you mean?)

I would make it like:
__________________________________________
If
Shaman's mana >= <Spell mana cost>

Then:
Create dummy
Order dummy to cast chain lighting
Set mana of shaman = mana of shaman - <Spell mana cost>
__________________________________________

Note 1: don't forget to remove memry leak (location)
Note 2: You can make for shaman a skill, that will do nothing, with a description of chain lighing that will be casted by dummy.
Note 3: This spell is MUI, causedummy needs some time to cast a spell. Use local location for the point where dummy will be created.
 
Level 2
Joined
Feb 10, 2008
Messages
11
How can he edit fire arrow to chain lighting? (or what do you mean?)

I would make it like:
__________________________________________
If
Shaman's mana >= <Spell mana cost>

Then:
Create dummy
Order dummy to cast chain lighting
Set mana of shaman = mana of shaman - <Spell mana cost>
__________________________________________

Note 1: don't forget to remove memry leak (location)
Note 2: You can make for shaman a skill, that will do nothing, with a description of chain lighing that will be casted by dummy.
Note 3: This spell is MUI, causedummy needs some time to cast a spell. Use local location for the point where dummy will be created.

Thanks for the reply but the spell itself don't has to be autocast, I just need a trigger so that my unit will cast a unit owned spell automaticly when he gets in range of an enemy.

Thanks.
 
Status
Not open for further replies.
Top