- Joined
- Sep 26, 2005
- Messages
- 40
I've been working on this for hours now. i am trying to figure out if there is a way to count the number of items owned by a unit.. not the charges. the amount of individual items.
the only way i've been able to figure out is dropping the items from the hero and then doing a pick every item in playable map area.. then giving it back to the hero but i dont like the result because i need this check performed every single time the hero attacks.. and it's a pain if item slot swapping mid-attack.
there has got to be a way to simply count how many of that type is owned.
or maybe even some way to perform an item slot check in a loop where each time conditions check the type of item i could have a var +1 itself.
so far this is what i got and i dont like it.
---------------------------------------
Caustic Trident
Events
Unit - A unit Is attacked
Conditions
((Attacking unit) has an item of type ITEM) Equal to True
((Owner of (Attacked unit)) is an enemy of (Owner of (Attacking unit))) Equal to True
Actions
Set ItemVarInt = 0
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Item - Pick every item in (Playable map area) and do (Actions)
Loop - Actions
Hero - Give (Picked item) to (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Attacking unit) has an item of type (Item-type of (Picked item))) Equal to True
((Attacking unit) has (Picked item)) Equal to True
(Item-type of (Picked item)) Equal to ITEM
Then - Actions
Set ItemVarInt = (ItemVarInt + 1)
Else - Actions
Do nothing
-----------------------------------------------------------
the only way i've been able to figure out is dropping the items from the hero and then doing a pick every item in playable map area.. then giving it back to the hero but i dont like the result because i need this check performed every single time the hero attacks.. and it's a pain if item slot swapping mid-attack.
there has got to be a way to simply count how many of that type is owned.
or maybe even some way to perform an item slot check in a loop where each time conditions check the type of item i could have a var +1 itself.
so far this is what i got and i dont like it.
---------------------------------------
Caustic Trident
Events
Unit - A unit Is attacked
Conditions
((Attacking unit) has an item of type ITEM) Equal to True
((Owner of (Attacked unit)) is an enemy of (Owner of (Attacking unit))) Equal to True
Actions
Set ItemVarInt = 0
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Hero - Drop (Item carried by (Attacking unit) of type ITEM) from (Attacking unit)
Item - Pick every item in (Playable map area) and do (Actions)
Loop - Actions
Hero - Give (Picked item) to (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Attacking unit) has an item of type (Item-type of (Picked item))) Equal to True
((Attacking unit) has (Picked item)) Equal to True
(Item-type of (Picked item)) Equal to ITEM
Then - Actions
Set ItemVarInt = (ItemVarInt + 1)
Else - Actions
Do nothing
-----------------------------------------------------------