• 🏆 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!

[Trigger] One type of item system

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
Any idea why this one-type item system doesn't work ?

It just automaticly throws items, even if you don't have any in your inventory.

  • One type equipment
    • 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
              • (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot (Integer A)))
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item being manipulated)) Equal to Artifact
        • Then - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-class of (Item being manipulated)) Equal to Permanent
            • Then - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-class of (Item being manipulated)) Equal to Purchasable
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-class of (Item being manipulated)) Equal to Campaign
                    • Then - Actions
                      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ...
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Item-class of (Item being manipulated)) Equal to Miscellaneous
                        • Then - Actions
                          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ...
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Item-class of (Item being manipulated)) Equal to Powerup
                            • Then - Actions
                              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ...
                            • Else - Actions
 
Level 8
Joined
Dec 8, 2007
Messages
312
It's simple. Your firs action (For each (Integer A) from 1 to 6, do (Actions)) is to drop item of the same class that Item being manipulated. This part of trigger will allways find item that hero just acquired and drop it.
 
Level 5
Joined
Oct 12, 2004
Messages
109
try this, im not sure if it will work but it might

  • Actions
    • Item - Set the custom value of (Item being manipulated) to 1
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot (Integer A)))) and ((Custom value of (Item carried by (Triggering unit) in slot (Integer A))) Equal to 0)
      • Then - Actions
        • Hero - Drop (Item being manipulated) from (Triggering unit)
      • Else - Actions
        • Skip remaining actions
    • Item - Set the custom value of (Item being manipulated) to 0

EDIT i don't know why my first post posted so late. i posted it like 30 min before the other dudes so sorry about the double post.
 
Last edited:
Level 6
Joined
Nov 28, 2007
Messages
203
u don't need to set a custom value and check it. You just need to use the second condition that's like this:
  • ((Item Being Manipulated) not equal to (Item Carried By (Hero Manipulating Item) in slot (Integer A))
 
Level 6
Joined
Feb 2, 2005
Messages
205
The Trigger fires after the item is in the inventory, so the condition is always true, because the hero has the item of that class. This loop should work. hf.

  • 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 (Hero manipulating item) in slot (Integer A))) Equal to Artifact
          • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
        • Then - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You can carry only ...
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
 
Status
Not open for further replies.
Top