dragon slayer -  22-07-2012 02:54
Kod:
var enableUOX= 0;
var enableT2A= 1;

function onUseChecked( pUser, iUsed )
{
    var socket = pUser.socket;
    if( socket && iUsed && iUsed.isItem )
    {
                iUsed.health -= 1;
                if(iUsed.health == 0)
                {
                  iUsed.Delete();
                  pUser.SysMessage( "You have worn out your tool!" );
              return false;
                }
                else
          socket.tempObj = iUsed;
          var targMsg = GetDictionaryEntry( 484, socket.Language );
          socket.CustomTarget( 1, targMsg );
    }
    return false;
}

function onCallback1( socket, ourObj )
{
    var bItem = socket.tempObj;
    var mChar = socket.currentChar;

    socket.tempObj = null;

    if( mChar && mChar.isChar && bItem && bItem.isItem )
    {
        if( !ourObj || !ourObj.isItem )
        {
            socket.SysMessage( GetDictionaryEntry( 942, socket.Language ) );
            return;
        }

        var resID = ourObj.id;
        if( resID == 0x1BEF || resID == 0x1BF2 || resID == 0x1BDD || resID == 0x1BE0 )  // A valid tinker resource
        {
            var ownerObj = GetPackOwner( ourObj, 0 );
            if( ownerObj && mChar.serial == ownerObj.serial )
                        {
                           
                           if( enableUOX == 1 )
                           {
                              if( resID != 0x1BDD && resID != 0x1BE0 )
                     socket.MakeMenu( 59, 37 );
                  else
                socket.SysMessage( GetDictionaryEntry( 941, socket.Language ) );
                           }
                           if( enableT2A == 1 )
                           {
                              if( resID != 0x1BDD && resID != 0x1BE0 )
                              {
                                  var ret=MainGump(socket, mChar);
                              }
                              else
                     socket.SysMessage( GetDictionaryEntry( 941, socket.Language ) );
                           }
                        }
            else
                socket.SysMessage( GetDictionaryEntry( 775, socket.Language ) );
        }
        else
            socket.SysMessage( "You can't make anything from that material." );
    }
}

