[FIXED] JS Event onPickup exists in code, but is not used by UOX3
- Xuri
- Site Admin
- Posts: 3704
- Joined: Mon Jun 02, 2003 9:11 am
- Location: Norway
- Has thanked: 48 times
- Been thanked: 8 times
- Contact:
JS Event onPickup exists in code, but is not used by UOX3
The situation for onPickup is the same as for onFall - the source for this JS event exists, but it is not referenced anywhere else in UOX3 and thus can't be used in scripts.
Last edited by Xuri on Wed Jul 16, 2008 11:16 pm, edited 2 times in total.
-= Ho Eyo He Hum =-
- Xuri
- Site Admin
- Posts: 3704
- Joined: Mon Jun 02, 2003 9:11 am
- Location: Norway
- Has thanked: 48 times
- Been thanked: 8 times
- Contact:
Did some more testing on this, and when the event returns true, the item will always bounce. If the event returns false, the character will be allowed to pick up the item if code allows for it.
Tested using this handy script:
It all seems to work, though I'm a little confused as to whether the functionality of return false / return true works as intended, or if it should be the other way around =P
Tested using this handy script:
Code: Select all
function onPickup( iPickedUp, pGrabber )
{
var pSock = pGrabber.socket;
//Check the value of pSock.pickupSpot to determine where the item was picked up from
switch( pSock.pickupSpot )
{
case 0: //nowhere
pGrabber.TextMessage( "I picked up this item from... NOWHERE!" );
break;
case 1: //ground
pGrabber.TextMessage( "I picked up this item from the ground." );
break;
case 2: //ownpack
pGrabber.TextMessage( "I picked up this item from my own backpack." );
break;
case 3: //otherpack
pGrabber.TextMessage( "I picked up this item from a container." );
break;
case 4: //paperdoll
pGrabber.TextMessage( "I picked up this item from my paperdoll." );
break;
case 5: //bank
pGrabber.TextMessage( "I picked up this item from my bank box." );
break;
default:
pGrabber.TextMessage( "Error. Redo from Start." );
break;
}
return false;
}-= Ho Eyo He Hum =-