|
@@ -60,10 +60,415 @@ class StoreProc {
|
|
|
return StoreProc::Equip_DownGradingLevel();
|
|
|
case CmdCode::store_equip_downGradingQual: # 6420 降品
|
|
|
return StoreProc::Equip_DownGradingQual();
|
|
|
+
|
|
|
+ case CmdCode::store_pet_removeNewTip: # 6421 移除宠物上的新的标志
|
|
|
+ return StoreProc::Pet_RemoveNewTip();
|
|
|
+ case CmdCode::store_pet_changeFightPosition: # 6422 出战/替换/上阵
|
|
|
+ return StoreProc::Pet_ChangeFightPosition();
|
|
|
+ case CmdCode::store_pet_selectShowPet: # 6423 展示空闲灵宠
|
|
|
+ return StoreProc::Pet_SelectShowPet();
|
|
|
+ case CmdCode::store_pet_levelUpgrade: # 6424 灵宠等级提升
|
|
|
+ return StoreProc::Pet_LevelUpgrade();
|
|
|
+ case CmdCode::store_pet_compose: # 6425 宠物合成
|
|
|
+ return StoreProc::Pet_Compose();
|
|
|
+ case CmdCode::store_pet_onekeyCompose: # 6426 宠物一键合成
|
|
|
+ return StoreProc::Pet_OnekeyCompose();
|
|
|
+ case CmdCode::store_pet_downGradingLevel: # 6427 宠物降级
|
|
|
+ return StoreProc::Pet_DownGradingLevel();
|
|
|
+ case CmdCode::store_pet_downGradingQual: # 6428 宠物降品
|
|
|
+ return StoreProc::Pet_DownGradingQual();
|
|
|
default:
|
|
|
Err(ErrCode::cmd_err);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6428 宠物降品
|
|
|
+ */
|
|
|
+ public static function Pet_DownGradingQual() {
|
|
|
+ list($uid) = req()->paras;
|
|
|
+
|
|
|
+ $petDic = ctx()->store->pet;
|
|
|
+ my_Assert(StlUtil::dictHasProperty($petDic, $uid), ErrCode::user_store_NotExistPet);
|
|
|
+ $ins_pet = new Ins_Pet($petDic->$uid);
|
|
|
+
|
|
|
+ $NotDownGradingList = explode(',', glc()->equipQual_NotDownGrading);
|
|
|
+ my_Assert(!in_array($ins_pet->qual, $NotDownGradingList), ErrCode::user_store_equip_minQual);
|
|
|
+
|
|
|
+ $itemNum = 0;
|
|
|
+ for ($i = 1; $i < $ins_pet->level; $i++) {
|
|
|
+ $mo = GameConfig::pet_levelupgrade_getItem($ins_pet->mo()->rarity, $ins_pet->qual, $i);
|
|
|
+ $itemNum += $mo->costItem;
|
|
|
+ }
|
|
|
+ StoreProc::AddMultiItemInStore(6 . ',' . $itemNum);
|
|
|
+
|
|
|
+ self::ComposeMaterial_Fallback_Pet($ins_pet->mo()->petType, $ins_pet->qual);
|
|
|
+
|
|
|
+ $ins_pet->level = 1;
|
|
|
+ $sList2 = explode(';', glc()->equipQualUnlockSkillId);
|
|
|
+ foreach ($sList2 as $str3) {
|
|
|
+ $s = explode(',', $str3);
|
|
|
+ if (in_array($ins_pet->qual, $s)) {
|
|
|
+ $ins_pet->qual = $s[0];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ctx()->store->pet->$uid = $ins_pet;
|
|
|
+ //FightProc::Ranking_FightPower();
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok(array(
|
|
|
+ //'gold' => ctx()->baseInfo->gold,
|
|
|
+ 'store' => ctx()->store,
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ private static function ComposeMaterial_Fallback_Pet($type, $qual) {
|
|
|
+ $sList2 = explode(';', glc()->equipQualUnlockSkillId);
|
|
|
+ foreach ($sList2 as $str) {
|
|
|
+ $s = explode(',', $str);
|
|
|
+ if (in_array($qual, $s)) {
|
|
|
+ $max = $qual;
|
|
|
+ $min = $s[0];
|
|
|
+ $num = 0;
|
|
|
+ for ($i = $min; $i < $max; $i++) {
|
|
|
+ $mo = GameConfig::pet_compose_getItem($i);
|
|
|
+ $num += explode(',', $mo->compose_condition)[2];
|
|
|
+ }
|
|
|
+
|
|
|
+ $typeId = self::ComposeMaterial($type, $min,902);
|
|
|
+ StoreProc::AddMultiItemInStore($typeId . ',' . $num);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 6427 宠物降级
|
|
|
+ */
|
|
|
+
|
|
|
+ public static function Pet_DownGradingLevel() {
|
|
|
+ list($uid) = req()->paras; //宠物uid
|
|
|
+
|
|
|
+ $petDic = ctx()->store->pet;
|
|
|
+ my_Assert(StlUtil::dictHasProperty($petDic, $uid), ErrCode::user_store_NotExistPet);
|
|
|
+ $ins_pet = new Ins_Pet($petDic->$uid);
|
|
|
+
|
|
|
+ my_Assert($ins_pet->level > 1, ErrCode::user_store_equip_minlevel);
|
|
|
+
|
|
|
+ $itemNum = 0;
|
|
|
+ for ($i = 1; $i < $ins_pet->level; $i++) {
|
|
|
+ $mo = GameConfig::pet_levelupgrade_getItem($ins_pet->mo()->rarity, $ins_pet->qual, $i);
|
|
|
+ $itemNum += $mo->costItem;
|
|
|
+ }
|
|
|
+ StoreProc::AddMultiItemInStore(6 . ',' . $itemNum);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $ins_pet->level = 1;
|
|
|
+ ctx()->store->pet->$uid = $ins_pet;
|
|
|
+
|
|
|
+ //FightProc::Ranking_FightPower();
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok(array(
|
|
|
+ //'gold' => ctx()->baseInfo->gold,
|
|
|
+ 'store' => ctx()->store,
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6426 宠物一键合成
|
|
|
+ * @return type
|
|
|
+ */
|
|
|
+ public static function Pet_OnekeyCompose() {
|
|
|
+ $store = ctx()->store(true);
|
|
|
+ $petDic = $store->pet;
|
|
|
+ $arr = array(); # 待处理装备临时数组
|
|
|
+ $composePet = array(); # 合成记录
|
|
|
+ foreach ($petDic as $pet) {
|
|
|
+ if ($pet->qual < 4) { # 4 品以上的不参与合成
|
|
|
+ $arr[] = new Ins_Pet($pet);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ while (count($arr) > 0) { # 循环处理每一个装备
|
|
|
+ $pet_compose = array_pop($arr); # 从末尾弹出一个元素做合成运算
|
|
|
+ if (null == $pet_compose) { # 防御空对象
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $eqQualCfg = GameConfig::pet_compose_getItem($pet_compose->qual); # 按照品阶查询合成配置数据
|
|
|
+ my_Assert(null != $eqQualCfg, ErrCode::err_const_no); # 防御配置数据错误
|
|
|
+ list($type, $costQual, $num) = explode(',', $eqQualCfg->compose_condition); # 从配置提取合成条件
|
|
|
+ $composeArr = array(); # 消耗集合
|
|
|
+ foreach ($arr as $v) { # 从剩余元素中查找合成所需
|
|
|
+ if ($v->qual == $costQual) { # 同品阶
|
|
|
+ if (($type == 1) ? $v->typeId == $pet_compose->typeId # # type: 1 与本体相同 2 同部位即可
|
|
|
+ : $v->mo()->petType == $pet_compose->mo()->petType) {
|
|
|
+ $composeArr[] = $v; # 成为消耗品
|
|
|
+ }
|
|
|
+ if (count($composeArr) >= $num) { # 达到消耗数量就停
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (count($composeArr) >= $num) { # 合成的回收 不合成的可不能给回收了
|
|
|
+ $uid = $pet_compose->uid;
|
|
|
+ $newPet = self::ComposeNewPet($pet_compose); # 原地合成
|
|
|
+ self::petLevelChange_Material_Recovery($newPet->mo()->rarity, $newPet->qual, $newPet->level); # 回收材料
|
|
|
+ $newPet->level = 1;
|
|
|
+ $petDic->$uid = $newPet;
|
|
|
+
|
|
|
+ $composePet[] = $uid; # 添加合成记录
|
|
|
+ foreach ($composeArr as $val) { # 回收消耗的装备中所含材料
|
|
|
+ self::petLevelChange_Material_Recovery($val->mo()->rarity, $val->qual, $val->level); # 回收材料
|
|
|
+ StlUtil::dictRemove(ctx()->store(true)->pet, $val->uid); # 背包删除
|
|
|
+ if(ctx()->store(true)->petUid_fight_position == $val->uid){
|
|
|
+ ctx()->store(true)->petUid_fight_position = 0;
|
|
|
+ }
|
|
|
+ foreach (ctx()->store(true)->petUids_supportFight_position as $k => $pUid) {
|
|
|
+ if($pUid == $val->uid){
|
|
|
+ StlUtil::dictRemove(ctx()->store(true)->petUids_supportFight_position, $k);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ StlUtil::arrayRemove($arr, $val); # 从arr中删掉已消耗装备
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ UserProc::updateUserInfo(); # 回存玩家数据
|
|
|
+ return Resp::ok(array(# # 返回给客户端的数据
|
|
|
+ 'store' => ctx()->store,
|
|
|
+ 'composeEquip' => $composePet,
|
|
|
+ 'task' => ctx()->task,
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6425 宠物合成
|
|
|
+ * @return Resp
|
|
|
+ */
|
|
|
+ public static function Pet_Compose() {
|
|
|
+ list($uid, $petUids_cost, $composeMaterial_typeIds) = req()->paras;
|
|
|
+
|
|
|
+ $petDic = ctx()->store->pet;
|
|
|
+ my_Assert(StlUtil::dictHasProperty($petDic, $uid), ErrCode::user_store_NotExistPet);
|
|
|
+ $ins_pet = new Ins_Pet($petDic->$uid);
|
|
|
+
|
|
|
+ my_Assert($ins_pet->qual < 11, ErrCode::user_store_equip_qualMaxLimit);
|
|
|
+ $composeMo = GameConfig::pet_compose_getItem($ins_pet->qual);
|
|
|
+ my_Assert(null != $composeMo, ErrCode::err_const_no);
|
|
|
+ $arr = explode(',', $composeMo->compose_condition);
|
|
|
+
|
|
|
+ $type = $arr[0];
|
|
|
+ $costQual = $arr[1];
|
|
|
+ $num = $arr[2];
|
|
|
+
|
|
|
+ $all_num = 0;
|
|
|
+
|
|
|
+ $materialItemType = 0;
|
|
|
+ $materialItemNum = 0;
|
|
|
+ if ($type == 2 && $composeMaterial_typeIds != null) {//部位去校验
|
|
|
+ $str = explode(',', $composeMaterial_typeIds);
|
|
|
+ $materialItemType = $str[0];
|
|
|
+ $materialItemNum = count($str);
|
|
|
+ foreach ($str as $s) {
|
|
|
+ $composeMaterial_itemTypeId = self::ComposeMaterial($ins_pet->mo()->petType, $costQual,902);
|
|
|
+ my_Assert($composeMaterial_itemTypeId == $s, ErrCode::user_store_equip_composeMaterialErr);
|
|
|
+ $all_num += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($petUids_cost != null) {
|
|
|
+ $costPetsArr = explode(',', $petUids_cost);
|
|
|
+ $all_num += count($costPetsArr);
|
|
|
+
|
|
|
+ foreach ($costPetsArr as $pUid) {
|
|
|
+ my_Assert(StlUtil::dictHasProperty($petDic, $pUid), ErrCode::user_store_NotExistPet);
|
|
|
+
|
|
|
+ my_Assert(ctx()->store(true)->petUid_fight_position != $pUid, ErrCode::user_store_NotSelectPet_fight);
|
|
|
+ my_Assert(!in_array($pUid, ctx()->store(true)->petUids_supportFight_position), ErrCode::user_store_NotSelectPet_supportfight);
|
|
|
+
|
|
|
+ $costIns_pet = new Ins_Pet($petDic->$pUid);
|
|
|
+ my_Assert($costIns_pet->qual == $costQual, ErrCode::user_store_equipMaterialQualErr);
|
|
|
+ if ($type == 1) {//本体
|
|
|
+ my_Assert($costIns_pet->typeId == $ins_pet->typeId, ErrCode::user_store_equipMaterialTypeErr);
|
|
|
+ } else {
|
|
|
+ my_Assert($costIns_pet->mo()->petType == $ins_pet->mo()->petType, ErrCode::user_store_equipMaterialTypeErr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ my_Assert($all_num == $num, ErrCode::user_store_equipMaterialNumErr);
|
|
|
+ ctx()->store(true)->pet->$uid = self::ComposeNewPet($ins_pet);
|
|
|
+
|
|
|
+ //消耗的装备 回收
|
|
|
+ if ($petUids_cost != null) {
|
|
|
+ $costPetsArr = explode(',', $petUids_cost);
|
|
|
+ foreach ($costPetsArr as $pUid) {
|
|
|
+ $costIns_Equip = new Ins_Pet($petDic->$pUid);
|
|
|
+ self::petLevelChange_Material_Recovery($costIns_Equip->mo()->rarity, $costIns_Equip->qual, $costIns_Equip->level);
|
|
|
+ StlUtil::dictRemove(ctx()->store(true)->pet, $pUid);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($materialItemType != 0) {
|
|
|
+ ctx()->store(true)->removeItem($materialItemType, $materialItemNum);
|
|
|
+ }
|
|
|
+
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok(array(
|
|
|
+ 'store' => ctx()->store,
|
|
|
+ 'task' => ctx()->task,
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装备等级提升 消耗的金币图纸回收
|
|
|
+ * @param type $rarity
|
|
|
+ * @param type $qual
|
|
|
+ * @param type $posId
|
|
|
+ * @param type $level
|
|
|
+ */
|
|
|
+ public static function petLevelChange_Material_Recovery($rarity, $qual,$level) {
|
|
|
+ $num = 0;
|
|
|
+
|
|
|
+ for ($i = 1; $i <= $level - 1; $i++) {
|
|
|
+ $mo = GameConfig::pet_levelupgrade_getItem($rarity, $qual, $i);
|
|
|
+ $num += $mo->costItem;
|
|
|
+ }
|
|
|
+ if ($num > 0) {
|
|
|
+ StoreProc::AddMultiItemInStore(6 . ',' . $num);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 合成一个新的装备
|
|
|
+ * @param type Ins_Equip
|
|
|
+ */
|
|
|
+ public static function ComposeNewPet(&$ins_pet) {
|
|
|
+ $newPetTypeId = $ins_pet->typeId;
|
|
|
+ $qual = $ins_pet->qual + 1;
|
|
|
+ if ($ins_pet->qual < 4) {
|
|
|
+ //$newEquipTypeId = substr($ins_pet->typeId, 0, strlen($ins_equip->typeId) - 5);
|
|
|
+ $rarity = substr($ins_pet->typeId, -3);
|
|
|
+ $mo = GameConfig::pet_getItem($ins_pet->typeId);
|
|
|
+ $newPetTypeId = $mo->type. "0" . $qual . $rarity;
|
|
|
+ }
|
|
|
+
|
|
|
+ $ins_pet->typeId = $newPetTypeId;
|
|
|
+ $ins_pet->qual = $qual;
|
|
|
+
|
|
|
+ return $ins_pet;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ *6424 灵宠等级提升
|
|
|
+ * @return Resp
|
|
|
+ */
|
|
|
+ public static function Pet_LevelUpgrade(){
|
|
|
+ list($uid) = req()->paras; //装备uid
|
|
|
+
|
|
|
+ my_Assert(StlUtil::dictHasProperty(ctx()->store->pet, $uid), ErrCode::user_store_NotExistPet);
|
|
|
+ $ins_pet = new Ins_Pet(ctx()->store->pet->$uid);
|
|
|
+ my_Assert($ins_pet->level < $ins_pet->Pet_MaxLevel(), ErrCode::user_store_LevelLimit);
|
|
|
+
|
|
|
+ $mo = $ins_pet->petLevelMo();
|
|
|
+
|
|
|
+ $costTuzhiId = 6;
|
|
|
+ $tuzhiNum = 0;
|
|
|
+ if (StlUtil::dictHasProperty(ctx()->store->items, $costTuzhiId)) {
|
|
|
+ $tuzhiNum = ctx()->store->items->$costTuzhiId;
|
|
|
+ }
|
|
|
+ my_Assert($tuzhiNum >= $mo->costItem, ErrCode::notenough_item);
|
|
|
+
|
|
|
+ ctx()->store(true)->removeItem($costTuzhiId,$mo->costItem);
|
|
|
+
|
|
|
+ $ins_pet->level += 1;
|
|
|
+ ctx()->store->pet->$uid = $ins_pet;
|
|
|
+
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok(array(
|
|
|
+ 'store' => ctx()->store,
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6423 展示空闲灵宠
|
|
|
+ * @return Resp
|
|
|
+ */
|
|
|
+ public static function Pet_SelectShowPet(){
|
|
|
+ list($uid) = req()->paras;
|
|
|
+
|
|
|
+ $petDic = ctx()->store->pet;
|
|
|
+ my_Assert(StlUtil::dictHasProperty($petDic, $uid), ErrCode::user_store_NotExistPet);
|
|
|
+
|
|
|
+ my_Assert(count(ctx()->store()->mainShowPetList)< GameConfig::glc2()->Pet_MainShowPetList , ErrCode::user_store_ShowPetNumLimit);
|
|
|
+
|
|
|
+ my_Assert(ctx()->store->petUid_fight_position != $uid, ErrCode::user_store_NotSelectPet_fight);
|
|
|
+ my_Assert(!in_array($uid, ctx()->store->petUids_supportFight_position), ErrCode::user_store_NotSelectPet_supportfight);
|
|
|
+
|
|
|
+ if(in_array($uid,ctx()->store()->mainShowPetList)){
|
|
|
+ StlUtil::arrayRemove(ctx()->store()->mainShowPetList, $uid);
|
|
|
+ } else {
|
|
|
+ ctx()->store()->mainShowPetList[] = $uid;
|
|
|
+ }
|
|
|
+
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok(array());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6422 出战/替换/上阵
|
|
|
+ */
|
|
|
+ public static function Pet_ChangeFightPosition() {
|
|
|
+ list($type, $uid, $index) = req()->paras;
|
|
|
+
|
|
|
+ if ($type == 1) {//出战、替换
|
|
|
+ ctx()->store(true)->petUid_fight_position = $uid;
|
|
|
+ } else if ($type == 2) {
|
|
|
+ ctx()->store(true)->petUids_supportFight_position->$index = $uid;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($type == 0 && $index == 0 && $uid != 0) {//上阵点击空白的地方
|
|
|
+ if (ctx()->store(true)->petUid_fight_position == 0) {
|
|
|
+ ctx()->store(true)->petUid_fight_position = $uid;
|
|
|
+ } else {
|
|
|
+ if (count(StlUtil::dictToArray(ctx()->store(true)->petUids_supportFight_position)) == 0) {
|
|
|
+ $key = 1;
|
|
|
+ ctx()->store(true)->petUids_supportFight_position->$key = $uid;
|
|
|
+ } else {
|
|
|
+ for ($i = 1; $i <= 2; $i++) {
|
|
|
+ if (!StlUtil::dictHasProperty(ctx()->store(true)->petUids_supportFight_position, $i) || ctx()->store(true)->petUids_supportFight_position->$i == 0) {
|
|
|
+ ctx()->store(true)->petUids_supportFight_position->$i = $uid;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok(array());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6421 移除宠物上的新的标志
|
|
|
+ */
|
|
|
+ public static function Pet_RemoveNewTip() {
|
|
|
+ list($uid) = req()->paras;
|
|
|
+
|
|
|
+ $petDic = ctx()->store->pet;
|
|
|
+ my_Assert(StlUtil::dictHasProperty($petDic, $uid), ErrCode::user_store_NotExistPet);
|
|
|
+
|
|
|
+ ctx()->store->pet->$uid->isNew = 0;
|
|
|
+
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok(array());
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 6420 降品
|
|
@@ -120,10 +525,10 @@ class StoreProc {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static function ComposeMaterial($posId, $qual) {
|
|
|
+ private static function ComposeMaterial($posId, $qual,$type = 901) {
|
|
|
$itemDic = GameConfig::item();
|
|
|
foreach ($itemDic as $typeId => $mo) {
|
|
|
- if ($mo->itemType == 901 && $typeId % 100 == $posId && floor($typeId / 100) % 100 == $qual) {
|
|
|
+ if ($mo->itemType == $type && $typeId % 100 == $posId && floor($typeId / 100) % 100 == $qual) {
|
|
|
return $typeId;
|
|
|
}
|
|
|
}
|
|
@@ -162,7 +567,7 @@ class StoreProc {
|
|
|
|
|
|
$ins_equip->level = 1;
|
|
|
ctx()->store->equip->$uid = $ins_equip;
|
|
|
-
|
|
|
+
|
|
|
FightProc::Ranking_FightPower();
|
|
|
UserProc::updateUserInfo();
|
|
|
return Resp::ok(array(
|
|
@@ -182,7 +587,7 @@ class StoreProc {
|
|
|
my_Assert(StlUtil::dictHasProperty($equipDic, $uid), ErrCode::user_store_NotExistEquip);
|
|
|
$ins_equip = new Ins_Equip($equipDic->$uid);
|
|
|
|
|
|
- my_Assert($ins_equip->qual<16, ErrCode::user_store_equip_qualMaxLimit);
|
|
|
+ my_Assert($ins_equip->qual < 16, ErrCode::user_store_equip_qualMaxLimit);
|
|
|
$composeMo = GameConfig::equip_compose_getItem($ins_equip->qual);
|
|
|
my_Assert(null != $composeMo, ErrCode::err_const_no);
|
|
|
$arr = explode(',', $composeMo->compose_condition);
|
|
@@ -246,7 +651,7 @@ class StoreProc {
|
|
|
|
|
|
TaskProc::OnEquipComposeNum();
|
|
|
FightProc::Ranking_FightPower();
|
|
|
-
|
|
|
+
|
|
|
UserProc::updateUserInfo();
|
|
|
return Resp::ok(array(
|
|
|
'gold' => ctx()->baseInfo->gold,
|
|
@@ -343,7 +748,12 @@ class StoreProc {
|
|
|
}
|
|
|
if (count($composeArr) >= $num) { # 合成的回收 不合成的可不能给回收了
|
|
|
$uid = $equip_compose->uid;
|
|
|
- $equipDic->$uid = self::ComposeNewEquip($equip_compose); # 原地合成
|
|
|
+ $newEquip = self::ComposeNewEquip($equip_compose); # 原地合成
|
|
|
+ self::equipLevelUp_Material_Recovery($newEquip->mo()->rarity, $newEquip->qual, $newEquip->mo()->position, $newEquip->level); # 回收材料
|
|
|
+ $newEquip->level = 1;
|
|
|
+ $equipDic->$uid = $newEquip;
|
|
|
+
|
|
|
+
|
|
|
$composeEquip[] = $uid; # 添加合成记录
|
|
|
foreach ($composeArr as $val) { # 回收消耗的装备中所含材料
|
|
|
self::equipLevelUp_Material_Recovery($val->mo()->rarity, $val->qual, $val->mo()->position, $val->level); # 回收材料
|
|
@@ -357,7 +767,7 @@ class StoreProc {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
TaskProc::OnEquipComposeNum();
|
|
|
FightProc::Ranking_FightPower();
|
|
|
UserProc::updateUserInfo(); # 回存玩家数据
|
|
@@ -513,7 +923,7 @@ class StoreProc {
|
|
|
$posId = $ins_equip->mo()->position;
|
|
|
ctx()->store(true)->equipLocation->$posId = $uid;
|
|
|
FightProc::Ranking_FightPower();
|
|
|
-
|
|
|
+
|
|
|
GuideProc::GateFight_Guide_Trigger();
|
|
|
UserProc::updateUserInfo();
|
|
|
return Resp::ok(array());
|
|
@@ -1013,7 +1423,7 @@ class StoreProc {
|
|
|
|
|
|
my_Assert(StlUtil::dictHasProperty(ctx()->store->equip, $uid), ErrCode::user_store_NoEquip);
|
|
|
$ins_equip = new Ins_Equip(ctx()->store->equip->$uid);
|
|
|
- my_Assert($ins_equip->level < $ins_equip->Equip_MaxLevel(), ErrCode::user_store_equipLevelLimit);
|
|
|
+ my_Assert($ins_equip->level < $ins_equip->Equip_MaxLevel(), ErrCode::user_store_LevelLimit);
|
|
|
|
|
|
$mo = GameConfig::equip_levelupgrade_getItem($ins_equip->mo()->rarity, $ins_equip->qual, $ins_equip->mo()->position, $ins_equip->level);
|
|
|
my_Assert(null != $mo, ErrCode::err_const_no);
|
|
@@ -1055,7 +1465,7 @@ class StoreProc {
|
|
|
my_Assert(StlUtil::dictHasProperty(ctx()->store->equip, $uid), ErrCode::user_store_NoEquip);
|
|
|
$ins_equip = new Ins_Equip(ctx()->store->equip->$uid);
|
|
|
$maxLevel = $ins_equip->Equip_MaxLevel();
|
|
|
- my_Assert($ins_equip->level < $ins_equip->Equip_MaxLevel(), ErrCode::user_store_equipLevelLimit);
|
|
|
+ my_Assert($ins_equip->level < $ins_equip->Equip_MaxLevel(), ErrCode::user_store_LevelLimit);
|
|
|
|
|
|
$tuzhiId = GameConfig::equip_position_getItem($ins_equip->mo()->position)->costTuzhiId;
|
|
|
$itemNum_store = 0;
|
|
@@ -1084,10 +1494,10 @@ class StoreProc {
|
|
|
$up_lv = $i;
|
|
|
if (ctx()->baseInfo->gold >= $up_Gold && $itemNum_store >= $up_needItem) {
|
|
|
$need_gold = $up_Gold;
|
|
|
- $need_item = $up_needItem;
|
|
|
+ $need_item = $up_needItem;
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -1209,10 +1619,10 @@ class StoreProc {
|
|
|
//self::PutEquipInStore($itemId, $num);
|
|
|
for ($i = 0; $i < $num; $i++) {
|
|
|
FightProc::funUnlock_equip_firstTime();
|
|
|
-
|
|
|
+
|
|
|
$equip = self::initEquip($itemId);
|
|
|
$uid = $equip->uid;
|
|
|
- ctx()->store(true)->equip->$uid = $equip;
|
|
|
+ ctx()->store(true)->equip->$uid = $equip;
|
|
|
self::$reward_equip[] = $uid;
|
|
|
}
|
|
|
break;
|