array:1 [
  0 => """
    Untitled Trigger 005\n
        Events\n
            Unit - A unit Acquires an item\n
        Conditions\n
            (Item-type of (Item being manipulated)) Equal to Claws of Attack +1\n
        Actions\n
            For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +1) then do (Set ItemAmount = (ItemAmount + 1)) else do (Do nothing))\n
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)\n
                If - Conditions\n
                    ItemAmount Equal to 2\n
                Then - Actions\n
                    Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)\n
                    Item - Remove (Last dropped item)\n
                    Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)\n
                    Item - Remove (Last dropped item)\n
                    Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)\n
                Else - Actions\n
                    Set ItemAmount = 0\n
    """
]
array:1 [
  0 => "For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +1) then do (Set ItemAmount = (ItemAmount + 1)) else do (Do nothing))\n"
]
array:1 [
  0 => """
    Untitled Trigger 007\r\n
        Events\r\n
            Unit - A unit Acquires an item\r\n
        Conditions\r\n
            (Item-type of (Item being manipulated)) Equal to Claws of Attack +1\r\n
        Actions\r\n
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)\r\n
                If - Conditions\r\n
                    (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +1\r\n
                Then - Actions\r\n
                    Set ItemAmount = (ItemAmount + 1)\r\n
                Else - Actions\r\n
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)\r\n
                If - Conditions\r\n
                    ItemAmount Equal to 2\r\n
                Then - Actions\r\n
                    Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)\r\n
                    Item - Remove (Last dropped item)\r\n
                    Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)\r\n
                    Item - Remove (Last dropped item)\r\n
                    Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)\r\n
                Else - Actions\r\n
                    Set ItemAmount = 0\r\n
    """
]
array:1 [
  0 => """
    Untitled Trigger 007\r\n
        Events\r\n
            Unit - A unit Acquires an item\r\n
        Conditions\r\n
            (Item-type of (Item being manipulated)) Equal to Claws of Attack +1\r\n
        Actions\r\n
            For each (Integer A) from 1 to 6, do (Actions)\r\n
                Loop - Actions\r\n
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)\r\n
                        If - Conditions\r\n
                            (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +1\r\n
                        Then - Actions\r\n
                            Set ItemAmount = (ItemAmount + 1)\r\n
                        Else - Actions\r\n
                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)\r\n
                                If - Conditions\r\n
                                    ItemAmount Equal to 2\r\n
                                Then - Actions\r\n
                                    Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)\r\n
                                    Item - Remove (Last dropped item)\r\n
                                    Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)\r\n
                                    Item - Remove (Last dropped item)\r\n
                                    Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)\r\n
                                Else - Actions\r\n
                                    Set ItemAmount = 0\r\n
    """
]
array:1 [
  0 => """
    Untitled Trigger 001\n
        Events\n
            Unit - A unit Acquires an item\n
        Conditions\n
            (Item-type of (Item being manipulated)) Equal to Claws of Attack +12\n
        Actions\n
            For each (Integer A) from 1 to 6, do (Actions)\n
                Loop - Actions\n
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)\n
                        If - Conditions\n
                            (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +12\n
                        Then - Actions\n
                            Set ItemAmount = (ItemAmount + 1)\n
                        Else - Actions\n
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)\n
                If - Conditions\n
                    ItemAmount Equal to 2\n
                Then - Actions\n
                    Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +12) from (Hero manipulating item)\n
                    Item - Remove (Last dropped item)\n
                    Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +12) from (Hero manipulating item)\n
                    Item - Remove (Last dropped item)\n
                    Hero - Create Claws of Attack +15 and give it to (Hero manipulating item)\n
                Else - Actions\n
                    Set ItemAmount = 0
    """
]
array:1 [
  0 => "Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)\n"
]
array:1 [
  0 => "Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)\n"
]
array:1 [
  0 => "Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)\n"
]

Item Trigger

