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

[Solved] Buy items in the shop

Level 4
Joined
Mar 7, 2024
Messages
41
I need your help, the hero bought an item Claws of Attack +15 in the SHOP but the requirement to buy that item is not gold or wood but two items Kelen's Dagger of Escape and 1 Crown of Kings +5, the hero will lose two items Kelen's Dagger of Escape and 1 Crown of Kings +5 and the rate of receiving the item Claws of Attack +15 is only 50%.
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
  • Untitled Trigger 001
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Claws of Attack +15
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Buying unit) has an item of type Crown of Kings +5) Equal to True
          • ((Buying unit) has an item of type Kelen's Dagger of Escape) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Buying unit) of type Crown of Kings +5)
          • Item - Remove (Item carried by (Buying unit) of type Kelen's Dagger of Escape)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random real number between 0.00 and 100.00) Greater than 50.00
            • Then - Actions
              • Item - Remove (Sold Item)
            • Else - Actions
        • Else - Actions
          • Item - Remove (Sold Item)
If you don't want the buyer to lose the two items if the rate is above 50%, put the last condition on top of the two above conditions.
 
Level 4
Joined
Mar 7, 2024
Messages
41
  • Untitled Trigger 001
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Claws of Attack +15
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Buying unit) has an item of type Crown of Kings +5) Equal to True
          • ((Buying unit) has an item of type Kelen's Dagger of Escape) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Buying unit) of type Crown of Kings +5)
          • Item - Remove (Item carried by (Buying unit) of type Kelen's Dagger of Escape)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random real number between 0.00 and 100.00) Greater than 50.00
            • Then - Actions
              • Item - Remove (Sold Item)
            • Else - Actions
        • Else - Actions
          • Item - Remove (Sold Item)
If you don't want the buyer to lose the two items if the rate is above 50%, put the last condition on top of the two above conditions.
Thank you very much, do you know any way to prevent the hero from holding 2 identical items? Only 1 item can be used.
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
Thank you very much, do you know any way to prevent the hero from holding 2 identical items? Only 1 item can be used.
  • Untitled Trigger 002
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • 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 being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))
              • (Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A)))
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
            • Else - Actions
This will work on all items regardless if they are picked up from the ground or bought from a shop. If you want to limit only the items bought from a shop, replace "Acquires an item" with "Sells an item (from shop)", "Item being manipulated" with "Sold item", and "Hero manipulating item" with "Buying unit".
 
Level 4
Joined
Mar 7, 2024
Messages
41
  • Untitled Trigger 002
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • 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 being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))
              • (Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A)))
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
            • Else - Actions
This will work on all items regardless if they are picked up from the ground or bought from a shop. If you want to limit only the items bought from a shop, replace "Acquires an item" with "Sells an item (from shop)", "Item being manipulated" with "Sold item", and "Hero manipulating item" with "Buying unit".
item Kelen's Dagger of Escape 75HP but when triggering event: unit - Aunit uses an item
The lifespan of the Kelen's Dagger of Escape item will increase to 10000HP or more, this is really difficult, can you help me? This is needed for my map.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
  • Events
    • Unit - A unit Uses an item
  • Conditions
    • (Item-Type of (Item being manipulated)) Equal to Dagger
  • Actions
    • Item - Set life of (Item being manipulated) to 10000
If that doesn't work, you could Remove the (Item being manipulated) and give the unit a different version that has 10000 HP (setup in Object Editor).

There's also these that may work:
  • Item - Set Item: (Item being manipulated)'s Integer Field: Hit Points to Value: 10000
  • Item - Set Item: (Item being manipulated)'s Integer Field: Hit Points ('ihtp') to Value: 10000
 
Level 4
Joined
Mar 7, 2024
Messages
41
  • Events
    • Unit - A unit Uses an item
  • Conditions
    • (Item-Type of (Item being manipulated)) Equal to Dagger
  • Actions
    • Item - Set life of (Item being manipulated) to 10000
If that doesn't work, you could Remove the (Item being manipulated) and give the unit a different version that has 10000 HP (setup in Object Editor).

