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

allow 1 hero to buy and sell from shop but the other hero unable to buy but can sell to shop?

Status
Not open for further replies.
Level 21
Joined
Dec 4, 2007
Messages
1,478
Not without huge workarounds i'm guessing.
Like using dummy items exclusively, with triggers that check the player slot upon acquisition.
If an unwanted player bought the item > remove it, reset the item's availability etc and refund its cost.

Seems cumbersome, i'd think of something else.
 
Level 4
Joined
Dec 1, 2011
Messages
41
yeah i figured it would be a huge workaround. i things in the shop that only affect 1 hero and if a different hero buys it then it doesnt work at all and waste the money. its a rpg game where only the main hero should be able to buy from the shop while the other heros(they are just pack mules to carry items they dont attack or do anything else) should only be able to sell items and not buy.
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
Think this may work :
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Market = Market 0001 <gen>
      • Neutral Building - Add Crown of Kings +5 to Market with 1 in stock and a max stock of 1
      • Neutral Building - Add Health Stone to Market with 1 in stock and a max stock of 1
      • Neutral Building - Add Scroll of Protection to Market with 1 in stock and a max stock of 1
      • Neutral Building - Add Mana Potion to Market with 1 in stock and a max stock of 1
      • Neutral Building - Add Health Potion to Market with 1 in stock and a max stock of 1
Secondly, You need to trigger the item like this :
  • Trigger
    • Events
      • Unit - A unit comes within 450.00 of Market 0001 <gen>
    • Conditions
      • (Triggering unit) Equal to Archmage 0000 <gen>
    • Actions
      • Neutral Building - Remove Crown of Kings +5 from Market
      • Wait until ((Distance between (Position of Market 0001 <gen>) and (Position of (Triggering unit))) Greatar than 500.00), checking every 1.00 seconds
      • Neutral Building - Add Crown of Kings +5 to Market with 1 in stock and a max stock of 1
P.S : For some reason, you can't remove items from a market when they were added via the Object Editor, but nevertheless. You can still add them via triggers instead.
 
Last edited:
Level 4
Joined
Dec 1, 2011
Messages
41
that would work warseeker, but my hero i want to buy and sell has a hero that is a pack mule that follows everywhere he goes and i want it to be able to sell but not buy. so i cant use your code since they are always in the same place at the same time. i just want to make certain units not able to even click on items in the shop.
 
Level 4
Joined
Dec 1, 2011
Messages
41
i will now try everyones ideas. thanks alot of everyone, but before i even try i think none of the ideas will work cause if some of the heros click on an item the game crashes so i need to make them unable to click on items in the shop. best option i have come up with so far is i just put a display message saying only use the one hero to buy items or else the game will crash so hopefully people will read the warning and follow the rules
 
Level 4
Joined
Dec 1, 2011
Messages
41
i was able to make this work for items on the ground, but can't make it work for items in the shop.


no items
Events
Unit - HEY! LISTEN! 0616 <gen> Is issued an order targeting an object
Conditions
Or - Any (Conditions) are true
Conditions
(Item-type of (Target item of issued order)) Equal to tome of strength +2
(Item-type of (Target item of issued order)) Equal to tome of agility +2
(Item-type of (Target item of issued order)) Equal to manual of health
(Item-type of (Target item of issued order)) Equal to tome of Intelligence +2
(Item-type of (Target item of issued order)) Equal to strength, intelligence, agility + 5 each
(Item-type of (Target item of issued order)) Equal to power overwhelming
(Item-type of (Target item of issued order)) Equal to rune for the ruined
Actions
Unit - Pause HEY! LISTEN! 0616 <gen>
Unit - Order HEY! LISTEN! 0616 <gen> to Stop
Unit - Unpause HEY! LISTEN! 0616 <gen>
Game - Display to (All players) for 1.00 seconds the text: u cant buy items
 
Status
Not open for further replies.
Top