- Joined
- Mar 30, 2013
- Messages
- 337
Hello so i want to make a skill for a basic unit (Ex:Footman) that will summon 1 unit. This skill will let you summon max 3 units after that you will get an error message. The problem with my trigger is that will not keep the track when that summoning will die. If i have 2 footman and i summoned with them 6 units the moment one of those 6 units will die i will be able to summon again but the problem is that the footman that used the last time this skill will summon that unit even if we have 3 units already.
-
Test1
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to ....Summon Water Elemental
-
-
Actions
-
Set AlbatrossCastingUnitLimit = (Casting unit)
-
Set AlbatrossLimitPoint = (Position of (Casting unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of ....Summon Water Elemental for (Casting unit)) Equal to 1
-
-
Then - Actions
-
Unit - Create 1 Albatross for (Owner of AlbatrossCastingUnitLimit) at AlbatrossLimitPoint facing 0.00 degrees
-
Set AlbatrossLimitUnits = (Last created unit)
-
Unit - Set level of ....Summon Water Elemental for (Casting unit) to 2
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of ....Summon Water Elemental for (Casting unit)) Equal to 2
-
-
Then - Actions
-
Unit - Create 1 Albatross for (Owner of AlbatrossCastingUnitLimit) at AlbatrossLimitPoint facing 0.00 degrees
-
Set AlbatrossLimitUnits = (Last created unit)
-
Unit - Set level of ....Summon Water Elemental for (Casting unit) to 3
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of ....Summon Water Elemental for (Casting unit)) Equal to 3
-
-
Then - Actions
-
Unit - Create 1 Albatross for (Owner of AlbatrossCastingUnitLimit) at AlbatrossLimitPoint facing 0.00 degrees
-
Set AlbatrossLimitUnits = (Last created unit)
-
Unit - Set level of ....Summon Water Elemental for (Casting unit) to 4
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of ....Summon Water Elemental for (Casting unit)) Equal to 4
-
-
Then - Actions
-
Unit - Order (Triggering unit) to Stop
-
Custom script: if udg_ErrorSound == null then
-
Custom script: set udg_ErrorSound = CreateSoundFromLabel( "InterfaceError",false,false,false,10,10)
-
Custom script: endif
-
Set ErrorMessage = Can't train more
-
Set ErrorPlayer = (Owner of (Triggering unit))
-
Custom script: if GetLocalPlayer() == udg_ErrorPlayer then
-
Custom script: call ClearTextMessages()
-
Custom script: call DisplayTimedTextToPlayer( udg_ErrorPlayer, 0.52, 0.96, 2.00, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+udg_ErrorMessage+"|r" )
-
Custom script: call StartSound(udg_ErrorSound)
-
Wait 0.50 seconds
-
Custom script: call DisplayTimedTextToPlayer( udg_ErrorPlayer, 0.00, 0.00, 2.00, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+udg_ErrorMessage+"|r" )
-
Custom script: endif
-
-
Else - Actions
-
-
-
-
-
-
-
-
-
-
Test2
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
(Unit-type of (Dying unit)) Equal to (Unit-type of AlbatrossLimitUnits)
-
-
Actions
-
Unit - Set level of ....Summon Water Elemental for AlbatrossCastingUnitLimit to ((Level of ....Summon Water Elemental for AlbatrossCastingUnitLimit) - 1)
-
-