$racials[$RACE_GOBLIN] = "69046,69041,69070,69042,69044,69045"; //in case they are not already added //now generate spells for ($trace = 0; $trace < 30; $trace++) { for ($tclass = 0; $tclass < 30; $tclass++) { if ($p_spells[$trace][$tclass]) { //get the index for this race class combination $get_query = "select `index` from playercreateinfo where class={$tclass} and race={$trace}"; $get_res = mysql_query($get_query, $dbi) or die(" Q200611231501411 " . mysql_error($dbi)); list($zindex) = mysql_fetch_row($get_res); $vect = convert_line_to_elements($p_spells[$trace][$tclass]); $line_index = 0; $unk = convert_from_line_to_int8($vect); $spell_count = convert_from_line_to_int16($vect); for ($i = 0; $i < $spell_count; $i++) { $spell_id = convert_from_line_to_int($vect); $spell_unk = convert_from_line_to_int16($vect); echo "insert into playercreateinfo_spells (indexid,spellid) values ( {$zindex},{$spell_id} );<br>"; } //racials ? if ($racials[$trace] != "") { $spells_vect = explode(",", $racials[$trace]); foreach ($spells_vect as $key => $spell) { echo "insert ignore into playercreateinfo_spells (indexid,spellid) values ( {$zindex},{$spell_id} );<br>"; } } } } } echo "<br> <br>"; //now generate bars
function read_block_data($line, $object_type_id, $guid_start_pos = 0) { global $line_index, $debug, $out_unk, $bc, $write_A9_decoded, $Player_updatefields_lookup; if ($write_A9_decoded && ($object_type_id == 3 || $object_type_id == 4 || $object_type_id == 66)) { //note: 66 is uncare update type :P $do_a9_human_form = 1; } else { $do_a9_human_form = 0; } $upd_mask_len = $line[$line_index++]; if ($debug == 1 && $object_type_id != 0 && !is_valid_update_mask($upd_mask_len, $object_type_id)) { fputs($out_unk, "!!!!!!!block {$bc} does not have a valid mask : mask {$upd_mask_len} object type {$object_type_id} . Dumping portion of the packet (-5 bytes / +5 bytes) bytes"); for ($i = -6; $i < 6; $i++) { fputs($out_unk, $line[$line_index + $i] . " "); } fputs($out_unk, "\r\n"); } if ($do_a9_human_form) { $a9_humanly_readable = fopen("a9_human_form.txt", "a"); fputs($a9_humanly_readable, "start createing or updating a new object of type_id={$object_type_id} and 8 bytes for guid (guid is copressed fo there might be more bytes here):"); for ($i = $guid_start_pos; $i <= $guid_start_pos + 8; $i++) { fputs($a9_humanly_readable, $line[$i] . " "); } fputs($a9_humanly_readable, "\r\n"); } for ($i = 0; $i < $upd_mask_len * 4; $i++) { $upd_mask[$i] = $line[$line_index++]; } // echo "updt mask len $upd_mask_len from index $line_index<br>"; //now we read all the values that are sent to us $data = ""; $pmindex = 1; for ($i = 0; $i < $upd_mask_len * 32; $i++) { $mindex = (int) ($i / 8); if ($mindex != $pmindex) { $pmindex = $mindex; $cur_mask = (int) $upd_mask[$mindex]; // echo "cur mask index = $mindex and mask $cur_mask <br>"; } $last_bit = (int) ((int) $cur_mask % 2); $cur_mask = (int) ($cur_mask / 2); // echo "$last_bit"; if ($last_bit == 1) { $data[$i] = convert_from_line_to_int($line); if ($do_a9_human_form) { fputs($a9_humanly_readable, $Player_updatefields_lookup[$i] . "=" . $data[$i] . "\r\n"); } //we requested to write to file this A9 } else { $data[$i] = 0; } } if ($do_a9_human_form) { fclose($a9_humanly_readable); } return $data; }
function extract_states($from) { global $line_index; $vect = convert_line_to_elements($from); $line_index = 0; $mapid = convert_from_line_to_int($vect); $zone = convert_from_line_to_int($vect); $area = convert_from_line_to_int($vect); $state_count = convert_from_line_to_int16($vect); for ($i = 0; $i < $state_count * 2; $i += 2) { $ret[$i] = convert_from_line_to_int($vect); $ret[$i + 1] = convert_from_line_to_int($vect); } return $ret; }
$time = convert_from_line_to_int($vect); //echo "$line_index<br>"; if ($f2 & $Parabolic) { //echo "Has parabolic<br>"; $zSpeed = convert_to_float(convert_from_line_to_int($vect)); $unk = convert_from_line_to_int($vect); } $count = convert_from_line_to_int($vect); //echo "$line_index - $count <br>"; if ($count > 100) { echo "Strangely large dest count {$count}. Skipping row {$line}<br>"; continue; } $dx = convert_to_float(convert_from_line_to_int($vect)); $dy = convert_to_float(convert_from_line_to_int($vect)); $dz = convert_to_float(convert_from_line_to_int($vect)); echo "{$x}-{$y}-{$z} => {$dx}-{$dy}-{$dz} ( {$time} ) - {$f1} - {$f2}(" . ToHex($f2, 4) . ") {$count} = {$line} <br>"; continue; //this is twilight zone for ($i = 0; $i < $count; $i++) { if ($line_index > $line_size) { echo "Not enough bytes in packet - {$count} - {$line_index} - {$line_size}. Skipping row {$line}<br>"; break; } } /* uint32 last_idx = spline.getPointCount() - 3; const Vector3 * real_path = &spline.getPoint(1); data << last_idx; data << real_path[last_idx]; // destination
} for ($i = 0; $i < $Count; $i++) { $Data[$i]["Unk"] = convert_from_line_to_int($vect); } for ($i = 0; $i < $Count; $i++) { $Data[$i]["val1"] = convert_from_line_to_int($vect); $Data[$i]["val2"] = convert_from_line_to_int($vect); } for ($i = 0; $i < $Count; $i++) { $Data[$i]["Type"] = convert_from_line_to_int($vect); } for ($i = 0; $i < $Count; $i++) { $Data[$i]["Id"] = convert_from_line_to_int($vect); } for ($i = 0; $i < $Count; $i++) { $Data[$i]["Flags"] = convert_from_line_to_int($vect); } $SkipReportTypes[0] = 1; $SkipReportTypes[1] = 1; //$SkipReportTypes[2] = 1; $SkipReportTypes[3] = 1; $SkipReportTypes[4] = 1; $SkipReportTypes[5] = 1; $SkipReportTypes[6] = 1; $SkipReportTypes[7] = 1; $AlwaysReportTypes[6] = 1; for ($i = 0; $i < $Count; $i++) { if ($SkipReportTypes[$Data[$i]["Type"]] != 1 || $Data[$i]["Flags"] != 0 && $Data[$i]["Flags"] != 1 || $Data[$i]["Unk"] != 0) { if ($AlwaysReportTypes[$Data[$i]["Type"]] != 1) { $SkipReportTypes[$Data[$i]["Type"]] = 1; }