Welcome to RuneLocus! If you are new, register now —or—

User Tag List

Page 1 of 5 123 ... LastLast
Results 1 to 10 of 50
  1. #1

    Join Date
    Jun 2010
    Posts
    22
    Thanks
    0
    Mentioned
    0 times
    Tagged
    0 Thread(s)

    317 - Adding Pk Points also making a shop for it

    First, go into your client.java, server sided.

    Then find...

    Code:
    public class client extends Player implements Runnable
    It should be near the top.

    After that last bracket, add this...

    Code:
    public int pkingPoints = 0;
    Next, find...

    Code:
    character-skill
    You should see something like this...

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

    Code:
    } else if (token.equals("character-pkingPoints")) {
    	pkingPoints = Integer.parseInt(token2);
    Next, find...

    Code:
    character-skill
    You should see something like...

    Code:
    characterfile.write("character-skill = ", 0, 18);
    			characterfile.write(Integer.toString(SkillID), 0, Integer.toString(SkillID).length());
    			characterfile.newLine();
    Below the...

    Code:
    characterfile.newLine();
    Add this...

    Code:
    characterfile.write("character-pkingPoints = ", 0, 21);
    			characterfile.write(Integer.toString(pkingPoints), 0, Integer.toString(pkingPoints).length());
    			characterfile.newLine();
    Now, save, and compile, and once a character logs in and out, it should save pk points for them.

    Now, to make it so when a player kills another, they get a pk point.

    Find...

    Code:
    killerz.
    Until you see something like...

    Code:
    killerz.sM("You have defeated "+playerName+".");
    Below that, add this...

    Code:
    killerz.sM("You have gained a Pking Point.");
    killerz.pkingPoints += 1;
    Now, every time you kill someone, you'll gain a pk point.

    Now, to make a shop use pking points.

    First, find...

    Code:
    MyShopID !=8
    You should see something like...

    Code:
    if (Slot == -1 && MyShopID != 8 && MyShopID != 19 && MyShopID != 36) {
                        sM("You don't have enough coins.");
                        break;
                    }
    Now, under that add...

    Code:
    if (Slot3 == -1 && MyShopID == 75) {
    					sM("You don't have enough Pking Points.");
    					break;
    				}
    Next, find...

    Code:
    MyShopID !=8
    You should see something like...

    Code:
    if (MyShopID != 8 && MyShopID != 19 && MyShopID != 36) {
                        if (playerItemsN[Slot] >= TotPrice2) {
                            if (freeSlots() > 0) {
    						
                                deleteItem(995, GetItemSlot(995), TotPrice2);
                                addItem(itemID, 1);
                                server.shopHandler.ShopItemsN[MyShopID][fromSlot] -= 1;
                                server.shopHandler.ShopItemsDelay[MyShopID][fromSlot] = 0;
                                if ((fromSlot + 1)
                                        > server.shopHandler.ShopItemsStandard[MyShopID]) {
                                    server.shopHandler.ShopItems[MyShopID][fromSlot] = 0;
                                }
                            } else {
                                sM("Not enough space in your inventory.");
                                break;
                            }
                        } else {
                            sM("Not enough coins for this item.");
                        }
                    }
    After, where it says...

    Code:
    MyShopID != 36
    Add...

    Code:
     && MyShopID !=75
    Now, find...

    Code:
    MyShopID == 8
    You should see something like...

    Code:
    if (MyShopID == 8) {
                        if (playerItemsN[Slot2] >= TotPrice2) {
                            if (freeSlots() > 0) {
                                deleteItem(6529, GetItemSlot(6529), TotPrice2);
                                addItem(itemID, 1);
                                server.shopHandler.ShopItemsN[MyShopID][fromSlot] -= 1;
                                server.shopHandler.ShopItemsDelay[MyShopID][fromSlot] = 0;
                                if ((fromSlot + 1)
                                        > server.shopHandler.ShopItemsStandard[MyShopID]) {
                                    server.shopHandler.ShopItems[MyShopID][fromSlot] = 0;
                                }
                            } else {
                                sM("Not enough space in your inventory.");
                                break;
                            }
                        } else {
                            sM("Not enough tokkul for this item.");
                        }
                    }
    Under that, add...

    Code:
    if (MyShopID == 75) {
    					if (pkingPoints >= TotPrice2) {
    						if (freeSlots() > 0){
    							pkingPoints -= TotPrice2;
                                addItem(itemID, 1);
                                server.shopHandler.ShopItemsN[MyShopID][fromSlot] -= 1;
                                server.shopHandler.ShopItemsDelay[MyShopID][fromSlot] = 0;
                                if ((fromSlot + 1)
                                        > server.shopHandler.ShopItemsStandard[MyShopID]) {
                                    server.shopHandler.ShopItems[MyShopID][fromSlot] = 0;
                                }
                            } else {
                                sM("Not enough space in your inventory.");
                                break;
                            }
                        } else {
                            sM("Not enough Pking Points for this item.");
                        }
                	}
    That's it.
    Add your shop, make the shop ID 75, then you'll have a pk point shop.

    **Any use of "sM" may be either wT or sendMessage in your server.**

    Thanks
    iMPeX

    EDIT:

    How to fix "Currently Costs # Coins and Currently Costs ## Pking Points."

    Go into Client.java, server sided.

    Next, find...

    Code:
     "+ShopValue+" coins
    You should see something like...

    Code:
    if (MyShopID == 8) {
    					sM(getItemName(removeID) + ": currently costs " + ShopValue
    							+ " tokkul" + ShopAdd);
    				}
    				if (MyShopID == 19) {
    					sM(getItemName(removeID) + ": currently costs " + ShopValue
    							+ " points" + ShopAdd);
    				} else {
    					sM(getItemName(removeID) + ": currently costs " + ShopValue
    							+ " coins" + ShopAdd);
    				}
    Replace that with this...

    Code:
    if (MyShopID != 8 && MyShopID != 19 && MyShopID != 75) {
    						sM(getItemName(removeID)+": currently costs "+ShopValue+" coins"+ShopAdd);
    					}
    					if (MyShopID == 8) {
                sM(getItemName(removeID)+": currently costs "+ShopValue+" tokkul"+ShopAdd);
    					}
    					if (MyShopID == 19) {
                sM(getItemName(removeID)+": currently costs "+ShopValue+" points"+ShopAdd);
    					}
    					if (MyShopID == 75) {
                sM(getItemName(removeID)+": currently costs "+ShopValue+" pking points"+ShopAdd);
    					}
    Fixed.

    Thanks
    iMPeX
    Last edited by iMPeX; July 2nd, 2010 at 23:26.

  2. #2

    Join Date
    Jun 2010
    Posts
    666
    Thanks
    0
    Mentioned
    0 times
    Tagged
    0 Thread(s)
    100% Leeched.

  3. #3

    Join Date
    Jun 2010
    Posts
    22
    Thanks
    0
    Mentioned
    0 times
    Tagged
    0 Thread(s)
    100% Non leeched. It's not that hard, for the shops, I just took my assault shop, and did it over. o.O


  4. #4

    Join Date
    Jun 2010
    Posts
    46
    Thanks
    0
    Mentioned
    0 times
    Tagged
    0 Thread(s)
    It may be leeched, it may not. Who cares, it's not that hard.

    It would take 1-5 minutes to put how to add the shop in shops.cfg, why don't you?
    Constructive criticism.

    Anyways, good guide for beginners.

  5. #5

    Join Date
    Jun 2010
    Posts
    141
    Thanks
    0
    Mentioned
    0 times
    Tagged
    0 Thread(s)
    this is a really good guide for beginners but to be honest this comes in most delta sources anyway now.. it even came in the blank i downloaded to restart my project, but its good for people that perhaps dont have pking points at all + there was a more advanced version of pking points released which would be cool if it was posted here maybe you could make a more advanced version e.g. so that it doesnt allow you to get pking points for killing the same person 3 times in the row etc..

  6. #6

    Join Date
    Jun 2010
    Posts
    2,080
    Thanks
    383
    Mentioned
    1 times
    Tagged
    0 Thread(s)
    Quote Originally Posted by Break View Post
    100% Leeched.
    Perhaps provide some proof?
    Any amount, much love! :3


  7. #7

    Join Date
    Jun 2010
    Posts
    746
    Thanks
    0
    Mentioned
    0 times
    Tagged
    0 Thread(s)
    looks good

  8. #8

    Join Date
    Jun 2010
    Posts
    593
    Thanks
    0
    Mentioned
    0 times
    Tagged
    0 Thread(s)
    This is a really good tut bro.
    PLAY RESURRECTION PK NOW :$!

  9. #9

    Join Date
    Jun 2010
    Posts
    22
    Thanks
    0
    Mentioned
    0 times
    Tagged
    0 Thread(s)
    Thanks guys.

    @Bloodpk3r, some do, some don't, but for those started from a deob, and a blank source, like me, this is good for them.


  10. #10

    Join Date
    Jun 2010
    Posts
    247
    Thanks
    4
    Mentioned
    0 times
    Tagged
    0 Thread(s)
    I try to find the code you showed but i cant :S the source im using is Project Insanity! HELP i want a pk points shop!

Posting Permissions

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