greenwich3
G
greenwich3
. please, i want to make a map with ai-controlled opponent.. it's concept is like a battle arena.. can you please teach me how to make the ai..
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
sorry hehe im just trying to help ^^Not to come off as rude, but that system is rather bad. It creates a significant amount of lag (due to the memory leaks).
You will also need dozens of triggers for the items alone.
And the AI isn't very intelligent, which removes the "I" in "AI" :/

And that's much appreciated!sorry hehe im just trying to help ^^![]()
Setup Items

Events


Map initialization

Conditions

Actions


-------- --------


Set AIItemCount = (AIItemCount + 1)


Set AIItemPrice[AIItemCount] = 900


Set AIItemType[AIItemCount] = Boots of Quel'Thalas +6


-------- --------


Set AIItemCount = (AIItemCount + 1)


Set AIItemPrice[AIItemCount] = 5000


Set AIItemType[AIItemCount] = Crown of Kings +5


-------- --------


Set AIItemCount = (AIItemCount + 1)


Set AIItemPrice[AIItemCount] = 2500


Set AIItemType[AIItemCount] = Orb of Frost


-------- --------


Set AIItemCount = (AIItemCount + 1)


Set AIItemPrice[AIItemCount] = 150


Set AIItemType[AIItemCount] = Gauntlets of Ogre Strength +3
AI Buy Item

Events


Unit - A unit enters Human Base <gen>


Unit - A unit enters Orc Base <gen>


Unit - A unit enters Undead Base <gen>


Unit - A unit enters Night Elf Base <gen>

Conditions


((Owner of (Triggering unit)) controller) Equal to Computer


((Triggering unit) is A Hero) Equal to True

Actions


For each (Integer A) from 1 to AIItemCount, do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






((Owner of (Triggering unit)) Current gold) Greater than or equal to AIItemPrice[(Integer A)]





Then - Actions






-------- Computer Player has enough gold --> Buy item --------






Hero - Create AIItemType[(Integer A)] and give it to (Triggering unit)






Player - Add (-1 x AIItemPrice[(Integer A)]) to (Owner of (Triggering unit)) Current gold






-------- Go back to area - removed location leak --------






Set loc = (Center of Mid <gen>)






Unit - Order (Triggering unit) to Attack-Move To loc






Custom script: call RemoveLocation(udg_loc)





Else - Actions
Setup Items

Events


Map initialization

Conditions

Actions


-------- --------


Set AIItemCount = (AIItemCount + 1)


Set AIItemPrice[AIItemCount] = 900


Set AIItemType[AIItemCount] = Boots of Quel'Thalas +6


Set AIItemHeroClass[AIItemCount] = agility


Set AIItemMinLevel[AIItemCount] = 2


-------- --------


Set AIItemCount = (AIItemCount + 1)


Set AIItemPrice[AIItemCount] = 5000


Set AIItemType[AIItemCount] = Crown of Kings +5


Set AIItemHeroClass[AIItemCount] = all


Set AIItemMinLevel[AIItemCount] = 6


-------- --------


Set AIItemCount = (AIItemCount + 1)


Set AIItemPrice[AIItemCount] = 2500


Set AIItemType[AIItemCount] = Orb of Frost


Set AIItemHeroClass[AIItemCount] = intel


Set AIItemMinLevel[AIItemCount] = 4


-------- --------


Set AIItemCount = (AIItemCount + 1)


Set AIItemPrice[AIItemCount] = 150


Set AIItemType[AIItemCount] = Gauntlets of Ogre Strength +3


Set AIItemHeroClass[AIItemCount] = strength


Set AIItemMinLevel[AIItemCount] = 1
Move Ai

Events


Time - Every 30.00 seconds of game time

Conditions

Actions


Set Random_Loc = (Random point in (Playable map area))


Unit Group - Pick every unit in Ai_Units and do (Actions)



Loop - Actions




Unit - Order (Picked unit) to Attack-Move To Random_Loc


Custom script: call RemoveLocation(udg_Random_Loc)
Revive Ai

Events


Unit - A unit Dies

Conditions


((Triggering unit) is in Ai_Units) Equal to True


((Triggering unit) is Summoned) Equal to False

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Number of items carried by (Triggering unit)) Greater than 5



Then - Actions




Hero - Drop (Item carried by (Triggering unit) in slot (Random integer number between 1 and 6)) from (Triggering unit)



Else - Actions


Wait 20.00 seconds


Set AITempLoc = ((Owner of (Triggering unit)) start location)


Hero - Instantly revive (Triggering unit) at AITempLoc, Show revival graphics


Custom script: call RemoveLocation(udg_AITempLoc)
Give item Ai

Events


Unit - A unit Finishes reviving

Conditions


And - All (Conditions) are true



Conditions




((Triggering unit) is in Ai_Units) Equal to True




(Number of items carried by (Triggering unit)) Less than 6




(Random integer number between 1 and 2) Equal to 1

Actions


Hero - Create (Random level (Random integer number between 1 and 7) item-type) and give it to (Triggering unit)
SkillsArchimond

Events


Unit - Archimonde 0107 <gen> Gains a level

Conditions

Actions


Hero - Learn skill for (Leveling Hero): Dark Portal (Archimonde)


Hero - Learn skill for (Leveling Hero): Finger of Death (Archimonde)


Hero - Learn skill for (Leveling Hero): Bash


Hero - Learn skill for (Leveling Hero): Rain of Chaos (Archimonde)
Archimonde

Events


Unit - Archimonde 0107 <gen> Takes damage

Conditions


(Damage taken) Greater than or equal to 25.00


A1Castspell of (Damage source))


Set DS_Unit = (Damage source)


If (All Conditions are Equal to True

Actions


Set A1Castspell = False


Set SourceLoc = (Position True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Level of Dark Portal (Archimonde) for Archimonde 0107 <gen>) Greater than or equal to 1




(Damage taken) Less than or equal to 75.00



Then - Actions




Unit - Order Archimonde 0107 <gen> to Special Archimonde - Dark Portal SourceLoc



Else - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Level of Rain of Chaos (Archimonde) for Archimonde 0107 <gen>) Greater than or equal to 1






(Damage taken) Greater than 125.00





Then - Actions






Unit - Order Archimonde 0107 <gen> to Special Archimonde - Rain Of Chaos SourceLoc





Else - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








(Level of Finger of Death (Archimonde) for Archimonde 0107 <gen>) Greater than or equal to 1







Then - Actions








Unit - Order Archimonde 0107 <gen> to Special Archimonde - Finger Of Death DS_Unit







Else - Actions








Unit - Order Archimonde 0107 <gen> to Attack DS_Unit






Set DS_Unit = No unit


Custom script: call RemoveLocation(udg_SourceLoc)


Wait 30.00 seconds


Set A1Castspell = True
