• 🏆 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!

[Solved] Efficent Recipe System

Level 7
Joined
Feb 23, 2020
Messages
253
I'm wondering if i can make triggers like these very simplified with a system. I've been searching through the Hive but cant find anything that really suits me.

The idea for me is to have 5 base items, mana stone, health stone, sword, dagger and shield. All of these can be combined with one and other (Recipe based on 2 items only, for example mana + mana, sword + shield etc...)

Almost every item will have specific effects attatched to them.

So this is what i have at the moment as an example:


  • Steel Shield
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Hero manipulating item) has an item of type Wooden Shield) Equal to True
    • Actions
      • Set VariableSet Item_Int[5] = 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 (Hero manipulating item) in slot (Integer A))) Equal to Wooden Shield
            • Then - Actions
              • Set VariableSet Item_Int[5] = (Item_Int[5] + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Item_Int[5] Greater than or equal to 2
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type Wooden Shield)
          • Item - Remove (Item carried by (Hero manipulating item) of type Wooden Shield)
          • Hero - Create Steel Shield and give it to (Hero manipulating item)
          • Special Effect - Create a special effect attached to the overhead of (Hero manipulating item) using Abilities\Spells\Items\AIam\AIamTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
  • Staff of the old Wizard Work
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • ((Item carried by GDD_DamageSource of type Staff of the old Wizard) is owned) Equal to True
    • Actions
      • Set VariableSet StaffOfTheOldWizardChance = 0
      • Set VariableSet StaffOfTheOldWizard_Attacked = GDD_DamagedUnit
      • For each (Integer StaffOfTheOldWizardLoop) 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 GDD_DamageSource in slot StaffOfTheOldWizardLoop)) Equal to Staff of the old Wizard
            • Then - Actions
              • Set VariableSet StaffOfTheOldWizardChance = (StaffOfTheOldWizardChance + 10)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to StaffOfTheOldWizardChance
        • Then - Actions
          • Set VariableSet StaffOfTheOldWizard_Point = (Position of GDD_DamageSource)
          • Unit - Create 1 Dummy Frost Nova Caster (Staff of the old Wizard) for (Owner of GDD_DamageSource) at StaffOfTheOldWizard_Point facing Default building facing degrees
          • Set VariableSet StaffOfTheOldWizard_Dummy = (Last created unit)
          • Unit - Add a 1.00 second Generic expiration timer to StaffOfTheOldWizard_Dummy
          • Unit - Add Frost Nova (Staff of the old Wizard) to StaffOfTheOldWizard_Dummy
          • Unit - Order StaffOfTheOldWizard_Dummy to Undead Lich - Frost Nova StaffOfTheOldWizard_Attacked
          • Custom script: call RemoveLocation(udg_StaffOfTheOldWizard_Point)
        • Else - Actions
  • Hands of Fury
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has an item of type Claws of Speed) Equal to True
          • ((Hero manipulating item) has an item of type Recipe Hands of Fury) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type Claws of Speed)
          • Item - Remove (Item carried by (Hero manipulating item) of type Recipe Hands of Fury)
          • Hero - Create Hands of Fury and give it to (Hero manipulating item)
          • Special Effect - Create a special effect attached to the overhead of (Hero manipulating item) using Abilities\Spells\Items\AIam\AIamTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
I found a lot of working item recipe systems that looked like they could do exactly what you want, what was wrong with the ones you found?

That aside, here's a map I threw together that has a system for combining two item-types together.

Also, I think you're using the wrong condition in Staff of the old Wizard Work. Shouldn't you be checking if the DamageSource has the Item?
  • GDD_DamageSource has an item of type Wooden Shield) Equal to True
 

Attachments

  • Item Combiner 2.w3m
    20.1 KB · Views: 3
Last edited:
Level 7
Joined
Feb 23, 2020
Messages
253
I found a lot of working item recipe systems that looked like they could do exactly what you want, what was wrong with the ones you found?

That aside, here's a map I threw together that has a system for combining two item-types together.

Also, I think you're using the wrong condition in Staff of the old Wizard Work. Shouldn't you be checking if the DamageSource has the Item?
  • GDD_DamageSource has an item of type Wooden Shield) Equal to True

I thought nothing looked super simplified, but i could be very wrong here since i did not take much time per system.

Thank you for your help though, its just what i wanted.

Yes you're right. Also, does that trigger work with multiple units or do i have to make the chance an array to check the custom value for the unit?
 
Top