じ☆ve冰风 发表于 2026-7-26 14:50:36

EIS Random Items

EIS Random Items


        A short script that lets you give items to the player randomly from a list (array) you declare.


        This can be good if you want to replicate something like gathering points from Monster Hunter. Or, put a little bit of RNG in the items you wish to give to your player.


Version 1.00


Core Features


[*]Random Item Gain



Script:


View attachment EISRandomItems.js


Instructions


[*]Place the script in your plugins folder with the same name EISRandomItem
[*]Place it below the system script.
[*]Enjoy





/*
//=============================================================================
//   Functions                                                         
//=============================================================================
*
* KR.Helpers.gainRandomItem(array)
* This method takes an array of items that you wish to pool from.
* After that it will return an item to the player.
*
* Example: KR.Helpers.gainRandomItem(['weapon', 1, 'item', 1, 'item', 2]);
* These are case sensitive and refer to the type of item you want the player
* to gain.
*
* KR.Helpers.setItemGainAmount(Number)
* This method takes a number, which is used to set the amount of the item
* you gain from the game.
*
* Example: KR.Helpers.setItemGainAmount(2);
* This would set the gain amount permanently to 2 until the game is restarted.
* If you want to return it to 1, just say KR.Helpers.setItemGainAmount(1);
*
* Tip: You can also set a random Item gain like so:
* KR.Helpers.setItemGainAmount(KR.Helpers.randomNumber(1, 3));
* You'll get 1 - 3 as the number of items gained.
*/






ScreenShots

SpoilerScreenshots:













Credits:


Free for both commercial and non-commercial use.Credit with the name Kino or Endless Illusion Software.


        Thanks:
        I appreciate you using this script, and I'm glad that it's able to help you.


If there are any bugs/issue, please contact me via message on the forums.


Note:
        If you have any ideas, please feel free to mention them here.


本贴来自国际rpgmaker官方论坛作者:Kino处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/eis-random-items.65470/
页: [1]
查看完整版本: EIS Random Items