開心農場Ver0.2Alpha

提供WOG各方面的技術問題,並提供最新path更新。

版主: 涅魂, 簫哥, 10度C~

aaasss9555
 
文章: 172
註冊時間: 2009-07-30 9:15 pm

開心農場Ver0.2Alpha

文章aaasss9555 » 2013-03-09 11:11 am

作者的話 寫:這是我2~3年前當時開心農場還很紅時寫的,只能說當時程式真的很爛@_@
如果回響大的話,還會繼續維護更新的
目前打算更新的內容:
1.拜訪好友更便利(跟聊天室等結合)
2.指令直接化
3.放蟲
4.偷菜訊息簡化


版本紀錄 寫:
  • 3/9 ver0.1
    Alpha版發布
  • 3/10 ver0.2
    修復了不會減少水量
    修復了不會重置偷菜次數
    新增物品土地契約(安裝步驟)



---------安裝步驟---------
1.在./class新建wog_act_farm.php
代碼: 選擇全部
<?php
class wog_act_farm{

   function farm_index($user_id)
   {
      global $DB_site,$lang;
      $p=$DB_site->query_first("select p_steal,p_earth,f_lv,f_exp,f_nextexp from wog_farm_book  where p_id=".$user_id);

      if(empty($p)){//玩家第一次開農場,初始化資訊
         $DB_site->query("insert into wog_farm_book (p_id)values($user_id)");
         $p=$DB_site->query_first("select p_steal,p_earth,f_lv,f_exp,f_nextexp from wog_farm_book  where p_id=".$user_id);
      }

      if($p[f_exp]>=$p[f_nextexp])//判斷是否升級
      {
         $this->flv_up($user_id,$p);
         $p=$DB_site->query_first("select p_steal,p_earth,f_lv,f_exp,f_nextexp from wog_farm_book  where p_id=".$user_id);
      }
      $DB_site->query("delete from wog_farm_list where ea_water=0");
      $farm=$DB_site->query("Select a.ea_id,a.earth,a.ea_water,a.ea_pest,a.ea_time,b.cr_name,a.ea_amount,b.cr_id From wog_farm_list a left join wog_farm_main b on b.cr_id=a.earth Where a.p_id=".$user_id." ORDER BY ea_id asc");
      $temp_s="";
      while($cds=$DB_site->fetch_array($farm))
      {
         $time=$cds[4]-time();
         $temp_s.=";".$cds[0].",".$cds[1].",".$cds[2].",".$cds[3].",".$time.",".$cds[5].",".$cds[6];
      }
      $DB_site->free_result($farm);
      unset($cds);
      $temp_s=substr($temp_s,1,strlen($temp_s));
      showscript("parent.farm_index('$temp_s','$p[p_earth]','$p[p_steal]','$p[f_lv]','$p[f_exp]','$p[f_nextexp]')");
      unset($temp_s);
   }
   function farm_water($user_id)
   {
      global $DB_site,$_POST,$lang;
      if($_POST[id] != "")
      {
         $f=$DB_site->query_first("select ea_water from wog_farm_list where ea_id=".$_POST[id]." and p_id=".$user_id);
         if($f[ea_water] < 9)
         {
            $DB_site->query("update wog_farm_list set ea_water=ea_water+1 where ea_id=".$_POST[id]);
            showscript("parent.farm_water('$f[ea_water]','$_POST[id]')");
         }else
         {
            alertWindowMsg("在澆下去會泡爛掉");
         }
      }
      else
      {
         alertWindowMsg($lang['wog_act_farm_noselect']);
      }
   }
   function farm_move($user_id)
   {
      global $DB_site,$_POST,$lang;
      if(eregi("[<>'\", ;]", $_POST["pay_id"]))
      {
         alertWindowMsg($lang['wog_act_errword']);
      }
      $sql="select p_id,p_name,p_bag from wog_player where p_name='".htmlspecialchars($_POST["pay_id"])."'";
      $pay_id=$DB_site->query_first($sql);
      if(!$pay_id)
      {
         alertWindowMsg($lang['wog_act_noid']);
      }
      if($pay_id[0]==$user_id)
      {
         alertWindowMsg($lang['wog_act_arm_nomove_me']);
      }
      $farm=$DB_site->query("Select a.ea_id,a.earth,a.ea_water,a.ea_pest,a.ea_time,b.cr_name,a.ea_amount,b.cr_id From wog_farm_list a left join wog_farm_main b on b.cr_id=a.earth Where a.p_id=".$pay_id[0]." ORDER BY ea_id asc");
      $temp_s="";
      while($cds=$DB_site->fetch_array($farm))
      {
         $cds[4]=$cds[4]-time();
         $temp_s.=";".$cds[0].",".$cds[1].",".$cds[2].",".$cds[3].",".$cds[4].",".$cds[5].",".$cds[6];
      }
      $DB_site->free_result($farm);
      unset($cds);
      $temp_s=substr($temp_s,1,strlen($temp_s));
      showscript("parent.farm_friend('$temp_s','$pay_id[1]')");
      unset($temp_s);
   }
   function farm_index2($user_id)
   {
      global $DB_site,$_POST,$lang;
      $crop=$DB_site->query("select a.cr_id,a.cr_name,a.cr_money,a.cr_time,b.d_money,a.cr_lv,a.cr_season,a.cr_time2 from wog_farm_main a,wog_df b where b.d_id=a.cr_df_id order by a.cr_id asc");
      $crop_name="";
      while($cds=$DB_site->fetch_array($crop))
      {
         $crop_name.=";".$cds[0].",".$cds[1].",".$cds[2].",".$cds[3].",".$cds[4].",".$cds[5].",".$cds[6].",".$cds[7];
      }
      $DB_site->free_result($crop);
      unset($cds);
      $crop_name=substr($crop_name,1,strlen($crop_name));
      showscript("parent.farm_index2('$crop_name');");
      unset($crop_name);
   }
   function farm_plant($user_id)
   {
      global $DB_site,$_POST,$lang;
      $sql="select count(ea_id) as num from wog_farm_list where p_id=".$user_id;
      $pack=$DB_site->query_first($sql);
      $p=$DB_site->query_first("select p_earth,f_lv from wog_farm_book where p_id=".$user_id);
      if($pack["num"] >= $p[p_earth])
      {
         alertWindowMsg($lang['wog_act_farm_err']);
      }
      $crop=$DB_site->query_first("select cr_time,cr_amount,cr_money,cr_lv from wog_farm_main where cr_id=".$_POST[id]);
      if($p[f_lv] < $crop[cr_lv])
      {
         alertWindowMsg("農夫等級不足");
      }
      $have_price=$DB_site->query_first("select p_money from wog_player where p_id=".$user_id);
      if($crop[2]>$have_price[0]){
         alertWindowMsg($lang['wog_act_nomoney']);
      }
      $DB_site->query("update wog_player set p_money=p_money-".$crop[2]." where p_id=".$user_id);
      $c[cr_amount]=rand($crop[cr_amount],$crop[cr_amount]+10);
      $time=time()+$crop[cr_time];
      $ea_id=$DB_site->insert_id();
      $DB_site->query("insert into wog_farm_list (ea_id,p_id,earth,ea_water,ea_pest,ea_amount,ea_time,ea_dateline )values($ea_id,$user_id,$_POST[id],10,0,$c[cr_amount],$time,$time)");
      $this->farm_index($user_id);
   }
   function farm_gather($user_id)
   {
      global $DB_site,$_POST,$a_id,$lang,$wog_arry,$wog_item_tool;
      $f=$DB_site->query_first("select earth,ea_time,ea_amount,ea_season from wog_farm_list where ea_id=".$_POST[id]." and p_id=".$user_id);
      if($_POST[id] != "")
      {
         if ($f[ea_time]-time() > 0)
         {
            alertWindowMsg("尚未成熟");
         }
         $c=$DB_site->query_first("select cr_df_id,cr_g_exp,cr_season,cr_time2 from wog_farm_main where cr_id=".$f[earth]);
         check_type($c[cr_df_id]);
         $pack=$DB_site->query_first("select ".$a_id." from wog_item where p_id=".$user_id);
         $pack[0]=trim($pack[0]);
         $temp_pack=array();
         if(!empty($pack[0]))
         {
            $temp_pack=split(",",$pack[0]);
         }         
         $have_price=$DB_site->query_first("select p_bag from wog_player where p_id=".$user_id."");
         $temp_pack=$wog_item_tool->item_in($temp_pack,$c["cr_df_id"],$f["ea_amount"]);
         $bag=$wog_arry["item_limit"]+$have_price["p_bag"];
         if(count($temp_pack) > $bag)
         {
            alertWindowMsg(sprintf($lang['wog_act_buy_tenitem'],$bag));
            unset($temp_pack);
         }
         if($pack)
         {
            $pack[0]=implode(',', $temp_pack);
            $DB_site->query("update wog_item set ".$a_id."='".$pack[0]."' where p_id=".$user_id."");
         }else
         {
            $pack[0]=implode(',', $temp_pack);
            $DB_site->query("insert into wog_item(".$a_id.",p_id)values('".$pack[0]."',".$user_id.")");
         }

         if($f[ea_season] < $c[cr_season])//多季作物
         {
            $time=time()+$c[cr_time2];
            $sql="update wog_farm_list set ea_time=".$time.",ea_season=ea_season+1 where ea_id=".$_POST[id]." and p_id=".$user_id;
            $DB_site->query($sql);
         }else
         {
            $sql="delete from wog_farm_list where ea_id=".$_POST[id]." and p_id=".$user_id;
            $DB_site->query($sql);
         }
         $DB_site->query("update wog_farm_book set f_exp=f_exp+".$c[cr_g_exp]." where p_id=".$user_id);
         $this->farm_index($user_id);
      }else
      {
         alertWindowMsg($lang['wog_act_farm_noselect']);
      }
   }
   function farm_steal($user_id)
   {
      global $DB_site,$_POST,$a_id,$lang,$wog_arry,$wog_item_tool;
      $f=$DB_site->query_first("select earth,ea_time,ea_amount from wog_farm_list where ea_id=".$_POST[id]);
      if(!$_POST[id])
      {
         alertWindowMsg($lang['wog_act_farm_noselect']);
      }
      if ($f[ea_time]-time() > 0)
      {
         alertWindowMsg("尚未成熟");
      }
      $c=$DB_site->query_first("select a.cr_name,a.cr_df_id,a.cr_amount,b.p_steal from wog_farm_main a,wog_farm_book b where a.cr_id=".$f[earth]." and b.p_id=".$user_id);
      $amount=rand(1,5);
      $ea_amount=$f[ea_amount]-$amount;
      if ($ea_amount < round($c[cr_amount]/2))
      {
         alertWindowMsg("別貪心了~這已經夠少了");
      }
      if ($c[p_steal] <= 0)
      {
         alertWindowMsg("今天偷夠多了喔!");
      }
      check_type($c[cr_df_id]);
      $have_price=$DB_site->query_first("select p_bag,p_name from wog_player where p_id=".$user_id);
      $pack=$DB_site->query_first("select ".$a_id." from wog_item where p_id=".$user_id);
      $pack[0]=trim($pack[0]);
      $temp_pack=array();
      if(!empty($pack[0]))
      {
         $temp_pack=split(",",$pack[0]);
      }         
      $temp_pack=$wog_item_tool->item_in($temp_pack,$c["cr_df_id"],$amount);
      $bag=$wog_arry["item_limit"]+$have_price["p_bag"];
      if(count($temp_pack) > $bag)
      {
         alertWindowMsg(sprintf($lang['wog_act_buy_tenitem'],$bag));
         unset($temp_pack);
      }
      if($pack)
      {
         $pack[0]=implode(',', $temp_pack);
         $DB_site->query("update wog_item set ".$a_id."='".$pack[0]."' where p_id=".$user_id."");
      }else
      {
         $pack[0]=implode(',', $temp_pack);
         $DB_site->query("insert into wog_item(".$a_id.",p_id)values('".$pack[0]."',".$user_id.")");
      }
      $sql="select p_id from wog_player where p_name='".htmlspecialchars($_POST["name"])."'";
      $pay_id=$DB_site->query_first($sql);      
      $DB_site->query("update wog_farm_book set p_steal=p_steal-1,f_exp=f_exp+".$amount." where p_id=".$user_id);
      $DB_site->query("update wog_farm_list set ea_amount=".$ea_amount." where ea_id=".$_POST[id]);
      $DB_site->query("insert into wog_message(p_id,title,dateline)values(".$pay_id[p_id].",'".$have_price[p_name]." 從你的菜園偷了 ".$amount." 個 ".$c[cr_name]."',".time().")");
      showscript("parent.farm_steal('$ea_amount','$_POST[id]');parent.farm_steal_alert('$c[cr_name]','$amount')");
   }
   function flv_up($user_id,$p)//升級function
   {
      global $DB_site;
      while($p[f_exp]>=$p[f_nextexp])
      {
         $p[f_lv]+=1;
         $p[f_exp]-=$p[f_nextexp];
         $p[f_nextexp]=round(($p[f_lv]+(($p[f_lv]/3)*2.2))*35);
      }
      if($p[f_exp]<0){$p[f_exp]=0;}
      $DB_site->query("update wog_farm_book set f_lv=".$p[f_lv].",f_exp=".$p[f_exp].",f_nextexp=".$p[f_nextexp]." where p_id=".$user_id);
   }
}
?>



