Hi,
First things first: This script was not written by me, it's a script by Galv. I got his permission to slightly modify and re-distribute the script with some minor adjustments. Original credit goes to Galv, I merely did some tiny changes.
You can find the most recent script version (1.4) plus a updated demo project on my DropBox:
https://dl.dropboxus...m Loot v1.4.rar
The updated, 1.4 Version of the script (just the script) can be found on pastebin:
http://pastebin.com/khU50cuy
Important Note!
The oder of function arguments changed from 1.1 to 1.2, you might have to re-order your script calls.
Introduction
This is a random loot drop script that lets the player find items according to a rarity system. It enables you to create random loot of different rarity levels without eventing/scripting endless loot tables. Instead of spawning item with ID X, this script spawns items according to their type (item, weapon or armor), family (scroll, potion etc.), rarity and player level restrictions.
All in all very simple changes but it should do the job!
Cheers
-Fhizban (also known as Malagar)
Version 1.2 Changes
A. How the loot is selected has been altered a little bit by changing the starting item as well as the next item if the starting item is skipped due to some reason. With larger databases this caused the same item to drop over and over again, it also resulted into many "empty" treasure chests. This should be fixed now (my project uses several dozens of items with large spaces of padding between and the script works like a charm).
B. I was not satisfied that you could only state to drop ITEMS, WEAPONS or ARMOR. There was no method to further refine the loot drop (e.g. drop only potions, or helmets, or heavy armor or mage weapons or missile weapons). This was changed by adding another note tag to items (the family tag).
You can now assign a family tag to your items in form of a integer number. When using the loot drop you can optionally state the item family you want to spawn. This grants you additional freedom, for example you can have the script only spawn potions or scrolls. Just add <family: X> to your potions (replace X with a number) and state that number when calling the script. Voila!
C. The Lucky Tag for items is functional again.
Version 1.3 Changes
A. The documentation was rewritten and is now much more detailled.
B. The sample project was updated and reflects now all changes.
C. Added some more security checks to the system.
D. You can now filter loot by weapon/armor subtypes as well (thats the ones defined in the Terms section of the database).
Version 1.4 Changes
Added Sixth's compatibility changes
Full Documentation
Code:
本贴来自国际rpgmaker官方论坛作者:Malagar处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/galvs-random-loot-v1-4.43741/