[Dev] Full inventory view

A fixed version of the code would be:

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[])
{
	long 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");
}
 
k not so great with C++ but i was told this is the awake -1481028493
don't quote me on this just relaying a message
 
Funny, I'm trying to make the same thing (flyffarmory :D) and ran into the same problems. Getting items and upgrades out of the inventory with a nice layout is easy but the awakenings...different story =(
 
Back