Thread: [NEW] Basic Loans System!

Page 1 of 6 123 ... LastLast
Results 1 to 10 of 55
  1. #1 [NEW] Basic Loans System! 
    Professional Upsetter


    Join Date
    Jul 2006
    Posts
    5,392
    Thanks given
    163
    Thanks received
    447
    Rep Power
    2040
    Description: Hey everyone, I thought I should release this basic version of Bank Loaning, of course its only a command version right now, but you guys aren't dumb enough not to add it to bank booths etc. I think this is a great Idea for all servers, it can smack the face of all those "starter" command ideas. Enjoy! Btw, if this is posted anywhere else except ********.net, it is leeched.

    Difficulty: 4/10

    Assumed Knowledge: Copy & Paste/Delete abilities, basic Java Knowledge.

    Tested Server: MiniCraft v1.4

    Files/Classes Modified: Client.java, Loans.java ( Attached )!

    Picture:



    Procedure
    Step 1:

    Visit the following link and download the .java file, once done, add it to your source files and continue on with the next step.

    Download link: [Only registered and activated users can see links. ]

    Step 2:

    So, we start off inside of client.java, open it up and these commands with your others. ( customCommand method )

    Code:
    //Loans System!   -   Inside Sin
    	else if (command.equalsIgnoreCase("takeoutloan"))
    	{
    	sendMessage("Do you want to take out a loan of gold coins?");
    	NpcDialogue = 1;
    	}
    	else if (command.startsWith("deposit"))
    	{
    		try {
    			int amount = Integer.parseInt(command.substring(8));
    			server.Loans.DepositGold(amount, this);
    		} catch(Exception e) {
    			sendMessage("< Error > - Try typing:   ::deposit #");
    		}
    	}
    	else if (command.equalsIgnoreCase("checkloan"))
    	{
    	server.Loans.CheckLoan(this);
    	}
    	//End Loans System..
    Proceed...

    Step 3:

    Now, once done that, search for:

    Code:
    SendWeapon((playerEquipment[playerWeapon]), GetItemName(playerEquipment[playerWeapon]));
    You should see the starting messages and so forth there, add the following under there:

    Code:
    if(server.Loans.SpendCycle == 1) {
    server.Loans.OweBackAmount += (server.Loans.LoanAverage / 25);
    }
    Proceed...

    Step 4:

    Now, search the following:

    Code:
    public void UpdateNPCChat()
    Add the following dialogue:

    Code:
    case 1: //Change to a non-used case.
            sendFrame171(1, 2465);
            sendFrame171(0, 2468);
            sendFrame126("Would you like to loan out some money?", 2460);
            sendFrame126("Yes, 5,000 Gold Coins", 2461);
            sendFrame126("Yes, 15,000 Gold Coins", 2462);
            sendFrame164(2459);
            NpcDialogueSend = true;
            break;
    Proceed..

    Step 5:

    Now search for:

    Code:
    case 9157:
    Add this option dialogue there:

    Code:
    else if(NpcDialogue == 1) { // Loan Option One
    					server.Loans.LoanGold(5000, this);
    					NpcDialogue = 0;
    					RemoveAllWindows();
                      }
    Now scroll down a bit until you see "case 9158:", add this:

    Code:
    else if(NpcDialogue == 1) { // Loan Option Two
    					server.Loans.LoanGold(15000, this);
    					NpcDialogue = 0;
    					RemoveAllWindows();
                      }
    Proceed...

    Step 6:

    Okay, now for the tricky part?

    Search for:

    Code:
    } else if (token.equals("character-lastlogintime")) {
    						    lastlogintime = Integer.parseInt(token2);
    Add this underneath that:

    Code:
    } else if (token.equals("character-OweBackAmount")) {
    						    server.Loans.OweBackAmount = Integer.parseInt(token2);
    						} else if (token.equals("character-LoanAverage")) {
    						    server.Loans.LoanAverage = Integer.parseInt(token2);
    						} else if (token.equals("character-SpendCycle")) {
    						    server.Loans.SpendCycle = Integer.parseInt(token2);
    Now find:

    Code:
    characterfile.write("character-lastlogintime = ", 0, 26);
    			characterfile.write(Integer.toString(playerLastLogin), 0, Integer.toString(playerLastLogin).length());
    			characterfile.newLine();
    Add these snipets underneath that code:

    Code:
    characterfile.write("character-OweBackAmount = ", 0, 26);
    			characterfile.write(Integer.toString(server.Loans.OweBackAmount), 0, Integer.toString(server.Loans.OweBackAmount).length());
    			characterfile.newLine();
    			characterfile.write("character-LoanAverage = ", 0, 24);
    			characterfile.write(Integer.toString(server.Loans.LoanAverage), 0, Integer.toString(server.Loans.LoanAverage).length());
    			characterfile.newLine();
    			characterfile.write("character-SpendCycle = ", 0, 23);
    			characterfile.write(Integer.toString(server.Loans.SpendCycle), 0, Integer.toString(server.Loans.SpendCycle).length());
    			characterfile.newLine();
    Step 7:

    Wallaa, your done

    Please report any bugs to me

    Credits: 100% Made By Inside Sin
    Last edited by Inside Sin; 10-12-2008 at 02:03 PM. Reason: Updated Link.
    Ex-super moderator of Rune-Server.org and RSBot.org
     

  2. #2  
    Old School Member

    Join Date
    Feb 2008
    Age
    26
    Posts
    2,163
    Thanks given
    372
    Thanks received
    40
    Rep Power
    687
    Nice work my new starter. Mabie a idea you can only use this command 1 time only with every ip.

    Quote Originally Posted by Colby View Post
    Rofl, moron. They're ALL going to be null idiot. This is such complete bullshit, it makes me want to strangle you.
     

  3. #3  
    Professional Upsetter


    Join Date
    Jul 2006
    Posts
    5,392
    Thanks given
    163
    Thanks received
    447
    Rep Power
    2040
    How about you make it check that if a loan is out, you can't trade at that time
    Ex-super moderator of Rune-Server.org and RSBot.org
     

  4. #4  
    Old School Member

    Join Date
    Feb 2008
    Age
    26
    Posts
    2,163
    Thanks given
    372
    Thanks received
    40
    Rep Power
    687
    Quote Originally Posted by Inside Sin View Post
    How about you make it check that if a loan is out, you can't trade at that time
    Will do sir, also a repped you because you put effert into this and you should be rewarded.

    Quote Originally Posted by Colby View Post
    Rofl, moron. They're ALL going to be null idiot. This is such complete bullshit, it makes me want to strangle you.
     

  5. #5  
    Professional Upsetter


    Join Date
    Jul 2006
    Posts
    5,392
    Thanks given
    163
    Thanks received
    447
    Rep Power
    2040
    Thanks I guess, oh btw. If you want to make that if you have a loan out, you can't do something, make it check it:

    Code:
    if(LoanAverage == 0) {
    doit();
    } else {
    don't();
    }
    Ex-super moderator of Rune-Server.org and RSBot.org
     

  6. #6  
    Banned

    Join Date
    May 2007
    Posts
    2,690
    Thanks given
    115
    Thanks received
    45
    Rep Power
    0
    That's nice Inside, but I suggest not using commands, use bankers.
     

  7. #7  
    Old School Member

    Join Date
    Feb 2008
    Age
    26
    Posts
    2,163
    Thanks given
    372
    Thanks received
    40
    Rep Power
    687
    Quote Originally Posted by A N G E L View Post
    That's nice Inside, but I suggest not using commands, use bankers.
    Read the begining of the topic noob.

    Quote Originally Posted by Colby View Post
    Rofl, moron. They're ALL going to be null idiot. This is such complete bullshit, it makes me want to strangle you.
     

  8. #8  
    Banned

    Join Date
    May 2007
    Posts
    2,690
    Thanks given
    115
    Thanks received
    45
    Rep Power
    0
    Quote Originally Posted by xx k03d xx View Post
    Read the begining of the topic noob.
    Hey no reason to call me a noob ?

    I forgot to read, I'm making a v2 now..I'm going to make them work with Npcs

    And YES, I DO have Insides permission.
     

  9. #9  
    hmu

    Jakey's Avatar
    Join Date
    Sep 2007
    Age
    31
    Posts
    6,489
    Thanks given
    109
    Thanks received
    277
    Rep Power
    1218
    nice work inside!

    cant wait for the server.
    to contact me, PM me on rune-server.
     

  10. #10  
    Registered Member i cliff i's Avatar
    Join Date
    Dec 2007
    Posts
    294
    Thanks given
    0
    Thanks received
    0
    Rep Power
    33
    inside sin u got leeched on mopar
    [Only registered and activated users can see links. ]
     

Page 1 of 6 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •