• 🏆 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] Recipe problem

Status
Not open for further replies.
Level 1
Joined
Dec 19, 2008
Messages
1
Hallo you all i got a problem with a recipe system
i want that a item with charges is part of a recipe.
The problems in my trigger are that all items of the same type which is needed are removed when the recipe is done.

  • Rezept 3
    • Rezept 3
    • Ereignisse
      • Einheit - A unit Erwirbt einen Gegenstand
    • Bedingungen
      • Or - Any (Conditions) are true
        • Bedingungen
          • (Item-type of (Item being manipulated)) Gleich Rolle des Schutzes
          • (Item-type of (Item being manipulated)) Gleich Talisman der Vitalität +25
    • Aktionen
      • -------- ItemInteger gibt die benötigte anzahl des items an --------
      • Set ItemInteger = 7
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • ((Triggering unit) has an item of type Talisman der Vitalität +25) Gleich True
          • ((Triggering unit) has an item of type Rolle des Schutzes) Gleich True
        • 'THEN'-Aktionen
          • For each (Integer A) from 1 to 6, do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Gleich Rolle des Schutzes
                • 'THEN'-Aktionen
                  • Set ItemCharges = (ItemCharges + ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) x 1))
                  • Set ItemChargesLeft = ItemCharges
                • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • ItemCharges Größer als ItemInteger
            • 'THEN'-Aktionen
              • Set ItemCharges = ItemInteger
            • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • ItemChargesLeft Größer als ItemInteger
            • 'THEN'-Aktionen
              • Set ItemChargesLeft = ItemInteger
            • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • ItemCharges Gleich ItemInteger
            • 'THEN'-Aktionen
              • For each (Integer B) from 1 to 6, do (Actions)
                • Schleifen - Aktionen
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Bedingungen
                      • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer B))) Gleich Rolle des Schutzes
                      • ItemChargesLeft Größer als 0
                    • 'THEN'-Aktionen
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • 'IF'-Bedingungen
                          • (Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer B))) Gleich ItemChargesLeft
                        • 'THEN'-Aktionen
                          • Held - Drop the item from slot (Integer B) of (Hero manipulating item)
                          • Gegenstand - Remove (Last dropped item)
                          • Set ItemChargesLeft = 0
                        • 'ELSE'-Aktionen
                          • Gegenstand - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer B)) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer B))) - (ItemChargesLeft - (ItemChargesLeft - ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer B))) - 1))))
                          • Set ItemChargesLeft = (ItemChargesLeft - ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer B))) - 1))
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • 'IF'-Bedingungen
                              • ItemChargesLeft Größer als 0
                            • 'THEN'-Aktionen
                              • Gegenstand - Remove (Item carried by (Hero manipulating item) in slot (Integer B))
                              • Set ItemChargesLeft = (ItemChargesLeft - 1)
                            • 'ELSE'-Aktionen
                    • 'ELSE'-Aktionen
              • Gegenstand - Remove (Item carried by (Hero manipulating item) of type Talisman der Vitalität +25)
              • Held - Create Ring des Schutzes +10 and give it to (Hero manipulating item)
              • Set ItemCharges = 0
              • Set ItemChargesLeft = 0
            • 'ELSE'-Aktionen
              • Set ItemCharges = 0
              • Set ItemChargesLeft = 0
        • 'ELSE'-Aktionen
 
Last edited by a moderator:
Level 9
Joined
Apr 3, 2008
Messages
700
1. Use [trigger ][/trigger ] for triggers.
2. Use English only in your messages in forum.
3. I have a system like this in 10 lines of code. You can make it much more optimized, and it'll remove the problem. Seach in WE tutorials.
 
Status
Not open for further replies.
Top