';
echo '' .
- 'Der Fight läuft noch! '.
+ 'Der Fight läuft noch! '.
' ';
@@ -338,7 +352,14 @@ function displayEventFight($event_id, $event_fight_id) {
echo '';
// :D
// first readout the required event data
- $event_fight_data = mysql_fetch_assoc(mysql_query('SELECT *, visible <= now() as passed FROM event_fights WHERE event_id = ' . $event_id . ' AND event_fight_id = ' . $event_fight_id ));
+ $sql = 'SELECT *, visible <= now() as passed FROM event_fights WHERE event_id = ' . $event_id . ' AND event_fight_id = ' . $event_fight_id . ' AND `starting` <= now()';
+ //echo $sql . ' ';
+ $event_fight_data = mysql_fetch_assoc(mysql_query($sql));
+ if(!$event_fight_data){
+ displayFightNotAvailable();
+ echo '
';
+ return;
+ }
// Okay and now get the data of the chars ;)
$sql = 'SELECT * FROM event_chars e where event_id = '.$event_id.' and event_char_id IN (SELECT event_char_id from event_fight_rounds where event_id = '.$event_id.' and event_fight_id = '.$event_fight_id.' and `round` = 0)';
// echo $sql . ' ';
@@ -357,7 +378,6 @@ function displayEventFight($event_id, $event_fight_id) {
// Platziere den Table-Header
echo ''.$char1['char_name'].' Vs '.$char2['char_name'].' ';
- displayEventFightRound($char1, $char2, array(), array(), 0);
// now get the round data :D
$sql = 'SELECT * from event_fight_rounds WHERE event_id = ' .$event_id . ' AND event_fight_id = ' .$event_fight_id . ' and visible <= now()';
$qry = mysql_query($sql);
@@ -370,11 +390,9 @@ function displayEventFight($event_id, $event_fight_id) {
}
for($i=0;$i'.$runde.' ';
- $c1_str = $roundnr==0?$char1_data['strength']:$char1_round_data['strength'];
- $c1_def = $roundnr==0?$char1_data['defense']:$char1_round_data['defense'];
- $c1_spd = $roundnr==0?$char1_data['speed']:$char1_round_data['speed'];
- $c1_stm = $roundnr==0?$char1_data['stamina']:$char1_round_data['stamina'];
- $c1_lck = $roundnr==0?$char1_data['luck']:$char1_round_data['luck'];
- $c1_hp = $roundnr==0?$char1_data['hp']:$char1_round_data['hp'];
+ $c1_str = $char1_round_data['strength'];
+ $c1_def = $char1_round_data['defense'];
+ $c1_spd = $char1_round_data['speed'];
+ $c1_stm = $char1_round_data['stamina'];
+ $c1_lck = $char1_round_data['luck'];
+ $c1_hp = $char1_round_data['hp'];
$c1_hpMax = $char1_data['hp'];
- $c1_mp = $roundnr==0?$char1_data['mp']:$char1_round_data['mp'];
+ $c1_mp = $char1_round_data['mp'];
$c1_mpMax = $char1_data['mp'];
- $c2_str = $roundnr==0?$char2_data['strength']:$char2_round_data['strength'];
- $c2_def = $roundnr==0?$char2_data['defense']:$char2_round_data['defense'];
- $c2_spd = $roundnr==0?$char2_data['speed']:$char2_round_data['speed'];
- $c2_stm = $roundnr==0?$char2_data['stamina']:$char2_round_data['stamina'];
- $c2_lck = $roundnr==0?$char2_data['luck']:$char2_round_data['luck'];
- $c2_hp = $roundnr==0?$char2_data['hp']:$char2_round_data['hp'];
+ $c2_str = $char2_round_data['strength'];
+ $c2_def = $char2_round_data['defense'];
+ $c2_spd = $char2_round_data['speed'];
+ $c2_stm = $char2_round_data['stamina'];
+ $c2_lck = $char2_round_data['luck'];
+ $c2_hp = $char2_round_data['hp'];
$c2_hpMax = $char2_data['hp'];
- $c2_mp = $roundnr==0?$char2_data['mp']:$char2_round_data['mp'];
+ $c2_mp = $char2_round_data['mp'];
$c2_mpMax = $char2_data['mp'];
// Bild + Avantarinfo | Attacken + Schaden | Bild + Avantarinfo
diff --git a/ag/include/kampf_wrapper.inc.php b/ag/include/kampf_wrapper.inc.php
index e07d46c..f908eb4 100644
--- a/ag/include/kampf_wrapper.inc.php
+++ b/ag/include/kampf_wrapper.inc.php
@@ -18,7 +18,7 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/arena.inc.php');
function convertLearnIDToAttackID (array $learnids, $char_id) {
$result = array();
$sql = 'SELECT id, at_id FROM lernen WHERE id IN ('.implode(',', $learnids).') AND besitzer = ' . $char_id;
- // echo $sql .' ';
+// echo $sql .' ';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)) {
for($i=0;$i $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
@@ -203,8 +214,9 @@ function calculateFight(array $char1, array $char2) {
$runde['char1_array'] = $chara_1;
$runde['char2_array'] = $chara_2;
- $runde['atk_char1'] = $technick1['name'];
- $runde['atk_char2'] = $technick2['name'];
+
+ $runde['atk_char1'] = $k_attacke1[$x];
+ $runde['atk_char2'] = $k_attacke2[$x];
$runde['dmg_char1'] = $schaden_1;
$runde['dmg_char2'] = $schaden_2;
diff --git a/ag/include/user.inc.php b/ag/include/user.inc.php
index 9f2e334..f36ab21 100644
--- a/ag/include/user.inc.php
+++ b/ag/include/user.inc.php
@@ -25,6 +25,10 @@ function getUser($userid, $buffer_enabled = true) {
return $GLOBALS['user_buffered_instances'][$userid];
}
+function addMoneyToUser($userid, $amount) {
+ mysql_query('update user set geld = geld + ' . $amount . ' WHERE id = ' .$userid);
+}
+
function checkSessionPasswort($userid, $password){
$sql = 'SELECT passwort from user where id = \''.$userid.'\'';
diff --git a/db/animegame_svn.sql b/db/animegame_svn.sql
index 04339f5..2eae56d 100644
--- a/db/animegame_svn.sql
+++ b/db/animegame_svn.sql
@@ -547,6 +547,7 @@ CREATE TABLE `event_chars` (
`defense` int(11) NOT NULL,
`luck` int(11) NOT NULL,
`stamina` int(11) NOT NULL,
+ `abgeholt` tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`event_id`,`event_char_id`),
KEY `char_bild` (`char_bild`),
CONSTRAINT `event_chars_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`event_id`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -586,8 +587,8 @@ CREATE TABLE `event_fight_rounds` (
`defense` int(11) NOT NULL,
`luck` int(11) NOT NULL,
`stamina` int(11) NOT NULL,
- `attack` varchar(30) NOT NULL,
- `damage` varchar(30) NOT NULL,
+ `attack` varchar(30) DEFAULT NULL,
+ `damage` varchar(30) DEFAULT NULL,
`visible` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`event_id`,`event_fight_id`,`event_char_id`,`round`),
KEY `event_fight_rounds_chars` (`event_id`,`event_char_id`),
@@ -604,7 +605,8 @@ DROP TABLE IF EXISTS `event_fights`;
CREATE TABLE `event_fights` (
`event_id` int(10) unsigned NOT NULL,
`event_fight_id` int(10) unsigned NOT NULL,
- `visible` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `visible` timestamp NOT NULL,
+ `started` timestamp NOT NULL,
`host` int(10) unsigned NOT NULL,
`winner` int(10) unsigned NOT NULL,
PRIMARY KEY (`event_id`,`event_fight_id`),