Thread: Elvarg Base using diffrent NPC for shops

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Elvarg Base using diffrent NPC for shops 
    Registered Member
    Join Date
    Apr 2017
    Posts
    30
    Thanks given
    7
    Thanks received
    0
    Rep Power
    11
    i want to use for example bob and get an error bob is 505 in my npclist

    this is what i was using
    npc_spawns.json NPCoptionPacketListener

    works just fine when use 506 for Shop Keeper
    not sure why am not able to get 505 Bob to work

    I have Jave EE Developer tools installed from Market place.

    I've done Upper case BOB still gives same result

    error

    Code:
    Apr 12, 2017 3:05:10 PM com.elvarg.Elvarg main
    INFO: Initializing the game...
    Apr 12, 2017 3:05:10 PM com.elvarg.Elvarg main
    INFO: Loading definitions...
    java.lang.NullPointerException
    	at com.elvarg.world.entity.impl.npc.NPC.<init>(NPC.java:95)
    	at com.elvarg.definitions.NpcSpawnsDefinition$1.load(NpcSpawnsDefinition.java:39)
    	at com.elvarg.util.JsonLoader.load(JsonLoader.java:53)
    	at com.elvarg.Elvarg.lambda$5(Elvarg.java:87)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Apr 12, 2017 3:05:12 PM com.elvarg.Elvarg main
    INFO: Binding port 43595...
    Apr 12, 2017 3:05:12 PM com.elvarg.Elvarg main
    INFO: Starting game engine...
    Apr 12, 2017 3:05:12 PM com.elvarg.Elvarg main
    INFO: The loader has finished loading utility tasks.
    Apr 12, 2017 3:05:12 PM com.elvarg.Elvarg main
    INFO: Elvarg is now online on port 43595!

    npc_spawn.json

    Code:
    [
    	{
            "npcId": 7456,
            "x": 3095,
    		"y": 3513
        },
    	{
            "npcId": 5792,
            "x": 3091,
    		"y": 3509
        },
        {
            "npcId": 315,
            "x": 3095,
    		"y": 3503
        },
    	{
            "npcId": 1306,
            "x": 3098,
    		"y": 3509
        },
    	{
            "npcId": 3310,
            "x": 3091,
    		"y": 3506
        },
    	{
            "npcId": 506,
            "x": 3080,
    		"y": 3509
        },
    	{
            "npcId": 1158,
            "x": 3087,
    		"y": 3535
        },
    	{
            "npcId": 1158,
            "x": 3102,
    		"y": 3542
        },
    	{
            "npcId": 1158,
            "x": 3084,
    		"y": 3551
        },
    	{
            "npcId": 1158,
            "x": 3066,
    		"y": 3540
        },
    	{
            "npcId": 1158,
            "x": 3042,
    		"y": 3536
        },
    	{
            "npcId": 1158,
            "x": 3052,
    		"y": 3557
        },
    	{
            "npcId": 4096,
            "x": 3095,
    		"y": 3530
        },
    	{
            "npcId": 4096,
            "x": 3094,
    		"y": 3543
        },
    	{
            "npcId": 4096,
            "x": 3080,
    		"y": 3538
        },
    	{
            "npcId": 4096,
            "x": 3072,
    		"y": 3528
        },
    	{
            "npcId": 2054,
            "x": 3265,
    		"y": 3920
        },
    	{
            "npcId": 6504,
            "x": 3243,
    		"y": 3745
        },
    	{
            "npcId": 6609,
            "x": 3316,
    		"y": 3841
        }
    ]
    The npcId i want to add after npcId 6609

    Code:
    ,
    {
            "npcId": 505,
            "x": 3081,
    		"y": 3509
        }
    NPCOptionPacketListener

    Code:
    /** NPCS **/
    	private static final int EMBLEM_TRADER = 315;
    	private static final int MAKE_OVER_MAGE = 1306;
    	private static final int FINANCIAL_ADVISOR = 3310;
    	private static final int PERDU = 7456;
    	private static final int PARTY_PETE = 5792;
    	private static final int SHOP_KEEPER = 506;
    	public static final int Bob = 505;
    the Case for bob

    Code:
          switch(npc.getId()) {
    				
    				case SHOP_KEEPER:
    					Shop.open(player, Shop.GENERAL_SHOP);
    					break;
    
    				case PARTY_PETE:
    					Shop.open(player, Shop.GAMBLING_SHOP);
    					break;
    					
    				case MAKE_OVER_MAGE:
    					player.getPacketSender().sendInterfaceRemoval().sendInterface(3559);
    					player.getAppearance().setCanChangeAppearance(true);
    					break;
    case Bob:
    	Shop.open(player, Shop.PK_Gear);
    	break;
    npclist.txt

    Code:
    Bob - 505
    Shop keeper - 506
    Shop assistant - 507
    Shop keeper - 508
    Shop assistant - 509
    Shop keeper - 510
    Shop assistant - 511
    Shop keeper - 512
    Shop assistant - 513
    Shop keeper - 514
    Shop assistant - 515
    Shop keeper - 516
    Shop assistant - 517
    Shop keeper - 518
    Shop assistant - 519
    Am i missing something ?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Apr 2017
    Posts
    30
    Thanks given
    7
    Thanks received
    0
    Rep Power
    11
    if its my npc_spawns.json how does one add a new npc spawn of a diffrent npc number?
    im just confused as to how its not working after declaring in the following classes.

    i mean its where the , is added to the } bracket of spawn 6609
    then add spawn in the {} but somehow its not registering it as valid.
    ive checked the coords ingame aswell to see if were out of bounds which they are not.

    like so for spawning the npc.
    Code:
    {
            "npcId": 6609,
            "x": 3316,
    		"y": 3841
    
        },
    {
            "npcId": 505,
            "x": 3081,
    		"y": 3509
        }
    Reply With Quote  
     

  3. #3  
    doit4state

    Titador's Avatar
    Join Date
    Nov 2013
    Posts
    224
    Thanks given
    46
    Thanks received
    24
    Rep Power
    142
    Code:
    public static final int BOB = 505;
    Code:
    case BOB:
    	Shop.open(player, Shop.PK_GEAR);
    	break;
    In your Shop class PK_Gear needs to be renamed to PK_GEAR

    In shops.json add
    Code:
    {
          "id":#,
          "buys-items":true,
          "name":"PK Gear",
          "items":[
          ],
          "currency":13307
       }
    Spawns should look like this:
    Code:
    [
    	{
            "npcId": 7456,
            "x": 3095,
    		"y": 3513
        },
    	{
            "npcId": 5792,
            "x": 3091,
    		"y": 3509
        },
        {
            "npcId": 315,
            "x": 3095,
    		"y": 3503
        },
    	{
            "npcId": 1306,
            "x": 3098,
    		"y": 3509
        },
    	{
            "npcId": 3310,
            "x": 3091,
    		"y": 3506
        },
    	{
            "npcId": 506,
            "x": 3080,
    		"y": 3509
        },
    	{
            "npcId": 1158,
            "x": 3087,
    		"y": 3535
        },
    	{
            "npcId": 1158,
            "x": 3102,
    		"y": 3542
        },
    	{
            "npcId": 1158,
            "x": 3084,
    		"y": 3551
        },
    	{
            "npcId": 1158,
            "x": 3066,
    		"y": 3540
        },
    	{
            "npcId": 1158,
            "x": 3042,
    		"y": 3536
        },
    	{
            "npcId": 1158,
            "x": 3052,
    		"y": 3557
        },
    	{
            "npcId": 4096,
            "x": 3095,
    		"y": 3530
        },
    	{
            "npcId": 4096,
            "x": 3094,
    		"y": 3543
        },
    	{
            "npcId": 4096,
            "x": 3080,
    		"y": 3538
        },
    	{
            "npcId": 4096,
            "x": 3072,
    		"y": 3528
        },
    	{
            "npcId": 2054,
            "x": 3265,
    		"y": 3920
        },
    	{
            "npcId": 6504,
            "x": 3243,
    		"y": 3745
        },
    	{
            "npcId": 6609,
            "x": 3316,
    		"y": 3841
        },
    {
            "npcId": 505,
            "x": 3081,
    		"y": 3509
        }
    ]



    Click here to feed me!

    Quote Originally Posted by No1killme View Post
    If you are using Project Insanity base, you won't be able to do it because you can't turn into a npc ^.^
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Apr 2017
    Posts
    30
    Thanks given
    7
    Thanks received
    0
    Rep Power
    11
    changed Bob to BOB in NPCOptionPacketListener

    Code:
    public static final int BOB = 505;
    and changed to PK_GEAR in the case in NPCOptionPacketListener

    Code:
    case BOB:
    	Shop.open(player, Shop.PK_GEAR);
    	break;
    the highlighted is what i added to shops.json
    which is how it should look like right?

    Code:
    [
       {
          "id":0,
          "buys-items":true,
          "name":"OSRS Pk Shop",
          "items":[
             {
                "id":9520,
                "amount":2000000000
             },
    		 {
                "id":12849,
                "amount":2000000000
             },
             {
                "id":2545,
                "amount":2000000000
             },
             {
                "id":2542,
                "amount":2000000000
             },
             {
                "id":2544,
                "amount":2000000000
             },
             {
                "id":2543,
                "amount":2000000000
             },
             {
                "id":11128,
                "amount":2000000000
             },
             {
                "id":6585,
                "amount":2000000000
             },
             {
                "id":19553,
                "amount":2000000000
             },
             {
                "id":6570,
                "amount":2000000000
             },
             {
                "id":12954,
                "amount":2000000000
             },
             {
                "id":12006,
                "amount":2000000000
             },
             {
                "id":10551,
                "amount":2000000000
             },
             {
                "id":11773,
                "amount":2000000000
             },
             {
                "id":11771,
                "amount":2000000000
             },
             {
                "id":11770,
                "amount":2000000000
             },
             {
                "id":12879,
                "amount":2000000000
             },
             {
                "id":12873,
                "amount":2000000000
             },
             {
                "id":12875,
                "amount":2000000000
             },
             {
                "id":12883,
                "amount":2000000000
             },
             {
                "id":12881,
                "amount":2000000000
             },
             {
                "id":12877,
                "amount":2000000000
             },
             {
                "id":11785,
                "amount":2000000000
             },
             {
                "id":19478,
                "amount":2000000000
             },
             {
                "id":19481,
                "amount":2000000000
             },
             {
                "id":13576,
                "amount":2000000000
             },
             {
                "id":13652,
                "amount":2000000000
             },
             {
                "id":11838,
                "amount":2000000000
             },
    		 {
                "id":11808,
                "amount":2000000000
             },
             {
                "id":11804,
                "amount":2000000000
             },
             {
                "id":11806,
                "amount":2000000000
             },
             {
                "id":11802,
                "amount":2000000000
             },
             {
                "id":11791,
                "amount":2000000000
             },
             {
                "id":12821,
                "amount":2000000000
             },
             {
                "id":12825,
                "amount":2000000000
             },
             {
                "id":12817,
                "amount":2000000000
             },
             {
                "id":21003,
                "amount":2000000000
             },
             {
                "id":13263,
                "amount":2000000000
             },
    		 {
                "id":13271,
                "amount":2000000000
             },
             {
                "id":11663,
                "amount":2000000000
             },
             {
                "id":11664,
                "amount":2000000000
             },
             {
                "id":11665,
                "amount":2000000000
             },
             {
                "id":8839,
                "amount":2000000000
             },
             {
                "id":8840,
                "amount":2000000000
             },
             {
                "id":8842,
                "amount":2000000000
             },
             {
                "id":11832,
                "amount":2000000000
             },
             {
                "id":11834,
                "amount":2000000000
             },
             {
                "id":11836,
                "amount":2000000000
             },
             {
                "id":11826,
                "amount":2000000000
             },
             {
                "id":11828,
                "amount":2000000000
             },
             {
                "id":11830,
                "amount":2000000000
             },
             {
                "id":10334,
                "amount":2000000000
             },
             {
                "id":10330,
                "amount":2000000000
             },
             {
                "id":10332,
                "amount":2000000000
             },
             {
                "id":10336,
                "amount":2000000000
             },
             {
                "id":10342,
                "amount":2000000000
             },
             {
                "id":10338,
                "amount":2000000000
             },
             {
                "id":10340,
                "amount":2000000000
             },
             {
                "id":10344,
                "amount":2000000000
             },
             {
                "id":10350,
                "amount":2000000000
             },
             {
                "id":10348,
                "amount":2000000000
             },
             {
                "id":10346,
                "amount":2000000000
             },
             {
                "id":10352,
                "amount":2000000000
             },
             {
                "id":2581,
                "amount":2000000000
             },
    		 {
    			"id":12596,
                "amount":2000000000
    		 },
             {
                "id":2577,
                "amount":2000000000
             },
             {
                "id":6914,
                "amount":2000000000
             },
             {
                "id":6889,
                "amount":2000000000
             },
             {
                "id":20595,
                "amount":2000000000
             },
             {
                "id":20517,
                "amount":2000000000
             },
             {
                "id":20520,
                "amount":2000000000
             },
             {
                "id":2579,
                "amount":2000000000
             },
             {
                "id":12926,
                "amount":2000000000
             },
             {
                "id":12934,
                "amount":2000000000
             },
             {
                "id":12887,
                "amount":2000000000
             },
             {
                "id":12888,
                "amount":2000000000
             },
             {
                "id":12889,
                "amount":2000000000
             },
             {
                "id":12892,
                "amount":2000000000
             },
             {
                "id":12893,
                "amount":2000000000
             },
             {
                "id":12894,
                "amount":2000000000
             },
             {
                "id":1038,
                "amount":2000000000
             },
             {
                "id":1040,
                "amount":2000000000
             },
             {
                "id":1044,
                "amount":2000000000
             },
             {
                "id":1046,
                "amount":2000000000
             },
             {
                "id":1048,
                "amount":2000000000
             },
             {
                "id":1042,
                "amount":2000000000
             }
          ],
          "currency":13307
       },
       {
          "id":1,
          "buys-items":true,
          "name":"Party Pete's Gambling Shop",
          "items":[
             {
                "id":299,
                "amount":2000000000
             }
          ],
          "currency":13307
       },
       {
          "id":2,
          "buys-items":true,
          "name":"General Shop",
          "items":[
          ],
          "currency":13307
       },
       {
          "id":3,
          "buys-items":true,
          "name":"PK Gear",
          "items":[
          ],
          "currency":13307
       }
    ]

    the highlighted in green is what i added to my npc_spawns.json
    like mentioned to look like right?

    Code:
    [
    	{
            "npcId": 7456,
            "x": 3095,
    		"y": 3513
        },
    	{
            "npcId": 5792,
            "x": 3091,
    		"y": 3509
        },
        {
            "npcId": 315,
            "x": 3095,
    		"y": 3503
        },
    	{
            "npcId": 1306,
            "x": 3098,
    		"y": 3509
        },
    	{
            "npcId": 3310,
            "x": 3091,
    		"y": 3506
        },
    	{
            "npcId": 506,
            "x": 3080,
    		"y": 3509
        },
    	{
            "npcId": 1158,
            "x": 3087,
    		"y": 3535
        },
    	{
            "npcId": 1158,
            "x": 3102,
    		"y": 3542
        },
    	{
            "npcId": 1158,
            "x": 3084,
    		"y": 3551
        },
    	{
            "npcId": 1158,
            "x": 3066,
    		"y": 3540
        },
    	{
            "npcId": 1158,
            "x": 3042,
    		"y": 3536
        },
    	{
            "npcId": 1158,
            "x": 3052,
    		"y": 3557
        },
    	{
            "npcId": 4096,
            "x": 3095,
    		"y": 3530
        },
    	{
            "npcId": 4096,
            "x": 3094,
    		"y": 3543
        },
    	{
            "npcId": 4096,
            "x": 3080,
    		"y": 3538
        },
    	{
            "npcId": 4096,
            "x": 3072,
    		"y": 3528
        },
    	{
            "npcId": 2054,
            "x": 3265,
    		"y": 3920
        },
    	{
            "npcId": 6504,
            "x": 3243,
    		"y": 3745
        },
    	{
            "npcId": 6609,
            "x": 3316,
    		"y": 3841
        },
        {
            "npcId": 505,
            "x": 3081,
    		"y": 3509
        }
    ]
    Result Same as OP
    even did a redownload of the Elvarg Based Source from Oak


    Code:
    Apr 13, 2017 6:16:32 PM com.elvarg.Elvarg main
    INFO: Initializing the game...
    Apr 13, 2017 6:16:32 PM com.elvarg.Elvarg main
    INFO: Loading definitions...
    java.lang.NullPointerException
    	at com.elvarg.world.entity.impl.npc.NPC.<init>(NPC.java:95)
    	at com.elvarg.definitions.NpcSpawnsDefinition$1.load(NpcSpawnsDefinition.java:39)
    	at com.elvarg.util.JsonLoader.load(JsonLoader.java:53)
    	at com.elvarg.Elvarg.lambda$5(Elvarg.java:87)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Apr 13, 2017 6:16:33 PM com.elvarg.Elvarg main
    INFO: Binding port 43595...
    Apr 13, 2017 6:16:33 PM com.elvarg.Elvarg main
    INFO: Starting game engine...
    Apr 13, 2017 6:16:33 PM com.elvarg.Elvarg main
    INFO: The loader has finished loading utility tasks.
    Apr 13, 2017 6:16:33 PM com.elvarg.Elvarg main
    INFO: Elvarg is now online on port 43595!
    Reply With Quote  
     

  5. #5  
    Theory Wins?
    Greyfield's Avatar
    Join Date
    Nov 2008
    Age
    32
    Posts
    1,585
    Thanks given
    61
    Thanks received
    265
    Rep Power
    310
    No, your shop name in the JSON format needs to be identical to the Enum value you defined; which is PK_GEAR.


    OR, assuming Elvarg uses the GSON library, you can annotate the value with -

    Code:
    SerializedName("PK Gear")
    - Nevermind, just realized that won't work without doing it manually and defining a TypeAdapater.



    Reply With Quote  
     

  6. #6  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    its the npc spawns json file , post the entire thing
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Apr 2017
    Posts
    30
    Thanks given
    7
    Thanks received
    0
    Rep Power
    11
    this is the npcspawns.json
    the highlighted in green is what I added with the , added to the } bracket of the last spawn

    Code:
    [
    	{
            "npcId": 7456,
            "x": 3095,
    		"y": 3513
        },
    	{
            "npcId": 5792,
            "x": 3091,
    		"y": 3509
        },
        {
            "npcId": 315,
            "x": 3095,
    		"y": 3503
        },
    	{
            "npcId": 1306,
            "x": 3098,
    		"y": 3509
        },
    	{
            "npcId": 3310,
            "x": 3091,
    		"y": 3506
        },
    	{
            "npcId": 506,
            "x": 3080,
    		"y": 3509
        },
    	{
            "npcId": 1158,
            "x": 3087,
    		"y": 3535
        },
    	{
            "npcId": 1158,
            "x": 3102,
    		"y": 3542
        },
    	{
            "npcId": 1158,
            "x": 3084,
    		"y": 3551
        },
    	{
            "npcId": 1158,
            "x": 3066,
    		"y": 3540
        },
    	{
            "npcId": 1158,
            "x": 3042,
    		"y": 3536
        },
    	{
            "npcId": 1158,
            "x": 3052,
    		"y": 3557
        },
    	{
            "npcId": 4096,
            "x": 3095,
    		"y": 3530
        },
    	{
            "npcId": 4096,
            "x": 3094,
    		"y": 3543
        },
    	{
            "npcId": 4096,
            "x": 3080,
    		"y": 3538
        },
    	{
            "npcId": 4096,
            "x": 3072,
    		"y": 3528
        },
    	{
            "npcId": 2054,
            "x": 3265,
    		"y": 3920
        },
    	{
            "npcId": 6504,
            "x": 3243,
    		"y": 3745
        },
    	{
            "npcId": 6609,
            "x": 3316,
    		"y": 3841
        },
        {
            "npcId": 505,
            "x": 3081,
    		"y": 3509
        }
    ]
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Apr 2017
    Posts
    30
    Thanks given
    7
    Thanks received
    0
    Rep Power
    11
    posted npcspawns
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Apr 2017
    Posts
    30
    Thanks given
    7
    Thanks received
    0
    Rep Power
    11
    Reply With Quote  
     

  10. #10  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Ok I looked at the error too fast, sorry. It seems you're spawning an npc which you haven't added a definition for.
    Add its definition in the npc_definitions.json file before spawning it.

    Non-combat npc definition example:
    Code:
    	{
    		"npcId": 505,
           		"name": "Bob",
    		"examine": "Runs a shop."
    	}
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  11. Thankful user:


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. Replies: 399
    Last Post: 12-08-2021, 06:06 AM
  2. My idea i was going to use for shopping
    By Pantera in forum Help
    Replies: 3
    Last Post: 06-01-2012, 10:19 AM
  3. [PI] Npc for Shop
    By EricFtw in forum Help
    Replies: 2
    Last Post: 07-27-2011, 06:45 PM
  4. Remove auto retaliate for some npc's (shops)
    By Nintendo in forum Requests
    Replies: 5
    Last Post: 09-15-2009, 01:46 AM
  5. Bank Withdraw X: Base for shops too.
    By Soulevoker in forum Snippets
    Replies: 54
    Last Post: 05-12-2009, 09:47 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •