Smoke Bomb

Got any custom JavaScript additions/tweaks you think other people would like to see? Post 'em here!
Post Reply
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Smoke Bomb

Post by dragon slayer »

Update
Added delay after using the smoke bomb


This is the smoke bomb ou get in osi when you choose to be a ninja :)

Code: Select all

[smokebomb]
{ 
GET=base_item
NAME=smoke bomb
ID=0x2808
weight=100
SCRIPT=5072
}
function onUseChecked( pUser, iUsed )
{
    var socket = pUser.socket;

    if( socket && iUsed && iUsed.isItem )
    {
        if( pUser.isUsingPotion )
        {
            socket.SysMessage( "You must wait a few seconds before you can use that item." );
            return false;
        }
        if( iUsed.movable == 2 || iUsed.movable == 3 )
        {
            socket.SysMessage( GetDictionaryEntry( 774, socket.Language ) ); //That is locked down and you cannot use it
            return false;
        }
        var itemOwner = GetPackOwner( iUsed, 0 );
        if( itemOwner == null || itemOwner.serial != pUser.serial )
        {
            pUser.SysMessage( "The item must be in your backpack to use it." );
            return false;
        }
        if( pUser.mana <= 10 )
        {
            pUser.SysMessage( "You don't have enough mana to do that." );
            return false;
        }
        if( pUser.skills[53] == 500 )
                {
                   pUser.SysMessage( "You need at least 50 Ninjitsu skill to use that ability" );
                   return false;
                }
                pUser.mana -= 10;
                pUser.StaticEffect( 0x3709, 30, 30 );//Staticeffect not working when item deletes
                pUser.SoundEffect( 0x22F, true );
        pUser.visible = 1;
        pUser.stealth = -1;
        pUser.isUsingPotion = true;
        DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another bomb    
    }
    if( iUsed.morey != 3 )
        {
          iUsed.Delete();
    }
    return false;
}
Post Reply