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?
Need some help with script for NPC Bankers
-
Maarc
- Developer
- Posts: 576
- Joined: Sat Mar 27, 2004 6:22 am
- Location: Fleet, UK
- Has thanked: 0
- Been thanked: 0
- Contact:
The other possibility is that we fire the onDrop event for the container as well, if required. Extend the onDrop event to include a direction parameter so it knows how to deal with it, and then trigger for both the item and container, item first, container second. This would probably give you the flexibility you want, yes?