var weaponShift = {1:3, 2:4}; var armorShift = {1:3, 2:4}; var actors = $gameParty.allMembers(); for (var i=0;i<actors.length;i++){ for (var j=0;j<actors[i]._equips.length;j++){ var item = actors[i]._equips[j]; if (item._dataClass ==="weapon" && weaponShift[item._itemId]){item._itemId = weaponShift[item._itemId];} if (item._dataClass ==="armor" && armorShift[item._itemId]){item._itemId = armorShift[item._itemId];} } }
var weaponShift = {1:3, 2:4};
var armorShift = {1:3, 2:4};
var actors = $gameParty.allMembers();
for (var i=0;i<actors.length;i++){
for (var j=0;j<actors[i]._equips.length;j++){
var item = actors[i]._equips[j];
if (item._dataClass ==="weapon" && weaponShift[item._itemId]){item._itemId = weaponShift[item._itemId];}
if (item._dataClass ==="armor" && armorShift[item._itemId]){item._itemId = armorShift[item._itemId];}
}
}
前两行自己改一下,weaponShift = {1:3, 2:4}代表ID为1的武器替换为ID为3的,armorShift就是替换护甲。多个规则由逗号分隔如var armorShift = {A:B, C:D, E:F, G:H}这样。 |