magicbooks.js
function onUseChecked( pUser, iUsed )
{
var socket = pUser.socket;
var pName = pUser.name;
if( socket && iUsed && iUsed.isItem )
{
if( pUser.isReadingBook )
{
socket.SysMessage( "You must wait before reading a nother book." );
return false;
}
//Check to see if it's locked down
if( iUsed.movable == 2 || iUsed.movable == 3 )
{
socket.SysMessage( GetDictionaryEntry( 774, socket.Language ) );
return false;
}
switch( iUsed.morey )
{
case 1: // Libram of Gainful Conjuration
pUser.StaticEffect( 0x373A, 0, 15 );
pUser.SoundEffect( 0x0215, true );
pUser.skills.magery=(pUser.skills.magery + 50);
pUser.isReadingBook = true;
pUser.EmoteMessage("You increase your knowledge of Magery!" );
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 2: // Libram of Ineffable Damnation
pUser.StaticEffect( 0x373A, 0, 15 );
pUser.SoundEffect( 0x019c, true );
pUser.skills.magery=(pUser.skills.magery + 150);
pUser.karma = (pUser.karma -500);
pUser.EmoteMessage( "You increase your knowledge of the magic arts!" );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 3: // Libram of the Silver Serpent
if(pUser.karma > 500)
{
pUser.skills.magery=(pUser.skills.magery + 150);
pUser.karma = (pUser.karma +100);
pUser.fame = (pUser.fame +100);
pUser.tempint=(pUser.tempint +5);
pUser.EmoteMessage( "You have learned much from this tome..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
iUsed.Delete();
break;
}
else
{
pUser.SysMessage( "You do not have enough Karma to read this..." );
}
break;
case 4: // Manual of Pilfering
pUser.skills.stealing=(pUser.skills.stealing + 100);
pUser.skills.lockpicking=(pUser.skills.lockpicking + 100);
pUser.skills.snooping=(pUser.skills.snooping + 100);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You have learned the arts to stealing" );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 5: // Vacuous Grimoire
pUser.tempint=(pUser.tempint - 5);
pUser.health = (pUser.health -75);
pUser.fame = (pUser.fame -100);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "Your body wracks with pain..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 6: // Book of Exalted Deeds
if(pUser.karma > 75)
{
pUser.fame = (pUser.fame +100);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You feel as if you are in the spot light." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
iUsed.Delete();
break;
}
else
{
pUser.SysMessage( "You do not have enough Karma to read this..." );
}
break;
case 7: // Blessed Book of the Avatar
if(pUser.karma > 150)
{
pUser.skills.magicresistance=(pUser.skills.magicresistance + 150);
pUser.tempint=(pUser.tempint - 5);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You feel as magic can no longer hurt you." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
iUsed.Delete();
break;
}
else
{
pUser.SysMessage( "You do not have enough Karma to read this..." );
}
break;
case 8: // Book of Vile Darkness
if(pUser.karma < -50)
{
pUser.skills.alchemy=(pUser.skills.alchemy + 200);
pUser.tempint=(pUser.tempint +5);
pUser.karma = (pUser.karma -300);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You are much more evil now." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
iUsed.Delete();
break;
}
else
{
pUser.SysMessage( "You are not evil enough to read this (yet)..." );
}
break;
case 9: // Tactics for Dummies
pUser.skills.tactics=(pUser.skills.tactics + 100);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage("You learn alot about tactics..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 10: // Book of Intelligence
pUser.tempint=(pUser.tempint +20);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You feel more intelligent..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 11: // Cursed Book of Mind Destroying
pUser.tempint=(pUser.tempint -20);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "Your mind is being destroyed..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 12: // Tome of Mystical Equations
pUser.skills.alchemy=(pUser.skills.alchemy + 150);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You learn alot about alchemy..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 13: // Tome of Magic
pUser.skills.magery=(pUser.skills.magery + 100);
pUser.tempint=(pUser.tempint +5);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You learn alot about magic..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 14: // Redlimb's Guide to Taming
pUser.skills.taming=(pUser.skills.taming + 120);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You learn alot about taming..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 15: // Cursed Manual of Fumble Fingers
pUser.tempdex=(pUser.tempdex -8);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You feel your coordination dwindle..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 16: // Tome of Tinkering
pUser.skills.tinkering=(pUser.skills.tinkering + 150);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You learn alot about tinkering..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 17: // Guide to Inscription
pUser.skills.inscription=(pUser.skills.inscription + 150);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You learn alot about inscription..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
default:
break;
}
if( iUsed.morey != 3 )
{
pUser.SoundEffect( 0x0030, true );
if( pUser.id > 0x0189 && !pUser.isonhorse )
pUser.DoAction( 0x22 );
iUsed.Delete();
}
}
return false;
}
{
var socket = pUser.socket;
var pName = pUser.name;
if( socket && iUsed && iUsed.isItem )
{
if( pUser.isReadingBook )
{
socket.SysMessage( "You must wait before reading a nother book." );
return false;
}
//Check to see if it's locked down
if( iUsed.movable == 2 || iUsed.movable == 3 )
{
socket.SysMessage( GetDictionaryEntry( 774, socket.Language ) );
return false;
}
switch( iUsed.morey )
{
case 1: // Libram of Gainful Conjuration
pUser.StaticEffect( 0x373A, 0, 15 );
pUser.SoundEffect( 0x0215, true );
pUser.skills.magery=(pUser.skills.magery + 50);
pUser.isReadingBook = true;
pUser.EmoteMessage("You increase your knowledge of Magery!" );
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 2: // Libram of Ineffable Damnation
pUser.StaticEffect( 0x373A, 0, 15 );
pUser.SoundEffect( 0x019c, true );
pUser.skills.magery=(pUser.skills.magery + 150);
pUser.karma = (pUser.karma -500);
pUser.EmoteMessage( "You increase your knowledge of the magic arts!" );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 3: // Libram of the Silver Serpent
if(pUser.karma > 500)
{
pUser.skills.magery=(pUser.skills.magery + 150);
pUser.karma = (pUser.karma +100);
pUser.fame = (pUser.fame +100);
pUser.tempint=(pUser.tempint +5);
pUser.EmoteMessage( "You have learned much from this tome..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
iUsed.Delete();
break;
}
else
{
pUser.SysMessage( "You do not have enough Karma to read this..." );
}
break;
case 4: // Manual of Pilfering
pUser.skills.stealing=(pUser.skills.stealing + 100);
pUser.skills.lockpicking=(pUser.skills.lockpicking + 100);
pUser.skills.snooping=(pUser.skills.snooping + 100);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You have learned the arts to stealing" );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 5: // Vacuous Grimoire
pUser.tempint=(pUser.tempint - 5);
pUser.health = (pUser.health -75);
pUser.fame = (pUser.fame -100);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "Your body wracks with pain..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 6: // Book of Exalted Deeds
if(pUser.karma > 75)
{
pUser.fame = (pUser.fame +100);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You feel as if you are in the spot light." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
iUsed.Delete();
break;
}
else
{
pUser.SysMessage( "You do not have enough Karma to read this..." );
}
break;
case 7: // Blessed Book of the Avatar
if(pUser.karma > 150)
{
pUser.skills.magicresistance=(pUser.skills.magicresistance + 150);
pUser.tempint=(pUser.tempint - 5);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You feel as magic can no longer hurt you." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
iUsed.Delete();
break;
}
else
{
pUser.SysMessage( "You do not have enough Karma to read this..." );
}
break;
case 8: // Book of Vile Darkness
if(pUser.karma < -50)
{
pUser.skills.alchemy=(pUser.skills.alchemy + 200);
pUser.tempint=(pUser.tempint +5);
pUser.karma = (pUser.karma -300);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You are much more evil now." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
iUsed.Delete();
break;
}
else
{
pUser.SysMessage( "You are not evil enough to read this (yet)..." );
}
break;
case 9: // Tactics for Dummies
pUser.skills.tactics=(pUser.skills.tactics + 100);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage("You learn alot about tactics..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 10: // Book of Intelligence
pUser.tempint=(pUser.tempint +20);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You feel more intelligent..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 11: // Cursed Book of Mind Destroying
pUser.tempint=(pUser.tempint -20);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "Your mind is being destroyed..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 12: // Tome of Mystical Equations
pUser.skills.alchemy=(pUser.skills.alchemy + 150);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You learn alot about alchemy..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 13: // Tome of Magic
pUser.skills.magery=(pUser.skills.magery + 100);
pUser.tempint=(pUser.tempint +5);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You learn alot about magic..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 14: // Redlimb's Guide to Taming
pUser.skills.taming=(pUser.skills.taming + 120);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You learn alot about taming..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 15: // Cursed Manual of Fumble Fingers
pUser.tempdex=(pUser.tempdex -8);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You feel your coordination dwindle..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 16: // Tome of Tinkering
pUser.skills.tinkering=(pUser.skills.tinkering + 150);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You learn alot about tinkering..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
case 17: // Guide to Inscription
pUser.skills.inscription=(pUser.skills.inscription + 150);
pUser.StaticEffect( 0x376A, 0x09, 0x06 );
pUser.SoundEffect( 0x01E3, true );
pUser.EmoteMessage( "You learn alot about inscription..." );
pUser.isReadingBook = true;
DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 );
break;
default:
break;
}
if( iUsed.morey != 3 )
{
pUser.SoundEffect( 0x0030, true );
if( pUser.id > 0x0189 && !pUser.isonhorse )
pUser.DoAction( 0x22 );
iUsed.Delete();
}
}
return false;
}
[bookconjuration]
{
get=base_item
name=a magical book
name2=Libram of Gainful Conjuration
id=0x0e3b
color=0x0019
decay=1
script=5046
morey=1
}
[bookdamnation]
{
get=base_item
name=a magical book
name2=Libram of Ineffable Damnation
id=0x0e3b
color=0x0322
decay=1
script=5046
morey=2
}
[booksilverserpent]
{
get=base_item
name=a magical book
name2=Libram of the Silver Serpent
id=0x0e3b
color=0x03e9
decay=1
script=5046
morey=3
}
[bookpilfering]
{
get=base_item
name=a magical book
name2=Manual of Pilfering
id=0x0e3b
color=0x0205
decay=1
script=5046
morey=4
}
[vacuousgrimoire]
{
get=base_item
name=a magical book
name2=Vacuous Grimoire
id=0x0e3b
color=0x030e
decay=1
script=5046
morey=5
}
bookexalteddeeds]
{
get=base_item
name=a magical book
name2=Book of Exalted Deeds
id=0x0e3b
color=0x0168
decay=1
script=5046
morey=6
}
[bookavatar]
{
get=base_item
name=a magical book
name2=Blessed Book of the Avatar
id=0x0e3b
color=0x00ab
decay=1
script=5046
morey=7
}
[bookviledarkness]
{
get=base_item
name=a magical book
name2=Book of Vile Darkness
id=0x0e3b
color=0x02e2
decay=1
script=5046
morey=8
}
[bookdummies]
{
get=base_item
name=a magical book
name2=Tactics for Dummies
id=0x0e3b
color=0x0036
decay=1
script=5046
morey=9
}
[bookintelligence]
{
get=base_item
name=a magical book
name2=Book of Intelligence
id=0x0e3b
color=0x00cd
decay=1
script=5046
morey=10
}
[bookminddestroying]
{
get=base_item
name=a magical book
name2=Cursed Book of Mind Destroying
id=0x0e3b
color=0x00cd
decay=1
script=5046
morey=11
}
[bookmystical]
{
get=base_item
name=a magical book
name2=Tome of Mystical Equations
id=0x0e3b
color=0x0297
decay=1
script=5046
morey=12
}
[bookmagic]
{
get=base_item
name=a magical book
name2=Tome of Magic
id=0x0e3b
color=0x02e2
decay=1
script=5046
morey=13
}
[bookredlimbs]
{
get=base_item
name=a magical book
name2=Redlimb's Guide to Animal Taming
id=0x0e3b
color=0x01c9
decay=1
script=5046
morey=14
}
[bookfumblefingers]
{
get=base_item
name=a magical book
name2=Cursed Manual of Fumble Fingers
id=0x0e3b
color=0x0205
decay=1
script=5046
morey=15
}
[booktinkering]
{
get=base_item
name=a magical book
name2=Tome of Tinkering
id=0x0e3b
color=0x0058
decay=1
script=5046
morey=16
}
[bookinscription]
{
get=base_item
name=a magical book
name2=Guide to Inscription
id=0x0e3b
color=0x0006
decay=1
script=5046
morey=17
}
{
get=base_item
name=a magical book
name2=Libram of Gainful Conjuration
id=0x0e3b
color=0x0019
decay=1
script=5046
morey=1
}
[bookdamnation]
{
get=base_item
name=a magical book
name2=Libram of Ineffable Damnation
id=0x0e3b
color=0x0322
decay=1
script=5046
morey=2
}
[booksilverserpent]
{
get=base_item
name=a magical book
name2=Libram of the Silver Serpent
id=0x0e3b
color=0x03e9
decay=1
script=5046
morey=3
}
[bookpilfering]
{
get=base_item
name=a magical book
name2=Manual of Pilfering
id=0x0e3b
color=0x0205
decay=1
script=5046
morey=4
}
[vacuousgrimoire]
{
get=base_item
name=a magical book
name2=Vacuous Grimoire
id=0x0e3b
color=0x030e
decay=1
script=5046
morey=5
}
bookexalteddeeds]
{
get=base_item
name=a magical book
name2=Book of Exalted Deeds
id=0x0e3b
color=0x0168
decay=1
script=5046
morey=6
}
[bookavatar]
{
get=base_item
name=a magical book
name2=Blessed Book of the Avatar
id=0x0e3b
color=0x00ab
decay=1
script=5046
morey=7
}
[bookviledarkness]
{
get=base_item
name=a magical book
name2=Book of Vile Darkness
id=0x0e3b
color=0x02e2
decay=1
script=5046
morey=8
}
[bookdummies]
{
get=base_item
name=a magical book
name2=Tactics for Dummies
id=0x0e3b
color=0x0036
decay=1
script=5046
morey=9
}
[bookintelligence]
{
get=base_item
name=a magical book
name2=Book of Intelligence
id=0x0e3b
color=0x00cd
decay=1
script=5046
morey=10
}
[bookminddestroying]
{
get=base_item
name=a magical book
name2=Cursed Book of Mind Destroying
id=0x0e3b
color=0x00cd
decay=1
script=5046
morey=11
}
[bookmystical]
{
get=base_item
name=a magical book
name2=Tome of Mystical Equations
id=0x0e3b
color=0x0297
decay=1
script=5046
morey=12
}
[bookmagic]
{
get=base_item
name=a magical book
name2=Tome of Magic
id=0x0e3b
color=0x02e2
decay=1
script=5046
morey=13
}
[bookredlimbs]
{
get=base_item
name=a magical book
name2=Redlimb's Guide to Animal Taming
id=0x0e3b
color=0x01c9
decay=1
script=5046
morey=14
}
[bookfumblefingers]
{
get=base_item
name=a magical book
name2=Cursed Manual of Fumble Fingers
id=0x0e3b
color=0x0205
decay=1
script=5046
morey=15
}
[booktinkering]
{
get=base_item
name=a magical book
name2=Tome of Tinkering
id=0x0e3b
color=0x0058
decay=1
script=5046
morey=16
}
[bookinscription]
{
get=base_item
name=a magical book
name2=Guide to Inscription
id=0x0e3b
color=0x0006
decay=1
script=5046
morey=17
}