// (F)
             $StashGold = bindec(substr($BinaryStats, $start - 34, 25));
             // $start -= 34;
             $keepgoing = 0;
             break;
         default:
             $keepgoing = 0;
     }
 }
 // Player Skills 812 - variable start $skillsection + 2
 $skillstarts = array(6, 36, 66, 96, 126, 221, 251);
 $count = 0;
 $skillnames = array('');
 $skilllevels = array('');
 for ($i = $skillsection + 2; $i < $skillsection + 32; $i++) {
     array_push($skillnames, array_shift(skill_decode($skillstarts[$CharClass] + $count)));
     array_push($skilllevels, $CharData[$i]);
     //      ${"Skill" . $count} = $CharData[$i];
     $count++;
 }
 // Player Item List 844 variable
 $itemcount = hexdec(padhex($CharData[$skillsection + 35]) . padhex($CharData[$skillsection + 34]));
 $mercitemstart = strpos($RawCharData, 'jf', $skillsection + 36);
 $mercitemend = strpos($RawCharData, 'kf', $mercitemstart);
 $ItemList = array();
 $itemstart = $skillsection + 38;
 for ($i = 0; $i < $itemcount; $i++) {
     $itemend = strpos($RawCharData, 'JM', $itemstart);
     // corpse will put a JM after the player item list - should always be there
     //    if ($itemend === false || $itemend >= $mercitemstart || $itemstart <= $itemend) {
     if ($itemend === false || $itemend >= $mercitemstart) {
function magic_properties($id, $binitem, $offset, &$property, $level)
{
    global $classes;
    global $difficulty;
    switch ($id) {
        case 0:
            // +X to Strength
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 32;
            $property = "+" . $stat . " to Strength";
            $offset -= 8;
            break;
        case 1:
            // +X to Energy
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 32;
            $property = "+" . $stat . " to Energy";
            $offset -= 7;
            break;
        case 2:
            // +X to Dexterity
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 32;
            $property = "+" . $stat . " to Dexterity";
            $offset -= 7;
            break;
        case 3:
            // +X to Vitality
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 32;
            $property = "+" . $stat . " to Vitality";
            $offset -= 7;
            break;
        case 7:
            // +X to Life
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 32;
            $property = "+" . $stat . " to Life";
            $offset -= 9;
            break;
        case 9:
            // +X to Mana
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 32;
            $property = "+" . $stat . " to Mana";
            $offset -= 8;
            break;
        case 11:
            // +X to Maximum Stamina
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 32;
            $property = "+" . $stat . " to Maximum Stamina";
            $offset -= 8;
            break;
        case 16:
            // +X% Enhanced Defense
            $stat = bindec(substr($binitem, $offset - 8, 9));
            $property = "+" . $stat . "% Enhanced Defense";
            $offset -= 9;
            break;
        case 17:
            // +X% Enhanced Damage
            $stat1 = bindec(substr($binitem, $offset - 8, 9));
            // max
            $offset -= 9;
            $stat2 = bindec(substr($binitem, $offset - 8, 9));
            // min - always the same?
            $offset -= 9;
            //      $property = "+". $stat2 ."% (min) +". $stat1 ."% (max)  Enhanced Damage";
            $property = "+" . $stat2 . "% Enhanced Damage";
            break;
        case 18:
            // +X% Enhanced Min Damage
            $stat = bindec(substr($binitem, $offset - 8, 9));
            $offset -= 9;
            $property = "+" . $stat . "% Enhanced Min Damage";
            break;
        case 19:
            // +X to Attack Rating
            $stat = bindec(substr($binitem, $offset - 9, 10));
            $property = "+" . $stat . " to Attack Rating";
            $offset -= 10;
            break;
        case 20:
            // X% Increased Chance of Blocking
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = $stat . "% Increased Chance of Blocking";
            $offset -= 6;
            break;
        case 21:
            // +X to Minimum Damage - 1 handed
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = "+" . $stat . " to Minimum Damage";
            $offset -= 6;
            break;
        case 22:
            // +X to Maximum Damage - 1 handed
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "+" . $stat . " to Maximum Damage";
            $offset -= 7;
            break;
        case 23:
            // +X to Minimum Damage - 2 handed
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = "+" . $stat . " to Minimum Damage";
            $offset -= 6;
            break;
        case 24:
            // +X to Maximum Damage - 2 handed
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "+" . $stat . " to Maximum Damage";
            $offset -= 7;
            break;
        case 25:
            // Damage % nv
            //      $stat = bindec(substr($binitem, $offset-7, 8));
            $property = "";
            $offset -= 8;
            break;
        case 26:
            // Regenerate Mana  % nv
            //      $stat = bindec(substr($binitem, $offset-7, 8));
            $property = "";
            $offset -= 8;
            break;
        case 27:
            // Regenerate Mana X%
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "Regenerate Mana " . $stat . "%";
            $offset -= 8;
            break;
        case 28:
            // Heal Stamina X%
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "Heal Stamina " . $stat . "%";
            $offset -= 8;
            break;
        case 31:
            // +X Defense
            $stat = bindec(substr($binitem, $offset - 10, 11)) - 10;
            $property = "+" . $stat . " Defense";
            $offset -= 11;
            break;
        case 32:
            // +X Defense vs. Missile
            $stat = bindec(substr($binitem, $offset - 8, 9));
            $property = "+" . $stat . " Defense vs. Missile";
            $offset -= 9;
            break;
        case 33:
            // +X Defense vs. Melee
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " Defense vs. Melee";
            $offset -= 8;
            break;
        case 34:
            // Damage Reduced by X
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = "Damage Reduce by " . $stat;
            $offset -= 6;
            break;
        case 35:
            // Magic Damage Reduced by X
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = "Magic Damage Reduce by " . $stat;
            $offset -= 6;
            break;
        case 36:
            // Damage Reduced by X%
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "Damage Reduce by " . $stat . "%";
            $offset -= 8;
            break;
        case 37:
            // Magic Resist +X%
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "Magic Resist +" . $stat . "%";
            $offset -= 8;
            break;
        case 38:
            // +X% to Maximum Magic Resist
            $stat = bindec(substr($binitem, $offset - 4, 5));
            $property = "+" . $stat . "% to Maximum Magic Resist";
            $offset -= 5;
            break;
        case 39:
            // Fire Resist +X%
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 50;
            $property = "Fire Resist +" . $stat . "%";
            $offset -= 8;
            break;
        case 40:
            // +X% to Maximum Fire Resist
            $stat = bindec(substr($binitem, $offset - 4, 5));
            $property = "+" . $stat . "% to Maximum Fire Resist";
            $offset -= 5;
            break;
        case 41:
            // Lightning Resist +X%
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 50;
            $property = "Lightning Resist +" . $stat . "%";
            $offset -= 8;
            break;
        case 42:
            // +X% to Maximum Lightning Resist
            $stat = bindec(substr($binitem, $offset - 4, 5));
            $property = "+" . $stat . "% to Maximum Lightning Resist";
            $offset -= 5;
            break;
        case 43:
            // Cold Resist +X%
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 50;
            $property = "Cold Resist +" . $stat . "%";
            $offset -= 8;
            break;
        case 44:
            // +X% to Maximum Cold Resist
            $stat = bindec(substr($binitem, $offset - 4, 5));
            $property = "+" . $stat . "% to Maximum Cold Resist";
            $offset -= 5;
            break;
        case 45:
            // Poison Resist +X%
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 50;
            $property = "Poison Resist +" . $stat . "%";
            $offset -= 8;
            break;
        case 46:
            // +X% to Maximum Poison Resist
            $stat = bindec(substr($binitem, $offset - 4, 5));
            $property = "+" . $stat . "% to Maximum Poison Resist";
            $offset -= 5;
            break;
        case 48:
            // Adds X-Y fire damage
            $stat1 = bindec(substr($binitem, $offset - 7, 8));
            $offset -= 8;
            $stat2 = bindec(substr($binitem, $offset - 8, 9));
            $offset -= 9;
            $property = "Adds " . $stat1 . "-" . $stat2 . " fire damage";
            break;
        case 49:
            // Max Fire Damage
            $stat = bindec(substr($binitem, $offset - 8, 9));
            $offset -= 9;
            $property = "Adds " . $stat . " fire damage";
            break;
        case 50:
            // Adds X-Y lightning damage
            $stat1 = bindec(substr($binitem, $offset - 5, 6));
            $offset -= 6;
            $stat2 = bindec(substr($binitem, $offset - 9, 10));
            $offset -= 10;
            $property = "Adds " . $stat1 . "-" . $stat2 . " lightning damage";
            break;
        case 51:
            // Max Lightning Damage
            $stat = bindec(substr($binitem, $offset - 9, 10));
            $offset -= 10;
            $property = "Adds " . $stat . " lightning damage";
            break;
        case 52:
            // Adds X-Y magic damage
            $stat1 = bindec(substr($binitem, $offset - 7, 8));
            $offset -= 8;
            $stat2 = bindec(substr($binitem, $offset - 8, 9));
            $offset -= 9;
            $property = "Adds " . $stat1 . "-" . $stat2 . " magic damage";
            break;
        case 53:
            // Max Magic Damage
            $stat = bindec(substr($binitem, $offset - 8, 9));
            $offset -= 9;
            $property = "Adds " . $stat . " magic damage";
            break;
        case 54:
            // Adds X-Y cold damage
            $stat1 = bindec(substr($binitem, $offset - 7, 8));
            $offset -= 8;
            $stat2 = bindec(substr($binitem, $offset - 8, 9));
            $offset -= 9;
            $stat3 = round(bindec(substr($binitem, $offset - 7, 8)) / 25);
            $offset -= 8;
            $property = "Adds " . $stat1 . "-" . $stat2 . " cold damage for " . $stat3 . " seconds";
            break;
        case 55:
            // Max Cold Damage
            $stat = bindec(substr($binitem, $offset - 8, 9));
            $offset -= 9;
            $property = "Adds " . $stat . " cold damage";
            break;
        case 56:
            // Cold Length
            $stat = round(bindec(substr($binitem, $offset - 8, 9)) / 25);
            $offset -= 9;
            $property = "Adds " . $stat . " seconds cold duration";
            break;
        case 57:
            // Adds X-Y poison damage over Z seconds
            $stat1 = bindec(substr($binitem, $offset - 9, 10));
            $offset -= 10;
            $stat2 = bindec(substr($binitem, $offset - 9, 10));
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 8, 9));
            $offset -= 9;
            if ($stat1 == $stat2) {
                $property = "Adds " . round($stat1 * $stat3 / 256) . " Poison Damage over " . round($stat3 / 25) . " seconds";
            } else {
                $property = "Adds " . round($stat1 * $stat3 / 256) . "-" . round($stat2 * $stat3 / 256) . " Poison Damage over " . round($stat3 / 25) . " seconds";
            }
            break;
        case 58:
            // Max Poison Damage
            $stat = bindec(substr($binitem, $offset - 9, 10));
            $offset -= 10;
            $property = "Adds " . $stat . " poison damage";
            break;
        case 59:
            // Max Poison Damage
            $stat = round(bindec(substr($binitem, $offset - 8, 9)) / 25);
            $offset -= 9;
            $property = "Adds " . $stat . " seconds poison length";
            break;
        case 60:
            // X% Life stolen per hit
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . "% Life stolen per hit";
            $offset -= 7;
            break;
        case 62:
            // X% Mana stolen per hit
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . "% Mana stolen per hit";
            $offset -= 7;
            break;
        case 67:
            // Run/Walk Speed % nv
            //      $stat = bindec(substr($binitem, $offset-6, 7))-30;
            $property = "";
            $offset -= 7;
            break;
        case 68:
            // Attack Speed % nv
            //      $stat = bindec(substr($binitem, $offset-6, 7))-30;
            $property = "";
            $offset -= 7;
            break;
        case 71:
            // value
            //      $stat = bindec(substr($binitem, $offset-7, 8))-100;
            $property = "";
            $offset -= 8;
            break;
        case 72:
            // Durability
            //      $stat = bindec(substr($binitem, $offset-8, 9));
            $property = "";
            $offset -= 9;
            break;
        case 73:
            // +X Maximum Durability
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " Maximum Durability";
            $offset -= 8;
            break;
        case 74:
            // Replenish Life +X
            $stat = bindec(substr($binitem, $offset - 5, 6)) - 30;
            $property = "Replenish Life +" . $stat;
            $offset -= 6;
            break;
        case 75:
            // Increase Maximum Durability X%
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 20;
            $property = "Increase Maximum Durability " . $stat . "%";
            $offset -= 7;
            break;
        case 76:
            // Increase Maximum Life X%
            $stat = bindec(substr($binitem, $offset - 5, 6)) - 10;
            $property = "Increase Maximum Life " . $stat . "%";
            $offset -= 6;
            break;
        case 77:
            // Increase Maximum Mana X%
            $stat = bindec(substr($binitem, $offset - 5, 6)) - 10;
            $property = "Increase Maximum Mana " . $stat . "%";
            $offset -= 6;
            break;
        case 78:
            // Attacker Takes Damage of X
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "Attacker Takes Damage of " . $stat;
            $offset -= 7;
            break;
        case 79:
            // X% Extra Gold from Monsters
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 100;
            $property = $stat . "% Extra Gold From Monsters";
            $offset -= 9;
            break;
        case 80:
            // X% Better Chance of Getting Magic Items
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 100;
            $property = $stat . "% Better Chance of Getting Magic Items";
            $offset -= 8;
            break;
        case 81:
            // Knockback
            //      $stat = bindec(substr($binitem, $offset-6, 7));
            $property = "Knockback";
            $offset -= 7;
            break;
        case 82:
            // Time Duration
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 20;
            $property = "";
            $offset -= 9;
            break;
        case 83:
            // + Class skill levels
            $stat1 = bindec(substr($binitem, $offset - 2, 3));
            $offset -= 3;
            $stat2 = bindec(substr($binitem, $offset - 2, 3));
            $offset -= 3;
            $property = "+" . $stat2 . " to " . $classes[$stat1] . " Skill Levels";
            break;
        case 85:
            // Add experience
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 50;
            $property = "+" . $stat . "% to Experience Gained";
            $offset -= 9;
            break;
        case 86:
            // Heal after kill
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "+" . $stat . " to Life After Each Kill";
            $offset -= 7;
            break;
        case 87:
            // Reduced Prices
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "Prices Reduced by " . $stat . "%";
            $offset -= 7;
            break;
        case 88:
            // Double Herb Duration
            //      $stat = bindec(substr($binitem, $offset, 1));
            $property = "";
            $offset--;
            break;
        case 89:
            // +X to Light Radius
            $stat = bindec(substr($binitem, $offset - 3, 4)) - 4;
            $property = "+" . $stat . " to Light Radius";
            $offset -= 4;
            break;
        case 90:
            // alter the color of the ambient light.
            $stat = bindec(substr($binitem, $offset - 23, 24));
            $lightcolorlist = array('White', 'Light Grey', 'Dark Grey', 'Black', 'Light Blue', 'Dark Blue', 'Crystal Blue', 'Light Red', 'Dark Red', 'Crystal Red', 'Light Green', 'Dark Green', 'Crystal Green', 'Light Yellow', 'Dark Yellow', 'Light Gold', 'Dark Gold', 'Light Purple', 'Dark Purple', 'Orange', 'Bright White');
            $property = "Change Ambient Light Color to " . $lightcolorlist[$stat];
            $offset -= 24;
            break;
        case 91:
            // Requirements -X%
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 100;
            $property = "Requirements " . $stat . "%";
            $offset -= 8;
            break;
        case 92:
            // Level Require
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "Required Level " . $stat;
            $offset -= 7;
            break;
        case 93:
            // X% Increased Attack Speed
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 20;
            $property = $stat . "% Increased Attack Speed";
            $offset -= 7;
            break;
        case 94:
            // Level Require %
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 64;
            $property = "Required Level " . $stat . "%";
            $offset -= 7;
            break;
        case 96:
            // X% Faster Run/Walk
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 20;
            $property = $stat . "% Faster Run/Walk";
            $offset -= 7;
            break;
        case 97:
            // Non Class skill
            $stat1 = array_shift(skill_decode(bindec(substr($binitem, $offset - 8, 9))));
            $offset -= 9;
            $stat2 = bindec(substr($binitem, $offset - 5, 6));
            $offset -= 6;
            $property = "Level " . $stat2 . " " . $stat1;
            break;
        case 98:
            // state
            //      $stat1 = bindec(substr($binitem, $offset-7, 8));
            $offset -= 8;
            //      $stat2 = bindec(substr($binitem, $offset, 1));
            $offset--;
            $property = "";
            break;
        case 99:
            // X% Faster Hit Recovery
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 20;
            $property = $stat . "% Faster Hit Recovery";
            $offset -= 7;
            break;
        case 102:
            // X% Faster Block Rate
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 20;
            $property = $stat . "% Faster Block Rate";
            $offset -= 7;
            break;
        case 105:
            // X% Faster Cast Rate
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 20;
            $property = $stat . "% Faster Cast Rate";
            $offset -= 7;
            break;
        case 107:
            // +Y to spell X (character class Only)
            $stat1 = skill_decode(bindec(substr($binitem, $offset - 8, 9)));
            $offset -= 9;
            $stat2 = bindec(substr($binitem, $offset - 2, 3));
            $offset -= 3;
            $property = "+" . $stat2 . " to " . $stat1[0] . " (" . $classes[$stat1[1]] . " Only)";
            break;
        case 108:
            // Rest in Peace
            $property = "Rest in Peace";
            $offset--;
            break;
        case 109:
            // Curse Resistance
            $stat = bindec(substr($binitem, $offset - 8, 9));
            $property = "+" . $stat . " to Curse Resistance";
            $offset -= 9;
            break;
        case 110:
            // Poison Length Reduced by X%
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 20;
            $property = "Poison Length Reduced by " . $stat . "%";
            $offset -= 8;
            break;
        case 111:
            // Damage +X
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 20;
            $property = "Damage +" . $stat;
            $offset -= 9;
            break;
        case 112:
            // Hit Causes Monster to Flee %
            $stat = bindec(substr($binitem, $offset - 6, 7)) + 1;
            $property = "Hit Causes Monster to Flee " . round($stat * 100 / 127) . "%";
            $offset -= 7;
            break;
        case 113:
            // Hit Blinds Target +X
            //      $stat = bindec(substr($binitem, $offset-6, 7));
            $property = "Hit Blinds Target";
            $offset -= 7;
            break;
        case 114:
            // X% Damage Taken Goes to Mana
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = $stat . "% Damage Taken Goes to Mana";
            $offset -= 6;
            break;
        case 115:
            // Ignore Target Defense
            $property = "Ignore Target's Defense";
            $offset--;
            break;
        case 116:
            // X% Target Defense
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . "% Target Defense";
            $offset -= 7;
            break;
        case 117:
            // Prevent Monster Heal
            //      $stat = bindec(substr($binitem, $offset-6, 7));
            $property = "Prevent Monster Heal";
            $offset -= 7;
            break;
        case 118:
            // Half Freeze Duration
            $property = "Half Freeze Duration";
            $offset--;
            break;
        case 119:
            // X% Bonus to Attack Rating
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 20;
            $property = $stat . "% Bonus to Attack Rating ";
            $offset -= 9;
            break;
        case 120:
            // X to Monster Defense Per Hit
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 128;
            $property = $stat . " to Monster Defense Per Hit";
            $offset -= 7;
            break;
        case 121:
            // +X% Damage to Demons
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 20;
            $property = "+" . $stat . "% Damage to Demons";
            $offset -= 9;
            break;
        case 122:
            // +X% Damage to Undead - in addition to inherent extra damage due to weapon class
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 20;
            $property = "+" . $stat . "% Damage to Undead";
            $offset -= 9;
            break;
        case 123:
            // +X to Attack Rating against Demons
            $stat = bindec(substr($binitem, $offset - 9, 10)) - 128;
            $property = "+" . $stat . " to Attack Rating against Demons";
            $offset -= 10;
            break;
        case 124:
            // +X to Attack Rating against Undead
            $stat = bindec(substr($binitem, $offset - 9, 10)) - 128;
            $property = "+" . $stat . " to Attack Rating against Undead";
            $offset -= 10;
            break;
        case 125:
            // Throwable
            $property = "Throwable";
            $offset--;
            break;
        case 126:
            // I have +X to Fire Skills, UdieToo says Elemental Skill
            $stat = bindec(substr($binitem, $offset - 2, 3));
            $property = "+" . $stat . " to Fire Skills";
            $offset -= 3;
            break;
        case 127:
            // +X to All Skills
            $stat = bindec(substr($binitem, $offset - 2, 3));
            $property = "+" . $stat . " to All Skills";
            $offset -= 3;
            break;
        case 128:
            // Attacker Takes Lightning Damage of X
            $stat = bindec(substr($binitem, $offset - 4, 5));
            $property = "Attacker Takes Lightning Damage of " . $stat;
            $offset -= 5;
            break;
        case 134:
            // Freezes Target
            //      $stat = bindec(substr($binitem, $offset-4, 5));
            $property = "Freezes Target";
            $offset -= 5;
            break;
        case 135:
            // X% Chance of Open Wounds
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . "% Chance of Open Wounds";
            $offset -= 7;
            break;
        case 136:
            // X% Chance of Crushing Blow
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . "% Chance of Crushing Blow";
            $offset -= 7;
            break;
        case 137:
            // +X Kick Damage
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "+" . $stat . " Kick Damage";
            $offset -= 7;
            break;
        case 138:
            // +X to Mana After Each Kill
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "+" . $stat . " to Mana After Each Kill";
            $offset -= 7;
            break;
        case 139:
            // +X Life after each Demon Kill
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "+" . $stat . " Life after each Demon Kill";
            $offset -= 7;
            break;
        case 140:
            // Unknown. Found on Swordback Hold Spiked Shield
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "Unknown";
            $offset -= 7;
            break;
        case 141:
            // X% Deadly Strike
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . "% Deadly Strike ";
            $offset -= 7;
            break;
        case 142:
            // Fire Absorb X%
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "Fire Absorb " . $stat . "%";
            $offset -= 7;
            break;
        case 143:
            // X Fire Absorb
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . " Fire Absorb";
            $offset -= 7;
            break;
        case 144:
            // Lightning Absorb X%
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "Lightning Absorb " . $stat . "%";
            $offset -= 7;
            break;
        case 145:
            // X Lightning Absorb
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . " Lightning Absorb";
            $offset -= 7;
            break;
        case 146:
            // Magic Absorb X%
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "Magic Absorb " . $stat . "%";
            $offset -= 7;
            break;
        case 147:
            // X Magic Absorb
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . " Magic Absorb";
            $offset -= 7;
            break;
        case 148:
            // Cold Absorb X%
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "Cold Absorb " . $stat . "%";
            $offset -= 7;
            break;
        case 149:
            // X Cold Absorb
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . " Cold Absorb";
            $offset -= 7;
            break;
        case 150:
            // Slows Target by X%
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "Slows Target by " . $stat . "%";
            $offset -= 7;
            break;
        case 151:
            // Aura
            $stat1 = array_shift(skill_decode(bindec(substr($binitem, $offset - 8, 9))));
            $offset -= 9;
            $stat2 = bindec(substr($binitem, $offset - 4, 5));
            $offset -= 5;
            $property = "Level " . $stat2 . " " . $stat1 . " Aura When Equipped";
            break;
        case 152:
            // Indestructable
            $property = "Indestructable";
            $offset--;
            break;
        case 153:
            // Cannot Be Frozen
            $property = "Cannot Be Frozen";
            $offset--;
            break;
        case 154:
            // X% Slower Stamina Drain
            $stat = bindec(substr($binitem, $offset - 6, 7)) - 20;
            $property = $stat . "% Slower Stamina Drain";
            $offset -= 7;
            break;
        case 155:
            // X% Chance to Reanimate Target
            $stat1 = bindec(substr($binitem, $offset - 9, 10));
            $offset -= 10;
            $stat2 = bindec(substr($binitem, $offset - 6, 7));
            $offset -= 7;
            $property = $stat2 . "% Chance to Reanimate Monster ID " . $stat1;
            break;
        case 156:
            // Piercing Attack
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = $stat . "% Chance to Pierce";
            $offset -= 7;
            break;
        case 157:
            // Fires Magic Arrows
            //      $stat = bindec(substr($binitem, $offset-6, 7));
            $property = "Fires Magic Arrows or Bolts";
            $offset -= 7;
            break;
        case 158:
            // Fires Explosive Arrows or Bolts
            //      $stat = bindec(substr($binitem, $offset-6, 7));
            $property = "Fires Explosive Arrows or Bolts";
            $offset -= 7;
            break;
        case 159:
            // +X to Minimum Damage (always with 21 and 23)
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = "+" . $stat . " to Minimum Damage";
            $offset -= 6;
            break;
        case 160:
            // +X to Maximum Damage (always with 22 and 24)
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "+" . $stat . " to Maximum Damage";
            $offset -= 7;
            break;
        case 179:
            // Attack Vs Monster
            $stat1 = bindec(substr($binitem, $offset - 9, 10));
            $offset -= 10;
            $stat2 = bindec(substr($binitem, $offset - 8, 9));
            $offset -= 9;
            $property = "+" . $stat1 . "% Attack Rating to Monster Type " . $stat1;
            break;
        case 180:
            // Damage Vs Monster
            $stat1 = bindec(substr($binitem, $offset - 9, 10));
            $offset -= 10;
            $stat2 = bindec(substr($binitem, $offset - 8, 9));
            $offset -= 9;
            $property = "+" . $stat1 . "% Damage to Monster Type " . $stat1;
            break;
        case 181:
            // Fade method
            $property = "";
            $offset -= 3;
            break;
        case 188:
            // +Y to skill set X Skills (character class Only)
            $stat1 = bindec(substr($binitem, $offset - 2, 3));
            $offset -= 3;
            $stat2 = bindec(substr($binitem, $offset - 12, 13));
            $offset -= 13;
            $stat3 = bindec(substr($binitem, $offset - 2, 3));
            $offset -= 3;
            switch ($stat1) {
                case 0:
                    switch ($stat2) {
                        case 0:
                            $property = "+" . $stat3 . " to Bow and Crossbow Skills (Amazon Only)";
                            break;
                        case 1:
                            $property = "+" . $stat3 . " to Fire Spells (Sorceress Only)";
                            break;
                        case 2:
                            $property = "+" . $stat3 . " to Curses (Necromancer Only)";
                            break;
                        case 3:
                            $property = "+" . $stat3 . " to Combat Skills (Paladin Only)";
                            break;
                        case 4:
                            $property = "+" . $stat3 . " to Combat Skills (Barbarian Only)";
                            break;
                        case 5:
                            $property = "+" . $stat3 . " to Summoning (Druid Only)";
                            break;
                        case 6:
                            $property = "+" . $stat3 . " to Traps (Assassin Only)";
                            break;
                    }
                    break;
                case 1:
                    switch ($stat2) {
                        case 0:
                            $property = "+" . $stat3 . " to Passive and Magic Skills (Amazon Only)";
                            break;
                        case 1:
                            $property = "+" . $stat3 . " to Lightning Spells (Sorceress Only)";
                            break;
                        case 2:
                            $property = "+" . $stat3 . " to Poison and Bone Spells (Necromancer Only)";
                            break;
                        case 3:
                            $property = "+" . $stat3 . " to Offensive Auras (Paladin Only)";
                            break;
                        case 4:
                            $property = "+" . $stat3 . " to Combat Masteries (Barbarian Only)";
                            break;
                        case 5:
                            $property = "+" . $stat3 . " to Shape Shifting (Druid Only)";
                            break;
                        case 6:
                            $property = "+" . $stat3 . " to Shadow Disciplines (Assassin Only)";
                            break;
                    }
                    break;
                case 2:
                    switch ($stat2) {
                        case 0:
                            $property = "+" . $stat3 . " to Javelin and Spear Skills (Amazon Only)";
                            break;
                        case 1:
                            $property = "+" . $stat3 . " to Cold Spells (Sorceress Only)";
                            break;
                        case 2:
                            $property = "+" . $stat3 . " to Summoning Spells (Necromancer Only)";
                            break;
                        case 3:
                            $property = "+" . $stat3 . " to Defensive Auras (Paladin Only)";
                            break;
                        case 4:
                            $property = "+" . $stat3 . " to Warcries (Barbarian Only)";
                            break;
                        case 5:
                            $property = "+" . $stat3 . " to Elemental (Druid Only)";
                            break;
                        case 6:
                            $property = "+" . $stat3 . " to Martial Arts (Assassin Only)";
                            break;
                    }
                    break;
            }
            break;
        case 194:
            // Adds X extra sockets to the item.
            $stat = bindec(substr($binitem, $offset - 3, 4));
            $property = "Adds " . $stat . " extra sockets";
            $offset -= 4;
            break;
        case 195:
            // Skill On Attack
            $stat1 = bindec(substr($binitem, $offset - 5, 6));
            $offset -= 6;
            $stat2 = array_shift(skill_decode(bindec(substr($binitem, $offset - 9, 10))));
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 6, 7));
            $offset -= 7;
            $property = $stat3 . "% Chance to Cast Level " . $stat1 . " " . $stat2 . " on Attack";
            break;
        case 196:
            // Skill On Kill
            $stat1 = bindec(substr($binitem, $offset - 5, 6));
            $offset -= 6;
            $stat2 = array_shift(skill_decode(bindec(substr($binitem, $offset - 9, 10))));
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 6, 7));
            $offset -= 7;
            $property = $stat3 . "% Chance to Cast Level " . $stat1 . " " . $stat2 . " on Kill";
            break;
        case 197:
            // Skill On Death
            $stat1 = bindec(substr($binitem, $offset - 5, 6));
            $offset -= 6;
            $stat2 = array_shift(skill_decode(bindec(substr($binitem, $offset - 9, 10))));
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 6, 7));
            $offset -= 7;
            $property = $stat3 . "% Chance to Cast Level " . $stat1 . " " . $stat2 . " on Death";
            break;
        case 198:
            // Skill On Hit
            $stat1 = bindec(substr($binitem, $offset - 5, 6));
            $offset -= 6;
            $stat2 = array_shift(skill_decode(bindec(substr($binitem, $offset - 9, 10))));
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 6, 7));
            $offset -= 7;
            $property = $stat3 . "% Chance to Cast Level " . $stat1 . " " . $stat2 . " on Striking";
            break;
        case 199:
            // Skill On Levelup
            $stat1 = bindec(substr($binitem, $offset - 5, 6));
            $offset -= 6;
            $stat2 = array_shift(skill_decode(bindec(substr($binitem, $offset - 9, 10))));
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 6, 7));
            $offset -= 7;
            $property = $stat3 . "% Chance to Cast Level " . $stat1 . " " . $stat2 . " on Level Up";
            break;
        case 201:
            // Skill on Get Hit
            $stat1 = bindec(substr($binitem, $offset - 5, 6));
            $offset -= 6;
            $stat2 = array_shift(skill_decode(bindec(substr($binitem, $offset - 9, 10))));
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 6, 7));
            $offset -= 7;
            $property = $stat3 . "% Chance to Cast Level " . $stat1 . " " . $stat2 . " When Struck";
            break;
        case 204:
            // Charged Skill
            $stat1 = bindec(substr($binitem, $offset - 5, 6));
            $offset -= 6;
            $stat2 = array_shift(skill_decode(bindec(substr($binitem, $offset - 9, 10))));
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 7, 8));
            $offset -= 8;
            $stat4 = bindec(substr($binitem, $offset - 7, 8));
            $offset -= 8;
            $property = "Level " . $stat1 . " " . $stat2 . " (" . $stat3 . "/" . $stat4 . " Charges)";
            break;
        case 214:
            // +X to Defense (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " to Defense (Based on Character Level)";
            $offset -= 6;
            break;
        case 215:
            // X% Enhanced Defense (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = (int) ($stat * $level) . "% Enhanced Defense (Based on Character Level)";
            $offset -= 6;
            break;
        case 216:
            // +X to Life (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " to Life (Based on Character Level)";
            $offset -= 6;
            break;
        case 217:
            // +X to Mana (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " to Mana (Based on Character Level)";
            $offset -= 6;
            break;
        case 218:
            // +X to Maximum Damage (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " to Maximum Damage (Based on Character Level)";
            $offset -= 6;
            break;
        case 219:
            // X% Enhanced Maximum Damage (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = (int) ($stat * $level) . "% Enhanced Maximum Damage (Based on Character Level)";
            $offset -= 6;
            break;
        case 220:
            // +X to Strength (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " to Strength (Based on Character Level)";
            $offset -= 6;
            break;
        case 221:
            // +X to Dexterity (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " to Dexterity (Based on Character Level)";
            $offset -= 6;
            break;
        case 222:
            // +X to Energy (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " to Energy (Based on Character Level)";
            $offset -= 6;
            break;
        case 223:
            // +X to Vitality (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " to Vitality (Based on Character Level)";
            $offset -= 6;
            break;
        case 224:
            // +X to Attack Rating (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 2;
            $property = "+" . (int) ($stat * $level) . " to Attack Rating (Based on Character Level)";
            $offset -= 6;
            break;
        case 225:
            // X% Bonus to Attack Rating (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 2;
            $property = (int) ($stat * $level) . "% Bonus to Attack Rating (Based on Character Level)";
            $offset -= 6;
            break;
        case 226:
            // +X Cold Damage (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " Cold Damage (Based on Character Level)";
            $offset -= 6;
            break;
        case 227:
            // +X Fire Damage (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " Fire Damage (Based on Character Level)";
            $offset -= 6;
            break;
        case 228:
            // +X Lightning Damage (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " Lightning Damage (Based on Character Level)";
            $offset -= 6;
            break;
        case 229:
            // +X Poison Damage (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " Poison Damage (Based on Character Level)";
            $offset -= 6;
            break;
        case 230:
            // Cold Resist +X% (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "Cold Resist +" . (int) ($stat * $level) . "% (Based on Character Level)";
            $offset -= 6;
            break;
        case 231:
            // Fire Resist +X% to (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "Fire Resist +" . (int) ($stat * $level) . "% (Based on Character Level)";
            $offset -= 6;
            break;
        case 232:
            // Lightning Resist +X% to (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "Lightning Resist +" . (int) ($stat * $level) . "% (Based on Character Level)";
            $offset -= 6;
            break;
        case 233:
            // Poison Resist +X% to (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "Poison Resist +" . (int) ($stat * $level) . "% (Based on Character Level)";
            $offset -= 6;
            break;
        case 234:
            // +X Cold Absorb (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " Cold Absorb (Based on Character Level)";
            $offset -= 6;
            break;
        case 235:
            // +X Fire Absorb (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " Fire Absorb (Based on Character Level)";
            $offset -= 6;
            break;
        case 236:
            // +X Lightning Absorb (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " Lightning Absorb (Based on Character Level)";
            $offset -= 6;
            break;
        case 237:
            // +X Lightning Absorb (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = "+" . (int) ($stat * $level) . " Lightning Absorb (Based on Character Level)";
            $offset -= 6;
            break;
        case 238:
            // Attacker Takes Damage of X (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 4, 5)) / 8;
            $property = "Attacker Takes Damage of " . (int) ($stat * $level) . " (Based on Character Level)";
            $offset -= 5;
            break;
        case 239:
            // X% Extra Gold from Monsters (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = (int) ($stat * $level) . "% Extra Gold from Monsters (Based on Character Level)";
            $offset -= 6;
            break;
        case 240:
            // X% Better Chance of Getting Magic Items (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6)) / 8;
            $property = (int) ($stat * $level) . "% Better Chance of Getting Magic Items (Based on Character Level)";
            $offset -= 6;
            break;
        case 241:
            // Heal Stamina Plus X% (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = "Heal Stamina Plus " . (int) ($stat * $level) . "% (Based on Character Level)";
            $offset -= 6;
            break;
        case 243:
            // X% Damage to Demons (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = (int) ($stat * $level) . "% Damage to Demons (Based on Character Level)";
            $offset -= 6;
            break;
        case 244:
            // X% Damage to Undead (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = (int) ($stat * $level) . "% Damage to Undead (Based on Character Level)";
            $offset -= 6;
            break;
        case 245:
            // +X to Attack Rating against Demons (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = "+" . (int) ($stat * $level) . " to Attack Rating against Demons (Based on Character Level)";
            $offset -= 6;
            break;
        case 246:
            // +X to Attack Rating against Undead (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = "+" . (int) ($stat * $level) . " to Attack Rating against Undead (Based on Character Level)";
            $offset -= 6;
            break;
        case 247:
            // X% Chance of Crushing Blow (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = (int) ($stat * $level) . "% Chance of Crushing Blow (Based on Character Level) ";
            $offset -= 6;
            break;
        case 248:
            // X% Chance of Open Wounds (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = (int) ($stat * $level) . "% Chance of Open Wounds (Based on Character Level)";
            $offset -= 6;
            break;
        case 249:
            // +X Kick Damage (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = "+" . (int) ($stat * $level) . " Kick Damage (Based on Character Level)";
            $offset -= 6;
            break;
        case 250:
            // X% to Deadly Strike (Based on Character Level)
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = (int) ($stat * $level) . "% to Deadly Strike (Based on Character Level)";
            $offset -= 6;
            break;
        case 252:
            // Repairs 1 durability in X seconds - UdieToo says '6', I say '5'
            $stat = 100 / bindec(substr($binitem, $offset - 4, 5));
            $property = "Repairs 1 durability in " . (int) $stat . " seconds";
            $offset -= 5;
            break;
        case 253:
            // Replenishes Quantity (1 in X seconds)
            $stat = 100 / bindec(substr($binitem, $offset - 5, 6));
            $property = "Replenishes Quantity (1 in " . (int) $stat . " seconds)";
            $offset -= 6;
            break;
        case 254:
            // Increased Stack Size (+X)
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "Increased Stack Size (+" . $stat . ")";
            $offset -= 8;
            break;
            // magic properties that change value depending on the time of day in game
        // magic properties that change value depending on the time of day in game
        case 268:
            // +X Defense (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") Defense (Increases " . $stat1 . ")";
            break;
        case 269:
            // X% Enhanced Defense (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Enhanced Defense (Increases " . $stat1 . ")";
            break;
        case 270:
            // +X to Life (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . round($stat2 / 256) . "-" . round($stat3 / 256) . ") to Life (Increases " . $stat1 . ")";
            break;
        case 271:
            // +X to Mana (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . round($stat2 / 256) . "-" . round($stat3 / 256) . ") to Mana (Increases " . $stat1 . ")";
            break;
        case 272:
            // +X to Damage (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") to Damage (Increases " . $stat1 . ")";
            break;
        case 273:
            // X% Enhanced Damage (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Enhanced Damage (Increases " . $stat1 . ")";
            break;
        case 274:
            // +X to Strength (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") to Strength (Increases " . $stat1 . ")";
            break;
        case 275:
            // +X to Dexterity (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") to Dexterity (Increases " . $stat1 . ")";
            break;
        case 276:
            // +X to Energy (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") to Energy (Increases " . $stat1 . ")";
            break;
        case 277:
            // +X to Vitality (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") to Vitality (Increases " . $stat1 . ")";
            break;
        case 278:
            // X% Enhanced Attack Rating (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Enhanced Attack Rating (Increases " . $stat1 . ")";
            break;
        case 279:
            // +X to Attack Rating (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") to Attack Rating (Increases " . $stat1 . ")";
            break;
        case 280:
            // +X Cold Damage (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") Cold Damage (Increases " . $stat1 . ")";
            break;
        case 281:
            // +X Fire Damage (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") Fire Damage (Increases " . $stat1 . ")";
            break;
        case 282:
            // +X Lightning Damage (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") Lightning Damage (Increases " . $stat1 . ")";
            break;
        case 283:
            // +X Poison Damage (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") Poison Damage (Increases " . $stat1 . ")";
            break;
        case 284:
            // X% Cold Resist (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Cold Resist (Increases " . $stat1 . ")";
            break;
        case 285:
            // X% Fire Resist (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Fire Resist (Increases " . $stat1 . ")";
            break;
        case 286:
            // X% Lightning Resist (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Lightning Resist (Increases " . $stat1 . ")";
            break;
        case 287:
            // X% Poison Resist (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Poison Resist (Increases " . $stat1 . ")";
            break;
        case 288:
            // +X Cold Absorb (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") Cold Absorb (Increases " . $stat1 . ")";
            break;
        case 289:
            // +X Fire Absorb (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") Fire Absorb (Increases " . $stat1 . ")";
            break;
        case 290:
            // +X Lightning Absorb (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") Lightning Absorb (Increases " . $stat1 . ")";
            break;
        case 291:
            // +X Poison Absorb (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") Poison Absorb (Increases " . $stat1 . ")";
            break;
        case 292:
            // X% Extra Gold from Monsters (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Extra Gold from Monsters (Increases " . $stat1 . ")";
            break;
        case 293:
            // X% Better Chance of Getting Magic Items (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Better Chance of Getting Magic Items (Increases " . $stat1 . ")";
            break;
        case 294:
            // Heal Stamina Plus X% (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "Heal Stamina Plus (" . $stat2 . "-" . $stat3 . ")% (Increases " . $stat1 . ")";
            break;
        case 295:
            // +X to Stamina (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . round($stat2 / 256) . "-" . round($stat3 / 256) . ") to Stamina (Increases " . $stat1 . ")";
            break;
        case 296:
            // X% Damage to Demons (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Damage to Demons (Increases " . $stat1 . ")";
            break;
        case 297:
            // X% Damage to Undead (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Damage to Undead (Increases " . $stat1 . ")";
            break;
        case 298:
            // +X to Attack Rating against Demons (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") to Attack Rating against Demons (Increases " . $stat1 . ")";
            break;
        case 299:
            // +X to Attack Rating against Undead (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") to Attack Rating against Undead (Increases " . $stat1 . ")";
            break;
        case 300:
            // X% Chance of Crushing Blow (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Chance of Crushing Blow (Increases " . $stat1 . ")";
            break;
        case 301:
            // X% Chance of Open Wounds (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Chance of Open Wounds (Increases " . $stat1 . ")";
            break;
        case 302:
            // +X Kick Damage (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "+(" . $stat2 . "-" . $stat3 . ") Kick Damage (Increases " . $stat1 . ")";
            break;
        case 303:
            // X% Deadly Strike (Increases by time)
            $stat1 = time_name(bindec(substr($binitem, $offset - 1, 2)));
            $offset -= 2;
            $stat2 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $stat3 = bindec(substr($binitem, $offset - 9, 10)) - 256;
            $offset -= 10;
            $property = "(" . $stat2 . "-" . $stat3 . ")% Deadly Strike (Increases " . $stat1 . ")";
            break;
        case 305:
            // item_pierce_cold
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 50;
            $property = "Pierce Cold by " . $stat;
            $offset -= 8;
            break;
        case 306:
            // item_pierce_fire
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 50;
            $property = "Pierce Fire by " . $stat;
            $offset -= 8;
            break;
        case 307:
            // item_pierce_ltng
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 50;
            $property = "Pierce Lightning by " . $stat;
            $offset -= 8;
            break;
        case 308:
            // item_pierce_pois
            $stat = bindec(substr($binitem, $offset - 7, 8)) - 50;
            $property = "Pierce Poison by " . $stat;
            $offset -= 8;
            break;
        case 324:
            // item_extra_charges
            $stat = bindec(substr($binitem, $offset - 5, 6));
            $property = $stat . " Extra Charges";
            $offset -= 6;
            break;
        case 329:
            // passive_fire_mastery
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 50;
            $property = "+" . $stat . " to Passive Fire Mastery";
            $offset -= 9;
            break;
        case 330:
            // passive_ltng_mastery
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 50;
            $property = "+" . $stat . " to Passive Lightning Mastery";
            $offset -= 9;
            break;
        case 331:
            // passive_cold_mastery
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 50;
            $property = "+" . $stat . " to Passive Cold Mastery";
            $offset -= 9;
            break;
        case 332:
            // passive_pois_mastery
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 50;
            $property = "+" . $stat . " to Passive Poison Mastery";
            $offset -= 9;
            break;
        case 333:
            // passive_fire_pierce
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Fire Pierce";
            $offset -= 8;
            break;
        case 334:
            // passive_ltng_pierce
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Lightning Pierce";
            $offset -= 8;
            break;
        case 335:
            // passive_cold_pierce
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Cold Pierce";
            $offset -= 8;
            break;
        case 336:
            // passive_pois_pierce
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Poison Pierce";
            $offset -= 8;
            break;
        case 337:
            // passive_critical_strike
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Critical Strike";
            $offset -= 8;
            break;
        case 338:
            // passive_dodge
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "+" . $stat . " to Passive Dodge";
            $offset -= 7;
            break;
        case 339:
            // passive_avoid
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "+" . $stat . " to Passive Avoid";
            $offset -= 7;
            break;
        case 340:
            // passive_evade
            $stat = bindec(substr($binitem, $offset - 6, 7));
            $property = "+" . $stat . " to Passive Evade";
            $offset -= 7;
            break;
        case 341:
            // passive_warmth
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Warmth";
            $offset -= 8;
            break;
        case 342:
            // passive_mastery_melee_th
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Melee Attack Rating";
            $offset -= 8;
            break;
        case 343:
            // passive_mastery_melee_dmg
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Melee Damage";
            $offset -= 8;
            break;
        case 344:
            // passive_mastery_melee_crit
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Melee Critical Strike";
            $offset -= 8;
            break;
        case 345:
            // passive_mastery_throw_th
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Throw Attack Rating";
            $offset -= 8;
            break;
        case 346:
            // passive_mastery_throw_dmg
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Throw Damage";
            $offset -= 8;
            break;
        case 347:
            // passive_mastery_throw_crit
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Throw Critical Strike";
            $offset -= 8;
            break;
        case 348:
            // passive_weaponblock
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Weapon Block";
            $offset -= 8;
            break;
        case 349:
            // passive_summon_resist
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Summon Resist";
            $offset -= 8;
            break;
        case 356:
            // questitemdifficulty
            $stat = $difficulty[bindec(substr($binitem, $offset - 1, 2))];
            $property = "Quest Item Difficulty: " . $stat;
            $offset -= 2;
            break;
        case 357:
            // passive_mag_mastery
            $stat = bindec(substr($binitem, $offset - 8, 9)) - 50;
            $property = "+" . $stat . " to Passive Magic Mastery";
            $offset -= 9;
            break;
        case 358:
            // passive_mag_pierce
            $stat = bindec(substr($binitem, $offset - 7, 8));
            $property = "+" . $stat . " to Passive Magic Pierce";
            $offset -= 8;
            break;
        case 511:
            // end of property list
            $property = "";
            break;
        default:
            // unknown magic property - stop decoding now
            $property = "Unknown Magical Property " . $id;
    }
    return $offset;
}