Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Hello everyone, i would like to ask for your help if do you know how to make an AI pick a certain tome from the enemy hero they killed? thanks in advance
Soryy for the late Reply is this how i do it? i've also added some chances to it
Hero Killed Tomes bonus
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
((Killing unit) belongs to an enemy of (Owner of (Dying unit))) Equal to True
Actions
Set Killing_bonus_chance = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Killing unit)) controller) Equal to Computer
((Killing unit) is Stunned) Equal to False
Killing_bonus_chance Less than or equal to 75
Then - Actions
Item - Create Tome of Regeneration at (Position of (Killing unit))
Unit Group - Pick every unit in (Units within 400.00 of (Position of (Last created item)) matching ((((Matching unit) is paused) Equal to False) and ((((Matching unit) is Stunned) Equal to False) and ((((Matching unit) is an illusion) Equal to False) and ((((Matching unit) is alive) Equal t and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Wait until ((((Killing unit) is paused) Equal to False) or ((((Killing unit) is invulnerable) Equal to False) or (((Killing unit) is Stunned) Equal to False))), checking every 0.10 seconds
Unit - Order (Picked unit) to Right-Click (Last created item)
Else - Actions
Unit - Order (Picked unit) to Right-Click (Last created item)
Unit - Order (Killing unit) to Right-Click (Last created item)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Killing unit)) controller) Equal to User
Killing_bonus_chance Less than or equal to 35
Then - Actions
Item - Create Tome of Regeneration at (Position of (Dying unit))
That's the idea but some of your Matching conditions don't seem necessary. You could probably get away with simplifying it to this:
Hero Killed Tomes bonus
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
((Killing unit) belongs to an enemy of (Owner of (Dying unit))) Equal to True
Actions
Set Killing_bonus_chance = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Killing unit)) controller) Equal to Computer
Killing_bonus_chance Less than or equal to 75
Then - Actions
Item - Create Tome of Regeneration at (Position of (Killing unit))
Unit Group - Pick every unit in (Units within 400.00 of (Position of (Last created item)) matching ((((Matching unit) is a Hero) Equal to True and ((Owner of (Matching unit)) controller) Equal to Computer and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Right-Click (Last created item)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Killing unit)) controller) Equal to User
Killing_bonus_chance Less than or equal to 35
Then - Actions
Item - Create Tome of Regeneration at (Position of (Dying unit))
Else - Actions
Now any computer Heroes within 400 range of the Tome will try to pick it up.
Note that this trigger has memory leaks, something you may want to look into.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.