[水怪RPG複雜化委員會]天空鬥技場興建計劃啟動
版主: 版主管理群
請問上面紅色的部分如果想改為讓他判讀的是rpg_level要如何加進去呢?ilove1291 寫:[php]<?php
function UserIsDead($wsql, $wsql2, $uid, $uname, $ulv, $deadtype, $is_npc = false)
{
global $db;
$ret_msg = '';
if ( $is_npc )
{
$sql = "select count(*) as dead_count, sum(rpg_level) as dead_level, sum(rpg_max_hp) as dead_money from phpbb_rpg_npc where rpg_cur_hp <= 0 and $wsql";
$result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) )
{
if ( $row['dead_count'] > 0 )
{
$sql = "select npc_id from phpbb_rpg_npc where rpg_cur_hp <= 0 and $wsql";
$result = $db->sql_query($sql);
if ( $row2 = $db->sql_fetchrow($result) )
{
$ret_msg = ' 擊敗: ';
do
{
$ret_msg .= ($row2['npc_name'] == '' ? '' . $row2['npc_id'] : $row2['npc_name']) . ' ';
}
while ( $row2 = $db->sql_fetchrow($result) );
$ret_msg .= "關鍵一擊: $deadtype ";
}
//掉寶率
// $sql = "select count(*) as item_count from phpbb_rpg_items where in_which_store <= 2 and need_level <= $ulv";
// $result = $db->sql_query($sql);
// $row2 = $db->sql_fetchrow($result);
// $item_count = $row2['item_count'] - 1;
// srand((double)microtime()*1000000);
// for ($i = 1; $i <= $row['dead_count']; $i++)
// {
// $sql = "select item_id, item_name from phpbb_rpg_items where in_which_store <= 2 and need_level <= $ulv order by item_id limit " . rand(0, $item_count) . " , 1";
// $result = $db->sql_query($sql);
srand((double)microtime()*1000000);
$change = rand(1, 100) ;
$sql = "select count(*) as item_count from phpbb_rpg_items where need_level <= $ulv and item_change >= $change";
$result = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result);
$item_count = $row2['item_count'] - 1;
for ($i = 1; $i <= $row['dead_count']; $i++)
{
$sql = "select item_id, item_name, in_which_store from phpbb_rpg_items where and need_level <= $ulv and item_change >= $change order by item_id limit " . rand(0, $item_count) . " , 1";
$result = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result);
switch ($row2['in_which_store']) {
case '0' :
$ret_msg .= "並獲得道具:" . $row2['item_name'] . ' ';
break;
case '1' :
$ret_msg .= "並獲得武器:" . $row2['item_name'] . ' ';
break;
case '2' :
$ret_msg .= "並獲得盔甲:" . $row2['item_name'] . ' ';
break;
case '3' :
$ret_msg .= "並意外領悟:" . $row2['item_name'] . ' ';
break;
case '4' :
$ret_msg .= "並獲得頭飾:" . $row2['item_name'] . ' ';
break;
case '5' :
$ret_msg .= "並獲得足具:" . $row2['item_name'] . ' ';
break;
case '6' :
$ret_msg .= "並獲得披風:" . $row2['item_name'] . ' ';
break;
case '7' :
$ret_msg .= "並獲得盾牌:" . $row2['item_name'] . ' ';
break;
case '8' :
$ret_msg .= "並獲得魔書:" . $row2['item_name'] . ' ';
break;
case '9' :
$ret_msg .= "並獲得飾品:" . $row2['item_name'] . ' ';
break;
}
$sql = "insert into phpbb_rpg_owns (user_id, item_id) values ($uid, " . $row2['item_id'] . ")";
$db->sql_query($sql);
//掉寶率
}[/color]
都沒出現哩QQ 老師救命
我有試著直接改為where need_level <= rpg_level 可是這樣他好像不會判讀
請各位大大教導一下,謝謝
另外,如果想在這段多加進職業的考量,又該如何加進去呢?
謝謝幫忙
水怪 Discuz 版::加上了控制台(把程式寫活了),沒做phpbb的
http://202.181.134.28/~nico/music/test/rpg.zip
請大家幫忙澈是吧 (還不是正式版)....
不知道委員會飛哪了/........不過歡迎到bbs.04gd.com成立新的委員會
http://202.181.134.28/~nico/music/test/rpg.zip
請大家幫忙澈是吧 (還不是正式版)....
不知道委員會飛哪了/........不過歡迎到bbs.04gd.com成立新的委員會
代碼: 選擇全部
洨?葉子™© !GOLDEN BALL 說:
PAIKANG呀
[gnakiap]鍛練心臟強度... 說:
?
洨?葉子™© !GOLDEN BALL 說:
竹貓有人把水怪RPG改成Discuz版的呢\r
[gnakiap]鍛練心臟強度... 說:
XD
洨?葉子™© !GOLDEN BALL 說:
然後又有人提到此問題 說要問問原作者
[gnakiap]鍛練心臟強度... 說:
沒關係啊
洨?葉子™© !GOLDEN BALL 說:
恩~
Helvetica is a feature-length independent film about typography.
Because I wanted to make game more complicate than it is.DL 寫:換成phpbb的死對頭?不要命了?:-P
還有喔...請問你得到了所有原作者同意了嗎?
And Discuz Forum is also better environment to develop MODs
I used PHPBB before, but to tell u the truth It has too much bugs/holes which i can exploit and coulodbe easily hacked ( don't want to reveal them) . That's why I switched to Discuz. Discuz is much more safer forum to use.