function MainGump(socket, pUser)
{
         var TinkerGump = new Gump; // create a new gump

         TinkerGump.AddPage(0);
         TinkerGump.AddBackground( 25, 0, 500, 400, 0x0a28 );
         TinkerGump.AddBackground( 45, 60, 450, 25, 0x13ec );
         TinkerGump.AddBackground( 45, 330, 450, 25, 0x13ec );
         TinkerGump.AddText( 150, 25, 995, "TINKER SELECTION MENU" );
         TinkerGump.AddText( 125, 360, 995, "Make Last" );
         TinkerGump.AddButton( 100, 364, 0x3, 1, 0, 2 );
         TinkerGump.AddButton( 340, 358, 0xf1, 1, 0, 0 );
         TinkerGump.AddButton( 410, 358, 0xf7, 1, 0, 1 );
         TinkerGump.AddText( 70, 60, 0, "Traps" );
         TinkerGump.AddButton( 120, 63, 0x1459, 0, 2, 0 );
         TinkerGump.AddText( 170, 60, 0, "Tools" );
         TinkerGump.AddButton( 220, 63, 0x1459, 0, 1, 0 );
         TinkerGump.AddText( 270, 60, 0, "Parts" );
         TinkerGump.AddButton( 315, 63, 0x1459, 0, 3, 0 );
         TinkerGump.AddText( 370, 60, 0, "Utensils" );
         TinkerGump.AddButton( 440, 63, 0x1459, 0, 7, 0 );
         TinkerGump.AddText( 65, 330, 0, "Jewelry" );
         TinkerGump.AddButton( 125, 333, 0x1459, 0, 4, 0 );
         TinkerGump.AddText( 180, 330, 0, "Miscellaneous" );
         TinkerGump.AddButton( 280, 333, 0x1459, 0, 5, 0 );
         TinkerGump.AddText( 320, 330, 0, "More Tools" );
         TinkerGump.AddButton( 410, 333, 0x1459, 0, 6, 0 );

         TinkerGump.AddPage(1);
         TinkerGump.AddText( 70, 95, 995, "scissors" );
         TinkerGump.AddRadio( 130, 120, 0xd2, 0, 3998 );
         TinkerGump.AddPicture( 85, 120, 3998 );
         TinkerGump.AddText( 70, 175, 995, "tinker's tools" );
         TinkerGump.AddRadio( 130, 205, 0xd2, 0, 7865 );
         TinkerGump.AddPicture( 90, 200, 7865 );
         TinkerGump.AddText( 70, 255, 995, "sewing kit" );
         TinkerGump.AddRadio( 130, 280, 0xd2, 0, 3997 );
         TinkerGump.AddPicture( 75, 280, 3997 );
         TinkerGump.AddText( 210, 95, 995, "mortar & pestle" );
         TinkerGump.AddRadio( 270, 120, 0xd2, 0, 3739 );
         TinkerGump.AddPicture( 220, 120, 3739 );
         TinkerGump.AddText( 230, 175, 995, "hatchet" );
         TinkerGump.AddRadio( 270, 205, 0xd2, 0, 3907 );
         TinkerGump.AddPicture( 220, 205, 3907 );
         TinkerGump.AddText( 230, 255, 995, "saw" );
         TinkerGump.AddRadio( 270, 280, 0xd2, 0, 4148 );
         TinkerGump.AddPicture( 230, 280, 4148 );
         TinkerGump.AddText( 370, 95, 995, "scorp" );
         TinkerGump.AddRadio( 405, 120, 0xd2, 0, 4327 );
         TinkerGump.AddPicture( 360, 120, 4327 );
         TinkerGump.AddText( 360, 175, 995, "draw knife" );
         TinkerGump.AddRadio( 405, 205, 0xd2, 0, 4324 );
         TinkerGump.AddPicture( 360, 205, 4324 );
         TinkerGump.AddText( 360, 255, 995, "dovetail saw" );
         TinkerGump.AddRadio( 405, 280, 0xd2, 0, 4136 );
         TinkerGump.AddPicture( 360, 280, 4136 );

         TinkerGump.AddPage(2);
         TinkerGump.AddText( 100, 120, 995, "Dart Trap" );
         TinkerGump.AddRadio( 145, 150, 0xd2, 0, 7164 );
         TinkerGump.AddPicture( 100, 140, 0x1bfc );
         TinkerGump.AddText( 100, 220, 995, "Explosion Trap" );
         TinkerGump.AddRadio( 145, 250, 0xd2, 0, 14092 );
         TinkerGump.AddPicture( 85, 145, 14092 );
         TinkerGump.AddText( 275, 120, 995, "Poison Trap" );
         TinkerGump.AddRadio( 340, 150, 0xd2,0, 4414 );
         TinkerGump.AddPicture( 280, 140, 4414 );

         TinkerGump.AddPage(3);
         TinkerGump.AddText( 70, 95, 995, "gears" );
         TinkerGump.AddRadio( 130, 120, 0xd2, 0, 4179 );
         TinkerGump.AddPicture( 80, 115, 4179 );
         TinkerGump.AddText( 70, 175, 995, "springs" );
         TinkerGump.AddRadio( 130, 205, 0xd2, 0, 4189 );
         TinkerGump.AddPicture( 70, 205, 4189 );
         TinkerGump.AddText( 230, 95, 995, "clock parts" );
         TinkerGump.AddRadio( 270, 120, 0xd2, 0, 4175 );
         TinkerGump.AddPicture( 225, 120, 4175 );
         TinkerGump.AddText( 70, 255, 995, "hinge" );
         TinkerGump.AddRadio( 130, 280, 0xd2, 0, 4181 );
         TinkerGump.AddPicture( 75, 280, 4181 );
         TinkerGump.AddText( 230, 175, 995, "sextant parts" );
         TinkerGump.AddRadio( 270, 205, 0xd2, 0, 4185 );
         TinkerGump.AddPicture( 220, 205, 4185 );
         TinkerGump.AddText( 360, 95, 995, "keg tap" );
         TinkerGump.AddRadio( 405, 120, 0xd2, 0, 4100 );
         TinkerGump.AddPicture( 355, 120, 4100 );
         TinkerGump.AddText( 360, 175, 995, "barrel hoops" );
         TinkerGump.AddRadio( 405, 205, 0xd2, 0, 4321 );
         TinkerGump.AddPicture( 360, 205, 4321 );

         TinkerGump.AddPage(4);
         TinkerGump.AddText( 70, 95, 995, "ring" );
         TinkerGump.AddRadio( 130, 120, 0xd2, 0, 4234 );
         TinkerGump.AddPicture( 70, 120, 4234 );
         TinkerGump.AddText( 70, 175, 995, "earrings" );
         TinkerGump.AddRadio( 130, 205, 0xd2, 0, 4231 );
         TinkerGump.AddPicture( 70, 205, 4231 );
         TinkerGump.AddText( 230, 95, 995, "necklace" );
         TinkerGump.AddRadio( 270, 120, 0xd2, 0, 4233 );
         TinkerGump.AddPicture( 230, 120, 4233 );
         TinkerGump.AddText( 230, 175, 995, "necklace" );
         TinkerGump.AddRadio( 270, 205, 0xd2, 0, 4232 );
         TinkerGump.AddPicture( 220, 205, 4232 );
         TinkerGump.AddText( 360, 95, 995, "necklace" );
         TinkerGump.AddRadio( 405, 120, 0xd2, 0, 4229 );
         TinkerGump.AddPicture( 355, 120, 4229 );
         TinkerGump.AddText( 360, 175, 995, "bracelet" );
         TinkerGump.AddRadio( 405, 205, 0xd2, 0, 4230 );
         TinkerGump.AddPicture( 360, 205, 4230 );

         TinkerGump.AddPage(5);
         TinkerGump.AddText( 70, 95, 995, "keyring" );
         TinkerGump.AddRadio( 130, 120, 0xd2, 0, 4113 );
         TinkerGump.AddPicture( 80, 120, 4113 );
         TinkerGump.AddText( 70, 175, 995, "iron key" );
         TinkerGump.AddRadio( 130, 205, 0xd2, 0, 4112 );
         TinkerGump.AddPicture( 70, 205, 4112 );
         TinkerGump.AddText( 70, 255, 995, "lantern" );
         TinkerGump.AddRadio( 130, 280, 0xd2, 0, 2597 );
         TinkerGump.AddPicture( 75, 280, 2597 );
         TinkerGump.AddText( 230, 95, 995, "candelabra" );
         TinkerGump.AddRadio( 270, 120, 0xd2, 0, 2599 );
         TinkerGump.AddPicture( 215, 120, 2599 );
         TinkerGump.AddText( 230, 175, 995, "globe" );
         TinkerGump.AddRadio( 270, 205, 0xd2, 0, 4167 );
         TinkerGump.AddPicture( 220, 195, 4167 );
         TinkerGump.AddText( 230, 255, 995, "heating stand" );
         TinkerGump.AddRadio( 270, 280, 0xd2, 0, 6217 );
         TinkerGump.AddPicture( 220, 280, 6217 );
         TinkerGump.AddText( 360, 95, 995, "scales" );
         TinkerGump.AddRadio( 405, 120, 0xd2, 0, 6225 );
         TinkerGump.AddPicture( 355, 120, 6225 );
         TinkerGump.AddText( 360, 175, 995, "spy glass" );
         TinkerGump.AddRadio( 405, 205, 0xd2, 0, 5365 );
         TinkerGump.AddPicture( 360, 205, 5365 );

         TinkerGump.AddPage(6);
         TinkerGump.AddText( 70, 95, 995, "froe" );
         TinkerGump.AddRadio( 130, 120, 0xd2, 0, 4325 );
         TinkerGump.AddPicture( 80, 120, 4325 );
         TinkerGump.AddText( 70, 175, 995, "hammer" );
         TinkerGump.AddRadio( 130, 205, 0xd2, 0, 4138 );
         TinkerGump.AddPicture( 70, 205, 4138 );
         TinkerGump.AddText( 70, 255, 995, "inshave" );
         TinkerGump.AddRadio( 130, 280, 0xd2, 0, 4326 );
         TinkerGump.AddPicture( 75, 280, 4326 );
         TinkerGump.AddText( 230, 95, 995, "tongs" );
         TinkerGump.AddRadio( 270, 120, 0xd2, 0, 4028 );
         TinkerGump.AddPicture( 225, 120, 4028 );
         TinkerGump.AddText( 230, 175, 995, "smith's hammer" );
         TinkerGump.AddRadio( 270, 205, 0xd2, 0, 5091 );
         TinkerGump.AddPicture( 220, 205, 5091 );
         TinkerGump.AddText( 230, 255, 995, "pickaxe" );
         TinkerGump.AddRadio( 270, 280, 0xd2, 0, 3718 );
         TinkerGump.AddPicture( 220, 280, 3718 );
         TinkerGump.AddText( 360, 95, 995, "shovel" );
         TinkerGump.AddRadio( 405, 120, 0xd2, 0, 3898 );
         TinkerGump.AddPicture( 300, 120, 3898 );
         TinkerGump.AddText( 360, 175, 995, "sledge hammer" );
         TinkerGump.AddRadio( 405, 205, 0xd2, 0, 4021 );
         TinkerGump.AddPicture( 360, 205, 4021 );
         TinkerGump.AddText( 360, 255, 995, "lockpick" );
         TinkerGump.AddRadio( 405, 280, 0xd2, 0, 5371 );
         TinkerGump.AddPicture( 360, 290, 5371 );

         TinkerGump.AddPage(7);
         TinkerGump.AddText( 70, 95, 995, "butcher knife" );
         TinkerGump.AddRadio( 130, 120, 0xd2, 0, 5110 );
         TinkerGump.AddPicture( 75, 120, 5110 );
         TinkerGump.AddText( 70, 175, 995, "skinning knife" );
         TinkerGump.AddRadio( 130, 205, 0xd2, 0, 3781 );
         TinkerGump.AddPicture( 70, 205, 3781 );
         TinkerGump.AddText( 70, 255, 995, "cleaver" );
         TinkerGump.AddRadio( 130, 280, 0xd2, 0, 3778 );
         TinkerGump.AddPicture( 75, 280, 3778 );
         TinkerGump.AddText( 230, 95, 995, "spoons" );
         TinkerGump.AddRadio( 270, 120, 0xd2, 0, 2552 );
         TinkerGump.AddPicture( 250, 120, 2552 );
         TinkerGump.AddRadio( 215, 120, 0xd2, 0, 2553 );
         TinkerGump.AddPicture( 210, 120, 2553 );
         TinkerGump.AddText( 230, 175, 995, "forks" );
         TinkerGump.AddRadio( 270, 205, 0xd2, 0, 2548 );
         TinkerGump.AddPicture( 235, 205, 2548 );
         TinkerGump.AddRadio( 215, 205, 0xd2, 0, 2549 );
         TinkerGump.AddPicture( 220, 205, 2549 );
         TinkerGump.AddText( 230, 255, 995, "knives" );
         TinkerGump.AddRadio( 270, 280, 0xd2, 0, 2550 );
         TinkerGump.AddPicture( 245, 280, 2550 );
         TinkerGump.AddRadio( 215, 280, 0xd2, 0, 2551 );
         TinkerGump.AddPicture( 215, 280, 2551 );
         TinkerGump.AddText( 360, 95, 995, "plate" );
         TinkerGump.AddRadio( 405, 120, 0xd2, 0, 2519 );
         TinkerGump.AddPicture( 360, 120, 2519 );
         TinkerGump.AddText( 360, 175, 995, "goblet" );
         TinkerGump.AddRadio( 405, 205, 0xd2, 0, 2507 );
         TinkerGump.AddPicture( 360, 205, 2507 );
         TinkerGump.AddText( 360, 255, 995, "pewter mug" );
         TinkerGump.AddRadio( 405, 280, 0xd2, 0, 4097 );
         TinkerGump.AddPicture( 360, 280, 4097 );
         TinkerGump.Send( pUser );
         TinkerGump.Free();
         return false;
}

