Mod Level - MP/HP/EXP dành cho IPB 2.1.x

Thảo luận trong 'Lập trình & Đồ hoạ' bắt đầu bởi Mark_acthan, 29/1/06.

  1. Mark_acthan

    Mark_acthan Donkey Kong

    Tham gia ngày:
    20/10/04
    Bài viết:
    382
    Nơi ở:
    Trân Châu Cảng
    Mở file cache/lang_cache/en/lang_topic.php tìm
    CODE:
    Mã:
    $lang = array (

    Thêm bên dưới :


    CODE:
    Mã:
    'rpg_level'  => "<b>Level:</b>",
    'rpg_life'  => "HP:",
    'rpg_magic'  => "MP:",
    'rpg_exp'  => "Exp:",
    Save & Upload .


    Mở file sources/action_puplic/topics.php tìm :


    CODE:
    Mã:
    $poster['members_display_name'] = "<a href='{$this->base_url}showuser={$poster['id']}'>{$poster['members_display_name']}</a>";
    Thêm bên dưới :


    CODE:
    Mã:
    $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'] = $this->ipsclass->lang['rpg_level']." $showlevel<br />".$this->ipsclass->lang['rpg_life']." ".$hp." / ".$maxhp."<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='html/rpg/img_left.gif' alt='' /></td>
         <td width='114' height='13' class='nopad' style='line-height: 13px;background: url(html/rpg/img_backing.gif) repeat-x top left;'><img src='html/rpg/orange.gif' width='".$hpf."%' height='9' alt='' /><img src='html/rpg/hp.gif' height='9' alt='' /></td>
         <td width='3' height='13' class='nopad'><img width='3' height='13' src='html/rpg/img_right.gif' alt='' /></td>
        </tr>
       </table>
      </div>
         ".$this->ipsclass->lang['rpg_magic']." ".$mp." / ".$maxmp."<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='html/rpg/img_left.gif' alt='' /></td>
         <td width='114' height='13' class='nopad' style='line-height: 13px;background: url(html/rpg/img_backing.gif) repeat-x top left;'><img src='html/rpg/green.gif' width='".$mpf."%' height='9' alt='' /><img src='html/rpg/mp.gif' height='9' alt='' /></td>
         <td width='3' height='13' class='nopad'><img width='3' height='13' src='html/rpg/img_right.gif' alt='' /></td>
        </tr>
       </table>
      </div>
         ".$this->ipsclass->lang['rpg_exp']." ".$ep."%<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='html/rpg/img_left.gif' alt='' /></td>
         <td width='114' height='13' class='nopad' style='line-height: 13px;background: url(html/rpg/img_backing.gif) repeat-x top left;'><img src='html/rpg/blue.gif' width='".$ep."%' height='9' alt='' /><img src='html/rpg/exp.gif' height='9' alt='' /></td>
         <td width='3' height='13' class='nopad'><img width='3' height='13' src='html/rpg/img_right.gif' alt='' /></td>
        </tr>
       </table>
      </div>
    ";
    Save & Upload .


    Okie , bây giờ đến phần làm ở skin . Có 2 cách , một là làm qua ACP , hoặc làm trực tiếp qua file skin .

    Cách 1 : Vào ACP --> Lock & Feel -->Skins & Templates --> Skin Manager --> chọn skin của bạn --> Edit Template HTML --> Topic View --> RenderRow

    Tìm :

    Mã:
    {$author['member_number']}<br>
    Thêm bên dưới :


    Mã:
    {$author['rpg']}

    Save Template Bit

    Down file này http://www.markxy.5gaigs.com/Mod_Level_2_1.x.rar giải nén (bằng Winrar)rồi up thư mục html lên thư mục gốc của host ngang hàng với các file admin.php , index.php...



    Còn mod này cho VBB thì tôi ko biết !
     

Chia sẻ trang này