A downloadable tool

Get this tool and 12 more for $32.50 USD
View bundle
Buy Now
On Sale!
50% Off
$2.00 $1.00 USD or more

๐Ÿ›’ ED5 Random Shop Items v2.1

Professional dynamic shop system for RPG Maker MV & MZ
Random items, stock limits, persistence & auto-generation

RPG Maker MZ 1.8.1 RPG Maker MV 1.6.3 Free License v2.1

๐ŸŒŸ Features

Core Shop System

  • โœจ Random Item Selection - Automatically select random items from pools
  • โœจ Stock & Quantity Limits - Per-item stock with random ranges ("5-15")
  • โœจ Shop Persistence - Items and stock remembered across visits
  • โœจ Save/Load Compatible - Full persistence through save files
  • โœจ Restocking System - Manual or automatic stock restoration

Auto-Generation

  • ๐Ÿค– Database Scanning - Automatically generate shops from your database
  • ๐Ÿค– Type Filtering - Filter by items, weapons, armors, or all
  • ๐Ÿค– Price Range Filtering - Set minimum and maximum prices
  • ๐Ÿค– Tag Exclusion - Use <NoDrop> tags to exclude items
  • ๐Ÿค– Smart Selection - Intelligently picks varied items

Advanced Controls

  • ๐ŸŽฎ Full Plugin Commands - MZ visual + MV text commands
  • ๐ŸŽฎ Script Call Support - Complete JavaScript API
  • ๐ŸŽฎ Custom Pricing - Override prices with multipliers
  • ๐ŸŽฎ Stock Queries - Check stock amounts in events

Compatibility

  • โœ… MV & MZ Compatible - Works on both engines automatically
  • โœ… Plugin-Friendly - Compatible with most other plugins
  • โœ… Performance Optimized - Efficient memory usage
  • โœ… Debug Mode - Built-in logging for troubleshooting

๐Ÿ“ฆ Installation

For RPG Maker MZ:

  1. Download ED5_RandomShopItems.js
  2. Copy to js/plugins/ folder
  3. Open Plugin Manager in RPG Maker MZ
  4. Add the plugin and enable it
  5. Configure parameters (optional)
  6. Save your project

For RPG Maker MV:

  1. Download ED5_RandomShopItems.js
  2. Copy to js/plugins/ folder
  3. Open Plugin Manager in RPG Maker MV
  4. Add the plugin and enable it
  5. Configure parameters (optional)
  6. Save your project

That's it! The plugin is ready to use. Create an event with a plugin command or script call to open your first shop!


๐ŸŽฎ How to Use

Basic Usage

Once installed, you can create shops in three ways:

Method Description
Auto-Generated Plugin picks random items from database with filters
Custom Shop You manually specify which items to sell
Item Range Specify ranges like "items 1-10" for quick setup

That's all you need to know to start creating shops!


๐Ÿš€ Quick Start

RPG Maker MZ (GUI Commands)

  1. Create an event
  2. Add Plugin Command
  3. Select ED5_RandomShopItems
  4. Choose Open Auto-Generated Shop
  5. Set Item Count to 10
  6. Run your event - Done!

RPG Maker MV (Text Commands)

  1. Create an event
  2. Add Plugin Command
  3. Type: RandomShop auto 10 all unlimited
  4. Run your event - Done!

๏ฟฝ Plugin Commands

RPG Maker MZ (GUI Commands)

Use the plugin command interface:

Open Auto-Generated Shop
โ—†Plugin Command: ED5_RandomShopItems โ†’ Open Auto-Generated Shop
  โ””โ”€ Item Count: 10
  โ””โ”€ Item Types: All Types
  โ””โ”€ Stock Type: Unlimited
Open Custom Shop
โ—†Plugin Command: ED5_RandomShopItems โ†’ Open Custom Shop
  โ””โ”€ Shop Items: 0,1,50,10 0,2,100,5 1,5,500,3
Open Item Range Shop
โ—†Plugin Command: ED5_RandomShopItems โ†’ Open Item Range Shop
  โ””โ”€ Item Range: 1-10
  โ””โ”€ Stock: 5-15
