AutMouse Labs Steal System Plugin for MZ

Hello all, A while back I released a Steal Plugin for MZ that was usable but not very user friendly under the name AMMZ_Steal.js. There is a thread about it

here

if you want to look at it. As part of that process I got some great feedback from Trihan and ATT_Turan that was encouraging but honestly above my head at the time. Since then I have gotten better with js and much better at deciphering the MZ code base. I have also decided on a name to use for my plugins and tutorials going forward, AutMouse Labs. I am excited to present this far easier to use successor to that plugin here.

The new version is fully integrated into MZ's plugin command system and only requires a few parameters be set up in the plugin itself and one state to be reserved for marking enemies as already stolen from.

----Instructions----
Use the plugin command 'Steal" in a common event that is ran by a skill or item.
Create an inventory list in an enemies notetags using the following format: <stealList:X Y> X and Y are item id numbers and must be separated by spaces. There needs to be no spaces before or after the items. There is no limited to the number of items you can add to the inventory in this way (e.g. <stealList:X Y Z>
Reserve a state for when an enemy has already been stolen from and set that state id in the plugin parameter.
Set a steal success chance in the plugin parameter.

I will be updating this post with a video outlining how to use the plugin later this week.

Thanks!

----Version----
1.0.1 - 05/09/2023
- Fixed a bug that causes game to crash if stealing from an enemy with no stealList
- Fixed a bug that would conflict with other plugins using the variable pluginName

1.0 - 05/08/2023
- Plugin Released

----License----
This plugin is distributed under the MIT license.
Feel free to use it modify it in any project.
Credit is appreciated as AUTMOUSE
Great plugin.
Though I'm experiencing an issue, if I'm fighting with two enemies that are the same if i steal from one the other is not able to stolen from even though it doesn't have the state. Its giving the message as if it does have the state. Or is this meant to only be used once per battle reguardless?

Looks like it was a problem with my targeting I can now steal from all enemies in combat.

EDIT:
On the you stole section if you want to add this it will add the icon of the item stolen as well.
`You stole a \\I[${$dataItems[AUTMOUSE_steal.numStealList[AUTMOUSE_steal.itemStolenId]].iconIndex}]${ $dataItems[ AUTMOUSE_steal.numStealList[AUTMOUSE_steal.itemStolenId] ].name }!` );
Oh cool! Thanks for the code snippet. I will add that in. 🙂
@cetra777 hello there! I'm wondering if you can help me! I'm not sure if there's an oversight here or if I'm using the plugin improperly but I seem to get a crash whenever I attempt a steal on an enemy once I've defeated certain other enemies in the troop.

I have three enemies in the troop, and their order in that troop seems to matter. So let's say I have enemy number 1, 2, and 3 in that order (their assigned positions in the troops data)

If I kill an enemy that's earlier in the order before attempt to steal from any of the ones that come after (e.g. I kill enemy 2 and then attempt to steal from enemy 3, or I kill enemy 1 and attempt to steal from enemy 3) the game crashes with the warning:

TypeError
Cannot read property 'enemyId' of undefined.

Perhaps killing an enemy seems to alter the others' ID somehow?

Original thread: https://forums.rpgmakerweb.com/threads/autmouse-labs-steal-system-plugin-for-mz.157361/