Thread: [PI] not getting xp [help]

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 [PI] not getting xp [help] 
    Registered Member 1defk0's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    225
    Thanks given
    5
    Thanks received
    3
    Rep Power
    0
    hello, iv added so when u use a charm on a pillar u get xp but u dont get xp

    code:

    Code:
    case 2149:
    if(itemId == 12158) {
    		c.getItems().deleteItem(12158, 1);
    		c.getPA().addSkillXP(3000, 22);
    		c.sendMessage("A magical force has been done!");
    		} else {
    		c.sendMessage("You don`t have enough charms to do this");
    		}
             break;
    		
    		}
    iv added this in useitem.java anyone a idea?
    Reply With Quote  
     

  2. #2  
    🍕

    Linus's Avatar
    Join Date
    Dec 2008
    Age
    26
    Posts
    2,758
    Thanks given
    903
    Thanks received
    406
    Rep Power
    0
    make it :

    case 2159:
    if(itemId == 12158){
    c.sendMessage("Works");
    }
    break;
    Tell me if "works" prints out, then maby I can help you.
    Spoiler for sig too large:

    ╠╬╣
    ╦╦
    ╠╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╚╩╩╩╩╩╩╝

    ╠╬╬╬╣

    Quote Originally Posted by Huey View Post
    I always applaud ppl that actually release shit. But okay me again and I'm negging your okaying ass. K homie?
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member 1defk0's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    225
    Thanks given
    5
    Thanks received
    3
    Rep Power
    0
    yes, text prints out, i just don`t get the xp , idk why not
    Reply With Quote  
     

  5. #4  
    Registered Member

    Join Date
    Aug 2011
    Posts
    2,764
    Thanks given
    297
    Thanks received
    534
    Rep Power
    1596
    Code:
    case 2159:
    if(itemId == 12158){
    c.sendMessage("lol");
    c.getPA().addSkillXP(3000, 22);
    }
    break;
    doesnt that work?
    Quote Originally Posted by Aj View Post
    This is not even a tutorial. It's fail for rep. It's fail for life.
    Reply With Quote  
     

  6. #5  
    🍕

    Linus's Avatar
    Join Date
    Dec 2008
    Age
    26
    Posts
    2,758
    Thanks given
    903
    Thanks received
    406
    Rep Power
    0
    Maby you toggled your exp ingame, check that first. Cause the code you provided in first post should work.
    Spoiler for sig too large:

    ╠╬╣
    ╦╦
    ╠╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╚╩╩╩╩╩╩╝

    ╠╬╬╬╣

    Quote Originally Posted by Huey View Post
    I always applaud ppl that actually release shit. But okay me again and I'm negging your okaying ass. K homie?
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #6  
    Registered Member 1defk0's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    225
    Thanks given
    5
    Thanks received
    3
    Rep Power
    0
    Quote Originally Posted by spikeyyy View Post
    Code:
    case 2159:
    if(itemId == 12158){
    c.sendMessage("lol");
    c.getPA().addSkillXP(3000, 22);
    }
    break;
    doesnt that work?
    its case 2149, and no it doesnt work, it prints out text, delete the item but no exp
    Reply With Quote  
     

  8. #7  
    🍕

    Linus's Avatar
    Join Date
    Dec 2008
    Age
    26
    Posts
    2,758
    Thanks given
    903
    Thanks received
    406
    Rep Power
    0
    Then you've either locked your exp, or you just got screwed over by some troll who deleted the methods for adding exp.
    Spoiler for sig too large:

    ╠╬╣
    ╦╦
    ╠╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╚╩╩╩╩╩╩╝

    ╠╬╬╬╣

    Quote Originally Posted by Huey View Post
    I always applaud ppl that actually release shit. But okay me again and I'm negging your okaying ass. K homie?
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  9. #8  
    Registered Member

    Join Date
    Aug 2011
    Posts
    2,764
    Thanks given
    297
    Thanks received
    534
    Rep Power
    1596
    Code:
    case 2149:
    if(itemId == 12158){
    c.sendMessage("xp has been given");
    c.getPA().addSkillXP((3000), 6);
    }
    break;
    this maybe
    Quote Originally Posted by Aj View Post
    This is not even a tutorial. It's fail for rep. It's fail for life.
    Reply With Quote  
     

  10. #9  
    🍕

    Linus's Avatar
    Join Date
    Dec 2008
    Age
    26
    Posts
    2,758
    Thanks given
    903
    Thanks received
    406
    Rep Power
    0
    [QUOTE=spikeyyy;2823724]
    Quote Originally Posted by spikeyyy View Post
    Code:
    case 2149:
    if(itemId == 12158){
    c.sendMessage("xp has been given");
    c.getPA().addSkillXP((3000), 6);
    }
    break;
    this maybe
    You cant print out "xp has been given" and then give exp, that doesn't make sense


    Replace your addSkillXP method with this:

    Code:
    	public boolean addSkillXP(int amount, int skill){
    		if (amount+c.playerXP[skill] < 0 || c.playerXP[skill] > 200000000) {
    			if(c.playerXP[skill] > 200000000) {
    				c.playerXP[skill] = 200000000;
    			}
    			return false;
    		}
    		amount *= Config.SERVER_EXP_BONUS;
    		int oldLevel = getLevelForXP(c.playerXP[skill]);
    		c.playerXP[skill] += amount;
    		if (oldLevel < getLevelForXP(c.playerXP[skill])) {
    			if (c.playerLevel[skill] < c.getLevelForXP(c.playerXP[skill]) && skill != 3 && skill != 5)
    				c.playerLevel[skill] = c.getLevelForXP(c.playerXP[skill]);
    			levelUp(skill);
    			c.gfx100(199);
    			requestUpdates();
    		}
    		setSkillLevel(skill, c.playerLevel[skill], c.playerXP[skill]);
    		refreshSkill(skill);
    		return true;
    	}
    Spoiler for sig too large:

    ╠╬╣
    ╦╦
    ╠╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╚╩╩╩╩╩╩╝

    ╠╬╬╬╣

    Quote Originally Posted by Huey View Post
    I always applaud ppl that actually release shit. But okay me again and I'm negging your okaying ass. K homie?
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  11. #10  
    Registered Member 1defk0's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    225
    Thanks given
    5
    Thanks received
    3
    Rep Power
    0
    [QUOTE=Herpus Derpus;2823732]
    Quote Originally Posted by spikeyyy View Post

    You cant print out "xp has been given" and then give exp, that doesn't make sense


    Replace your addSkillXP method with this:

    Code:
    	public boolean addSkillXP(int amount, int skill){
    		if (amount+c.playerXP[skill] < 0 || c.playerXP[skill] > 200000000) {
    			if(c.playerXP[skill] > 200000000) {
    				c.playerXP[skill] = 200000000;
    			}
    			return false;
    		}
    		amount *= Config.SERVER_EXP_BONUS;
    		int oldLevel = getLevelForXP(c.playerXP[skill]);
    		c.playerXP[skill] += amount;
    		if (oldLevel < getLevelForXP(c.playerXP[skill])) {
    			if (c.playerLevel[skill] < c.getLevelForXP(c.playerXP[skill]) && skill != 3 && skill != 5)
    				c.playerLevel[skill] = c.getLevelForXP(c.playerXP[skill]);
    			levelUp(skill);
    			c.gfx100(199);
    			requestUpdates();
    		}
    		setSkillLevel(skill, c.playerLevel[skill], c.playerXP[skill]);
    		refreshSkill(skill);
    		return true;
    	}
    ok i will try this, thx
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

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