Code: Select all
[clothingblessdeed]
{
GET=base_item
NAME=Clothing Bless Deed
ID=0x1F23
SCRIPT=6003
}
// Clothing Bless Deed
// v1.3
// by Xuri (xuri@sensewave.com)
// Last Updated: 2. May 2006
// With a clothing bless deed, a player may bless/newbiefie any one piece of clothing in his/her backpack or paperdoll.
// The blessed clothing article will then stay with the character even upon death, and cannot be stolen.
// To use, save this script as js/custom/clothingBlessDeed.js, and add a new entry in jse_fileassociations.scp for it
// in the [SCRIPT_LIST] section of the file
// Example:
// 6000=custom/clothingBlessDeed.js
//
// Next, add a deed ingame using 'ADD 0x1f23, then do 'SETSCPTRIG 6000 on the deed.
// Alternatively, add a new deed-item to the item-dfns (with a unique header, like [ClothBlessDeed], and assign the script
// by adding a SCRIPT=6000 tag. Add the new item ingame using 'ADD ITEM ClothBlessDeed
//The following items may be blessed with a bless-deed:
var validClothingArray = new Array( "0x1515", "0x1516", "0x1517", "0x1518", "0x152e", "0x152f", "0x1530", "0x1531", "0x1537",
"0x1538", "0x1539", "0x153a", "0x153b", "0x153c", "0x153d", "0x153e", "0x153f", "0x1540",
"0x1544", "0x170b", "0x170c", "0x170d", "0x170e", "0x170f", "0x1710", "0x1711", "0x1712",
"0x1713", "0x1714", "0x1715", "0x1716", "0x1717", "0x1718", "0x1719", "0x171a", "0x171b",
"0x171c", "0x1efd", "0x1efe", "0x1eff", "0x1f00", "0x1f01", "0x1f02", "0x1f03", "0x1f04",
"0x1f7b", "0x1f7c", "0x1f9f", "0x1fa0", "0x1fa1", "0x1fa2", "0x1ffd", "0x1ffe", "0x2305",
"0x2306", "0x2307", "0x2308", "0x2309", "0x230a", "0x230b", "0x230c", "0x230d", "0x230e",
"0x230f", "0x2310", "0x25ea", "0x25eb", "0x25ec", "0x25ed", "0x25ee", "0x25ef", "0x25f2",
"0x25f3", "0x2649", "0x264a", "0x264d", "0x264e", "0x264f", "0x2650", "0x2651", "0x2652",
"0x2653", "0x2654", "0x2655", "0x2656", "0x265f", "0x2660", "0x2661", "0x2662", "0x2663",
"0x2664", "0x2665", "0x2666", "0x2667", "0x2668", "0x267b", "0x267c", "0x267d", "0x267e",
"0x267f", "0x2680", "0x2681", "0x2682", "0x2683", "0x2684", "0x268b", "0x268c", "0x269d",
"0x269e", "0x2782", "0x2783", "0x278f", "0x2794", "0x2796", "0x2797", "0x2798", "0x2799",
"0x279a", "0x279b", "0x279c", "0x27a0", "0x27a1", "0x27cd", "0x27ce", "0x27da", "0x27e1",
"0x27e2", "0x27e3", "0x27e4", "0x27e5", "0x27e6", "0x27e7", "0x27eb", "0x27ec", "0x2fb9",
"0x2fba", "0x2fbd", "0x2fbe", "0x2fc3", "0x2fc4", "0x2fca", "0x3173", "0x3174", "0x3175",
"0x3176", "0x3177", "0x3178", "0x3179", "0x317a", "0x3180" );
function onUseChecked( pUser, iUsed )
{
var pSock = pUser.socket;
var itemContainer = iUsed.container;
if( itemContainer && itemContainer.serial == pUser.pack.serial )
{
pSock.tempObj = iUsed;
pUser.CustomTarget( 0, "Select clothing article to bless:" );
}
else
pUser.SysMessage( GetDictionaryEntry( 1763, pSock.Language )); //That item must be in your backpack before it can be used.
return false;
}
function onCallback0( pSock, ourObj )
{
var pUser = pSock.currentChar;
var iUsed = pSock.tempObj;
if( iUsed.container && iUsed.container == pUser.pack )
{
if( !pSock.GetWord( 1 ) && ourObj.isItem )
{
if( ourObj.container && (( ourObj.container == pUser ) || ( ourObj.container == pUser.pack )))
{
for(var i = 0; i < validClothingArray.length; i++)
{
if( ourObj.id == validClothingArray[i] )
{
if( ourObj.isNewbie == false )
{
ourObj.isNewbie = true;
pUser.SysMessage( "The targeted item (" + ourObj.name + ") has been blessed." );
iUsed.Delete();
}
else
pUser.SysMessage( "That item is already blessed." );
return;
}
}
}
}
pSock.SysMessage( "You can only use this on clothes in your backpack or on your paperdoll." );
}
else
pUser.SysMessage( "You are no longer carrying the clothing bless deed." );
}
// v1.3
// by Xuri (xuri@sensewave.com)
// Last Updated: 2. May 2006
// With a clothing bless deed, a player may bless/newbiefie any one piece of clothing in his/her backpack or paperdoll.
// The blessed clothing article will then stay with the character even upon death, and cannot be stolen.
// To use, save this script as js/custom/clothingBlessDeed.js, and add a new entry in jse_fileassociations.scp for it
// in the [SCRIPT_LIST] section of the file
// Example:
// 6000=custom/clothingBlessDeed.js
//
// Next, add a deed ingame using 'ADD 0x1f23, then do 'SETSCPTRIG 6000 on the deed.
// Alternatively, add a new deed-item to the item-dfns (with a unique header, like [ClothBlessDeed], and assign the script
// by adding a SCRIPT=6000 tag. Add the new item ingame using 'ADD ITEM ClothBlessDeed
//The following items may be blessed with a bless-deed:
var validClothingArray = new Array( "0x1515", "0x1516", "0x1517", "0x1518", "0x152e", "0x152f", "0x1530", "0x1531", "0x1537",
"0x1538", "0x1539", "0x153a", "0x153b", "0x153c", "0x153d", "0x153e", "0x153f", "0x1540",
"0x1544", "0x170b", "0x170c", "0x170d", "0x170e", "0x170f", "0x1710", "0x1711", "0x1712",
"0x1713", "0x1714", "0x1715", "0x1716", "0x1717", "0x1718", "0x1719", "0x171a", "0x171b",
"0x171c", "0x1efd", "0x1efe", "0x1eff", "0x1f00", "0x1f01", "0x1f02", "0x1f03", "0x1f04",
"0x1f7b", "0x1f7c", "0x1f9f", "0x1fa0", "0x1fa1", "0x1fa2", "0x1ffd", "0x1ffe", "0x2305",
"0x2306", "0x2307", "0x2308", "0x2309", "0x230a", "0x230b", "0x230c", "0x230d", "0x230e",
"0x230f", "0x2310", "0x25ea", "0x25eb", "0x25ec", "0x25ed", "0x25ee", "0x25ef", "0x25f2",
"0x25f3", "0x2649", "0x264a", "0x264d", "0x264e", "0x264f", "0x2650", "0x2651", "0x2652",
"0x2653", "0x2654", "0x2655", "0x2656", "0x265f", "0x2660", "0x2661", "0x2662", "0x2663",
"0x2664", "0x2665", "0x2666", "0x2667", "0x2668", "0x267b", "0x267c", "0x267d", "0x267e",
"0x267f", "0x2680", "0x2681", "0x2682", "0x2683", "0x2684", "0x268b", "0x268c", "0x269d",
"0x269e", "0x2782", "0x2783", "0x278f", "0x2794", "0x2796", "0x2797", "0x2798", "0x2799",
"0x279a", "0x279b", "0x279c", "0x27a0", "0x27a1", "0x27cd", "0x27ce", "0x27da", "0x27e1",
"0x27e2", "0x27e3", "0x27e4", "0x27e5", "0x27e6", "0x27e7", "0x27eb", "0x27ec", "0x2fb9",
"0x2fba", "0x2fbd", "0x2fbe", "0x2fc3", "0x2fc4", "0x2fca", "0x3173", "0x3174", "0x3175",
"0x3176", "0x3177", "0x3178", "0x3179", "0x317a", "0x3180" );
function onUseChecked( pUser, iUsed )
{
var pSock = pUser.socket;
var itemContainer = iUsed.container;
if( itemContainer && itemContainer.serial == pUser.pack.serial )
{
pSock.tempObj = iUsed;
pUser.CustomTarget( 0, "Select clothing article to bless:" );
}
else
pUser.SysMessage( GetDictionaryEntry( 1763, pSock.Language )); //That item must be in your backpack before it can be used.
return false;
}
function onCallback0( pSock, ourObj )
{
var pUser = pSock.currentChar;
var iUsed = pSock.tempObj;
if( iUsed.container && iUsed.container == pUser.pack )
{
if( !pSock.GetWord( 1 ) && ourObj.isItem )
{
if( ourObj.container && (( ourObj.container == pUser ) || ( ourObj.container == pUser.pack )))
{
for(var i = 0; i < validClothingArray.length; i++)
{
if( ourObj.id == validClothingArray[i] )
{
if( ourObj.isNewbie == false )
{
ourObj.isNewbie = true;
pUser.SysMessage( "The targeted item (" + ourObj.name + ") has been blessed." );
iUsed.Delete();
}
else
pUser.SysMessage( "That item is already blessed." );
return;
}
}
}
}
pSock.SysMessage( "You can only use this on clothes in your backpack or on your paperdoll." );
}
else
pUser.SysMessage( "You are no longer carrying the clothing bless deed." );
}