mrhat187 Posted January 2, 2013 Share Posted January 2, 2013 Does anyone know where to edit the pick of the black figure in the combat module when your fighting. I woul dlike to change this picture, also would it be possible to make the picture change based upon a persons level? Ive already started to remove the other images and create ones that more fit my theme, just want to change the I think its Favatar2 picture. Quote Link to comment Share on other sites More sharing options...
Someone Posted January 2, 2013 Share Posted January 2, 2013 (edited) The code/html of the avatar image during compat images is at modules/combat/lib.php around line 197 (around becuse I did some changes to test the variables) echo "<img src='{$webBaseDir}modules/combat/avatar.png'>"; It seems like this part is incomplete. As modules/combat/avatar.png does not exist. And uploaded avatar images are at modules/avatar/##userid##.png The incoming $user variable does not contain the user id. It will be best to wait for the developer to make an official update But as a dirty workaround for testing or just funzies Replace this function, add /* before and */ after the old function, so you can easily revert back. function ShowInteractiveInterface ($user, $npc, $buttons) { global $webBaseDir, $userStats, $userId; echo "<table class='plainTable'><tr valign='top'><td align='center' width='1%'>"; ShowStats($user); echo "<br><br>"; if ($buttons) ShowCombatButtons($npc, $user); echo "</td><td align='center'>"; if($userStats['Level']->value < 5){ echo "<img src='{$webBaseDir}modules/avatar/images/{$userId}.png'>"; } else { //This version will be used if levelis above 5 //This example adds a border just for testing, not to be used echo "<img border='10' src='{$webBaseDir}modules/avatar/images/{$userId}.png'>"; } echo "<img src='{$webBaseDir}modules/combat/npc/" . $npc['image_id'] . ".png'>"; if (! isset($_SESSION["combatLog"])) $_SESSION["combatLog"] = ""; // echo $_SESSION["combatLog"]; echo "</td><td width='1%'>"; ShowSecondStats($npc); echo "</td></tr></table>"; } In general, when making a custom version of a module, I would make a copy of the module. As changes will be lost when updating the module. EDIT: as I re-read post title and and the content. I am unsure about what you mean. However echo "<img src='{$webBaseDir}modules/combat/npc/" . $npc['image_id'] . ".png'>"; is the enemy "avatar" image. You could apply the level check above, and have 2 versions of the enemy image, and make the image $npc['image_id'] . "-highlevelversion.png'. The rat image would then be at modules/combat/npc/1-highlevelversion.png Edited January 2, 2013 by Someone Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted January 4, 2013 Share Posted January 4, 2013 Will check this issue on Monday and let you know. Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted January 7, 2013 Share Posted January 7, 2013 The avatar.png file seems there to me, I don't see the error you report 1331 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.