示例#1
0
        unset($action);
    }
}
if ($action == "resurrect") {
    $no = 0;
    gNoTravel($acc["x"], $acc["y"]);
    $sql = "SELECT {$gdCreatureSelect} FROM (summons AS s, creatures AS c, races AS r) LEFT JOIN accitems AS ai ON ai.account = '{$acc['id']}' AND s.item = ai.id LEFT JOIN items AS i ON ai.item = i.id WHERE s.id = '{$sid}' AND s.account = '{$acc['id']}' AND s.creature = c.id AND c.race = r.id ORDER BY c.name ASC";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    if ($numrows != 1) {
        $output .= 'Invalid data.<br>';
        $no = 1;
    } else {
        $row = $db->fetch_array($result);
        $creature = new creature($row);
        $power += round($creature->powerSkill() * gdResurrectMultiplier);
        if ($power > $acc["power"]) {
            $output .= 'You don\'t have enough power to resurrect that creature.<br>';
            $no = 1;
        }
        if ($creature->data["status"] == 4) {
            $output .= 'An attacking creature can\'t be resurrected.<br>';
        }
        if ($creature->data["dead"] != 1) {
            $output .= 'That creature isn\'t dead!<br>';
            $no = 1;
        }
    }
    if ($no == 0) {
        $acc["power"] -= $power;
        $sql = "UPDATE summons SET dead = '0' WHERE id = '{$sid}'";
示例#2
0
    }
}
if ($action == "step2") {
    tBegin("Step 2: hide creatures");
    echo '
		Now you have to select which creatures you want to hide from the searching eye of your opponent.
		Hidden creatures cannot be seen until all the unhidden creatures have been defended.
		You can hide certain creatures for tactical purposes, but it will cost you some power, depending on the strength of the creature.
		<br><br>
		<form method="post" name="hideform" action="index.php?page=battles&action=launch&bid=', $id, '&key=', $key, '">
		';
    tBegin();
    for ($m = 0; $m < count($array); $m++) {
        $row = $array[$m];
        $creature = new creature($row);
        $url = array("<input type='hidden' name='summon", "#id", "' value='attack'>", "<input onClick='calculate(", "#id", ",", $creature->powerSkill(), ")' type='checkbox' name='hidden", "#id", "'>&nbsp;&nbsp;", "#creaturename");
        $creature->echoCreature($url);
    }
    echo '</table><br><br>';
    echo 'Total Power Cost:&nbsp;&nbsp;&nbsp;<input type="text" class="input" name="powercost" size="10" value="', $totalskill, '"><br><br>';
    echo '
		<input class="input" type="submit" name="submit" value="Attack!">
		</form>
		';
    // power cost javascript function
    echo '
		<script language="JavaScript">
		var gdHideCostMultiplier = ', $gdHideCostMultiplier, ';
		hidden = new Array(0);
		powercost = parseInt(document.hideform.powercost.value);
		var multiplier = ', $pbmultiplier, ';