Restock Current Shop
โ—†Plugin Command: ED5_RandomShopItems โ†’ Restock Current Shop
Restock All Shops
โ—†Plugin Command: ED5_RandomShopItems โ†’ Restock All Shops
Reopen Last Shop
โ—†Plugin Command: ED5_RandomShopItems โ†’ Reopen Last Shop
Check Item Stock
โ—†Plugin Command: ED5_RandomShopItems โ†’ Check Item Stock
  โ””โ”€ Item Type: Items (0)
  โ””โ”€ Item ID: 1
  โ””โ”€ Result Variable: 10

RPG Maker MV (Text Commands)

Type these directly in the plugin command box:

RandomShop auto [count] [types] [stock] [amount] [price] [min] [max] [exclude]
RandomShop custom type,id,price,stock type,id,price,stock ...
RandomShop range itemType itemRange price stock maxItems
RandomShop restock
RandomShop restockAll
RandomShop reopen
RandomShop checkStock itemType itemId variableId eventId mapId

๐Ÿ’ป Script Calls

Use these in Script event commands (works in both MV & MZ):

Open Auto-Generated Shop

SceneManager.openAutoGeneratedShop({
    itemCount: 10,              // Number of items to show
    itemTypes: [0, 1, 2],       // 0=items, 1=weapons, 2=armors
    priceMultiplier: 1.0,       // Multiply all prices
    stockRange: '10-30',        // Stock amount or range
    excludeNoDrop: true,        // Exclude <NoDrop> tagged items
    minPrice: 0,                // Minimum item price
    maxPrice: 999999,           // Maximum item price
    forceRegenerate: false      // Force new items
});

Open Custom Shop

SceneManager.openRandomShopWithItems([
    {type: 0, id: 1, price: 50, stock: 10},      // Item
    {type: 1, id: 5, price: 500, stock: '5-15'}, // Weapon with random stock
    {type: 2, id: 3, price: 300, stock: 0}       // Armor unlimited
], 3);

Restock Shops

SceneManager.restockShop();           // Restock current shop
SceneManager.restockAllShops();      // Restock all shops

Check Stock

var stock = SceneManager.getShopStock(
    eventId,    // Event ID (0 = current)
    mapId,      // Map ID (0 = current)
    itemType,   // 0=item, 1=weapon, 2=armor
    itemId      // Item ID
);
// Returns: stock count, or -1 if unlimited

Reopen Last Shop

SceneManager.openRandomShopWithLastItems();

๐Ÿ’ก Examples

Example 1: Basic Auto Shop

// MZ Plugin Command:
Open Auto-Generated Shop
Item Count: 10
Item Types: All Types
Stock Type: Unlimited
// MV Plugin Command:
RandomShop auto 10 all unlimited
// Script Call:
SceneManager.openAutoGeneratedShop({
    itemCount: 10,
    itemTypes: [0, 1, 2]
});

Example 2: Potion Shop with Limited Stock

// MZ Plugin Command:
Open Auto-Generated Shop
Item Count: 5
Item Types: Items Only
Stock Type: Random Range
Stock Amount: 10-30
Maximum Price: 500
// MV Plugin Command:
RandomShop auto 5 items random 10-30 1.0 0 500
// Script Call:
SceneManager.openAutoGeneratedShop({
    itemCount: 5,
    itemTypes: [0],
    stockRange: '10-30',
    maxPrice: 500
});

Example 3: Premium Weapon Shop

// MZ Plugin Command:
Open Auto-Generated Shop
Item Count: 8
Item Types: Weapons Only
Stock Type: Fixed Amount
Stock Amount: 3
Price Multiplier: 1.5
Minimum Price: 1000
// MV Plugin Command:
RandomShop auto 8 weapons fixed 3 1.5 1000 9999
// Script Call:
SceneManager.openAutoGeneratedShop({
    itemCount: 8,
    itemTypes: [1],
    stockRange: 3,
    priceMultiplier: 1.5,
    minPrice: 1000
});

Example 4: Custom Shop with Specific Items

// MZ Plugin Command:
Open Custom Shop
Shop Items:
0,1,50,10
0,2,100,5
1,5,500,3
// MV Plugin Command:
RandomShop custom 0,1,50,10 0,2,100,5 1,5,500,3
// Script Call:
SceneManager.openRandomShopWithItems([
    {type: 0, id: 1, price: 50, stock: 10},
    {type: 0, id: 2, price: 100, stock: 5},
    {type: 1, id: 5, price: 500, stock: 3}
], 3);

Example 5: Item Range Shop

