• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Item set trigger not working as intended.

Status
Not open for further replies.
Level 6
Joined
Jan 8, 2009
Messages
140
I'm trying to make some triggers to incorporate item sets, but it's not really functioning properly. If a unit aquires both items in the set, both items are removed and two identical items with different descriptions are created and given to that unit, this works. The dropping part doesn't really work at all, it needs to drop both items, and create the non-complete set description item of the non-dropped item. However i think it's clashing with an item-class based restriction in the same trigger. If anyone could point me in the right direction it'd be great.

A quick explanation of a couple things the Main Hand and Off Hand abilities I add are placeholder, unresearched abilities for item abilities if the player hasn't got a suitable item in their inventory.

All the repeated ability removal was because it seemed to keep adding them again.

  • Main Hand
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • 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 (Item-class of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Hero - Drop the item from slot (Integer A) of (Hero manipulating item)
              • Quest - Display to (Player group((Owner of (Hero manipulating item)))) the Warning message: Only one main-hand ...
            • Else - Actions
              • For each (Integer loopA) from 1 to WeaponCountMH, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-type of (Item being manipulated)) Equal to WeaponsMH[loopA]
                    • Then - Actions
                      • Unit - Remove Main Hand from (Triggering unit)
                      • Unit - Add WeaponAbilitiesMH[loopA] to (Triggering unit)
                      • -------- ----- SETS ----- --------
                      • -------- Slashers of the Night --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Item-type of (Item being manipulated)) Equal to |cFF640CB4Elven Slasher|r
                        • Then - Actions
                          • For each (Integer loopB) from 1 to 6, do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Item-type of (Item carried by (Triggering unit) in slot loopB)) Equal to |cFF640CB4Elven Slasher|r
                                • Then - Actions
                                  • Unit - Remove Elven Slasher (Left) from (Triggering unit)
                                  • Unit - Remove Elven Slasher (Right) from (Triggering unit)
                                  • Item - Remove (Item carried by (Triggering unit) in slot loopB)
                                  • Item - Remove (Item being manipulated)
                                  • Hero - Create |cFF640CB4Elven Slasher|r (2/2) and give it to (Triggering unit)
                                  • Hero - Create |cFF640CB4Elven Slasher|r (2/2) and give it to (Triggering unit)
                                  • Unit - Remove Elven Slasher (Left) from (Triggering unit)
                                  • Unit - Remove Elven Slasher (Right) from (Triggering unit)
                                  • Unit - Remove Main Hand from (Triggering unit)
                                  • Unit - Remove Off Hand from (Triggering unit)
                                  • Unit - Add Elven Slasher (Left) to (Triggering unit)
                                  • Unit - Add Elven Slasher (Right) to (Triggering unit)
                                • Else - Actions
                        • Else - Actions
                    • Else - Actions
  • Lose
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Not equal to |cFF640CB4Elven Slasher|r (2/2)
          • (Item-type of (Item being manipulated)) Not equal to |cFF640CB4Elven Slasher|r (2/2)
        • Then - Actions
          • -------- Main Hand --------
          • For each (Integer loopA) from 1 to WeaponCountMH, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to WeaponsMH[loopA]
                • Then - Actions
                  • Unit - Remove WeaponAbilitiesMH[loopA] from (Triggering unit)
                  • Unit - Add Main Hand to (Triggering unit)
                • Else - Actions
          • -------- Off Hand --------
          • For each (Integer loopA) from 1 to WeaponCountMH, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to WeaponsMH[loopA]
                • Then - Actions
                  • Unit - Remove WeaponAbilitiesOH[loopA] from (Triggering unit)
                  • Unit - Add Off Hand to (Triggering unit)
                • Else - Actions
        • Else - Actions
          • Trigger - Turn off Main Hand <gen>
          • Trigger - Turn off Off Hand <gen>
          • -------- ----- SETS ----- --------
          • -------- Slashers of the Night --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to |cFF640CB4Elven Slasher|r (2/2)
                  • (Item-type of (Item being manipulated)) Equal to |cFF640CB4Elven Slasher|r (2/2)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to |cFF640CB4Elven Slasher|r (2/2)
                • Then - Actions
                  • Item - Remove (Item being manipulated)
                  • Item - Remove (Item carried by (Triggering unit) of type |cFF640CB4Elven Slasher|r (2/2))
                  • Unit - Remove Elven Slasher (Left) from (Triggering unit)
                  • Unit - Remove Elven Slasher (Right) from (Triggering unit)
                  • Hero - Create |cFF640CB4Elven Slasher|r and give it to (Triggering unit)
                  • Unit - Remove Elven Slasher (Left) from (Triggering unit)
                  • Unit - Add Main Hand to (Triggering unit)
                  • Unit - Add Elven Slasher (Right) to (Triggering unit)
                • Else - Actions
                  • Item - Remove (Item being manipulated)
                  • Item - Remove (Item carried by (Triggering unit) of type |cFF640CB4Elven Slasher|r (2/2))
                  • Unit - Remove Elven Slasher (Left) from (Triggering unit)
                  • Unit - Remove Elven Slasher (Right) from (Triggering unit)
                  • Hero - Create |cFF640CB4Elven Slasher|r and give it to (Triggering unit)
                  • Unit - Remove Elven Slasher (Right) from (Triggering unit)
                  • Unit - Add Off Hand to (Triggering unit)
                  • Unit - Add Elven Slasher (Left) to (Triggering unit)
            • Else - Actions
          • Trigger - Turn on Main Hand <gen>
          • Trigger - Turn on Off Hand <gen>
 
