Plugin that changes drops from entire troop encounter based on enemy drops.

RetailDrone7576

Reillo9
Veteran
Joined
Mar 22, 2018
Messages
37
Reaction score
16
First Language
English
Primarily Uses
RMMV
I'm using yanfly's victory aftermath plugin, and on the battle spoils screen I need a plugin that changes the loot based on all the loot there, such as for every 2 of item #3, instead give 1 of item #2 (so 7 of item 3 would give 3 of item 2 and only 1 of item 3) I would like this plugin to be able to handle multiple different items too and be able to apply to every troop encounter.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,944
Reaction score
1,050
First Language
Dutch
Primarily Uses
RMMV
it might be possible with this plugin "YEP_ExtraEnemyDrops".
you just create a var and the drops you want drop.
so you can make a random 1-7 and the amount of items
so you can get 7 the same, or 7 different items.

I dont know lunatic code exacly, but someone can help you with it.
 

JojoLaVache

Easily distracted
Veteran
Joined
Mar 26, 2020
Messages
45
Reaction score
29
First Language
French
Primarily Uses
RMMV
So if I understand it... you want a custom enemy drop. YEP_ExtraEnemyDrops can do that, but it's a paid plugin. And sadly, this only works on a single enemy's drops, not a troop's.
This is made even more complicated by the fact it's implied the enemy can drop an indefinite quantity of items 2 and 3. I actually have no idea if this is even possible to do what you wanted. The best I can think of a functional solution is the following:
  1. Think of the drop rate of item 3. For the sake of simplicity, I'll go for 50%.
  2. The probability of dropping two instances of item 3 is 50% * 50% = 25%. This would be the probability of dropping a single instance of item 2.
You can have Item 3 as a 50% (1/2 chance) drop and Item 2 as a 25% (1/4 chance) drop without plugins, but if you wanted multiple of each, hoo boy.
For what I know, the <Conditional Item x Drop> tag only works on a single instance of an item, so expect a lot of copypasting. Let's say you can have a maximum of 7 instances of item 3.

For item 3, copy the following seven times:
Code:
<Conditional Item 3 Drop>
  // Calculate the chance of getting the item
  var chance = 0.5;
  // Check RNG if it passed
  if (Math.random() < chance) {
    // You got item 3
    $gameVariables.value(3) += 1;
  }
  // Check if Variable 3 is an odd number
  if (($gameVariables.value(3) % 2) !== 0) {
    // Finally, you got an Item 3
    Always: +50%
  }
</Conditional Item 3 Drop>
For item 2, copy the following three times:
Code:
<Conditional Item 2 Drop>
  // Check if Variable 3 is an even number
  if (($gameVariables.value(3) % 2) == 0) {
    // You got an Item 2
    Always: +25%
  }
  // Lower Variable 3 by two
  $gameVariables.value(3) -= 2;
</Conditional Item 3 Drop>
This also requires you to reset Variable 3 at value zero after getting the items somehow.

I have no idea if any of this works. This is perhaps the most challenging thing I tried to do with JS and I won't be surprised if there's a better way to do all of this.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,472
Members
137,822
Latest member
madelbylz
Top