- Joined
- Nov 19, 2010
- Messages
- 54
Hello there,
I am trying to make a duplicate of a trigger i have for my tower defense game from "legion td" that i have edited.
The King currently has 3 types he can upgrade his damage ( attack) , Life and hitpoint regeneration.
This is the trigger for the regular king's upgrades:
This is my 5x trigger:
After some tries i changed it towards my second 5x trigger above and the "damage" is working so far but the another 2 i have been unable to get working.
I tried using the increase level of ability of unit for this one too seeing the another part (of the trigger) of the damage / attack of the king does that, but that did not work neither
It also gets bugged when there are less then 5 upgrade levels left (damage is level 60 max for example ) and the 5x gets used on level damage 56+ then the damage of the king, gets reset towards + 5 damage in total for the king instead of the +800 damage in total after fully upgraded with 60 levels of the damage in my legion td game.
I hope some one can help me with this one it would be great!
I am trying to make a duplicate of a trigger i have for my tower defense game from "legion td" that i have edited.
The King currently has 3 types he can upgrade his damage ( attack) , Life and hitpoint regeneration.
This is the trigger for the regular king's upgrades:
-
King Regular Upgrades
-
Events
- Unit - A unit Sells a unit
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Unit-type of (Sold unit)) Equal to Upgrade King Hit Points
- (Unit-type of (Sold unit)) Equal to Upgrade King Attack
- (Unit-type of (Sold unit)) Equal to Upgrade King Regeneration
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
- -------- Which Player/Team --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Owner of (Selling unit)) is an ally of Player 9 (Gray).) Equal to True
-
Then - Actions
- Set VariableSet Temp_Player = Player 9 (Gray)
- Set VariableSet Temp_Unit = The King 0009 <gen>
-
Else - Actions
- Set VariableSet Temp_Player = Player 10 (Light Blue)
- Set VariableSet Temp_Unit = The King 0006 <gen>
-
If - Conditions
- -------- Add Upgrade (if valid) --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Sold unit)) Equal to Upgrade King Hit Points
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Current research level of King Hit Points (1) for Temp_Player) Less than (Max research level of King Hit Points (1) for Temp_Player)
-
Then - Actions
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Loop - Actions
- Player - Set the current research level of King Hit Points (1) to ((Current research level of King Hit Points (1) for (Picked player)) + 1) for (Picked player)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Holy Light II (builder) for Temp_Unit) Equal to 0
-
Then - Actions
- -------- This abuses a glitch...if you don't understand it, ignore it --------
- Unit - Add King Life (Pseudoupgrade) to Temp_Unit
- Unit - Set level of King Life (Pseudoupgrade) for Temp_Unit to ((Current research level of King Hit Points (1) for (Owner of Temp_Unit)) + 1)
- Unit - Remove King Life (Pseudoupgrade) from Temp_Unit
- Else - Actions
-
If - Conditions
- Game - Display to (All allies of Temp_Player.) for 10.00 seconds the text: (((PlayerColor_String[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's hit points to level |cffFFcc00) + ((String((Current research level of King Hit Points (1) for Temp_Player))) + |r))
- Set VariableSet UpgradesBought[(Player number of (Owner of (Selling unit)))] = (UpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
- -------- Income --------
- Set VariableSet PlayerIncome[(Player number of (Owner of (Selling unit)))] = (PlayerIncome[(Player number of (Owner of (Selling unit)))] + 3)
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Else - Actions
- Player - Make Upgrade King Hit Points Unavailable for training/construction by (Owner of (Selling unit))
- Player - Add 80 to (Owner of (Selling unit)).Current lumber
- Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
- Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Sold unit)) Equal to Upgrade King Attack
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Current research level of King Attack (1) for Temp_Player) Less than (Max research level of King Attack (1) for Temp_Player)
-
Then - Actions
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Loop - Actions
- Player - Set the current research level of King Attack (1) to ((Current research level of King Attack (1) for (Picked player)) + 1) for (Picked player)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of King Damage (Pseudoupgrade) for Temp_Unit) Equal to 0
-
Then - Actions
- Unit - Add King Damage (Pseudoupgrade) to Temp_Unit
-
Else - Actions
- Unit - Set level of King Damage (Pseudoupgrade) for Temp_Unit to ((Level of King Damage (Pseudoupgrade) for Temp_Unit) + 1)
-
If - Conditions
- Game - Display to (All allies of Temp_Player.) for 10.00 seconds the text: (((PlayerColor_String[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's attack to level |cffFFcc00) + ((String((Current research level of King Attack (1) for Temp_Player))) + |r))
- Set VariableSet UpgradesBought[(Player number of (Owner of (Selling unit)))] = (UpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
- -------- Income --------
- Set VariableSet PlayerIncome[(Player number of (Owner of (Selling unit)))] = (PlayerIncome[(Player number of (Owner of (Selling unit)))] + 3)
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Else - Actions
- Player - Make Upgrade King Attack Unavailable for training/construction by (Owner of (Selling unit))
- Player - Add 80 to (Owner of (Selling unit)).Current lumber
- Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
- Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Sold unit)) Equal to Upgrade King Regeneration
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Current research level of King Regeneration (1) for Temp_Player) Less than (Max research level of King Regeneration (1) for Temp_Player)
-
Then - Actions
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Loop - Actions
- Player - Set the current research level of King Regeneration (1) to ((Current research level of King Regeneration (1) for (Picked player)) + 1) for (Picked player)
-
Loop - Actions
- Game - Display to (All allies of Temp_Player.) for 10.00 seconds the text: (((PlayerColor_String[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's regeneration to level |cffFFcc00) + ((String((Current research level of King Regeneration (1) for Temp_Player))) + |r))
- Set VariableSet UpgradesBought[(Player number of (Owner of (Selling unit)))] = (UpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
- -------- Income --------
- Set VariableSet PlayerIncome[(Player number of (Owner of (Selling unit)))] = (PlayerIncome[(Player number of (Owner of (Selling unit)))] + 3)
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Else - Actions
- Player - Add 80 to (Owner of (Selling unit)).Current lumber
- Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
- Player - Make Upgrade King Regeneration Unavailable for training/construction by (Owner of (Selling unit))
- Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
- -------- Update Income Multiboard --------
- Trigger - Run Update Income <gen> (ignoring conditions)
- -------- Clean --------
- Unit - Remove (Sold unit) from the game
- -------- Fx --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Temp_Player Equal to Player 9 (Gray)
-
Then - Actions
- Special Effect - Create a special effect at LKing using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
-
Else - Actions
- Special Effect - Create a special effect at RKing using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
-
If - Conditions
- Special Effect - Destroy (Last created special effect)
-
Events
This is my 5x trigger:
-
King Regular Upgrades 5 times
-
Events
- Unit - A unit Sells a unit
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Unit-type of (Sold unit)) Equal to Upgrade King Attack 5x
- (Unit-type of (Sold unit)) Equal to Upgrade King Hit Points 5x
- (Unit-type of (Sold unit)) Equal to Upgrade King Regeneration 5x
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
- -------- Which Player/Team --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Owner of (Selling unit)) is an ally of Player 9 (Gray).) Equal to True
-
Then - Actions
- Set VariableSet Temp_Player = Player 9 (Gray)
- Set VariableSet Temp_Unit = The King 0009 <gen>
-
Else - Actions
- Set VariableSet Temp_Player = Player 10 (Light Blue)
- Set VariableSet Temp_Unit = The King 0006 <gen>
-
If - Conditions
- -------- Add Upgrade (if valid) --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Sold unit)) Equal to Upgrade King Hit Points 5x
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Current research level of King Hit Points (1) for Temp_Player) Less than (Max research level of King Hit Points (1) for Temp_Player)
-
Then - Actions
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Loop - Actions
- Player - Set the current research level of King Hit Points (1) to ((Current research level of King Hit Points (1) for (Picked player)) + 5) for (Picked player)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of King's Regeneration (Pseudoupgrade) for Temp_Unit) Equal to 0
-
Then - Actions
- -------- This abuses a glitch...if you don't understand it, ignore it --------
- Unit - Add King's Regeneration (Pseudoupgrade) to Temp_Unit
- Unit - Set level of King Life (Pseudoupgrade) for Temp_Unit to ((Current research level of King Hit Points (1) for (Owner of Temp_Unit)) + 1)
- Unit - Set level of King Life (Pseudoupgrade) for Temp_Unit to ((Current research level of King Hit Points (1) for (Owner of Temp_Unit)) + 1)
- Unit - Set level of King Life (Pseudoupgrade) for Temp_Unit to ((Current research level of King Hit Points (1) for (Owner of Temp_Unit)) + 1)
- Unit - Set level of King Life (Pseudoupgrade) for Temp_Unit to ((Current research level of King Hit Points (1) for (Owner of Temp_Unit)) + 1)
- Unit - Set level of King Life (Pseudoupgrade) for Temp_Unit to ((Current research level of King Hit Points (1) for (Owner of Temp_Unit)) + 1)
- Unit - Remove King's Regeneration (Pseudoupgrade) from Temp_Unit
- Else - Actions
-
If - Conditions
- Game - Display to (All allies of Temp_Player.) for 10.00 seconds the text: (((PlayerColor_String[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's hit points to level |cffFFcc00) + ((String((Current research level of King Hit Points (1) for Temp_Player))) + |r))
- Set VariableSet UpgradesBought[(Player number of (Owner of (Selling unit)))] = (UpgradesBought[(Player number of (Owner of (Selling unit)))] + 5)
- -------- Income --------
- Set VariableSet PlayerIncome[(Player number of (Owner of (Selling unit)))] = (PlayerIncome[(Player number of (Owner of (Selling unit)))] + 15)
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Else - Actions
- Player - Make Upgrade King Hit Points 5x Unavailable for training/construction by (Owner of (Selling unit))
- Player - Add 400 to (Owner of (Selling unit)).Current lumber
- Player - Add -400 to (Owner of (Selling unit)).Total lumber gathered
- Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Sold unit)) Equal to Upgrade King Attack 5x
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Current research level of King Attack (1) for Temp_Player) Less than (Max research level of King Attack (1) for Temp_Player)
-
Then - Actions
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Loop - Actions
- Player - Set the current research level of King Attack (1) to ((Current research level of King Attack (1) for (Picked player)) + 5) for (Picked player)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of King Damage (Pseudoupgrade) for Temp_Unit) Equal to 0
-
Then - Actions
- Unit - Add King Damage (Pseudoupgrade) to Temp_Unit
-
Else - Actions
- Unit - Increase level of King Damage (Pseudoupgrade) for Temp_Unit
- Unit - Increase level of King Damage (Pseudoupgrade) for Temp_Unit
- Unit - Increase level of King Damage (Pseudoupgrade) for Temp_Unit
- Unit - Increase level of King Damage (Pseudoupgrade) for Temp_Unit
- Unit - Increase level of King Damage (Pseudoupgrade) for Temp_Unit
-
If - Conditions
- Game - Display to (All allies of Temp_Player.) for 10.00 seconds the text: (((PlayerColor_String[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's attack to level |cffFFcc00) + ((String((Current research level of King Attack (1) for Temp_Player))) + |r))
- Set VariableSet UpgradesBought[(Player number of (Owner of (Selling unit)))] = (UpgradesBought[(Player number of (Owner of (Selling unit)))] + 5)
- -------- Income --------
- Set VariableSet PlayerIncome[(Player number of (Owner of (Selling unit)))] = (PlayerIncome[(Player number of (Owner of (Selling unit)))] + 15)
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Else - Actions
- Player - Make Upgrade King Attack 5x Unavailable for training/construction by (Owner of (Selling unit))
- Player - Add 400 to (Owner of (Selling unit)).Current lumber
- Player - Add -400 to (Owner of (Selling unit)).Total lumber gathered
- Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Sold unit)) Equal to Upgrade King Regeneration 5x
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Current research level of King Regeneration (1) for Temp_Player) Less than (Max research level of King Regeneration (1) for Temp_Player)
-
Then - Actions
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Loop - Actions
- Unit - Increase level of King's Regeneration (Pseudoupgrade) for Temp_Unit
- Unit - Increase level of King's Regeneration (Pseudoupgrade) for Temp_Unit
- Unit - Increase level of King's Regeneration (Pseudoupgrade) for Temp_Unit
- Unit - Increase level of King's Regeneration (Pseudoupgrade) for Temp_Unit
- Unit - Increase level of King's Regeneration (Pseudoupgrade) for Temp_Unit
-
Loop - Actions
- Game - Display to (All allies of Temp_Player.) for 10.00 seconds the text: (((PlayerColor_String[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's regeneration to level |cffFFcc00) + ((String((Current research level of King Regeneration (1) for Temp_Player))) + |r))
- Set VariableSet UpgradesBought[(Player number of (Owner of (Selling unit)))] = (UpgradesBought[(Player number of (Owner of (Selling unit)))] + 5)
- -------- Income --------
- Set VariableSet PlayerIncome[(Player number of (Owner of (Selling unit)))] = (PlayerIncome[(Player number of (Owner of (Selling unit)))] + 15)
-
Player Group - Pick every player in (All allies of Temp_Player.) and do (Actions)
-
Else - Actions
- Player - Add 400 to (Owner of (Selling unit)).Current lumber
- Player - Add -400 to (Owner of (Selling unit)).Total lumber gathered
- Player - Make Upgrade King Regeneration 5x Unavailable for training/construction by (Owner of (Selling unit))
- Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
- -------- Update Income Multiboard --------
- Trigger - Run Update Income <gen> (ignoring conditions)
- -------- Clean --------
- Unit - Remove (Sold unit) from the game
- -------- Fx --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Temp_Player Equal to Player 9 (Gray)
-
Then - Actions
- Special Effect - Create a special effect at LKing using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
-
Else - Actions
- Special Effect - Create a special effect at RKing using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
-
If - Conditions
- Special Effect - Destroy (Last created special effect)
-
Events
- Player - Set the current research level of King Regeneration (1) to ((Current research level of King Regeneration (1) for (Picked player)) + 1) for (Picked player)
- Player - Set the current research level of King Regeneration (1) to ((Current research level of King Regeneration (1) for (Picked player)) + 5) for (Picked player)
- Player - Set the current research level of King Hit Points (1) to ((Current research level of King Hit Points (1) for (Picked player)) + 1) for (Picked player)
- Unit - Set level of King Life (Pseudoupgrade) for Temp_Unit to ((Current research level of King Hit Points (1) for (Owner of Temp_Unit)) + 1)
- Player - Set the current research level of King Hit Points (1) to ((Current research level of King Hit Points (1) for (Picked player)) + 5) for (Picked player)
- Unit - Set level of King Life (Pseudoupgrade) for Temp_Unit to ((Current research level of King Hit Points (1) for (Owner of Temp_Unit)) + 5)
- Set VariableSet UpgradesBought[(Player number of (Owner of (Selling unit)))] = (UpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
After some tries i changed it towards my second 5x trigger above and the "damage" is working so far but the another 2 i have been unable to get working.
I tried using the increase level of ability of unit for this one too seeing the another part (of the trigger) of the damage / attack of the king does that, but that did not work neither
- Unit - Set level of King Life (Pseudoupgrade) for Temp_Unit to ((Current research level of King Hit Points (1) for (Owner of Temp_Unit)) + 1)
It also gets bugged when there are less then 5 upgrade levels left (damage is level 60 max for example ) and the 5x gets used on level damage 56+ then the damage of the king, gets reset towards + 5 damage in total for the king instead of the +800 damage in total after fully upgraded with 60 levels of the damage in my legion td game.
I hope some one can help me with this one it would be great!
Last edited: