L8tly I've been workin' on a map where I used a lot of spells and after a while I just had no more basic spells to customize. So I thought I'll just use a spell with the same order string to create a new one. The problem about it is, that as soon as a unit has 2 spells with the same order string and begins casting one of them, it automatically uses the last one learned instead of the one casted. I tried by:
My idea was to remove all spells that are in conflict with the spell casted and as soon as the unit has casted his ability he will regain his spells.
The problem is, like I alreadz said, that the unit casts the last learned skill with that order as soon as he gets an order, so the trigger never will be triggered, because the condition: (Ability being cast) Equal to Spellconflict1 isnt't true.
I would appreciate any kind of help.
Code:
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Spellconflict1
Actions
Unit - Order (Triggering unit) to Stop
If - Conditions
(Level of Spellconflict2 for (Triggering unit)) Not equal to 0
Then - Actions
Set levelofskill = (Level of Spellconflict2 for (Triggering unit))
Set Skill = (Spellconflict2)
Unit - Remove Spellconflict2 from (Triggering unit)
Else - Actions
Do nothing
Unit - Order (Triggering unit) to (Convert (Name of (Ability being cast)) to unit targeted order) (Target unit of ability being cast)
Wait 0.05 game-time seconds
If - Conditions
Skill Not equal to none
Then - Actions
Unit - Add Spellconflict2 to (Triggering unit)
Unit - Set Level of Spellconflict2 for (Triggering unit) to levelofskill
Set Skill = none
Else - Actions
Do nothing
My idea was to remove all spells that are in conflict with the spell casted and as soon as the unit has casted his ability he will regain his spells.
The problem is, like I alreadz said, that the unit casts the last learned skill with that order as soon as he gets an order, so the trigger never will be triggered, because the condition: (Ability being cast) Equal to Spellconflict1 isnt't true.
I would appreciate any kind of help.