Jump to content

Recommended Posts

Posted (edited)

with this script you can remove drop groups from all mobs in npcdata.
maybe someone will use it.

 

<?php
$contenido ="";

$file = fopen("npcdata.txt", "r") or exit("Error!");

while(!feof($file))
{
	$modificado=false;
	$additional_make_multi_list_nuevo = "additional_make_multi_list={";
	
	$linea = fgets($file);
	$partes = explode('	', $linea);
	$additional_make_multi_list = $partes[60];	
			
	$additional_make_multi_list = str_replace("additional_make_multi_list=", "", $additional_make_multi_list);	
	$additional_make_multi_list = str_replace("{", "", $additional_make_multi_list);
	$additional_make_multi_list = str_replace("}", "", $additional_make_multi_list);	
	$additional_make_multi_list = str_replace("[", "x[", $additional_make_multi_list);	
	$additional_make_multi_list = str_replace("]", "]x", $additional_make_multi_list);	
	$partes_drop = explode(';', $additional_make_multi_list);
	
	for($z = 0; $z < count($partes_drop); ++$z) 
	{
		if (strpos($partes_drop[$z], '[') !== false) {
			$item_name=$partes_drop[$z];
			$drop_min=$partes_drop[$z+1];
			$drop_max=$partes_drop[$z+2];
			$drop_chance=$partes_drop[$z+3];

			$arreglo= "{{{".$item_name.";".$drop_min.";".$drop_max.";".$drop_chance."}};100};";
			$additional_make_multi_list_nuevo .= $arreglo;
			$modificado=true;
		}
	}
	
	$additional_make_multi_list_nuevo = str_replace("x[", "[", $additional_make_multi_list_nuevo);	
	$additional_make_multi_list_nuevo = str_replace("]x", "]", $additional_make_multi_list_nuevo);	
	$additional_make_multi_list_nuevo = substr ($additional_make_multi_list_nuevo, 0, strlen($additional_make_multi_list_nuevo) - 1);
	$additional_make_multi_list_nuevo .= "}";

	if ($modificado)
		$partes[60] = $additional_make_multi_list_nuevo;
		
	for($i = 0; $i < count($partes); ++$i) {
		$contenido .= $partes[$i];
		if ((count($partes)-1)!=$i && count($partes)>5)
			$contenido .= "	";
	}	
}
fclose($file);

$fch= fopen("npcdata_Nuevo_Ansi.txt", "w"); 
fwrite($fch, $contenido);
fclose($fch);

?>

 

Edited by guytis
Posted
5 hours ago, Naelson Saraiva said:

Why in PHP?

I found it more comfortable to do it in php, since the server is the only thing I had installed...
I had no vs and no python.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...