Author
Comment
Share This Thread
----------------------------
Digg
del.icio.us
Google Bookmarks
Yahoo Bookmarks
Share on Facebook
Blog This!
Kiff
Registered User
Posts: 2
(3/2/06 6:54 pm)
Reply
Nodecay on spawners?
Does Worldbuilder make spawners (or I suppose uox3) make spawners not decay?
It seems my spawns have decayed.... or was it that I put # of animals to spawnto 2 then they dissapear after spawning 2? I'm very sad ... well I'll get over it I suppose but I'm somewhat sad
I was using the preview version ... .23 I believe
Xuri Dabur
ezOP
Posts: 87
(3/3/06 10:07 am)
Reply
Re: Nodecay on spawners?
Since WB sends the 'ADD 0x#### command to the client window, it would have to be UOX3, yes. If you're using a beta version of the next UOX3 release, there's chance that you don't have the updated add.js file which deals with the 'ADD command.
Because a change in the source code makes all new items added decayable by default, parts of the add command needs to be edited to make them NOT decayable, specifically the items added using 'ADD 0x#### since the other items ('ADD ITEM #) have a decay-tag in the DFNs set to either true or false).
So make sure you get the updated add.js from the UOX3 CVS, or change the onCallback1() function in the file you have already to this:
function onCallback1( socket, ourObj )
{
        var mChar = socket.currentChar;
        if( mChar )
        {
                var itemID         = socket.tempint;
                var StrangeByte = socket.GetWord( 1 );
                if( StrangeByte == 0 && ourObj.isChar )
                { //If target is a character, add item to backpack
                        var backpack = ourObj.FindItemLayer(21);
                        if( backpack != null )
                                var newItem = CreateBlankItem( socket, mChar, 1, "#", itemID, 0, "ITEM", true );
                        else
                                mChar.SysMessage( "That character has no backpack, no item added" );
                }
                else
                {
                        var x                 = socket.GetWord( 11 );
                        var y                 = socket.GetWord( 13 );
                        var z                 = socket.GetByte( 16 ) + GetTileHeight( socket.GetWord( 17 ) );
                        var newItem = CreateBlankItem( socket, mChar, 1, "#", itemID, 0, "ITEM", false );
                        newItem.SetLocation( x, y, z );
                }
                if( newItem )
                        newItem.decayable = false;
                if( newItem.id != itemID )
                { //If itemid of newly created item differs from specified id, delete item - it's a default one only
                        mChar.SysMessage( "Specified item-ID does not exist." );
                        mChar.SysMessage( "Hex: 0x"+itemID.toString(16)+ " Dec: " + itemID );
                        newItem.Delete();
                }
        }
}
-=- Ho eyo he Hum -=-
Kiff
Registered User
Posts: 3
(3/3/06 12:07 pm)
Reply
Re: Nodecay on spawners?
Thanks a bundle...I changed the JS stuff...I suppose time will tell whether I did it right. That amount of time being however long it takes something to decay
Kiff
Registered User
Posts: 4
(3/3/06 12:37 pm)
Reply
Re: Nodecay on spawners?
Didn't exactly work per se... I figure I'll just make a macro for 'nodecay ... since there are 9 steps already one more won't kill me
Xuri Dabur
ezOP
Posts: 89
(3/3/06 6:18 pm)
Reply
Re: Nodecay on spawners?
Doh, my fault. Replace onCallback3 and onCallback4 (the functions for adding spawners, not just normal items!) with the following code:
function onCallback3( socket, ourObj )
{
        var mChar = socket.currentChar;
        if( mChar )
        {
                var x                 = socket.GetWord( 11 );
                var y                 = socket.GetWord( 13 );
                var z                 = socket.GetByte( 16 ) + GetTileHeight( socket.GetWord( 17 ) );
                var itemID         = socket.tempint;
                var newItem         = CreateBlankItem( socket, mChar, 1, "#", itemID, 0, "SPAWNER", false );
                if( newItem )
                {
                        newItem.SetLocation( x, y, z );
                        newItem.decayable = false;
                }
                if( newItem.id != itemID )
                { //If itemid of newly created item differs from specified id, delete item - it's a default one only
                        mChar.SysMessage( "Specified item-ID does not exist." );
                        mChar.SysMessage( "Hex: 0x"+itemID.toString(16)+ " Dec: " + itemID );
                        newItem.Delete();
                }                       
        }
}
function onCallback4( socket, ourObj )
{
        var mChar = socket.currentChar;
        if( mChar )
        {
                var x                 = socket.GetWord( 11 );
                var y                 = socket.GetWord( 13 );
                var z                 = socket.GetByte( 16 ) + GetTileHeight( socket.GetWord( 17 ) );
                var iSection         = socket.xText;
                var newItem         = CreateDFNItem( socket, mChar, iSection, 1, "SPAWNER", false );
                if( newItem )
                {
                        newItem.SetLocation( x, y, z );
                        newItem.decayable = false;
                }
                else
                        mChar.SysMessage( "Item-section not found in DFNs: "+iSection );                       
        }
}
-=- Ho eyo he Hum -=-
Kiff
Registered User
Posts: 5
(3/4/06 1:46 pm)
Reply
Re: Nodecay on spawners?
Hehe no problem. I snagged the most recent CVS, and even though 'tweak says they are still dacay=1, I sat there and watched a pillow for like 20 minutes and it didn't go anywhere
Thanks a bunch
-Kiff
Kiff
Registered User
Posts: 6
(3/4/06 7:11 pm)
Reply
Re: Nodecay on spawners?
Foot in Mouth... They still decay on the newest CVS... perhaps I'll do your changes after all