设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 104|回复: 0

[转载发布] Simple Random Shop v. 1.0

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-1 09:10:59 | 显示全部楼层 |阅读模式
    Hey there,

    While practicing and trying to get better at scripting, this little snippet was created. This script allows you to implement random shops in your game. Please note that I am not the best scripter out there. I also like to keep my scripts simple. This system is designed to use the same notetags as Galv's Random Loot and will interlock with my other scripts (Random Drops, Simple Rarities) later on to form a little system (Item Suite).

    Get the most recent version (1.0) plus a demo project from my DropBox:

    https://dl.dropboxusercontent.com/u/18289607/RPGMakersScripts/Random%20Shop%20v1.0.rar

    The script itself can be found on PasteBin as well:

    http://pastebin.com/ySiLsHLR

    Introduction

    This script allows you to use a script call to randomly generate a shop. Add notetags to items to specify level requirements and rarity values. The shop inventory will be generated automatically according to the party level and the notetags provided for items. Shops can sell items of specific types, subtypes or custom defined families. Using a clever combination of type, subtype and families - you can tailor the random shop to offer only items of a very specific type. Like only Armors of the Small Shield type, or just Weapons of the Sword type and so on.

    Note that in this very first version, the shop inventory is re-generated every time a player visits the shop. Persistent shop inventories will be added later. Right now its highly fluctuating - a bit like in Disgaea.

    Version 1.0


    • Limit shops to a maximum amount of items
    • Include only items of certain rarity and level bounds
    • Use the <noshop> notetag to prevent items from showing up in the shop.
    • Modify the shop price +/- by a percentage amount (optional).
    Full Documentation

                    Code:       
    1. #===============================================================================#                          +++ SIMPLE RANDOM SHOP +++#===============================================================================# + Original Script by Fhizban (also known as Malagar)## + Version 1.0# + Updated August 2015# + For RPGMaker VX Ace# + Free for Non-Commercial and Commercial use# + Requires no other scripts#===============================================================================#                                DESCRIPTION#===============================================================================#  This script allows you to use a script call to randomly generate a shop. Add#  notetags to items to specify level requirements and rarity values. The shop#  inventory will be generated automatically according to the party level and#  the notetags provided for items. Shops can sell items of specific types,#  subtypes or custom defined families.#===============================================================================#                                INSTALLATION#===============================================================================# + Put this script after Material but before main.# + Add some of the notetags (described below) to the items in the database.# + Add a new event that represents a shop to your map.# + Add a script call to the event that will generate a random shop (see below).#===============================================================================#                                DOCUMENTATION#===============================================================================# You are required to setup two different parts to make this script work:#   1) Add Notetags to your items in the database.#   2) Add the script call to your events (chests).#   3) Optionally you can change the configuration below to your taste.## 1) Editing Notetags:#    You must specify the following notetags for all ITEMS, WEAPONS and ARMOR that#    you want to randomly appear in your events (shops). If any items do not have#    these tags, they will just not appear in a random shops at all.##    <family: x>                    # The group or family the item belongs to#                                   # You define these families yourself (1-99)#    <rarity: x>                    # The rarity value (1+ higher is rarer)#    <level-min: x>                 # Min level of player for item to show (1-99)#    <level-max: x>                 # Max level of player for item to show (1-99)##    Optional notetag for ARMORS and WEAPONS only:##    <lucky: x>                     # All equipped lucky items of the party are added to#                                   # calculate the total chance to get rarer items.##    New Optional notetags for all item types:##    <noshop>      # Item does never appear in a random shop (requires Simple Random Shop 1.0+)#    <noloot>      # Item is never found as random loot (requires Simple Random Loot 1.4+)#    <nodrop>      # Item is never dropped from an enemy (requires Simple Random Drop 1.0+)## 2) Using the script call:#    By using this script call, you can randomly populate a shop. Go to your event and add#    a new command to it, choose script from the very last command tab and insert the#    following line.#  #    EXAMPLE:##            random_shop(0, 1, 10, 50, 1, 1)##    SYNTAX:##            random_shop(type, rarity_min, rarity_max, price=0, amount=0, subtype=0, family=0)##    type                           # The type of item to be found:#                                   # 0 = All Types, determined randomly#                                   # 1 = Item#                                   # 2 = Armor#                                   # 3 = Weapon#                                   # 4 = One randomly determined Type##    rarity_min                     # Min and Max Rareness determine the item rarity that#    rarity_max                     # the script call will obtain when successful. You can#                                   # state any number that you also use on the notetags#                                   # of your items. Example:#                                   # rarity_min=10, rarity_max=50#                                   # The script call will generate a random number 1-50.#                                   # An item can only be obtained if it has a rarity#                                   # EQUAL or LESS than the generated number.##    price                          # OPTIONAL. This will alter the price of all items in#                                   # the shop by X percent. It is also possible to set#                                   # this to a negative number, lowering the prices.##    amount                         # OPTIONAL. This limites the shop inventory to X items.#                                   # If not set, the default maximum amount limit is used.##    subtype                        # OPTIONAL. This only applies to WEAPONS or ARMOR and#                                   # will be ignored otherwise. Filters the random loot#                                   # to drop only items of the stated type.#                                   # (e.g. 1 = General Armour)##    family                         # OPTIONAL. Family can be any number or 0.#                                   # 0 = drops any item of the stated type/subtype#                                   # x = drops only items of the stated type/subtype that#                                   # share the family.## Using a clever combination of type, subtype and families - you can tailor the random# shop to offer only items of a very specific type. Like only Armors of the Small# Shield type, or just Weapons of the Sword type and so on.#===============================================================================#                                COMPATABILITY#===============================================================================# + Should be compatible with most other scripts (like YANFLY engine).# + Can be combined with my other scripts to form the complete ITEM SUITE:#   + Simple Random Loot#   + Simple Random Shop#   + Simple Random Drop#   + Simple Random Rarities#===============================================================================
    复制代码




    本贴来自国际rpgmaker官方论坛作者:Malagar处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/simple-random-shop-v-1-0.43827/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 22:16 , Processed in 0.083757 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表