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.
Trigger
Event

A unit enters Playable Map Area
Conditions

(Triggering Unit) is a Hero Equal to True

Custom value of (Triggering Unit) equal to 0
Actions

Set HeroIndex = HeroIndex+1

Unit - Set Custom Value of (Triggering Unit) equal to HeroIndex
simply check if the gold variable [heroIndex] is higher than the price of item bougjt. and then remove the ammout from the variable.
if you need the whole trigger done tell me and i can post it here
To share gold with triggers you have to, manually set the gold bounty for each unit or detect the bounty received by the killing unit from the object editor (by detecting the difference between his gold before and after the kill, then dividing it by 2, and giving it to everyone in range).
Chaosy is up to help you If you can't do it by yourself.
Index units

Events


Unit - A unit enters (Playable map area)

Conditions


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


(Custom value of (Triggering unit)) Equal to 0

Actions


Set Unit_index = (Unit_index + 1)


Unit - Set the custom value of (Triggering unit) to Unit_index
Obtain custom gold

Events


Unit - A unit Dies

Conditions


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

Actions


-------- Here you got two choises, make every unit give the same ammout of custom gold or not. --------


-------- This does not include the gold share but just lower the prices a little and thats fine --------


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



If - Conditions




(Unit-type of (Dying unit)) Equal to Footman



Then - Actions




Set CustomGold_value[(Custom value of (Dying unit))] = (CustomGold_value[(Custom value of (Dying unit))] + 10)



Else - Actions


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



If - Conditions




(Unit-type of (Dying unit)) Equal to Knight



Then - Actions




Set CustomGold_value[(Custom value of (Dying unit))] = (CustomGold_value[(Custom value of (Dying unit))] + 15)



Else - Actions
Use custom gold

Events


Unit - A unit Sells an item (from shop)

Conditions

Actions


-------- Make sure that items available in the shop got the gold cost 0 --------


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



If - Conditions




(Item-type of (Sold Item)) Equal to Tome of Experience




CustomGold_value[(Custom value of (Buying unit))] Greater than or equal to 150



Then - Actions




Set CustomGold_value[(Custom value of (Buying unit))] = (CustomGold_value[(Custom value of (Buying unit))] - 150)



Else - Actions




Item - Remove (Sold Item)


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


-------- And so on for every item, very simple --------


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


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



If - Conditions




(Item-type of (Sold Item)) Equal to Keg of Thunderwater




CustomGold_value[(Custom value of (Buying unit))] Greater than or equal to 75



Then - Actions




Set CustomGold_value[(Custom value of (Buying unit))] = (CustomGold_value[(Custom value of (Buying unit))] - 75)



Else - Actions




Item - Remove (Sold Item)
AI Item Buy
Events
Conditions
((Owner of (Triggering unit)) is in AI_Players) Equal to True
((Triggering unit) is A Hero) Equal to True
Actions
For each (Integer A) from 1 to Configure_Max_Item, 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 AI_ItemCost[(Integer A)]
(Item-type of (Item carried by (Triggering unit) of type AI_Item[(Integer A)])) Not equal to AI_Item[(Integer A)]
Then - Actions
Hero - Create AI_Item[(Integer A)] and give it to (Triggering unit)
Player - Add (0 - AI_ItemCost[(Integer A)]) to (Owner of (Triggering unit)) Current gold
Else - Actions
AI Item Buy
Events
Conditions
((Owner of (Triggering unit)) is in AI_Players) Equal to True
((Triggering unit) is A Hero) Equal to True
Actions
For each (Integer A) from 1 to Configure_Max_Item, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
custom value of unit is greater or equal to item cost here
(Item-type of (Item carried by (Triggering unit) of type AI_Item[(Integer A)])) Not equal to AI_Item[(Integer A)]
Then - Actions
Hero - Create AI_Item[(Integer A)] and give it to (Triggering unit)
Set customgold_value = custom value of triggering unit - gold cost here
Else - Actions
if you need help tomarrow im up for it, your project seems very nice but request with p
pm insted of spamming here
