[水怪RPG複雜化委員會]天空鬥技場興建計劃啟動
版主: 版主管理群
-
- 竹貓忠實會員
- 文章: 1086
- 註冊時間: 2003-10-28 14:50
我想要問一下如果武器店只想顯示 need_class 是特定數的的時候(例如8)要如何修改呢
武器店 的php
[php]<?php
$sql = "select * from phpbb_rpg_items where in_which_store = 1 order by item_order limit $start_rec, " . PAGE_WEAPONS;
$result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) )
{
if ($page_count > 0)
{
$itemlist .= '<span class="gensmall"><b>頁次:';
for ($i = 1; $i <= $page_count ; $i++)
{
if ($i == (floor($start_rec / PAGE_WEAPONS) + 1) )
{
$itemlist .= ' ' . $i;
}
else
{
$itemlist .= ' <a href="rpg.php?action=weapons&start=' . (($i - 1) * PAGE_WEAPONS) . '">' . $i . '</a>';
}
}
$itemlist .= '</span>';
}
$i = $start_rec + 1;
$itemlist .= '<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0">
<tr><td align="center" class="catLeft"><b><span class="gen">#</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">名稱</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">金額</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">屬性</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">職業</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">等級</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">購買</span></b></td></tr>';
do
{
$itemlist .= '<tr><td class="row3" align="center"><span class="gensmall">' . $i .
'</span></td><td><span class="gensmall">' . $row['item_name'] .
'</span></td><td align="right"><span class="gensmall">';
if ($row['item_spec_price'] > 0)
{
$itemlist .= 'max(' . number_format($row['item_price']) . ',' . $row['item_spec_price'] . '%財產)';
}
else
{
$itemlist .= number_format($row['item_price']);
}
$itemlist .= '</span></td><td><span class="gensmall">' . GetProperties($row) .
'</span></td><td><span class="gensmall">' . GetTypies($row['need_class']) .
'</span></td><td align="center"><span class="gensmall">' . $row['need_level'] .
'</span></td><td align="center"><span class="gensmall"><a href=rpg.php?action=weapons&start=' . $start_rec . '&buy=' .
$row['item_id'] . '>購買</a></span></td></tr>';
$i++;
}
while ( $row = $db->sql_fetchrow($result) );
$itemlist .= '</table>';
}
?>[/php]
finction_rpg 理的部分
[php]<?php
function GetTypies($classlist)
{
global $db;
$typies = '';
if (strstr($classlist, '0'))
{
$typies = ' 不限';
}
else
{
$sql = 'SELECT * FROM phpbb_rpg_setting WHERE setting_id = 1';
if ( ($result = $db->sql_query($sql)) )
{
if ( $row = $db->sql_fetchrow($result) )
{
$classid = array();
$classname = array();
do
{
$classid[] = $row['setting_value1'];
$classname[$row['setting_value1']] = $row['setting_value2'];
}
while ( $row = $db->sql_fetchrow($result) );
for ($i = 0; $i < count($classid); $i++)
{
if (strstr($classlist, strval($classid[$i])))
{
$typies .= ' ' . $classname[$classid[$i]];
}
}
}
}
}
return $typies;
}
?>[/php]
代碼: 選擇全部
TABLE `phpbb_rpg_items` (
`item_id` smallint(6) unsigned NOT NULL auto_increment,
`item_name` varchar(60) default NULL,
`item_description` varchar(255) default NULL,
`in_which_store` tinyint(1) default '0',
`need_level` smallint(5) default '0',
`custom_made` mediumint(8) default '0',
`need_class` varchar(10) default NULL,
`item_addition1` varchar(60) default NULL,
`item_addition2` varchar(60) default NULL,
`item_price` int(11) NOT NULL default '0',
`item_spec_price` smallint(5) NOT NULL default '0',
`item_type` tinyint(4) NOT NULL default '0',
`item_position` tinyint(4) NOT NULL default '0',
`item_order` smallint(5) default '0',
`need_to_use` tinyint(1) default '0',
`attack_property` decimal(4,1) default '0.0',
`defense_property` decimal(4,1) default '0.0',
`magic_property` decimal(4,1) default '0.0',
`speed_property` decimal(4,1) default '0.0',
`hp_property` decimal(4,1) default '0.0',
`mp_property` decimal(4,1) default '0.0',
`need_mp1` varchar(4) default '0',
`need_mp2` varchar(4) default '0',
PRIMARY KEY (`item_id`)
)
[php]<?php
$sql = "select * from phpbb_rpg_items where in_which_store = 1 order by item_order limit $start_rec, " . PAGE_WEAPONS;
$result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) )
{
if ($page_count > 0)
{
$itemlist .= '<span class="gensmall"><b>頁次:';
for ($i = 1; $i <= $page_count ; $i++)
{
if ($i == (floor($start_rec / PAGE_WEAPONS) + 1) )
{
$itemlist .= ' ' . $i;
}
else
{
$itemlist .= ' <a href="rpg.php?action=weapons&start=' . (($i - 1) * PAGE_WEAPONS) . '">' . $i . '</a>';
}
}
$itemlist .= '</span>';
}
$i = $start_rec + 1;
$itemlist .= '<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0">
<tr><td align="center" class="catLeft"><b><span class="gen">#</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">名稱</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">金額</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">屬性</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">職業</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">等級</span></b></td>
<td align="center" class="catLeft"><b><span class="gen">購買</span></b></td></tr>';
do
{
$itemlist .= '<tr><td class="row3" align="center"><span class="gensmall">' . $i .
'</span></td><td><span class="gensmall">' . $row['item_name'] .
'</span></td><td align="right"><span class="gensmall">';
if ($row['item_spec_price'] > 0)
{
$itemlist .= 'max(' . number_format($row['item_price']) . ',' . $row['item_spec_price'] . '%財產)';
}
else
{
$itemlist .= number_format($row['item_price']);
}
$itemlist .= '</span></td><td><span class="gensmall">' . GetProperties($row) .
'</span></td><td><span class="gensmall">' . GetTypies($row['need_class']) .
'</span></td><td align="center"><span class="gensmall">' . $row['need_level'] .
'</span></td><td align="center"><span class="gensmall"><a href=rpg.php?action=weapons&start=' . $start_rec . '&buy=' .
$row['item_id'] . '>購買</a></span></td></tr>';
$i++;
}
while ( $row = $db->sql_fetchrow($result) );
$itemlist .= '</table>';
}
?>[/php]
finction_rpg 理的部分
[php]<?php
function GetTypies($classlist)
{
global $db;
$typies = '';
if (strstr($classlist, '0'))
{
$typies = ' 不限';
}
else
{
$sql = 'SELECT * FROM phpbb_rpg_setting WHERE setting_id = 1';
if ( ($result = $db->sql_query($sql)) )
{
if ( $row = $db->sql_fetchrow($result) )
{
$classid = array();
$classname = array();
do
{
$classid[] = $row['setting_value1'];
$classname[$row['setting_value1']] = $row['setting_value2'];
}
while ( $row = $db->sql_fetchrow($result) );
for ($i = 0; $i < count($classid); $i++)
{
if (strstr($classlist, strval($classid[$i])))
{
$typies .= ' ' . $classname[$classid[$i]];
}
}
}
}
}
return $typies;
}
?>[/php]
XD..... 這樣的喔....
我的站上是有水怪的討論區 XD....
不過都沒人來~ 有興趣的話歡迎來討問唷~
我的站上是有水怪的討論區 XD....
不過都沒人來~ 有興趣的話歡迎來討問唷~
Helvetica is a feature-length independent film about typography.
歡迎貼過來啊 不然我就要轉載了呢 :-pilove1291 寫:我可以把這些問題貼過去佔版面嗎?StickyKid 寫: 我的站上是有水怪的討論區 XD....
不過都沒人來~ 有興趣的話歡迎來討問唷~
Helvetica is a feature-length independent film about typography.
職業的類別是在\r
phpbb_rpg_setting
鍵名..........................型態..........組別.........欄位
setting_value1......INDEX........不適用......setting_value1
setting_id..............INDEX........不適用......setting_id
setting_value2......FULLTEXT...不適用......setting_value2
setting_value2_2..FULLTEXT...不適用......setting_value2
setting_value2_3..FULLTEXT...不適用......setting_value2
setting_value2_4..FULLTEXT...不適用......setting_value2
setting_value2_5..FULLTEXT...不適用......setting_value2
setting_value2_6..FULLTEXT...不適用......setting_value2
setting_value2_7..FULLTEXT...不適用......setting_value2
以戰士為例
setting_id.............1<<<<<<<這個要1(不知道為什麼XD)
setting_value1......1<<<<<<<這個是職業類別代碼\r
setting_value2......戰士系<<<<這個是職業類別名稱\r
然後職業是在phpbb_rpg_position
欄位..........................型態..................屬性..............Null..預設值\r
position_id...............smallint(6).......UNSIGNED.....否... auto_increment
position_name.........varchar(30)...........................是...NULL
position_class..........char(2)..................................否...0
position_order.........tinyint(2)...............................否...0
position_fee.............int(8)....................................是....NULL
attack_property.......decimal(4,1)..........................否....0.0
defense_property....decimal(4,1)..........................否....0.0
magic_property........decimal(4,1)..........................否....0.0
speed_property.......decimal(4,1)..........................否....0.0
hp_property.............decimal(4,1)..........................否....0.0
mp_property............decimal(4,1)..........................否...0.0
在position.php裡有define('UPGRADE_LEVEL', 4);<<<<就是每4即可轉
你在position_class 填入你要的職業類別\r
然後position_order推看看lv200是多少(基礎職業3級=16戰士1級=20如果他只練戰士的話lv200時就是戰士46級不知道算的對不對)所以position_order的值是47
假設你要加在戰士系列的話因該是這樣 X要看你編到幾號 20000是轉職金
後面的0.0是職業加成
INSERT INTO `phpbb_rpg_position` VALUES (x, '戰士46', '1', 47, 20000, '0.0', '0.0', '0.0', '0.0', '0.0', '0.0');
我知道的只有這樣 可能不合你的要求XD
phpbb_rpg_setting
鍵名..........................型態..........組別.........欄位
setting_value1......INDEX........不適用......setting_value1
setting_id..............INDEX........不適用......setting_id
setting_value2......FULLTEXT...不適用......setting_value2
setting_value2_2..FULLTEXT...不適用......setting_value2
setting_value2_3..FULLTEXT...不適用......setting_value2
setting_value2_4..FULLTEXT...不適用......setting_value2
setting_value2_5..FULLTEXT...不適用......setting_value2
setting_value2_6..FULLTEXT...不適用......setting_value2
setting_value2_7..FULLTEXT...不適用......setting_value2
以戰士為例
setting_id.............1<<<<<<<這個要1(不知道為什麼XD)
setting_value1......1<<<<<<<這個是職業類別代碼\r
setting_value2......戰士系<<<<這個是職業類別名稱\r
然後職業是在phpbb_rpg_position
欄位..........................型態..................屬性..............Null..預設值\r
position_id...............smallint(6).......UNSIGNED.....否... auto_increment
position_name.........varchar(30)...........................是...NULL
position_class..........char(2)..................................否...0
position_order.........tinyint(2)...............................否...0
position_fee.............int(8)....................................是....NULL
attack_property.......decimal(4,1)..........................否....0.0
defense_property....decimal(4,1)..........................否....0.0
magic_property........decimal(4,1)..........................否....0.0
speed_property.......decimal(4,1)..........................否....0.0
hp_property.............decimal(4,1)..........................否....0.0
mp_property............decimal(4,1)..........................否...0.0
在position.php裡有define('UPGRADE_LEVEL', 4);<<<<就是每4即可轉
你在position_class 填入你要的職業類別\r
然後position_order推看看lv200是多少(基礎職業3級=16戰士1級=20如果他只練戰士的話lv200時就是戰士46級不知道算的對不對)所以position_order的值是47
假設你要加在戰士系列的話因該是這樣 X要看你編到幾號 20000是轉職金
後面的0.0是職業加成
INSERT INTO `phpbb_rpg_position` VALUES (x, '戰士46', '1', 47, 20000, '0.0', '0.0', '0.0', '0.0', '0.0', '0.0');
我知道的只有這樣 可能不合你的要求XD