if ( $taskid == 2 )
{
$fertilizer = $_SGLOBAL['db']->result( $_SGLOBAL['db']-
>query( "SELECT fertilizer FROM ".tname( "plug_newfarm" )." where uid=".$_SGLOBAL['supe_uid'] ), 0 );
$fertilizer = json_decode( $fertilizer );
$putonghuafei = 2;
$fertilizer->$putonghuafei = $fertilizer->$putonghuafei + 2;
$fertilizer = json_encode( $fertilizer );
$_SGLOBAL['db']->query( "UPDATE ".tname( "plug_newfarm" )."
set fertilizer='".$fertilizer."',exp=exp+100,money=money+100,taskid=taskid+1 where uid=".$_SGLOBAL['supe_uid'] );
echo "{\"eDesc\":\"恭喜您完成任务,获得100个经验和100个金币
\",\"item\":[{\"eType\":7,\"eParam\":0,\"eNum\":100},{\"eType\":6,\"eParam\":0,\"eNum\":100}],\"levelUp\":{\"title\":\"升级奖
励\",\"eDesc\":\"这么快就升级到1级了啊?真是神速,奖励你两袋普通化肥,快到背包里看看吧。\",\"item\":[{\"eType\":\"3
\",\"eParam\":\"1\",\"eNum\":\"2\",\"name\":\"普通化肥\"}],\"level\":1},\"task\":{\"taskId\":2,\"taskFlag\":2}}";
}
以上这是升级到1的时候奖励2把化肥。上面以有人将原来的2包普通化肥改成了高级化肥 。求具体设置。。我想在升级的时候都奖励玩家一些种子。! |