Season changing Commands

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

Season changing Commands

Post by dragon slayer »

Thanks to xuri packet guide i was able to come up with a season changing commands
function CommandRegistration()
{
    RegisterCommand( "spring", 1, true );
    RegisterCommand( "summer", 1, true );
    RegisterCommand( "fall", 1, true );
    RegisterCommand( "winter", 1, true );
    RegisterCommand( "desolation", 1, true );
}

function command_SPRING( socket, cmdString )
{
    //var socket = pUser.socket;
    // Notes
    // Season flags:
    // 0x00 = Spring
    // 0x01 = Summer
    // 0x02 = Fall
    // 0x03 = Winter
    // 0x04 = Desolation
   
    var myPacket = new Packet; // Create new packet stream
    myPacket.ReserveSize( 3 ); // Reserve packet size of 3, which is optimal for packet 0xBC in this case
    myPacket.WriteByte( 0, 0xBC ); // Write packetID (0xBC) at position 0
    myPacket.WriteByte( 1, 0x00 ); // Write Season flag at position 1 (0+WriteByte, or 0+1)
    myPacket.WriteByte( 2, 0x01 ); // Write PlayMusic (0x00 = no, 0x01 = yes - doesn't seem to work) at position 2 (1+WriteByte, or 0+1)
    socket.Send( myPacket );
    myPacket.Free();
    return false;
}

function command_SUMMER( socket, cmdString )
{
    //var socket = pUser.socket;
    // Notes
    // Season flags:
    // 0x00 = Spring
    // 0x01 = Summer
    // 0x02 = Fall
    // 0x03 = Winter
    // 0x04 = Desolation
   
    var myPacket = new Packet; // Create new packet stream
    myPacket.ReserveSize( 3 ); // Reserve packet size of 3, which is optimal for packet 0xBC in this case
    myPacket.WriteByte( 0, 0xBC ); // Write packetID (0xBC) at position 0
    myPacket.WriteByte( 1, 0x01 ); // Write Season flag at position 1 (0+WriteByte, or 0+1)
    myPacket.WriteByte( 2, 0x01 ); // Write PlayMusic (0x00 = no, 0x01 = yes - doesn't seem to work) at position 2 (1+WriteByte, or 0+1)
    socket.Send( myPacket );
    myPacket.Free();
    return false;
}

function command_FALL( socket, cmdString )
{
    //var socket = pUser.socket;
    // Notes
    // Season flags:
    // 0x00 = Spring
    // 0x01 = Summer
    // 0x02 = Fall
    // 0x03 = Winter
    // 0x04 = Desolation
   
    var myPacket = new Packet; // Create new packet stream
    myPacket.ReserveSize( 3 ); // Reserve packet size of 3, which is optimal for packet 0xBC in this case
    myPacket.WriteByte( 0, 0xBC ); // Write packetID (0xBC) at position 0
    myPacket.WriteByte( 1, 0x02 ); // Write Season flag at position 1 (0+WriteByte, or 0+1)
    myPacket.WriteByte( 2, 0x01 ); // Write PlayMusic (0x00 = no, 0x01 = yes - doesn't seem to work) at position 2 (1+WriteByte, or 0+1)
    socket.Send( myPacket );
    myPacket.Free();
    return false;
}

function command_WINTER( socket, cmdString )
{
    //var socket = pUser.socket;
    // Notes
    // Season flags:
    // 0x00 = Spring
    // 0x01 = Summer
    // 0x02 = Fall
    // 0x03 = Winter
    // 0x04 = Desolation
   
    var myPacket = new Packet; // Create new packet stream
    myPacket.ReserveSize( 3 ); // Reserve packet size of 3, which is optimal for packet 0xBC in this case
    myPacket.WriteByte( 0, 0xBC ); // Write packetID (0xBC) at position 0
    myPacket.WriteByte( 1, 0x03 ); // Write Season flag at position 1 (0+WriteByte, or 0+1)
    myPacket.WriteByte( 2, 0x01 ); // Write PlayMusic (0x00 = no, 0x01 = yes - doesn't seem to work) at position 2 (1+WriteByte, or 0+1)
    socket.Send( myPacket );
    myPacket.Free();
    return false;
}

function command_DESOLATION( socket, cmdString )
{
    //var socket = pUser.socket;
    // Notes
    // Season flags:
    // 0x00 = Spring
    // 0x01 = Summer
    // 0x02 = Fall
    // 0x03 = Winter
    // 0x04 = Desolation
   
    var myPacket = new Packet; // Create new packet stream
    myPacket.ReserveSize( 3 ); // Reserve packet size of 3, which is optimal for packet 0xBC in this case
    myPacket.WriteByte( 0, 0xBC ); // Write packetID (0xBC) at position 0
    myPacket.WriteByte( 1, 0x04 ); // Write Season flag at position 1 (0+WriteByte, or 0+1)
    myPacket.WriteByte( 2, 0x01 ); // Write PlayMusic (0x00 = no, 0x01 = yes - doesn't seem to work) at position 2 (1+WriteByte, or 0+1)
    socket.Send( myPacket );
    myPacket.Free();
    return false;
}
Post Reply