random spell

emolilolee

New Member
Reaction score
1
Can i make a spell of a hero who randomly uses one spell? at example, i click it and it uses finger of death, or it can do war stomp or a custom spell... etc.etc. It looks very hard to find a trigger for it, but maybey someone can help me
many thanks already.:p
 

Samael88

Evil always finds a way
Reaction score
181
This has to be triggered.
You will need an ability array.
set the array like follows.
set SpellList[1] = Death Coil.
set SpellList[2] = Thunderbolt...
And so on.
This can be done in the map intialization file.
Just do it with the random number function.

Code:
Event: 
      Unit begins casting an ability
Condition: 
      Ability equal to DummySpell.
Actions:
      Make unit cast Ability[Random integer number between 1 and 10] on targeted unit of abiility being cast.

This is only if all abilitys are targeted the same. In this case they are all targeting a unit.

If you want to mix them like this:
set SpellList[1] = Death Coil.
set SpellList[2] = Thunder Clap.

If you got them like this, then you can not use the first example. It will have to be done with a really long trigger or a couple of dummy units.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top