// 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." );
}
// 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." );
}