mirror of
https://github.com/UOX3DevTeam/UOX3
synced 2026-08-13 12:27:04 -04:00
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
/// <reference path="../definitions.d.ts" />
|
|
// @ts-check
|
|
function SkillRegistration()
|
|
{
|
|
RegisterSkill( 47, true ); // Stealth
|
|
}
|
|
|
|
/** @type { ( skillUse: BaseObject, skillUsed: number, objType: 0 | 1 ) => boolean } */
|
|
function onSkill( pUser, skillUsed, objType )
|
|
{
|
|
var pSock = pUser.socket;
|
|
if( pSock )
|
|
{
|
|
if( pUser.isonhorse )
|
|
{
|
|
pSock.SysMessage( GetDictionaryEntry( 837, pSock.language )); // You cannot stealth while mounted.
|
|
}
|
|
else if( pUser.visible != 1 )
|
|
{
|
|
pSock.SysMessage( GetDictionaryEntry( 836, pSock.language )); // You must hide first.
|
|
}
|
|
else if( pUser.skills.hiding < 700 )
|
|
{
|
|
pSock.SysMessage( GetDictionaryEntry( 838, pSock.language )); // You are not hidden well enough. Become better at hiding.
|
|
pUser.visible = 0;
|
|
pUser.stealth = -1;
|
|
}
|
|
else if( !pUser.CheckSkill( 47, 0, pUser.skillCaps.stealth ))
|
|
{
|
|
pUser.visible = 0;
|
|
pUser.stealth = -1;
|
|
}
|
|
else
|
|
{
|
|
pSock.SysMessage( GetDictionaryEntry( 839, pSock.language )); // You begin to move quietly.
|
|
pUser.visible = 1;
|
|
pUser.stealth = 0;
|
|
}
|
|
}
|
|
return true;
|
|
}
|