Last edited:
Level 6
Joined
Jan 8, 2009
Messages
140
If you are talking about an item recipe system you can use the one in my sig.

Also don't use integer A

I want to avoid having to use a third party editor, I also can't really use a premade system because it would make it significantly harder to implement specific actions. Thanks for the suggestion though, i'd already checked out your system.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
If I may... there is no need to fear JNGP, it has thousands of downloads and I have never heard of a single complaint as to it harming a person's computer.

While if you have recipes that require more than 3 items than deathismyfriend's system maybe still not be for you, in which case you will likely have to do more of what you're doing now, although if you have many more items to deal with you may consider saving them into an itemtype array and looping to see which one is added and doing actions that way because as of now it will require a boat load of IFs the more items you add.

I would also suggest you save triggering unit and item being manipulated into a variable, in general anything you use twice or more its good to save in a variable for efficiency. (Also clarity, in my opinion).
 
Level 6
Joined
Jan 8, 2009
Messages
140
If I may... there is no need to fear JNGP, it has thousands of downloads and I have never heard of a single complaint as to it harming a person's computer.

While if you have recipes that require more than 3 items than deathismyfriend's system maybe still not be for you, in which case you will likely have to do more of what you're doing now, although if you have many more items to deal with you may consider saving them into an itemtype array and looping to see which one is added and doing actions that way because as of now it will require a boat load of IFs the more items you add.

I would also suggest you save triggering unit and item being manipulated into a variable, in general anything you use twice or more its good to save in a variable for efficiency. (Also clarity, in my opinion).

I'm not afraid of jngp, it's just I don't know jass, and i'm probably not going to use it because I don't want to add anything I can't understand and manipulate.

There won't be that many of these, this is as far as I got but it's still not working...

I make this trigger run after the class check has happened.

  • Item Sets
    • Events
    • Conditions
    • Actions
      • -------- ----- SETS ----- --------
      • -------- Slashers of the Night --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of tmpItem) Equal to |cFF640CB4Elven Slasher|r
        • Then - Actions
          • For each (Integer loopA) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by tmpUnit in slot loopA)) Equal to |cFF640CB4Elven Slasher|r
                • Then - Actions
                  • Unit - Remove Elven Slasher (Left) from tmpUnit
                  • Unit - Remove Elven Slasher (Right) from tmpUnit
                  • Item - Remove (Item carried by tmpUnit in slot loopA)
                  • Item - Remove tmpItem
                  • Hero - Create |cFF640CB4Elven Slasher|r (2/2) and give it to tmpUnit
                  • Hero - Create |cFF640CB4Elven Slasher|r (2/2) and give it to tmpUnit
                  • Unit - Remove Elven Slasher (Left) from tmpUnit
                  • Unit - Remove Elven Slasher (Right) from tmpUnit
                  • Unit - Remove Main Hand from tmpUnit
                  • Unit - Remove Off Hand from tmpUnit
                  • Unit - Add Elven Slasher (Left) to tmpUnit
                  • Unit - Add Elven Slasher (Right) to tmpUnit
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of tmpItem) Equal to |cFF640CB4Elven Slasher|r
        • Then - Actions
          • For each (Integer loopA) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by tmpUnit in slot loopA)) Equal to |cFF640CB4Elven Slasher|r
                • Then - Actions
                  • Unit - Remove Elven Slasher (Left) from tmpUnit
                  • Unit - Remove Elven Slasher (Right) from tmpUnit
                  • Item - Remove (Item carried by tmpUnit in slot loopA)
                  • Item - Remove tmpItem
                  • Hero - Create |cFF640CB4Elven Slasher|r (2/2) and give it to tmpUnit
                  • Hero - Create |cFF640CB4Elven Slasher|r (2/2) and give it to tmpUnit
                  • Unit - Remove Elven Slasher (Left) from tmpUnit
                  • Unit - Remove Elven Slasher (Right) from tmpUnit
                  • Unit - Remove Main Hand from tmpUnit
                  • Unit - Remove Off Hand from tmpUnit
                  • Unit - Add Elven Slasher (Left) to tmpUnit
                  • Unit - Add Elven Slasher (Right) to tmpUnit
                • Else - Actions
        • Else - Actions
 
Status
Not open for further replies.
Top