Example #1
0
 function defence_roll($comb_act, $test = false)
 {
     $rollthedice = diceroll();
     if (DEBUG >= 2) {
         $_SESSION['disp_msg'][] = "**DEBUG: dice roll = {$rollthedice}";
     }
     if ($comb_act == "magic_attack") {
         $char_defence = (int) (($this->wisdom + $rollthedice) / 2 + rand(0, 99) * 0.01);
     } else {
         if (DEBUG >= 2) {
             $_SESSION['disp_msg'][] = "**DEBUG: defense_min = " . $this->defense_min();
         }
         $char_def = rand($this->defense_skill_min(), $this->defense_skill_max());
         $char_defence = (int) (($this->dexterity + $char_def + $rollthedice) / 10 + rand(0, 99) * 0.01);
     }
     if (!$test) {
         if ($this->stamina_points > 0) {
             --$this->stamina_points;
         }
     }
     return $char_defence;
 }
Example #2
0
}
?>


	<tr>
		<td>
		<table width="100%" weight="100%" border=0 cellspacing=0 cellpadding=0
			align=center>
			<tr>
			<?php 
if (@$combat_continue) {
    //echo "<td align=center><b>(Combat continues...)</b></td>";
    $combat_continue = 0;
} else {
    $char_first_attack = $character->dexterity + diceroll();
    $opp_first_attack = $oppcharacter->dexterity + diceroll();
    if ($char_first_attack <= $opp_first_attack) {
        jsChangeLocation("combat.php?comb_act=npc_attack&npcfirstatt");
    } else {
        // You attack first, code
        echo "<td align=center>" . $lang_comb["sight_enn"] . "</td>";
    }
}
echo "</tr>";
print_msgs(@$_SESSION['disp_msg']);
unset($_SESSION['disp_msg']);
?>
			</tr>
		</table>
		</td>
	</tr>