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] Any way to discover if an item fails to be sold?

Discussion in 'Triggers & Scripts' started by HellslayerX15, Jun 10, 2009.

  1. HellslayerX15

    HellslayerX15

    Joined:
    Apr 23, 2008
    Messages:
    252
    Resources:
    0
    Resources:
    0
    A hero wants to shop an item.

    The hero already have 6 items.

    The hero fails to shop the item.

    Can I trigger an event when the item is clicked / when it fails to be sold?


    This is done in DotA
     
  2. Lord_BoNes

    Lord_BoNes

    Joined:
    Sep 5, 2007
    Messages:
    264
    Resources:
    0
    Resources:
    0
    If by that, you mean "cannot be sold or dropped"... then they just made it so that the item can't be dropped in the item properties. If you can't drop it, you can't sell it. :thumbs_up:
     
  3. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,237
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    No dude, read what he said. He wants to know how to detect when a player attempts to buy an item for a unit with a full inventory.
     
  4. Lord_BoNes

    Lord_BoNes

    Joined:
    Sep 5, 2007
    Messages:
    264
    Resources:
    0
    Resources:
    0
    Soz. My bad :p

    The way that I did it, create a duplicate of the item, base off of a tome... then just check whenever an item is used. IE: if the item is a special duplicate, then check the unit's inventory, if there's space, then create the "real-deal" item. :thumbs_up:
     
  5. HellslayerX15

    HellslayerX15

    Joined:
    Apr 23, 2008
    Messages:
    252
    Resources:
    0
    Resources:
    0
    will take time but I will try that thanks
     
  6. HellslayerX15

    HellslayerX15

    Joined:
    Apr 23, 2008
    Messages:
    252
    Resources:
    0
    Resources:
    0
    Had to remake almost all my item triggers but it worked :csmile:
     
  7. Lord_BoNes

    Lord_BoNes

    Joined:
    Sep 5, 2007
    Messages:
    264
    Resources:
    0
    Resources:
    0
    Good to hear. I had a bit of a play with it a while back...
    I created two arrays for my items, one for the "duplicate" and one for the "real thing". Doing it this way also allows you to make the "sold" item cost nothing to buy, but do your own check for prices.
    Then, you can have you own style of tooltip for the prices (instead of the tiny icons).

    EG:
    Mythril Arrows
    Cost: 400 gold, 50 lumber
    .........

    It took me a bit to get it to work exactly how I wanted, but it does look good when you're done. :thumbs_up: