Bank Checks?

Forum where anything UOX3-related goes - including, but not limited to: newbie-support, ideas, general questions, comments, etc and-so-forth.
Post Reply
User avatar
Natas
UOX3 Novice
Posts: 70
Joined: Fri Mar 25, 2005 3:00 am
Location: Del Valle, texas United States
Has thanked: 0
Been thanked: 0

Bank Checks?

Post by Natas »

I was just curious if there is a script out there for bank checks. Or maybe I over looked it.

Thanks

-Natas-
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 »

I have a more or less completed javascript which replaces the hardcoded banker ai with a scripted one which supports more commands AND the ability to create checks from gold in your bank box. I also have a script for the bankchecks themselves, which will turn back into gold. They're newbiefied and can only be used while in your bankbox. I'm not sure what other things you're supposed to be able to do with checks :P

When I've made sure that it's as bugfree as I can get it, it will probably be included in the next UOX3 release.

If you want to try it out right now, download this RAR file (use WinRar/WinAce to unpack), which you then unzip to your UOX3/JS folder (Make sure that banker.js ends up in npc/ai/ and bankcheck.js in item/).

Then add these two lines to jse_fileassociations.scp at the apropriate places:
3201=npc/ai/banker.js
and
5014=item/bankcheck.js

Next, edit the Banker-NPCs in dfndata/npc/malevendors.dfn and dfndata/npc/femalevendors.dfn, and replace their NPCAI=8 line with one saying SCRIPT=3201 instead.

Note that these changes will only affect any NEW banker-NPCs added to your world, so if you add these manually or through itembased-spawners, you need to respawn them. If you use regional spawns, new banker-NPCs with those changes will automatically be spawned on the next server startup.

Creating checks should be the same as on the official UO servers, say CHECK <amount> to any banker who has the above mentioned banker-ai-script attached.
-= Ho Eyo He Hum =-
User avatar
Natas
UOX3 Novice
Posts: 70
Joined: Fri Mar 25, 2005 3:00 am
Location: Del Valle, texas United States
Has thanked: 0
Been thanked: 0

Post by Natas »

Where can I get winrar or winace to unpack that file? And also in OSI they have it set up so that when you sell items to an npc or are collecting a reward that if your bag can't hold all the gold coins it puts a bank check for that amount in your bag. did you include that in your code?
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 »

WinRAR: http://www.rarlab.com/download.htm
WinAce: http://www.winace.com/
(Note that WinAce can handle both .ace, .zip, .rar and many other files)

I didn't include what you mentioned in my script, no. I'm not sure how I could accomplish that. :|
-= Ho Eyo He Hum =-
User avatar
Natas
UOX3 Novice
Posts: 70
Joined: Fri Mar 25, 2005 3:00 am
Location: Del Valle, texas United States
Has thanked: 0
Been thanked: 0

Post by Natas »

Would I be able to just set it up where the quest npc just rewards a chr with a bank check as oppose to gold? That would be easyer wouldnt it?
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 »

That would be possible. If you through your quest script add a new check to the player's backpack similar to the following method, the check will work exactly like the checks made by the banker NPC.

Code: Select all

var checkSize = 1000;
var newCheck = CreateDFNItem( playerChar.socket, playerChar, "0x14F0", 1, "ITEM", true );
if( newcheck )
{
	newCheck.SetTag( "CheckSize", checkSize );
	newCheck.name = "A bank check";
	newCheck.colour = 0x34;
	newCheck.scripttrigger = 5014;
	newCheck.isNewbie = true;
	newCheck.weight = 100;
}
-= Ho Eyo He Hum =-
User avatar
Jediman
UOX3 Apprentice
Posts: 177
Joined: Fri Jul 16, 2004 1:38 am
Location: New England
Has thanked: 0
Been thanked: 0
Contact:

Post by Jediman »

For some reason, this script doesn't seem to be working...well the actual double clicking on the bank check once created doesn't do anything..5014 seems to never trigger for some odd ball reason.

I'm using V0.98-37.q .
I've even double checked the JS for the banker by forceably setting the trigger script of the bank check to 5014 but still no go.

Setting the trigger to 5014 manually on the bank check item itself also yeilds nothing..any ideas?
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 »

bankcheck-js uses

Code: Select all

function onUse( pUser, iUsed )
which is no longer supported, as it has been replaced by onUseChecked (performs hardcoded checks for range, line of sight, dead-check, etc) and onUseUnchecked (no hardcoded checks).

Try replacing the onUse line with

Code: Select all

function onUseChecked( pUser, iUsed )
-= Ho Eyo He Hum =-
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 »

Btw, I just went through the Script Vault and ninja-replaced all instances of "onUse" with "onUseChecked" in the scripts there. :P
-= Ho Eyo He Hum =-
User avatar
Jediman
UOX3 Apprentice
Posts: 177
Joined: Fri Jul 16, 2004 1:38 am
Location: New England
Has thanked: 0
Been thanked: 0
Contact:

Post by Jediman »

Perfect!
Post Reply