• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Help with Item Recipes

Status
Not open for further replies.
Level 2
Joined
Sep 20, 2015
Messages
8
I need help on my "Item Recipes" I wanted to create a trigger that even your inventory is full, you can still complete the recipe. :vw_sad:
This trigger doesn't work on me

  • Item Mask of Death
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
          • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
          • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
      • ((Hero manipulating item) has an item of type Claws of Attack +15) Equal to True
      • ((Hero manipulating item) has an item of type Crown of Kings +5) Equal to True
      • ((Hero manipulating item) has an item of type Kelen's Dagger of Escape) Equal to True
    • Actions
      • Set I_Mod_Ingredients = 3
      • Set I_Mod_RFactor[1] = Claws of Attack +15
      • Set I_Mod_RFactor[2] = Crown of Kings +5
      • Set I_Mod_RFactor[3] = Kelen's Dagger of Escape
      • For each (Integer A) from 1 to I_Mod_Ingredients, do (Actions)
        • Loop - Actions
          • Set I_Mod_Factor[(Integer A)] = False
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to I_Mod_Ingredients, 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 I_Mod_RFactor[(Integer B)]
                  • I_Mod_Factor[(Integer B)] Equal to False
                • Then - Actions
                  • Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))
                  • Set I_Mod_Factor[(Integer B)] = True
                • Else - Actions
      • Hero - Create Mask of Death and give it to (Hero manipulating item)
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
No, each item should have a 'tome' equivalent. Examplr, when your map has boots of speed, you also need to have a 'tome' version of boots of speed and when a unit dropped a 'real' boots of speed, trigger it and replace the 'real' by a 'tome'. When a unit picked a 'tome', replace it by a 'real'.

EDIT: Triggering this will be complex. If you want to get an idea, look at my No Item Sharing System in my sig. It has similar concept.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
So basically everything in the Shop List is a Tome, whereas you would setup a trigger in which each Tome correspond to each Item in the Object Editor.

  • Set ItemTome[1] = Boots of Speed (Tome)
  • Set ItemReal[1] = Boots of Speed
  • ...
  • Set ItemTome[27] = Blink Dagger (Tome)
  • Set ItemReal[27] = Blink Dagger
However, this is looping through every registered items, quite slow compared to a Hashtable.
Let's say you have looped until 27 index, it will check the condition whether the bought item is the index of 27, which is the Blink Dagger.
Once the check is true, it will call the 27th index of ItemReal (which is the Blink Dagger) and give the item to your Hero.
But obviously if your slot is full AND you are buying additional item that does not combine any items, you should generate the error message AND possibly a refund, you must set this one too - of if you want it to be simple, just drop the item to the buyer's feet.

In this case I'd prefer the usage of Hashtable - but if you want more simpler way, go for the above example.
 
Level 12
Joined
Nov 3, 2013
Messages
989
I think someone somewhere said that dummy units was better than tomes, so that's what I've been doing. It's definitely an alternative, but how do they stack up against each other?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Status
Not open for further replies.
Top