Esempio n. 1
0
    public void TryUpgradeRelics(int relicsID)
    {
        DRelics db = ReadCfgRelics.GetDataById(relicsID);

        if (db == null)
        {
            GTItemHelper.ShowTip("非法物品");
            return;
        }
        XRelics relics = DataDBSRelics.GetDataById(relicsID);

        if (relics == null)
        {
            GTItemHelper.ShowTip("非法物品");
            return;
        }
        if (relics.Level == db.LevelRequireExp.Length)
        {
            GTItemHelper.ShowTip("已升到最大等级,无法继续升级");
            return;
        }
        for (int i = 0; i < 3; i++)
        {
            if (RelicsModule.Instance.GetExp(relics, i + 1) < db.LevelRequireExp[relics.Level])
            {
                GTItemHelper.ShowTip("神器未获得足够的充能");
                return;
            }
        }
        ReqUpgradeRelics req = new ReqUpgradeRelics();

        req.RelicsID = relicsID;
        NetworkManager.Instance.Send(MessageID.MSG_REQ_UPGRADE_RELICS, req);
    }
Esempio n. 2
0
    private void OnReq_UpgradeRelics(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        ReqUpgradeRelics       req = Serializer.Deserialize <ReqUpgradeRelics>(ms);

        AckUpgradeRelics ack = new AckUpgradeRelics();

        ack.RelicsID = req.RelicsID;
        NetworkManager.Instance.Send(MessageID.MSG_ACK_UPGRADE_RELICS, ack, 0, 0);
    }