2.在./class/wog_etc_peo.php
搜尋
代碼: 選擇全部
         //寵物飢餓
         $p=$DB_site->query_first("select pe_dateline,pe_he,pe_fu from wog_pet where pe_p_id=$userid and pe_st=0");

前面加上
代碼: 選擇全部
//農作物減少水量
         $f=$DB_site->query_first("select ea_water,ea_dateline from wog_farm_list where p_id=".$userid);
         if($f)
         {
            if($time-$f["ea_dateline"] > $wog_arry["farm_dry_time"]*60*60 )
            {
               $f["ea_water"] -= floor( ($time-$f["ea_dateline"]) / ($wog_arry["farm_dry_time"]*60*60) );
               if($f["ea_water"] < 0){$f["ea_water"]=0;}
               $DB_site->query("update wog_farm_list set ea_dateline=".$time.",ea_water=".$f["ea_water"]." where p_id=".$userid);
            }
         }
         //重置每日可偷菜次數
         $u=$DB_site->query_first("select p_steal,p_update_time from wog_farm_book where p_id=".$userid);
         if($u)
         {
            if ($u[p_update_time] == 0)
            {
               $DB_site->query("update wog_farm_book set p_update_time=".$time." where p_id=".$userid);
            }
            if($time-$u[p_update_time] > 86400 )
            {
               $DB_site->query("update wog_farm_book set p_steal=10,p_update_time=".$time." where p_id=".$userid);
            }
         }



