[Tut] [317] Changing Players starting inventory

Results 1 to 1 of 1
  1. #1
    There's no RL just AFK -fedexer- is offline
    MemberRank
    May 2006 Join Date
    ScotlandLocation
    1,632Posts

    [Tut] [317] Changing Players starting inventory

    Okay... A very simple tutorial here, I whipped it up in my spare time.

    Purpose: Okay... This will allow people to start with items in their inventory, only once.

    Difficulty: 2

    Assumed Knowledge: Copy and paste.

    Server Base: pimpscape, cheezscape, testscape

    Classes Modified: Client.java

    Procedure

    Step 1: First off , open up your client.java and look for:

    Code:
    public int lastlogintime;
    below that, add:

    Code:
    public int hitems = 0;
    Step 2: Next, look for:

    Code:
    } else if (token.equals("character-height")) {
    						    heightLevel = Integer.parseInt(token2);
    						}
    Below that, add:

    Code:
    else if (token.equals("character-hitems")) {//-fedexer-
    						    hitems = Integer.parseInt(token2);
    						}
    Step 3:Now, look for:


    Code:
    characterfile.write("character-lastlogintime = ", 0, 26);
    			characterfile.write(Integer.toString(playerLastLogin), 0, Integer.toString(playerLastLogin).length());
    			characterfile.newLine();
    Below. add:

    Code:
    characterfile.write("character-hitems = ", 0, 19);// -fedexer-
    			characterfile.write(Integer.toString(hitems), 0, Integer.toString(hitems).length());
    			characterfile.newLine();
    Step 4: Now, above any public void, add this void:


    Code:
    public void startingitems() {//-fedexer-'s coding
    hitems = 1;
    addItem(1049, 10);
    addItem(1039, 10);
    addItem(1041, 10);
    addItem(1043, 10);
    addItem(1045, 10);
    addItem(1047, 10);
    }
    Step 5: Now, change the items in the:

    Code:
    addItem(xxxx, x);
    to whatever you want the players to receive in their inventory when they log in.

    In addItem(xxxx, x); the first 4 x's are the item id's and the last x , is the amount of that item, remember if you want to have more than one item the id's for them must be noted items.

    Step 6: Lastly, search for:


    Code:
    //openWelcomeScreen(201, false, 3, ((IPPart1 << 24)+(IPPart2 << 16)+(IPPart3 << 8)+IPPart4), lastlogintime);
    MainHelpMenu();
    		//openWelcomeScreen(201, false, 3, (127 << 24)+1, misc.random(10));
    Below, add:

    Code:
    if(hitems == 0) //creds to -fedexer- for this
    		{
    		startingitems();
    		}else{
    		sendMessage("no starter items for you (made by -fedexer-) ");
    		}
    Okay... that's it, people. Now once a player logs in they will get the items that you want them to get and every time they log in after that they wont get anything , so they only get the items once, now you don't need to have your mods running about trying to dish out starter packs

    Credits: -fedexer- (myself)




Advertisement