Thread: 667 - Dung system doesnt take points away

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1 667 - Dung system doesnt take points away 
    Developer

    Join Date
    Jan 2012
    Posts
    392
    Thanks given
    177
    Thanks received
    40
    Rep Power
    0
    Im trying to get this to take dung points away after buying the item iv tried everything..

    Code:
    if (componentId == 1) {
    					if (player.getDungpoints() <= 20000) {
    						player.setDungpoints(player.getDungpoints =- 20000);
    						player.getInventory().addItem(18349, 1);
    						end();
    						return;
    					}
    Reply With Quote  
     

  2. #2  
    van 't stad

    Shnek's Avatar
    Join Date
    Oct 2013
    Posts
    1,065
    Thanks given
    343
    Thanks received
    297
    Rep Power
    109
    maybe you should change this "<=" to this ">=" because in your statement you need less then 20k points, don't know if you ment to do this
    Attached image

    Do not use the vps from ovh, blocking vps without reason and no customer support
    Reply With Quote  
     

  3. #3  
    Developer

    Join Date
    Jan 2012
    Posts
    392
    Thanks given
    177
    Thanks received
    40
    Rep Power
    0
    I need it to take points away after buying the item.
    Reply With Quote  
     

  4. #4  
    Donator
    holydivinity's Avatar
    Join Date
    Mar 2014
    Posts
    109
    Thanks given
    5
    Thanks received
    4
    Rep Power
    11
    What are you actually trying to do?

    Your code currently says the following:

    If Player has 20.000 or more then 20.000 DP ->
    Set DP to: current points =- 20.000 (This should be "player.getDungpoints + 20000" if you want to add 20k points) ->
    Add 1x 18349 to player inventory ->
    quit
    Reply With Quote  
     

  5. #5  
    Developer

    Join Date
    Jan 2012
    Posts
    392
    Thanks given
    177
    Thanks received
    40
    Rep Power
    0
    I cant figure out how to make it take away points..
    Reply With Quote  
     

  6. #6  
    Donator
    holydivinity's Avatar
    Join Date
    Mar 2014
    Posts
    109
    Thanks given
    5
    Thanks received
    4
    Rep Power
    11
    Quote Originally Posted by Kylee View Post
    I need it to take points away after buying the item.
    Code:
     if (componentId == 1) {
    					if (player.getDungpoints() >= 20000) {
    						player.setDungpoints(player.getDungpoints - 20000);
    						player.getInventory().addItem(18349, 1);
    						end();
    						return;
    					}
    Edit: When i started writing my first post you didn't comment yet. That is why i asked you what you wanted to do.
    Reply With Quote  
     

  7. #7  
    Developer

    Join Date
    Jan 2012
    Posts
    392
    Thanks given
    177
    Thanks received
    40
    Rep Power
    0
    Ye i tried that lol didnt work.

    Edit:
    going to try again.
    Reply With Quote  
     

  8. #8  
    Donator
    holydivinity's Avatar
    Join Date
    Mar 2014
    Posts
    109
    Thanks given
    5
    Thanks received
    4
    Rep Power
    11
    What is the result?

    Add me on skype, username: HolyDivinity

    Code:
    if (player.getDungpoints() >= 20000) {
    player.sm("[DEV] player has"+player.getDungpoints()+"DP's");
    player.setDungpoints(player.getDungpoints() - 20000);
    player.sm("[DEV] DP set to"+player.getDungpoints());
    player.getInventory().addItem(18349, 1);
    player.sm("[DEV] Added item");
    return;
    } else {
    player.sm("[DEV] Player doesn't have >= 20.000 DP");
    return;
    }
    Could you run that instead of your code and show me the [DEV] messages ?
    Reply With Quote  
     

  9. #9  
    Developer

    Join Date
    Jan 2012
    Posts
    392
    Thanks given
    177
    Thanks received
    40
    Rep Power
    0
    This is a 667 so things may be diffrent, cause i had no issues on my 718.

    Code:
    @Override
    	public void start() {
    		npcId = (Integer) parameters[0];
    		sendEntityDialogue(SEND_1_TEXT_CHAT,
    				new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
    						"Would you like to view the Dungeoneering shop?" }, IS_NPC, npcId, 9827);
    	}
    
    	@Override
    	public void run(int interfaceId, int componentId) {
    		if (stage == -1) {
    			sendEntityDialogue(SEND_1_TEXT_CHAT,
    					new String[] { player.getDisplayName(), "Yes please." },
    					IS_PLAYER, player.getIndex(), 9827);
    			stage = 1;
    		} else if (stage == 1) {
    			sendDialogue(SEND_5_OPTIONS, "Choose an option", "Chaotic Rapier",
    					"Chaotic Longsword", "Chaotic Maul", "Chaotic Crossbow", "Next page.");
    			stage = 2;
    		} else if (stage == 2) {
    			if (componentId == 1) {
    					if (player.getDungpoints() >= 20000) {
    						player.getInventory().addItem(18349, 1);
    						player.setDungpoints(player.getDungpoints + 20000);
    						player.setDungpoints(player.getDungpoints - 2000);
    						end();
    						return;
    					}
    Reply With Quote  
     

  10. #10  
    Registered Member Sjonsen's Avatar
    Join Date
    May 2012
    Posts
    321
    Thanks given
    15
    Thanks received
    44
    Rep Power
    20
    Code:
    player.setDungpoints(player.getDungpoints -= 20000);
    Reply With Quote  
     

  11. Thankful users:


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

Similar Threads

  1. 614 Dung system points
    By Smd Pamela A in forum Help
    Replies: 8
    Last Post: 12-30-2013, 12:03 AM
  2. [667-718] - Looking for PK point system!!
    By berke203 in forum Help
    Replies: 1
    Last Post: 06-26-2013, 08:43 PM
  3. [667] Upgrade system and Warp System
    By erica in forum Show-off
    Replies: 27
    Last Post: 06-26-2012, 11:25 AM
  4. Replies: 5
    Last Post: 06-02-2011, 05:26 PM
  5. Take me Away
    By Tom Sawyer in forum Showcase
    Replies: 7
    Last Post: 11-22-2009, 02:01 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •