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

[Trigger] Full inventory and item recipes(dota)

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
333
How can I change my trigger so that when I have a full inventory and I purchase an item for a recipe it doesn't say "Inventory Full" and completes the recipe instead?
I used Tome of Power
  • test
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item carried by (Hero manipulating item) of type sword1)) Equal to (==) sword1
          • (Item-type of (Item carried by (Hero manipulating item) of type sword2)) Equal to (==) sword2
          • (Item-type of (Item carried by (Hero manipulating item) of type recipe)) Equal to (==) recipe
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type sword1)
          • Item - Remove (Item carried by (Hero manipulating item) of type sword2)
          • Item - Remove (Item carried by (Hero manipulating item) of type recipe)
          • Hero - Create final sword and give it to (Hero manipulating item)
          • Special Effect - Create a special effect at (Position of (Hero manipulating item)) using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
 

Attachments

  • Item Recipes.w3x
    13.8 KB · Views: 74
Last edited:
Level 5
Joined
Mar 5, 2015
Messages
135
The problem is that you've removed effect of the tome so that it doesn't get used right away, meaning that you actually have to carry the tome in order for the recipe to complete :) Ofc, this could be a feature that you want to keep. If not, an easy way around this is to chance it back, and chance to trigger to see if the item acquired is the recipe and then check if the unit has the required items.

If you do this, you have to make sure to give gold back to the player if he doesn't have the items.
 
Level 10
Joined
Jun 20, 2017
Messages
333
But if I do not remove that, the items cannot be added to the slots.
as you said, so something like this?! or should I use variables?
  • test
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Multiple ConditionsOr - Any (Conditions) are true
            • Conditions
              • Multiple ConditionsAnd - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item carried by (Hero manipulating item) of type sword1)) Equal to (==) sword1
                  • ((Hero manipulating item) has an item of type sword1) Equal to (==) True
              • Multiple ConditionsAnd - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item carried by (Hero manipulating item) of type sword2)) Equal to (==) sword2
                  • ((Hero manipulating item) has an item of type sword2) Equal to (==) True
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type sword1)
          • Item - Remove (Item carried by (Hero manipulating item) of type sword2)
          • Special Effect - Create a special effect at (Position of (Hero manipulating item)) using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (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 (==) recipe
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))
            • Else - Actions
      • Hero - Create final sword and give it to (Hero manipulating item)
 
Level 5
Joined
Mar 5, 2015
Messages
135
Yeah, only you don't have to remove the recipe item from the Hero, because will never exist. Just like a regular tome.
And I'm not quite sure what going on in the first conditions:

upload_2019-1-31_16-22-44.png


I believe the secon condition in each, should be enough :)
 
Level 10
Joined
Jun 20, 2017
Messages
333
Still not working!!!
The question is should all items based on tome?!
  • test2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item being manipulated) Equal to (==) (Item carried by (Triggering unit) in slot (Integer A))
              • (Item-type of (Item being manipulated)) Equal to (==) (Item-type of (Item carried by (Triggering unit) in slot (Integer A)))
            • Then - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to (==) sword1 [tome]
                  • (Item-type of (Item being manipulated)) Equal to (==) sword2 [tome]
                  • (Item-type of (Item being manipulated)) Equal to (==) recipe [tome]
                • Then - Actions
                  • Hero - Create final sword and give it to (Hero manipulating item)
                  • Special Effect - Create a special effect at (Position of (Hero manipulating item)) using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Player - Add 25 to (Owner of (Triggering unit)) Current gold
                • Else - Actions
            • Else - Actions
 

Attachments

  • Item Recipes.w3x
    14.6 KB · Views: 46
Level 5
Joined
Mar 5, 2015
Messages
135
Alright, I went and made a solution for you ;)

Recipe item
A book item which is being used, when you buy it (it does not go through your inventory). Did that by making a custom item ability (Mask Ability), which does not nothing, but still allow the item to be "used". This replaced the original item ability for the book. Changed the item into an agi book instead, because I couldn't get rid of the power up effect.

Trigger
Remade the trigger a bit:

  • test
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Recipe
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Buying unit) has an item of type sword1) Equal to True
          • ((Buying unit) has an item of type sword2) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Buying unit) of type sword1)
          • Item - Remove (Item carried by (Buying unit) of type sword2)
          • Hero - Create final sword and give it to (Buying unit)
          • Special Effect - Create a special effect at (Position of (Buying unit)) using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Game - Display to (All players) the text: |cffff4444You don't...
Instead of registering when it's picked up, it's registering when it's sold. Because the item will never be "picked up" (see what I wrote above). Then we check if the unit has the required item. In that case we remove the required items, and give the crafted on.e


I was a bit hard to explain, so I finished it for you ;)
 

Attachments

  • Item Recipes.w3x
    14.6 KB · Views: 40
Level 10
Joined
Jun 20, 2017
Messages
333
Your attached file are incorrect! however, I made that trigger.
Watch this video, that you can buy recipe item and it's added to the slot.
idk how its work ,mb 2 item 1 based on tome other normal?!
After buying that item(tome), it leaks onto the ground
 
Last edited:
Level 5
Joined
Mar 5, 2015
Messages
135
I believe this should be the right file ;)
 

Attachments

  • Item Recipes.w3x
    15.1 KB · Views: 59
Level 10
Joined
Jun 20, 2017
Messages
333
I mean that recipe also can be added to slots
Watch this video, that you can buy recipe item and it's added to the slot.
idk how its work ,mb 2 item 1 based on tome other normal?!
So I edited trigger to this, but not sure how to replace the item tome with normal[tome]
  • test
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to (==) recipe[tome]
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has an item of type sword1) Equal to (==) True
          • ((Hero manipulating item) has an item of type sword2) Equal to (==) True
          • ((Hero manipulating item) has an item of type recipe) Equal to (==) True
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type sword1)
          • Item - Remove (Item carried by (Hero manipulating item) of type sword2)
          • Item - Remove (Item carried by (Hero manipulating item) of type recipe)
          • Hero - Create final sword and give it to (Hero manipulating item)
          • Special Effect - Create a special effect at (Position of (Hero manipulating item)) using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
 

Attachments

  • Item Recipes1.w3x
    14 KB · Views: 44
Last edited:
Level 5
Joined
Mar 5, 2015
Messages
135
Well, that's something different entirely ;) What I would, is to create a seperate non-usable recipe item (identical to the other one, just not usable), which you can add to the player when buying the recipe from the shop. This should ofc only happen if the player doesn't have the required items, and if the player has enough space in his/her inventory.
 
Status
Not open for further replies.
Top