1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest.
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Forbid buying/picking up item

Discussion in 'Triggers & Scripts' started by Henahax, Nov 5, 2008.

  1. Henahax

    Henahax

    Joined:
    Mar 27, 2005
    Messages:
    37
    Resources:
    0
    Resources:
    0
    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: Nov 29, 2008
  2. darkrider

    darkrider

    Joined:
    Dec 31, 2007
    Messages:
    780
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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
     
  3. Avator

    Avator

    Joined:
    Aug 23, 2008
    Messages:
    2,309
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    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.
     
  4. Henahax

    Henahax

    Joined:
    Mar 27, 2005
    Messages:
    37
    Resources:
    0
    Resources:
    0
    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.
     
  5. Avator

    Avator

    Joined:
    Aug 23, 2008
    Messages:
    2,309
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    So you want the hero to be able to buy and pick up items only when he's carrying a specific item?
     
  6. Henahax

    Henahax

    Joined:
    Mar 27, 2005
    Messages:
    37
    Resources:
    0
    Resources:
    0
    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
     
  7. Vegavak

    Vegavak

    Joined:
    Mar 16, 2006
    Messages:
    1,010
    Resources:
    0
    Resources:
    0
    Just use a bunch of if->thens to get that working.
     
  8. Avator

    Avator

    Joined:
    Aug 23, 2008
    Messages:
    2,309
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Just use darkrider's first trigger and add the condition 'Acquired item equal to item A' (and ofcourse the 'AND (Multiple conditions)' added.
     
  9. Henahax

    Henahax

    Joined:
    Mar 27, 2005
    Messages:
    37
    Resources:
    0
    Resources:
    0
    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: Dec 1, 2008
  10. Henahax

    Henahax

    Joined:
    Mar 27, 2005
    Messages:
    37
    Resources:
    0
    Resources:
    0
    Bump :) plz help me