예제 #1
0
if ($character->name == "") {
    $message = "<font size=4><b>" . $lang_area["must_create_a_char"] . "</b></font><p>" . $lang_area["create_a_char"];
} else {
    $message = '';
    if ($character->hit_points <= "0") {
        $message = $lang_trav["zero_hp"] . "<br>";
    }
    if ($character->stamina_points <= "0") {
        $message .= $lang_trav["zero_st"] . "<br>";
    }
    if ($destination == "") {
        $message .= "<b>" . $lang_trav["dest"] . "</b>";
        draw_html($message);
    }
    if ($destination != "") {
        $list = whos_here($character->location, 'phaos_npc');
        if (count($list)) {
            $result = mysql_query("SELECT buildings,special FROM phaos_locations WHERE id = '" . $character->location . "'");
            list($buildings, $special) = mysql_fetch_array($result);
            if ($buildings == "n" and $special == 0) {
                header("Location: combat.php?opp_type=roammonst");
                exit;
            }
        }
        draw_html(@$message);
    }
}
session_destroy();
##---Functions--##
function draw_html($message = '')
{
예제 #2
0
                     $_SESSION['disp_msg'][] = "{$lang_fun['gai_gold']} {$_SESSION['gold_rec']}";
                     //Receive Experience
                     $_SESSION['xp_rec'] = (int) ($defender->max_hp / 2 + $character->wisdom);
                     $_SESSION['xp_rec'] *= $_SESSION['fightbonus'];
                     $character->xp += $_SESSION['xp_rec'];
                     $_SESSION['disp_msg'][] = "{$lang_fun['gai_xp']} {$_SESSION['xp_rec']}";
                     //Update Character rewards to the DataBase
                     //       				$res=mysql_query("UPDATE players SET gold=".$character->gold.", xp=".$character->xp." WHERE id='$PHP_PHAOS_CHARID'");
                     $res = mysql_query($sql);
                     if (!$res) {
                         showError(__FILE__, __LINE__, __FUNCTION__);
                         exit;
                     }
                     $character->all_skillsup($comb_act, $lang_fun);
                     refsidebar();
                     $list = whos_here($character->location);
                     if ($defender->id == $oppcharacter->id) {
                         //the opponent we are engaged with has been killed
                         $_SESSION['endcombat'] = true;
                     }
                 }
                 //killed opponent
             }
             //hit opponent
         }
         //living defender
     }
     //foreach defender
 }
 //end "has enough stamina"
 $_SESSION['disp_msg'][] = "&nbsp";