Thread: 718 Getting Shop Sell Price

Results 1 to 10 of 10
  1. #1 718 Getting Shop Sell Price 
    Scrub Lord
    _Will's Avatar
    Join Date
    Aug 2012
    Posts
    537
    Thanks given
    60
    Thanks received
    61
    Rep Power
    34
    Does anyone know how to get the sell price from shops? My guess its coming from the cache so i looked in my ItemDefinitions and nothing is there for it. If someone knows a way to find where it pulls from or better yet the code to use it in Shops.java.

    NOTE: This is not the buy price from item.getDefinitions().getValue()

    EDIT: I know a lot of the items sold back to the vender is buyPrice / 3.333333 but some items like air staff's and other items have different sell prices that are loaded in the shop interface

    This is sell interface where it shows the sell price:

    Attached image
    Last edited by _Will; 10-15-2019 at 11:30 AM.
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Nov 2015
    Age
    24
    Posts
    1,980
    Thanks given
    334
    Thanks received
    1,051
    Rep Power
    5000
    it's probably in the params (opcode 249) of the itemdefinition
    Reply With Quote  
     

  3. #3  
    Developer


    Join Date
    Jul 2016
    Posts
    350
    Thanks given
    59
    Thanks received
    33
    Rep Power
    112
    I assume by sell price you mean the value it's showing under the item icon.

    This is done via the cache, yes.
    Reply With Quote  
     

  4. #4  
    Scrub Lord
    _Will's Avatar
    Join Date
    Aug 2012
    Posts
    537
    Thanks given
    60
    Thanks received
    61
    Rep Power
    34
    Quote Originally Posted by Tommeh View Post
    it's probably in the params (opcode 249) of the itemdefinition
    I checked the opcode 249 and its already used for client script data. Not sure if thats the right opcode. I tried sysout ing the data and got a bunch of random numbers and text.

    This the opcode used

    Code:
    } else if (opcode == 249) {
    			int length = stream.readUnsignedByte();
    			if (clientScriptData == null)
    				clientScriptData = new HashMap<Integer, Object>(length);
    			for (int index = 0; index < length; index++) {
    				boolean stringInstance = stream.readUnsignedByte() == 1;
    				int key = stream.read24BitInt();
    				Object value = stringInstance ? stream.readString() : stream
    						.readInt();
    				clientScriptData.put(key, value);
    				System.out.println(clientScriptData.get(key));
    			}

    When launching server it sent a bunch text like this:

    Code:
    Remove
    6000
    18000
    1
    Activate aura
    Aura time remaining
    Remove
    6000
    18000
    1
    Activate aura
    Aura time remaining
    Remove
    6000
    24000
    1
    10
    10
    10
    10
    10
    5
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Nov 2015
    Age
    24
    Posts
    1,980
    Thanks given
    334
    Thanks received
    1,051
    Rep Power
    5000
    if it's not in params, id just try to look into the cs2 script and find out where it gets the value from
    Reply With Quote  
     

  6. #6  
    WhiteDownMb | HYBRID JEFE
    Brett the Don's Avatar
    Join Date
    Dec 2009
    Posts
    2,117
    Thanks given
    349
    Thanks received
    556
    Rep Power
    2540
    Its cache sided you will have to repack all the item values, I used to have a program that did all of them for me but sadly I moved on from 718 or I would give it to you. I may have some code laying around I might have changed where it reads from later on in my development if I did and I find it I will pm you or edit this for your answer just give me a day or so.

    All of humanity's problems stem from man's
    inability to sit quietly in a room by himself




    Reply With Quote  
     

  7. #7  
    Donator
    Join Date
    Aug 2017
    Posts
    6
    Thanks given
    0
    Thanks received
    5
    Rep Power
    0
    Here are the scripts that decides the item price:
    Code:
    [proc,buyprice](obj $obj0)(int)
    if ($obj0 = null) {
      return(0);
    }
    $obj0 = oc_uncert($obj0);
    def_int $int1 = enum(obj, int, 731, $obj0);
    if (%var532 = 6529 & $int1 ! -1 & $int1 > 0) {
        return($int1);
    }
    $int1 = enum(obj, int, 733, $obj0);
    if ($int1 ! -1 & $int1 > 0) {
        return($int1);
    }
    if (oc_param($obj0, 258) = 1 | oc_param($obj0, 259) = 1) {
        return(99000);
    }
    $int1 = oc_cost($obj0);
    if (%var532 = 6529) {
        $int1 = scale(3, 2, $int1);
    }
    return(max($int1, 1));
    Code:
    [proc,sellprice](obj $obj0)(int)
    if ($obj0 = null) {
        return(0);
    }
    $obj0 = oc_uncert($obj0);
    def_int $int1 = enum(obj, int, 732, $obj0);
    if (%var532 = 6529 & $int1 ! -1) {
        return($int1);
    }
    $int1 = enum(obj, int, 1441, $obj0);
    if ($int1 ! -1 & $int1 > 0) {
        return($int1);
    }
    $int1 = max(1, scale(oc_cost($obj0), 100, 30));
    return($int1);
    In-case you don't know, enums are in index 17 more commonly known as CSMap(s) in Matrix based servers. OC is object config which is ItemDefinition in Matrix, varps are just sendConfig in Matrix.
    Reply With Quote  
     

  8. #8  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    ^ They're 30% of cache price, can also be seen from Schedule's post where it scales it to 30 out of 100.
    Code:
    $int1 = max(1, scale(oc_cost($obj0), 100, 30));
    Attached image
    Reply With Quote  
     

  9. #9  
    Scrub Lord
    _Will's Avatar
    Join Date
    Aug 2012
    Posts
    537
    Thanks given
    60
    Thanks received
    61
    Rep Power
    34
    Quote Originally Posted by Schedule View Post
    Here are the scripts that decides the item price:
    Code:
    [proc,buyprice](obj $obj0)(int)
    if ($obj0 = null) {
      return(0);
    }
    $obj0 = oc_uncert($obj0);
    def_int $int1 = enum(obj, int, 731, $obj0);
    if (%var532 = 6529 & $int1 ! -1 & $int1 > 0) {
        return($int1);
    }
    $int1 = enum(obj, int, 733, $obj0);
    if ($int1 ! -1 & $int1 > 0) {
        return($int1);
    }
    if (oc_param($obj0, 258) = 1 | oc_param($obj0, 259) = 1) {
        return(99000);
    }
    $int1 = oc_cost($obj0);
    if (%var532 = 6529) {
        $int1 = scale(3, 2, $int1);
    }
    return(max($int1, 1));
    Code:
    [proc,sellprice](obj $obj0)(int)
    if ($obj0 = null) {
        return(0);
    }
    $obj0 = oc_uncert($obj0);
    def_int $int1 = enum(obj, int, 732, $obj0);
    if (%var532 = 6529 & $int1 ! -1) {
        return($int1);
    }
    $int1 = enum(obj, int, 1441, $obj0);
    if ($int1 ! -1 & $int1 > 0) {
        return($int1);
    }
    $int1 = max(1, scale(oc_cost($obj0), 100, 30));
    return($int1);
    In-case you don't know, enums are in index 17 more commonly known as CSMap(s) in Matrix based servers. OC is object config which is ItemDefinition in Matrix, varps are just sendConfig in Matrix.
    Sorry none of this code makes sense to me and I don't think this is correct either. I tried importing ur code but it looks not even java.

    Quote Originally Posted by Kris View Post
    ^ They're 30% of cache price, can also be seen from Schedule's post where it scales it to 30 out of 100.
    Code:
    $int1 = max(1, scale(oc_cost($obj0), 100, 30));
    I use this currently to get close to the sale price but its not accurate for all items. For example air staffs buy price is 1500 and sell price is 20. But most other item is just 50% less than high alch price, which is the same as 30% of cache price.

    If you look at the prices on zaffs staff shop it shows the different sell and buy prices. This is the same prices for rs3 and matrix rsps btw:
    https://runescape.wiki/w/Zaff%27s_Superior_Spellcasting

    Quote Originally Posted by Brett the Don View Post
    Its cache sided you will have to repack all the item values, I used to have a program that did all of them for me but sadly I moved on from 718 or I would give it to you. I may have some code laying around I might have changed where it reads from later on in my development if I did and I find it I will pm you or edit this for your answer just give me a day or so.
    It would be awesome if you can find the code to pack them or atleast the file filled with the correct prices. But If you cant please try to explain to me how to pack them. By that you mean like pack them into a txt file right? Couldn't this be done without putting them into a txt file and code them straight in pulling from cache?
    Reply With Quote  
     

  10. #10  
    Donator
    Join Date
    Aug 2017
    Posts
    6
    Thanks given
    0
    Thanks received
    5
    Rep Power
    0
    Quote Originally Posted by _Will View Post
    Sorry none of this code makes sense to me and I don't think this is correct either. I tried importing ur code but it looks not even java.

    The code is 100% correct since it is taken from the cache directly, however, if it doesn't make sense to you then :/ I will try to explain it in short, the price is determined in multiple places:

    1. For the buy price of the runes, most of them, they are in CSMap 731 (Enum 731)
    2. For the sell price of the Death Rune and Chaos Rune, they are in CSMap 732 (Enum 732)
    3. For the sell price of Staff of Air, Charge bow, Spirit shards, and Spirit shard pack, they are in CSMap 1441 (Enum 1441)
    4. A lot of the farming items and some additional items are in CSMap 733 (Enum 733)
    5. For the rest of the items, the are located in item definitions cost opcode (value)


    If it is none of these, your item's value must have been hardcoded somewhere in the client.
    Reply With Quote  
     


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. 718 Edit Shop Interface Prices
    By FatherBob in forum Help
    Replies: 2
    Last Post: 05-20-2014, 09:50 PM
  2. More Accurate Shop Sell Price
    By _jordan in forum Configuration
    Replies: 4
    Last Post: 10-20-2013, 03:21 AM
  3. Shop Sell Price
    By spacebarr in forum Help
    Replies: 13
    Last Post: 12-19-2012, 09:42 AM
  4. [667/718] Cant Change Selling Prices
    By xpgbeast in forum Help
    Replies: 16
    Last Post: 11-24-2012, 03:43 PM
  5. Replies: 1
    Last Post: 09-10-2012, 09:51 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
  •