|
|
|
@ -199,40 +199,34 @@ function getDefaultData() {
|
|
|
|
|
'stm' => 0,
|
|
|
|
|
'special' => true
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'name' => 'MONSTER',
|
|
|
|
|
'type' => 3,
|
|
|
|
|
'id' => 14,
|
|
|
|
|
'hp' => 0,
|
|
|
|
|
'mp' => 0,
|
|
|
|
|
'str' => 0,
|
|
|
|
|
'def' => 0,
|
|
|
|
|
'spd' => 0,
|
|
|
|
|
'lck' => 0,
|
|
|
|
|
'stm' => 0,
|
|
|
|
|
'special' => true
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
return $array;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setupRassen() {
|
|
|
|
|
mysql_query('DROP database `rassen`');
|
|
|
|
|
mysql_query('DROP database `rassen_attacken`');
|
|
|
|
|
|
|
|
|
|
mysql_query('CREATE TABLE `rassen_type` (
|
|
|
|
|
`id` INT NOT NULL ,
|
|
|
|
|
`name` VARCHAR(45) NOT NULL ,
|
|
|
|
|
`gm_only` TINYINT NOT NULL DEFAULT false ,
|
|
|
|
|
PRIMARY KEY (`id`) )
|
|
|
|
|
ENGINE = InnoDB;');
|
|
|
|
|
|
|
|
|
|
mysql_query('CREATE TABLE `test_ag`.`rassen` (
|
|
|
|
|
`id` INT NOT NULL ,
|
|
|
|
|
`name` VARCHAR(45) NOT NULL ,
|
|
|
|
|
`type` INT NOT NULL DEFAULT 0 ,
|
|
|
|
|
`hp` INT NOT NULL DEFAULT 0 ,
|
|
|
|
|
`mp` INT NOT NULL DEFAULT 0 ,
|
|
|
|
|
`str` INT NOT NULL DEFAULT 0 ,
|
|
|
|
|
`def` INT NOT NULL DEFAULT 0 ,
|
|
|
|
|
`spd` INT NOT NULL DEFAULT 0 ,
|
|
|
|
|
`lck` INT NOT NULL DEFAULT 0 ,
|
|
|
|
|
`stm` INT NOT NULL DEFAULT 0 ,
|
|
|
|
|
`special` TINYINT NOT NULL DEFAULT false ,
|
|
|
|
|
PRIMARY KEY (`id`) )
|
|
|
|
|
ENGINE = InnoDB;');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function displayRassen($request) {
|
|
|
|
|
|
|
|
|
|
if($request['setup'] == 1) {
|
|
|
|
|
$array = getDefaultData();
|
|
|
|
|
foreach($array['race_type'] as $race_type) {
|
|
|
|
|
db_query('INSERT INTO rassen_type(id, name, gm_only) values('.$race_type['id'].', \''.$race_type['name'].'\', '.($race_type['gm_only']?'1':'0').')');
|
|
|
|
|
}
|
|
|
|
|
foreach($array['race'] as $r) {
|
|
|
|
|
db_query('INSERT INTO rassen(name, type, id, hp, mp, str, def, spd, lck, stm, special) '.
|
|
|
|
|
'values(\''.$r['name'].'\', '.$r['type'].','.$r['id'].', '.$r['hp'].','.$r['mp'].','.$r['str'].','.$r['def'].','.$r['spd'].','.$r['lck'].','.$r['stm'].','.($r['special']?'1':'0').')');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<table>
|
|
|
|
|
<tr>
|
|
|
|
@ -246,8 +240,9 @@ function displayRassen($request) {
|
|
|
|
|
<th align="center" colspan="2">Aktion</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
|
|
|
|
if(!mysql_query('SELECT * FROM rassen_types')) {
|
|
|
|
|
echo '<tr><th colspan="4"><a href="">setup rassen database</a></th></tr>';
|
|
|
|
|
$num = mysql_num_rows(db_query('SELECT * FROM rassen_type'));
|
|
|
|
|
if($num == 0) {
|
|
|
|
|
echo '<tr><th colspan="4"><a href="?choose=rassen&setup=1">setup rassen database</a></th></tr>';
|
|
|
|
|
} else {
|
|
|
|
|
$race_types = getRaceTypes();
|
|
|
|
|
foreach($race_types as $type) {
|
|
|
|
|