I am trying to cause a unit to learn certain, predefined spells and levels when a different spell is cast. Setting the variables wont be a problem.. Just applying them could be.
I've come to the conclusion that storing the information as an Integer would be the easiest way to do it.
Heres a dummy trigger to sorta explain what i mean
SpellList [a] = xyz
'a' represents the player number
'x' represents the level of spell 1
'y' represents the level of spell 2
'z' represents the level of spell 3
Spell 1 has 9 levels.
Spell 2 has 5 levels.
Spell 3 has 5 levels.
and a value of 0 indicates no spells.
The problem i have is when i want to apply the spells to a unit. Do i have to do an individual If/Then/Else for each possible combination (1 through to 955)? Or is there a way i can apply the spells using less triggers.
I've come to the conclusion that storing the information as an Integer would be the easiest way to do it.
Heres a dummy trigger to sorta explain what i mean
-
dummy spell
-
Events
- Unit - A unit Begins casting an ability
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SpellList[(Player number of (Owner of (Casting unit)))] Equal to 100
-
Then - Actions
- -------- Cause the unit to learn Spell 1 at Level 1 --------
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SpellList[(Player number of (Owner of (Casting unit)))] Equal to 342
-
Then - Actions
- -------- Cause the unit to learn Spell 1 at Level 3 --------
- -------- Cause the unit to learn Spell 2 at Level 4 --------
- -------- Cause the unit to learn Spell 3 at Level 2 --------
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
SpellList [a] = xyz
'a' represents the player number
'x' represents the level of spell 1
'y' represents the level of spell 2
'z' represents the level of spell 3
Spell 1 has 9 levels.
Spell 2 has 5 levels.
Spell 3 has 5 levels.
and a value of 0 indicates no spells.
The problem i have is when i want to apply the spells to a unit. Do i have to do an individual If/Then/Else for each possible combination (1 through to 955)? Or is there a way i can apply the spells using less triggers.