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

[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,240
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