[Dev] Full inventory view

🚫
Exiled
Joined
May 26, 2010
Messages
116
Reaction score
65
I am currently working on a full inventory view, from the web. I want to include the display of the awakenings and the upgrades. Sp far i have got a table of the item id's up. What I am currently working on is figuring out the awake code, from the INVENTORY_TBL.
For those who did not see how the m_Inventory code looks like here it is:
Code:
0,500,0,0,,1,0,3600000,0,0,0,-1367267205,1,0,0,0,0/
1,16722,0,0,,1,0,9000000,0,0,0,-1177264204,0,0,0,0,0/
2,4805,0,0,,9,0,0,0,0,0,-24516137,0,0,0,0,0/
3,4806,0,0,,1,0,-1,0,0,0,-2050955612,0,0,0,0,0/
4,22505,0,0,,1,0,7200000,0,0,2,1183714363,0,0,0,0,0/
5,5104,0,0,,1,0,-1,0,0,0,2012191601,0,0,0,0,0/
6,21029,0,0,,1,0,-1,0,0,0,-1582266442,0,0,0,0,0/
7,2035,0,0,,2,0,-1,0,0,0,610567834,0,0,0,0,0/
8,2036,0,0,,1,0,-1,0,0,0,1035776021,0,0,0,0,0/
9,26468,0,0,,1,0,-1,0,0,0,1972121811,0,0,0,0,0/
10,26528,0,0,,1,0,-1,0,0,0,604414262,0,0,0,0,0/
11,21041,0,0,,1,0,-1,0,0,1,-2008666152,0,0,0,0,0/
12,26456,0,0,,997,0,-1,0,0,0,363438754,0,0,0,0,0/
13,5102,0,0,,1,0,-1,0,0,0,-2085854648,0,0,0,0,0/
14,11,0,0,,1,0,-1,0,0,0,-1218819801,0,0,0,0,0/
15,21054,0,0,,1,0,-1,0,0,0,1609339101,0,0,0,0,0/
16,21029,0,0,,1,0,-1,0,0,0,-599511839,0,0,0,0,0/
17,21051,0,0,,1,0,-1,0,0,0,897136242,0,0,0,0,0/
18,21053,0,0,,1,0,-1,0,0,0,666959636,0,0,0,0,0/
19,20113,0,0,,1,0,-1,0,0,0,-377012745,0,0,0,0,0/
20,21086,0,0,,1,0,-1,0,0,0,-869923242,0,0,0,0,0/
21,20186,0,0,,1,0,-1,0,0,0,-1874135923,0,0,0,0,0/
22,20187,0,0,,1,0,-1,0,0,0,2029933852,0,0,0,0,0/
23,26854,0,0,,1,0,-1,0,0,0,2073373662,0,0,0,0,0/
24,26464,0,0,,1,0,-1,0,0,0,-1507507647,0,0,0,0,0/
25,2830,0,0,,2,0,-1,0,0,0,-1347870776,0,0,0,0,0/
26,2950,0,0,,86,0,-1,0,0,0,18986978,0,0,0,0,0/
27,20129,0,0,,1,0,-1,0,0,0,-1897765827,0,0,0,0,0/
28,5819,0,0,,1,0,-1,0,0,0,558464813,0,0,0,0,0/
29,20126,0,0,,1,0,-1,0,0,0,-2085122598,0,0,0,0,0/
30,20127,0,0,,1,0,-1,0,0,0,1843194238,0,0,0,0,0/
31,22545,0,0,,1,0,-1,0,0,2,1343638380,10,0,0,0,0/
32,22546,0,0,,1,0,4500000,0,0,2,-511476442,10,4,20,0,0/
33,22547,0,0,,1,0,4500000,0,0,2,105214927,10,4,20,0,0/
34,22548,0,0,,1,0,4500000,0,0,2,508370718,10,4,20,0,0/
35,16597,0,0,,1,0,3600000,0,0,0,-1624877184,0,0,0,0,0/
36,22500,0,0,,1,0,7200000,0,0,2,-1994239522,10,2,20,0,0/
38,16721,0,0,,1,0,3600000,0,0,0,-1037065081,0,0,0,0,0/
39,26419,0,0,,150,0,0,0,0,0,-367434763,0,0,0,0,0/
40,16723,0,0,,1,0,5850000,0,0,0,-1915893795,0,0,0,0,0/
41,16724,0,0,,1,0,4500000,0,0,0,-982409390,0,0,0,0,0/
42,506,0,0,,1,0,5850000,0,0,0,-649968956,0,0,0,0,0/
43,510,0,0,,1,0,4500000,0,0,0,421942701,0,0,0,0,0/
44,21,0,0,,1,0,7200000,0,0,0,-1808047902,0,0,0,0,0/
45,2800,0,0,,90,0,0,0,0,0,-2053550989,0,0,0,0,0/
46,26468,0,0,,1,0,-1,0,0,0,-870152076,0,0,0,0,0/
47,22500,0,0,,1,0,7200000,0,0,2,77658764,10,4,20,0,0/
48,30085,0,0,,1,0,9000000,0,0,0,-150362013,0,0,0,0,0/
49,16599,0,0,,1,0,5850000,0,0,0,-1975977474,0,0,0,0,0/
50,16600,0,0,,1,0,4500000,0,0,0,249693535,0,0,0,0,0/
51,21011,0,0,,1,0,0,0,0,0,-2061636897,0,0,0,0,0/
52,21011,0,0,,1,0,0,0,0,0,362565213,0,0,0,0,0/
$
This corresponds to the m_apIndex which maps the slots where the items go. I am now trying to figure out an algorithm that creates the awakes and the elements/upgrades.
(Sidenote: My English sucked at above, sorry, I've been up for 16 hours now :(
 
Last edited:
I am currently working on a full inventory view, from the web. I want to include the display of the awakenings and the upgrades. Sp far i have got a table of the item id's up. What I am currently working on is figuring out the awake code, from the INVENTORY_TBL.
For those who did not see how the m_Inventory code looks like here it is:
Code:
0,500,0,0,,1,0,3600000,0,0,0,-1367267205,1,0,0,0,0/
1,16722,0,0,,1,0,9000000,0,0,0,-1177264204,0,0,0,0,0/
2,4805,0,0,,9,0,0,0,0,0,-24516137,0,0,0,0,0/
3,4806,0,0,,1,0,-1,0,0,0,-2050955612,0,0,0,0,0/
4,22505,0,0,,1,0,7200000,0,0,2,1183714363,0,0,0,0,0/
5,5104,0,0,,1,0,-1,0,0,0,2012191601,0,0,0,0,0/
6,21029,0,0,,1,0,-1,0,0,0,-1582266442,0,0,0,0,0/
7,2035,0,0,,2,0,-1,0,0,0,610567834,0,0,0,0,0/
8,2036,0,0,,1,0,-1,0,0,0,1035776021,0,0,0,0,0/
9,26468,0,0,,1,0,-1,0,0,0,1972121811,0,0,0,0,0/
10,26528,0,0,,1,0,-1,0,0,0,604414262,0,0,0,0,0/
11,21041,0,0,,1,0,-1,0,0,1,-2008666152,0,0,0,0,0/
12,26456,0,0,,997,0,-1,0,0,0,363438754,0,0,0,0,0/
13,5102,0,0,,1,0,-1,0,0,0,-2085854648,0,0,0,0,0/
14,11,0,0,,1,0,-1,0,0,0,-1218819801,0,0,0,0,0/
15,21054,0,0,,1,0,-1,0,0,0,1609339101,0,0,0,0,0/
16,21029,0,0,,1,0,-1,0,0,0,-599511839,0,0,0,0,0/
17,21051,0,0,,1,0,-1,0,0,0,897136242,0,0,0,0,0/
18,21053,0,0,,1,0,-1,0,0,0,666959636,0,0,0,0,0/
19,20113,0,0,,1,0,-1,0,0,0,-377012745,0,0,0,0,0/
20,21086,0,0,,1,0,-1,0,0,0,-869923242,0,0,0,0,0/
21,20186,0,0,,1,0,-1,0,0,0,-1874135923,0,0,0,0,0/
22,20187,0,0,,1,0,-1,0,0,0,2029933852,0,0,0,0,0/
23,26854,0,0,,1,0,-1,0,0,0,2073373662,0,0,0,0,0/
24,26464,0,0,,1,0,-1,0,0,0,-1507507647,0,0,0,0,0/
25,2830,0,0,,2,0,-1,0,0,0,-1347870776,0,0,0,0,0/
26,2950,0,0,,86,0,-1,0,0,0,18986978,0,0,0,0,0/
27,20129,0,0,,1,0,-1,0,0,0,-1897765827,0,0,0,0,0/
28,5819,0,0,,1,0,-1,0,0,0,558464813,0,0,0,0,0/
29,20126,0,0,,1,0,-1,0,0,0,-2085122598,0,0,0,0,0/
30,20127,0,0,,1,0,-1,0,0,0,1843194238,0,0,0,0,0/
31,22545,0,0,,1,0,-1,0,0,2,1343638380,10,0,0,0,0/
32,22546,0,0,,1,0,4500000,0,0,2,-511476442,10,4,20,0,0/
33,22547,0,0,,1,0,4500000,0,0,2,105214927,10,4,20,0,0/
34,22548,0,0,,1,0,4500000,0,0,2,508370718,10,4,20,0,0/
35,16597,0,0,,1,0,3600000,0,0,0,-1624877184,0,0,0,0,0/
36,22500,0,0,,1,0,7200000,0,0,2,-1994239522,10,2,20,0,0/
38,16721,0,0,,1,0,3600000,0,0,0,-1037065081,0,0,0,0,0/
39,26419,0,0,,150,0,0,0,0,0,-367434763,0,0,0,0,0/
40,16723,0,0,,1,0,5850000,0,0,0,-1915893795,0,0,0,0,0/
41,16724,0,0,,1,0,4500000,0,0,0,-982409390,0,0,0,0,0/
42,506,0,0,,1,0,5850000,0,0,0,-649968956,0,0,0,0,0/
43,510,0,0,,1,0,4500000,0,0,0,421942701,0,0,0,0,0/
44,21,0,0,,1,0,7200000,0,0,0,-1808047902,0,0,0,0,0/
45,2800,0,0,,90,0,0,0,0,0,-2053550989,0,0,0,0,0/
46,26468,0,0,,1,0,-1,0,0,0,-870152076,0,0,0,0,0/
47,22500,0,0,,1,0,7200000,0,0,2,77658764,10,4,20,0,0/
48,30085,0,0,,1,0,9000000,0,0,0,-150362013,0,0,0,0,0/
49,16599,0,0,,1,0,5850000,0,0,0,-1975977474,0,0,0,0,0/
50,16600,0,0,,1,0,4500000,0,0,0,249693535,0,0,0,0,0/
51,21011,0,0,,1,0,0,0,0,0,-2061636897,0,0,0,0,0/
52,21011,0,0,,1,0,0,0,0,0,362565213,0,0,0,0,0/
$
This corresponds to the m_apIndex which maps the slots where the items go. I am now trying to figure out an algorithm that creates the awakes and the elements/upgrades.
(Sidenote: My English sucked at above, sorry, I've been up for 16 hours now :(

Awakening slots are 10x as hard as parsing the inventory(item id, upgrade, element, position). It's basically an array of 59 arrays containing 17 integers each. Once you know that, it's pretty easy to parse.
 
@mootie, i already have the element etc done, now trying to figure out awakenings (:
Code:
[COLOR="RoyalBlue"]44[/COLOR],[COLOR="Magenta"]21[/COLOR],0,0,,1,0,7200000,0,0,0,-1481028493,[color='red']5[/color],[color='green']4[/color],[color='blue']5[/color],0,0/
red=upgrade +
green=element id
blue=element +
RoyalBlue=slot(needs to be matched with m_apIndex)
pink=item id

---------- Post added at 10:28 PM ---------- Previous post was at 10:01 PM ----------

update:
The awake is contained in the INVENTORY_EXT_TBL, 1st slot has been figured out

---------- Post added at 10:36 PM ---------- Previous post was at 10:28 PM ----------

another update, each awake goes up by 256, equivelent of hex: FF
so str+1=262400, str+2=262656, str+3=262912
so str equation would be: (256*x)262144=y

---------- Post added at 11:19 PM ---------- Previous post was at 10:36 PM ----------

str -0 + str -0 = 68719738880, trying to figure that algorithm, 2 slots awakening. Have got nothing so far, if anyone notices a pattern please pm me or reply

---------- Post added at 11:57 PM ---------- Previous post was at 11:19 PM ----------

(262144*x)+(256*y)=z
/sro x y

---------- Post added 06-14-2010 at 12:11 AM ---------- Previous post was 06-13-2010 at 11:57 PM ----------

slot 2 algorithm discovered, under testing...
 
Last edited:
nice job you're doing here. For some reason, I remember something related to awakening's algorithm written somewhere, not sure if it's on RZ, but I remember reading something regarding it.. But meh, seems that you're progressing well enough. good luck
 
just a small tool i made for ppl to calculate the slot 1:
you can be assured there is no virus as it's just a c++ calculator

---------- Post added at 02:06 AM ---------- Previous post was at 12:50 AM ----------

here it is reversed back into sro form, from the awakening value, again only slot1:
 
Last edited:
@mootie, i already have the element etc done, now trying to figure out awakenings (:
Code:
[COLOR="RoyalBlue"]44[/COLOR],[COLOR="Magenta"]21[/COLOR],0,0,,1,0,7200000,0,0,0,-1481028493,[color='red']5[/color],[color='green']4[/color],[color='blue']5[/color],0,0/
red=upgrade +
green=element id
blue=element +
RoyalBlue=slot(needs to be matched with m_apIndex)
pink=item id
slotid, itemid, ?,?,,amount,?,duration,refine,element,element refine,?, cs item/$
some more details
 
Semih

in the code pain posted

the 44 is the id of the slot
21 is the ID of the item (Wooden sword in this case)
5 is the upgrade amount of the item
4 is the ID of the Element
and 5 is the amount of Element upgraded

i only said the numbers that have colors in that code
 
who knows what the << operation does in vb, kind of clueless lol...
i mean 1 << 5 = 32, and 2 << 3 = 16

---------- Post added at 02:27 AM ---------- Previous post was at 12:46 AM ----------

get length with this function
it's basically a eocrm function changed into c++, because i hate vb :(
Code:
int getsize(long nRandomOption){
cin >> nRandomOption;
int nSize = 0;
long k = 0;
int l = 0;
int MAX_RANDOM_OPTION = 3;
k = [b][color="red"]0x3ffff << 8;[/color][/b]
for (l = 0; l <= MAX_RANDOM_OPTION; l++){
	if(nRandomOption & k){
		nSize = nSize + 1;
	}
	else{
		return nSize;
	}
	k = k << 18;
}
return nSize;
}
red: anyone know how to do this in php? :)
 
Last edited:
Thanks spiken, very useful if it's needed to be coded into a website ;>
 
full c++ sample program source:
Code:
// slot1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
int getsize(long nRandomOption){
int nSize = 0;
long k = 0;
int l = 0;
int MAX_RANDOM_OPTION = 3;
k = 0x3ffff << 8;
for (l = 0; l <= MAX_RANDOM_OPTION; l++){
	if(nRandomOption & k){
		nSize = nSize + 1;
	}
	else{
		return nSize;
	}
	k = k << 18;
}
return nSize;
}
//iRandomOptItemId=item random option value(fromdb)
//k=size of rand opt
bool getrand(long iRandomOptItemId, int k, int& nDst, int& nAdj){
	int MAX_RANDOM_OPTION = 3;
	long iRandomOption = 0;
	if (k < MAX_RANDOM_OPTION){
		iRandomOption = iRandomOptItemId >> (8 + k * 18);
		nAdj=int(iRandomOption & 0x1ff);
	}
	else{
		return false;
	}
	if (iRandomOption & 0x200){
		nAdj = -nAdj;
	}
	iRandomOption = iRandomOption >> 10;
	nDst=iRandomOption & 0xff;
	return (nDst > 0);
}
int _tmain(int argc, _TCHAR* argv[])
{
	[b]int s;[/b]
	std::cin >> s;
	int z=getsize(s);
	printf ("\n/sro "); 
	int k = 0;
    int nDst = 0;
    int nAdj = 0;
	for (k = 0; k <= z; k++){
		if (getrand(s, k, nDst, nAdj)==true){
			std::cout << nDst << " " << nAdj << " ";
		}
	}
	printf("\n");
	system("pause");
}
Do what you need to do with it, but I am not responsible for your actions :)
 
Last edited:
full c++ sample program source:
Code:
// slot1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
int getsize(long nRandomOption){
int nSize = 0;
long k = 0;
int l = 0;
int MAX_RANDOM_OPTION = 3;
k = 0x3ffff << 8;
for (l = 0; l <= MAX_RANDOM_OPTION; l++){
	if(nRandomOption & k){
		nSize = nSize + 1;
	}
	else{
		return nSize;
	}
	k = k << 18;
}
return nSize;
}
//iRandomOptItemId=item random option value(fromdb)
//k=size of rand opt
bool getrand(long iRandomOptItemId, int k, int& nDst, int& nAdj){
	int MAX_RANDOM_OPTION = 3;
	long iRandomOption = 0;
	if (k < MAX_RANDOM_OPTION){
		iRandomOption = iRandomOptItemId >> (8 + k * 18);
		nAdj=int(iRandomOption & 0x1ff);
	}
	else{
		return false;
	}
	if (iRandomOption & 0x200){
		nAdj = -nAdj;
	}
	iRandomOption = iRandomOption >> 10;
	nDst=iRandomOption & 0xff;
	return (nDst > 0);
}
int _tmain(int argc, _TCHAR* argv[])
{
	int s;
	std::cin >> s;
	int z=getsize(s);
	printf ("\n/sro "); 
	int k = 0;
    int nDst = 0;
    int nAdj = 0;
	for (k = 0; k <= z; k++){
		if (getrand(s, k, nDst, nAdj)==true){
			std::cout << nDst << " " << nAdj << " ";
		}
	}
	printf("\n");
	system("pause");
}
Do what you need to do with it, but I am not responsible for your actions :)

Very nice!
 
update: for some odd reason the c++ isn't generating correctly, here is the same function in vb:
Code:
Function GetRandomOption(ByVal iRandomOptItemId As Long, ByVal k As Integer, ByRef nDst As Integer, ByRef nAdj As Integer) As String
        Dim MAX_RANDOM_OPTION As Integer = 3
        'Dim iRandomOption As Integer
        Dim iRandomOption As Long

        If k < MAX_RANDOM_OPTION Then
            iRandomOption = iRandomOptItemId >> (8 + k * 18)
            'nAdj = iRandomOption and &H000001FF
            nAdj = int(iRandomOption And &H1FF)
        Else
            Return False
        End If

        If iRandomOption And &H200 Then
            nAdj = -nAdj
        End If

        iRandomOption = iRandomOption >> 10
        nDst = iRandomOption And &HFF

        'response.write ("nDst: " & nDst &"<br>")

        Return (nDst > 0)
    End Function
The problem with the C++ code is that an integer cannot handle a value higher then 2.3b(thanks for finding spikensbror)
 
Last edited:
Back