Level 5
Joined
Jul 15, 2012
Messages
101
  • Untitled Trigger 005
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +1
    • Actions
      • For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +1) then do (Set ItemAmount = (ItemAmount + 1)) else do (Do nothing))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemAmount Equal to 2
        • Then - Actions
          • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)
          • Item - Remove (Last dropped item)
          • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)
          • Item - Remove (Last dropped item)
          • Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)
        • Else - Actions
          • Set ItemAmount = 0
Is something wrong?
  • For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +1) then do (Set ItemAmount = (ItemAmount + 1)) else do (Do nothing))
When i enable it - "The trigger cannot be enabled because not all parameters have values."
 
Last edited:
Level 5
Joined
Jul 15, 2012
Messages
101
There is only 1 variable - ItemAmount = Integer

If i do this:

  • Untitled Trigger 007
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +1
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +1
        • Then - Actions
          • Set ItemAmount = (ItemAmount + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemAmount Equal to 2
        • Then - Actions
          • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)
          • Item - Remove (Last dropped item)
          • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)
          • Item - Remove (Last dropped item)
          • Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)
        • Else - Actions
          • Set ItemAmount = 0
it does not work.

EDIT*

If i do this:

  • Untitled Trigger 007
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +1
    • 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-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +1
            • Then - Actions
              • Set ItemAmount = (ItemAmount + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ItemAmount Equal to 2
                • Then - Actions
                  • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)
                  • Item - Remove (Last dropped item)
                  • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +1) from (Hero manipulating item)
                  • Item - Remove (Last dropped item)
                  • Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)
                • Else - Actions
                  • Set ItemAmount = 0
it does not work.
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
The only thing that comes to mind right now is that you need to set 'ItemAmount' to 0 at the end of the 'Then' branch as well, or just move that one to after the 'If/Then/Else'.
 
Level 29
Joined
Nov 29, 2012
Messages
6,638
I made a test of myself with some changes in your triggers and it worked for me actually. Jut remove the last If/Then/Else from the other Else you contained it in. This is the trigger I used anyway (do not know if this is leakless but I am sure it's not so watchout for leaks and problems):

  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +12
    • 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-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +12
            • Then - Actions
              • Set ItemAmount = (ItemAmount + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemAmount Equal to 2
        • Then - Actions
          • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +12) from (Hero manipulating item)
          • Item - Remove (Last dropped item)
          • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +12) from (Hero manipulating item)
          • Item - Remove (Last dropped item)
          • Hero - Create Claws of Attack +15 and give it to (Hero manipulating item)
        • Else - Actions
          • Set ItemAmount = 0
Triggers in map also for you to CnP. I guess you aim to make some sort of combining items, right? Lastly for a tip, dont use Do Nothing for it consumes space for no actual reason.
 

Attachments

  • Test - Item.w3x
    16.8 KB · Views: 24
Level 5
Joined
Jul 15, 2012
Messages
101
yip said:
The only thing that comes to mind right now is that you need to set 'ItemAmount' to 0 at the end of the 'Then' branch as well, or just move that one to after the 'If/Then/Else'.


Nope, it does not work. Btw,
  • Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)
should be in Else actions not in Then (my mistake).
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
Nope, it does not work. Btw,
  • Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)
should be in Else actions not in Then (my mistake).

What? I thought you were trying to combine the two claws (as Hell_Master thought too, and assembled a working trigger).

If it is as you say, then you want the hero to have both it's claws +1 destroyed if he picks up two, but to be given an extra +2 claws if he picks up only 1 (which would make him have one +2 and one +1)?

What exactly do you want the trigger to do?

EDIT: Well, looks like it has been solved, nevermind me.
 
Level 5
Joined
Jul 15, 2012
Messages
101
Btw,
  • Hero - Create Claws of Attack +2 and give it to (Hero manipulating item)
should be in Else actions not in Then (my mistake).

Ah, just ignore this part of post, i said a nonsense. (I checked the post where the trigger was and it was in Then actions)
 
Top