Need some help with script for NPC Bankers
Posted: Fri Mar 09, 2007 7:17 pm
Finally doing some more work on my long-overdue script to overhaul bankers & add support for bankchecks - but I've run into some snags.
One of the things I'd like to add is a way to limit the amount of items (and/or total weight) you can put in a bank box. That is easy to do when only dealing with the "DEPOSIT" bank-command, since I can check for all that in the script right away.
However, when it comes to dragging & dropping items into the bank box manually, I can't really think of a way to check for that, unless I attach an onDrop script or some such to every item in the world - which doesn't sound like a good solution. Same thing goes for when players drag items OUT OF the bankbox - how would I manage to detect that and calculate the remaining weight/amount of items instantly?
Sounds like I need a couple of new JS events that can be attached to containers or something - "onItemLoss/onItemGain" perhaps?
Any thoughts, anyone?
One of the things I'd like to add is a way to limit the amount of items (and/or total weight) you can put in a bank box. That is easy to do when only dealing with the "DEPOSIT" bank-command, since I can check for all that in the script right away.
However, when it comes to dragging & dropping items into the bank box manually, I can't really think of a way to check for that, unless I attach an onDrop script or some such to every item in the world - which doesn't sound like a good solution. Same thing goes for when players drag items OUT OF the bankbox - how would I manage to detect that and calculate the remaining weight/amount of items instantly?
Sounds like I need a couple of new JS events that can be attached to containers or something - "onItemLoss/onItemGain" perhaps?
Any thoughts, anyone?