本帖最后由 电脑神童 于 2009-12-16 11:02 编辑
推广: http://www.vavay.com
话说在前头, 这不是傻瓜教学, 不适合没有基础的同学观看, 本修改适合所有版本, 只要你会对照着改. 表达能力差, 看不懂不要骂我, 该修改的程序段都已经写出, 谢谢...
现在开始狗粮购买
1. 首先添加狗粮到商店道具购买参数里
查找位于文件头部的:在数组的末尾添加- ,
- "501" => array(
- "tId" => 501,
- "tName" => "\\u72D7\\u7CAE",
- "list" => array(
- "1" => array( "price" => 200, "FBPrice" => 0 ),
- "10" => array( "price" => 1200, "FBPrice" => 0 ),
- "100" => array( "price" => 9999, "FBPrice" => 0 )
- ),
- "timeLimit" => "0",
- "effect" => "0",
- "depict" => "\\u4EBA\\u4E0D\\u5403\\u996D\\u662F\\u4E0D\\u884C\\u7684\\uFF0C\\u66F4\\u4F55\\u51B5\\u662F\\u72D7",
- "type" => 3
- )
复制代码 2. 添加狗粮到商店道具(道具不显示, 只能在兑换里显示, 这个我不知道什么原因)
查找商店内容返回段:- if ( $_REQUEST['mod'] == "shop" && $_REQUEST['act'] == "getShopInfo" )
复制代码 再在下面的 3,4 段里找:在前面添加狗粮信息:- ,{"tId":501,"tName":"\\u72D7\\u7CAE","list":{"1":{"price":200,"FBPrice":0},"10":{"price":1200,"FBPrice":0},"100":{"price":9999,"FBPrice":0}},"timeLimit":"0","effect":"3","depict":"\\u4EBA\\u4E0D\\u5403\\u996D\\u662F\\u4E0D\\u884C\\u7684\\uFF0C\\u66F4\\u4F55\\u51B5\\u662F\\u72D7","type":3}
复制代码 3. 价格什么的你们都会改, 我就不说什么了, 到此狗粮添加完毕
-----------------------------------------------------------
修复兑换里, 购买神秘种子的随机项, 此前你们说一直种不出其他的东西, 是因为用FB兑换只能出固定的2001号作物, 这里加了程序段专门服务购买神秘种子.
查找:- if ( $_REQUEST['mod'] == "shop" && $_REQUEST['act'] == "buy" && $_REQUEST['type'] == "1" )
复制代码 在上面添加(一定要上面, 否则就被下面的程序先执行了:- if ( $_REQUEST['mod'] == "shop" && $_REQUEST['act'] == "buy" && $_REQUEST['type'] == "1" && $_REQUEST['id'] == "2001")
- {
- $query = $_SGLOBAL['db']->query( "SELECT money,fb,package FROM ".tname( "plug_newfarm" )." where uid=".$_SGLOBAL['supe_uid'] );
- while ( $value = $_SGLOBAL['db']->fetch_array( $query ) )
- {
- $list[] = $value;
- }
- $toyid = mt_rand( 2001, 2003 );
- $_price = array(
- "money" => array(1 => 0, 10 => 0, 100 => 0),
- "fb" => array(1 => 3, 10 => 27, 100 => 240),
- );
- $_money = $_price['money'][1] * $_REQUEST['number'];
- $_fb = $_price['fb'][1] * $_REQUEST['number'];
- if ( $_REQUEST['number'] == 10 )
- {
- $_money = $_price['money'][10];
- $_fb = $_price['fb'][100];
- }
- if ( $_REQUEST['number'] == 100 )
- {
- $_money = $_price['money'][10];
- $_fb = $_price['fb'][100];
- }
- if ( $list[0][money] < $_money || $list[0][fb] < $_fb)
- {
- exit();
- }
-
- $package = json_decode( $list[0][package] );
- $package->$toyid = $package->$toyid + $_REQUEST['number'];
- $package = json_encode( $package );
- $_SGLOBAL['db']->query( "UPDATE ".tname( "plug_newfarm" )." set money=money-".$_money.", fb=fb-".$_fb.",package='".$package."' where uid=".$_SGLOBAL['supe_uid'] );
- echo "{"code":1,"cId":".$toyid.","cName":"".$crops[$toyid][cName]."","num":".$_REQUEST['number'].","money":-".$_money.","FB":-".$_fb."}";
- $sql = "INSERT INTO ".tname( "plug_newfarm_logs" )." (`uid`, `type`, `count`, `fromid`, `time`, `cropid`, `isread` ) VALUES (".$_SGLOBAL['supe_uid'].", 7, ".$_REQUEST['number'].", ".$_SGLOBAL['supe_uid'].", ".$_SGLOBAL['timestamp'].", ".$toyid.", 0);";
- $_SGLOBAL['db']->query( $sql );
- exit( );
- }
复制代码 为了修改方便, 我把价格直接定死在里面, 也懒得改其他地方了.
-----------------------------------------------------------
修复好友显示缺失的"魅力"显示(此前版本一直显示0)
查找:- if ( $_REQUEST['mod'] == "friend" )
复制代码 在下面的第一条SQL语句里加上字段: charm
找稍微下面一点查找
推广: http://www.vavay.com
现在开始狗粮购买
1. 首先添加狗粮到商店道具购买参数里
查找位于文件头部的:在数组的末尾添加- ,
- "501" => array(
- "tId" => 501,
- "tName" => "\\u72D7\\u7CAE",
- "list" => array(
- "1" => array( "price" => 200, "FBPrice" => 0 ),
- "10" => array( "price" => 1200, "FBPrice" => 0 ),
- "100" => array( "price" => 9999, "FBPrice" => 0 )
- ),
- "timeLimit" => "0",
- "effect" => "0",
- "depict" => "\\u4EBA\\u4E0D\\u5403\\u996D\\u662F\\u4E0D\\u884C\\u7684\\uFF0C\\u66F4\\u4F55\\u51B5\\u662F\\u72D7",
- "type" => 3
- )
复制代码 2. 添加狗粮到商店道具(道具不显示, 只能在兑换里显示, 这个我不知道什么原因)
查找商店内容返回段:- if ( $_REQUEST['mod'] == "shop" && $_REQUEST['act'] == "getShopInfo" )
复制代码 再在下面的 3,4 段里找:在前面添加狗粮信息:- ,{"tId":501,"tName":"\\u72D7\\u7CAE","list":{"1":{"price":200,"FBPrice":0},"10":{"price":1200,"FBPrice":0},"100":{"price":9999,"FBPrice":0}},"timeLimit":"0","effect":"3","depict":"\\u4EBA\\u4E0D\\u5403\\u996D\\u662F\\u4E0D\\u884C\\u7684\\uFF0C\\u66F4\\u4F55\\u51B5\\u662F\\u72D7","type":3}
复制代码 3. 价格什么的你们都会改, 我就不说什么了, 到此狗粮添加完毕
-----------------------------------------------------------
修复兑换里, 购买神秘种子的随机项, 此前你们说一直种不出其他的东西, 是因为用FB兑换只能出固定的2001号作物, 这里加了程序段专门服务购买神秘种子.
查找:- if ( $_REQUEST['mod'] == "shop" && $_REQUEST['act'] == "buy" && $_REQUEST['type'] == "1" )
复制代码 在上面添加(一定要上面, 否则就被下面的程序先执行了:- if ( $_REQUEST['mod'] == "shop" && $_REQUEST['act'] == "buy" && $_REQUEST['type'] == "1" && $_REQUEST['id'] == "2001")
- {
- $query = $_SGLOBAL['db']->query( "SELECT money,fb,package FROM ".tname( "plug_newfarm" )." where uid=".$_SGLOBAL['supe_uid'] );
- while ( $value = $_SGLOBAL['db']->fetch_array( $query ) )
- {
- $list[] = $value;
- }
- $toyid = mt_rand( 2001, 2003 );
- $_price = array(
- "money" => array(1 => 0, 10 => 0, 100 => 0),
- "fb" => array(1 => 3, 10 => 27, 100 => 240),
- );
- $_money = $_price['money'][1] * $_REQUEST['number'];
- $_fb = $_price['fb'][1] * $_REQUEST['number'];
- if ( $_REQUEST['number'] == 10 )
- {
- $_money = $_price['money'][10];
- $_fb = $_price['fb'][100];
- }
- if ( $_REQUEST['number'] == 100 )
- {
- $_money = $_price['money'][10];
- $_fb = $_price['fb'][100];
- }
- if ( $list[0][money] < $_money || $list[0][fb] < $_fb)
- {
- exit();
- }
-
- $package = json_decode( $list[0][package] );
- $package->$toyid = $package->$toyid + $_REQUEST['number'];
- $package = json_encode( $package );
- $_SGLOBAL['db']->query( "UPDATE ".tname( "plug_newfarm" )." set money=money-".$_money.", fb=fb-".$_fb.",package='".$package."' where uid=".$_SGLOBAL['supe_uid'] );
- echo "{"code":1,"cId":".$toyid.","cName":"".$crops[$toyid][cName]."","num":".$_REQUEST['number'].","money":-".$_money.","FB":-".$_fb."}";
- $sql = "INSERT INTO ".tname( "plug_newfarm_logs" )." (`uid`, `type`, `count`, `fromid`, `time`, `cropid`, `isread` ) VALUES (".$_SGLOBAL['supe_uid'].", 7, ".$_REQUEST['number'].", ".$_SGLOBAL['supe_uid'].", ".$_SGLOBAL['timestamp'].", ".$_REQUEST['id'].", 0);";
- $_SGLOBAL['db']->query( $sql );
- exit( );
- }
复制代码 为了修改方便, 我把价格直接定死在里面, 也懒得改其他地方了.
-----------------------------------------------------------
修复好友显示缺失的"魅力"显示(此前版本一直显示0)
查找:- if ( $_REQUEST['mod'] == "friend" )
复制代码 在下面的第一条SQL语句里加上字段: charm
找稍微下面一点查找在末尾的- ,"money":".$value[money]."}";
复制代码 前面添加- ,"charm":".$value[charm]."
复制代码 完成....... |