How can I prevent the purchase of an item if...

SutinG

Member
Reaction score
1
Hi,
I need to prevent the purchase of an item if the buying hero hasn't some 'X' item... Is this possible? I've seen something like that in DotA.
Currently I'm checking this with a trigger and that returns the gold if is necessary, but this isn't a very fancy solution...

Thanks in advance.
Oh I almost forget.. Happy new year!
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Create an upgrade named after your item that needs an item [going to call it item 1], then if the hero buys the needed item [going to call it item 2] set upgrade level to 1, if he loses item 2 set it to 0, add the tech tree to your items requirements.
 

SutinG

Member
Reaction score
1
Thanks Dameon, but I've already tried that and it doesn't work... I can buy the item without any restriction.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Ahh that's right u need to own the shop for that to work. only other thing I can think of is don't add the 2nd item to the shop, when the hero selects the shop check to see if he has the item, if he does add the 2nd item to the shops inventory with 1 max charge, this way the item wont even show up unless you have the first item you need.
Trigger:
  • Untitled Trigger 003
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • ((Random unit from (Units owned by Player 1 (Red) matching (((Matching unit) is A Hero) Equal to True))) has an item of type Claws of Attack +3) Equal to True
    • Actions
      • Neutral Building - Add Claws of Attack +6 to (Triggering unit) with 1 in stock and a max stock of 1
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top