Player Travel Commands v1.0

Got any custom JavaScript additions/tweaks you think other people would like to see? Post 'em here!
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:

Player Travel Commands v1.0

Post by Xuri »

// Player Travel Commands
// by Xuri Dabur (xuri@sensewave.com)
// v1.0
// Last updated: 17. January 2006

// These commands will allow players to mark runes and put up gates for a customizable fee. To use the script, save in JS\COMMANDS\CUSTOM\ as (for instance) playertravel.js, then add a new entry to the bottom of the [COMMAND_SCRIPT] section of JSE_FILEASSOCIATIONS.SCP, using a unique script-ID.

var gateFee = 500;
var markFee = 1000;

function CommandRegistration()
{
    RegisterCommand( "pgate", 0, true );
    RegisterCommand( "pmark", 0, true );
}

function command_PGATE( socket, cmdString )
{
    var targMsg = GetDictionaryEntry( 226, socket.Language );
    socket.CustomTarget( 0, targMsg );
}

function onCallback0( socket, ourObj )
{
    var mChar = socket.currentChar;
    var gold =  mChar.ResourceCount( 0xEED, 0 );
    if( gold >= gateFee )
    {
        if( !socket.GetWord( 1 ) && ourObj.isItem && mChar )
        {
            if( ourObj.morex <= 200 && ourObj.morey <= 200 )
            {
                var txtMessage = GetDictionaryEntry( 679, socket.Language );
                socket.SysMessage( txtMessage );
            }
            else
            {
                mChar.Gate( ourObj );
                mChar.UseResource( gateFee, 0xEED );
            }
        }
    }
    else
        socket.SysMessage( "You don't have enough gold. You need at least "+gateFee+" gold to put up a gate." );
}

function command_PMARK( socket, cmdString )
{
    var targMsg = GetDictionaryEntry( 225 );
    socket.CustomTarget( 2, targMsg );
}

function onCallback2( socket, ourObj )
{
    var mChar   = socket.currentChar;
    var gold =  mChar.ResourceCount( 0xEED, 0 );
    if( gold >= markFee )
    {
        if( !socket.GetWord( 1 ) && ourObj.isItem && mChar )
        {
            var txtMessage = GetDictionaryEntry( 686 );
            socket.SysMessage( txtMessage );
            mChar.Mark( ourObj );
            mChar.UseResource( markFee, 0xEED );
        }
    }
    else
        socket.SysMessage( "You don't have enough gold. You need at least "+markFee+" gold to mark a rune." ); 
}
-= Ho Eyo He Hum =-
l_katana
UOX3 Newbie
Posts: 16
Joined: Sun Apr 02, 2006 5:57 pm
Has thanked: 0
Been thanked: 0

Post by l_katana »

do you think there is a way to add onto that script to add that gold that it causts to mark/gate to a bank box accessable to the Admin account..

just a thought
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. Are you saying you want GMs to pay for the travel commands from a single bank account belonging to an admin character? Might be easier to just add a check to the script which makes it free for GMs.

On the other hand, the GMs could use the already available (and free for GMs) commands 'MARK, 'GATE and 'RECALL :)

If that wasn't what you were asking, let me know :P
-= Ho Eyo He Hum =-
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

I understood it, that he wants his GMs to access the money that is used for the gating.

So a player gates, it transferes his $$ into the admin's bank account. the admin can then access that gold.

Interesting thought.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Why would the admin need that gold? He can simply make his own. :P
Scott
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

That's why I said it could be an interesting thought:

--suppose for example that, unkowing to the PCs, the use of "gold" as a recall reagent has ill-effects on the magical balance of Britannia.

For every 5,000 gold that is "vanished" into a gate, a Harvester of Souls spawns somewhere in the open plains of britannia. Or even near a town.

A GM could check the bank, view the running total of gold, and as soon as 5,000 GP was in the bank account, he teleports to a location and creates a harvester of souls.

That's one thing I would think of that could be kind of cool. And you could get other quests as well:

--Lord British summon the heros and tellsthem to kill these harvesters and find out where they are coming from. As the PCs unravel the plot, they realize the very gold they were using to recall is what is bringing the harvesters in the first place. *dum dum dum*



I know.....it's a stretch.....
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Were one going to all the trouble of scripting the gold being spent into a bank account, it would actually be easier to simply write a script that with each use of the function a percentage chance of whatever action desired increases (or decreases).

A global bank account would actually be harder, as banks are attached to characters individually and it would be quite a strain on the server to "locate" a GM or Admin character.
Scott
l_katana
UOX3 Newbie
Posts: 16
Joined: Sun Apr 02, 2006 5:57 pm
Has thanked: 0
Been thanked: 0

Post by l_katana »

but was acualy thinking in the line of a lotery or something to that afect.. though i ran into a modified clock works asembly in my lone wolf add menu that works like a slot machene which was rather fun so thinking of trying to figure how to add that to my UOX server and maby add a casino some where...

Buc's Den seems like the kind of place where you would find something like that...

but I'm sure gambling is illigal in britiana so maby thers a use for thoes empty caves under Buc's Den after all
Post Reply