// MZ Plugin Command:
Open Item Range Shop
Item Range: 1-10
Item Type: Items
Stock: 5-15
// MV Plugin Command:
RandomShop range 0 1-10 0 5-15 10
// Script Call:
SceneManager.openRandomShopWithItems([
    {type: 0, id: '1-10', price: 0, stock: '5-15'}
], 10);

Example 6: Daily Rotating Shop

// Check if new day
if ($gameVariables.value(1) !== $gameSystem.day()) {
    // Restock and force new items
    SceneManager.openAutoGeneratedShop({
        itemCount: 10,
        stockRange: '10-30',
        forceRegenerate: true
    });
    $gameVariables.setValue(1, $gameSystem.day());
} else {
    // Same items within the day
    SceneManager.openAutoGeneratedShop({
        itemCount: 10,
        stockRange: '10-30'
    });
}

Example 7: Stock-Based NPC Dialogue

// Check stock
SceneManager.getShopStock(0, 0, 0, 1); // Returns stock amount
// Or use plugin command: RandomShop checkStock 0 1 10 0 0
// Then in event:
Conditional Branch: Variable [10] = 0
  Text: Sorry, we're sold out!
Else
  Conditional Branch: Variable [10] <= 5
    Text: We're running low, only \V[10] left!
  Else
    Text: We have \V[10] in stock!

โš™๏ธ Plugin Parameters

Parameter Default Description
Default Max Items 5 Default number of items in auto-generated shops
Enable Stock System true Enable stock tracking system
Default Stock 0 Default stock amount (0 = unlimited)
Show Stock Count true Display stock counts in shop window
Stock Text %1 (Stock: %2) Stock display format (%1=item, %2=stock)
Sold Out Text SOLD OUT Text shown when item out of stock
Restock On Map Change false Auto-restock when player changes maps
Debug Mode false Show console logs (F8) for debugging

๐Ÿ’พ Shop Persistence

โš ๏ธ IMPORTANT: How Shop Persistence Works

Shops remember their items and stock across visits:

  • First Visit: Shop generates random items and stock
  • Subsequent Visits: Shows THE SAME items (not new random items!)
  • After Purchases: Stock depletes normally
  • After Save/Load: Shop state is preserved
  • After Restocking: Stock restored, same items
โœ… This ensures consistent shopping experience!
Players won't see different items every time they enter the shop.

To Get NEW Items:

  • Use restockShop() to restore stock (keeps same items)
  • Use forceRegenerate: true to force new item selection
// Force new items
SceneManager.openAutoGeneratedShop({
    itemCount: 10,
    forceRegenerate: true
});

๐Ÿท๏ธ Database Tags

Add these tags to item/weapon/armor notes to control auto-generation:

<NoDrop>
Prevents item from appearing in auto-generated shops
<NoShop>
Same as NoDrop - prevents item from appearing in shops

Example in Item Notes:

This is a rare quest item.
<NoDrop>
<NoShop>
Use these tags to exclude quest items, unique items, or story items from random shops!

๐ŸŽฌ Common Use Cases

1. General Store with Mixed Items

โ—†Plugin Command: Open Auto-Generated Shop
  โ””โ”€ Item Count: 15
  โ””โ”€ Item Types: All Types
  โ””โ”€ Stock: 10-20
โ—†Text: Welcome to our general store!

2. Potion Shop

โ—†Plugin Command: Open Auto-Generated Shop
  โ””โ”€ Item Count: 8
  โ””โ”€ Item Types: Items Only
  โ””โ”€ Max Price: 500
  โ””โ”€ Stock: Unlimited
โ—†Text: Fresh potions and supplies!

3. Rare Weapon Dealer

โ—†Plugin Command: Open Auto-Generated Shop
  โ””โ”€ Item Count: 5
  โ””โ”€ Item Types: Weapons Only
  โ””โ”€ Min Price: 1000
  โ””โ”€ Stock: 1-3
  โ””โ”€ Price Multiplier: 1.5
โ—†Text: Only the finest weapons here.

4. Daily Special Shop

โ—†Conditional Branch: Variable [DayNumber] != Current Day
  โ””โ”€ Script: SceneManager.openAutoGeneratedShop({
                itemCount: 10,
                forceRegenerate: true
             });
  โ””โ”€ Control Variables: [DayNumber] = Current Day
โ—†Else
  โ””โ”€ Plugin Command: Reopen Last Shop

5. Check Stock Before Selling

