Save_EquipItem_SlotLvUp
This commit is contained in:
parent
e8c9ef365f
commit
06b3622387
|
|
@ -1249,6 +1249,41 @@ handlers.Save_Equipment_Decomposition = function(args)
|
|||
Set_JsonUserData(urod);
|
||||
return Get_Return(0);
|
||||
}
|
||||
handlers.Save_EquipItem_SlotLvUp = function(args)
|
||||
{
|
||||
var readonlydata = Get_UserReadOnlyData();
|
||||
var error = Get_Error(readonlydata, args.Token);
|
||||
if (error < 0) return Get_Return(error);
|
||||
|
||||
if (args.Count <= 0) return Get_Return(1);
|
||||
|
||||
var urod = Get_JsonUserData(readonlydata);
|
||||
|
||||
var itemtable = Get_ItemTable();
|
||||
var itemdata = itemtable.find(f=>f.n_ItemID == args.ItemID);
|
||||
if (!itemdata) return Get_Return(3);
|
||||
|
||||
var esu_table = Get_EquipmentSlotUpgradeTable();
|
||||
var esu_data = esu_table.find(f=>f.e_EquipParts == itemdata.e_ItemType);
|
||||
if (!esu_data) return Get_Return(4);
|
||||
|
||||
var table = Get_MissionTable();
|
||||
var m_SD_Slot = urod.Slot.find(f => f.Parts == esu_data.e_EquipParts);
|
||||
var price = parseInt(Get_K_Value(m_SD_Slot.Lv, esu_data.f_BalanceConstantPrice, esu_data.n_DefaultValuePrice, esu_data.f_LevelPerValuePrice));
|
||||
log.info("슬롯 강화 비용 " + price)
|
||||
if (Use_Item(table, urod, esu_data.n_ConsumeGoodsID, price))
|
||||
{
|
||||
m_SD_Slot.Use += price;
|
||||
++m_SD_Slot.Lv;
|
||||
|
||||
Add_MissionCount(table, urod, "EQUIP_SLOT_UPGRADE_ALL", 0, 1);
|
||||
Add_MissionCount(table, urod, "EQUIP_SLOT_UPGRADE_ACC", 0, 1);
|
||||
|
||||
Set_JsonUserData(urod);
|
||||
return Get_Return(0);
|
||||
}
|
||||
return Get_Return(1);
|
||||
}
|
||||
/////////////////////////////////// 서버 처리
|
||||
|
||||
handlers.Write_UnityInApp = function(args)
|
||||
|
|
@ -8362,6 +8397,128 @@ function Get_EquipSmeltingTable()
|
|||
}
|
||||
]
|
||||
}
|
||||
function Get_EquipmentSlotUpgradeTable()
|
||||
{
|
||||
return [
|
||||
{
|
||||
"e_EquipParts": "Weapon",
|
||||
"e_EquipAttribute": "Physics ",
|
||||
"n_EquipSlotName": "2001",
|
||||
"e_OptionType": "ATK_Multiplier",
|
||||
"n_DefaultValue": "3",
|
||||
"f_LevelPerValue": "1.5",
|
||||
"f_BalanceConstant": "0.032",
|
||||
"n_ConsumeGoodsID": "101",
|
||||
"n_DefaultValuePrice": "10",
|
||||
"f_LevelPerValuePrice": "5",
|
||||
"f_BalanceConstantPrice": "0.015"
|
||||
},
|
||||
{
|
||||
"e_EquipParts": "Weapon",
|
||||
"e_EquipAttribute": "Magic",
|
||||
"n_EquipSlotName": "2002",
|
||||
"e_OptionType": "ATK_Multiplier",
|
||||
"n_DefaultValue": "3",
|
||||
"f_LevelPerValue": "1.5",
|
||||
"f_BalanceConstant": "0.032",
|
||||
"n_ConsumeGoodsID": "101",
|
||||
"n_DefaultValuePrice": "10",
|
||||
"f_LevelPerValuePrice": "5",
|
||||
"f_BalanceConstantPrice": "0.015"
|
||||
},
|
||||
{
|
||||
"e_EquipParts": "Weapon",
|
||||
"e_EquipAttribute": "None",
|
||||
"n_EquipSlotName": "2003",
|
||||
"e_OptionType": "Stat_EXTRA",
|
||||
"n_DefaultValue": "3",
|
||||
"f_LevelPerValue": "1.5",
|
||||
"f_BalanceConstant": "0.032",
|
||||
"n_ConsumeGoodsID": "101",
|
||||
"n_DefaultValuePrice": "10",
|
||||
"f_LevelPerValuePrice": "5",
|
||||
"f_BalanceConstantPrice": "0.015"
|
||||
},
|
||||
{
|
||||
"e_EquipParts": "Armor",
|
||||
"e_EquipAttribute": "None",
|
||||
"n_EquipSlotName": "2004",
|
||||
"e_OptionType": "DEF",
|
||||
"n_DefaultValue": "1",
|
||||
"f_LevelPerValue": "0.5",
|
||||
"f_BalanceConstant": "0.025",
|
||||
"n_ConsumeGoodsID": "102",
|
||||
"n_DefaultValuePrice": "5",
|
||||
"f_LevelPerValuePrice": "3",
|
||||
"f_BalanceConstantPrice": "0.025"
|
||||
},
|
||||
{
|
||||
"e_EquipParts": "Armor",
|
||||
"e_EquipAttribute": "None",
|
||||
"n_EquipSlotName": "2005",
|
||||
"e_OptionType": "M_DEF",
|
||||
"n_DefaultValue": "1",
|
||||
"f_LevelPerValue": "0.5",
|
||||
"f_BalanceConstant": "0.025",
|
||||
"n_ConsumeGoodsID": "102",
|
||||
"n_DefaultValuePrice": "5",
|
||||
"f_LevelPerValuePrice": "3",
|
||||
"f_BalanceConstantPrice": "0.025"
|
||||
},
|
||||
{
|
||||
"e_EquipParts": "Helmet",
|
||||
"e_EquipAttribute": "None",
|
||||
"n_EquipSlotName": "2006",
|
||||
"e_OptionType": "M_DEF",
|
||||
"n_DefaultValue": "1",
|
||||
"f_LevelPerValue": "0.5",
|
||||
"f_BalanceConstant": "0.025",
|
||||
"n_ConsumeGoodsID": "103",
|
||||
"n_DefaultValuePrice": "5",
|
||||
"f_LevelPerValuePrice": "3",
|
||||
"f_BalanceConstantPrice": "0.025"
|
||||
},
|
||||
{
|
||||
"e_EquipParts": "Extra",
|
||||
"e_EquipAttribute": "None",
|
||||
"n_EquipSlotName": "2007",
|
||||
"e_OptionType": "M_DEF",
|
||||
"n_DefaultValue": "1",
|
||||
"f_LevelPerValue": "0.5",
|
||||
"f_BalanceConstant": "0.025",
|
||||
"n_ConsumeGoodsID": "104",
|
||||
"n_DefaultValuePrice": "5",
|
||||
"f_LevelPerValuePrice": "3",
|
||||
"f_BalanceConstantPrice": "0.025"
|
||||
},
|
||||
{
|
||||
"e_EquipParts": "Necklace",
|
||||
"e_EquipAttribute": "None",
|
||||
"n_EquipSlotName": "2008",
|
||||
"e_OptionType": "M_DEF",
|
||||
"n_DefaultValue": "1",
|
||||
"f_LevelPerValue": "0.5",
|
||||
"f_BalanceConstant": "0.025",
|
||||
"n_ConsumeGoodsID": "105",
|
||||
"n_DefaultValuePrice": "5",
|
||||
"f_LevelPerValuePrice": "3",
|
||||
"f_BalanceConstantPrice": "0.025"
|
||||
},
|
||||
{
|
||||
"e_EquipParts": "Ring",
|
||||
"e_EquipAttribute": "None",
|
||||
"n_EquipSlotName": "2009",
|
||||
"e_OptionType": "M_DEF",
|
||||
"n_DefaultValue": "1",
|
||||
"f_LevelPerValue": "0.5",
|
||||
"f_BalanceConstant": "0.025",
|
||||
"n_ConsumeGoodsID": "106",
|
||||
"n_DefaultValuePrice": "5",
|
||||
"f_LevelPerValuePrice": "3",
|
||||
"f_BalanceConstantPrice": "0.025"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
function Get_PlayOCoupons()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1438,11 +1438,49 @@ public class ServerInfo : MyCoroutine
|
|||
}
|
||||
}
|
||||
else
|
||||
Set_Coroutine(() => { Save_Equipment_Equip(itemid, _act); }, 2f);
|
||||
Set_Coroutine(() => { Save_Equipment_Decomposition(itemid, count, _act); }, 2f);
|
||||
},
|
||||
fail =>
|
||||
{
|
||||
Set_Coroutine(() => { Save_Equipment_Equip(itemid, _act); }, 2f);
|
||||
Set_Coroutine(() => { Save_Equipment_Decomposition(itemid, count, _act); }, 2f);
|
||||
});
|
||||
}
|
||||
public void Save_EquipItem_SlotLvUp(int itemid, Action _act)
|
||||
{
|
||||
NetWait.Ins.Set(true);
|
||||
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
|
||||
{
|
||||
FunctionName = MethodBase.GetCurrentMethod().Name,
|
||||
GeneratePlayStreamEvent = true,
|
||||
FunctionParameter = new
|
||||
{
|
||||
Token = m_LoginInfo.EntityToken.EntityToken,
|
||||
ItemID = itemid,
|
||||
}
|
||||
},
|
||||
result =>
|
||||
{
|
||||
if (result.Error == null)
|
||||
{
|
||||
NetWait.Ins.Set(false);
|
||||
var str_result = result.FunctionResult.ToString();
|
||||
var error = MyErrorCheck(str_result);
|
||||
// (0 성공, 1 실패 (없는 아이템), 2 실패 (이미 착용 중))
|
||||
switch (error)
|
||||
{
|
||||
case 0: _act?.Invoke(); break;
|
||||
case 1: ToastUI.Ins.Set(388); break;
|
||||
case 2: ToastUI.Ins.Set(999900003); break;
|
||||
case 3: ToastUI.Ins.Set(999900014); break;
|
||||
case 4: ToastUI.Ins.Set(999900020); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
Set_Coroutine(() => { Save_EquipItem_SlotLvUp(itemid, _act); }, 2f);
|
||||
},
|
||||
fail =>
|
||||
{
|
||||
Set_Coroutine(() => { Save_EquipItem_SlotLvUp(itemid, _act); }, 2f);
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class EquipmentItemPopup : EquipmentPopupItemInfoBase
|
|||
m_EquipItemEnchantOption.Set(m_SD_Slot);
|
||||
}
|
||||
|
||||
int Get_Price() { return (int)(m_ESUTD.n_DefaultValuePrice + m_SD_Slot.Lv + m_ESUTD.f_LevelPerValuePrice); }
|
||||
int Get_Price() { return (int)m_ESUTD.Get_Price(m_SD_Slot.Lv); }
|
||||
public eItem Get_Parts() { return m_Data.e_EquipParts; }
|
||||
|
||||
public void OnClick_Reinforce()
|
||||
|
|
@ -71,14 +71,18 @@ public class EquipmentItemPopup : EquipmentPopupItemInfoBase
|
|||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
var price = Get_Price();
|
||||
if (sdata.Check_ItemAmount(m_ESUTD.n_ConsumeGoodsID, price))
|
||||
{
|
||||
ServerInfo.Ins.Save_EquipItem_SlotLvUp(m_Data.n_EquipID, () =>
|
||||
{
|
||||
sdata.Use_Item(m_ESUTD.n_ConsumeGoodsID, price);
|
||||
sdata.Add_SlotLv(m_ESUTD.e_EquipParts, price);
|
||||
Set_UI();
|
||||
NewGameUI.Ins.m_EquipmentUI.m_equipItems.Set();
|
||||
MyValue.Get_ActorStatInfoorNull(eRole.PC);
|
||||
|
||||
sdata.Add_MissionCount(ePurpose.EQUIP_SLOT_UPGRADE_ALL);
|
||||
sdata.Add_MissionCount(ePurpose.EQUIP_SLOT_UPGRADE_ACC);
|
||||
});
|
||||
}
|
||||
}
|
||||
public void OnClick_ReinforceReset()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EquipmentUI_EquipItems : uScrollViewMgr
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue