- Joined
- Jun 27, 2010
- Messages
- 2,763
In this trigger what I'm trying to do is to increase the computer players' heroes attributes. Eeach upgrade costs 150 gold. By default every player gets 1000 gold at the beginning of the game. So, I must calculate how much upgrades 1000 gold contains. However, in its current state, when this trigger is ran, the game crashes. If I disable the variables and attribute increase it doesn't crash EVEN IF THERE ARE NO COMPUTER PLAYERS.
-
Upgrade Items of Heroes
-
Events
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Player((Integer A))) controller) Equal to Computer
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Level Less than or equal to 6
-
-
Then - Actions
-
Hero - Create Item[(Random integer number between 1 and 100)] and give it to Hero[(Integer A)]
-
-
Else - Actions
-
-
Set TempGold_Real = (Real(((Player((Integer A))) Current gold)))
-
Set TempGold_Real = (TempGold_Real / 150.00)
-
Set TempGold = (Integer(TempGold_Real))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of Hero[(Integer A)]) Equal to Demon Hunter (9)
-
(Unit-type of Hero[(Integer A)]) Equal to Warden (10)
-
(Unit-type of Hero[(Integer A)]) Equal to Blademaster (4)
-
(Unit-type of Hero[(Integer A)]) Equal to Shadow Hunter (6)
-
(Unit-type of Hero[(Integer A)]) Equal to Dark Ranger (19)
-
(Unit-type of Hero[(Integer A)]) Equal to Firelord (20)
-
(Unit-type of Hero[(Integer A)]) Equal to Ranger (13)
-
-
-
-
Then - Actions
-
Hero - Modify Agility of Hero[(Integer A)]: Add TempGold
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of Hero[(Integer A)]) Equal to Paladin (1)
-
(Unit-type of Hero[(Integer A)]) Equal to Mountain King (2)
-
(Unit-type of Hero[(Integer A)]) Equal to Tauren Chieftain (5)
-
(Unit-type of Hero[(Integer A)]) Equal to Dreadlord (11)
-
(Unit-type of Hero[(Integer A)]) Equal to Crypt Lord (8)
-
(Unit-type of Hero[(Integer A)]) Equal to Alchemist (15)
-
(Unit-type of Hero[(Integer A)]) Equal to Tinker (17)
-
(Unit-type of Hero[(Integer A)]) Equal to Beastmaster (18)
-
(Unit-type of Hero[(Integer A)]) Equal to Pandaren Brewmaster (21)
-
(Unit-type of Hero[(Integer A)]) Equal to Pit Lord (22)
-
-
-
-
Then - Actions
-
Hero - Modify Strength of Hero[(Integer A)]: Add TempGold
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of Hero[(Integer A)]) Equal to Blood Mage (3)
-
(Unit-type of Hero[(Integer A)]) Equal to Lich (7)
-
(Unit-type of Hero[(Integer A)]) Equal to Warlock (14)
-
(Unit-type of Hero[(Integer A)]) Equal to Naga Sea Witch (16)
-
(Unit-type of Hero[(Integer A)]) Equal to Sorcerer (23)
-
(Unit-type of Hero[(Integer A)]) Equal to Archmage (12)
-
(Unit-type of Hero[(Integer A)]) Equal to Keeper of the Grove (24)
-
-
-
-
Then - Actions
-
Hero - Modify Intelligence of Hero[(Integer A)]: Add TempGold
-
-
Else - Actions
-
-
Player - Set (Player((Integer A))) Current gold to (((Player((Integer A))) Current gold) - (TempGold x 150))
-
-
Else - Actions
-
-
-
-
-