2022-05-07 12:25:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
session_start();
|
|
|
|
ob_start();
|
|
|
|
|
2022-06-21 01:27:08 +00:00
|
|
|
require_once './config.php';
|
|
|
|
require_once './_pdo.php';
|
2022-05-07 12:25:27 +00:00
|
|
|
|
2022-06-21 01:27:08 +00:00
|
|
|
require_once './src/D2Functions.php';
|
2022-06-26 19:41:06 +00:00
|
|
|
require_once './src/D2ByteReader.php';
|
2022-06-29 04:54:27 +00:00
|
|
|
require_once './src/D2BitReader.php';
|
|
|
|
require_once './src/D2Item.php';
|
2022-07-03 10:13:50 +00:00
|
|
|
require_once './src/D2Char.php';
|
2022-05-07 12:25:27 +00:00
|
|
|
|
2023-05-30 18:06:58 +00:00
|
|
|
error_reporting(E_ERROR | E_PARSE);
|
|
|
|
set_time_limit(-1);
|
|
|
|
ini_set('max_input_time', '-1');
|
|
|
|
ini_set('max_execution_time', '0');
|
|
|
|
|
2022-06-21 01:27:08 +00:00
|
|
|
define('DB_FILE', $_SESSION['modname'] . ".db");
|
|
|
|
PDO_Connect("sqlite:" . DB_FILE);
|
2022-05-07 12:25:27 +00:00
|
|
|
|
2022-06-21 01:27:08 +00:00
|
|
|
$sql = "SELECT * FROM strings";
|
|
|
|
$strings = PDO_FetchAssoc($sql);
|
2022-05-07 12:25:27 +00:00
|
|
|
|
2022-06-21 13:06:41 +00:00
|
|
|
$sql = "SELECT code,namestr
|
|
|
|
FROM armor
|
2022-06-21 01:27:08 +00:00
|
|
|
UNION SELECT code,namestr
|
|
|
|
FROM misc
|
|
|
|
UNION SELECT code,namestr
|
2022-06-29 04:54:27 +00:00
|
|
|
FROM weapons";
|
2022-06-21 13:06:41 +00:00
|
|
|
$namestr = PDO_FetchAssoc($sql);
|
2022-05-07 12:25:27 +00:00
|
|
|
|
2022-06-29 04:54:27 +00:00
|
|
|
$sql = "SELECT ID,Stat,CSvBits FROM itemstatcost WHERE Saved=1";
|
|
|
|
$ISCData = PDO_FetchAll($sql);
|
|
|
|
foreach ($ISCData as $k => $v) {
|
|
|
|
$ISC[$v['ID']] = $v;
|
|
|
|
}
|
|
|
|
|
2022-06-21 01:27:08 +00:00
|
|
|
//$filePath = "D:\Diablo II\MODS\ironman-dev\save\Aldur.d2s";
|
|
|
|
//$filePath = "D:\Diablo II\MODS\MedianXL2012\save\Lok.d2s";
|
|
|
|
//$filePath = "D:\Diablo II\MODS\MedianXL2012\save\Pal.d2s";
|
2022-06-29 04:54:27 +00:00
|
|
|
//$filePath = "D:\Diablo II\MODS\MedianXL2012\save\Test.d2s";
|
2022-05-07 12:25:27 +00:00
|
|
|
|
|
|
|
|
2023-06-03 02:43:18 +00:00
|
|
|
$filePath = "Pest.d2s";
|
2022-07-03 10:13:50 +00:00
|
|
|
$char = new D2Char($filePath);
|
2023-05-30 18:06:58 +00:00
|
|
|
|
|
|
|
//$char->setChar("CharacterStatus", "Died", 0);
|
|
|
|
//$char->setChar("CharacterStatus", "Hardcore", 1);
|
2022-07-06 23:41:24 +00:00
|
|
|
//$char->setChar("CharacterStatus", "Expansion", 1);
|
|
|
|
//$char->setChar("LeftmousebuttonskillID", 223);
|
|
|
|
|
2023-06-03 02:43:18 +00:00
|
|
|
//$char->setAllSkills(1);
|
|
|
|
$char->setSkill(4, 99);
|
2022-07-06 23:41:24 +00:00
|
|
|
//$char->setChar("CharacterClass", "Necromancer"); // 127
|
|
|
|
//$char->setChar("CharacterProgression", 1); // 0 in normal, 1 finished normal, 2 finished nm, 3 finished hell
|
2023-05-30 18:06:58 +00:00
|
|
|
|
|
|
|
//$char->setChar("CharacterStatus", "Died", 1);
|
2023-06-03 02:43:18 +00:00
|
|
|
//$char->setChar("CharacterLevel", 99);
|
|
|
|
//$char->setStat("strength", 270);
|
|
|
|
//$char->setStat("energy", 270);
|
|
|
|
//$char->setStat("dexterity", 270);
|
|
|
|
//$char->setStat("vitality", 270);
|
|
|
|
//$char->setStat("hitpoints", 100);
|
|
|
|
//$char->setStat("maxhp", 150);
|
|
|
|
//$char->setStat("stamina", 280);
|
|
|
|
//$char->setStat("maxstamina", 290);
|
|
|
|
//$char->setStat("mana", 70);
|
|
|
|
//$char->setStat("maxmana", 200);
|
2023-05-30 18:06:58 +00:00
|
|
|
|
|
|
|
|
2022-07-06 23:41:24 +00:00
|
|
|
//$char->setStat("soulcounter", 80);
|
|
|
|
//
|
|
|
|
//$char->setStat("hitpoints", 70);
|
|
|
|
//$char->setStat("maxhp", 70);
|
|
|
|
//$char->setStat("stamina", 70);
|
|
|
|
//$char->setStat("maxstamina", 200);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//$char->setStat("gold", 0);
|
|
|
|
//$char->setStat("soulcounter", 40273409479012734098712903479012374091827349081273490172093478);
|
|
|
|
|
|
|
|
|
2022-05-07 12:25:27 +00:00
|
|
|
|
2022-06-29 07:53:27 +00:00
|
|
|
|
2022-07-03 10:13:50 +00:00
|
|
|
unset($char); // destroy $char so we can read it again after writing to it to get updated stats
|
2022-06-29 04:54:27 +00:00
|
|
|
|
2022-07-03 10:13:50 +00:00
|
|
|
$char = new D2Char($filePath);
|
2023-05-30 18:06:58 +00:00
|
|
|
|
2023-06-03 02:43:18 +00:00
|
|
|
var_dump($char->cData);
|
|
|
|
//var_dump($char->cData['stats']);
|