Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • drubrkletern: yes
      Today at 03:28:39 PM
    • delponcho: hey why when i open the jar file it doesnt open the private server it opens my actual rs page?
      Today at 12:00:37 AM
    • `Discardedx2`: deathschaos9 where r u
      December 14, 2017, 02:35:11 PM
    • stCky: mutiny
      December 14, 2017, 02:21:10 AM
    • DeathsChaos9: No, mods are missing a lot of permissions atm and its not getting fixed
      December 13, 2017, 09:44:40 PM
    • stCky: is there a mod panel (dunno if itd be assigned to ur group anyway zzz)
      December 13, 2017, 07:58:03 PM
    • stCky: lame
      December 13, 2017, 07:57:45 PM
    • DeathsChaos9: no dice
      December 13, 2017, 07:45:45 PM
    • DeathsChaos9: /help
      December 13, 2017, 07:45:40 PM
    • DeathsChaos9: /prune
      December 13, 2017, 07:45:32 PM
    • DeathsChaos9: /clear
      December 13, 2017, 07:45:29 PM
    • stCky: try /clear or /prune
      December 13, 2017, 07:18:19 PM
    • * stCky ok
      December 13, 2017, 07:17:59 PM
    • DeathsChaos9: I cant clean that >_<
      December 13, 2017, 01:41:42 AM
    • Travas: :-(
      December 12, 2017, 11:35:34 PM
    • Soulcist: :-(
      December 12, 2017, 05:33:31 PM
    • wjfgg321: 카지노사이트주소%↘∽↙%cay777。com%↘∽↙%카지노게임 해외카지노사이트 바카라사이트주소 카지노사이트 바카라사이트 온라인바카라 온라인카지노 인터넷카지노
      December 12, 2017, 12:26:24 AM
    • wjfgg321: 사설토토사이트추천 첫충20프로%s t - 2 2 5 5. c o m%가입코드 s  t  8  8안전사설토토사이트추천 토토추천 사설토토추천사이트 토토사이트주소 해외토토사이트추천 스포츠토토사이트추천 사설토토추천 안전메이저토토사이트추천 안전사설토토추천
      December 11, 2017, 10:28:52 PM
    • stCky: all these staff members and we're still covered in spam :( soulcist please actually do something
      December 11, 2017, 08:33:35 PM
    • xtragic: click below for best rs classic server.
      December 11, 2017, 07:49:49 AM

    Author Topic: Changing back to config.java drops  (Read 948 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Changing back to config.java drops
    « on: February 13, 2016, 11:23:24 PM »
    Right now my drop system is completely weird , i don't understand it at all i had thought all my drops were handled inside of config.java but there not, its in this file called json so basically it's in Data/json/drops i want my drops for npc's to be pulled from config.java.
    « Last Edit: February 13, 2016, 11:25:37 PM by tank nation »
    RS2Ad banner

    OfflineSoulxs

    • Member
    • ***
    • Posts: 131
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #1 on: February 14, 2016, 07:58:30 AM »
    When a NPC dies it will request a drop, backtrack and find out where it defines where to load the drops from. Then change that back to config.
    RS2Ad banner

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #2 on: February 14, 2016, 02:05:58 PM »
    When a NPC dies it will request a drop, backtrack and find out where it defines where to load the drops from. Then change that back to config.

    Here is a couple of things i found, now i wasnt sure on how the config file would come in to play. Would it go something like this if i went to change the drops on the json final: ./Server/src/server/Config.java? Considering you don't know where my config file is it's in the source folder it's self then when i click on src folder it says server then config.

    Code: [Select]
    public static final void load() {
    final Gson gson = new Gson();
    final File dir = new File("./Data/json/drops/");

    for (final File file : dir.listFiles()) {
    try (final BufferedReader parse = new BufferedReader(
    new FileReader(file))) {
    System.out.println(file.getName());
    final NPCLootTable table = gson.fromJson(parse,
    NPCLootTable.class);

    for (final int key : table.npcIdentifiers) {
    DROP_TABLE_REPO.put(key, table);
    }
    } catch (IOException e) {
    System.out.println("ERROR IN: " + file.getName());
    e.printStackTrace();
    }
    }
    }
    }

    Code: [Select]
    public static final String DEFINITION_FILE = "Data/json/npc_definitions.json";
    public static final String SPAWN_FILE = "Data/json/npc_spawns.json";

    Code: [Select]
    writer.write("// id, x, y, z, walking type");
    writer.newLine();
    for (int i2 = 0; i2 < NPCHandler.npcs.length; i2++) {
    NPC n1 = NPCHandler.npcs[i2];
    if (n1 == null)
    continue;
    NPCDefinition nl = n1.getDefinition();
    writer.write("spawn\t=\t" + nl.translationId + "\t" + n1.absX + "\t" + n1.absY + "\t" + n1.heightLevel + "\t" + n1.walkingType);
    writer.newLine();
    }
    writer.write("[ENDOFSPAWNLIST]");
    writer.flush();

    reader.close();
    RS2Ad banner

    Offlinelare69

    • Member
    • ****
    • *
    • Posts: 5,322
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #3 on: February 14, 2016, 08:15:32 PM »
    why would you want that... just use the json files
    hi. check out luna:)

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #4 on: February 17, 2016, 09:17:10 PM »
    why would you want that... just use the json files

    How is the rarity like can you tell me how these drops work i don't understand them. Here's what they look like.


    OfflineTree

    • Member
    • ****
    • Posts: 2,638
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #5 on: February 17, 2016, 09:49:43 PM »
    why would you want that... just use the json files

    How is the rarity like can you tell me how these drops work i don't understand them. Here's what they look like.



    Quote
    <_^_> this community has really collapsed
    <_^_> it is like a shitty version of friendster for washed up nerds

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #6 on: February 17, 2016, 10:21:20 PM »
    why would you want that... just use the json files

    How is the rarity like can you tell me how these drops work i don't understand them. Here's what they look like.





    All i need to know is what is the rarity like for this coding, i basically understand what's what but i just don't get the hitrollceil ik this is the rarity of the drops but is 100 always or what is 0.1 or what i don't get it.

    OfflineTree

    • Member
    • ****
    • Posts: 2,638
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #7 on: February 17, 2016, 11:07:40 PM »
    why would you want that... just use the json files



    How is the rarity like can you tell me how these drops work i don't understand them. Here's what they look like.





    All i need to know is what is the rarity like for this coding, i basically understand what's what but i just don't get the hitrollceil ik this is the rarity of the drops but is 100 always or what is 0.1 or what i don't get it.

    Follow the code.
    « Last Edit: February 17, 2016, 11:44:21 PM by Tree »
    Quote
    <_^_> this community has really collapsed
    <_^_> it is like a shitty version of friendster for washed up nerds

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #8 on: February 18, 2016, 09:32:48 AM »
    You know how easy it is to "convert" a drop system. All you do is replace code with other code.
    https://www.rune-server.ee/runescape-development/google/tutorials/251287-completely-rewrite-drops-pi.html
    Oh look, a tutorial on the drop system. Now what would happen if you replaced your system with it?

    Since you "Can't understand" the code for the current drop system, you'll have to manually input the data from the json files into your Config.java.
    Or..:

    why would you want that... just use the json files

    How is the rarity like can you tell me how these drops work i don't understand them. Here's what they look like.





    All i need to know is what is the rarity like for this coding, i basically understand what's what but i just don't get the hitrollceil ik this is the rarity of the drops but is 100 always or what is 0.1 or what i don't get it.
    Like tree said.. The code tells you what it does...

    If you really can't understand it; this is what you do:
    A) Post the code so someone can explain it to you. No, not pictures of the json files, not the json files, the code reading and using the json files.
    B) Read more about the language so you can understand it.
    C) Give up.

    The choice is yours.

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #9 on: February 18, 2016, 03:39:26 PM »
    You know how easy it is to "convert" a drop system. All you do is replace code with other code.
    https://www.rune-server.ee/runescape-development/google/tutorials/251287-completely-rewrite-drops-pi.html
    Oh look, a tutorial on the drop system. Now what would happen if you replaced your system with it?

    Since you "Can't understand" the code for the current drop system, you'll have to manually input the data from the json files into your Config.java.
    Or..:

    why would you want that... just use the json files

    How is the rarity like can you tell me how these drops work i don't understand them. Here's what they look like.





    All i need to know is what is the rarity like for this coding, i basically understand what's what but i just don't get the hitrollceil ik this is the rarity of the drops but is 100 always or what is 0.1 or what i don't get it.
    Like tree said.. The code tells you what it does...

    If you really can't understand it; this is what you do:
    A) Post the code so someone can explain it to you. No, not pictures of the json files, not the json files, the code reading and using the json files.
    B) Read more about the language so you can understand it.
    C) Give up.

    The choice is yours.

    i followed the tutorial and drops are not being dropped from the npcs any help with that? I believe there's something missing.
    « Last Edit: February 18, 2016, 10:08:50 PM by tank nation »

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #10 on: February 18, 2016, 11:12:36 PM »
    Use debugging.
    Place a statement like this in the dropitems method to see if it's being executed..
    Code: Java
    1. System.out.println("Dropping.");

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #11 on: February 19, 2016, 01:17:28 AM »
    Use debugging.
    Place a statement like this in the dropitems method to see if it's being executed..
    Code: Java
    1. System.out.println("Dropping.");

    does nothing.

    Code: [Select]
    public void dropItems(int i) {
    int npc = 0;
    Client c = (Client)Server.playerHandler.players[npcs[i].killedBy];
    if(c != null) {
    for(int o = 0; o < c.barrowsNpcs.length; o++){
    if(npcs[i].npcType == c.barrowsNpcs[o][0]) {
    c.barrowsNpcs[o][1] = 2; // 2 for dead
    c.barrowsKillCount++;
    }
    }
    if (npcs[i].npcType == 912 || npcs[i].npcType == 913 || npcs[i].npcType == 914)
    c.magePoints += 1;

    for(npc = 0; npc < Config.NPC_DROPS.length; npc++){
    if(npcs[i].npcType == Config.NPC_DROPS[npc][0]) {
    if(Misc.random(Config.NPC_DROPS[npc][3]) == 0) {
    Server.itemHandler.createGroundItem(c, Config.NPC_DROPS[npc][1], npcs[i].absX, npcs[i].absY, Config.NPC_DROPS[npc][2], c.playerId);
    System.out.println("Dropping.");
    « Last Edit: February 19, 2016, 01:28:36 AM by tank nation »

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #12 on: February 19, 2016, 11:09:57 AM »
    If it does nothing then it's not being executed.
    It's that simple.

    You know what you get to do (key word: you)? Find out why.

    First things first: Check if the dropItems(int i) method is used. Just literally search for "dropItems(" in the class, there should be at minimal 2 results. 1 being the method, and 1 being when it's used. If you only get 1 result, that's your problem.

    Next: If the method is being used, you get to try 2 things. 1) Add a similar debugging statement ABOVE where the method is used 2) Spawn npc 1 (man) and kill it. Check for drops and for the new debugging message.

    The reason you're killing a man is because that npc is in the npc list the OP provided for the tutorial.

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #13 on: February 19, 2016, 12:57:39 PM »
    If it does nothing then it's not being executed.
    It's that simple.

    You know what you get to do (key word: you)? Find out why.

    First things first: Check if the dropItems(int i) method is used. Just literally search for "dropItems(" in the class, there should be at minimal 2 results. 1 being the method, and 1 being when it's used. If you only get 1 result, that's your problem.

    Next: If the method is being used, you get to try 2 things. 1) Add a similar debugging statement ABOVE where the method is used 2) Spawn npc 1 (man) and kill it. Check for drops and for the new debugging message.

    The reason you're killing a man is because that npc is in the npc list the OP provided for the tutorial.

    K now on the rockcrab its show the message dropping like so.

    Code: [Select]
    public void dropItems(int i) {
    int npc = 0;
    Client c = (Client)Server.playerHandler.players[npcs[i].killedBy];
    if(c != null) {
    System.out.println("Dropping.");
    for(int o = 0; o < c.barrowsNpcs.length; o++){
    if(npcs[i].npcType == c.barrowsNpcs[o][0]) {
    c.barrowsNpcs[o][1] = 2; // 2 for dead
    c.barrowsKillCount++;
    }
    }
    if (npcs[i].npcType == 912 || npcs[i].npcType == 913 || npcs[i].npcType == 914)
    c.magePoints += 1;

    OfflineTree

    • Member
    • ****
    • Posts: 2,638
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #14 on: February 19, 2016, 10:05:08 PM »
    Dude, go figure it out.
    Quote
    <_^_> this community has really collapsed
    <_^_> it is like a shitty version of friendster for washed up nerds

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Changing back to config.java drops
    « Reply #15 on: February 20, 2016, 01:07:58 PM »
    Dude, go figure it out.

    Dude ok, will do! haha nah im honestly done with rsps it's pretty annoying and old fashion to many servers out as it is. I wanna create my own game ect.. i'm actually gonna learn to write java the right way this time before i go and waste 2k questions lol.

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal