1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  5. Dismiss Notice
  6. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Item Recipe System 1.1.1

Submitted by Zeatherann
This bundle is marked as substandard. It may contain bugs, not perform optimally or otherwise be in violation of the submission rules.
[​IMG]

Zeatherann Presents:


An Anthro-Vixen System



Item Recipe System



Reason for Making

What: This will allow you to add item recipes to your map with great ease.


Configurables
  • How you code your recipes (Jass/GUI/Both).
  • How the recipe system is invoked, basically you can add the effects and call the function.

Tehnical Side
  • Coded in JASS, but can be used in all GUI.
  • Uses 2 arrays and 1 integer.
  • Supports use for any item stacking system.
  • Uses the item's charge, allowing for staking items.
Code
Code (vJASS):
function Make_Item takes unit u returns nothing
    //Add item types to udg_Items
    //Change udg_ItemCount to the number of item types in udg_Items.
    //This system works with item charges, if the charge is 0 then it adds 1.
    //Thus allowing you to 'stack' items.
    //Fake Recipie;
    //
    //if udg_ItemNum[0]>=2 and udg_ItemNum[1]>=1 then
    //    //remove checked items.
    //    set udg_ItemNum[0]=udg_ItemNum[0]-2
    //    set udg_ItemNum[1]=udg_ItemNum[1]-1
    //    //Add the items you want the recipie to give.
    //    set udg_ItemNum[3]=udg_ItemNum[3]+1
    //elseif udg_ItemNum[3]>=1 and udg_ItemNum[0]>=1 then
    //    //remove checked items.
    //    set udg_ItemNum[0]=udg_ItemNum[0]-1
    //    set udg_ItemNum[3]=udg_ItemNum[3]-1
    //    //Add the items you want the recipie to give.
    //    set udg_ItemNum[4]=udg_ItemNum[4]+1
    //endif
    //
    //Make sure all your item mats and items you get from the recipies to udg_Items.
    //Items in a unit's invintory not on the udg_Items list will be ignored.
    //This will not returned 'stacked' items, your stacking system should handle when a unit gains an item it already has to stack them.
    local integer i=0
    local integer I
    local integer II
    local item ii
    //Count items...
    loop
        exitwhen i>udg_ItemCount
        set udg_ItemNum[i]=0
        set I=0
        loop
            exitwhen I>5
            set ii=UnitItemInSlot(u,I)
            if ii!=null then
                if GetItemTypeId(ii)==udg_Items[i]then
                    set II=GetItemCharges(ii)
                    if II<=1then
                        set II=1
                    endif
                    set udg_ItemNum[i]=udg_ItemNum[i]+II
                    call RemoveItem(ii)
                    set II=0
                endif
            endif
            set ii=null
            set I=I+1
        endloop
        set i=i+1
    endloop
    //Recipes...
    if udg_ItemNum[0]>=1 and udg_ItemNum[1]>=1 and udg_ItemNum[5]>=1 then
        set udg_ItemNum[0]=udg_ItemNum[0]-1
        set udg_ItemNum[1]=udg_ItemNum[1]-1
        set udg_ItemNum[3]=udg_ItemNum[3]+1
    elseif udg_ItemNum[0]>=1 and udg_ItemNum[2]>=1 and udg_ItemNum[5]>=1 then
        set udg_ItemNum[0]=udg_ItemNum[0]-1
        set udg_ItemNum[2]=udg_ItemNum[2]-1
        set udg_ItemNum[4]=udg_ItemNum[4]+1
    endif
    //GUI Recipes...
    call TriggerExecute(gg_trg_GUI_Recipes)
    //Remake unused items...
    set i=0
    loop
        exitwhen i>udg_ItemCount
        loop
            exitwhen udg_ItemNum[i]<=0
            set udg_ItemNum[i]=udg_ItemNum[i]-1
            call UnitAddItemById(u,udg_Items[i])
        endloop
        set udg_ItemNum[i]=0
        set i=i+1
    endloop
    set ii=null
    set u=null
endfunction

  • GUI Recipes
    • Events
    • Conditions
    • Actions
      • -------- This is the GUI side of my system, it allows you to never touch JASS, however it's suggested to use elseif's, or nested if's --------
      • -------- rather than multiple if's --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemNum[0] Greater than or equal to 2
        • Then - Actions
          • Set ItemNum[0] = (ItemNum[0] - 2)
          • Set ItemNum[1] = (ItemNum[1] + 1)
        • Else - Actions

  • Add Recepes
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Add all the itemtypes you want the system to deal with here. --------
      • Set Items[0] = Assassin's Blade
      • Set Items[1] = Orb of Frost
      • Set Items[2] = Orb of Fire
      • Set Items[3] = Frostguard
      • Set Items[4] = Searing Blade
      • Set Items[5] = Enchanter's Stone
      • -------- Set the ItemCount to the number of items types you want the system deal with. --------
      • Set ItemCount = 5
      • -------- WARNING: Remember to count '0' as one of the items, if you only use '0' set the ItemCount to 0. --------

Updates
1.0
Spell Uploaded!

1.1
Added an if check against null items.

1.1.1
  • Fixed description errors.
  • Added full code.


Spell is made in JASS.

Keywords:
Item, Recipe, Zeatherann, System
Contents

Zeatherann's Item Recipe System! (Map)

Reviews
Moderator
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Pharaoh_: Although I appreciate the effort, this is too plain and there are item systems out there that do the job equally well, with more advanced features and stuff. Rejected at this state....
  1. 12th Dec 2015
    IcemanBo: Too long as NeedsFix. Rejected.

    Pharaoh_: Although I appreciate the effort, this is too plain and there are item systems out there that do the job equally well, with more advanced features and stuff. Rejected at this state.

    Old Review
    14th Jun 2011
    Bribe:

    If you post all the triggers here (GUI Add is missing, for example) that would at least show users what they have to c&p to import your system.
     
  2. Midnighters

    Midnighters

    Joined:
    Jun 2, 2009
    Messages:
    1,802
    Resources:
    12
    Icons:
    10
    Packs:
    1
    Maps:
    1
    Resources:
    12
    What makes this any different than the ones made before?
     
  3. Zeatherann

    Zeatherann

    Joined:
    Nov 25, 2008
    Messages:
    1,303
    Resources:
    6
    Skins:
    1
    Tools:
    1
    Maps:
    4
    Resources:
    6
    It's cut, clean and easy to look at.

    Edit: It also doesn't need the items in any particular order. And when working with it you don't work with items or item types, just integers in an array.
     
  4. MiniMage

    MiniMage

    Joined:
    Jun 5, 2008
    Messages:
    1,752
    Resources:
    22
    Models:
    21
    Skins:
    1
    Resources:
    22
    Why the furry picture? :O
     
  5. Dark_Axl

    Dark_Axl

    Joined:
    Dec 12, 2007
    Messages:
    473
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    please post the full triggers?
    as from the code, there are more than just the wrap function called "Make_Item"...
     
  6. Zeatherann

    Zeatherann

    Joined:
    Nov 25, 2008
    Messages:
    1,303
    Resources:
    6
    Skins:
    1
    Tools:
    1
    Maps:
    4
    Resources:
    6
    The only other code is a blank trigger called gg_trg_GUI_Recipes. It's blank and you only need to fill in the actions. The method with which you call Make_Item(unit) is totally up to you.

    MiniMage; The furry pic is my logo of sorts, it's in all my resources.
     
  7. Pharaoh_

    Pharaoh_

    Joined:
    Nov 6, 2008
    Messages:
    8,127
    Resources:
    11
    Icons:
    3
    Skins:
    1
    Spells:
    6
    Tutorials:
    1
    Resources:
    11
    You can also use a condition to prevent further executions of the code, if ii != null then (rest actions here). This way, you will first of all check if there is any item in the said slot.
     
  8. Zeatherann

    Zeatherann

    Joined:
    Nov 25, 2008
    Messages:
    1,303
    Resources:
    6
    Skins:
    1
    Tools:
    1
    Maps:
    4
    Resources:
    6
    Hmm, awesome idea!

    Edit: The configurables is how you use this system within your map after importing it as it can be used in JASS and/or GUI.
     
    Last edited: Jun 7, 2011
  9. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    can I ask how many items we can require in each recipe?
     
  10. Zeatherann

    Zeatherann

    Joined:
    Nov 25, 2008
    Messages:
    1,303
    Resources:
    6
    Skins:
    1
    Tools:
    1
    Maps:
    4
    Resources:
    6
    Any number, though it's best to not do more than 6 as a unit can only carry 6 different items (assuming stacking of like items)

    However, if it's a stacked item, then as many of that item's charges as the system counts charges.
     
  11. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    This might be useful for some GUIers.. I still prefer Diablo-dk's though (The only flaw it has is that it's not OO) ... 3.5/5 -> 4/5 :]
     
  12. Zeatherann

    Zeatherann

    Joined:
    Nov 25, 2008
    Messages:
    1,303
    Resources:
    6
    Skins:
    1
    Tools:
    1
    Maps:
    4
    Resources:
    6
    Diablo-dk's system is nice, but my system is a lot shorter and cleaner, and it's really friendly for GUI users.

    Edit: Also my system isn't hardcoded to trigger when a unit picks an item up, or acquires an item. Rather you choose when it fires.
     
    Last edited: Jun 11, 2011
  13. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    wow I'll thinking about this system and you show me how to create system has shorten ... I like it and I'll try to test it!!. Thanks a lot It's useful for learning.

    Ahh I'll Try to Test. This Trigger mean I'll LOOP all Item Recipe? OHHH MY GOD

    This Trigger is cannot use with event "EVENT_PLAYER_UNIT_PICKUP_ITEM" ???

    I'll try it. and Game is error suddenly ....
     
    Last edited by a moderator: Dec 16, 2011