Item Recipes Codes

Cloud_FF

New Member
Reaction score
5
I know that you're thinking that this is an item recipe thread on "How do I do it???" Well it's not. I've done it but I want to change it and I can't a tutorial which shows how I can make item recipes via variables. There is a simple Example down of one of my triggers. I'd love if someone was to redesign it with custom variables, since these are the ONLY triggers in my map which aren't done this way and I really hope that they are the source of the crashes (I redid all special effects, pathing, spawning, pick units, pick players and so on crushable triggers) cuz it sux that it crashes:

Code:
Event:
   Unit - A unit Acquires an item

Conditions:
   Or - Any (Conditions) are true
      Conditions
         (Item-type of (Item being manipulated)) Equal to |CFFO54A6Swift Steel Sword
         (Item-type of (Item being manipulated)) Equal to Magical Scroll
         (Item-type of (Item being manipulated)) Equal to Runed Scroll
   ((Hero manipulating item) has an item of type |CFFO54A6Swift Steel Sword) Equal to True
   ((Hero manipulating item) has an item of type Magical Scroll) Equal to True
   ((Hero manipulating item) has an item of type Runed Scroll) Equal to True

Actions:
   Item - Remove (Item carried by (Triggering unit) of type |CFFO54A6Swift Steel Sword)
   Item - Remove (Item carried by (Triggering unit) of type Magical Scroll)
   Item - Remove (Item carried by (Triggering unit) of type Runed Scroll)
   Hero - Create |CFF62D91Gut-Ripping Sword and give it to (Triggering unit)

The trigger works fine. It takes the items, it removes them, never miss works, always works correctly for the item combos and auto applies.

P.S. If you could put in a few words a system which uses dialogue buttons instead of auto crafting I'd be very glad. I have in mind for this:

Code:
Event:
   Unit - A unit Acquires an item

Conditions:
   Or - Any (Conditions) are true
      Conditions
         (Item-type of (Item being manipulated)) Equal to Gemless Pendant
         (Item-type of (Item being manipulated)) Equal to |CFF662D91Amethyst of Magic Warding
   ((Hero manipulating item) has an item of type Gemless Pendant) Equal to True
   ((Hero manipulating item) has an item of type |CFF662D91Amethyst of Magic Warding) Equal to True

Actions:
   Item - Remove (Item carried by (Triggering unit) of type Gemless Pendant)
   Item - Remove (Item carried by (Triggering unit) of type |CFF662D91Amethyst of Magic Warding)
   Hero - Create |CFF62D91Amethyst Pendant of Magic Warding and give it to (Triggering unit)

Somewhere in that last trigger I want dialogue trigger but I can't make them myself. :confused:
 

foodflare

You can change this now in User CP.
Reaction score
32
I know its not mpi or mui or leakless but this is wat i could come up with

Code:
Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set Items_Obtained[1] = Claws of Attack +15
        Set Items_Obtained[2] = Crown of Kings +5
        Set Items_Obtained[3] = Kelen's Dagger of Escape
        Set Items_Obtained[4] = Mask of Death
        Set Items_Obtained[5] = Orb of Frost
        Set Items_Obtained[6] = Ring of Protection +5
        Set Items_Created[3] = Heart of Aszune
        Set Items_Created[4] = Horn of Cenarius
        Set Items_Created[5] = Sun Key
        Set Items_Created[6] = Key of Three Moons
        Set Items_Created[7] = Magic Key Chain
        Set Items_Created[8] = Mogrin's Report
        Set Items_Created[9] = Moon Key
        Set Items_Created[10] = Mooncrystal
        Set Items_Created[11] = Note to Jaina Proudmoore

Code:
Dialog Creation
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Dialog - Clear CombinationDialog
        Dialog - Create a dialog button for CombinationDialog labelled Combine
        Set DialogButtons[1] = (Last created dialog Button)
        Dialog - Create a dialog button for CombinationDialog labelled Do not Combine
        Set DialogButtons[2] = (Last created dialog Button)

Code:
Show Dialog
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - 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
                                Or - Any (Conditions) are true
                                    Conditions
                                        (Item-type of (Item being manipulated)) Equal to Items_Obtained[(Integer A)]
                                        (Item-type of (Item being manipulated)) Equal to Items_Obtained[(Integer B)]
                                ((Triggering unit) has an item of type Items_Obtained[(Integer A)]) Equal to True
                                ((Triggering unit) has an item of type Items_Obtained[(Integer B)]) Equal to True
                                (Integer A) Not equal to (Integer B)
                            Then - Actions
                                Set Items_to_Combine[1] = (Item carried by (Triggering unit) of type Items_Obtained[(Integer A)])
                                Set Items_to_Combine[2] = (Item carried by (Triggering unit) of type Items_Obtained[(Integer B)])
                                Set Triggering_Hero = (Triggering unit)
                                Dialog - Show CombinationDialog for (Owner of (Triggering unit))
                            Else - Actions

Code:
Creating Items
    Events
        Dialog - A dialog button is clicked for CombinationDialog
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[1]
            Then - Actions
                For each (Integer A) from 1 to 6, do (Actions)
                    Loop - 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 Items_to_Combine[1]) Equal to Items_Obtained[(Integer A)]
                                        (Item-type of Items_to_Combine[2]) Equal to Items_Obtained[(Integer B)]
                                    Then - Actions
                                        Item - Remove Items_to_Combine[1]
                                        Item - Remove Items_to_Combine[2]
                                        Item - Create Items_Created[((Integer A) + (Integer B))] at (Position of Triggering_Hero)
                                        Unit - Order Triggering_Hero to Right-Click (Last created item)
                                    Else - Actions
            Else - Actions

I know it doesnt allow for same type of item combinations but it works I have tested it
 

Cloud_FF

New Member
Reaction score
5
Whoa! :eek: Right...but doesn't that mean that I have to "pre-set" each and every item I use? They are kind of a lot...

P.S. Is that the simplest way btw....it looks very long. And are you sure that such triggers don't crash games? Because if they don't I am pretty much stuck headbanging at the other 270 triggers, why and where they go wrong.
 

foodflare

You can change this now in User CP.
Reaction score
32
True and its not that efficient because some diff item combos would make the same item and it might choose the wrong items.
 

Cloud_FF

New Member
Reaction score
5
I made sure that there are no combos which are equal for 2 different items...well I think I made sure...I'll check again :D
 
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