第 1 頁 (共 1 頁)
[問題] HP/MP/EXP 內的 MP 永遠常滿
發表於 : 2004-02-15 21:22
由 men_lok
論壇版本: 2.0.6
問題外掛:
HP/MP/EXP 1.2.0
安裝後,MP 圖形那行永遠常滿,試著用數字來看 (用{postrow.POSTER_MP})
文字顯示也是常滿的,記得 MP 的減法好像是每次發文減少,按註冊時間還原
再來測試連發數篇文章,也沒有扣呢,但其他如 HP 等數值有增加
請問是否安裝錯了?要改那一段?謝謝解答~~~
Re: [問題] HP/MP/EXP 內的 MP 永遠常滿
發表於 : 2004-02-15 21:59
由 吉川拓也
men_lok 寫:論壇版本: 2.0.6
問題外掛:
HP/MP/EXP 1.2.0
安裝後,MP 圖形那行永遠常滿,試著用數字來看 (用{postrow.POSTER_MP})
文字顯示也是常滿的,記得 MP 的減法好像是每次發文減少,按註冊時間還原
再來測試連發數篇文章,也沒有扣呢,但其他如 HP 等數值有增加
請問是否安裝錯了?要改那一段?謝謝解答~~~
貼張圖片來看比較快瞭解你的狀況 !!
另外把你 CODE 貼上來看看(TPL)
發表於 : 2004-02-15 22:10
由 Martinet
感覺是 php檔的問題 ...如果有問題的話..
把 viewtopic.php 也一併貼上來吧..(吉川說的TPL也貼一下好偵錯)
發表於 : 2004-02-16 00:49
由 men_lok
代碼: 選擇全部
<tr>
<td><img src="templates/Iris/images/level/mp.gif" alt="{postrow.POSTER_MP}" title="{postrow.POSTER_MP}" width="{postrow.POSTER_MP_WIDTH}" height="5" /><img src="templates/Iris/images/level/mp_end.gif" alt="" width="4" height="5" /></td>
</tr>
這是顯示 MP 的 php 碼 (viewtopic_body.tpl)
至於 php 本身都是用原來下載的程式,只有變動了圖片和高度等 (當然也試過不變動圖片測試...同樣常滿呢...)
看來應該沒錯...也試過不變動開新的 phpbb 來測試...也一樣呢\r
要靠各位大大幫忙,謝謝解答 ^_______^
發表於 : 2004-02-16 00:53
由 men_lok
忘了 viewtopic.php
代碼: 選擇全部
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
之後加入這一行
include($phpbb_root_path . 'includes/level_mod.'.$phpEx); //added for Level Mod (Mac)
另外一段就是這樣,沒有變動它呢\r
代碼: 選擇全部
/* BEGIN LEVEL MOD */
"POSTER_HP" => $level_hp,
"POSTER_HP_WIDTH" => $level_hp_percent,
"POSTER_HP_EMPTY" => ( 100 - $level_hp_percent ),
"POSTER_MP" => $level_mp,
"POSTER_MP_WIDTH" => $level_mp_percent,
"POSTER_MP_EMPTY" => ( 100 - $level_mp_percent ),
"POSTER_EXP" => $level_exp,
"POSTER_EXP_WIDTH" => $level_exp_percent,
"POSTER_EXP_EMPTY" => ( 100 - $level_exp_percent ),
"POSTER_LEVEL" => $level_level,
"POSTER_LEVEL_CLASSNAME" => $level_classname,
"POSTER_LEVEL_SKILLRATIO" => $level_skillratio,
"POSTER_LEVEL_CLASSIMG" => $level_classimg,
"POSTER_LEVEL_ELEMENT" => $element,
/* END LEVEL MOD */
再次謝謝
另外忘了說,在 profile_view_body.tpl 內也是一樣不能正常顯示 MP,也是常滿的 (這表示應該是我安裝時程式 php 安裝錯了?)
發表於 : 2004-02-16 20:03
由 shihchieh
你貼的這段並不是這個mod的計算部份~你要貼計算的部份才有辦法,應該是level.php這個檔(好像.....)
發表於 : 2004-02-16 20:34
由 men_lok
謝謝,沒有更動該 php 東,以下是應該是計算 MP 的部份
代碼: 選擇全部
/* Determine MP
*
* MP is calculated by how long the user has been around
* and how often they post.
*
* Max MP is based on level, and increases with level
* Each post a user makes costs them mp,
* and a user regenerates mp proportional to how
* many days they have been registered
*
*/
//Number of days the user has been at the forums.
if ($profileversion) {
$level_user_days = max(1, round( ( time() - $profiledata['user_regdate'] ) / 86400 ));
} else {
$level_user_days = max(1, round( ( time() - $postrow[$i]['user_regdate'] ) / 86400 ));
}
/* The mp cost for one post.
* Raising this value will generally decrease the current
* mp for most posters.
* This may be set to a decimal value (eg, 2, 2.1, 3.141596)
* This should NOT be set to 0
*/
$level_post_mp_cost = 2.5;
/* This determines how much mp a user regenerates per day
* Raising this value will generally increase the current
* mp for most posters.
* This may be set to a decimal value (eg, 3, 3.5, 2.71828)
* This should NOT be set to 0
*/
$level_mp_regen_per_day = 20;
if($level_level < 1)
{
$level_mp = '0 / 0';
$level_mp_percent = 0;
}
else
{
$level_max_mp = floor( (pow( $level_level, (1/4) ) ) * (pow( 10, pow( $level_level+2, (1/3) ) ) ) / (pi()) );
if ($profileversion) {
$level_mp_cost = $profiledata['user_posts'] * $level_post_mp_cost;
} else {
$level_mp_cost = $postrow[$i]['user_posts'] * $level_post_mp_cost;
}
$level_mp_regen = max(1, $level_user_days * $level_mp_regen_per_day);
$level_cur_mp = floor($level_max_mp - $level_mp_cost + $level_mp_regen);
$level_cur_mp = max(0, $level_cur_mp);
$level_cur_mp = min($level_max_mp, $level_cur_mp);
$level_mp = $level_cur_mp . ' / ' . $level_max_mp;
$level_mp_percent = floor($level_cur_mp / $level_max_mp * 100 );
}
有發現,當我更改 $level_mp_regen_per_day = 20; 為比較小的數字發文後就可以減少 MP
原因是...?
謝謝 ^__^