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

[General] will this restriction for item trigger work?

Status
Not open for further replies.
The point of this trigger is planned to be restriction for the types of items the hero can pick. Strength, intelligence and agility items are in three different clsses. My question here is will this work and if not how to?

  • Drop Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Hero_Class[(Player number of (Owner of (Triggering unit)))] Equal to Strength
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-class of (Item being manipulated)) Equal to Artifact
                  • (Item-class of (Item being manipulated)) Equal to Charged
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Hero_Class[(Player number of (Owner of (Triggering unit)))] Equal to Agility
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-class of (Item being manipulated)) Equal to Artifact
                  • (Item-class of (Item being manipulated)) Equal to Permanent
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Hero_Class[(Player number of (Owner of (Triggering unit)))] Equal to Intelligence
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-class of (Item being manipulated)) Equal to Permanent
                  • (Item-class of (Item being manipulated)) Equal to Charged
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
        • Else - Actions
 
Level 25
Joined
May 11, 2007
Messages
4,651
Also you don't need to use the "All Condition" for the If then else action.

The IF already checks if all of the conditions are true, so just move the stuff you have in the AND out of it and remove it.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
I use This in my own map and it Works.


  • IN Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set IN_ItemClass_String[1] = |cFFFF0000Helmet|r
      • Set IN_ItemClass_String[2] = |cFF6A798BArmor|r
      • Set IN_ItemClass_String[3] = |cFF7EBFF1Main-Hand|r
      • Set IN_ItemClass_String[4] = |cFF1CE6B9Off-Hand|r
      • Set IN_ItemClass_String[5] = |cFF00FF00Trinket|r
      • Set IN_ItemClass_String[6] = |cFF4E2A04Pair of Boots|r
  • Acquiring
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Not equal to Powerup
    • Actions
      • Set IN_Item_Index = 0
      • Set IN_Item_Slot = 0
      • For each (Integer IN_ItemClass_Index) from 1 to 7, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item level of (Item being manipulated)) Equal to IN_ItemClass_Index
            • Then - Actions
              • For each (Integer IN_Item_Slot) from 1 to 6, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item level of (Item carried by (Triggering unit) in slot IN_Item_Slot)) Equal to IN_ItemClass_Index
                    • Then - Actions
                      • Set IN_Item_Index = (IN_Item_Index + 1)
                    • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IN_Item_Index Greater than 1
                • Then - Actions
                  • Hero - Drop (Item being manipulated) from (Triggering unit)
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: (|cFFFFCC00You can only Carry 1|r + (IN_ItemClass_String[IN_ItemClass_Index] + |cFFFFCC00.|r))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Item-class of (Item being manipulated)) Equal to Miscellaneous
                          • IN_ItemClass_Index Equal to 5
                          • And - All (Conditions) are true
                            • Conditions
                              • (Item-class of (Item being manipulated)) Equal to Permanent
                              • (Unit-type of (Triggering unit)) Equal to |cFFFF0000Warrior|r
                          • And - All (Conditions) are true
                            • Conditions
                              • (Item-class of (Item being manipulated)) Equal to Artifact
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Triggering unit)) Equal to Mage
                                  • (Unit-type of (Triggering unit)) Equal to |cFFFFCC00Priest|r
                          • And - All (Conditions) are true
                            • Conditions
                              • (Item-class of (Item being manipulated)) Equal to Campaign
                              • (Unit-type of (Triggering unit)) Equal to Ranger
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • IN_ItemClass_Index Equal to 3
                              • IN_ItemClass_Index Equal to 4
                              • IN_ItemClass_Index Equal to 7
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • IN_ItemClass_Index Equal to 3
                            • Then - Actions
                              • For each (Integer IN_Item_Slot) from 1 to 6, do (Actions)
                                • Loop - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Item level of (Item carried by (Triggering unit) in slot IN_Item_Slot)) Equal to 7
                                    • Then - Actions
                                      • Set IN_Item_Index = (IN_Item_Index + 1)
                                    • Else - Actions
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • IN_ItemClass_Index Equal to 4
                                • Then - Actions
                                  • For each (Integer IN_Item_Slot) from 1 to 6, do (Actions)
                                    • Loop - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Item level of (Item carried by (Triggering unit) in slot IN_Item_Slot)) Equal to 7
                                        • Then - Actions
                                          • Set IN_Item_Index = (IN_Item_Index + 1)
                                        • Else - Actions
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • IN_ItemClass_Index Equal to 7
                                    • Then - Actions
                                      • For each (Integer IN_Item_Slot) from 1 to 6, do (Actions)
                                        • Loop - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Item level of (Item carried by (Triggering unit) in slot IN_Item_Slot)) Equal to 4
                                            • Then - Actions
                                              • Set IN_Item_Index = (IN_Item_Index + 1)
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (Item level of (Item carried by (Triggering unit) in slot IN_Item_Slot)) Equal to 3
                                                • Then - Actions
                                                  • Set IN_Item_Index = (IN_Item_Index + 1)
                                                • Else - Actions
                                    • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • IN_Item_Index Greater than 1
                            • Then - Actions
                              • Hero - Drop (Item being manipulated) from (Triggering unit)
                              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cFFFFCC00You Eithe...
                            • Else - Actions
                              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: (|cFFFFCC00Acquired:|r + (Name of (Item being manipulated)))
                        • Else - Actions
                          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: (|cFFFFCC00Acquired:|r + (Name of (Item being manipulated)))
                    • Else - Actions
                      • Hero - Drop (Item being manipulated) from (Triggering unit)
                      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cFFFFCC00Your Clas...
            • Else - Actions



Hope I helped.
 

Ardenian

A

Ardenian

I would strongly recommend using the IDS method. As far as I know/see your method is very inefficient and heavy, Arad MNK.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
I would strongly recommend using the IDS method. As far as I know/see your method is very inefficient and heavy, Arad MNK.

It has 7 Item types:

1. Helmet
2. Armor
3. Main-Hand
4. Off-Hand
5. Trinket
6. Boots
7. Two-Handed Weapon

and Certain Items are only available to a specific Hero Class (4 classes) and Some are available to all. (Trinket, Miscellaneous)


While Wielding a 2 handed weapon, you may not carry either a Main-Hand or Off-Hand, and Vica versa.


You say this doesn't require Heavy triggering? And This IS based on IDS.

Inefficient? Then Tell me on how to make it efficient, and I shall accept what you said.
 

Ardenian

A

Ardenian

There is no need to be pissed.

Eh, using the pure IDS is simply most comfortable, since it allows easy changes and additions.
 

Ardenian

A

Ardenian

No,
I don't want to go too much off-topic now,
but the IDS method only uses the item level for categorization while you use indexed variables and item categories like Power Up.
 

Ardenian

A

Ardenian

So what if you want to add more classes ? Then you have a problem, as you cannot add more item categories.
If you never going to add new classes it is fine.
 
Status
Not open for further replies.
Top