3.在./js新建wog_farm.js
代碼: 選擇全部
function farm_index(a,b,c,d,e,f)
{
   var sum=0;
   w_c('<form action="wog_act.php" method="post" target="mission" name=f2 >');
   w_c(left_table2);
   w_c('<tr><td colspan="2" class="head_td">個人狀態</td></tr>');
   w_c('<tr><td colspan="2">農夫等級: '+d+'</td></tr>');
   w_c('<tr><td colspan="2">熟練度: '+e+'/'+f+'</td></tr>');
   w_c('<tr><td>偷菜: '+c+'</td><td>放蟲: </td></tr>');
   w_c(temp_table2);
   w_c('</form>');
   w_c('<form action="wog_act.php" method="post" target="mission" name=f1 >');
   w_c(right_table2);
   w_c('<tr class="head_td"><td>操作</td><td>作物名稱</td><td>水量</td><td>蟲害</td><td>狀態</td><td>成長時間</td></tr>');
   if (a != "")
   {
      var s1=a.split(";");
      for(var i=0;i<s1.length;i++)
      {
         var s2=s1[i].split(",");
         sum++;
         if (s2[4] <= 0){state= s2[6]+'個';}else{state="成長期";}
         w_c('<tr onMouseOver="this.style.backgroundColor=\'#2B4686\'" onMouseOut="this.style.backgroundColor=\'\'" class=t1 onclick="this.childNodes[0].childNodes[1].checked = true"><td>'+sum+'. <input type="radio" name="id" value="'+s2[0]+'"></td><td>'+s2[5]+'</td><td><span id="'+s2[0]+'">'+s2[2]+'</span>/10</td><td>'+s2[3]+'</td><td>'+state+'</td><td><div id="count_s'+i+'"></div></td></tr>');
         eval("parent.window.clearInterval(job_list.count_s"+i+"_2)");
         creat_job_list("count_s"+i,s2[4]);
      }
   }
   w_c('<tr><td colspan="7"><input type="submit" value="種植" onClick="document.f1.act.value=\'index2\'"> <input type="submit" value="澆水" onClick="document.f1.act.value=\'water\'"> <input type="submit" value="收成" onClick="document.f1.act.value=\'gather\'">('+sum+'/'+b+')</td></tr>');
   w_c('<tr><td colspan="7" >欲拜訪需輸入對方遊戲的帳號 <input type="text" name="pay_id" size="16"> <input type="submit" value="拜訪他" onClick="document.f1.act.value=\'move\'"></td></tr>');
   w_c(temp_table2);
   w_c('<input type="hidden" name="f" value="farm">');
   w_c('<input type="hidden" name="act" value="water">');
   w_c('<input type="hidden" name="sum" value='+sum+'>');
   w_c('</form>');
   p_c();
};
function farm_friend(a,name)
{
   var sum=0;
   w_c('<form action="wog_act.php" method="post" target="mission" name=f1 >');
   w_c(temp_table1);
   w_c('<tr class="head_td"><td>歡迎來到'+name+'的菜園</td></tr>');
   w_c(temp_table2);
   w_c('<br>');
   w_c(temp_table1);
   w_c('<tr class="head_td"><td>操作</td><td>作物名稱</td><td>水量</td><td>蟲害</td><td>狀態</td></tr>');
   if (a != "")
   {
      var s1=a.split(";");
      for(var i=0;i<s1.length;i++)
      {
         var s2=s1[i].split(",");
         sum++;
         if (s2[4] <= 0){state= s2[6]+'個';}else{state="成長期";}
         w_c('<tr onMouseOver="this.style.backgroundColor=\'#2B4686\'" onMouseOut="this.style.backgroundColor=\'\'" class=t1 onclick="this.childNodes[0].childNodes[1].checked = true"><td>'+sum+'. <input type="radio" name="id" value="'+s2[0]+'"></td><td>'+s2[5]+'</td><td>'+s2[2]+'/10</td><td>'+s2[3]+'</td><td><span id="'+s2[0]+'">'+state+'</span></td></tr>');
      }
   }
   w_c('<tr><td colspan="7"><input type="submit" value="偷菜" onClick="document.f1.act.value=\'steal\'"> <input type="submit" value="回家" onClick="document.f1.act.value=\'index\'"></td></tr>');
   w_c('<tr><td colspan="7" >欲拜訪需輸入對方遊戲的帳號 <input type="text" name="pay_id" size="16"> <input type="submit" value="拜訪他" onClick="document.f1.act.value=\'move\'"></td></tr>');
   w_c(temp_table2);
   w_c('<input type="hidden" name="f" value="farm">');
   w_c('<input type="hidden" name="act" value="water">');
   w_c('<input type="hidden" name="name" value='+name+'>');
   w_c('</form>');
   p_c();
};
function farm_steal(a1,a2)
{
   f.getElementById(a2).innerHTML = a1;
};
function farm_water(a1,a2)
{
   f.getElementById(a2).innerHTML = a1;
};
function farm_steal_alert(name,amount)
{
   var temp="";
   temp='<b>'+name+'獲得 '+amount+' 個</b>';
   wog_message_box(temp,0,2);
};
function farm_index2(s)
{
   w_c('<form action="wog_act.php" method="post" target="mission">');
   w_c(temp_table1);
   w_c('<tr class="head_td"><td>選擇</td><td>作物名稱</td><td>類型</td><td>成熟時間</td><td>再成熟時間</td><td>單個收入</td><td>種子售價</td><td>種植等級</td></tr>');
   var s1=s.split(";");
   for(var i=0;i<s1.length;i++)
   {
      var s2=s1[i].split(",");
      s2[3]=s2[3]/3600;
      s2[7]=s2[7]/3600;
      s2[4]=s2[4]/2;
      w_c('<tr onMouseOver="this.style.backgroundColor=\'#2B4686\'" onMouseOut="this.style.backgroundColor=\'\'" class=t1 onclick="this.childNodes[0].childNodes[0].checked = true"><td><input type="radio" name="id" value="'+s2[0]+'"></td><td>'+s2[1]+'</td><td>'+s2[6]+'</td><td>'+s2[3]+'</td><td>'+s2[7]+'</td><td>'+s2[4]+'</td><td>'+s2[2]+'</td><td>'+s2[5]+'</td></tr>');
   }
   w_c('<tr><td colspan="8"><input type="submit" value="確定種植"></td></tr>');
   w_c(temp_table2);
   w_c('<input type="hidden" name="f" value="farm">');
   w_c('<input type="hidden" name="act" value="plant">');
   w_c('</form>');
   p_c();
};



