[分享]寵物能力爆增BUG解決法
發表於 : 2009-12-31 9:25 pm
當寵物能力小於0時,會變成
WOG不管在哪個版本都有的大BUG,我用WOG4得程式作範例
開啟./class/wog_act_pet.php
在function pet_ac()裡面
新增修改紅色部分
WOG不管在哪個版本都有的大BUG,我用WOG4得程式作範例
開啟./class/wog_act_pet.php
在function pet_ac()裡面
新增修改紅色部分
- 代碼: 選擇全部
function pet_ac($user_id)
{
global $DB_site,$_POST,$wog_arry,$lang;
----------省略----------
if(rand(1,100) < $leave)
{
$DB_site->query("delete from wog_pet where pe_p_id=".$user_id." and pe_id=".$_POST["pay_id"]);
showscript("parent.job_end(17)");
}
*/
}else
{
alertWindowMsg($lang['wog_act_pet_nopet']);
}
[color=red]$p=$DB_site->query_first("select pe_at,pe_mt,pe_def,pe_fi from wog_pet where pe_p_id=".$user_id." and pe_id=".$_POST["pay_id"]." ");[/color]
$at="+0";$mt="+0";$def="+0";$fi="+0";$fu="+0";
switch ($_POST["temp_id"])
{
case "1":
$at="+3";$mt="-1";$def="-1";
[color=red]$p[pe_at]=$p[pe_at]+3;$p[pe_mt]=$p[pe_mt]-1;$p[pe_def]=$p[pe_def]-1;[/color]
break;
case "2":
$at="-1";$mt="+3";$fi="-1";
[color=red]$p[pe_at]=$p[pe_at]-1;$p[pe_mt]=$p[pe_mt]+3;$p[pe_fi]=$p[pe_fi]-1;[/color]
break;
case "3":
$at="-1";$mt="-1";$def="+3";
[color=red]$p[pe_at]=$p[pe_at]-1;$p[pe_mt]=$p[pe_mt]-1;$p[pe_def]=$p[pe_def]+3;[/color]
break;
case "4":
$fi="+2";$def="-2";
[color=red]$p[pe_fi]=$p[pe_fi]+2;$p[pe_def]=$p[pe_def]-2;[/color]
break;
}
$hu=rand(5,9);
$he=rand(0,3);
$p["pe_he"]=$p["pe_he"]-$he;
if($p["pe_he"] < 0){$p["pe_he"]=0;}
[color=red]if($p["pe_at"] < 0){$p["pe_at"]=0;}
if($p["pe_mt"] < 0){$p["pe_mt"]=0;}
if($p["pe_def"] < 0){$p["pe_def"]=0;}
if($p["pe_fi"] < 0){$p["pe_fi"]=0;}[/color]
$DB_site->query("update wog_pet set [color=red]pe_at=".$p["pe_at"].",pe_mt=".$p["pe_mt"].",pe_def=".$p["pe_def"].",pe_fi=".$p["pe_fi"]."[/color],pe_hu=pe_hu+".$hu.",pe_he=".$p["pe_he"].",pe_dateline=".time()." where pe_p_id=".$user_id." and pe_id=".$_POST["pay_id"]);
if($p)
{
showscript("parent.pet_detail('$at','$mt','$def','+$hu','$fu','-$he','$fi')");
}else
{
alertWindowMsg($lang['wog_act_pet_nopet']);
}
unset($p);
}