if($userrow["currentmp"]<$spells[$id]["mp"]){$return="<span class=\"red\"><b>Spell Failed:</b> You do not have enough MP to cast that spell.</span><br />";$failed=1;}
$return=$userrow["charname"]." casts ".$spells[$id]["name"]." and gains ".$spells[$id]["value"]." HP.<br />";
}
return($return);
}
functionhurt($id){
global$userrow,$monsterrow,$fightrow,$spells;
$failed=0;
if($userrow["currentmp"]<$spells[$id]["mp"]){$return="<span class=\"red\"><b>Spell Failed:</b> You do not have enough MP to cast that spell.</span><br />";$failed=1;}
$return=$userrow["charname"]." casts ".$spells[$id]["name"]." for ".$fightrow["playermagicdamage"]." damage.<br />";
}
return($return);
}
functionfire($id){
global$userrow,$monsterrow,$fightrow,$spells;
$failed=0;
if($userrow["currentmp"]<$spells[$id]["mp"]){$return="<span class=\"red\"><b>Spell Failed:</b> You do not have enough MP to cast that spell.</span><br />";$failed=1;}
$return=$userrow["charname"]." casts ".$spells[$id]["name"]." for ".$fightrow["playerfiredamage"]." damage.<br />";
}
return($return);
}
functionlight($id){
global$userrow,$monsterrow,$fightrow,$spells;
$failed=0;
if($userrow["currentmp"]<$spells[$id]["mp"]){$return="<span class=\"red\"><b>Spell Failed:</b> You do not have enough MP to cast that spell.</span><br />";$failed=1;}
$return=$userrow["charname"]." casts ".$spells[$id]["name"]." for ".$fightrow["playerlightdamage"]." damage.<br />";
}
return($return);
}
functionprism($id){
global$userrow,$monsterrow,$fightrow,$spells;
$failed=0;
if($userrow["currentmp"]<$spells[$id]["mp"]){$return="<span class=\"red\"><b>Spell Failed:</b> You do not have enough MP to cast that spell.</span><br />";$failed=1;}
// Mad crazy ninja love to Anman for writing this spell. I've cleaned it up a bit to match the format of the rest of the code, but it's his spell.
functionblessedstrike($id){
global$userrow,$monsterrow,$fightrow,$spells;
$failed=0;
if($userrow["currentmp"]<$spells[$id]["mp"]){$return="<span class=\"red\"><b>Spell Failed:</b> You do not have enough MP to cast that spell.</span><br />";$failed=1;}
if($failed==0){
//now define the power of the spell. you can stack these spells, but the more you try to stack it the harder it will be to get a decent number out of the stack. Now, this spell is more of a bonus to a player compared to the defence spell. So for this reason, the ratio of stacking has been decreased from 100 to 90 and the minimum % to take of the spell is now 10% instead of 20%.
$userrow["currentmp"]-=$spells[$id]["mp"];
if($userrow["bonusattack"]==0){
$userrow["bonusattack"]=$spells[$id]["value"];
}else{
//if a more powerful inc attack spell is cast, replace the old value with the new one
// *2 damage delt will never go above 50% chance. *1.75 damage will always be 50%
}
$return=$userrow["charname"]." casts ".$spells[$id]["name"].". Future attacks will be more powerful!<br />";
}
return($return);
}
// Mad crazy ninja love to Anman for writing this spell. I've cleaned it up a bit to match the format of the rest of the code, but it's his spell.
functionstoneskin($id){
global$userrow,$monsterrow,$fightrow,$spells;
$failed=0;
if($userrow["currentmp"]<$spells[$id]["mp"]){$return="<span class=\"red\"><b>Spell Failed:</b> You do not have enough MP to cast that spell.</span><br />";$failed=1;}
if($failed==0){
//now define the power of the spell. you can stack these spells, but the more you try to stack it the harder it will be to get a decent number out of the stack. The max will always be 100. This is because the spell works with percentages and 100 will always be the highest.