|
@@ -1046,20 +1046,11 @@ class HeroProc {
|
|
|
return Resp::err(ErrCode::hero_yanling_levelMax);
|
|
|
}
|
|
|
|
|
|
- $maxLv = $curlv + $type;
|
|
|
-
|
|
|
-// for ($index = $curlv; $index < $maxLv; $index++) {
|
|
|
-// $mo = GameConfig::yanlingLeve_getItem($index);
|
|
|
-// $costList = explode(';', $mo->cost);
|
|
|
-// foreach ($costList as $item) {
|
|
|
-// $list = explode(',', $item);
|
|
|
-// if ($list[0] == META_GOLD_ITEMID) {//扣金币
|
|
|
-// Data_UserGame::Consume_Gold($req->userInfo->game->baseInfo, $list[1]);
|
|
|
-// } elseif ($list[0] == META_RESPOINT_ITEMID) {//扣除资源点
|
|
|
-// Data_UserGame::Consume_ResPoint($req->userInfo->game->baseInfo, $list[1]);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
+ $maxLv = $curlv + $type;
|
|
|
+ if($maxLv > $maxLevel ){
|
|
|
+ $maxLv = $maxLevel;
|
|
|
+ }
|
|
|
+
|
|
|
$goldNum = 0;
|
|
|
$pointNum = 0;
|
|
|
for ($index = $curlv; $index < $maxLv; $index++) {
|
|
@@ -1067,17 +1058,20 @@ class HeroProc {
|
|
|
return Resp::err(ErrCode::hero_yanling_levelconst_no);
|
|
|
}
|
|
|
$mo = GameConfig::yanlingLeve_getItem($index);
|
|
|
- $cost = '1,'.$mo->goldCost.';'. '8,'.$mo->pointCost;
|
|
|
+ //$cost = '1,'.$mo->goldCost.';'. '8,'.$mo->pointCost;
|
|
|
|
|
|
- $costList = explode(';',$cost);
|
|
|
- foreach ($costList as $item) {
|
|
|
- $list = explode(',', $item);
|
|
|
- if($list[0] == META_GOLD_ITEMID){//扣金币
|
|
|
- $goldNum += $list[1];
|
|
|
- } elseif ($list[0] == META_RESPOINT_ITEMID) {//扣除资源点
|
|
|
- $pointNum += $list[1];
|
|
|
- }
|
|
|
- }
|
|
|
+ $goldNum += $mo->goldCost;
|
|
|
+ $pointNum += $mo->pointCost;
|
|
|
+
|
|
|
+// $costList = explode(';',$cost);
|
|
|
+// foreach ($costList as $item) {
|
|
|
+// $list = explode(',', $item);
|
|
|
+// if($list[0] == META_GOLD_ITEMID){//扣金币
|
|
|
+// $goldNum += $list[1];
|
|
|
+// } elseif ($list[0] == META_RESPOINT_ITEMID) {//扣除资源点
|
|
|
+// $pointNum += $list[1];
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
if($req->userInfo->game->baseInfo->gold < $goldNum){
|
|
@@ -1091,6 +1085,10 @@ class HeroProc {
|
|
|
Data_UserGame::Consume_ResPoint($req->userInfo->game->baseInfo, $pointNum);
|
|
|
|
|
|
$store->yanling->$yanlingUid->level += $type;
|
|
|
+ if($store->yanling->$yanlingUid->level > $maxLevel){
|
|
|
+ $store->yanling->$yanlingUid->level = $maxLevel;
|
|
|
+ }
|
|
|
+
|
|
|
$req->userInfo->game->store = $store;
|
|
|
|
|
|
UserProc::updateUserInfo();
|