• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How can i allow ONE ITEM of type to hero? (drop if more than one)

Status
Not open for further replies.
Level 13
Joined
Mar 4, 2009
Messages
1,156
Unit acquiers an item [2 items of that type are in his inventory] -drop item

ok so i want my hero to be able to use some item of type but that he cannot have 2 of them.....

  • Drop item if more than one of that type is in inventory
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to (My Item)
  • <<<<drop if hero has 2 items of type (My Item)>>>>
    • Actions
      • Hero - Drop (Item being manipulated) from (Hero manipulating item)
......:hohum:
 
Last edited:
Hmmm... So you want a system, that allows unit to only have one type of item in it's inventory?

Dunno never tried that, but I would assign a value (integer) to the "first" item as you pick it up. So you leave actions as they are + you add an if/then/else that checks if the "value" is greater than 2, then drop one item.

Also you can do it with custom values, but that can be tricky...

~Berz
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Whatever you do don´t try this....xD (it will crash your warcraft 3)
  • drop Mask of Death
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Mask of Death
    • Actions
      • Item - Remove (Item being manipulated)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has an item of type Mask of Death) Not equal to True
        • Then - Actions
          • Hero - Create Mask of Death and give it to (Hero manipulating item)
        • Else - Actions
          • Item - Create Mask of Death at (Position of (Hero manipulating item))

i was doing something like this before:hohum:,but it will work on just one item (enough for me xD)

  • Mask of Death acquires
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Mask of Death
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (ability with no icon and effect)-chanell for (Hero manipulating item)) Equal to 1
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
      • Unit - Add (ability with no icon and effect)-chanell to (Hero manipulating item)
  • Mask of Ddeath lost
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Mask of Death
    • Actions
      • Unit - Remove (ability with no icon and effect)-chanell from (Hero manipulating item)
anyway this is not solved jet........
 
Status
Not open for further replies.
Top