Need some help with script for NPC Bankers

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Need some help with script for NPC Bankers

Post by Xuri »

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?
-= Ho Eyo He Hum =-
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

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?
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Hmm yep sounds like it. Though there would have to be a similar setup for onPickup, or it would be a one-way street only (can detect when they drop things in the bank, but not when they pick items out of the bank).
-= Ho Eyo He Hum =-
Post Reply