• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Forbid buying/picking up item

Status
Not open for further replies.
Level 3
Joined
Mar 27, 2005
Messages
38
Hi, I need a trigger which wich forbids the hero to buy or to pick up a specific item if the hero has another specific item in the heros intentory and show the player an error message.
Thx I hope you can help me.

Edit: read my last post plz
 
Last edited:
Level 11
Joined
Dec 31, 2007
Messages
780
You need 2 triggers

1) when picking up an item

  • Untitled trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has an item of type (your other item here)) Equal to True
    • Actions
      • Hero - Drop (Item being manipulated) from (Hero manipulating item)
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text:"you are not allowed to bla bla bla"
2) When buying an item

  • Untitled 2
    • Events
      • Unit - A unit Pawns an item (to shop)
    • Conditions
      • ((Triggering unit) has an item of type (your other item here)) Equal to True
    • Actions
      • Item - Remove (Item carried by (Triggering unit) of type (bought item here))
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text:"you are not allowed to bla bla bla"
      • Player - Add (amount of gold the item costs) to (Owner of (Triggering unit)) Current gold
guess thats it
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
The second trigger isn't possible, since the item is dropped as soon as it's picked up.

I suggest you remove the item in the first trigger and return the item cost to the Owner of Triggering Unit. Also you need to add 1 charge of that item in the shop it was bought from.
 
Level 3
Joined
Mar 27, 2005
Messages
38
Thank you,
The 2nd trigger did not work.

I need triggers which make it impossible to buy/pick up Item[a] if the hero is carrying Item, buying/picking up items of type [c,d,...] should be still possible.
The first trigger I think makes it impossible to pick up any item.
 
Level 3
Joined
Mar 27, 2005
Messages
38
No, the hero should not be possible to buy/pick up item A if he is carrying item B, but he still should be able to buy item C,D,E,... if he is carrying item B
 
Level 3
Joined
Mar 27, 2005
Messages
38
I had a break at mapping, but now I want to finish the map (and this trigger).
I got a upgradeable Item and I want that, if the hero already has the Item [Level 3], picking up another Item (Level 1-3) of the same type is not possible.
I already tried the trigger with "... or ... or ..." but the Item X [Level 3] always was dropped, so I tried this one, but i noticed, everything of the trigger but the last "If (All Conditions are True) then do (Then Actions) else do (Else Actions) ..." works. (If I use the whole trigger, I have the same problem, that Item [Level 3] always is dropped)
What do I have to change?

  • Trigger
    • 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 Item X [Level 3]) Equal to True) and ((Item-type of (Item being manipulated)) Equal to Item X [Level 1])
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Hero manipulating item) has an item of type Item X [Level 3]) Equal to True) and ((Item-type of (Item being manipulated)) Equal to Item X [Level 2])
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Hero manipulating item) has an item of type Item X [Level 3]) Equal to True) and ((Item-type of (Item being manipulated)) Equal to Item X [Level 3])
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
          • Do nothing
 
Last edited:
Status
Not open for further replies.
Top