| 05-24-2008, 06:43 PM | #1 |
Code:
AI Item Build Set
Events
Time - Elapsed game time is 0.20 seconds
Conditions
Actions
For each (Integer AI_Build_Setup) from 1 to 12, do (Actions)
Loop - Actions
Set Temp_Region_Center = (Center of Bows <gen>)
Item - Create Fire Bow Scroll at Temp_Region_Center
Item - Create Lightning Bow Scroll at Temp_Region_Center
Item - Create Ice Bow Scroll at Temp_Region_Center
Custom script: call RemoveLocation(udg_Temp_Region_Center)
Set Temp_Region_Center = (Center of Special Item <gen>)
Item - Create Double Shot at Temp_Region_Center
Item - Create Mana Steal at Temp_Region_Center
Item - Create Starfall at Temp_Region_Center
Custom script: call RemoveLocation(udg_Temp_Region_Center)
Set MD = 1
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Boots of Speed
Set Item_Price[MDArray] = 20
Set Next_Item[AI_Build_Setup] = Boots of Speed
Set Next_Item_Price[AI_Build_Setup] = 20
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Boots of Speed
Set Item_Price[MDArray] = 20
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Uber Boots Scroll
Set Item_Price[MDArray] = 35
Set Rand_Int5 = (Random integer number between 1 and 2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Rand_Int5 Equal to 1
Then - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Improved Bow
Set Item_Price[MDArray] = 100
Set Temp_Item2 = (Random item in Bows <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 50
Item - Remove Temp_Item2
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Improved Bow
Set Item_Price[MDArray] = 100
Set Temp_Item2 = (Random item in Bows <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 50
Item - Remove Temp_Item2
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Improved Bow
Set Item_Price[MDArray] = 100
Set Temp_Item2 = (Random item in Bows <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 50
Item - Remove Temp_Item2
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Ring of Regeneration
Set Item_Price[MDArray] = 15
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Health Stone
Set Item_Price[MDArray] = 25
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Greater Health Stone
Set Item_Price[MDArray] = 50
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Mega Stone Scroll
Set Rand_Int5 = (Random integer number between 1 and 2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Rand_Int5 Equal to 1
Then - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set Rand_Int5 = (Random integer number between 1 and 2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Rand_Int5 Equal to 1
Then - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Archer Mastery
Set Item_Price[MDArray] = 150
Else - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Lifesteal
Set Item_Price[MDArray] = 70
Else - Actions
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set Rand_Int5 = (Random integer number between 1 and 2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Rand_Int5 Equal to 1
Then - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Archer Mastery
Set Item_Price[MDArray] = 150
Else - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Lifesteal
Set Item_Price[MDArray] = 70
Else - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Ring of Regeneration
Set Item_Price[MDArray] = 15
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Health Stone
Set Item_Price[MDArray] = 25
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Greater Health Stone
Set Item_Price[MDArray] = 50
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Mega Stone Scroll
Set Item_Price[MDArray] = 20
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Improved Bow
Set Item_Price[MDArray] = 100
Set Temp_Item2 = (Random item in Bows <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 50
Item - Remove Temp_Item2
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Improved Bow
Set Item_Price[MDArray] = 100
Set Temp_Item2 = (Random item in Bows <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 50
Item - Remove Temp_Item2
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Improved Bow
Set Item_Price[MDArray] = 100
Set Temp_Item2 = (Random item in Bows <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 50
Item - Remove Temp_Item2
Set Rand_Int5 = (Random integer number between 1 and 2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Rand_Int5 Equal to 1
Then - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set Rand_Int5 = (Random integer number between 1 and 2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Rand_Int5 Equal to 1
Then - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Archer Mastery
Set Item_Price[MDArray] = 150
Else - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Lifesteal
Set Item_Price[MDArray] = 70
Else - Actions
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set Temp_Item2 = (Random item in Special Item <gen>)
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = (Item-type of Temp_Item2)
Set Item_Price[MDArray] = 30
Item - Remove Temp_Item2
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Critical Strike
Set Item_Price[MDArray] = 60
Set Rand_Int5 = (Random integer number between 1 and 2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Rand_Int5 Equal to 1
Then - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Archer Mastery
Set Item_Price[MDArray] = 150
Else - Actions
Set MD = (MD + 1)
Set MDArray = (AI_Build_Setup + (12 x MD))
Set AI_Build[MDArray] = Lifesteal
Set Item_Price[MDArray] = 70Code:
AI Buy 1
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering player) Current gold) Greater than or equal to Next_Item_Price[(Player number of (Triggering player))]
(HERO[(Player number of (Triggering player))] is alive) Equal to True
Current_Item[(Player number of (Triggering player))] Less than 22
Then - Actions
Trigger - Turn off (This trigger)
Hero - Create Next_Item[(Player number of (Triggering player))] and give it to HERO[(Player number of (Triggering player))]
Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - Next_Item_Price[(Player number of (Triggering player))])
Set Current_Item[(Player number of (Triggering player))] = (Current_Item[(Player number of (Triggering player))] + 1)
Set Next_Item[(Player number of (Triggering player))] = AI_Build[((Player number of (Triggering player)) + (12 x Current_Item[(Player number of (Triggering player))]))]
Set Item_Price[(Player number of (Triggering player))] = Item_Price[((Player number of (Triggering player)) + (12 x Current_Item[(Player number of (Triggering player))]))]
Trigger - Turn on (This trigger)
Else - ActionsThe ai set trigger sets the item build for AI players in a fake multidimensional array. The buy trigger (event is player 1-12 gold becomes greater than 0) buys items for the AI. but for some reason, it skips some items at times? i do not think its the set trigger because i used game text messages and the skipped item shows up on the list, but not in the inventory. |
