How do i do a trigger for 2 same items in the same item receipe?

bryanEX1993

New Member
Reaction score
0
I was pondering on how to make an item out of 3 items. For example, in dota there's an item called monkey king bar where there exists 2 javelins. But when i do a trigger lyk this, i have to only get 1 javelin. What other ''if'' triggers do i need to add?

Unit - A unit acquires an item

If-If hero manipulating item has an item of type javelin equal to true If-If hero manipulating item has an item of type javelin equal to true
Then-Create 1 monkey king bar for the hero manipulating hero
 
Reaction score
65
Code:
adv recipes
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has an item of type Stygian Desolator) Equal to True
            Then - Actions
                Set Styg = 0
                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 (Triggering unit) in slot (Integer A))) Equal to Mithril Hammer +26
                                Styg Less than or equal to 2
                            Then - Actions
                                Set Styg = (Styg + 1)
                            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Styg Equal to 2
                    Then - Actions
                        For each (Integer B) 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 (Integer B))) Equal to Mithril Hammer +26
                                        Styg Greater than 0
                                    Then - Actions
                                        Item - Remove (Item carried by (Triggering unit) in slot (Integer B))
                                        Set Styg = (Styg - 1)
                                    Else - Actions
                        Item - Remove (Item carried by (Triggering unit) of type Stygian Desolator)
                        Set Temporary_Point = (Position of (Triggering unit))
                        Item - Create Stygian Desolator at Temporary_Point
                        Hero - Give (Last created item) to (Triggering unit)
                        Special Effect - Create a special effect at Temporary_Point using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
                        Custom script:   call RemoveLocation( udg_Temporary_Point )
                        Wait 2.00 seconds
                        Special Effect - Destroy (Last created special effect)
                    Else - Actions
            Else - Actions

An old post back from 2005 by emjlr3.
There are lots of different recipe systems in the Systems, Triggers and Demo Maps. Check them out.
 

denmax

You can change this now in User CP.
Reaction score
155
Trigger:
  • A
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item type of (Item being manipulated) Equal to "Javelin"
    • Actions
      • If (All conditions are true) then do (Actions), else do (Else Actions)
        • If - Conditions
          • IntVar Greater than or Equal to 2
        • Then - Actions
          • Do your stuff here
          • Set IntVar = IntVar - 2
        • Else - Actions
          • Set IntVar = IntVar + 1


Trigger:
  • A
    • Event
      • Unit - A unit Loses an item
    • Conditions
      • (Item type of (Item being manipulated) Equal to "Javelin"
    • Actions
      • Set IntVar = IntVar - 1


Above post is more detailed ^_^
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top