Fear3d

SRPG_EnemyEquip

Dec 11th, 2021
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // SRPG_EnemyEquip.js
  3. //=============================================================================
  4. /*:
  5.  * @plugindesc v1.0 Adds <SRPG_EnemyEquip> for SRPG this includes Stealing Options
  6.  * @author dopan
  7.  *
  8.  *
  9.  * @param Enemy Slot Amount
  10.  * @desc Default Amount of EquipSlots for all Enemys.EnemyNote can change this indivudually.
  11.  * @type number
  12.  * @default 5
  13.  *
  14.  * @param Break Chance
  15.  * @desc this Number makes the Break chance in %. Min is "1", Max is "100".
  16.  * @type number
  17.  * @min 0
  18.  * @max 100
  19.  * @default 50
  20.  *
  21.  * @param Steal Chance
  22.  * @desc this Number makes the Steal chance in %. Min is "1", Max is "100".
  23.  * @type number
  24.  * @min 1
  25.  * @max 100
  26.  * @default 50
  27.  *
  28.  * @param Controll Draw Text
  29.  * @desc Switch that lets you decide if a text is drawn into BattleStatus Window if unequiped
  30.  * @type boolean
  31.  * @default true
  32.  *
  33.  * @param noWeapon Text
  34.  * @desc Text that is used on weaponSlot, if "Controll Draw Text" is "true"
  35.  * @default No Weapon
  36.  *
  37.  * @param noShield Text
  38.  * @desc Text that is used on shieldSlot, if "Controll Draw Text" is "true"
  39.  * @default No Shield
  40.  *
  41.  * @param noHead Text
  42.  * @desc Text that is used on headSlot, if "Controll Draw Text" is "true"
  43.  * @default No Head
  44.  *
  45.  * @param noBody Text
  46.  * @desc Text that is used on bodySlot, if "Controll Draw Text" is "true"
  47.  * @default No Body
  48.  *
  49.  * @param noAccessory Text
  50.  * @desc Text that is used on accessorySlot, if "Controll Draw Text" is "true"
  51.  * @default No Accessory
  52.  *
  53.  * @help  
  54.  *
  55.  * this Plugins requires:
  56.  *  "SRPG_Core.js" & "SRPG_Teams" (default actor team "actor" must be used)
  57.  *
  58.  * This Plugin let Enemys use Equipment (default is = 5 base slots) & and it adds the Equipment
  59.  * into the battleStatusWindow of actor&enemys
  60.  *
  61.  * => the max Amount of used EnemySlots is 10
  62.  * (but if using more than the default 5, you need to edit the BattleStatusWindow,or only default5 will be displayed)
  63.  * (such BattleStatusWindow_edit can be made in this plugin or in the "SRPG_StatusWindow(patch)" plugin)
  64.  *
  65.  * => the max Amount of Slots from which can be stolen/broken is also 10
  66.  *
  67.  * => this Plugin includes a stealing/breaking function!
  68.  *
  69.  *
  70.  * The plugin param allows you to change a few things.
  71.  *
  72.  * Everything else is handled with EnemyNotetags, SkillNoteTags & Scriptcalls..
  73.  *
  74.  * (by editing the Plugins JS_code the battleStatusWindow can be changed if needed,
  75.  *  but i think i already made the best of it)
  76.  *
  77.  * When using EnemyNote to set Equip,
  78.  * every enemyClone with the same EnemyID will have the same Equip..
  79.  *
  80.  * But you can also use 2 Scriptcalls,for changing BattlerUnits Equipment on Battlemap,
  81.  * based on the eventID..
  82.  *
  83.  * By default the chanceRates are 50%, this can be changed in the Plugin param,
  84.  *  or by using the plugin Scriptcall.Incase its wanted to have a UnitRelated Chance:
  85.  * ->Such change should happen in the "eventBeforeAction",or with "customExecution" (with scriptcall).
  86.  * Pls Note: (plugin auto reset Chance)
  87.  * The "BreakChance"&"StealChance" will always be reseted to the Plugin param "BreakChance"&"StealChance",
  88.  * ..in the AfterAction_Scene.
  89.  *
  90.  * Default equipSlots are : (BattleStatusWindow related)
  91.  *-------------------------
  92.  * 0 = weapon slot or shield slot (plugin checks if equip is armor or weapon)
  93.  * 1 = shield slot or weapon slot (plugin checks if equip is armor or weapon)
  94.  * 2 = head slot (plugin asumes armor)
  95.  * 3 = body slot (plugin asumes armor)
  96.  * 4 = accessory slot  (plugin asumes armor)
  97.  * (can be used otherways aswell)
  98.  *
  99.  * Plugin Scriptcalls:
  100.  *--------------------
  101.  *
  102.  * (Change Equip related to event ID works for Actors&Enemys .. and on all slots)
  103.  * -> this allows individual EquipChange to every battleUnit
  104.  *
  105.  * $gameTemp.changeUnitArmor(eventID, SlotID, ArmorID);   //by Default armor Slot IDs are "1","2","3","4"
  106.  *                                                      
  107.  * $gameTemp.changeUnitWeapon(eventID, SlotID, WeaponID); //by Default weapon Slot ID is "0"
  108.  *
  109.  * (weaponID and ArmorID , is the Number related to the equipment in your Project)
  110.  * => using 0 on weaponID or ArmorID, will delete any equipment in that slot!!
  111.  *
  112.  * these 2 Scriptcalls above can be used on battlemap to change the Equipment of battleUnits individually
  113.  *-------------------------------------------------------------------------------------------------------
  114.  * ScriptCall to change the Enemys ItemSlot_Item (3slots availleble). This is only for enemyUnits!
  115.  *
  116.  * $gameTemp.changeEnemyItem(eventID, SlotID, ItemID, typeID);
  117.  *
  118.  *
  119.  *  eventID of the enemyUnit
  120.  *  SlotID can be 0 ,1 or 2 (first slot is 0, last slot is 2)
  121.  *  ItemID the ID of the Item or Equip, if id 0 this will leave an empty Slot
  122.  *  typeID can be "item","armor" or "weapon"
  123.  *
  124.  *
  125.  * Example:  $gameTemp.changeEnemyItem(30, 0, 3, "item");
  126.  *
  127.  *----------------------------------------------
  128.  * Scriptcall to change the Stealchance in Game:
  129.  *----------------------------------------------
  130.  * BreakChance:
  131.  *--------------
  132.  * "this.changeBreakChance(chanceNumber);"// usage in Events ,commonEvents ,"Game_Interpreter.prototype"-functions ect
  133.  *
  134.  * or "Game_Interpreter.prototype.changeBreakChance.call(this, chanceNumber);"// usage if used in other pluginsCodes
  135.  *
  136.  *
  137.  * StealChance:
  138.  *--------------
  139.  * "this.changeStealChance(chanceNumber);"// usage in Events ,commonEvents ,"Game_Interpreter.prototype"-functions ect
  140.  *
  141.  * or "Game_Interpreter.prototype.changeStealChance.call(this, chanceNumber);"// usage if used in other pluginsCodes
  142.  *
  143.  *
  144.  *
  145.  * => "chanceNumber" can be any number betwen "1" and "100". "100" means 100% stealChance.
  146.  * (default is ChanceNumber in the Plugin param)
  147.  *
  148.  *
  149.  *
  150.  * Plugin NoteTags:
  151.  *-----------------
  152.  *----------------
  153.  * Enemy noteTags:
  154.  *----------------
  155.  *   <srpgSlot0Type:x>
  156.  *   <srpgSlot1Type:x>
  157.  *   <srpgSlot2Type:x>
  158.  *   <srpgSlot3Type:x>
  159.  *   <srpgSlot4Type:x>
  160.  *   <srpgSlot5Type:x>
  161.  *   <srpgSlot6Type:x>
  162.  *   <srpgSlot7Type:x>
  163.  *   <srpgSlot8Type:x>
  164.  *   <srpgSlot9Type:x>
  165.  *
  166.  *  Type "x" is "armor" or "weapon" (it can only be "armor" or "weapon",never both)
  167.  * Example => <srpgSlot0Type:weapon>  
  168.  * (this tells the plugin that SlotType0 is an WeaponSlot,means EquipID of Slot0 from below will be a weapon_ID)
  169.  *
  170.  *   <srpgSlot0EquipID:x>
  171.  *   <srpgSlot1EquipID:x>
  172.  *   <srpgSlot2EquipID:x>
  173.  *   <srpgSlot3EquipID:x>
  174.  *   <srpgSlot4EquipID:x>
  175.  *   <srpgSlot5EquipID:x>
  176.  *   <srpgSlot6EquipID:x>
  177.  *   <srpgSlot7EquipID:x>
  178.  *   <srpgSlot8EquipID:x>
  179.  *   <srpgSlot9EquipID:x>
  180.  *
  181.  * EquipID "x" is the number of the ID of Weapon or Armor in your project
  182.  * (the plugin will know if its an armor or weapon because of the "SlotType" from above)
  183.  *
  184.  *------------------------------------------------------------------------------------
  185.  * EquipSlotAmount:
  186.  *-----------------
  187.  * by default the Global EquipSlotAmount for enemys is set in the plugin param,
  188.  * it can be any number from 1 up to 10 (default is 5)
  189.  *
  190.  * This enemyNote can set the slotAmount for that enemy ID individually!
  191.  * (if not used default 5 will be used)
  192.  *
  193.  *   <enemySlotSize:x>
  194.  *
  195.  *---------------
  196.  * SkillNoteTags:
  197.  *---------------
  198.  * These noteTags , make a Skill into a "stealing_Skill" or "breaking_Skill"
  199.  * (Skills can be break&steal Skills at the same time)
  200.  * -> the Chance apllys to the whole Skill, if you steal/break more than 1 slot ,the same Chance will be used.
  201.  * => if "srpgBreak" is used it will trigger the breakChance, "srpgSteal" will trigger stealChance
  202.  * ==> incase both Chances are triggered,remember that broken Equip wont get stolen anyway.
  203.  *
  204.  * <srpgBreak:slot0Equip>
  205.  * <srpgBreak:slot1Equip>
  206.  * <srpgBreak:slot2Equip>
  207.  * <srpgBreak:slot3Equip>
  208.  * <srpgBreak:slot4Equip>
  209.  * <srpgBreak:slot5Equip>
  210.  * <srpgBreak:slot6Equip>
  211.  * <srpgBreak:slot7Equip>
  212.  * <srpgBreak:slot8Equip>
  213.  * <srpgBreak:slot9Equip>
  214.  *
  215.  * <srpgSteal:slot0Equip>
  216.  * <srpgSteal:slot1Equip>
  217.  * <srpgSteal:slot2Equip>
  218.  * <srpgSteal:slot3Equip>
  219.  * <srpgSteal:slot4Equip>
  220.  * <srpgSteal:slot5Equip>
  221.  * <srpgSteal:slot6Equip>
  222.  * <srpgSteal:slot7Equip>
  223.  * <srpgSteal:slot8Equip>
  224.  * <srpgSteal:slot9Equip>
  225.  *
  226.  *------------------
  227.  * Steal Item Skill: (skillnote for Actor Skills)
  228.  *------------------
  229.  *
  230.  *  <actorStealItem>
  231.  *
  232.  * Whatever Items the Enemy ID has on its "dropItems setup" (3slots) can be stolen by actors
  233.  * (these items will be added to the enemys "itemSlot"-storage which has 3 slots aswell)
  234.  *
  235.  * The Chance rate that is Used for such skills is "stealChance"
  236.  *
  237.  * This chance is not related to the dropItem chance from the enemy setup
  238.  *
  239.  * Stolen items are erased from the "itemSlot"-storage, this has no Effect on "dropItem Slot" of that enemyUnit.
  240.  * (enemy can still drop that item if killed in such case)
  241.  * => if we would try to change the "dropItem Slot", this would affect all Enemys with the same enemy ID
  242.  *
  243.  * When actors steal items from enemys, the plugins checks the 3 ItemSlots,
  244.  *  and the first slot which contains an Item will get stolen.The Item will be erased from that ItemSlot.
  245.  * => for example if actors want to steal an item from slot 3, actor must steal items from slot1&2 first..
  246.  *
  247.  *
  248.  * => you can also change the Items in the "itemSlot"storage of each enemyUnit individually with a ScriptCall
  249.  *    (this has no Effect on dropItem Slot of that enemyUnit)
  250.  *----------------------------------------------------------------------------------------------------------
  251.  * "BreakChance" & "StealChance" are by default "50" or whatever you added to the plugin param
  252.  * (if Equip get broken, stealing wont work ,even if stealChance was succesfull)
  253.  *
  254.  * <srpgSkillBreakChance:x>
  255.  * <srpgSkillStealChance:x>
  256.  *
  257.  * "x" is a number betwen 1 and 100. Example => 100 would mean %100 chance => <srpgSkillBreakChance:100>
  258.  * (these scriptcalls are only needed if you want a skill with other chances)
  259.  *
  260.  * Chances can be changed global with Scriptcall for usage with "custom execution" or in the "preActionPhase"
  261.  * The "BreakChance"&"StealChance" will always be reseted to the Plugin param "BreakChance"&"StealChance",
  262.  * ..in the AfterAction_Scene.
  263.  *
  264.  *------------------------------------
  265.  * About gain Exp & gain Gold -Skills:
  266.  *------------------------------------
  267.  *
  268.  * for Skills that add gold or extra exp, you can use an CommonEvent on the Skill.
  269.  * (This can probably also be solved with the battleformula)
  270.  * There you can put a math script or a variable that rolls the succes rate.
  271.  * Default Scripts for gainGold and gainExp are :
  272.  *
  273.  *  $gameParty.gainGold(n);
  274.  *  $gameActors.actor(ActorID).gainExp(exp)
  275.  *
  276.  *
  277.  * (i might implement such Steal Skills with later Plugin updates,but for now i preffer
  278.  * to figure out if this plugins works completly bugfree,before adding such Skills)
  279.  *
  280.  * => if you find any bugs pls let me know!
  281.  *
  282.  *
  283.  *
  284.  * ============================================================================
  285.  * Terms of Use
  286.  * ============================================================================
  287.  * Free for any commercial or non-commercial project!
  288.  * (edits are allowed but pls dont claim it as yours without Credits.thx)
  289.  * ============================================================================
  290.  * Changelog
  291.  * ============================================================================
  292.  * Version 1.0:
  293.  * - first Release 21.11.2021 for SRPG (rpg mv)!
  294.  * - bugfix and Upgrade 26.11.2021
  295.  */
  296.  
  297. (function() {
  298.  
  299.   // Plugin param Variables:
  300.  
  301.   var parameters = PluginManager.parameters("SRPG_EnemyEquip") || $plugins.filter(function (plugin) {
  302.                    return plugin.description.contains('<SRPG_EnemyEquip>'); });
  303.  
  304.   var _drawText = parameters['Controll Draw Text'] || 'true';
  305.  
  306.   var _textNoWeapon = parameters['noWeapon Text'] || _textNoWeapon;
  307.  
  308.   var _textNoShield = parameters['noShield Text'] || _textNoShield;
  309.  
  310.   var _textNoHead = parameters['noHead Text'] || _textNoHead;
  311.  
  312.   var _textNoBody = parameters['noBody Text'] || _textNoBody;
  313.  
  314.   var _textNoAccessory = parameters['noAccessory Text'] || _textNoAccessory;
  315.  
  316.   var _breakChance = Number(parameters['Break Chance'] || 50);
  317.  
  318.   var _stealChance = Number(parameters['Steal Chance'] || 50);
  319.      
  320.   var _enemySlotSize = Number(parameters['Enemy Slot Amount'] || 5);
  321.  
  322.   var _broken = false;
  323.   var _stolen = false;
  324.    
  325. //-----------------------------------------------------------------------------------------
  326.  
  327. //Scene.map.AfterAction:
  328.  
  329.     // add stuff to eventAfterAction_scene
  330.     var _srpgAfterActionScene = Scene_Map.prototype.srpgAfterAction;
  331.     Scene_Map.prototype.srpgAfterAction = function() {
  332.      _srpgAfterActionScene.call(this);
  333.          //reset ActorEquip Setup after Action,its needed incase actorUnit_Equip was stolen..
  334.          //..and actorUnit equips something else during battle.
  335.          $gameTemp.resetActorEquip();
  336.          // reset break&steal-Chance to the Plugin param Setup
  337.      _breakChance = Number(parameters['Break Chance']);
  338.          _stealChance = Number(parameters['Steal Chance']);
  339.     };
  340.  
  341. //Game_interpreter
  342.  
  343.     // this.changeBreakChance(chanceNumber);Game_Interpreter.prototype.changeBreakChance.call(this, chanceNumber);
  344.     Game_Interpreter.prototype.changeBreakChance = function(chanceNumber) {
  345.         _breakChance = Number(chanceNumber);
  346.         return _breakChance;
  347.     };
  348.     // this.changeStealChance(chanceNumber);Game_Interpreter.prototype.changeStealChance.call(this, chanceNumber);
  349.     Game_Interpreter.prototype.changeStealChance = function(chanceNumber) {
  350.         _stealChance = Number(chanceNumber);
  351.         return _stealChance;
  352.     };
  353.  
  354. //Game_Temp: ScripCalls
  355.  
  356.     // scriptcall "$gameTemp.changeEnemyItem(eventID, SlotID, ItemID, typeID);"
  357.     Game_Temp.prototype.changeEnemyItem = function(eventID, SlotID, ItemID, typeID) {
  358.         var battleUnit = $gameSystem.EventToUnit(eventID);
  359.         if ((battleUnit[0] === 'enemy') && (battleUnit[1]._itemSlot)) {
  360.             battleUnit[1]._itemSlot[SlotID]._itemId = ItemID;
  361.             battleUnit[1]._itemSlot[SlotID]._dataClass = typeID;
  362.             if (ItemID === 0)  {
  363.                 battleUnit[1]._equips[SlotID]._dataClass = "";
  364.             }
  365.         }
  366.     return battleUnit[1]._itemSlot[SlotID];
  367.     };
  368.  
  369.     // scriptcall "$gameTemp.changeUnitArmor(eventID, SlotID, ArmorID);"
  370.     Game_Temp.prototype.changeUnitArmor = function(eventID, SlotID, ArmorID) {
  371.         var battleUnit = $gameSystem.EventToUnit(eventID);
  372.         if ((battleUnit[0] === 'enemy') && (battleUnit[1]._equips)) {
  373.             battleUnit[1]._equips[SlotID]._itemId = ArmorID;
  374.             battleUnit[1]._equips[SlotID]._dataClass = "armor";
  375.             battleUnit[1]._equips[SlotID].equipIsGone = false;
  376.             if (ArmorID === 0)  {
  377.             battleUnit[1]._equips[SlotID]._dataClass = "";
  378.             battleUnit[1]._equips[SlotID].equipIsGone = true;
  379.             }
  380.         }
  381.         if ((battleUnit[0] === 'actor') && (battleUnit[1]._equips)) {
  382.             battleUnit[1]._equips[SlotID]._itemId = ArmorID;
  383.             battleUnit[1]._equips[SlotID]._dataClass = "armor";
  384.             battleUnit[1]._equips[SlotID].equipIsGone = false;
  385.             if (ArmorID === 0)  {
  386.             battleUnit[1]._equips[SlotID]._dataClass = "";
  387.             battleUnit[1]._equips[SlotID].equipIsGone = true;
  388.             }
  389.         }      
  390.     return battleUnit[1]._equips[SlotID];
  391.     };
  392.     // scriptcall to change enemy weapon "$gameTemp.changeUnitWeapon(eventID, SlotID, WeaponID);"
  393.     Game_Temp.prototype.changeUnitWeapon = function(eventID, SlotID, WeaponID) {
  394.         var battleUnit = $gameSystem.EventToUnit(eventID);
  395.         if ((battleUnit[0] === 'enemy') && (battleUnit[1]._equips)) {
  396.             battleUnit[1]._equips[SlotID]._itemId = WeaponID;
  397.             battleUnit[1]._equips[SlotID]._dataClass = "weapon";
  398.             battleUnit[1]._equips[SlotID].equipIsGone = false;
  399.             if (WeaponID === 0)  {
  400.             battleUnit[1]._equips[SlotID]._dataClass = "";
  401.             battleUnit[1]._equips[SlotID].equipIsGone = true;
  402.             }
  403.         }
  404.         if ((battleUnit[0] === 'actor') && (battleUnit[1]._equips)) {
  405.             battleUnit[1]._equips[SlotID]._itemId = WeaponID;
  406.             battleUnit[1]._equips[SlotID]._dataClass = "weapon";
  407.             battleUnit[1]._equips[SlotID].equipIsGone = false;
  408.             if (WeaponID === 0)  {
  409.             battleUnit[1]._equips[SlotID]._dataClass = "";
  410.             battleUnit[1]._equips[SlotID].equipIsGone = true;
  411.             }
  412.         }    
  413.     return battleUnit[1]._equips[SlotID];
  414.     };
  415.  
  416.     Game_Temp.prototype.resetActorEquip = function() {
  417.     if ($gameSystem.isSRPGMode() == true) {
  418.             $gameMap.events().forEach(function(event) {
  419.                  if (event.isType() === 'actor') {
  420.                      var actorUnit = $gameSystem.EventToUnit(event.eventId);
  421.                      if (actorUnit) {
  422.                          var equips = actorUnit[1]._equips;
  423.                          var count = equips.length;
  424.                          for (var i = 0; i < count; i++) {
  425.                               if ((actorUnit[1]._equipIsGone[i] === true) && (actorUnit[1]._equips[i]._itemId > 0)) {
  426.                                   actorUnit[1]._equipIsGone[i] = false;
  427.                               }
  428.                          }
  429.                      }
  430.                  }    
  431.            });
  432.         }
  433.     };
  434.  
  435. // Setup for Equipment of Units:
  436. //-------------------------------
  437.    
  438.     var srpgActorIni = Game_Actor.prototype.initialize
  439.     Game_Actor.prototype.initialize = function(actorId) {
  440.         srpgActorIni.call(this, actorId)
  441.         this._equipIsGone = [];
  442.         this._battleUnit = 'actor';  
  443.         var slotSize = this._equips.length;
  444.         var count = slotSize;
  445.         for (var i = 0; i < count; i++) {
  446.              this._equipIsGone[i] = false;      
  447.         }  
  448.     };
  449.  
  450.     var srpgEnemyIni = Game_Enemy.prototype.initialize
  451.     Game_Enemy.prototype.initialize = function(enemyId, x, y) {
  452.         srpgEnemyIni.call(this, enemyId, x, y)
  453.         this.setEquipSlots();
  454.         this._battleUnit = 'enemy';
  455.         this._itemSlot = [new Game_Item(), new Game_Item(), new Game_Item()];
  456.         this.enemyItemStorage();
  457.     };
  458.  
  459.     Game_Enemy.prototype.enemyItemStorage = function() {
  460.         var count = 3;
  461.         for (var i = 0; i < count; i++) {
  462.              var itemType = this.enemy().dropItems[i].kind;
  463.              var itemID =  this.enemy().dropItems[i].dataId;
  464.          if (itemType === 1) {var dataType = $dataItems[itemID]};
  465.          if (itemType === 2) {var dataType = $dataWeapons[itemID]};
  466.          if (itemType === 3) {var dataType = $dataArmors[itemID]};
  467.              if (itemID > 0) {this._itemSlot[i].setObject(dataType)};  
  468.         }
  469.     return this._itemSlot;
  470.     };
  471.  
  472.     // add EquipSlots to Game_Enemy
  473.     Game_Enemy.prototype.setEquipSlots = function() {
  474.         this._equips = [];
  475.         this._equipIsGone = [];
  476.         var slotSize = _enemySlotSize;
  477.         if (this.enemy().meta.enemySlotSize) {slotSize = this.enemy().meta.enemySlotSize};
  478.         var count = slotSize;
  479.         for (var i = 0; i < count; i++) {
  480.              this._equips[i] = new Game_Item();
  481.              this._equipIsGone[i] = false;      
  482.         }
  483.  
  484.     };
  485.     // add Equip if enemyNote fits & enemy is not already equiped
  486.     Game_Enemy.prototype.equips = function() {
  487.         if (this._equips) {
  488.             var enemy = this.enemy()
  489.             if ((enemy.note.indexOf("srpgSlot0EquipID") > 0) && (this._equips[0]._itemId === 0) && (this._equipIsGone[0] === false)) {    
  490.         var slotType = enemy.meta.srpgSlot0Type;
  491.                 if (slotType === "weapon") {this._equips[0].setObject($dataWeapons[Number(enemy.meta.srpgSlot0EquipID)])}
  492.             if (slotType === "armor") {this._equips[0].setObject($dataArmors[Number(enemy.meta.srpgSlot0EquipID)])}
  493.             }  
  494.             if ((enemy.note.indexOf("srpgSlot1EquipID") > 0) && (this._equips[1]._itemId === 0) && (this._equipIsGone[1] === false)) {    
  495.         var slotType = enemy.meta.srpgSlot1Type;
  496.                 if (slotType === "weapon") {this._equips[1].setObject($dataWeapons[Number(enemy.meta.srpgSlot1EquipID)])}
  497.             if (slotType === "armor") {this._equips[1].setObject($dataArmors[Number(enemy.meta.srpgSlot1EquipID)])}
  498.             }  
  499.             if ((enemy.note.indexOf("srpgSlot2EquipID") > 0) && (this._equips[2]._itemId === 0) && (this._equipIsGone[2] === false)) {    
  500.         var slotType = enemy.meta.srpgSlot2Type;
  501.                 if (slotType === "weapon") {this._equips[2].setObject($dataWeapons[Number(enemy.meta.srpgSlot2EquipID)])}
  502.             if (slotType === "armor") {this._equips[2].setObject($dataArmors[Number(enemy.meta.srpgSlot2EquipID)])}
  503.             }  
  504.             if ((enemy.note.indexOf("srpgSlot3EquipID") > 0) && (this._equips[3]._itemId === 0) && (this._equipIsGone[3] === false)) {    
  505.         var slotType = enemy.meta.srpgSlot3Type;
  506.                 if (slotType === "weapon") {this._equips[3].setObject($dataWeapons[Number(enemy.meta.srpgSlot3EquipID)])}
  507.             if (slotType === "armor") {this._equips[3].setObject($dataArmors[Number(enemy.meta.srpgSlot3EquipID)])}
  508.             }  
  509.             if ((enemy.note.indexOf("srpgSlot4EquipID") > 0) && (this._equips[4]._itemId === 0) && (this._equipIsGone[4] === false)) {    
  510.         var slotType = enemy.meta.srpgSlot4Type;
  511.                 if (slotType === "weapon") {this._equips[4].setObject($dataWeapons[Number(enemy.meta.srpgSlot4EquipID)])}
  512.             if (slotType === "armor") {this._equips[4].setObject($dataArmors[Number(enemy.meta.srpgSlot4EquipID)])}
  513.             }  
  514.             if ((enemy.note.indexOf("srpgSlot5EquipID") > 0) && (this._equips[5]._itemId === 0) && (this._equipIsGone[5] === false)) {    
  515.         var slotType = enemy.meta.srpgSlot5Type;
  516.                 if (slotType === "weapon") {this._equips[5].setObject($dataWeapons[Number(enemy.meta.srpgSlot5EquipID)])}
  517.             if (slotType === "armor") {this._equips[5].setObject($dataArmors[Number(enemy.meta.srpgSlot5EquipID)])}
  518.             }  
  519.             if ((enemy.note.indexOf("srpgSlot6EquipID") > 0) && (this._equips[6]._itemId === 0) && (this._equipIsGone[6] === false)) {    
  520.         var slotType = enemy.meta.srpgSlot6Type;
  521.                 if (slotType === "weapon") {this._equips[6].setObject($dataWeapons[Number(enemy.meta.srpgSlot6EquipID)])}
  522.             if (slotType === "armor") {this._equips[6].setObject($dataArmors[Number(enemy.meta.srpgSlot6EquipID)])}
  523.             }  
  524.             if ((enemy.note.indexOf("srpgSlot7EquipID") > 0) && (this._equips[7]._itemId === 0) && (this._equipIsGone[7] === false)) {    
  525.         var slotType = enemy.meta.srpgSlot7Type;
  526.                 if (slotType === "weapon") {this._equips[7].setObject($dataWeapons[Number(enemy.meta.srpgSlot7EquipID)])}
  527.             if (slotType === "armor") {this._equips[7].setObject($dataArmors[Number(enemy.meta.srpgSlot7EquipID)])}
  528.             }  
  529.             if ((enemy.note.indexOf("srpgSlot8EquipID") > 0) && (this._equips[8]._itemId === 0) && (this._equipIsGone[8] === false)) {    
  530.         var slotType = enemy.meta.srpgSlot8Type;
  531.                 if (slotType === "weapon") {this._equips[8].setObject($dataWeapons[Number(enemy.meta.srpgSlot8EquipID)])}
  532.             if (slotType === "armor") {this._equips[8].setObject($dataArmors[Number(enemy.meta.srpgSlot8EquipID)])}
  533.             }  
  534.             if ((enemy.note.indexOf("srpgSlot9EquipID") > 0) && (this._equips[9]._itemId === 0) && (this._equipIsGone[9] === false)) {    
  535.         var slotType = enemy.meta.srpgSlot9Type;
  536.                 if (slotType === "weapon") {this._equips[9].setObject($dataWeapons[Number(enemy.meta.srpgSlot9EquipID)])}
  537.             if (slotType === "armor") {this._equips[9].setObject($dataArmors[Number(enemy.meta.srpgSlot9EquipID)])}
  538.             }
  539.         } if (this._equips) {return this._equips} else {return 0};
  540.     };
  541.     // Reflect the characteristics of the Enemy_equipment  (add trairs ect)
  542.     var _SRPG_Game_Enemy_traitObjects = Game_Enemy.prototype.traitObjects;
  543.     Game_Enemy.prototype.traitObjects = function() {
  544.         var objects = _SRPG_Game_Enemy_traitObjects.call(this);
  545.         if ($gameSystem.isSRPGMode() == true) {
  546.             var equips = this.equips();
  547.             for (var i = 0; i < equips.length; i++) {
  548.                  var equipSlot = equips[i];
  549.                  if (equipSlot && (equipSlot._itemId !== 0)) {
  550.                      if (equipSlot._dataClass === "weapon") {
  551.                          item = $dataWeapons[equipSlot._itemId];
  552.                          objects.push(item);
  553.                      }
  554.                      if (equipSlot._dataClass === "armor") {
  555.                          item = $dataArmors[equipSlot._itemId];
  556.                          objects.push(item);
  557.                      }
  558.                  };
  559.             };
  560.         };
  561.     return objects;
  562.     };
  563.     // Reflects the ability change value of the Enemy_equipment (add item stats)
  564.     Game_Enemy.prototype.paramPlus = function(paramId) {
  565.         var value = Game_Battler.prototype.paramPlus.call(this, paramId);
  566.         if ($gameSystem.isSRPGMode() == true) {
  567.             var equips = this.equips();
  568.             for (var i = 0; i < equips.length; i++) {
  569.                  var equipSlot = equips[i];
  570.                  if (equipSlot && (equipSlot._itemId !== 0)) {
  571.                      if (equipSlot._dataClass === "weapon") {
  572.                          item = $dataWeapons[equipSlot._itemId];
  573.                          value += item.params[paramId];
  574.                      }
  575.                      if (equipSlot._dataClass === "armor") {
  576.                          item = $dataArmors[equipSlot._itemId];
  577.                          value += item.params[paramId];
  578.                      }
  579.                  };
  580.             };
  581.         };
  582.     return value;
  583.     };
  584.  
  585. //Window Setup
  586. //-----------------------------------------
  587.  
  588. //enemys
  589. //--------
  590.  
  591.     // drawn contents Enemy Status window
  592.     Window_SrpgStatus.prototype.drawContentsEnemy = function() {  
  593.         var lineHeight = this.lineHeight();
  594.         this.drawActorName(this._battler, 12, lineHeight * 0);
  595.         this.drawEnemyClass(this._battler, 12, lineHeight * 5);
  596.         this.drawEnemyFace(this._battler, 4, lineHeight * 1);
  597.         this.drawBasicInfoEnemy(4, lineHeight * 6);
  598.         this.drawParameters(156, lineHeight * 1);
  599.         this.drawSrpgParameters(156, lineHeight * 4);
  600.         var equips = this._battler._equips;
  601.         // only 5 slots are used by default
  602.         // slot 0 check if weapon or shield assume weapon
  603.         if (equips[0] && equips[0]._itemId === 0) {
  604.             if (this._battler.enemy().meta.srpgSlot0Type === "armor") {
  605.                 if (_drawText === 'true') {this.drawText(_textNoShield, 250, lineHeight * 5)};
  606.             } else {
  607.                 if (_drawText === 'true') {this.drawText(_textNoWeapon, 250, lineHeight * 5)};
  608.             }          
  609.         } else if (equips[0]) {//if slot has equip, check type & display equip
  610.                 var slotType = this._battler.enemy().meta.srpgSlot0Type;
  611.             if (slotType === "weapon") {var equip = $dataWeapons[equips[0]._itemId]};
  612.             if (slotType === "armor") {var equip = $dataArmors[equips[0]._itemId]};
  613.                 this.drawItemName(equip, 200, lineHeight * 5 );
  614.         };
  615.         //slot 1 check if weapon or shield,assume shield
  616.         if (equips[1] && equips[1]._itemId === 0) {
  617.             if (this._battler.enemy().meta.srpgSlot1Type === "weapon") {
  618.                 if (_drawText === 'true') {this.drawText(_textNoWeapon, 250, lineHeight * 6)};
  619.             } else {
  620.                 if (_drawText === 'true') {this.drawText(_textNoShield, 250, lineHeight * 6)};  
  621.             }          
  622.         } else if (equips[1]) {//if slot has equip, check type & display equip
  623.                 var slotType = this._battler.enemy().meta.srpgSlot1Type;
  624.             if (slotType === "weapon") {var equip = $dataWeapons[equips[1]._itemId]};
  625.             if (slotType === "armor") {var equip = $dataArmors[equips[1]._itemId]};
  626.                 this.drawItemName(equip, 200, lineHeight * 6 );
  627.         };
  628.         //slot 2 assume Head
  629.         if (equips[2] && equips[2]._itemId === 0) {
  630.             if (_drawText === 'true') {this.drawText(_textNoHead, 250, lineHeight * 7)};
  631.         } else if (equips[2]) {//if slot has equip, check type & display equip
  632.                 var slotType = this._battler.enemy().meta.srpgSlot2Type;
  633.             if (slotType === "weapon") {var equip = $dataWeapons[equips[2]._itemId]};
  634.             if (slotType === "armor") {var equip = $dataArmors[equips[2]._itemId]};
  635.                 this.drawItemName(equip, 200, lineHeight * 7 );
  636.         };  
  637.         //slot 3 assume Body
  638.         if (equips[3] && equips[3]._itemId === 0) {
  639.             if (_drawText === 'true') {this.drawText(_textNoBody, 250, lineHeight * 8)};
  640.         } else if (equips[3]) {//if slot has equip, check type & display equip
  641.                 var slotType = this._battler.enemy().meta.srpgSlot3Type;
  642.             if (slotType === "weapon") {var equip = $dataWeapons[equips[3]._itemId]};
  643.             if (slotType === "armor") {var equip = $dataArmors[equips[3]._itemId]};
  644.                 this.drawItemName(equip, 200, lineHeight * 8 );
  645.         };
  646.         //slot 4 assume Accessory
  647.         if (equips[4] && equips[4]._itemId === 0) {
  648.             if (_drawText === 'true') {this.drawText(_textNoAccessory, 250, lineHeight * 9)};
  649.         } else if (equips[4]) {//if slot has equip, check type & display equip
  650.                 var slotType = this._battler.enemy().meta.srpgSlot4Type;
  651.             if (slotType === "weapon") {var equip = $dataWeapons[equips[4]._itemId]};
  652.             if (slotType === "armor") {var equip = $dataArmors[equips[4]._itemId]};
  653.                 this.drawItemName(equip, 200, lineHeight * 9 );
  654.         };
  655.     };
  656.     // related to the function above "this.drawBasicInfoEnemy"
  657.     Window_SrpgStatus.prototype.drawBasicInfoEnemy = function(x, y) {
  658.         var lineHeight = this.lineHeight();
  659.         this.drawEnemyLevel(this._battler, x, y + lineHeight * 1);
  660.         this.drawActorIcons(this._battler, x, y + lineHeight * 0);
  661.         this.drawActorHp(this._battler, x, y + lineHeight * 2);
  662.         if ($dataSystem.optDisplayTp) {
  663.             this.drawActorMp(this._battler, x, y + lineHeight * 3, 90);
  664.             this.drawActorTp(this._battler, x + 96, y + lineHeight * 3, 90);
  665.         } else {
  666.            this.drawActorMp(this._battler, x, y + lineHeight * 3);
  667.         }
  668.     };
  669.     // Status Window Width
  670.     Window_SrpgStatus.prototype.windowWidth = function() {
  671.         return 550;
  672.     };
  673.     // Status Window Height (amount of lines starts from the top with 0)
  674.     Window_SrpgStatus.prototype.windowHeight = function() {
  675.         return this.fittingHeight(10);
  676.     };
  677.  
  678. // actors:
  679. //--------
  680.  
  681.     // draw Actor Content
  682.     Window_SrpgStatus.prototype.drawContentsActor = function() {    
  683.         var lineHeight = this.lineHeight();
  684.         this.drawActorName(this._battler, 12, lineHeight * 0);
  685.         this.drawActorClass(this._battler, 12, lineHeight * 5);
  686.         this.drawActorFace(this._battler, 4, lineHeight * 1);
  687.         this.drawBasicInfoActor(4, lineHeight * 6);
  688.         this.drawParameters(156, lineHeight * 1);
  689.         this.drawSrpgParameters(156, lineHeight * 4);
  690.         var equips = this._battler._equips;
  691.         // only 5 slots are used by default
  692.         // slot 0 check if weapon or shield assume weapon
  693.         if (equips[0] && equips[0]._itemId === 0) {
  694.             if (equips[0]._dataClass === "armor") {
  695.                 if (_drawText === 'true') {this.drawText(_textNoShield, 250, lineHeight * 5)};
  696.             } else {
  697.                 if (_drawText === 'true') {this.drawText(_textNoWeapon, 250, lineHeight * 5)};
  698.             }          
  699.         } else if (equips[0]) {//if slot has equip, check type & display equip
  700.                 var slotType = equips[0]._dataClass;
  701.             if (slotType === "weapon") {var equip = $dataWeapons[equips[0]._itemId]};
  702.             if (slotType === "armor") {var equip = $dataArmors[equips[0]._itemId]};
  703.                 this.drawItemName(equip, 200, lineHeight * 5 );
  704.         };
  705.         //slot 1 check if weapon or shield,assume shield
  706.         if (equips[1] && equips[1]._itemId === 0) {
  707.             if (equips[1]._dataClass === "weapon") {
  708.                 if (_drawText === 'true') {this.drawText(_textNoWeapon, 250, lineHeight * 6)};
  709.             } else {
  710.                 if (_drawText === 'true') {this.drawText(_textNoShield, 250, lineHeight * 6)};  
  711.             }          
  712.         } else if (equips[1]) {//if slot has equip, check type & display equip
  713.                 var slotType = equips[1]._dataClass;
  714.             if (slotType === "weapon") {var equip = $dataWeapons[equips[1]._itemId]};
  715.             if (slotType === "armor") {var equip = $dataArmors[equips[1]._itemId]};
  716.                 this.drawItemName(equip, 200, lineHeight * 6 );
  717.         };
  718.         //slot 2 assume Head
  719.         if (equips[2] && equips[2]._itemId === 0) {
  720.             if (_drawText === 'true') {this.drawText(_textNoHead, 250, lineHeight * 7)};
  721.         } else if (equips[2]) {//if slot has equip, check type & display equip
  722.                 var slotType = equips[2]._dataClass;
  723.             if (slotType === "weapon") {var equip = $dataWeapons[equips[2]._itemId]};
  724.             if (slotType === "armor") {var equip = $dataArmors[equips[2]._itemId]};
  725.                 this.drawItemName(equip, 200, lineHeight * 7 );
  726.         };  
  727.         //slot 3 assume Body
  728.         if (equips[3] && equips[3]._itemId === 0) {
  729.             if (_drawText === 'true') {this.drawText(_textNoBody, 250, lineHeight * 8)};
  730.         } else if (equips[3]) {//if slot has equip, check type & display equip
  731.                 var slotType = equips[3]._dataClass;
  732.             if (slotType === "weapon") {var equip = $dataWeapons[equips[3]._itemId]};
  733.             if (slotType === "armor") {var equip = $dataArmors[equips[3]._itemId]};
  734.                 this.drawItemName(equip, 200, lineHeight * 8 );
  735.         };
  736.         //slot 4 assume Accessory
  737.         if (equips[4] && equips[4]._itemId === 0) {
  738.             if (_drawText === 'true') {this.drawText(_textNoAccessory, 250, lineHeight * 9)};
  739.         } else if (equips[4]) {//if slot has equip, check type & display equip
  740.                 var slotType = equips[4]._dataClass;
  741.             if (slotType === "weapon") {var equip = $dataWeapons[equips[4]._itemId]};
  742.             if (slotType === "armor") {var equip = $dataArmors[equips[4]._itemId]};
  743.                 this.drawItemName(equip, 200, lineHeight * 9 );
  744.         };
  745.     };
  746.     // this is related to "this.drawBasicInfoActor" from above
  747.     Window_SrpgStatus.prototype.drawBasicInfoActor = function(x, y) {
  748.         var lineHeight = this.lineHeight();
  749.         this.drawSrpgExpRate(this._battler, x, y + lineHeight * 1);
  750.         this.drawActorLevel(this._battler, x, y + lineHeight * 1);
  751.         this.drawActorIcons(this._battler, x, y + lineHeight * 0);
  752.         this.drawActorHp(this._battler, x, y + lineHeight * 2);
  753.         if ($dataSystem.optDisplayTp) {
  754.             this.drawActorMp(this._battler, x, y + lineHeight * 3, 90);
  755.             this.drawActorTp(this._battler, x + 96, y + lineHeight * 3, 90);
  756.         } else {
  757.             this.drawActorMp(this._battler, x, y + lineHeight * 3);
  758.         }
  759.     };
  760.  
  761.  
  762.  
  763. // Setup for Skills:
  764. //-----------------------
  765.  
  766.     //this.nothingToSteal();
  767.     Game_Action.prototype.nothingToSteal = function() {
  768.         $gameMessage.setBackground(1);$gameMessage.setPositionType(2);
  769.         $gameMessage.add("There is Nothing to Steal \\|\\^");
  770.     };
  771.     //this.srpgFailedText();
  772.     Game_Action.prototype.srpgFailedText = function() {
  773.         $gameMessage.setBackground(1);$gameMessage.setPositionType(2);
  774.         $gameMessage.add("Failed \\|\\^");
  775.     };
  776.     //this.stealResult(itemName, msgIconID, eName);
  777.     Game_Action.prototype.stealResult = function(itemName, msgIconID, eName) {
  778.         $gameMessage.setBackground(1);$gameMessage.setPositionType(2);
  779.         $gameMessage.add(eName + "'s \\i["+ msgIconID +"]"+ itemName +" stolen!\\|\\^");
  780.     };
  781.     //this.breakResult(itemName, msgIconID, eName);
  782.     Game_Action.prototype.breakResult = function(itemName, msgIconID, eName) {
  783.         $gameMessage.setBackground(1);$gameMessage.setPositionType(2);
  784.         $gameMessage.add(eName + "'s \\i["+ msgIconID +"]"+ itemName +" broken!\\|\\^");
  785.     };
  786.  
  787.     Game_Action.prototype.setUserEventId = function() {
  788.         this._userEventID = $gameTemp.activeEvent().eventId();
  789.         return this._userEventID;
  790.     };
  791.  
  792.     Game_Action.prototype.setTargetEventId = function() {
  793.         this._targetEventID = $gameTemp.targetEvent().eventId();
  794.         return this._targetEventID;
  795.     }; 
  796.     // check used SkillAction_itemObeject for meta"srpgSteal"
  797.     var SRPG_Game_Action_apply = Game_Action.prototype.apply;
  798.     Game_Action.prototype.apply = function(target) {
  799.         SRPG_Game_Action_apply.call(this, target);
  800.             // add stuff to Game action if Break/Steal Meta & Hit
  801.              var result = target.result();
  802.              this._userEventID = 0;
  803.              this._targetEventID = 0;
  804.              this.setUserEventId();
  805.              this.setTargetEventId();
  806.              if ((this.item().meta.srpgSteal && result.isHit()) ||
  807.                  (this.item().meta.srpgBreak && result.isHit())) {
  808.              this.checkBreakSteal();
  809.              }
  810.              if (this.item().meta.actorStealItem && result.isHit()) {
  811.                  this.actorStealItem();
  812.              }
  813.     };
  814.  
  815.     Game_Action.prototype.checkBreakSteal = function() {
  816.     _broken = false;
  817.     _stolen = false;
  818.     if (this.item().meta.srpgSkillBreakChance) {
  819.         _breakChance = this.item().meta.srpgSkillBreakChance;
  820.     }
  821.     if (this.item().meta.srpgSkillStealChance) {
  822.         _stealChance = this.item().meta.srpgSkillStealChance;
  823.     }    
  824.     if (this.item().meta.srpgBreak) {
  825.             // breakChanceRoll var that represents the chance you rolled.
  826.             var breakChanceRoll = Math.floor(Math.random() * 100) + 1;
  827.             //_breakChance is the PluginVar that stores % chance
  828.             if (breakChanceRoll <= _breakChance) {           
  829.                 _broken = true;
  830.             };  
  831.         }
  832.     if (this.item().meta.srpgSteal) {
  833.             // stealChanceRoll var that represents the chance you rolled.
  834.             var stealChanceRoll = Math.floor(Math.random() * 100) + 1;
  835.             //_stealChance is the PluginVar that stores % chance
  836.             if (stealChanceRoll <= _stealChance) {           
  837.                 _stolen = true;
  838.             };  
  839.         }
  840.         if (_broken === true)  {
  841.         this.srpgBreaking();
  842.     }
  843.         if ((_broken === false) && (_stolen === true))  {
  844.         this.srpgStealing();
  845.     }
  846.         if ((_broken === false) && (_stolen === false))  {
  847.             this.srpgFailedText();
  848.     }      
  849.     };
  850.  
  851.     Game_Action.prototype.actorStealItem = function() {
  852.         var activeBattleUnit = $gameSystem.EventToUnit(this._userEventID);
  853.         var targetBattleUnit = $gameSystem.EventToUnit(this._targetEventID);
  854.         if (activeBattleUnit[0] === 'actor' && targetBattleUnit[0] === 'enemy' ) {
  855.             var itemStolen = false;
  856.         if (this.item().meta.srpgSkillStealChance) {
  857.             _stealChance = this.item().meta.srpgSkillStealChance;
  858.         }
  859.             // stealChanceRoll var that represents the chance you rolled.
  860.             var stealChanceRoll = Math.floor(Math.random() * 100) + 1;
  861.             //_stealChance is the PluginVar that stores % chance
  862.             if (stealChanceRoll <= _stealChance) {           
  863.                 itemStolen = true;
  864.             }
  865.     }
  866.         if (itemStolen === true) {
  867.             var doneStealing = false;
  868.             var stolenItemType = 0;
  869.             var stolenItem = 0;
  870.             if (targetBattleUnit[1]._itemSlot[0]._itemdId !== 0) {
  871.                 stolenItemType = targetBattleUnit[1]._itemSlot[0]._dataClass;
  872.                 stolenItem = targetBattleUnit[1]._itemSlot[0]._itemId;
  873.                 targetBattleUnit[1]._itemSlot[0]._dataClass = "";
  874.                 targetBattleUnit[1]._itemSlot[0]._itemId = 0;
  875.                 doneStealing = true;
  876.         }
  877.             if (doneStealing === false && targetBattleUnit[1]._itemSlot[1]._itemdId !== 0) {
  878.                 stolenItemType = targetBattleUnit[1]._itemSlot[1]._dataClass;
  879.                 stolenItem = targetBattleUnit[1]._itemSlot[1]._itemId;
  880.                 targetBattleUnit[1]._itemSlot[1]._dataClass = "";
  881.                 targetBattleUnit[1]._itemSlot[1]._itemId = 0;
  882.                 doneStealing = true;
  883.         }
  884.             if (doneStealing === false && targetBattleUnit[1]._itemSlot[2]._itemdId !== 0) {
  885.                 stolenItemType = targetBattleUnit[1]._itemSlot[2]._dataClass;
  886.                 stolenItem = targetBattleUnit[1]._itemSlot[2]._itemId;
  887.                 targetBattleUnit[1]._itemSlot[2]._dataClass = "";
  888.                 targetBattleUnit[1]._itemSlot[2]._itemId = 0;
  889.                 doneStealing = true;
  890.         }
  891.             if (doneStealing === false)  {this.nothingToSteal()};
  892.             if (doneStealing === true && stolenItem > 0)  {
  893.             if (stolenItemType === "item") {var dataType = $dataItems[stolenItem]};
  894.             if (stolenItemType === "weapon") {var dataType = $dataWeapons[stolenItem]};
  895.             if (stolenItemType === "armor") {var dataType = $dataArmors[stolenItem]};
  896.                 var itemName = dataType.name;
  897.                 var msgIconID = dataType.iconIndex;
  898.                 var eName = targetBattleUnit[1].name();
  899.                 $gameParty.gainItem(dataType, 1);
  900.                 this.stealResult(itemName, msgIconID, eName);
  901.             }
  902.     }
  903.         if (itemStolen === false) {this.srpgFailedText()}; 
  904.     };
  905.     //srpgBreaking Setup
  906.     Game_Action.prototype.srpgBreaking = function() {
  907.     if ($gameSystem.isSRPGMode() == true) {
  908.             //get Unit data:
  909.         var anythingToBreak = false;   
  910.             var activeEventID = this._userEventID;
  911.             var targetEventID = this._targetEventID;
  912.             var activeBattleUnit = $gameSystem.EventToUnit(activeEventID);
  913.             var targetBattleUnit = $gameSystem.EventToUnit(targetEventID);
  914.             var slotID = 0;
  915.             if ((this.item().meta.srpgBreak === "slot0Equip") && (targetBattleUnit[1]._equips[0]._itemId > 0)) {
  916.                 this.srpgBreakingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToBreak = true;
  917.         }; 
  918.             if ((this.item().meta.srpgBreak === "slot1Equip") && (targetBattleUnit[1]._equips[1]._itemId > 0)) {
  919.                 slotID = 1;this.srpgBreakingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToBreak = true;
  920.         }; 
  921.             if ((this.item().meta.srpgBreak === "slot2Equip") && (targetBattleUnit[1]._equips[2]._itemId > 0)) {
  922.                 slotID = 2;this.srpgBreakingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToBreak = true;
  923.         };
  924.             if ((this.item().meta.srpgBreak === "slot3Equip") && (targetBattleUnit[1]._equips[3]._itemId > 0)) {
  925.                 slotID = 3;this.srpgBreakingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToBreak = true;
  926.         }; 
  927.             if ((this.item().meta.srpgBreak === "slot4Equip") && (targetBattleUnit[1]._equips[4]._itemId > 0)) {
  928.                 slotID = 4;this.srpgBreakingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToBreak = true;
  929.         };
  930.             if ((this.item().meta.srpgBreak === "slot5Equip") && (targetBattleUnit[1]._equips[5]._itemId > 0)) {
  931.                 slotID = 5;this.srpgBreakingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToBreak = true;
  932.         }; 
  933.             if ((this.item().meta.srpgBreak === "slot6Equip") && (targetBattleUnit[1]._equips[6]._itemId > 0)) {
  934.                 slotID = 6;this.srpgBreakingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToBreak = true;
  935.         }; 
  936.             if ((this.item().meta.srpgBreak === "slot7Equip") && (targetBattleUnit[1]._equips[7]._itemId > 0)) {
  937.                 slotID = 7;this.srpgBreakingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToBreak = true;
  938.         };
  939.             if ((this.item().meta.srpgBreak === "slot8Equip") && (targetBattleUnit[1]._equips[8]._itemId > 0)) {
  940.                 slotID = 8;this.srpgBreakingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToBreak = true;
  941.         }; 
  942.             if ((this.item().meta.srpgBreak === "slot9Equip") && (targetBattleUnit[1]._equips[9]._itemId > 0)) {
  943.                 slotID = 9;this.srpgBreakingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToBreak = true;
  944.         };
  945.         if (anythingToBreak === false) {this.nothingToBreak()};
  946.     };  
  947.     }; 
  948.  
  949.     Game_Action.prototype.srpgBreakingSlot = function(activeBattleUnit, targetBattleUnit, slotID) {
  950.     var stolenEquipId = targetBattleUnit[1]._equips[slotID]._itemId;
  951.     if (targetBattleUnit[1]._equips[slotID]._dataClass === "weapon") {
  952.         var itemName =  $dataWeapons[stolenEquipId].name;
  953.             var msgIconID = $dataWeapons[stolenEquipId].iconIndex;
  954.     }  
  955.     if (targetBattleUnit[1]._equips[slotID]._dataClass === "armor") {
  956.         var itemName =  $dataArmors[stolenEquipId].name;
  957.             var msgIconID = $dataArmors[stolenEquipId].iconIndex;      
  958.     }  
  959.         targetBattleUnit[1]._equipIsGone[slotID] = true;
  960.         targetBattleUnit[1]._equips[slotID] = new Game_Item();
  961.         // get data for breakResult
  962.         var eName = targetBattleUnit[1].name();
  963.         this.breakResult(itemName, msgIconID, eName);  
  964.     };
  965.     //srpgStealing Setup
  966.     Game_Action.prototype.srpgStealing = function() {
  967.     if ($gameSystem.isSRPGMode() == true) {
  968.             //get Unit data:
  969.         var anythingToSteal = false;   
  970.             var activeEventID = this._userEventID;
  971.             var targetEventID = this._targetEventID;
  972.             var activeBattleUnit = $gameSystem.EventToUnit(activeEventID);
  973.             var targetBattleUnit = $gameSystem.EventToUnit(targetEventID);
  974.             var slotID = 0;
  975.             if ((this.item().meta.srpgSteal === "slot0Equip") && (targetBattleUnit[1]._equips[0]._itemId > 0)) {
  976.                 this.srpgStealingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToSteal = true;
  977.         }; 
  978.             if ((this.item().meta.srpgSteal === "slot1Equip") && (targetBattleUnit[1]._equips[1]._itemId > 0)) {
  979.                 slotID = 1;this.srpgStealingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToSteal = true;
  980.         }; 
  981.             if ((this.item().meta.srpgSteal === "slot2Equip") && (targetBattleUnit[1]._equips[2]._itemId > 0)) {
  982.                 slotID = 2;this.srpgStealingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToSteal = true;
  983.         };
  984.             if ((this.item().meta.srpgSteal === "slot3Equip") && (targetBattleUnit[1]._equips[3]._itemId > 0)) {
  985.                 slotID = 3;this.srpgStealingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToSteal = true;
  986.         }; 
  987.             if ((this.item().meta.srpgSteal === "slot4Equip") && (targetBattleUnit[1]._equips[4]._itemId > 0)) {
  988.                 slotID = 4;this.srpgStealingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToSteal = true;
  989.         };
  990.             if ((this.item().meta.srpgSteal === "slot5Equip") && (targetBattleUnit[1]._equips[5]._itemId > 0)) {
  991.                 slotID = 5;this.srpgStealingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToSteal = true;
  992.         }; 
  993.             if ((this.item().meta.srpgSteal === "slot6Equip") && (targetBattleUnit[1]._equips[6]._itemId > 0)) {
  994.                 slotID = 6;this.srpgStealingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToSteal = true;
  995.         }; 
  996.             if ((this.item().meta.srpgSteal === "slot7Equip") && (targetBattleUnit[1]._equips[7]._itemId > 0)) {
  997.                 slotID = 7;this.srpgStealingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToSteal = true;
  998.         };
  999.             if ((this.item().meta.srpgSteal === "slot8Equip") && (targetBattleUnit[1]._equips[8]._itemId > 0)) {
  1000.                 slotID = 8;this.srpgStealingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToSteal = true;
  1001.         }; 
  1002.             if ((this.item().meta.srpgSteal === "slot9Equip") && (targetBattleUnit[1]._equips[9]._itemId > 0)) {
  1003.                 slotID = 9;this.srpgStealingSlot(activeBattleUnit, targetBattleUnit, slotID);anythingToSteal = true;
  1004.         };
  1005.         if (anythingToSteal === false) {this.nothingToSteal()};
  1006.         };
  1007.     };
  1008.  
  1009.     Game_Action.prototype.srpgStealingSlot = function(activeBattleUnit, targetBattleUnit, slotID) {
  1010.     var stolenEquipId = targetBattleUnit[1]._equips[slotID]._itemId;
  1011.     if (targetBattleUnit[1]._equips[slotID]._dataClass === "weapon") {
  1012.         var itemName =  $dataWeapons[stolenEquipId].name;
  1013.             var msgIconID = $dataWeapons[stolenEquipId].iconIndex;
  1014.         if ((targetBattleUnit[0] === "enemy") ||
  1015.         ((targetBattleUnit[1].srpgTeam()) && (targetBattleUnit[1].srpgTeam() !== "actor"))) {
  1016.         $gameParty.gainItem($dataWeapons[stolenEquipId], 1);
  1017.         }      
  1018.     }  
  1019.     if (targetBattleUnit[1]._equips[slotID]._dataClass === "armor") {
  1020.         var itemName =  $dataArmors[stolenEquipId].name;
  1021.             var msgIconID = $dataArmors[stolenEquipId].iconIndex;
  1022.         if ((targetBattleUnit[0] === "enemy") ||
  1023.         ((targetBattleUnit[1].srpgTeam()) && (targetBattleUnit[1].srpgTeam() !== "actor"))) {
  1024.         $gameParty.gainItem($dataArmors[stolenEquipId], 1);
  1025.         }  
  1026.     }  
  1027.         targetBattleUnit[1]._equipIsGone[slotID] = true;
  1028.         targetBattleUnit[1]._equips[slotID] = new Game_Item();
  1029.         var eName = targetBattleUnit[1].name();
  1030.         this.stealResult(itemName, msgIconID, eName);  
  1031.     };
  1032.  
  1033. //-----------------------------------------------------------------------------------------
  1034. //
  1035.                  
  1036. //--End:
  1037.  
  1038. })();
Add Comment
Please, Sign In to add comment