Thread: Elvarg econemy prayer scrolls and bounty teleport

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Elvarg econemy prayer scrolls and bounty teleport 
    Registered Member
    Join Date
    Nov 2017
    Posts
    52
    Thanks given
    17
    Thanks received
    5
    Rep Power
    36
    How do I fix these? it works fine on the spawn source??

    Code:
    		case 2542:
    		case 2543:
    		case 2544:
    			if(player.busy()) {
    				player.getPacketSender().sendMessage("You cannot do that right now.");
    				return;
    			}
    			if(itemId == 2542 && player.isPreserveUnlocked() || itemId == 2543 && player.isRigourUnlocked() || 
    					itemId == 2544 && player.isAuguryUnlocked()) {
    				player.getPacketSender().sendMessage("You have already unlocked that prayer.");
    				return;
    			}
    			DialogueManager.start(player, 9);
    			player.setDialogueOptions(new DialogueOptions() {
    				@Override
    				public void handleOption(Player player, int option) {
    					if(option == 1) {
    						player.getInventory().delete(itemId, 1);
    
    						if(itemId == 2542)
    							player.setPreserveUnlocked(true);
    						else if(itemId == 2543)
    							player.setRigourUnlocked(true);
    						else if(itemId == 2544)
    							player.setAuguryUnlocked(true);
    						player.getPacketSender().sendConfig(709, PrayerHandler.canUse(player, PrayerData.PRESERVE, false) ? 1 : 0);
    						player.getPacketSender().sendConfig(711, PrayerHandler.canUse(player, PrayerData.RIGOUR, false) ? 1 : 0);
    						player.getPacketSender().sendConfig(713, PrayerHandler.canUse(player, PrayerData.AUGURY, false) ? 1 : 0);
    						player.getPacketSender().sendMessage("You have unlocked a new prayer.");
    					}
    					player.getPacketSender().sendInterfaceRemoval();
    				}
    			});
    			break;
    		case 2545:
    			if(player.busy()) {
    				player.getPacketSender().sendMessage("You cannot do that right now.");
    				return;
    			}
    			if(player.isTargetTeleportUnlocked()) {
    				player.getPacketSender().sendMessage("You have already unlocked that teleport.");
    				return;
    			}
    			DialogueManager.start(player, 12);
    			player.setDialogueOptions(new DialogueOptions() {
    				@Override
    				public void handleOption(Player player, int option) {
    					if(option == 1) {
    						player.getInventory().delete(itemId, 1);
    						player.setTargetTeleportUnlocked(true);
    						player.getPacketSender().sendMessage("You have unlocked a new teleport.");
    					}
    					player.getPacketSender().sendInterfaceRemoval();
    				}
    			});
    			break;
    thanks for your help
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2011
    Posts
    1,143
    Thanks given
    545
    Thanks received
    110
    Rep Power
    87
    When you say "how do i fix these" you don't help us at all. What's happening to make it not work correctly? Are they just not working at all? are you getting an error?

    Reply With Quote  
     

  3. #3  
    Donator

    its.teewhy's Avatar
    Join Date
    Nov 2017
    Posts
    77
    Thanks given
    107
    Thanks received
    93
    Rep Power
    593
    I would say make sure the item ids are correct. Also make sure the dialogues are added as if I'm not mistaken, the dialogues from OSRSPK release aren't in the economy release.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Nov 2017
    Posts
    52
    Thanks given
    17
    Thanks received
    5
    Rep Power
    36
    Quote Originally Posted by Falconpunch View Post
    When you say "how do i fix these" you don't help us at all. What's happening to make it not work correctly? Are they just not working at all? are you getting an error?
    No errors, Just doesn't do anything when I click on the items.

    Quote Originally Posted by its.teewhy View Post
    I would say make sure the item ids are correct. Also make sure the dialogues are added as if I'm not mistaken, the dialogues from OSRSPK release aren't in the economy release.
    Right that is what I would be looking for thank you

    Every time I add it to the .json file I get an error why is this?
    Reply With Quote  
     

  5. #5  
    Donator

    its.teewhy's Avatar
    Join Date
    Nov 2017
    Posts
    77
    Thanks given
    107
    Thanks received
    93
    Rep Power
    593
    Quote Originally Posted by TwoHitNation View Post
    Every time I add it to the .json file I get an error why is this?
    Perhaps you aren't adding it correctly, check your ,'s and such.
    Reply With Quote  
     

  6. Thankful user:


  7. #6  
    Registered Member
    Join Date
    Nov 2017
    Posts
    52
    Thanks given
    17
    Thanks received
    5
    Rep Power
    36
    Quote Originally Posted by its.teewhy View Post
    Perhaps you aren't adding it correctly, check your ,'s and such.
    I've removed and put my old dialogues.json back and I'm still getting this error? :O

    com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 5
    at com.google.gson.JsonParser.parse(JsonParser.java:6 5)
    at com.elvarg.game.definition.loader.impl.DialogueDef initionLoader.load(DialogueDefinitionLoader.java:2 3)
    at com.elvarg.game.definition.loader.DefinitionLoader .run(DefinitionLoader.java:22)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 5
    at com.google.gson.stream.JsonReader.syntaxError(Json Reader.java:1505)
    at com.google.gson.stream.JsonReader.checkLenient(Jso nReader.java:1386)
    at com.google.gson.stream.JsonReader.doPeek(JsonReade r.java:531)
    at com.google.gson.stream.JsonReader.peek(JsonReader. java:414)
    at com.google.gson.JsonParser.parse(JsonParser.java:6 0)
    ... 5 more
    Dec 13, 2017 4:39:01 PM com.elvarg.game.definition.loader.DefinitionLoader run
    SEVERE: Loaded definitions for: ./data/definitions/dialogues.json
    com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 5
    at com.google.gson.JsonParser.parse(JsonParser.java:6 5)
    at com.elvarg.game.definition.loader.impl.DialogueDef initionLoader.load(DialogueDefinitionLoader.java:2 3)
    at com.elvarg.game.definition.loader.DefinitionLoader .run(DefinitionLoader.java:22)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 5
    at com.google.gson.stream.JsonReader.syntaxError(Json Reader.java:1505)
    at com.google.gson.stream.JsonReader.checkLenient(Jso nReader.java:1386)
    at com.google.gson.stream.JsonReader.doPeek(JsonReade r.java:531)
    at com.google.gson.stream.JsonReader.peek(JsonReader. java:414)
    at com.google.gson.JsonParser.parse(JsonParser.java:6 0)
    ... 5 more
    Reply With Quote  
     

  8. #7  
    Donator

    its.teewhy's Avatar
    Join Date
    Nov 2017
    Posts
    77
    Thanks given
    107
    Thanks received
    93
    Rep Power
    593
    Quote Originally Posted by TwoHitNation View Post
    I've removed and put my old dialogues.json back and I'm still getting this error? :O
    Post a screenshot of your first couple lines in your json file. Your error is at Line 1 as the error provided states.
    Reply With Quote  
     

  9. #8  
    Registered Member
    Join Date
    Nov 2017
    Posts
    52
    Thanks given
    17
    Thanks received
    5
    Rep Power
    36
    Quote Originally Posted by its.teewhy View Post
    Post a screenshot of your first couple lines in your json file. Your error is at Line 1 as the error provided states.
    this is the first 4 lines

    [
    {
    "id": 0,
    "type": "NPC_STATEMENT",
    "anim": "DEFAULT",
    "lines": 1,
    "line1": "Hello. What do you need?",
    "next": 1,
    "npcId": 315
    },
    {
    "id": 1,
    "type": "OPTION",
    "lines": 4,
    "line1": "Open Shop",
    "line2": "Sell Emblems",
    "line3": "Skull me",
    "line4": "Cancel",
    "next": -1,
    "npcId": 315
    },
    {
    Even when I put my old .json file back in still gave me the same error that I didn't have before? very confusing haha thanks for your help
    Reply With Quote  
     

  10. #9  
    Donator

    its.teewhy's Avatar
    Join Date
    Nov 2017
    Posts
    77
    Thanks given
    107
    Thanks received
    93
    Rep Power
    593
    Quote Originally Posted by TwoHitNation View Post
    this is the first 4 lines

    Even when I put my old .json file back in still gave me the same error that I didn't have before? very confusing haha thanks for your help
    Everything looks fine to me there, perhaps you could private message me your discord and I could take a look at it when I am available on desktop. If you don't find help or fix the problem before then.
    Reply With Quote  
     

  11. Thankful user:


  12. #10  
    Registered Member

    Join Date
    Feb 2015
    Posts
    830
    Thanks given
    12
    Thanks received
    200
    Rep Power
    118
    If this still hasnt been fixed;


    If you look in the code you sent. It's trying to send dialogue id 12 and 9.
    DialogueManager.start(player, 9);
    DialogueManager.start(player, 12);

    check id 9 and 12 in dialogues.json, see what they are. If they don't exist, add them.
    Attached image
    Reply With Quote  
     

  13. 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. Prayer, skull and adding arrow
    By dustrip in forum Tutorials
    Replies: 5
    Last Post: 09-17-2008, 02:51 PM
  2. Replies: 9
    Last Post: 06-24-2008, 04:32 AM
  3. Replies: 5
    Last Post: 03-22-2008, 04:55 PM
  4. [Simple]Varrok and Falador teleports
    By HcoFlame in forum Configuration
    Replies: 6
    Last Post: 03-06-2008, 10:03 AM
  5. Replies: 11
    Last Post: 02-22-2008, 07:30 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
  •