Thread: Mys 1.3.4 Simple NPC Battle
View Single Post
  #16  
Old 09-25-2016, 12:32 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,418
Abronsyth is on a distinguished road
Default

Oh yeah, that is totally doable! I actually originally had it set up that way but was having issues with aligning it in a way that looked really good...but the random opponent image isn't too difficult. You just need the images...so, where you add opponent stats add in this:
PHP Code:
$images rand(1,3); 
Change the 3 to suit whatever number of images you want possible. Then, below the stats add this:
PHP Code:
if($images 1) {
$opimage "<img src='IMAGE URL'/>";
}
elseif(
$images 2) {
$opimage "<img src='IMAGE URL'/>";
}
elseif(
$images 3) {
$opimage "<img src='IMAGE URL'/>";

Where it says IMAGE URL just change it to the image's url for the different opponent images. Then where you display the opponent's stats just add in {$opimage}. So, for example:
PHP Code:
<td width='40%' style='text-align:right;vertical-align:bottom'
{
$opimage}<br>                    
<
i>Opponent</i><br
                    <
b>Sense:</b> {$opsense}<br
                    <
b>Speed:</b> {$opspeed}<br
                    <
b>Strength:</b> {$opstrength}<br
                    <
b>Stamina:</b> {$opstamina}<br
                    </
td

Now I will note that I just wrote this without testing it at all, so I don't guarantee it'll work as is, but it should give you the general idea!
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote