function SelectCaracMoyMonstre($id_race, $id_template, $id_age) { global $db_vue_rm; // on établit la requête cherchant le monstre avec ces caractéristiques $sql = "SELECT * FROM `best_monstres` WHERE `id_race_monstre`={$id_race}"; // la race $sql .= " AND `id_template_monstre`={$id_template}"; // on complète par le template $sql .= " AND `id_age_monstre`={$id_age}"; // et on rajoute l'âge if ($query = mysql_query($sql, $db_vue_rm)) { if (mysql_numrows($query) > 0) { $monstre = mysql_fetch_array($query); /* $ret['niv']=carac_monstre($ret['nivsom_monstre'],$ret['nivnbr_monstre']); $ret['pdv']=carac_monstre($ret['pdvsom_monstre'],$ret['pdvnbr_monstre']); $ret['att']=carac_monstre($ret['attsom_monstre'],$ret['attnbr_monstre']); $ret['esq']=carac_monstre($ret['esqsom_monstre'],$ret['esqnbr_monstre']); $ret['deg']=carac_monstre($ret['degsom_monstre'],$ret['degnbr_monstre']); $ret['reg']=carac_monstre($ret['regsom_monstre'],$ret['regnbr_monstre']); $ret['arm']=carac_monstre($ret['armsom_monstre'],$ret['armnbr_monstre']); $ret['vue']=carac_monstre($ret['vuesom_monstre'],$ret['vuenbr_monstre']); */ /* Correction Bodéga : $montre à la place de $ret */ $ret['niv'] = carac_monstre($monstre['nivsom_monstre'], $monstre['nivnbr_monstre']); $ret['pdv'] = carac_monstre($monstre['pdvsom_monstre'], $monstre['pdvnbr_monstre']); $ret['att'] = carac_monstre($monstre['attsom_monstre'], $monstre['attnbr_monstre']); $ret['esq'] = carac_monstre($monstre['esqsom_monstre'], $monstre['esqnbr_monstre']); $ret['deg'] = carac_monstre($monstre['degsom_monstre'], $monstre['degnbr_monstre']); $ret['reg'] = carac_monstre($monstre['regsom_monstre'], $monstre['regnbr_monstre']); $ret['arm'] = carac_monstre($monstre['armsom_monstre'], $monstre['armnbr_monstre']); $ret['vue'] = carac_monstre($monstre['vuesom_monstre'], $monstre['vuenbr_monstre']); $ret['mm'] = carac_monstre($monstre['mmsom_monstre'], $monstre['mmnbr_monstre']); $ret['rm'] = carac_monstre($monstre['rmsom_monstre'], $monstre['rmnbr_monstre']); $ret['dla'] = carac_monstre($monstre['dlasom_monstre'], $monstre['dlanbr_monstre']); $ret['nbatt'] = $monstre['nbatt_monstre']; $ret['vitdep'] = $monstre['vitdep_monstre']; $ret['vlc'] = $monstre['vlc_monstre']; $ret['attdist'] = $monstre['attdist_monstre']; } else { $ret = false; } } else { $ret = false; } // Erreur lors de la requête sur le monstre return $ret; }
function affiche_monstre(&$monstre, &$capspe, &$caracs) { print "<table border='1' cellpadding='0' cellspacing='1' align='center' class='mh_tdborder' width='80%'>"; print "<tr class='mh_tdtitre'>"; print " <td colspan=16 align=center>" . $monstre['nom_monstre'] . "</td>"; print "</tr>"; $td = "td align=center width=70"; print "<tr class='mh_tdpage'>"; print " <td> </td><{$td}>Niv</td><{$td}>PdV</td><{$td}>Att</td><{$td}>Esq</td>"; print " <{$td}>Deg</td><{$td}>Reg</td><{$td}>Arm</td><{$td}>Vue</td><{$td}>MM</td><{$td}>RM</td><{$td}>dla</td>"; print "</tr>"; print "<tr class='mh_tdpage'>"; print "<td nowrap><em>Valeurs Moyennes</em></td>"; $carac = carac_monstre($monstre['nivsom_monstre'], $monstre['nivnbr_monstre']); print " <{$td}>" . $carac . "</td>"; // niv $carac = carac_monstre($monstre['pdvsom_monstre'], $monstre['pdvnbr_monstre']); print " <{$td}>" . $carac . "</td>"; // Pdv $carac = carac_monstre($monstre['attsom_monstre'], $monstre['attnbr_monstre']); print " <{$td}>" . $carac . "</td>"; // Att $carac = carac_monstre($monstre['esqsom_monstre'], $monstre['esqnbr_monstre']); print " <{$td}>" . $carac . "</td>"; // Esq $carac = carac_monstre($monstre['degsom_monstre'], $monstre['degnbr_monstre']); print " <{$td}>" . $carac . "</td>"; // Deg $carac = carac_monstre($monstre['regsom_monstre'], $monstre['regnbr_monstre']); print " <{$td}>" . $carac . "</td>"; // Reg $carac = carac_monstre($monstre['armsom_monstre'], $monstre['armnbr_monstre']); print " <{$td}>" . $carac . "</td>"; // Arm $carac = carac_monstre($monstre['vuesom_monstre'], $monstre['vuenbr_monstre']); print " <{$td}>" . $carac . "</td>"; // Vue $carac = carac_monstre($monstre['mmsom_monstre'], $monstre['mmnbr_monstre']); print " <{$td}>" . $carac . "</td>"; // MM $carac = carac_monstre($monstre['rmsom_monstre'], $monstre['rmnbr_monstre']); print " <{$td}>" . $carac . "</td>"; // RM $carac = carac_monstre($monstre['dlasom_monstre'], $monstre['dlanbr_monstre']); print " <{$td}>" . $carac . "</td>"; // DLA print "</tr>"; print "<tr class='mh_tdpage'>"; print "<td nowrap><em>Nbr de valeurs utilisées</em></td>"; // niv $carac = carac_monstre($monstre['nivsom_monstre'], $monstre['nivnbr_monstre']); print "<{$td}>" . $monstre['nivnbr_monstre'] . "</td>"; // niv $carac = carac_monstre($monstre['pdvsom_monstre'], $monstre['pdvnbr_monstre']); print "<{$td}>" . $monstre['pdvnbr_monstre'] . " </td>"; // Pdv $carac = carac_monstre($monstre['attsom_monstre'], $monstre['attnbr_monstre']); print "<{$td}>" . $monstre['attnbr_monstre'] . "</td>"; // Att $carac = carac_monstre($monstre['esqsom_monstre'], $monstre['esqnbr_monstre']); print "<{$td}>" . $monstre['esqnbr_monstre'] . "</td>"; // Esq $carac = carac_monstre($monstre['degsom_monstre'], $monstre['degnbr_monstre']); print "<{$td}>" . $monstre['degnbr_monstre'] . "</td>"; // Deg $carac = carac_monstre($monstre['regsom_monstre'], $monstre['regnbr_monstre']); print "<{$td}>" . $monstre['regnbr_monstre'] . "</td>"; // Reg $carac = carac_monstre($monstre['armsom_monstre'], $monstre['armnbr_monstre']); print "<{$td}>" . $monstre['armnbr_monstre'] . "</td>"; // Arm $carac = carac_monstre($monstre['vuesom_monstre'], $monstre['vuenbr_monstre']); print "<{$td}>" . $monstre['vuenbr_monstre'] . "</td>"; // Vue $carac = carac_monstre($monstre['mmsom_monstre'], $monstre['mmnbr_monstre']); print "<{$td}>" . $monstre['mmnbr_monstre'] . "</td>"; // MM $carac = carac_monstre($monstre['rmsom_monstre'], $monstre['rmnbr_monstre']); print "<{$td}>" . $monstre['rmnbr_monstre'] . "</td>"; // Vue $carac = carac_monstre($monstre['dlasom_monstre'], $monstre['dlanbr_monstre']); print "<{$td}>" . $monstre['dlanbr_monstre'] . "</td>"; // DLA print "</tr></table>"; if ($capspe) { $td = "td align=center width=80"; print "<table border='1' cellpadding='0' cellspacing='1' align='center' class='mh_tdborder' width='80%'>"; print "<tr class='mh_tdpage'>"; print " <td colspan=6><em>Capacité spéciale</em> " . htmlentities($capspe['nom_capspe']) . " <em>affecte</em> " . htmlentities($capspe['affecte_capspe']) . "</td>"; print "</tr>"; print "<tr class='mh_tdpage'>"; print " <td align=left>[source : " . htmlentities($capspe['source_capspe']) . " - date : " . mysqltimestamp_date($capspe['date_capspe']) . "]</td>"; print " </td><{$td}>MM</td><{$td}>deg</td><{$td}>portee</td><{$td}>durée</td><{$td}>zone</td>"; print "</tr>"; print "<tr class='mh_tdpage'>"; print "<td nowrap><em>Valeurs Moyennes</em></td>"; $carac = carac_monstre($capspe['MMsom_capspe'], $capspe['MMnbr_capspe']); print " <{$td}>" . $carac . "</td>"; $carac = carac_monstre($capspe['degatsom_capspe'], $capspe['degatnbr_capspe']); print " <{$td}>" . $carac . "</td>"; print " <{$td}>" . $capspe['portee_capspe'] . "</td>"; print " <{$td}>" . $capspe['duree_capspe'] . "</td>"; print " <{$td}>" . $capspe['portee_zone_capspe'] . "</td>"; print "</tr>"; print "<tr class='mh_tdpage'>"; print "<td nowrap><em>Nbr de valeurs utilisées</em></td>"; // niv $carac = carac_monstre($capspe['MMsom_capspe'], $capspe['MMnbr_capspe']); print " <{$td}>" . $capspe['MMnbr_capspe'] . "</td>"; $carac = carac_monstre($capspe['degatsom_capspe'], $capspe['degatnbr_capspe']); print " <{$td}>" . $capspe['degatsnbr_capspe'] . "</td>"; print " <{$td}>" . $capspe['portee_capspe'] . "</td>"; print " <{$td}>" . $capspe['duree_capspe'] . "</td>"; print " <{$td}>" . $capspe['portee_zone_capspe'] . "</td>"; print "</tr></table>"; } if ($caracs) { print "<table border='1' cellpadding='0' cellspacing='1' align='center' class='mh_tdborder' width='80%'>"; print "<tr class='mh_tdpage'>"; print " <td> </td><td>RM</td><td>nbr</td><td colspan=14></td>"; print "</tr>"; print "<tr class='mh_tdpage'>"; print "<td nowrap><em>Valeurs Moyennes</em></td>"; $carac = carac_monstre($caracs['RMsom_caracs'], $caracs['RMnbr_caracs']); print " <td>" . $carac . "</td><td colspan=14></td>"; print "</tr>"; print "<tr class='mh_tdpage'>"; print "<td nowrap><em>Nbr de valeurs utilisées</em></td>"; // niv $carac = carac_monstre($caracs['RMsom_caracs'], $caracs['RMnbr_caracs']); print " <td>" . $caracs['RMnbr_caracs'] . "</td><td colspan=14></td>"; print "</tr></table>"; } }
function vue2d_informations_monstres_popup($monstre, $ax, $ay, $az, $max_pa) { $titre = "<b>" . addslashes($monstre['nom']) . "</b>"; $text = "Desactivation des informations pour surcharge serveur."; $info = " onmouseover=\"return overlib('{$text}',CAPTION,'Clique pour fixer la popup !');\""; $info .= " onclick=\"return overlib('{$text}', STICKY, CAPTION, '{$titre}', CLOSECLICK, EXCLUSIVE);\" "; $info .= " onmouseout=\"return nd();\""; return $info; include_once 'bestiaire2/Libs/inc_affichage.php'; $titre = "<b>" . addslashes($monstre['nom']) . "</b>"; $text = "<center>"; $text .= "<br>"; $text .= "<table><tr><td>"; $text .= "<table align=center class=mh_tdborder><tr><td colspan=4>"; $text .= "<h2>{$titre}</h2>"; $text .= "</center></td></tr>"; preg_match("/(.+) \\[(.+)\\]/", $monstre['nom'], $resultat); $nom = preg_replace("/'/", "%27", $resultat[1]); $age = preg_replace("/'/", "%27", $resultat[2]); $race = $monstre['infos_monstre']['race']; $race = addslashes($race); $famille = $monstre['infos_monstre']['famille']; $famille = addslashes($famille); $niveau = $monstre['niveau']; $text .= "<tr class=mh_tdpage>"; $text .= "<td>Age : {$age}</td>"; $text .= "<td>Niveau : {$niveau}</td>"; $text .= "</tr>"; $text .= "<tr class=mh_tdpage>"; $text .= "<td>Race : " . htmlentities($race) . "<br>"; $text .= "<td>Famille : " . htmlentities($famille) . "</td>"; $text .= "</tr>"; $text .= "</table>"; $text .= "</td><td>"; $x_dist = $ax - $monstre['x']; $y_dist = $ay - $monstre['y']; $z_dist = $az - $monstre['z']; if ($x_dist < 0) { $x_dist = -$x_dist; } if ($y_dist < 0) { $y_dist = -$y_dist; } if ($z_dist < 0) { $z_dist = -$z_dist; } $text .= "<table align=center class=mh_tdborder><tr><td nowrap class=mh_tdtitre>"; $text .= "Distance"; $text .= "</td><td nowrap class=mh_tdpage>"; $text .= "en x = {$x_dist} case(s)<br>"; $text .= "en y = {$y_dist} case(s)<br>"; $text .= "en z = {$z_dist} case(s)"; $text .= "</td></tr></table>"; $text .= "</td></tr></table><br>"; if ($monstre['infos_monstre']['id_age'] != "") { $tab_cdm = SelectCdM_mh($monstre['id'], $monstre['infos_monstre']['race'], $monstre['infos_monstre']['id_age']); if (count($tab_cdm) > 0) { $text .= "<table class=mh_tdtitre>"; $text .= "<tr><td align=center class=mh_titre colspan=12><b>CdM sur ce monstre</b></td></tr></table>"; $text .= addslashes(affiche_liste_cdms($tab_cdm, false)); } } if ($max_pa > 15) { $text .= "La taille en PA est supérieure à 15. Pour plus d\\'info sur ce monstre, consultez le bestiaire.<br>"; } // if (( $monstre[infos_monstre][id_template] != "" ) && ($monstre[infos_monstre][id_age] != "") ) { // $tab_cdm=SelectCdMs($monstre[infos_monstre][race],$monstre[infos_monstre][id_template],$monstre[infos_monstre][id_age],"-1","-1", true); if (count($monstre[tab_cdm]) > 0) { $text .= "<table class=mh_tdtitre>"; $text .= "<tr><td align=center class=mh_titre colspan=12><b>Dernière CdM de même race, même template et même âge</b></td></tr></table>"; $text .= addslashes(affiche_liste_cdms($monstre['tab_cdm'], false)); } // } $tab = $monstre['caracs_moyennes']; $td = "td align=center width=50"; /*$text .= "<br><table class=mh_tdborder>"; $text .= "<tr><td align=center class=mh_titre colspan=12><b>Caractétistiques moyennes</b></td></tr>"; $text .= "<tr class=mh_tdtitre><$td>niv</td><$td>pdv</td><$td>att</td><$td>esq</td><$td>deg</td><$td>reg</td><$td>arm</td><$td>vue</td></tr>"; $text .= "<tr class=mh_tdpage><$td>$tab[niv]</td><$td>$tab[pdv]</td><$td>$tab[att]</td><$td>$tab[esq]</td><$td>$tab[deg]</td><$td>$tab[reg]</td><$td>$tab[arm]</td><td>$tab[vue]</td></tr>"; $text .= "</table><br>";*/ $capspe = $monstre['capacites_speciales']; if ($capse) { $text .= "<table class=mh_tdborder>"; $text .= " <tr><td colspan=6><em>Capacité spéciale </em> " . htmlentities($capspe['nom_capspe']) . " <em>affecte</em> " . htmlentities($capspe['affecte_capspe']) . "</td>"; $text .= "</tr>"; $text .= "<tr class=mh_tdtitre>"; $text .= " <{$td}>MM</td><{$td}>deg</td><{$td}>portee</td><{$td}>durée</td><{$td}>zone</td></tr>"; $carac = carac_monstre($capspe['MMsom_capspe'], $capspe['MMnbr_capspe']); $text .= "<tr class=mh_tdpage>"; $text .= " <{$td}>" . $carac . "</td>"; $carac = carac_monstre($capspe['degatsom_capspe'], $capspe['degatnbr_capspe']); $text .= " <{$td}>" . $carac . "</td>"; $text .= " <{$td}>" . $capspe['portee_capspe'] . "</td>"; $text .= " <{$td}>" . $capspe['duree_capspe'] . "</td>"; $text .= " <{$td}>" . $capspe['portee_zone_capspe'] . "</td>"; $text .= "</tr>"; $text .= "</table>"; $text .= "</center>"; } $text .= "<br><table align=center class=mh_tdborder><tr><td>"; $text .= "<h2><a href=\\'/bestiaire2/bestiaire.php?Monstre={$nom}&Age={$age}\\'>lien vers le bestiaire</a></h2>"; $text .= "</td></tr></table>"; $info = " onmouseover=\"return overlib('{$text}',CAPTION,'Clique pour fixer la popup !');\""; $info .= " onclick=\"return overlib('{$text}', STICKY, CAPTION, '{$titre}', CLOSECLICK, EXCLUSIVE);\" "; $info .= " onmouseout=\"return nd();\""; return $info; }