• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Spell matching

Status
Not open for further replies.
Level 9
Joined
Jun 7, 2008
Messages
440
Hey guys. Quick question, there is a way to set any spell into a variable. My question is:

is there a way to have a dummy unit cast that same ability? I know how to trigger this. My Problem is having the dummy unit cast the random spell. There are too many functions to call to have them cast one simple spell, being a random ability and all.

Any Ideas?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You would have to first manually configure the type of each spell. There are three types of spells, point targeted, unit targeted and instant cast. Each requires a different function to be called.

You could store the spell type or function to call into a hashtable and then load it when needed. Use the ability id as parent key.
 
Level 16
Joined
Jun 24, 2009
Messages
1,409
What? You want the dummy to cast a random spell? Well then just store them into an arrayed variable and generate a random number at each cast. If you want to cast the same ability next time then store the random value into another variable and use it on next cast.
 
Level 9
Joined
Jun 7, 2008
Messages
440
Sorry it took me so long to respond.

@Maker: What if I wanted to localize it to a random ability casted against a unit?

@Marsal: Sorry for not being clear enough, It is not a random ability, its casting an identical ability to the one cast against the unit (Unit is a wall)
 
Status
Not open for further replies.
Top