• 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.

Random spells

Status
Not open for further replies.
Level 5
Joined
May 21, 2006
Messages
145
Hi ! :arrow: I would like to create a hero who have random spell . Exemple : the hero have a spell chain , i would like that the hero could throw the spell randomly between three spells. When i clik on the spell "chain" , my hero could throw chain lighting or finger of dead or another spell . If you have understand what i want :oops: post please . @ + Xamaro
 
Level 11
Joined
Jul 12, 2005
Messages
764
Use a dummy ability for the hero, and use a trigger, where event is a unit starts the effect of a spell. Actions:
Set IntVar = Random integer between 1 and 3
If IntVar is equal to 1
Create a dummy and cast the first random spell
If IntVar is equal to 2
Create a dummy and cast the second random spell
If IntVar is equal to 3
Create a dummy and cast the third random spell


I'm gonna write it in detail if you want me to.
 
Level 6
Joined
Apr 27, 2006
Messages
186
You could waste the space and make 4 units, but it takes a fairly long time at least for me to copy and paste a unit then change its name and possibly its icon, so you only really have to make one unit per 8 abilities.
 
Level 6
Joined
Apr 27, 2006
Messages
186
You could waste the space and make 4 units, but it takes a fairly long time at least for me to copy and paste a unit then change its name and possibly its icon, so you only really have to make one unit per 8 of your chain abilities (give one dummy 8 dummy spells).
 
Level 11
Joined
Jul 12, 2005
Messages
764
No no... I didn't mean to copy&paste dummyunits.
Code:
Create a Dummy
Add a 2 sec expiration timer to LastCreatedUnit
If IntVar is Equal to 1
   Add [Spell#1] to LastCreatedUnit
   Set [Spell#1] level to Level of Ability Being Cast for Trigger Unit
   Order LastCreatedUnit to "..." Target Unit of Ability Being Cast
If IntVar is Equal to 2
   Add [Spell#2] to LastCreatedUnit
   Set [Spell#2] level to Level of Ability Being Cast for Trigger Unit
   Order LastCreatedUnit to "..." Target Unit of Ability Being Cast

Aoen, you only have to have ONE dummy Spellcaster in the whole map, because you can add any abilities to it that you want.
 
Level 5
Joined
May 21, 2006
Messages
145
Can you tell me what trigger exactly i have to create please , and with the variable please :?:
 
Status
Not open for further replies.
Top