MV Extension for YEP_ExtraEnemyDrops to have multiple items in one tag

Hi,

I'm using the Extra Enemy Drops plugin, and I'm using it so enemies can drop items, armors, and weapons with a rarity system.
It works fine, but right now I'm facing an issue, which is a more practical than a technical one.

The first problem is that the drop rate of any weapon should be 5%. However, when an enemy might drop two different weapons, I don't want the rates to add up. If both weapons have 5% drop rate, so there's in fact around 10% chance of a weapon being dropped so depending on how many different weapons an enemy might drop, I have to recalculate the drop rates (If they drop 3 kinds of weapon/armor/accessory, I have to recalculate each rate to be 1.7%. Looks tedious)

It wouldn't be so bad if it wasn't for the second problem. 😅

In my game, slimes, thieves, and ghosts kinda harvest everything, and are the only enemies that are likely to drop any kind of weapon/armor/accessory that is not a signature one. And I have a LOT of them in my database.

When I tried to setup the loot table I concluded that I would have to setup 125 notetags, for 25 sets, and solve the equation x^25 = 0.95 to get a drop rate that would be no longer valid if I add another item to the pool later.

TL;DR : I need someone to help me extend the Extra Enemy Drops plugins so I can now put several items separated by a comma in both <Item/Weapon/Armor X: Y%> and <Conditional Item/Weapon/Armor X Drop> so I can input things like this :

<Weapon 50,51,52,53,54: 5%>

Meaning the enemy has 5% chance to drop one of the mentioned items, and not all of them
Have you tried this plugin?
Hi,

Trying to avoid as much as possible to use SRD's plugins, as they are not supported anymore and some are causing lots of bugs. But i'm gonna make a backup and give it a try
I was to mention that plugin @TobyYasha as I knew one existed to
extend it much more.

I also edit YEP_EnemDrops to allow decimals like 1.35 as default flat
number like 1%, 5% doesn't really work out and even 2% drops more
than an item of 10% for odd's reasons, so with the changes, I can do
1/253 so it works much better when checking 😉

the SRD should work in the way you want + you can share the group
if multiple enemies will drop the same or from the same pool.
Looked through SRD's plugin and I'm facing two new issues

- I can't use a range of items : Each enemy drops common weapons, and one signature weapon when they reach their maximum level. Meaning some enemies will drop the same weapon (ex : 10 to 14) based on their level, but at max level, they'll drop weapon 15 or 16.

- I can't use groups, as the drop list is sorted by level. I could make level groups, but there's so much combinations of items i would have to use more groups than I have enemies
However, it looks easier to edit SRD's plugin to use commas instead of hyphens. Do you think I can just... work on this :
JavaScript:
var f = parseInt(RegExp.$1);
var l = parseInt(RegExp.$2);
for(var j = f; j <= l; j++) {
    result.push($dataWeapons[j]);
}

From what I understand, parseInt(RegExp.$1) and parseInt(RegExp.$1) refers to the two numbers that sides the hyphen. How can I change either the RegEx or this parsing bit of code so I can change the formatting from hyphen(-) to comma(,) and put as much as I want so I can input <Group Weapon 13,14,16: 50%> ?

EDIT : seems that I can't combine group and conditional like <Conditional Group Weapon 10-15>

EDIT : Here's an idea of the result I'm trying to achieve in the form of a notetag. I have a monster "Mimic" that, when defeated, drops an equipment based on its level.

Code:
<Conditional Weapon 41,50,55,61,68,81 Drop>
Eval user.level < 15: +5%
</Conditional Weapon 41,50,55,61,68,81 Drop>

<Conditional Weapon 42,51,56,62,67,82 Drop>
Eval user.level >= 15 && user.level < 25 : +5%
<Conditional Weapon 42,51,56,62,67,82 Drop>

<Conditional Weapon 43,52,57,63,68,83 Drop>
Eval user.level >= 25 && user.level < 35 : +5%
</Conditional Weapon 43,52,57,63,68,83 Drop>

<Conditional Weapon 44,53,58,64,69,84 Drop>
Eval user.level >= 35 : +5%
</Conditional Weapon 44,53,58,64,69,84 Drop>
I was having something of the same issue with my game, but I came up with an interesting work around?

Ill say it to give you an idea, but might not work for you.

If an enemy drops a weapon/armor, it is just an "Unidentified Mystery Weapon" or "Unidentified Mystery Armor" in the battle rewards screen, but as soon as battle ends I have a common event run and will show a loot popup window on the map screen to show what was found in battle.

Using said common event it checks the party level, and then rolls to determine weapon/armor type, and rewards a proper level item while removing the Mystery items from the inventory.


Just a suggestion if you are unable to come up with exactly what you're looking for 😀
if you want to use range by id's and comma's, you need to use "split(", ")"
or another regex with [d+]\s*\g or something around this to allow multiple
id's and some uses that in a plugin.

if you can find some that uses that, you can try to use the regex in the
enemy drops plugin.

I think enemydrops also allow condition based on level and drop the item
and ignore the lower level if the actor bypasses it.

it's given in the helpfile, but I dont think the item drop rate increases while
a different drop rate as I didn't had that in my case though.
You might find this more suitable for your needs.

You might find this more suitable for your needs.


I'll look into that if I can't work on the ExtraEnemyDrops, because it would imply re-writing all the notetags, and I'm short on time (must be ready for steam deployment for March)

For the time being, and to ensure that this is the case (the database was expected to be ready by the end of this week), I used "exception notetags".

Slimes, who are supposed to drop almost any non-signature weapons with a 5% drop rate, have the <slime> tag, and mimics that always drop a piece of equipment have the <mimic> tag. I just edited the makeDropItems function so it slips that drop into the rewards at the end of the battle


JavaScript:
Game_Enemy.prototype.makeDropItems = function() {
    var drops = Yanfly.EED.Game_Enemy_makeDropItems.call(this);
    var array = [];
    drops = drops.concat(this.makeConditionalDropItems());
    if ((this.enemy().meta.dropAll && Math.random() < 0.05) || this.enemy().meta.mimic) {
        if (this.level < 15) array = [41,50,55,61,68,81,91,1070,1078,1084,1089,1101,1107,1112,1118,1119,1132,1138,1144];
        else if (this.level >= 15 && this.level < 25) array = [42,51,56,62,69,82,92,87,1071,1079,1085,1090,1094,1102,1108,1113,1120,1121,1133,1139,1145];
        else if (this.level >= 25 && this.level < 35) array = [43,52,57,63,70,83,93,88,96,1072,1080,1086,1091,1095,1103,1109,1114,1122,1123,1134,1140,1146];
        else if (this.level >= 35) array = [44,53,58,64,66,71,73,84,94,89,97,1073,1081,1087,1092,1096,1104,1110,1115,1124,1125,1135,1141,1147];
        var id = array[Math.randomInt(array.length)];
        if (id > 1000)
        {
            id -= 1000;
            drops.push($dataArmors[id]);
        } else {
            drops.push($dataWeapons[id]);
        }
    }
    return drops;
};
Looks dirty, but I can move onto something else before doing something cleaner :/

Original thread: https://forums.rpgmakerweb.com/threads/extension-for-yep_extraenemydrops-to-have-multiple-items-in-one-tag.165421/