โ—†Plugin Command: Check Item Stock
  โ””โ”€ Item: Potion (Item 1)
  โ””โ”€ Variable: 10
โ—†Conditional Branch: Variable [10] > 0
  โ””โ”€ Text: Yes, we have \V[10] in stock!
โ—†Else
  โ””โ”€ Text: Sorry, we're all out!

๐Ÿ“œ Changelog

v2.1(October 11, 2025)

  • โœ… FIXED: Auto-generated shops now persist items on revisit
  • โœ… Shops no longer regenerate items every time player enters
  • โœ… Added forceRegenerate option for daily/weekly shops
  • โœ… Consistent behavior with manual shops
  • โœ… Added "Open Custom Shop" plugin command
  • โœ… Added "Open Item Range Shop" plugin command
  • โœ… Added "Check Item Stock" plugin command
  • โœ… Complete plugin command coverage
  • โœ… Added full plugin commands for MZ and MV
  • โœ… MZ visual interface support
  • โœ… MV text-based commands
  • โœ… Added auto-generation from database
  • โœ… Price range filtering
  • โœ… Item type filtering
  • โœ… <NoDrop> tag support
  • โœ… Added RPG Maker MV compatibility
  • โœ… Automatic version detection
  • โœ… Added random stock quantities ("5-15")
  • โœ… Stock ranges for dynamic inventory

v2.0 (October 11, 2025)

  • โœ… Initial major release
  • โœ… Stock system
  • โœ… Save/load persistence
  • โœ… Restocking system

๐Ÿ“ License

Free to use in commercial and non-commercial projects.

โœ… Allowed:

  • Use in free games
  • Use in commercial games
  • Modify for personal use
  • Include in game compilations

โŒ Not Allowed:

  • Redistribute as your own
  • Sell the plugin separately
  • Remove author credits

๐Ÿš€ Quick Start Guide

Get Started in 3 Steps:

1๏ธโƒฃ Install the Plugin

โ€ข Copy to js/plugins/
โ€ข Enable in Plugin Manager

2๏ธโƒฃ Create a Shop Event

โ€ข Add plugin command or script call
โ€ข Choose auto-generate or custom items
โ€ข Set stock amounts

3๏ธโƒฃ Test It!

โ€ข Talk to NPC
โ€ข See random shop in action
โ€ข Buy items and watch stock decrease!

That's it! You're ready to create dynamic shops! ๐Ÿ›’โœจ


๐ŸŽฏ Perfect For:

๐Ÿ—บ๏ธ RPGs

Dynamic shops that change over time

๏ฟฝ Trading Games

Limited stock creates urgency

๐ŸŽฒ Roguelikes

Random items for each run

๐ŸŒ Open World

Regional shop variation

๐Ÿ’ฐ Economy Sims

Realistic stock management

๐Ÿฐ Survival

Scarce resources

๐Ÿ“– Story-Rich

Shop inventory reflects story

๐ŸŽจ Any RPG!

Adds depth to shopping


โšก Feature Highlights

โœจ Random item generation
โœจ Stock limits
โœจ MV & MZ compatible
โœจ Shop persistence
โœจ Auto-generation
โœจ Price filtering
โœจ Plugin commands
โœจ Save compatible
โœจ Easy to use
โœจ FREE!

๐ŸŽŠ Thank You!

Thank you for using ED5 Random Shop Items!
I hope it adds depth and variety to your game's economy! ๐Ÿ›’๐Ÿ’™

Happy Game Making! โœจ

ED5 Random Shop Items v2.1

Professional dynamic shop system for RPG Maker MV & MZ

Download Latest Support on Patreon

RPG Maker MV | MZ

Need Help? Enable Debug Mode parameter and check console (F8) for detailed logs!

Updated 10 days ago
StatusReleased
CategoryTool
AuthorChigooX
TagsRPG Maker MZ, sourcecode

Purchase

Get this tool and 12 more for $32.50 USD
View bundle
Buy Now
On Sale!
50% Off
$2.00 $1.00 USD or more

In order to download this tool you must purchase it at or above the minimum price of $1 USD. You will get access to the following files:

ED5_RandomShopItems v2.1.js 63 kB

Comments

Log in with itch.io to leave a comment.

Use and like this one, though it would be nice to be able to limit quantities of each item players are able to purchase.

Iโ€™ll add that in the next update 

Cool, let me know and i'll be glad to test it out.

not a problem

it's added!