Ejemplo n.º 1
0
    public void TryChargeRelics(int relicsID, int index)
    {
        DRelics db = ReadCfgRelics.GetDataById(relicsID);

        if (db == null)
        {
            GTItemHelper.ShowTip("非法物品");
            return;
        }
        if (index > 3 || index < 1)
        {
            GTItemHelper.ShowTip("非法索引" + index.ToString());
            return;
        }
        XRelics relics = DataDBSRelics.GetDataById(relicsID);

        if (relics != null)
        {
            if (RelicsModule.Instance.GetExp(relics, index) >= db.LevelRequireExp[relics.Level])
            {
                GTItemHelper.ShowTip("你不能对此充能了");
                return;
            }
        }
        if (GTItemHelper.CheckItemEnongh(db.ArtificeCostID[index - 1], 1) == false)
        {
            return;
        }

        ReqChargeRelics req = new ReqChargeRelics();

        req.RelicsID = relicsID;
        req.Index    = index;
        NetworkManager.Instance.Send(MessageID.MSG_REQ_CHARGE_RELICS, req);
    }
Ejemplo n.º 2
0
    public void TryStrengthGem(XGem gem, List <XItem> list)
    {
        if (MLGem.Instance.IsFullStrengthenLevel(gem))
        {
            GTItemHelper.ShowTip("宝石强化等级已满");
            return;
        }
        if (list.Count == 0)
        {
            GTItemHelper.ShowTip("请添加升级材料");
            return;
        }
        int exp = MLGem.Instance.GetExpByStrengthMatList(list);

        if (GTItemHelper.CheckItemEnongh(1, exp) == false)
        {
            return;
        }

        ReqStrengthGem req = new ReqStrengthGem();

        req.TarGem = gem;
        req.UseItems.AddRange(list);
        NetworkManager.Instance.Send <ReqStrengthGem>(MessageID.MSG_REQ_STRENGTHEN_GEM, req);
    }
Ejemplo n.º 3
0
    public void TryUpStarEquip(XEquip equip)
    {
        if (EquipModule.Instance.IsFullStarLevel(equip))
        {
            GTItemHelper.ShowTip("装备星级已满");
            return;
        }
        DEquip     equipDB = ReadCfgEquip.GetDataById(equip.Id);
        int        starID  = equipDB.Quality * 1000 + equip.StarLevel + 1;
        DEquipStar db      = ReadCfgEquipStar.GetDataById(starID);

        if (!GTItemHelper.CheckItemEnongh(db.CostMoneyId, db.CostMoneyNum))
        {
            return;
        }
        if (!GTItemHelper.CheckItemEnongh(db.CostItemId, db.CostItemNum))
        {
            return;
        }

        ReqUpStarEquip req = new ReqUpStarEquip();

        req.TarEquip = equip;
        NetworkManager.Instance.Send <ReqUpStarEquip>(MessageID.MSG_REQ_UPSTAR_EQUIP, req);
    }
Ejemplo n.º 4
0
    public void TryMainCopyReq(UInt64 roleGUID, Int32 dwCopyID)
    {
        DCopy copyDB = ReadCfgCopy.GetDataById(dwCopyID);

        if (GTItemHelper.CheckItemEnongh(copyDB.CostActionId, copyDB.CostActionNum) == false)
        {
            return;
        }

        MainCopyReq req = new MainCopyReq();

        req.CopyID = dwCopyID;
        NetworkManager.Instance.Send <MainCopyReq>(MessageID.MSG_MAIN_COPY_REQ, req, roleGUID, 0);
    }
Ejemplo n.º 5
0
    public void TryAdvanceEquip(XEquip equip)
    {
        if (EquipModule.Instance.IsFullAdvanceLevel(equip))
        {
            GTItemHelper.ShowTip("进阶等级已满");
            return;
        }
        DEquip            cfg       = ReadCfgEquip.GetDataById(equip.Id);
        int               advanceID = cfg.Quality * 1000 + equip.AdvanceLevel + 1;
        DEquipAdvanceCost db        = ReadCfgEquipAdvanceCost.GetDataById(advanceID);

        if (!GTItemHelper.CheckItemEnongh(db.CostMoneyId, db.CostMoneyNum))
        {
            return;
        }
        if (!GTItemHelper.CheckItemEnongh(db.CostItemId, db.CostItemNum))
        {
            return;
        }

        List <XItem> list;

        if (db.CostEquipNum > 0)
        {
            list = EquipModule.Instance.GetBagSameEquipList(equip);
            if (list.Count < db.CostEquipNum)
            {
                GTItemHelper.ShowTip("缺少同样的装备");
                return;
            }
            list.RemoveRange(db.CostEquipNum, list.Count - db.CostEquipNum);
        }
        else
        {
            list = new List <XItem>();
        }

        ReqAdvanceEquip req = new ReqAdvanceEquip();

        req.TarEquip = equip;
        req.UseItems.AddRange(list);
        NetworkManager.Instance.Send <ReqAdvanceEquip>(MessageID.MSG_REQ_ADVANCE_EQUIP, req);
    }
Ejemplo n.º 6
0
    public void TryStrengthEquip(XEquip equip, List <XItem> list)
    {
        if (list.Count == 0)
        {
            GTItemHelper.ShowTip("请添加装备或者水晶");
            return;
        }
        int addExpNum = EquipModule.Instance.GetStrengthenExpByMatList(list);

        if (!GTItemHelper.CheckItemEnongh(DEquip.EQUIP_STRENGTHEN_MONEY_ID_1, addExpNum))
        {
            return;
        }

        ReqStrengthEquip req = new ReqStrengthEquip();

        req.TarEquip = equip;
        req.UseItems.AddRange(list);
        NetworkManager.Instance.Send <ReqStrengthEquip>(MessageID.MSG_REQ_STRENGTHEN_EQUIP, req);
    }
Ejemplo n.º 7
0
    public void TryBattleCheck(ECopyType copyType, int chapter, int copyID)
    {
        if (CheckCopy(copyType, chapter, copyID) == false)
        {
            return;
        }
        DCopy copyDB = ReadCfgCopy.GetDataById(copyID);

        if (GTItemHelper.CheckItemEnongh(copyDB.CostActionId, copyDB.CostActionNum) == false)
        {
            return;
        }


        ReqBattleCheck req = new ReqBattleCheck();

        req.CopyType = (int)copyType;
        req.CopyID   = copyID;
        req.Chapter  = chapter;
        NetworkManager.Instance.Send <ReqBattleCheck>(MessageID.MSG_REQ_BATTLE_CHECK, req);
    }
Ejemplo n.º 8
0
    public void TryBuyStore(int storeType, int storeID, int num)
    {
        DStore storeDB = ReadCfgStore.GetDataById(storeID);

        if (storeDB == null)
        {
            GTItemHelper.ShowTip("非法物品");
            return;
        }
        if (GTItemHelper.CheckItemEnongh(storeDB.CostMoneyID, storeDB.CostMoneyNum) == false)
        {
            return;
        }
        if (GTItemHelper.CheckBagFull(1))
        {
            return;
        }
        ReqBuyStore req = new ReqBuyStore();

        req.StoreType = storeType;
        req.StoreID   = storeID;
        req.Num       = num;
        NetworkManager.Instance.Send <ReqBuyStore>(MessageID.MSG_REQ_BUY_STORE, req);
    }