• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Item that cannot be throw or sell

  • 68
    Posts
    6
    Years
    • Seen Aug 25, 2023
    Hi! Maybe this is a basic question, but, I readed at the wiki but I couldn't find anything...

    I was making a quest about collect 30 of a specific item, but, if the player throws or sells one of them, then he can't complete the quest. So, is possible to make a item that cannot be trown? I know that if you put its price at 0 you can't sell the Item, but for the other thing...
     
    To not throw, we have this def:
    Code:
    # Important items can't be sold, given to hold, or tossed.
    def pbIsImportantItem?(item)
      return $ItemData[item] && (pbIsKeyItem?(item) ||
                                 pbIsHiddenMachine?(item) ||
                                 (INFINITETMS && pbIsTechnicalMachine?(item)))
    end

    So, create a new def for your items, like we have for Mega Stone:
    Code:
    def pbIsMegaStone?(item)   # Does NOT include Red Orb/Blue Orb
      return $ItemData[item] && $ItemData[item][ITEMTYPE]==12
    end

    But for you:
    Code:
    def pbIsLuisMRLItem?(item)   # Does NOT include Red Orb/Blue Orb
      return $ItemData[item] && $ItemData[item][ITEMTYPE]==13
    end

    Then, add your new code inside 'def pbIsImportantItem?(item)':
    Code:
    # Important items can't be sold, given to hold, or tossed.
    def pbIsImportantItem?(item)
      return $ItemData[item] && (pbIsKeyItem?(item) ||
                                 pbIsHiddenMachine?(item) ||pbIsLuisMRLItem?(item) ||
                                 (INFINITETMS && pbIsTechnicalMachine?(item)))
    end

    Also, remember to put the number (13) inside item.txt (check how Mega stone works).
     
    Also, remember to put the number (13) inside item.txt (check how Mega stone works).

    My megastones are:

    544,AUDINITE,Audinite,Audinites,1,50000,"One of the mysterious Mega Stones. Have Audino hold it, and this stone will enable it to Mega Evolve in battle.",0,0,0,

    XD I don't know, but i guess is something like this?:

    841,TBOX,Trash Box,Trash Boxes,1,0,"A small box full of trash!",0,0,14,

    (I used 14 because 13 is Z-crystals, also, with that, i can't have more than 1 of the item , but at least i can't throw them xd)
     
    You can just modify the method mentioned above directly, rather than creating a whole new category of items:

    Code:
    # Important items can't be sold, given to hold, or tossed.
    def pbIsImportantItem?(item)
      return $ItemData[item] && (pbIsKeyItem?(item) ||
                                 pbIsHiddenMachine?(item) ||
                                 (INFINITETMS && pbIsTechnicalMachine?(item)) [COLOR="Red"]||
                                 isConst?(item,PBItems,:MYITEM)[/COLOR])
    end
     
    Spoiler:


    Ops, missundestood. 30 to same item instead 30 differents items. So yeah, follow what Maruno wrote.
     
    Last edited:
    It works! Thanks both of you so much!

    (The only issue is that the game doesn't show how much of that item the player has, but whatever, I guess, I tested the game, quest and items and it worked)
     
    Hmmm I think you can adapt what we have for Zygarde Cube:
    https://www.pokecommunity.com/threads/398562

    Look where we have:
    Code:
    elsif cmdCheck>=0 && command==cmdCheck # Check Zygarde Cube
             Kernel.pbMessage(_INTL("\\w[blacktextskin]\\c[8]You have collected {1}/100 Zygarde Cores and Zygarde Cells.",$game_variables[107]))
             Kernel.pbMessage(_INTL("\\w[blacktextskin]\\c[8]You have {1} in the Zygarde Cube now.",$game_variables[107]))
             @scene.pbRefresh

    And edit for your item.
     
    It works! Thanks both of you so much!

    (The only issue is that the game doesn't show how much of that item the player has, but whatever, I guess, I tested the game, quest and items and it worked)
    You can have a look in def drawItem in the Bag scripts and find the reference to pbIsImportantItem? there. Add in a || isConst?(item,PBItems,:MYITEM) to show the quantity for it.
     
    Back
    Top