Without creating an entire system, a spellbook is what your looking for. http://www.thehelper.net/threads/how-to ... oks.27637/
For the heros[0], im sorry but it seems i completely skipped over that somehow. Yes, that is a unit variable with an array of 11..or however many players you have set. From the questions im getting im guessing your making an RPG of some sort..so for the heros variable add something like
Code: Select all
Set Heros[(Player number of (Owner of (Last Created Unit)))] = (Last created unit)
It will only require a bit of simple editing. First create a new interger variable, this will be used as a random number to see which fish you get. Then edit the trigger Casts Fishing, under the line
Code: Select all
-------- It then creates a fish in the Triggering Unit's inventory based on which fish is being targeted. --------
Code: Select all
Set FishInt = (Random integer number between 1 and 3)
Now in the original trigger we have two units for the fish, Green Fish and School of Fish..since we are randomizing it we only need one, in the example ive only used School of Fish. All you need to do to make it random is that under the conditions is to check which number it is.
Code: Select all
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Target unit of ability being cast)) Equal to School of Fishs
FishInt Equal to 1
Then - Actions
Hero - Create Green Fish and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Target unit of ability being cast)) Equal to School of Fishes
FishInt Equal to 2
Then - Actions
Hero - Create Anchovy and give it to (Triggering unit)
Else - Actions