Item of Only One Type

Undead_Lives

New Member
Ok, so in my map I want Heroes only able to carry one item of a type. (In my case it's Campaign)
So here's the trigger, but it doesn't work...need help...
Code:
Campaign Items
????Events
????????Unit - A unit Acquires an item
????Conditions
????????(Item-class of (Picked item)) Equal to Campaign
????Actions
????????For each (Integer A) from 1 to 6, do (Actions)
????????????Loop - Actions
????????????????If (All Conditions are True) then do (Then Actions) else do (Else Actions)
????????????????????If - Conditions
????????????????????????(Item-class of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Campaign
????????????????????Then - Actions
????????????????????????Hero - Drop (Matching item) from (Triggering unit)
????????????????????Else - Actions
????????????????????????Hero - Give (Matching item) to (Triggering unit)
Help anyone? What am I doing wrong?
 
Werbung:

ragingspeedhorn

New Member
The way I see it is that you have done so if he just has that item he drops it, right? Shouldent you do so if the number of that type of item is greater than 1 drop?
 

Xeridanus

New Member
Code:
Campaign Items
????Events
????????Unit - A unit Acquires an item
????Conditions
????????(Item-class of [b](Picked item)[/b]) Equal to Campaign
????Actions
????????For each (Integer A) from 1 to 6, do (Actions)
????????????Loop - Actions
????????????????If (All Conditions are True) then do (Then Actions) else do (Else Actions)
????????????????????If - Conditions
????????????????????????(Item-class of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Campaign [u]and (Item carried by (Triggering Unit) in slot (Integer A)) not equal to (Item being manipulated)[/u]
????????????????????Then - Actions
????????????????????????Hero - Drop [b](Matching item)[/b] from (Triggering unit)
????????????????????Else - Actions
????????????????????????Hero - Give [b](Matching item)[/b] to (Triggering unit)
The bits in bold are wrong, but I can't find my warcraft III cd in my pile of junk I call a desk so I can't get the right one for you. If memory serves me well (and it hasn't very often) then it should be (Item being manipulated). One more thing, your conditions as they are will drop the item being pickd up even when there is no other item being carried. I have also fixed this in your code.

EDIT: hmmm, the tags don't work inside the code tag.
 

Xeridanus

New Member
Yes I'm sure about Integer A, I've got one myself with items and it works.
Sorry bout delay, the update caught me off-guard.
 
Werbung:
Top