diff --git a/D2SaveFileStructure.php b/D2SaveFileStructure.php new file mode 100644 index 0000000..4f9626a --- /dev/null +++ b/D2SaveFileStructure.php @@ -0,0 +1,137 @@ + 4, // Identifier + 4 => 4, // Version ID + 8 => 4, // File size + 12 => 4, // Checksum + 16 => 4, // Active weapon + 20 => 16, // Character Name + 36 => 1, // Character Status + 37 => 1, // Character progression + 38 => 2, // Unknown + 40 => 1, // Character Class + 41 => 2, // Unknown + 43 => 1, // Character Level + 44 => 4, // Unknown + 48 => 4, // Last played + 52 => 4, // Unknown + 56 => 64, // Assigned skills + 120 => 4, // Left mouse button skill ID + 124 => 4, // Right mouse button skill ID + 128 => 4, // Left swap mouse button skill ID + 132 => 4, // Right swap mouse button skill ID + 136 => 32, // Character menu appearance + 168 => 3, // Difficulty + 171 => 4, // Map ID + 175 => 2, // Unknown + 177 => 2, // Mercenary dead + 179 => 4, // Mercenary ID + 183 => 2, // Mercenary Name ID + 185 => 2, // Mercenary type + 187 => 4, // Mercenary experience + 191 => 144, // Unknown + 335 => 298, // Quests + 633 => 81, // Waypoints + 714 => 51, // NPC Introductions +]; + +foreach ($offsets as $k => $v){ + fseek($fp, $k); + $data[$k] = fread($fp, $v); +} + +function strtobits(string $str): string +{ + $ret = ""; + for ($i = 0; $i < strlen($str); ++ $i) { + $ord = ord($str[$i]); + for ($bitnum = 7; $bitnum >= 0; -- $bitnum) { + if ($ord & (1 << $bitnum)) { + $ret .= "1"; + } else { + $ret .= "0"; + } + } + } + return $ret; +} + +$charData['Identifier'] = bin2hex($data['0']); + +$charData['VersionID'] = unpack('l', $data['4'])[1]; // 96 is v1.10+ - check out + +$charData['Filesize'] = round(unpack('l', $data['8'])[1]/1024, 2) . " KB"; // 1.41 KB (1,447 bytes) - checks out + +// $charData['Checksum'] = bin2hex($data['12']); +// $charData['Activeweapon'] = unpack('l', $data['16']); + +$charData['CharacterName'] = ($data['20']); + + +$charData['CharacterStatus'] = array_filter(str_split(strtobits($data['36']))); + +foreach ($charData['CharacterStatus'] as $k => $v){ + $str .= ($characterStatus[$k]) . " "; +} + +$charData['CharacterStatus'] = $str; + + + +// $charData['Characterprogression'] = bindec($data['37']); + +$charData['CharacterClass'] = $class[unpack('C',$data['40'])[1]]; + + +$charData['CharacterLevel'] = unpack('C', $data['43'])[1]; + + + +$charData['Lastplayed'] = gmdate("Y-m-d\TH:i:s\Z", unpack('I', $data['48'])[0]); + +// $charData['Assignedskills'] = (unpack('i16', $data['56'])); + +$charData['LeftmousebuttonskillID'] = $skills[unpack('i', $data['120'])[1]]; +$charData['RightmousebuttonskillID'] = $skills[unpack('i', $data['124'])[1]]; +$charData['LeftswapmousebuttonskillID'] = $skills[unpack('i', $data['128'])[1]]; +$charData['RightswapmousebuttonskillID'] = $skills[unpack('i', $data['132'])[1]]; + +// $charData['Charactermenuappearance'] = unpack('i', $data['136']); + +$charData['Difficulty'] = strtobits($data['168']); + +// $charData['MapID'] = $data['171']; + +//$charData['Mercenarydead'] = unpack('i', $data['177']); +//$charData['MercenaryID'] = $data['179']; +//$charData['MercenaryNameID'] = $data['183']; +//$charData['Mercenarytype'] = $data['185']; +//$charData['Mercenaryexperience'] = $data['187']; + +$charData['Quests'] = $data['335']; +$charData['Waypoints'] = $data['633']; +$charData['NPCIntroductions'] = $data['714']; + + +echo "
"; +print_r($charData); + +// $charData['Unknown'] = $data['44']; +// $charData['Unknown'] = $data['52']; +// $charData['Unknown'] = $data['175']; +// $charData['Unknown'] = $data['191']; diff --git a/D2SaveFileStructureData.php b/D2SaveFileStructureData.php new file mode 100644 index 0000000..117ba4c --- /dev/null +++ b/D2SaveFileStructureData.php @@ -0,0 +1,830 @@ + 'Attack', +1 => 'Kick', +2 => 'Throw', +3 => 'Unsummon', +4 => 'Left Hand Throw', +5 => 'Left Hand Swing', +6 => 'Magic Arrow', +7 => 'Fire Arrow', +8 => 'Inner Sight', +9 => 'Critical Strike', +10 => 'Jab', +11 => 'Cold Arrow', +12 => 'Multiple Shot', +13 => 'Dodge', +14 => 'Power Strike', +15 => 'Poison Javelin', +16 => 'Exploding Arrow', +17 => 'Slow Missiles', +18 => 'Avoid', +19 => 'Impale', +20 => 'Lightning Bolt', +21 => 'Ice Arrow', +22 => 'Guided Arrow', +23 => 'Penetrate', +24 => 'Charged Strike', +25 => 'Plague Javelin', +26 => 'Strafe', +27 => 'Immolation Arrow', +28 => 'Decoy', +29 => 'Evade', +30 => 'Fend', +31 => 'Freezing Arrow', +32 => 'Valkyrie', +33 => 'Pierce', +34 => 'Lightning Strike', +35 => 'Lightning Fury', +36 => 'Fire Bolt', +37 => 'Warmth', +38 => 'Charged Bolt', +39 => 'Ice Bolt', +40 => 'Frozen Armor', +41 => 'Inferno', +42 => 'Static Field', +43 => 'Telekinesis', +44 => 'Frost Nova', +45 => 'Ice Blast', +46 => 'Blaze', +47 => 'Fire Ball', +48 => 'Nova', +49 => 'Lightning', +50 => 'Shiver Armor', +51 => 'Fire Wall', +52 => 'Enchant', +53 => 'Chain Lightning', +54 => 'Teleport', +55 => 'Glacial Spike', +56 => 'Meteor', +57 => 'Thunder Storm', +58 => 'Energy Shield', +59 => 'Blizzard', +60 => 'Chilling Armor', +61 => 'Fire Mastery', +62 => 'Hydra', +63 => 'Lightning Mastery', +64 => 'Frozen Orb', +65 => 'Cold Mastery', +66 => 'Amplify Damage', +67 => 'Teeth', +68 => 'Bone Armor', +69 => 'Skeleton Mastery', +70 => 'Raise Skeleton', +71 => 'Dim Vision', +72 => 'Weaken', +73 => 'Poison Dagger', +74 => 'Corpse Explosion', +75 => 'Clay Golem', +76 => 'Iron Maiden', +77 => 'Terror', +78 => 'Bone Wall', +79 => 'Golem Mastery', +80 => 'Raise Skeletal Mage', +81 => 'Confuse', +82 => 'Life Tap', +83 => 'Poison Explosion', +84 => 'Bone Spear', +85 => 'Air Elemental', +86 => 'Attract', +87 => 'Decrepify', +88 => 'Bone Prison', +89 => 'Summon Resist', +90 => 'Iron Golem', +91 => 'Lower Resist', +92 => 'Poison Nova', +93 => 'Bone Spirit', +94 => 'Fire Golem', +95 => 'Revive', +96 => 'Sacrifice', +97 => 'Smite', +98 => 'Might', +99 => 'Prayer', +100 => 'Resist Fire', +101 => 'Holy Bolt', +102 => 'Holy Fire', +103 => 'Thorns', +104 => 'Defiance', +105 => 'Resist Cold', +106 => 'Zeal', +107 => 'Charge', +108 => 'Blessed Aim', +109 => 'Cleansing', +110 => 'Resist Lightning', +111 => 'Vengeance', +112 => 'Blessed Hammer', +113 => 'Concentration', +114 => 'Holy Freeze', +115 => 'Vigor', +116 => 'Conversion', +117 => 'Holy Shield', +118 => 'Holy Shock', +119 => 'Sanctuary', +120 => 'Meditation', +121 => 'Fist of the Heavens', +122 => 'Fanaticism', +123 => 'Conviction', +124 => 'Redemption', +125 => 'Salvation', +126 => 'Bash', +127 => 'Sword Mastery', +128 => 'Axe Mastery', +129 => 'Mace Mastery', +130 => 'Howl', +131 => 'Find Potion', +132 => 'Leap', +133 => 'Double Swing', +134 => 'Pole Arm Mastery', +135 => 'Throwing Mastery', +136 => 'Spear Mastery', +137 => 'Taunt', +138 => 'Shout', +139 => 'Stun', +140 => 'Double Throw', +141 => 'Increased Stamina', +142 => 'Find Item', +143 => 'Leap Attack', +144 => 'Concentrate', +145 => 'Iron Skin', +146 => 'Battle Cry', +147 => 'Frenzy', +148 => 'Increased Speed', +149 => 'Battle Orders', +150 => 'Grim Ward', +151 => 'Whirlwind', +152 => 'Berserk', +153 => 'Natural Resistance', +154 => 'War Cry', +155 => 'Battle Command', +190 => 'Prime Ice Nova', +195 => 'Diablo Fire', +201 => 'Andariel Poison Bolt', +217 => 'Scroll of Identify', +218 => 'Tome of Identify', +219 => 'Scroll of Townportal', +220 => 'Tome of Townportal', +221 => 'Raven', +222 => 'Werewolf', +223 => 'Werewolf', +224 => 'Lycanthropy', +225 => 'Firestorm', +226 => 'Oak Sage', +227 => 'Summon Spirit Wolf', +228 => 'Werebear', +229 => 'Molten Boulder', +230 => 'Arctic Blast', +231 => 'Carrion Vine', +232 => 'Feral Rage', +233 => 'Maul', +234 => 'Fissure', +235 => 'Cyclone Armor', +236 => 'Heart of Wolverine', +237 => 'Summon Dire Wolf', +238 => 'Rabies', +239 => 'Fire Claws', +240 => 'Twister', +241 => 'Solar Creeper', +242 => 'Hunger', +243 => 'Shock Wave', +244 => 'Volcano', +245 => 'Tornado', +246 => 'Spirit of Barbs', +247 => 'Summon Grizzly', +248 => 'Fury', +249 => 'Armageddon', +250 => 'Hurricane', +251 => 'Fire Blast', +252 => 'Claw Mastery', +253 => 'Psychic Hammer', +254 => 'Tiger Strike', +255 => 'Dragon Talon', +256 => 'Shock Web', +257 => 'Blade Sentinel', +258 => 'Burst of Speed', +259 => 'Fists of Fire', +260 => 'Dragon Claw', +261 => 'Charged Bolt Sentry', +262 => 'Wake of Fire', +263 => 'Weapon Block', +264 => 'Cloak of Shadows', +265 => 'Cobra Strike', +266 => 'Blade Fury', +267 => 'Fade', +268 => 'Shadow Warrior', +269 => 'Claws of Thunder', +270 => 'Dragon Tail', +271 => 'Lightning Sentry', +272 => 'Wake of Inferno', +273 => 'Mind Blast', +274 => 'Blades of Ice', +275 => 'Dragon Flight', +276 => 'Death Sentry', +277 => 'Blade Shield', +278 => 'Venom', +279 => 'Shadow Master', +280 => 'Phoenix Strike', +316 => 'Baal Nova', +317 => 'Baal Inferno', +318 => 'Baal Cold Missiles', +350 => 'Delirium', +358 => 'Poison Bolt', +359 => 'Poison Spray', +360 => 'StartingPassive', +366 => 'Prime Ice Nova', +371 => 'Diablo Fire', +377 => 'Andariel Poison Bolt', +378 => 'Baal Nova', +379 => 'Baal Inferno', +380 => 'Baal Cold Missiles', +383 => 'Might', +384 => 'Prayer', +385 => 'Resist Fire', +386 => 'Holy Fire', +387 => 'Thorns', +388 => 'Defiance', +389 => 'Resist Cold', +390 => 'Blessed Aim', +391 => 'Cleansing', +392 => 'Resist Lightning', +393 => 'Concentration', +394 => 'Holy Freeze', +395 => 'Vigor', +396 => 'Holy Shock', +397 => 'Sanctuary', +398 => 'Meditation', +399 => 'Fanaticism', +400 => 'Conviction', +401 => 'Redemption', +402 => 'Salvation', +403 => 'Warmth', +404 => 'Warmth', +405 => 'Warmth', +406 => 'Warmth', +407 => 'Warmth', +408 => 'Warmth', +409 => 'Warmth', +410 => 'Experience Boost', +411 => 'Experience Boost', +412 => 'Experience Boost', +413 => 'Experience Boost', +414 => 'Experience Boost', +415 => 'Experience Boost', +416 => 'Experience Boost', +417 => 'Andariel Poison Bolt', +418 => 'Blizzard', +419 => 'Bone Spirit', +420 => 'Chain Lightning', +421 => 'Charged Bolt', +422 => 'Diablo Fire', +425 => 'Fissure', +426 => 'Fire Ball', +427 => 'Fire Bolt', +428 => 'Fire Blast', +429 => 'Fire Wall', +430 => 'Firestorm', +431 => 'Fist of the Heavens', +432 => 'Frost Nova', +433 => 'Frozen Orb', +434 => 'Glacial Spike', +435 => 'Ice Blast', +436 => 'Ice Bolt', +439 => 'Lightning', +440 => 'Meteor', +441 => 'Molten Boulder', +442 => 'Nova', +443 => 'Poison Nova', +448 => 'Prime Ice Nova', +453 => 'Shock Wave', +454 => 'Static Field', +455 => 'Teeth', +456 => 'Tornado', +457 => 'Twister', +461 => 'Volcano', +462 => 'Diablo Red Lightning', +463 => 'Diablo Red Lightning', +464 => 'Summon Skeleton', +465 => 'Summon Returned', +466 => 'Summon BoneWarrior', +467 => 'Summon BurningDead', +468 => 'Summon Horror', +469 => 'Summon Zombie', +470 => 'Summon HungryDead', +471 => 'Summon Ghoul', +472 => 'Summon DrownedCarcass', +473 => 'Summon PlagueBearer', +474 => 'Summon Afflicted', +475 => 'Summon Tainted', +476 => 'Summon Misshapen', +477 => 'Summon Disfigured', +478 => 'Summon Damned', +479 => 'Summon FoulCrow', +480 => 'Summon BloodHawk', +481 => 'Summon BlackRaptor', +482 => 'Summon CloudStalker', +483 => 'Summon Fallen', +484 => 'Summon Carver', +485 => 'Summon Devilkin', +486 => 'Summon DarkOne', +487 => 'Summon WarpedFallen', +488 => 'Summon Brute', +489 => 'Summon Yeti', +490 => 'Summon Crusher', +491 => 'Summon WailingBeast', +492 => 'Summon GargantuanBeast', +493 => 'Summon SandRaider', +494 => 'Summon Marauder', +495 => 'Summon Invader', +496 => 'Summon Infidel', +497 => 'Summon Assailant', +498 => 'Summon Ghost', +499 => 'Summon Wraith', +500 => 'Summon Specter', +501 => 'Summon Apparition', +502 => 'Summon DarkShape', +503 => 'Summon DarkHunter', +504 => 'Summon VileHunter', +505 => 'Summon DarkStalker', +506 => 'Summon BlackRogue', +507 => 'Summon FleshHunter', +508 => 'Summon DuneBeast', +509 => 'Summon RockDweller', +510 => 'Summon JungleHunter', +511 => 'Summon DoomApe', +512 => 'Summon TempleGuard', +513 => 'Summon MoonClan', +514 => 'Summon NightClan', +515 => 'Summon BloodClan', +516 => 'Summon HellClan', +517 => 'Summon DeathClan', +518 => 'Summon FallenShaman', +519 => 'Summon CarverShaman', +520 => 'Summon DevilkinShaman', +521 => 'Summon DarkShaman', +522 => 'Summon WarpedShaman', +523 => 'Summon QuillRat', +524 => 'Summon SpikeFiend', +525 => 'Summon ThornBeast', +526 => 'Summon RazorSpine', +527 => 'Summon JungleUrchin', +528 => 'Summon SandMaggot', +529 => 'Summon RockWorm', +530 => 'Summon Devourer', +531 => 'Summon GiantLamprey', +532 => 'Summon WorldKiller', +533 => 'Summon TombViper', +534 => 'Summon ClawViper', +535 => 'Summon Salamander', +536 => 'Summon PitViper', +537 => 'Summon SerpentMagus', +538 => 'Summon SandLeaper', +539 => 'Summon CaveLeaper', +540 => 'Summon TombCreeper', +541 => 'Summon TreeLurker', +542 => 'Summon RazorPitRaakshus', +543 => 'Summon Huntress', +544 => 'Summon SaberCat', +545 => 'Summon NightTiger', +546 => 'Summon HellCat', +547 => 'Summon Itchies', +548 => 'Summon BlackLocusts', +549 => 'Summon PlagueBugs', +550 => 'Summon HellSwarm', +551 => 'Summon DungSoldier', +552 => 'Summon SandWarrior', +553 => 'Summon Scarab', +554 => 'Summon SteelWeevil', +555 => 'Summon AlbinoRoach', +556 => 'Summon DriedCorpse', +557 => 'Summon Decayed', +558 => 'Summon Embalmed', +559 => 'Summon PreservedDead', +560 => 'Summon Cadaver', +561 => 'Summon HollowOne', +562 => 'Summon Guardian', +563 => 'Summon Unraveler', +564 => 'Summon Horadrim Ancient', +565 => 'Summon Baal Subject Mummy', +566 => 'Summon CarrionBird', +567 => 'Summon UndeadScavenger', +568 => 'Summon HellBuzzard', +569 => 'Summon WingedNightmare', +570 => 'Summon Sucker', +571 => 'Summon Feeder', +572 => 'Summon BloodHook', +573 => 'Summon BloodWing', +574 => 'Summon Gloam', +575 => 'Summon SwampGhost', +576 => 'Summon BurningSoul', +577 => 'Summon BlackSoul', +578 => 'Summon Arach', +579 => 'Summon SandFisher', +580 => 'Summon PoisonSpinner', +581 => 'Summon FlameSpider', +582 => 'Summon SpiderMagus', +583 => 'Summon ThornedHulk', +584 => 'Summon BrambleHulk', +585 => 'Summon Thrasher', +586 => 'Summon Spikefist', +587 => 'Summon GhoulLord', +588 => 'Summon NightLord', +589 => 'Summon DarkLord', +590 => 'Summon BloodLord', +591 => 'Summon Banished', +592 => 'Summon DesertWing', +593 => 'Summon Fiend', +594 => 'Summon Gloombat', +595 => 'Summon BloodDiver', +596 => 'Summon DarkFamiliar', +597 => 'Summon RatMan', +598 => 'Summon Fetish', +599 => 'Summon Flayer', +600 => 'Summon SoulKiller', +601 => 'Summon StygianDoll', +602 => 'Summon Andariel', +603 => 'Summon DarkRanger', +604 => 'Summon VileArcher', +605 => 'Summon DarkArcher', +606 => 'Summon BlackArcher', +607 => 'Summon FleshArcher', +608 => 'Summon DarkSpearwoman', +609 => 'Summon VileLancer', +610 => 'Summon DarkLancer', +611 => 'Summon BlackLancer', +612 => 'Summon FleshLancer', +613 => 'Summon SkeletonArcher', +614 => 'Summon ReturnedArcher', +615 => 'Summon BoneArcher', +616 => 'Summon BurningDeadArcher', +617 => 'Summon HorrorArcher', +618 => 'Summon SandMaggotYoung', +619 => 'Summon RockWormYoung', +620 => 'Summon DevourerYoung', +621 => 'Summon GiantLampreyYoung', +622 => 'Summon WorldKillerYoung', +623 => 'Summon Blunderbore', +624 => 'Summon Gorbelly', +625 => 'Summon Mauler', +626 => 'Summon Urdar', +627 => 'Summon SandMaggotEgg', +628 => 'Summon RockWormEgg', +629 => 'Summon DevourerEgg', +630 => 'Summon GiantLampreyEgg', +631 => 'Summon WorldKillerEgg', +632 => 'Summon FoulCrowNest', +633 => 'Summon BloodHawkNest', +634 => 'Summon BlackVultureNest', +635 => 'Summon CloudStalkerNest', +636 => 'Summon Duriel', +637 => 'Summon Undead RatMan', +638 => 'Summon Undead Fetish', +639 => 'Summon Undead Flayer', +640 => 'Summon Undead SoulKiller', +641 => 'Summon Undead StygianDoll', +642 => 'Summon Radament', +643 => 'Summon FlyingScimitar', +644 => 'Summon Zakarumite', +645 => 'Summon Faithful', +646 => 'Summon Zealot', +647 => 'Summon Sexton', +648 => 'Summon Cantor', +649 => 'Summon Heirophant', +650 => 'Summon Heirophant', +651 => 'Summon Mephisto', +652 => 'Summon Diablo', +653 => 'Summon Swamp Dweller', +654 => 'Summon Bog Creature', +655 => 'Summon Slime Prince', +656 => 'Summon Summoner', +657 => 'Summon izual', +658 => 'Summon Bloodraven', +659 => 'Summon GargoyleTrap', +660 => 'Summon ReturnedMage', +661 => 'Summon BoneMage', +662 => 'Summon BurningDeadMage', +663 => 'Summon HorrorMage', +664 => 'Summon RatManShaman', +665 => 'Summon FetishShaman', +666 => 'Summon FlayerShaman', +667 => 'Summon SoulKillerShaman', +668 => 'Summon StygianDollShaman', +669 => 'Summon SandMaggotQueen', +670 => 'Summon RockWormQueen', +671 => 'Summon DevourerQueen', +672 => 'Summon GiantLampreyQueen', +673 => 'Summon WorldKillerQueen', +674 => 'Summon ClayGolem', +675 => 'Summon BloodGolem', +676 => 'Summon IronGolem', +677 => 'Summon FireGolem', +678 => 'Summon FleshSpawner', +679 => 'Summon StygianHag', +680 => 'Summon Grotesque', +681 => 'Summon FleshBeast', +682 => 'Summon StygianDog', +683 => 'Summon GrotesqueWyrm', +684 => 'Summon Groper', +685 => 'Summon Strangler', +686 => 'Summon StormCaster', +687 => 'Summon Corpulent', +688 => 'Summon CorpseSpitter', +689 => 'Summon MawFiend', +690 => 'Summon DoomKnight', +691 => 'Summon AbyssKnight', +692 => 'Summon OblivionKnight', +693 => 'Summon QuillBear', +694 => 'Summon SpikeGiant', +695 => 'Summon ThornBrute', +696 => 'Summon RazorBeast', +697 => 'Summon GiantUrchin', +698 => 'Summon Council Member', +699 => 'Summon Council Member', +700 => 'Summon Council Member', +701 => 'Summon Turret', +702 => 'Summon Turret', +703 => 'Summon Turret', +704 => 'Summon Hydra', +705 => 'Summon Hydra', +706 => 'Summon Hydra', +707 => 'Summon Balrog', +708 => 'Summon PitLord', +709 => 'Summon VenomLord', +710 => 'Summon Griswold', +711 => 'Summon LightningSpire', +712 => 'Summon FireTower', +713 => 'Summon Slinger', +714 => 'Summon SpearCat', +715 => 'Summon NightSlinger', +716 => 'Summon HellSlinger', +717 => 'Summon ReturnedMage', +718 => 'Summon BoneMage', +719 => 'Summon BaalColdMage', +720 => 'Summon HorrorMage', +721 => 'Summon ReturnedMage', +722 => 'Summon BoneMage', +723 => 'Summon BurningDeadMage', +724 => 'Summon HorrorMage', +725 => 'Summon ReturnedMage', +726 => 'Summon BoneMage', +727 => 'Summon BurningDeadMage', +728 => 'Summon HorrorMage', +729 => 'Summon Hell Bovine', +730 => 'Summon SpearCat', +731 => 'Summon NightSlinger', +732 => 'Summon RatMan', +733 => 'Summon Fetish', +734 => 'Summon Flayer', +735 => 'Summon SoulKiller', +736 => 'Summon StygianDoll', +737 => 'Summon The Smith', +738 => 'Summon TrappedSoul', +739 => 'Summon TrappedSoul', +740 => 'Summon RatMan', +741 => 'Summon The Feature Creep', +742 => 'Summon RotWalker', +743 => 'Summon ReanimatedHorde', +744 => 'Summon ProwlingDead', +745 => 'Summon UnholyCorpse', +746 => 'Summon DefiledWarrior', +747 => 'Summon Siege Beast', +748 => 'Summon CrushBiest', +749 => 'Summon BloodBringer', +750 => 'Summon GoreBearer', +751 => 'Summon DeamonSteed', +752 => 'Summon Snow Drifter', +753 => 'Summon Abominable', +754 => 'Summon Chilled Froth', +755 => 'Summon Frozen Abyss', +756 => 'Summon FanaticMinion', +757 => 'Summon BerserkSlayer', +758 => 'Summon ConsumedIceBoar', +759 => 'Summon ConsumedFireBoar', +760 => 'Summon FrenziedHellSpawn', +761 => 'Summon FrenziedIceSpawn', +762 => 'Summon InsaneHellSpawn', +763 => 'Summon InsaneIceSpawn', +764 => 'Summon Succubusexp', +765 => 'Summon VileTemptress', +766 => 'Summon StygianHarlot', +767 => 'Summon Hell Temptress', +768 => 'Summon Blood Temptress', +769 => 'Summon Dominus', +770 => 'Summon VileWitch', +771 => 'Summon StygianFury', +772 => 'Summon Blood Witch', +773 => 'Summon Hell Witch', +774 => 'Summon OverSeer', +775 => 'Summon Lasher', +776 => 'Summon OverLord', +777 => 'Summon BloodBoss', +778 => 'Summon HellWhip', +779 => 'Summon Raakshus Portal', +780 => 'Summon Raakshus Portal', +781 => 'Summon Raakshus Portal', +782 => 'Summon Raakshus Portal', +783 => 'Summon Raakshus Portal', +784 => 'Summon Raakshus Portal', +785 => 'Summon Raakshus Portal', +786 => 'Summon Raakshus Portal', +787 => 'Summon Raakshus Imp', +788 => 'Summon Raakshus Rascal', +789 => 'Summon Raakshus Gremlin', +790 => 'Summon Raakshus Trickster', +791 => 'Summon Raakshus Sprite', +792 => 'Summon Frozen Creeper', +793 => 'Summon Frozen Terror', +794 => 'Summon Frozen Scourge', +795 => 'Summon Frozen Horror', +796 => 'Summon Frozen Scorch', +797 => 'Summon Moon Lord', +798 => 'Summon Night Lord', +799 => 'Summon Blood Lord', +800 => 'Summon Death Lord', +801 => 'Summon Hell Lord', +802 => 'Summon Death Mauler', +803 => 'Summon Death Brawler', +804 => 'Summon Death Slasher', +805 => 'Summon Death Berserker', +806 => 'Summon Death Brigadier', +807 => 'Summon Putrid Defiler', +808 => 'Summon Wretched Defiler', +809 => 'Summon Fetid Defiler', +810 => 'Summon Rancid Defiler', +811 => 'Summon Rank Defiler', +812 => 'Summon Pain Worm', +813 => 'Summon Torment Worm', +814 => 'Summon Agony Worm', +815 => 'Summon Menace Worm', +816 => 'Summon Anguish Worm', +817 => 'Summon VenomLord', +818 => 'Summon Festering Appendages', +819 => 'Summon Festering Appendages', +820 => 'Summon Festering Appendages', +821 => 'Summon Festering Appendages', +822 => 'Summon Festering Appendages', +823 => 'Summon Baal', +824 => 'Summon Stone Giant', +825 => 'Ice Golem', +826 => 'Ice Golem', +827 => 'Ice Golem', +828 => 'Ice Golem', +829 => 'Ice Golem', +830 => 'Ice Golem', +831 => 'Teeth Nova', +832 => 'Teeth Nova', +833 => 'Teeth Nova', +834 => 'Teeth Nova', +835 => 'Teeth Nova', +836 => 'Teeth Nova', +837 => 'Teeth Nova', +838 => 'Find Potion', +839 => 'Find Potion', +840 => 'Find Potion', +841 => 'Find Potion', +842 => 'Find Potion', +843 => 'Find Potion', +844 => 'Find Potion', +845 => 'Find Item', +846 => 'Find Item', +847 => 'Find Item', +848 => 'Find Item', +849 => 'Find Item', +850 => 'Find Item', +851 => 'Find Item', +852 => 'Poisonous Wildfire Nova', +853 => 'Poisonous Wildfire', +854 => 'Acid Rain', +855 => 'Poison Orb', +856 => 'Toxic Fumes', +857 => 'Djinni', +858 => 'dummy', +859 => 'dummy', +860 => 'dummy', +861 => 'dummy', +862 => 'dummy', +863 => 'dummy', +864 => 'dummy', +865 => 'dummy', +866 => 'dummy', +867 => 'Poison Arrow', +868 => 'dummy', +869 => 'dummy', +870 => 'Summon Leopard', +871 => 'Summon EarthSpirit', +872 => 'Summon Snake', +873 => 'Poison Mastery', +874 => 'Magic Mastery', +875 => 'Fire Mastery', +876 => 'Cold Mastery', +877 => 'Lightning Mastery', +878 => 'Poison Mastery', +879 => 'Magic Mastery', +880 => 'Fire Mastery', +881 => 'Cold Mastery', +882 => 'Lightning Mastery', +883 => 'Poison Mastery', +884 => 'Magic Mastery', +885 => 'Fire Mastery', +886 => 'Cold Mastery', +887 => 'Lightning Mastery', +888 => 'Poison Mastery', +889 => 'Magic Mastery', +890 => 'Fire Mastery', +891 => 'Cold Mastery', +892 => 'Lightning Mastery', +893 => 'Poison Mastery', +894 => 'Magic Mastery', +895 => 'Fire Mastery', +896 => 'Cold Mastery', +897 => 'Lightning Mastery', +898 => 'Poison Mastery', +899 => 'Magic Mastery', +900 => 'Fire Mastery', +901 => 'Cold Mastery', +902 => 'Lightning Mastery', +903 => 'Poison Mastery', +904 => 'Magic Mastery', +905 => 'dummy', +906 => 'dummy', +907 => 'dummy', +908 => 'Flying Djinni', +909 => 'dummy', +910 => 'dummy', +911 => 'Bone Golem', +912 => 'dummy', +913 => 'Summon Wild Dog', +914 => 'dummy', +915 => 'dummy', +916 => 'dummy', +917 => 'dummy', +918 => 'Lava Golem', +919 => 'dummy', +920 => 'Summon Blood Wolf', +921 => 'dummy', +922 => 'Summon Mastery', +923 => 'Summon Mastery', +924 => 'Summon Mastery', +925 => 'Summon Mastery', +926 => 'dummy', +927 => 'Summon Mastery', +928 => 'Summon Mastery', +929 => 'Green Slime', +930 => 'Purple Slime', +931 => 'Red Slime', +932 => 'Yellow Slime', +933 => 'Blue Slime', +934 => 'dummy', +935 => 'dummy', +936 => 'dummy', +937 => 'dummy', +938 => 'dummy', +939 => 'dummy', +940 => 'dummy', +941 => 'dummy', +942 => 'dummy', +943 => 'dummy', +944 => 'dummy', +945 => 'dummy', +946 => 'dummy', +947 => 'dummy', +948 => 'dummy', +949 => 'dummy', +950 => 'dummy', +951 => 'dummy', +952 => 'dummy', +953 => 'dummy', +954 => 'dummy', +955 => 'dummy', +956 => 'dummy', +957 => 'dummy', +958 => 'dummy', +959 => 'dummy', +960 => 'dummy', +961 => 'dummy', +962 => 'dummy', +963 => 'dummy' +]; + + +$class = [ + 0 => 'Amazon', + 1 => 'Sorceress', + 2 => 'Necromancer', + 3 => 'Paladin', + 4 => 'Barbarian', + 5 => 'Druid', + 6 => 'Assassin' +]; + + +$characterStatus = [ + 0 => '', + 1 => '', + 2 => 'Hardcore', + 3 => 'Died', + 4 => '', + 5 => 'Expansion', + 6 => 'Ladder', + 7 => '' + +]; \ No newline at end of file diff --git a/test.php b/scratchSpaceFile.php similarity index 83% rename from test.php rename to scratchSpaceFile.php index ddad823..7cab236 100644 --- a/test.php +++ b/scratchSpaceFile.php @@ -19,10 +19,70 @@ require_once './src/D2DocGenerator.php'; +$filePath = "D:\Diablo II\MODS\ironman-dev\save\Sorc.d2s"; -foreach(glob("C:\*") as $g){ - var_dump($g); +$fp = fopen($filePath, "rb"); + +$offsets = [ + 0 => 4, + 4 => 4, + 8 => 4, + 12 => 4, + 16 => 4, + 20 => 16, + 36 => 1, + 37 => 1, + 38 => 2, + 40 => 1, + 41 => 2, + 43 => 1, + 44 => 4, + 48 => 4, + 52 => 4, + 56 => 64, + 120 => 4, + 124 => 4, + 128 => 4, + 132 => 4, + 136 => 32, + 168 => 3, + 171 => 4, + 175 => 2, + 177 => 2, + 179 => 4, + 183 => 2, + 185 => 2, + 187 => 4, + 191 => 144, + 335 => 298, + 633 => 81, + 714 => 51, +]; + +foreach ($offsets as $k => $v){ + fseek($fp, $k); + $data[$k] = fread($fp, $v); } +echo ""; +print_r($data); + + + + + + + + + + + + + + + + + + diff --git a/src/D2ItemData.php b/src/D2ItemData.php index f559b4e..7cb3ea4 100755 --- a/src/D2ItemData.php +++ b/src/D2ItemData.php @@ -131,12 +131,7 @@ class D2ItemData { $sql = "SELECT func1,stat1 - func2,stat2 - func3,stat3 - func4,stat4 - func5,stat5 - func6,stat6 - func6,stat7 + FROM properties WHERE code = ?"; $props[$key]['stat'] = PDO_FetchRow($sql, [$val['prop' . $counter]]); // if not empty, filter props key stat