Few bugs can appear with that triggers.
What will happen if the unit pick up 2 of those items, and then lose one of them? it's collor will change to teh original color but it still got one of those items...
My suggestion is that you'll make three Real varables, call them Red, Blue and Green and make one Integer varable, lets call it Amount for this case. Oh, and its improtant you to make the size of theese varables to the amount of players playin in your map.
Then add theese actions in the Map initialization:
-
Map
-
Events
-
Conditions
-
Actions
-
Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Actions)
-
Loop - Actions
-
Set Red[(Player number of (Picked player))] = 100.00
-
Set Green[(Player number of (Picked player))] = 100.00
-
Set Red[(Player number of (Picked player))] = 100.00
-
Set Amount[(Player number of (Picked player))] = 1
After that, creat a new trigger that should look like that:
-
Acquire Item
-
Events
-
Unit - A unit Acquires an item
-
Conditions
-
Actions
-
Set TriggeringUnit = (Triggering unit)
-
Set TriggeringPlayer = (Owner of TriggeringUnit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Purple Stone
-
Then - Actions
-
-------- This item will change color to purple (Red 300 / Green 0% / Blue 300) --------
-
Set Blue[(Player number of TriggeringPlayer)] = (Blue[(Player number of TriggeringPlayer)] + 300.00)
-
Set Green[(Player number of TriggeringPlayer)] = (Green[(Player number of TriggeringPlayer)] + 0.00)
-
Set Red[(Player number of TriggeringPlayer)] = (Red[(Player number of TriggeringPlayer)] + 300.00)
-
Set Amount[(Player number of TriggeringPlayer)] = (Amount[(Player number of TriggeringPlayer)] + 1)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Hardcore Purple Stone
-
Then - Actions
-
-------- This item will change color to pure purple (Red 1000 / Green -1000 / Blue 1000) --------
-
Set Blue[(Player number of TriggeringPlayer)] = (Blue[(Player number of TriggeringPlayer)] + 1000.00)
-
Set Green[(Player number of TriggeringPlayer)] = (Green[(Player number of TriggeringPlayer)] - 1000.00)
-
Set Red[(Player number of TriggeringPlayer)] = (Red[(Player number of TriggeringPlayer)] + 1000.00)
-
Set Amount[(Player number of TriggeringPlayer)] = (Amount[(Player number of TriggeringPlayer)] + 1)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Yellow Stone
-
Then - Actions
-
-------- This item will change color to yellow (Red 0 / Green 300 / Blue 300) --------
-
Set Blue[(Player number of TriggeringPlayer)] = (Blue[(Player number of TriggeringPlayer)] + 300.00)
-
Set Green[(Player number of TriggeringPlayer)] = (Green[(Player number of TriggeringPlayer)] + 300.00)
-
Set Red[(Player number of TriggeringPlayer)] = (Red[(Player number of TriggeringPlayer)] + 0.00)
-
Set Amount[(Player number of TriggeringPlayer)] = (Amount[(Player number of TriggeringPlayer)] + 1)
-
Else - Actions
-
Animation - Change TriggeringUnit's vertex coloring to ((Red[(Player number of TriggeringPlayer)] / (Real(Amount[(Player number of TriggeringPlayer)])))%, (Green[(Player number of TriggeringPlayer)] / (Real(Amount[(Player number of TriggeringPlayer)])))%, (Blue[(Player number of TriggeringPlayer)] / (Real(Amount[(Player number of TriggeringPlayer)])))%) with 0.00% transparency
-
Set TriggeringUnit = No unit
And another trigger:
-
Lose Item
-
Events
-
Unit - A unit Pawns an item (to shop)
-
Unit - A unit Loses an item
-
Conditions
-
Actions
-
Set TriggeringUnit = (Triggering unit)
-
Set TriggeringPlayer = (Owner of TriggeringUnit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Purple Stone
-
Then - Actions
-
Set Blue[(Player number of TriggeringPlayer)] = (Blue[(Player number of TriggeringPlayer)] - 300.00)
-
Set Green[(Player number of TriggeringPlayer)] = (Green[(Player number of TriggeringPlayer)] + 0.00)
-
Set Red[(Player number of TriggeringPlayer)] = (Red[(Player number of TriggeringPlayer)] - 300.00)
-
Set Amount[(Player number of TriggeringPlayer)] = (Amount[(Player number of TriggeringPlayer)] - 1)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Hardcore Purple Stone
-
Then - Actions
-
Set Blue[(Player number of TriggeringPlayer)] = (Blue[(Player number of TriggeringPlayer)] - 1000.00)
-
Set Green[(Player number of TriggeringPlayer)] = (Green[(Player number of TriggeringPlayer)] + 1000.00)
-
Set Red[(Player number of TriggeringPlayer)] = (Red[(Player number of TriggeringPlayer)] - 1000.00)
-
Set Amount[(Player number of TriggeringPlayer)] = (Amount[(Player number of TriggeringPlayer)] - 1)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Yellow Stone
-
Then - Actions
-
Set Blue[(Player number of TriggeringPlayer)] = (Blue[(Player number of TriggeringPlayer)] - 300.00)
-
Set Green[(Player number of TriggeringPlayer)] = (Green[(Player number of TriggeringPlayer)] - 300.00)
-
Set Red[(Player number of TriggeringPlayer)] = (Red[(Player number of TriggeringPlayer)] + 0.00)
-
Set Amount[(Player number of TriggeringPlayer)] = (Amount[(Player number of TriggeringPlayer)] - 1)
-
Else - Actions
-
Animation - Change TriggeringUnit's vertex coloring to ((Red[(Player number of TriggeringPlayer)] / (Real(Amount[(Player number of TriggeringPlayer)])))%, (Green[(Player number of TriggeringPlayer)] / (Real(Amount[(Player number of TriggeringPlayer)])))%, (Blue[(Player number of TriggeringPlayer)] / (Real(Amount[(Player number of TriggeringPlayer)])))%) with 0.00% transparency
-
Set TriggeringUnit = No unit
The advantage of this system is that you can pick and drop coloring items without getting somethin wrong.
In addition, you may fuse item's colors together (If you got one red coloring item and another blue coloring item then theese items will make your hero purple).
Hope I helped.