<commit_before><?php
if (file_exists('root.php'))
  include_once('root.php');
include('haut.php');

$monstres = monstre::create(false, false, 'level ASC', false, '1');

foreach($monstres as $monstre)
{
	$drops = explode(';', $monstre->get_drops());
	$show = '';
	foreach($drops as $key => $drop)
	{
		if($drop[0] == 'o')
		{
			$explode = explode('-', $drop);
			$id = substr($explode[0], 1);
			$requete = "SELECT nom FROM objet WHERE id = ".$id;
			$req = $db->query($requete);
			$row = $db->read_assoc($req);
			$chance = 100 / $explode[1];
			$show .= $row['nom'].' - '.$chance.'%';
			$newdrop = floor($explode[1] / 1.2);
			$chance = 100 / $newdrop;
			$show .= ' => '.$chance.'% ';
			$new = 'o'.$id.'-'.$newdrop;
			$drops[$key] = $new;
		}
	}
	$implode = implode(';', $drops);
	$monstre->set_drops($implode);
	$monstre->sauver();
}<commit_msg>* décommenter la ligne pour augmenter le taux de drop des objets si besoin.<commit_after><?php
if (file_exists('root.php'))
  include_once('root.php');
include('haut.php');

$monstres = monstre::create(false, false, 'level ASC', false, '1');

foreach($monstres as $monstre)
{
	$drops = explode(';', $monstre->get_drops());
	$show = '';
	foreach($drops as $key => $drop)
	{
		if($drop[0] == 'o')
		{
			$explode = explode('-', $drop);
			$id = substr($explode[0], 1);
			$requete = "SELECT nom FROM objet WHERE id = ".$id;
			$req = $db->query($requete);
			$row = $db->read_assoc($req);
			$chance = 100 / $explode[1];
			$show .= $row['nom'].' - '.$chance.'%';
			$newdrop = floor($explode[1] / 1.2);
			$chance = 100 / $newdrop;
			$show .= ' => '.$chance.'% ';
			$new = 'o'.$id.'-'.$newdrop;
			$drops[$key] = $new;
		}
	}
	$implode = implode(';', $drops);
	$monstre->set_drops($implode);
	//$monstre->sauver();
}
{'fraction_non_alphanumeric': 0.25875706214689265, 'fraction_numerical': 0.015819209039548022, 'mean_word_length': 3.74798927613941, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4187330', 'n_tokens_mistral': 809, 'n_tokens_neox': 742, 'n_words': 145}