• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

[Eventing Question] Random item event

  • 3
    Posts
    3
    Years
    • Seen Jun 26, 2021
    Hi guys,
    Im making a pokemon game based on an island, and i want to make an item ball event that gives you everyday 1 random item from all items available, ai tried and didnt succeed.
    Any help would be appreciated :D
     
    There are a few different ways you could do this. Here's how I would do it.
    Since this is an event that resets at midnight (presumably), you can look at how Kurt works in the example maps.
    The first event page for your item ball might look like this (I've used script commands, but some of this you could do using event commands):
    Code:
    arr = []
    GameData::Item.each { |s| arr.push(s.id) if !s.is_important? && !s.is_mega_stone? }
    if pbItemBall(arr.sample)
      pbSetEventTime # Start timer until next time player can receive an item
      pbSetSelfSwitch(@event_id,"A",true) # Activates self-switch A, usually corresponds to the event page that is used while the event is cooling down
    end
    This gives the player one of any defined item that is not a key item, TM, HM or mega stone.
    I hope that helps!
     
    There are a few different ways you could do this. Here's how I would do it.
    Since this is an event that resets at midnight (presumably), you can look at how Kurt works in the example maps.
    The first event page for your item ball might look like this (I've used script commands, but some of this you could do using event commands):
    Code:
    arr = []
    GameData::Item.each { |s| arr.push(s.id) if !s.is_important? && !s.is_mega_stone? }
    if pbItemBall(arr.sample)
      pbSetEventTime # Start timer until next time player can receive an item
      pbSetSelfSwitch(@event_id,"A",true) # Activates self-switch A, usually corresponds to the event page that is used while the event is cooling down
    end
    This gives the player one of any defined item that is not a key item, TM, HM or mega stone.
    I hope that helps!

    Thank you man! is there any way to add evolutions stones, tms and hms?
     
    Thank you man! is there any way to add evolutions stones, tms and hms?

    Evolution stones should be included. If you meant mega evolution stones, then use this (also no longer excludes TMs and HMs):
    Code:
    arr = []
    GameData::Item.each { |s| arr.push(s.id) if !s.is_key_item? }
    if pbItemBall(arr.sample)
      pbSetEventTime # Start timer until next time player can receive an item
      pbSetSelfSwitch(@event_id,"A",true) # Activates self-switch A, usually corresponds to the event page that is used while the event is cooling down
    end
     
    Evolution stones should be included. If you meant mega evolution stones, then use this (also no longer excludes TMs and HMs):
    Code:
    arr = []
    GameData::Item.each { |s| arr.push(s.id) if !s.is_key_item? }
    if pbItemBall(arr.sample)
      pbSetEventTime # Start timer until next time player can receive an item
      pbSetSelfSwitch(@event_id,"A",true) # Activates self-switch A, usually corresponds to the event page that is used while the event is cooling down
    end

    Thank you very much man! you the best! :D when I'll finnish my game I'll let you know if it worked.
     
    Back
    Top