4.開啟./js/wog_shop.js
搜尋
代碼: 選擇全部
<a class="uline" onClick="parent.act_click(\'pet\',\'index\')">【牧場】</a>

後面添加
代碼: 選擇全部
<a class="uline" onClick="parent.act_click(\'farm\',\'index\')">【農場】</a>



5.開啟./index.htm和./index.php
搜尋
代碼: 選擇全部
<script language="JavaScript" src="./js/wog_etc_view.js"></script>

後面添加
代碼: 選擇全部
<script language="JavaScript" src="./js/wog_farm.js"></script>


6.開啟./wog_act.php
搜尋
代碼: 選擇全部
switch ($_POST["f"])
{

後面添加
代碼: 選擇全部
   case "farm":
      include_once("./class/wog_item_tool.php");
      $wog_item_tool = new wog_item_tool;
      include_once("./class/wog_act_farm.php");
      $wog_act_class = new wog_act_farm;
      switch ($_POST["act"])
      {
         case "index":
            $wog_act_class->farm_index($_COOKIE["wog_cookie"]);
         break;
         case "water":
            $wog_act_class->farm_water($_COOKIE["wog_cookie"]);
         break;
         case "move":
            $wog_act_class->farm_move($_COOKIE["wog_cookie"]);
         break;
         case "index2":
            $wog_act_class->farm_index2($_COOKIE["wog_cookie"]);
         break;
         case "plant":
            $wog_act_class->farm_plant($_COOKIE["wog_cookie"]);
         break;
         case "gather":
            $wog_act_class->farm_gather($_COOKIE["wog_cookie"]);
         break;
         case "steal":
            $wog_act_class->farm_steal($_COOKIE["wog_cookie"]);
         break;
      }
   break;



7.在phpmysql新增
代碼: 選擇全部
-- 表的結構 `wog_farm_list`
--

CREATE TABLE IF NOT EXISTS `wog_farm_list` (
  `ea_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `p_id` int(11) unsigned NOT NULL,
  `earth` int(10) unsigned NOT NULL DEFAULT '0',
  `ea_water` int(10) unsigned NOT NULL DEFAULT '0',
  `ea_pest` int(10) unsigned NOT NULL DEFAULT '0',
  `ea_amount` int(10) unsigned NOT NULL DEFAULT '0',
  `ea_season` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `ea_time` int(11) unsigned NOT NULL DEFAULT '0',
  `ea_dateline` int(11) unsigned NOT NULL,
  PRIMARY KEY (`ea_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--

CREATE TABLE IF NOT EXISTS `wog_farm_book` (
  `p_id` int(11) unsigned NOT NULL auto_increment,
  `p_steal` tinyint(3) unsigned NOT NULL default '0',
  `p_earth` tinyint(3) unsigned NOT NULL default '3',
  `f_lv` int(11) unsigned NOT NULL default '1',
  `f_exp` int(11) unsigned NOT NULL default '0',
  `f_nextexp` int(11) unsigned NOT NULL default '30',
  `p_update_time` int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (`p_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3588 ;

--
-- 表的結構 `wog_farm_main`
--

CREATE TABLE IF NOT EXISTS `wog_farm_main` (
  `cr_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `cr_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `cr_amount` int(10) unsigned NOT NULL DEFAULT '0',
  `cr_season` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `cr_money` int(10) unsigned NOT NULL DEFAULT '0',
  `cr_lv` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `cr_g_exp` int(10) unsigned NOT NULL,
  `cr_df_id` int(10) unsigned NOT NULL,
  `cr_time` int(11) unsigned NOT NULL DEFAULT '0',
  `cr_time2` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`cr_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;

--
-- 轉存資料表中的資料 `wog_farm_main`
--

INSERT INTO `wog_farm_main` (`cr_id`, `cr_name`, `cr_amount`, `cr_season`, `cr_money`, `cr_lv`, `cr_g_exp`, `cr_df_id`, `cr_time`, `cr_time2`) VALUES
(1, '白蘿蔔', 36, 1, 200, 1, 40, 5000, 12000, 0),
(2, '紅蘿蔔', 41, 1, 350, 1, 40, 5001, 16000, 0),
(3, '玉米', 42, 1, 500, 1, 40, 5002, 24000, 0),
(4, '馬鈴薯', 48, 1, 650, 1, 40, 5003, 28800, 0),
(5, '茄子', 54, 1, 800, 1, 40, 5004, 36000, 0),
(6, '蕃茄', 35, 2, 950, 5, 45, 5005, 31200, 12000),
(7, '辣椒', 39, 2, 1100, 5, 45, 5006, 36000, 14400),
(8, '南瓜', 36, 2, 1250, 5, 45, 5007, 40800, 14400),
(9, '豌豆', 43, 2, 1400, 5, 45, 5008, 40800, 26600),
(10, '草苺', 31, 3, 1550, 10, 50, 5009, 37200, 14400),
(11, '蘋果', 28, 3, 1800, 10, 50, 5010, 42000, 26600);

INSERT INTO `wog_df` (`d_id`, `d_df`, `d_mdf`, `d_mstr`, `d_magl`, `d_msmart`, `d_mau`, `ch_id`, `d_money`, `d_name`, `d_type`, `d_fie`, `d_at`, `d_mat`, `d_dbst`, `d_g_hp`, `d_g_sp`, `d_g_str`, `d_g_smart`, `d_g_agi`, `d_g_life`, `d_g_vit`, `d_g_au`, `d_g_be`, `d_s`, `d_hole`, `d_plus`, `d_lv`, `skill`, `stime`, `ch_pro`, `d_send`, `d_vip`) VALUES
(5000, 0, 0, 0, 0, 0, 0, 0, 26, '白蘿蔔', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),
(5001, 0, 0, 0, 0, 0, 0, 0, 40, '紅蘿蔔', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),
(5002, 0, 0, 0, 0, 0, 0, 0, 56, '玉米', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),
(5003, 0, 0, 0, 0, 0, 0, 0, 62, '馬鈴薯', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),
(5004, 0, 0, 0, 0, 0, 0, 0, 68, '茄子', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),
(5005, 0, 0, 0, 0, 0, 0, 0, 68, '蕃茄', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),
(5006, 0, 0, 0, 0, 0, 0, 0, 70, '辣椒', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),
(5007, 0, 0, 0, 0, 0, 0, 0, 86, '南瓜', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),
(5008, 0, 0, 0, 0, 0, 0, 0, 80, '豌豆', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),
(5009, 0, 0, 0, 0, 0, 0, 0, 84, '草苺', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),
(5010, 0, 0, 0, 0, 0, 0, 0, 56, '蘋果', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),


瀏覽圖 寫:
farm.png
farm.png (10.56 KiB) 被瀏覽 16728 次




最後由 aaasss9555 於 2013-05-30 10:34 pm 編輯,總共編輯了 6 次。
書本的好壞不在於厚度而是內容;
人生的意義在於內涵而不是長短。


ETERNAL
 
文章: 2937
註冊時間: 2003-12-03 11:08 pm
性別: 男生

Re: 開心農場1.0alpha

文章ETERNAL » 2013-03-10 2:22 pm

我覺得不錯 值得鼓勵 !!!!! :D :D :D


水色論壇 http://www.et99.net
簡恩峻分享

aaasss9555
 
文章: 172
註冊時間: 2009-07-30 9:15 pm

安裝土地契約

文章aaasss9555 » 2013-03-10 8:18 pm

1.開啟./class/wog_act_arm.php
搜尋
代碼: 選擇全部
case 13:
         //使用技能書
            include_once("./class/wog_mission_tool.php");
            $wog_act_class = new wog_mission_tool;
            $wog_act_class->mission_skill($user_id,$used_item["skill_id"]);
            unset($wog_act_class);
            break;

後面添加
代碼: 選擇全部
case 14:
         // 使用土地契約
            $DB_site->query("update wog_farm_book set p_earth=p_earth+".$used_item[d_g_earth]." where p_id=".$user_id);
            $DB_site->query_first("COMMIT");
            showscript("parent.bag_up($used_item[d_g_earth],3)");
            break;

搜尋
代碼: 選擇全部
      $sql="select a.d_lv,a.d_type,a.d_g_exp,a.d_g_bag,a.ch_id,a.use_time,a.exp,a.skill_exp,a.at,a.mat,a.df,a.mdf,a.hp,a.sp,a.skill_id from wog_df_used a where a.d_id=".$item_id;

在a.d_g_bag後面加上
代碼: 選擇全部
,a.d_g_earth


2.開啟./js/wog_item.js
搜尋
代碼: 選擇全部
      case 1:
         temp="道具欄";
      break;
      case 2:
         temp="倉庫";
      break;

後面加上
代碼: 選擇全部
case 3:
         temp="耕地";
      break;



3.在phpmysql新增
代碼: 選擇全部
INSERT INTO `wog_df` (`d_id`, `d_df`, `d_mdf`, `d_mstr`, `d_magl`, `d_msmart`, `d_mau`, `ch_id`, `d_money`, `d_name`, `d_type`, `d_fie`, `d_at`, `d_mat`, `d_dbst`, `d_g_hp`, `d_g_sp`, `d_g_str`, `d_g_smart`, `d_g_agi`, `d_g_life`, `d_g_vit`, `d_g_au`, `d_g_be`, `d_s`, `d_hole`, `d_plus`, `d_lv`, `skill`, `stime`, `ch_pro`, `d_send`, `d_vip`) VALUES
(5100, 0, 0, 0, 0, 0, 0, 0, 10, '1格土地契約', 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),(5101, 0, 0, 0, 0, 0, 0, 0, 10, '2格土地契約', 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0),(5102, 0, 0, 0, 0, 0, 0, 0, 10, '3格土地契約', 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0);

ALTER TABLE `wog_df_used` ADD  `d_g_earth` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `d_g_bag`;

INSERT INTO `wog_df_used` (`d_id`, `d_lv`, `d_type`, `d_g_exp`, `d_g_bag`, `d_g_earth`, `ch_id`, `skill_id`, `use_time`, `exp`, `skill_exp`, `at`, `mat`, `df`, `mdf`, `hp`, `sp`) VALUES
(5100, 0, 14, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),(5101, 0, 14, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),(5102, 0, 14, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);



書本的好壞不在於厚度而是內容;
人生的意義在於內涵而不是長短。


ETERNAL
 
文章: 2937
註冊時間: 2003-12-03 11:08 pm
性別: 男生

Re: 開心農場Ver0.2Alpha

文章ETERNAL » 2013-03-12 11:24 am

這是買格子嗎?
這功能看起來蠻好玩的


水色論壇 http://www.et99.net
簡恩峻分享


回到 Online FF Battle-WOG官方聯盟推廣處

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 3 位訪客

cron