Not allowing two of same item in inventory

Level 3
Joined
Sep 17, 2004
Messages
24
For example, I want to make it so that once my hero picks up a weapon, he cannot have another one in his inventory. If he picks up a sword, then tries to pick up another weapon, i need triggers that wont let him do this. Same for shields, so that only one shield and one weapon can be equipped at a time. But if the weapon or shield is dropped, i want to be able to pick up another different weapon or shield.

I tried a variety of triggers
-Conditions
((Hero manipulating item) has an item of type Legion Sword) Equal to True
((Hero manipulating item) has an item of type Iron Ferrite Axe) Equal to True
((Hero manipulating item) has an item of type Legion Axe) Equal to True
((Hero manipulating item) has an item of type Sharpened Axe) Equal to True
((Hero manipulating item) has an item of type Sharpened Sword) Equal to True
((Hero manipulating item) has an item of type Steel Sword) Equal to True
((Hero manipulating item) has an item of type Steel Axe) Equal to True
((Hero manipulating item) has an item of type Titanium Sword) Equal to True

this is a list of all of my weapons, i tried giving the weapons a specific class and the shields a different class

(Item-class of (Item being manipulated)) Equal to Miscellaneous

I have no idea what to try next, i know there is a solution to this, but it is very complicated. If anyone has any idea, let me know
 
Level 8
Joined
Aug 3, 2008
Messages
391
This trigger won't let you have two items of the same class. Try it.

  • Item Classification
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • 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
              • And - All (Conditions) are true
                • Conditions
                  • (Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))
                  • (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A)))
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
            • Else - Actions
 
Top