Original version for ipb 2.0.x, recoded for ipb 2.1.x by 3T
Down về file đính kem, bung nén vào up "galaga" & "rpg" và thư mục ảnh của bạn.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mở cache/skin_cache/***/skin_topic.php
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tìm:
CODE
{$author['member_number']}<br />
Thêm bên dưới:
CODE
{$author['rpg_lv']} [{$author['stars_display']}]
{$author['rpg']}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mở sources/action_public/topics.php
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tìm:
CODE
if ( $poster['id'] )
{
$poster['members_display_name'] = "<a href='{$this->base_url}showuser={$poster['id']}'>{$poster['members_display_name']}</a>";
}
Thêm bên dưới:
CODE
// IBF RPG MOD - Created By Tuoi*Thi*Tham
$today = time();
$diff = $today - $poster['joined'];
$exp = round($diff / 86400,0);
if ($exp<=0) { $exp = 1; }
$ppd= round($poster['posts'] / $exp, 0);
$level = pow (log10 ($poster['posts']), 3);
$ep = floor (100 * ($level - floor ($level)));
$showlevel = floor ($level + 1);
$hpmulti =round ($ppd / 6, 1);
if ($hpmulti > 1.5) { $hpmulti = 1.5; }
if ($hpmulti < 1) { $hpmulti = 1; }
$maxhp = $level * 25 * $hpmulti;
$hp= $ppd / 10;
if ($hp >= 1) { $hp= $maxhp; }
else { $hp= floor ($hp * $maxhp); }
$hp= floor ($hp);
$maxhp= floor ($maxhp);
if ($maxhp <= 0) { $zhp = 1; }
else { $zhp = $maxhp; }
$hpf= floor (100 * ($hp / $zhp)) - 1;
$maxmp= ($exp * $level) / 5;
$mp= $poster['posts'] / 3;
if ($mp >= $maxmp) { $mp = $maxmp; }
$maxmp = floor ($maxmp);
$mp = floor ($mp);
if ($maxmp <= 0) { $zmp = 1; }
else { $zmp = $maxmp; }
$mpf= floor (100 * ($mp / $zmp)) - 1;
if ( $hpf >= 98 ) { $hpf = $hpf - 2; }
if ( $ep >= 98 ) { $ep = $ep - 2; }
if ( $mpf >= 98 ) { $mpf = $mpf - 2; }
$poster['rpg_lv'] = "".$this->ipsclass->lang['rpg_level']." <span style='font-weight:bold; color:crimson'>$showlevel</span>";
$poster['rpg'] = "<span style='font-size:7pt; color:gray'>".$this->ipsclass->lang['rpg_life']." ".$hp." / ".$maxhp."</span><br />
<div style='width:120px;align:center'>
<table cellspacing='0' cellpadding='0' width='120' border='0'>
<tr>
<td width='3' height='13' class='nopad'><img width='3' height='13' src='style_images/<#IMG_DIR#>/rpg/img_left.gif' alt='' /></td>
<td width='114' height='13' class='nopad' style='line-height: 13px;background: url(style_images/<#IMG_DIR#>/rpg/img_backing.gif) repeat-x top left;'><img src='style_images/<#IMG_DIR#>/rpg/orange.gif' width='".$hpf."%' height='9' alt='' /><img src='style_images/<#IMG_DIR#>/rpg/hp.gif' height='9' alt='' /></td>
<td width='3' height='13' class='nopad'><img width='3' height='13' src='style_images/<#IMG_DIR#>/rpg/img_right.gif' alt='' /></td>
</tr>
</table>
</div>
<span style='font-size:7pt; color:gray'>".$this->ipsclass->lang['rpg_magic']." ".$mp." / ".$maxmp."</span><br />
<div style='width:120px;align:center'>
<table cellspacing='0' cellpadding='0' width='120' border='0'>
<tr>
<td width='3' height='13' class='nopad'><img width='3' height='13' src='style_images/<#IMG_DIR#>/rpg/img_left.gif' alt='' /></td>
<td width='114' height='13' class='nopad' style='line-height: 13px;background: url(style_images/<#IMG_DIR#>/rpg/img_backing.gif) repeat-x top left;'><img src='style_images/<#IMG_DIR#>/rpg/green.gif' width='".$mpf."%' height='9' alt='' /><img src='style_images/<#IMG_DIR#>/rpg/mp.gif' height='9' alt='' /></td>
<td width='3' height='13' class='nopad'><img width='3' height='13' src='style_images/<#IMG_DIR#>/rpg/img_right.gif' alt='' /></td>
</tr>
</table>
</div>
<span style='font-size:7pt; color:gray'>".$this->ipsclass->lang['rpg_exp']." ".$ep."%</span><br />
<div style='width:120px;align:center'>
<table cellspacing='0' cellpadding='0' width='120' border='0'>
<tr>
<td width='3' height='13' class='nopad'><img width='3' height='13' src='style_images/<#IMG_DIR#>/rpg/img_left.gif' alt='' /></td>
<td width='114' height='13' class='nopad' style='line-height: 13px;background: url(style_images/<#IMG_DIR#>/rpg/img_backing.gif) repeat-x top left;'><img src='style_images/<#IMG_DIR#>/rpg/blue.gif' width='".$ep."%' height='9' alt='' /><img src='style_images/<#IMG_DIR#>/rpg/exp.gif' height='9' alt='' /></td>
<td width='3' height='13' class='nopad'><img width='3' height='13' src='style_images/<#IMG_DIR#>/rpg/img_right.gif' alt='' /></td>
</tr>
</table>
</div>
";
// IBF Galaga Hack - Created By Tuoi*Thi*Tham
$poster['stars'] = ($level/3)*2;
// Get level
if($poster['stars'] >= 20){
if($poster['stars'] >= 25){$poster['stars'] = 25;}
$poster['starsc'] = $poster['stars']-20;
$poster['s_ext'] = "red";
}elseif($poster['stars'] >= 15){
$poster['starsc'] = $poster['stars']-15;
$poster['s_ext'] = "blue";
}elseif($poster['stars'] >= 10){
$poster['starsc'] = $poster['stars']-10;
$poster['s_ext'] = "green";
}elseif($poster['stars'] >= 5){
$poster['starsc'] = $poster['stars']-5;
$poster['s_ext'] = "grey";
}else{
$poster['starsc'] = $poster['stars'];
$poster['s_ext'] = "yellow";
}
if($poster['starsc'] < 1){
$poster['starsc'] = 1;
}
for($iCount=0; $iCount<$poster['starsc']; $iCount++){
$poster['stars_display'] .= "<img src='style_images/<#IMG_DIR#>/galaga/s_{$poster['s_ext']}.gif' alt='1.5 Level/Star - 5 Stars/Color - - - [Yellow → Gray → Green → Blue → Red]'>";
}
Mở ./lang/en/lang_topic.php
Thêm vào (nhớ theo dạng lang):
CODE
'rpg_level' => "<b>Level</b>:",
'rpg_life' => "Life:",
'rpg_magic' => "Magic:",
'rpg_exp' => "Experience:",
♪ Xong rồi. Enjoy bạn nhé!
Download file hình:
Phần nội dung ẩn: http://vnsuper.5gigs.com/rpg.rar