# [Trigger]Item pickup/drop problem

Status
Not open for further replies.

#### Section2129

Level 4
The problem i have is that, when a hero picks a horadric cube up, and the hero doesn't have one, he drops it, which he shouldn't. So if anyone can fix this, please help.

• Drop
• Events
• Unit - A unit owned by Player 1 (Red) Acquires an item
• Conditions
• (((Hero manipulating item) has an item of type Horadric Cube) Equal to True) and ((Item-type of (Item being manipulated)) Equal to Horadric Cube)
• Actions
• Hero - Drop (Item being manipulated) from (Hero manipulating item)

#### deathismyfriend

Level 29
Use a counter and loop through the items the player has and see if its greater than 1 if it is drop the item.

#### Spartipilo

Level 20
Change Hero Manipulating item for Triggering Unit

The hero doesn't have the item, but once he acquires it, you have an item of that type, so, you drop it.

If conditions are automatically nested with "and", so, there's no need to add "and" conditiones unless you use them inside an "or" block.

#### Legal_Ease

Level 20
Use a counter and loop through the items the player has and see if its greater than 1 if it is drop the item.

I like this solution, but another possibility would be to set a variable so if hero acquires HC then set HC = HC+1. In the next trigger if HC=2 then do "drop item HC." Basically the same as above. I don't know counters so I thought maybe he doesn't either. Deathismyfriend is always right though so try that first.

#### Section2129

Level 4
Use a counter and loop through the items the player has and see if its greater than 1 if it is drop the item.

How to do this?

#### Maker

Level 37
set integer = 0
integer A loop from 1 to 6
--if item type of item carried by triggering unit in slot integer A equal to cube then
----if integer equal to 0 then
------set integer = 1
----else
------drop item being manipulated
------Skip remaining actions
----endif

#### deathismyfriend

Level 29
Make posted it lol

Counters are easy just use a number set it to 0 then for every condition / instance set it equals it plus 1. When it is over the number then the counter is reached and u reset the counter to 0. Always use greater than or greater than or equal to. If u use number == 2 u can buy it up.

Status
Not open for further replies.

[Trigger] Drop Item Problem
Replies
4
Views
815
Replies
3
Views
618
Replies
18
Views
902
[Trigger] Item Drop
Replies
8
Views
905
Replies
7
Views
868