[分享](V3)角色狀態顯示裝備訊息
發表於 : 2007-04-11 12:24 am
程式已經改好了,所以就跟大家分享囉
另外,這個程式碼只適用在[個人狀態]中,冠軍與偵查及其他地方皆不會顯示裝備資訊
範例圖片(第二張的裝備類型錯誤不必理會,程式碼已經更正)
儲存、關閉所有檔案
下面先列出目前存在的bug或其他的問題,等週六之後再補…
1.超出頁面的bug
2.加入物品id紀錄
另外,這個程式碼只適用在[個人狀態]中,冠軍與偵查及其他地方皆不會顯示裝備資訊
範例圖片(第二張的裝備類型錯誤不必理會,程式碼已經更正)
開啟檔案wog/class/wog_act_chara.php 寫:In show_chara() Function
尋找
- 代碼: 選擇全部
$p=$DB_site->query_first($sql);
下方,加上
- 代碼: 選擇全部
if($s!=2)
{
$result=$DB_site->query("Select a.d_id,a.d_name,a.d_at,a.d_mat,a.d_df,a.d_mdf,a.d_agl,a.d_type,a.d_mstr,a.d_magl,a.d_msmart,a.d_s,a.d_send,b.ch_name
From wog_df a left join wog_character b on a.ch_id=b.ch_id,wog_player c
Where a.d_id in (c.a_id,c.d_body_id,c.d_head_id,c.d_hand_id,c.d_foot_id,c.d_item_id) and c.p_id=".$user_id);
while($eq=$DB_site->fetch_array($result))
{
echo "parent.desc_id[".$eq['d_type']."]=".$eq['d_id'].";parent.description(".$eq['d_id'].",'".$eq['d_name']."',".$eq['d_type'].",".$eq['d_at'].",".$eq['d_mat'].",".$eq['d_df'].",".$eq['d_mdf'].",".$eq['d_agl'].",".$eq['d_mstr'].",".$eq['d_magl'].",".$eq['d_msmart'].",'".$eq['ch_name']."','".$eq['d_s']."',".$eq['d_send'].");";
}
}
開啟檔案wog/wog.js 寫:In status_view() Function
尋找
- 代碼: 選擇全部
f.write('<tr><td >武器</td><td ><b>'+d_a_name+'</b></td><td >身體</td><td ><b>'+d_body_name+'</b></td></tr>')
f.write('<tr><td >手部</td><td ><b>'+d_hand_name+'</b></td><td >頭部</td><td ><b>'+d_head_name+'</b></td></tr>')
f.write('<tr><td >腳部</td><td ><b>'+d_foot_name+'</b></td><td >道具</td><td ><b>'+d_item_name+'</b></td></tr>')
改成
- 代碼: 選擇全部
f.write('<tr><td >武器</td><td ><b><span onmouseover="parent.textboard_view('+desc_id[0]+',event)" onmouseout="parent.textboard_close()">'+d_a_name+'</b></td><td>身體</td><td ><b><span onmouseover="parent.textboard_view('+desc_id[2]+',event)" onmouseout="parent.textboard_close()">'+d_body_name+'</span></b></td></tr>')
f.write('<tr><td >手部</td><td ><b><span onmouseover="parent.textboard_view('+desc_id[3]+',event)" onmouseout="parent.textboard_close()">'+d_hand_name+'</span></b></td><td >頭部</td><td ><b><span onmouseover="parent.textboard_view('+desc_id[1]+',event)" onmouseout="parent.textboard_close()">'+d_head_name+'</span></b></td></tr>')
f.write('<tr><td >腳部</td><td ><b><span onmouseover="parent.textboard_view('+desc_id[4]+',event)" onmouseout="parent.textboard_close()">'+d_foot_name+'</span></b></td><td >道具</td><td ><b><span onmouseover="parent.textboard_view('+desc_id[5]+',event)" onmouseout="parent.textboard_close()">'+d_item_name+'</span></b></td></tr>')
尋找
- 代碼: 選擇全部
f.write('<tr><td >物防</td><td class="b1" ><img src="'+img+'bar/bmg.gif" width="'+p_dff+'%" height="9"><b>'+p_df+'</b></td><td >魔防</td><td class="b1" ><img src="'+img+'bar/bmg.gif" width="'+p_mdff+'%" height="9"><b>'+p_mdf+'</b></td></tr>')
f.write(temp_table2);
下方,加上
- 代碼: 選擇全部
f.write('<div id="textboard" name="textboard" style="display:none;background:black;border:1px solid #4B689E;width:160px;height:100px;position:absolute;left:0px;top:0px"></div>');
尋找
- 代碼: 選擇全部
function status_view(p_win,p_lost,p_img_set,i_img,p_sex,p_s,p_lv,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,p_place)
{
..........
}
下方,加上
- 代碼: 選擇全部
var txt = new Array();
var desc_id=new Array(0,0,0,0,0,0);
function description(id,name,d_type,at,mat,df,mdf,agl,mstr,magl,msmart,ch_name,s,send)
{
if(!txt[id])
{
switch(d_type)
{
case 0:
d_type="武器";
break;
case 1:
d_type="頭部";
break;
case 2:
d_type="身體";
break;
case 3:
d_type="手部";
break;
case 4:
d_type="足部";
break;
case 5:
d_type="道具";
break;
case 6:
d_type="強化";
break;
default:
d_type="未知";
break;
}
switch(s)
{
case "1":
s='(<font color="#FFBF9F">地</font>)';
break;
case "2":
s='(<font color="#9F9FFF">水</font>)';
break;
case "3":
s='(<font color="#FF9F9F">火</font>)';
break;
case "4":
s='(<font color="#9FFF9F">木</font>)';
break;
case "5":
s='(<font color="#9FFFFF">風</font>)';
break;
case "6":
s='(<font color="#FF9FFF">毒</font>)';
break;
default:
s="";
break;
}
ch_name=ch_name?ch_name:'無';
if(send==1)
{
send='<tr><td colspan="2" bgcolor="#444444" style="border:1px solid #4B689E">已綁定</td></tr>';
}else
{
send="";
}
txt[id]='<table border=0 width="100%" style="font-size:9px"><tr><td style="border:1px solid #4B689E"><table border=0 width="100%"><tr><td width="75%" style="text-align:left">'+name+s+'</td><td width="25%">'+d_type+'</td></tr></table></td></tr><tr><td colspan="2" style="text-align:left">物攻擊力:'+at+'<br>魔攻擊力:'+mat+'<br>物防禦力:'+df+'<br>魔防禦力:'+mdf+'<br>速度:'+agl+'<br>需求力量:'+mstr+'<BR>需求速度:'+magl+'<BR>需求智力:'+msmart+' <BR>限定職業:'+ch_name+'</td></tr>'+send+'</table>';
}
}
function textboard_view(txt_id,event)
{
var board=parent.wog_view.textboard;
var f=parent.wog_view.frameElement;
if(!txt[txt_id])return false;
board.innerHTML=txt[txt_id];
Bwidth=parseInt(board.style.width),Bheight=parseInt(board.style.height);
var Bleft=(event.clientX+Math.ceil(Bwidth*5/4)+5 >= f.width)?event.clientX-Math.ceil(Bwidth*5/4):event.clientX+Math.floor(Bwidth/4);
var Btop=(event.clientY+Math.ceil(Bheight/2)+5 >= f.height)?event.clientY-Bheight:event.clientY-Math.floor(Bheight/2);
board.style.left=Bleft;
board.style.top=Btop;
board.style.display="";
}
function textboard_close()
{
parent.wog_view.textboard.style.display="none";
}
儲存、關閉所有檔案
下面先列出目前存在的bug或其他的問題,等週六之後再補…
1.超出頁面的bug
2.加入物品id紀錄