[問題]水怪RPG 1.0.5 抓不到路人資料(已解決)

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
upton
星球普通子民
星球普通子民
文章: 17
註冊時間: 2003-05-14 06:50
來自: Milwaukee

[問題]水怪RPG 1.0.5 抓不到路人資料(已解決)

文章 upton »

在使用亂飛矢的時候,可以抓到範圍內所有使用者的資料
但是對於範圍內的路人資料卻抓不到,不知道是那邊有錯誤是需要改正的
謝謝!

我有做部分修改,把原本只能攻擊低於10級內的限制解除,這部分應該沒有改錯
其他我找不太出來到底是哪裡出了問題

代碼: 選擇全部

				case 171: // 萬物歸零究級無限血火紅
				case 119: // 亂飛矢
					if ( $next_act == 171 )
					{
						$sql = "select min(own_id) as wing_id, count(*) as wing_count from phpbb_rpg_owns where item_id = 104 and user_id = " . $profiledata['user_id'];
						$result = $db->sql_query($sql);
						if ( $row2 = $db->sql_fetchrow($result) )
						{
							if ( $row2['wing_count'] == 0 )
							{
								$ret_msg = "您沒有 <b>翼翼的羽毛</b> 可以輔助施展這個技巧!!";
							}
							else
							{
								$sql = "delete from phpbb_rpg_owns where user_id = " . $profiledata['user_id'] . " and own_id = " . $row2['wing_id'];
								$db->sql_query($sql);
							}
						}
					}
					if ( $ret_msg == '' )
					{
						$dead_cause = '';
						$sql1 = "rpg_eol_data is not null and right(rpg_eol_data, 6) <> '000086' and (abs(left(right(rpg_eol_data, 6), 3) - $now_x) + abs(right(rpg_eol_data, 3) - $now_y)) <= 9 " .
							($next_act == 171 ? "" : " and user_id <> " . $profiledata['user_id']);
						$sql2 = (abs(now_x - $now_x) + abs(now_y - $now_y)) <= 9 ;
						$sql3 = "u.rpg_eol_data is not null and right(u.rpg_eol_data, 6) <> '000086' and (abs(left(right(u.rpg_eol_data, 6), 3) - $now_x) + abs(right(u.rpg_eol_data, 3) - $now_y)) <= 9 " .
							($next_act == 171 ? "" : " and u.user_id <> " . $profiledata['user_id']);

						$sql = "delete from phpbb_rpg_npc where npc_name is not null and npc_name <> '' and $sql2";
						$db->sql_query($sql);

						$sql = "select username from phpbb_users where $sql1";
						$result = $db->sql_query($sql);
						if ( $row2 = $db->sql_fetchrow($result) )
						{
							do
							{
								$dead_cause .= $row2['username'] . ' ';
							}
							while ( $row2 = $db->sql_fetchrow($result) );
						}

						$sql = "select npc_id, npc_name from phpbb_rpg_npc where $sql2";
						$result = $db->sql_query($sql);
						if ( $row2 = $db->sql_fetchrow($result) )
						{
							do
							{
								$dead_cause .= ($row2['npc_name'] == '' ? "路人" . $row2['npc_id'] : $row2['npc_name']) . ' ';
							}
							while ( $row2 = $db->sql_fetchrow($result) );
						}
						if ( $next_act == 171 )
						{
							$hp_deduct = floor($profiledata['rpg_max_mp'] / 3);
							$skill_name = "萬物歸零究級無限血火紅";
						}
						else
						{
							$hp_deduct = rand(floor($profiledata['rpg_attack'] / 10), floor($profiledata['rpg_attack'] / 2));
							$skill_name = "亂飛矢";
						}
						$sql = "update phpbb_users set rpg_cur_hp = rpg_cur_hp - $hp_deduct where $sql1";
						$db->sql_query($sql);
						$sql = "update phpbb_rpg_npc set rpg_cur_hp = rpg_cur_hp - $hp_deduct where $sql2";
						$db->sql_query($sql);
						$ret_msg = $profiledata['username'] . "使出 $skill_name ,擊中: $dead_cause ,受傷點數: $hp_deduct ";
						$ret_msg .= UserIsDead($sql1, $sql3, $profiledata['user_id'], $profiledata['username'], $profiledata['rpg_level'], "$skill_name($hp_deduct)");
						$ret_msg .= UserIsDead($sql2, "", $profiledata['user_id'], $profiledata['username'], $profiledata['rpg_level'], "$skill_name($hp_deduct)", true);
						unset($skill_name);
					}
					break;

上網方式:DSL(AT&T)。
安裝的程式:Apache 1.3.37+ php 4.4.2+ MySql 4.1.21+ Linux OS
phpBB2 版本:phpBB 2.0.22
domain(網域名稱) :phpbb2.tsaiit.100megs32.com
phpBB2 連結網址: http://phpbb2.tsaiit.100megs32.com/
凡事豈能盡如人意,但求無愧我心
upton
星球普通子民
星球普通子民
文章: 17
註冊時間: 2003-05-14 06:50
來自: Milwaukee

文章 upton »

問題已經解決

看了好久~~總算發現到問題了

代碼: 選擇全部

						$sql2 = (abs(now_x - $now_x) + abs(now_y - $now_y)) <= 9 ;
應該改成

代碼: 選擇全部

						$sql2 = "(abs(now_x - $now_x) + abs(now_y - $now_y)) <= 9" ;
小地方
大問題
:mrgreen:
凡事豈能盡如人意,但求無愧我心
主題已鎖定

回到「外掛問題討論」