function onGumpPress( pSock, pButton, gumpData )
{
    var pUser = pSock.currentChar;
    switch(pButton)
    {
        case 0:
            // abort and do nothing
            break;
        case 1:
                        var OtherButton = gumpData.getButton(0);
            switch( OtherButton )
            {
                case 3998:
                                        MakeItem( pSock, pUser, 210 );
                                        var ret=MainGump(pSock, pUser);
                                        break;//scissors
                case 7865:
                                        MakeItem( pSock, pUser, 213 );
                                        var ret=MainGump(pSock, pUser);
                            break;//tinker's tools
                case 3997:
                                        MakeItem( pSock, pUser, 216 );
                                        var ret=MainGump(pSock, pUser);
                            break;//sewing kit
                case 3739:
                                        MakeItem( pSock, pUser, 211 );
                                        var ret=MainGump(pSock, pUser);
                            break;//mortar & pestle
                case 3907:
                                        MakeItem( pSock, pUser, 214 );
                                        var ret=MainGump(pSock, pUser);
                            break;//hatchet
                case 4148:
                                        MakeItem( pSock, pUser, 217 );
                                        var ret=MainGump(pSock, pUser);
                            break;//saw
                case 4327:
                                        MakeItem( pSock, pUser, 212 );
                                        var ret=MainGump(pSock, pUser);
                            break;//scorp
                case 4324:
                                        MakeItem( pSock, pUser, 215 );
                                        var ret=MainGump(pSock, pUser);
                            break;//draw knife
                case 4136:
                                        MakeItem( pSock, pUser, 218 );
                                        var ret=MainGump(pSock, pUser);
                            break;//dovetail saw
                case 4179:
                                        MakeItem( pSock, pUser, 219 );
                                        var ret=MainGump(pSock, pUser);
                            break;//gears
                case 4189:
                                        MakeItem( pSock, pUser, 222 );
                                        var ret=MainGump(pSock, pUser);
                            break;//springs
                case 4175:
                                        MakeItem( pSock, pUser, 220 );
                                        var ret=MainGump(pSock, pUser);
                            break;//clock parts
                case 4181:
                                        MakeItem( pSock, pUser, 225 );
                                        var ret=MainGump(pSock, pUser);
                            break;//hinge
                case 4185:
                                        MakeItem( pSock, pUser, 223 );
                                        var ret=MainGump(pSock, pUser);
                            break;//sextant parts
                case 4100:
                                        MakeItem( pSock, pUser, 221 );
                                        var ret=MainGump(pSock, pUser);
                            break;//keg tap
                case 4321:
                                        MakeItem( pSock, pUser, 224 );
                                        var ret=MainGump(pSock, pUser);
                            break;//barrel hoops
                case 4234:
                                        MakeItem( pSock, pUser, 238 );
                                        var ret=MainGump(pSock, pUser);
                            break;//ring
                case 4231:
                                        MakeItem( pSock, pUser, 241 );
                                        var ret=MainGump(pSock, pUser);
                            break;//earrings
                case 4233:
                                        MakeItem( pSock, pUser, 239 );
                                        var ret=MainGump(pSock, pUser);
                            break;//necklace
                case 4232:
                                        MakeItem( pSock, pUser, 240 );
                                        var ret=MainGump(pSock, pUser);
                            break;//necklace
                case 4229:
                                        MakeItem( pSock, pUser, 242 );
                                        var ret=MainGump(pSock, pUser);
                            break;//necklace
                case 4230:
                                        MakeItem( pSock, pUser, 243 );
                                        var ret=MainGump(pSock, pUser);
                            break;//bracelet
                case 4113:
                                        MakeItem( pSock, pUser, 244 );
                                        var ret=MainGump(pSock, pUser);
                            break;//keyring
                case 4112:
                                        MakeItem( pSock, pUser, 247 );
                                        var ret=MainGump(pSock, pUser);
                            break;//iron key
                case 2597:
                                        MakeItem( pSock, pUser, 250 );
                                        var ret=MainGump(pSock, pUser);
                            break;//lantern
                case 2599:
                                        MakeItem( pSock, pUser, 245 );
                                        var ret=MainGump(pSock, pUser);
                            break;//candelabra
                case 4167:
                                        MakeItem( pSock, pUser, 248 );
                                        var ret=MainGump(pSock, pUser);
                            break;//globe
                case 6217:
                                        MakeItem( pSock, pUser, 251 );
                                        var ret=MainGump(pSock, pUser);
                            break;//heating stand
                case 6225:
                                        MakeItem( pSock, pUser, 246 );
                                        var ret=MainGump(pSock, pUser);
                            break;//scales
                case 5365:
                                        MakeItem( pSock, pUser, 249 );
                                        var ret=MainGump(pSock, pUser);
                            break;//spy glass
                case 4325:
                                        MakeItem( pSock, pUser, 252 );
                                        var ret=MainGump(pSock, pUser);
                            break;//froe
                case 4138:
                                        MakeItem( pSock, pUser, 255 );
                                        var ret=MainGump(pSock, pUser);
                            break;//hammer
                case 4326:
                                        MakeItem( pSock, pUser, 258 );
                                        var ret=MainGump(pSock, pUser);
                            break;//inshave
                case 4028:
                                        MakeItem( pSock, pUser, 253 );
                                        var ret=MainGump(pSock, pUser);
                            break;//tongs
                case 5091:
                                        MakeItem( pSock, pUser, 256 );
                                        var ret=MainGump(pSock, pUser);
                            break;//smiths hammer
                case 3718:
                                        MakeItem( pSock, pUser, 259 );
                                        var ret=MainGump(pSock, pUser);
                            break;//pickaxe
                case 3898:
                                        MakeItem( pSock, pUser, 254 );
                                        var ret=MainGump(pSock, pUser);
                            break;//shovel
                case 4021:
                                        MakeItem( pSock, pUser, 257 );
                                        var ret=MainGump(pSock, pUser);
                            break;//sledge hammer
                case 5371:
                                        MakeItem( pSock, pUser, 260 );
                                        var ret=MainGump(pSock, pUser);
                            break;//lockpick
                case 5110:
                                        MakeItem( pSock, pUser, 226 );
                                        var ret=MainGump(pSock, pUser);
                            break;//butcher knife
                case 3781:
                                        MakeItem( pSock, pUser, 237 );
                                        var ret=MainGump(pSock, pUser);
                            break;//skinning knife
                case 3778:
                                        MakeItem( pSock, pUser, 232 );
                                        var ret=MainGump(pSock, pUser);
                            break;//cleaver
                case 2552:
                                        MakeItem( pSock, pUser, 228 );
                                        var ret=MainGump(pSock, pUser);
                            break;//spoons
                case 2553:
                                        MakeItem( pSock, pUser, 227 );
                                        var ret=MainGump(pSock, pUser);
                            break;//spoons
                case 2548:
                                        MakeItem( pSock, pUser, 230 );
                                        var ret=MainGump(pSock, pUser);
                            break;//forks
                case 2549:
                                        MakeItem( pSock, pUser, 231 );
                                        var ret=MainGump(pSock, pUser);
                            break;//forks
                case 2550:
                                        MakeItem( pSock, pUser, 233 );
                                        var ret=MainGump(pSock, pUser);
                            break;//knives
                case 2551:
                                        MakeItem( pSock, pUser, 234 );
                                        var ret=MainGump(pSock, pUser);
                            break;//knives
                case 2519:
                                        MakeItem( pSock, pUser, 229 );
                                        var ret=MainGump(pSock, pUser);
                            break;//plate
                case 2507:
                                        MakeItem( pSock, pUser, 235 );
                                        var ret=MainGump(pSock, pUser);
                            break;//goblet
                case 4097:
                                        MakeItem( pSock, pUser, 236 );
                                        var ret=MainGump(pSock, pUser);
                            break;//pewter mug
                case 7164:
                    MakeItem( pSock, pUser, 261 );
                                        var ret=MainGump(pSock, pUser);
                    break;//Dart Trap
                case 14092:
                    MakeItem( pSock, pUser, 263 );
                                        var ret=MainGump(pSock, pUser);
                    break;//Explosion Trap
                case 4414:
                    MakeItem( pSock, pUser, 262 );
                                        var ret=MainGump(pSock, pUser);
                    break;//Poison Trap
            }
            break;
    }
}

YORUMLAR (0)

Henüz yorum yapılmamış.

BENZER SAYFALAR