There's also these that may work:
  • Item - Set Item: (Item being manipulated)'s Integer Field: Hit Points to Value: 10000
  • Item - Set Item: (Item being manipulated)'s Integer Field: Hit Points ('ihtp') to Value: 10000
  • (
    item.gif
    Item - Set Item: (Item being manipulated)'s Integer Field: Hit Points to Value: 10000)
  • (
    item.gif
    Item - Set Item: (Item being manipulated)'s Integer Field: Hit Points ('ihtp') to Value: 10000)
  • I can't find any of these lines anywhere, can you help me
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
  • (
    item.gif
    Item - Set Item: (Item being manipulated)'s Integer Field: Hit Points to Value: 10000)
  • (
    item.gif
    Item - Set Item: (Item being manipulated)'s Integer Field: Hit Points ('ihtp') to Value: 10000)
  • I can't find any of these lines anywhere, can you help me
Need version 1.31+ to use the Set Field actions. You can tell which category they WOULD be in by this:
item.gif
Item
 
Level 4
Joined
Mar 7, 2024
Messages
41
Need version 1.31+ to use the Set Field actions. You can tell which category they WOULD be in by this:
item.gif
Item
When there are 3 regular items to enter the Hero's inventory, the 3 items include: Attack Claws +6, Attack Claws +9, Attack Claws +12 when all 3 items are available. This item will help the general increase his potential power by 1000hp and 50str 50agi 50int, but when 1 of those 3 items is missing, it will not increase anything. please help me
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
Remember to search for a solution yourself before asking for help, I found these two in a minute or two:
It's generally safe to assume that other people have tried and solved whatever it is you're trying to do.
 
Level 4
Joined
Mar 7, 2024
Messages
41
Remember to search for a solution yourself before asking for help, I found these two in a minute or two:
It's generally safe to assume that other people have tried and solved whatever it is you're trying to do.
This morning I looked at the above 2 options but it is not the same as the event I requested. When you have 3 items, you will be increased by 1000hp 50 all str agi int and will lose that effect when the hero's inventory is missing 1 of those 3 items. .
 
Level 4
Joined
Mar 7, 2024
Messages
41
What you're describing is known as an Item Set, when you equip pieces of or the full Set you get a bonus.

That Item Set System should do exactly that.
HOI.PNG

Thank you, I did it, you are truly a master. I created an event that when the Hero moves into an area, he gets an item in his inventory, but I want that item to be in the 6th slot of the hero's inventory, (item This cannot be moved by manipulation) can you help me do this? Here is an example.
 
Level 4
Joined
Mar 7, 2024
Messages
41
It sounds to me like you actually want some sort of equipment system where there are specific slots for specific item-classes. There are at least a couple equipment/inventory systems in the resources here but they may have too much functionality for what you want to achieve.
That's right, my map has 6 heroes, each hero uses his own item class. Each level item in the class item is a weapon for the gladiator character which will be in item level 3 class item : campaign, armor will be in item level 5 item class item : campaign..., but the problem I'm having is the armor +1 at level 5 class item :campaign and armor +3 level 5 class item :campaign can all be used at the same time, so when a hero uses 2 armors at the same time, many models of the armor will be displayed. different armor. I want the hero to only be able to use 1 item class item :campaign level : 5, not 2 items.
 
Level 4
Joined
Mar 7, 2024
Messages
41
Look in the resources for equipment/inventory systems and see if anything seems close. Then you can modify it exactly as you need once you know where you’re starting.

Okay, thank you, can I see if using this long term will affect the game?
HOII.PNG
 
Level 39
Joined
Feb 27, 2007
Messages
5,024
You’re welcome to reply in Vietnamese (we all have google translate), but when quoting someone else’s triggers you should leave it in English. Why? This site has special automatic formatting codes to make triggers in text replies look pretty… but it only recognizes English triggers. If your editor language is set to Vietnamese you may just have to deal with it, but that’s my suggestion.

About your question to Uncle: are you trying to give the item itself more life (make it very difficult to destroy by attacking it on the ground with units) or are you trying to give the unit holding the item more max life? Uncle’s trigger just makes the item harder to destroy, but would not affect the unit holding it.

Are you trying to make it so that after using the dagger to blink the unit prevents all damage it takes for a short time? Explaining your overall objective (rather than just explaining one step along the way you see to a solution) will make it easier to suggest things for you to do.
 
Level 4
Joined
Mar 7, 2024
Messages
41
You’re welcome to reply in Vietnamese (we all have google translate), but when quoting someone else’s triggers you should leave it in English. Why? This site has special automatic formatting codes to make triggers in text replies look pretty… but it only recognizes English triggers. If your editor language is set to Vietnamese you may just have to deal with it, but that’s my suggestion.

About your question to Uncle: are you trying to give the item itself more life (make it very difficult to destroy by attacking it on the ground with units) or are you trying to give the unit holding the item more max life? Uncle’s trigger just makes the item harder to destroy, but would not affect the unit holding it.

Are you trying to make it so that after using the dagger to blink the unit prevents all damage it takes for a short time? Explaining your overall objective (rather than just explaining one step along the way you see to a solution) will make it easier to suggest things for you to do.

okay, I have solved this problem, thanks for your advice.
🥰
 
Top