Let's assume there's only 2 possible weapons in my game - 15 and 16.
It works always. When I gave myself weapons 15 and 16 with different event, the event still returns "you have no weapons"
On Discord I sent you a patched version of "UsefulFunctions"...
You want to check if anyone has the weapon equipped?
...or if it is anywhere in the party inventory at all including equipped?
...or if it is anywhere in the party inventory at all but NOT including equipped?
Basically I rewrote those functions to this...
Spoiler
Code:
// Check Types:
// 0: All Inventory
// 1: Only Equipped
// 2: All Inventory EXCEPT equipped
function hasWeapon(id, checkType) {
checkType = checkType || 0;
if (checkType === 2) {return $gameParty.hasItem($dataWeapons[id]);}
if (checkType === 0) {return $gameParty.hasItem($dataWeapons[id], true);}
for (actorId in $gameParty._actors) {
if ($gameActors.actor($gameParty._actors[actorId])) var bool = $gameActors.actor($gameParty._actors[actorId])._equips[0]._itemId == id;
if (bool) {return true;}
}
return false;
}
function hasArmor(id, checkType) {
if (checkType === 2){return $gameParty.hasItem($dataArmors[id]);}
if (checkType === 0){return $gameParty.hasItem($dataArmors[id], true);}
for (actorId in $gameParty._actors) {
if ($gameActors.actor($gameParty._actors[actorId])) {
var bool = bool || $gameActors.actor($gameParty._actors[actorId])._equips[1]._itemId == id;
bool = bool || $gameActors.actor($gameParty._actors[actorId])._equips[2]._itemId == id;
bool = bool || $gameActors.actor($gameParty._actors[actorId])._equips[3]._itemId == id;
bool = bool || $gameActors.actor($gameParty._actors[actorId])._equips[4]._itemId == id;
if (bool) {return true;}
}
}
return false;
}
This allows to check for (0) All Inventory, (1) Only Equipped, or (2) All Inventory EXCEPT equipped.
Example: if you set the "checkType" to 2 it will only check the weapons/armors that are equipped in the party.
😉
Does that help?
Edit:
Also now creating my own Inventory Checking Plugin for more advanced usage for those interested...