![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Архивный участник
Join Date: Jul 2006
Posts: 119
|
The script is universal for converting npcdata and itemdata, check it.
[php:1:0b4601f89b]<pre> <?php // Xelat Copyright(c) 2006 //xelat_z@mail.ru //ICQ 195187980 $orig_dir = "c4\\orig"; $off_dir = "c4\\off"; $out_dir = "c4"; $include["npc"] = explode(",","level,acquire_exp_rate,exp,acquire_sp ,clan,ignore_clan_list,clan_help_range,slot_chest, slot_rhand,slot_lhand,skill_list,npc_ai,category,r ace,sex,undying,can_be_attacked,corpse_time,no_sle ep_mode,agro_range,ground_high,ground_low,org_hp,o rg_hp_regen,org_mp,org_mp_regen,str,int,dex,wit,co n,men,base_attack_type,base_attack_range,base_dama ge_range,base_rand_dam,base_physical_attack,base_c ritical,physical_hit_modify,base_attack_speed,base _reuse_delay,base_magic_attack,base_defend,base_ma gic_defend,physical_avoid_modify,item_make_list,co rpse_make_list,additional_make_list,additional_mak e_multi_list,hp_increase,mp_increase"); $exclude["npc"] = explode(",",""); $bad_type["npc"] = explode(",",""); $bad_type["item"] = explode(",",""); $include["item"] = explode(",","item_type,slot_bit_type,armor_type,et citem_type,consume_type,default_action,weight,soul shot_count,spiritshot_count,default_price,item_ski ll,critical_attack_skill,material_type,crystal_typ e,crystal_count,is_trade,is_drop,is_destruct,physi cal_damage,random_damage,weapon_type,can_penetrate ,critical,hit_modify,avoid_modify,dual_fhit_rate,s hield_defense,shield_defense_rate,attack_range,dam age_range,attack_speed,reuse_delay,mp_consume,magi cal_damage,durability,damaged,physical_defense,mag ical_defense,mp_bonus,category,enchanted,equip_pet ,magic_weapon,,,,,"); //$exclude["item"] = explode(",","recipe_id,reduced_soulshot,reduced_sp iritshot,reduced_mp_consume,attack_skill,magic_ski ll,item_skill_enchanted_four,html,enchant_enable,, ,,"); $exlude["item"] = explode(",",""); //Structure: <file type>_begin <type> <id> <name> <params> <file type>_end $ftype = "item"; $fname = $ftype."data.txt"; $f = fopen($off_dir."\\".$fname,"r"); while (!feof($f)) { $s = fgets($f); if (preg_match("/".$ftype."_begin\s+(\w+)\s+(\d+)\s+\[([\w_\'\`\.\-0-9]+)\]\s+(.+)\s+".$ftype."_end/i",$s,$m)) { $type = $m[1]; $id = $m[2]; $name = $m[3]; $params = $m[4]; preg_match_all("/([^\s]+)\s+/i",$params,$p); $p = $p[1]; $params = array(); foreach ($p as $val) { $p1 = explode("=",$val,2); $params[$p1[0]] = $p1[1]; } $data[$id]->type = $type; $data[$id]->name = $name; $data[$id]->params = $params; } } fclose($f); $fn = fopen($out_dir."\\".$fname,"w"); $f = fopen($orig_dir."\\".$fname,"r"); while (!feof($f)) { $s = fgets($f); if (preg_match("/".$ftype."_begin\s+(\w+)\s+(\d+)\s+\[([\w_\'\`\.\-0-9]+)\]\s+(.+)\s+".$ftype."_end/i",$s,$m)) { $type = $m[1]; $id = $m[2]; $name = $m[3]; $params = $m[4]; preg_match_all("/\s?([^\s]+)\s?/i",$params,$p); $p = $p[1]; $params = ""; foreach ($p as $val) { $pp = explode("=",$val,2); $p1 = $pp[0]; $p2 = $pp[1]; if (in_array($p1,$include) && $data[$id]->params[$p1]) $params[]=$p1."=".$data[$id]->params[$p1]; else $params[]=$p1."=".$p2; //if (in_array($p1,$include[$ftype]) || !in_array($p1,$exclude[$ftype])) //$params[]=$p1."=".($data[$id]->params[$p1]?$data[$id]->params[$p1]:$p2); //else $params[]=$p1."=".$p2; } $name = $data[$id]->name; $type = $data[$id]->type; if (!in_array($type,$bad_type[$ftype])) $s = $ftype."_begin\t".$type."\t".$id."\t[".$name."]\t".implode("\t",$params)."\t".$ftype."_end\r\n" ; } fputs($fn,$s); } fclose($f); fclose($fn); ?> </pre> [/php:1:0b4601f89b] Thnx for all who test this conveter
|
|
|
|
|
#2 |
|
Архивный участник
Join Date: Apr 2006
Posts: 729
|
Respect, Xari0n!
![]() I'll kill you. ![]() I was made a script, and you made the same?
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Jul 2006
Posts: 119
|
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: May 2006
Posts: 53
|
give me c4 retail script and i'll test it 1000 times =)
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: May 2006
Posts: 26
|
500$ pm me, lawl
|
|
|
|
|
#6 |
|
Архивный участник
Join Date: Jul 2005
Posts: 242
|
good work man, now skilldata would be perfect
|
|
|
|
|
#7 | |
|
Архивный участник
Join Date: Nov 2005
Posts: 504
|
Quote:
|
|
|
|
|
|
#8 |
|
Архивный участник
Join Date: Apr 2006
Posts: 110
|
People share it free, coz, any body has it!
|
|
|
|
|
#9 |
|
Архивный участник
Join Date: Dec 2005
Posts: 82
|
very nice work
|
|
|
|
|
#10 | |
|
Архивный участник
Join Date: Apr 2006
Posts: 76
|
Quote:
|
|
|
|
|
|