- Joined
- Jun 27, 2010
- Messages
- 2,763
I'm making a trigger that allows the player to upgrade his abilities to higher level in exchange for lumber. These abilities are linked with items. If you have the item you have the ability. These items are ability items. The items and the abilities set in array variable to be easy for me to call them.
The thing I want to do is when you drop an item on specific* unit-type shop to upgrade it, or if you don't have enough lumber to refund it. Here's the trigger and it's not working. When I drop the item on the shop nothing happens. See what you can help me about that?
the set_player_upgrade_X is integer that stores the level of the ability for the player so you can recall it later.
The thing I want to do is when you drop an item on specific* unit-type shop to upgrade it, or if you don't have enough lumber to refund it. Here's the trigger and it's not working. When I drop the item on the shop nothing happens. See what you can help me about that?
-
Upgrade
-
Events
-
Unit - A unit Pawns an item (to shop)
-
-
Conditions
-
(Unit-type of (Buying unit)) Equal to Abyss (Team 1)
-
-
Actions
-
Set Temp_Upgrading_Player = (Owner of (Item being manipulated))
-
For each (Integer A) from 1 to 100, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Item[(Integer A)]
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Temp_Upgrading_Player Current lumber) Greater than or equal to 5
-
-
Then - Actions
-
Set Temp_Upgrade_number[(Integer A)] = (Integer A)
-
Hero - Create Item[(Integer A)] and give it to Hero[(Player number of Temp_Upgrading_Player)]
-
Unit - Increase level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)]
-
Player - Set Temp_Upgrading_Player Current lumber to ((Temp_Upgrading_Player Current lumber) - 10)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 1 (Red)
-
-
Then - Actions
-
Set PLayer_Upgrades_1[Temp_Upgrade_number[1]] = (PLayer_Upgrades_1[Temp_Upgrade_number[1]] + 1)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 2 (Blue)
-
-
Then - Actions
-
Set PLayer_Upgrades_2[Temp_Upgrade_number[2]] = (PLayer_Upgrades_2[Temp_Upgrade_number[2]] + 1)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 3 (Teal)
-
-
Then - Actions
-
Set PLayer_Upgrades_3[Temp_Upgrade_number[3]] = (PLayer_Upgrades_3[Temp_Upgrade_number[3]] + 1)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 4 (Purple)
-
-
Then - Actions
-
Set PLayer_Upgrades_4[Temp_Upgrade_number[4]] = (PLayer_Upgrades_4[Temp_Upgrade_number[4]] + 1)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 5 (Yellow)
-
-
Then - Actions
-
Set PLayer_Upgrades_5[Temp_Upgrade_number[5]] = (PLayer_Upgrades_5[Temp_Upgrade_number[5]] + 1)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 6 (Orange)
-
-
Then - Actions
-
Set PLayer_Upgrades_6[Temp_Upgrade_number[6]] = (PLayer_Upgrades_6[Temp_Upgrade_number[6]] + 1)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 7 (Green)
-
-
Then - Actions
-
Set PLayer_Upgrades_7[Temp_Upgrade_number[7]] = (PLayer_Upgrades_7[Temp_Upgrade_number[7]] + 1)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 8 (Pink)
-
-
Then - Actions
-
Set PLayer_Upgrades_8[Temp_Upgrade_number[8]] = (PLayer_Upgrades_8[Temp_Upgrade_number[8]] + 1)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 9 (Gray)
-
-
Then - Actions
-
Set PLayer_Upgrades_9[PLayer_Upgrades_9[Temp_Upgrade_number[9]]] = (PLayer_Upgrades_9[Temp_Upgrade_number[9]] + 1)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 10 (Light Blue)
-
-
Then - Actions
-
Set PLayer_Upgrades_10[Temp_Upgrade_number[10]] = (PLayer_Upgrades_10[Temp_Upgrade_number[10]] + 1)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Temp_Upgrading_Player Current lumber) Less than 5
-
-
Then - Actions
-
Player - Add 5 to Temp_Upgrading_Player Current lumber
-
Hero - Create Item[(Integer A)] and give it to Hero[(Player number of Temp_Upgrading_Player)]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 1 (Red)
-
-
Then - Actions
-
Unit - Set level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)] to PLayer_Upgrades_1[Temp_Upgrade_number[1]]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 2 (Blue)
-
-
Then - Actions
-
Unit - Set level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)] to PLayer_Upgrades_2[Temp_Upgrade_number[2]]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 3 (Teal)
-
-
Then - Actions
-
Unit - Set level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)] to PLayer_Upgrades_3[Temp_Upgrade_number[3]]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 4 (Purple)
-
-
Then - Actions
-
Unit - Set level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)] to PLayer_Upgrades_4[Temp_Upgrade_number[(Integer A)]]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 5 (Yellow)
-
-
Then - Actions
-
Unit - Set level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)] to PLayer_Upgrades_5[Temp_Upgrade_number[5]]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 6 (Orange)
-
-
Then - Actions
-
Unit - Set level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)] to PLayer_Upgrades_6[Temp_Upgrade_number[5]]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 7 (Green)
-
-
Then - Actions
-
Unit - Set level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)] to PLayer_Upgrades_7[Temp_Upgrade_number[7]]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 8 (Pink)
-
-
Then - Actions
-
Unit - Set level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)] to PLayer_Upgrades_8[Temp_Upgrade_number[8]]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 9 (Gray)
-
-
Then - Actions
-
Unit - Set level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)] to PLayer_Upgrades_9[Temp_Upgrade_number[9]]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Temp_Upgrading_Player Equal to Player 10 (Light Blue)
-
-
Then - Actions
-
Unit - Set level of Ability[(Integer A)] for Hero[(Player number of Temp_Upgrading_Player)] to PLayer_Upgrades_10[Temp_Upgrade_number[10]]
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
-
-