[insert_php]
$gems = array(
“Aquamarine”,
“Topaz”,
“Sunstone”,
“Agate”,
“Diamond”,
“Sapphire”
);
$spells = array(
“Haste”,
“Focus”,
“Power”,
“Shield”,
“Meditate”,
“Army”,
“Enlighten”
);
$archerSpecs = array(
“Default”,
“Sniper”,
“Falconeer”
);
$rogueSpecs = array(
“Default”,
“Assassin”
);
$frostmageSpecs = array(
“Default”,
“Trickster”,
“Stormmage”
);
$firemageSpecs = array(
“Default”,
“Pyromancer”,
“Lightningmage”,
“Bombermage”
);
$alchemistSpecs = array(
“Default”,
“Deathdealer”,
“Necromancer”
);
$bardSpecs = array(
“Default”,
“Mimic”,
“Scout”
);
$code = htmlspecialchars($_POST[‘code’]);
$statArray = explode(“%”, $code);
$userName = $statArray[0];
$classRanks = $statArray[1];
$classSpecs = $statArray[2];
$archerRank = $classRanks[0];
$rogueRank = $classRanks[1];
$frostmageRank = $classRanks[2];
$firemageRank = $classRanks[3];
$alchemistRank = $classRanks[4];
$bardRank = $classRanks[5];
$priestRank = $classRanks[6];
$archerSpec = $classSpecs[0];
$rogueSpec = $classSpecs[1];
$frostmageSpec = $classSpecs[2];
$firemageSpec = $classSpecs[3];
$alchemistSpec = $classSpecs[4];
$bardSpec = $classSpecs[5];
$archerXP = $statArray[3];
$rogueXP = $statArray[4];
$frostmageXP = $statArray[5];
$firemageXP = $statArray[6];
$alchemistXP = $statArray[7];
$bardXP = $statArray [8];
$ringInfo = $statArray[9];
$gemType = $gems[AlphaToInt($ringInfo [0])];
$ringRank = AlphaToInt($ringInfo[1]);
$shards = $statArray[10];
$gold = $statArray[11];
$spellUnlocks = $statArray[12];
$spellCount = count ($spells);
function IntToBin ($num, $arrayLen) {
$binString = decbin($num);
$binLen = strlen($binString);
$extraZeros = $arrayLen – $binLen;
$finalBin = “”;
for ($i = 0; $i < $extraZeros; $i = $i + 1) { $finalBin .= “0”; } $finalBin .= $binString; return $finalBin; }
function BinToSpells ($bin) { $sString = “”; global $spellCount; global $spells; for ($i = $spellCount-1; $i >= 0; $i = $i – 1) {
if ($bin[$i] == “1”) {
if ($sString != “”) {
$sString .= “, “;
}
$sString = “{$sString}{$spells[$i]}”;
}
}
return $sString;
}
function AlphaToInt ($alpha) {
switch ($alpha) {
case “0”: return 0;
case “1”: return 1;
case “2”: return 2;
case “3”: return 3;
case “4”: return 4;
case “5”: return 5;
case “6”: return 6;
case “7”: return 7;
case “8”: return 8;
case “9”: return 9;
case “a”: return 10;
case “b”: return 11;
case “c”: return 12;
case “d”: return 13;
case “e”: return 14;
case “f”: return 15;
case “g”: return 16;
case “h”: return 17;
case “i”: return 18;
case “j”: return 19;
case “k”: return 20;
case “l”: return 21;
case “m”: return 22;
case “n”: return 23;
case “o”: return 24;
case “p”: return 25;
case “q”: return 26;
case “r”: return 27;
case “s”: return 28;
case “t”: return 29;
case “u”: return 30;
case “v”: return 31;
case “w”: return 32;
case “x”: return 33;
case “y”: return 34;
case “z”: return 35;
case “A”: return 36;
case “B”: return 37;
case “C”: return 38;
case “D”: return 39;
case “E”: return 40;
case “F”: return 41;
case “G”: return 42;
case “H”: return 43;
case “I”: return 44;
case “J”: return 45;
case “K”: return 46;
case “L”: return 47;
case “M”: return 48;
case “N”: return 49;
case “O”: return 50;
case “P”: return 51;
case “Q”: return 52;
case “R”: return 53;
case “S”: return 54;
case “T”: return 55;
case “U”: return 56;
case “V”: return 57;
case “W”: return 58;
case “X”: return 59;
case “Y”: return 60;
case “Z”: return 61;
default: return 00;
}
}
echo $gemType;
[/insert_php]