|
@@ -959,7 +959,7 @@ class HeroProc {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 升星
|
|
|
|
|
|
+ * 言灵升星
|
|
* @param req $req
|
|
* @param req $req
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
@@ -1013,6 +1013,39 @@ class HeroProc {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 言灵升级
|
|
|
|
+ * @param req $req
|
|
|
|
+ */
|
|
|
|
+ static function YanlinUpLevel($req) {
|
|
|
|
+ list($yanlingUid,$type) = $req->paras;
|
|
|
|
+ $store = $req->userInfo->game->store;
|
|
|
|
+ if(!StlUtil::dictHasProperty($store->yanling,$yanlingUid)){
|
|
|
|
+ return Resp::err(ErrCode::hero_yanling_notfound);
|
|
|
|
+ }
|
|
|
|
+ $curlv = $store->yanling->$yanlingUid->level;
|
|
|
|
+ $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]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $store->yanling->$yanlingUid->level += $type;
|
|
|
|
+ $req->userInfo->game->store = $store;
|
|
|
|
+
|
|
|
|
+ UserProc::updateUserInfo();
|
|
|
|
+ return Resp::ok(array('store' => $req->userInfo->game->store,'gold'=>$req->userInfo->game->baseInfo->gold,'resPoint'=>$req->userInfo->game->baseInfo->resPoint));
|
|
|
|
+ }
|
|
//
|
|
//
|
|
// <editor-fold defaultstate="collapsed" desc="计算战队战斗力, for pvp back matchers, -wg 2017.07.13">
|
|
// <editor-fold defaultstate="collapsed" desc="计算战队战斗力, for pvp back matchers, -wg 2017.07.13">
|
|
|
|
|