recipe

CBBPhoenix

New Member
Reaction score
1
Hi guys I am making a map where you ( as in dota ) should be able to pick up some items and then get another more powerful one. The problem is that I want for 2 identical items to meld to one powerful one and I can't make this using the ordenary triggers 'cause it will give the new item as soon as you pick up one. What can I do about it using GUI?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Use this:
Trigger:
  • Recipe
    • 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 Recipe: Shiny Axe of Strength) Equal to True
          • ((Triggering unit) has an item of type Gauntlets of Ogre Strength +3) Equal to True
        • Then - Actions
          • Set Count = 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 Axe
                • Then - Actions
                  • Set Count = (Count + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Count Equal to 1
                    • Then - Actions
                      • Set Slot = (Integer A)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Count Equal to 2
                    • Then - Actions
                      • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                      • Item - Remove (Item carried by (Triggering unit) in slot Slot)
                      • Item - Remove (Item carried by (Triggering unit) of type Recipe: Shiny Axe of Strength)
                      • Item - Remove (Item carried by (Triggering unit) of type Gauntlets of Ogre Strength +3)
                      • Set TempPoint = (Position of (Triggering unit))
                      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation(udg_TempPoint)
                      • Hero - Create Shiny Axe of Strength and give it to (Triggering unit)
                    • Else - Actions
                • Else - Actions
        • Else - Actions

If you only want two identical items, just remove the "If" and keep the Integer A loop, like this:
Trigger:
  • Recipe
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set Count = 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 Axe
            • Then - Actions
              • Set Count = (Count + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Count Equal to 1
                • Then - Actions
                  • Set Slot = (Integer A)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Count Equal to 2
                • Then - Actions
                  • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                  • Item - Remove (Item carried by (Triggering unit) in slot Slot)
                  • Item - Remove (Item carried by (Triggering unit) of type Recipe: Shiny Axe of Strength)
                  • Item - Remove (Item carried by (Triggering unit) of type Gauntlets of Ogre Strength +3)
                  • Set TempPoint = (Position of (Triggering unit))
                  • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Hero - Create Shiny Axe of Strength and give it to (Triggering unit)
                • Else - Actions
            • Else - Actions


And to change the two identical items needed for this, simply change the condition which looks like this:
Trigger:
  • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Axe
 

CBBPhoenix

New Member
Reaction score
1
Okay

So you use a count function to see if there is more than one gauntles of str on the hero inventory? I think I used boolean and that only checks whether or not the hero has none or one/more of the item. I am not quite sure which kinds of variables you use but I am going to try this trigger... Looks very long for such a "simple" game function T_T.

PS: there is no way that you can copy triggers from Thehelper.net and paste them in the trigger editor is there?:(
 

Komaqtion

You can change this now in User CP.
Reaction score
469
There are only two variables in that trigger, Count (An "Integer" variable) and TempPoint (A "Point" variable) ;)


PS: there is no way that you can copy triggers from Thehelper.net and paste them in the trigger editor is there?

Hehe, nope :p
You'll have to try it for youself :D
 

CBBPhoenix

New Member
Reaction score
1
Testing done

Works perfectly no matter where the required items are in the Hero inventory. You're win mate :D

Thanks a lot. Approved
 

Vadested

New Member
Reaction score
0
Set Slot = (Integer A) I can figure out how to put it in if i only made those other two triggers
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top