Just thought id post this little snippet and maybe it helps anyone who may search for it in the future, quite honestly ive not even searched for it myself to check if there any out there.
So this is an example
Code:
if (c.playerEquipment[c.playerWeapon] == 22550 && c.crawsbowCharge <= 0) { // new
c.getItems().wearItem(22547, 1, 3);
}
Code:
the (3) is the item slot that its exchanging the item into.
to help you understand it more, its changed into a charged craw's bow when the charges are at 0 into a craw's bow uncharged.
this system could be used to swap degradeables out the hand upon degraded using -1 id assume or cool other custom systems.
this can be handled in files such as AttackNPC or AttackPlayer , may be called something different on your source.
Pretty much just coded it, not sure if ive missed anything but feel free to comment if i have.