|
@@ -67,16 +67,20 @@ class StoreProc {
|
|
|
|
|
|
$arr = explode(';', glc()->XILianGemlNeedXILianStone);
|
|
$arr = explode(';', glc()->XILianGemlNeedXILianStone);
|
|
$needStone = 0;
|
|
$needStone = 0;
|
|
|
|
+ $xilianStoneId = 0;
|
|
foreach ($arr as $val) {
|
|
foreach ($arr as $val) {
|
|
$str = explode(':', $val);
|
|
$str = explode(':', $val);
|
|
if ($str[0] == $gem->mo()->qual) {
|
|
if ($str[0] == $gem->mo()->qual) {
|
|
- $needStone = $str[1];
|
|
|
|
|
|
+ $s = explode(',', $str[1]);
|
|
|
|
+
|
|
|
|
+ $needStone = $s[1];
|
|
|
|
+ $xilianStoneId = $s[0];
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- my_Assert(ctx()->baseInfo->xilianStone >= $needStone, ErrCode::user_store_XilianStoneNoEnough);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ my_Assert(StlUtil::dictHasProperty(ctx()->store->items,$xilianStoneId) && ctx()->store->items->$xilianStoneId >= $needStone, ErrCode::user_store_XilianStoneNoEnough);
|
|
|
|
+
|
|
$dic = GameConfig::predicate();
|
|
$dic = GameConfig::predicate();
|
|
$pList = array();
|
|
$pList = array();
|
|
foreach ($dic as $id => $pMo) {
|
|
foreach ($dic as $id => $pMo) {
|
|
@@ -92,11 +96,11 @@ class StoreProc {
|
|
$pId = $pList[$rand];
|
|
$pId = $pList[$rand];
|
|
ctx()->store->gemStore->$uid->predicateId = $pId;
|
|
ctx()->store->gemStore->$uid->predicateId = $pId;
|
|
|
|
|
|
- ctx()->baseInfo->xilianStone -= $needStone;
|
|
|
|
|
|
+ ctx()->store->items->$xilianStoneId -= $needStone;
|
|
|
|
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
return Resp::ok(array(
|
|
return Resp::ok(array(
|
|
- 'xilianStone' => ctx()->baseInfo->xilianStone,
|
|
|
|
|
|
+ 'items' => ctx()->store->items,
|
|
'predicateId' => $pId,
|
|
'predicateId' => $pId,
|
|
));
|
|
));
|
|
}
|
|
}
|