Exemple #1
0
 void onClick_Quedingjiadian_Btn(GameObject caster)
 {
     if (CurPet != null)
     {
         stAttrPointPetUserCmd_C cmd = new stAttrPointPetUserCmd_C();
         cmd.id = CurPet.GetID();
         PetTalent attr = CurPet.GetAttrTalent();
         PetTalent tal  = new PetTalent();
         tal.tizhi      = (uint)addPointDic[FightCreatureProp.Corporeity.ToString()] + attr.tizhi;
         tal.minjie     = (uint)addPointDic[FightCreatureProp.Agility.ToString()] + attr.minjie;
         tal.jingshen   = (uint)addPointDic[FightCreatureProp.Spirit.ToString()] + attr.jingshen;
         tal.zhili      = (uint)addPointDic[FightCreatureProp.Intelligence.ToString()] + attr.zhili;
         tal.liliang    = (uint)addPointDic[FightCreatureProp.Strength.ToString()] + attr.liliang;
         cmd.attr_point = tal;
         if (!bHasAddPoint())
         {
             TipsManager.Instance.ShowTips(DataManager.Manager <TextManager>().GetLocalText(LocalTextType.Local_TXT_Notice_NoAllotQianXiuPoint));
             return;
         }
         else
         {
             NetService.Instance.Send(cmd);
         }
     }
 }
Exemple #2
0
    void RsetPoint(bool bReset)
    {
        if (CurPet != null)
        {
            stAttrPointPetUserCmd_C cmd = new stAttrPointPetUserCmd_C();
            cmd.id       = CurPet.GetID();
            cmd.auto_buy = bReset;
            PetTalent attr = CurPet.GetAttrTalent();
            PetTalent tal  = new PetTalent();
            tal.tizhi    = (uint)addPointDic[FightCreatureProp.Corporeity.ToString()] + attr.tizhi;
            tal.minjie   = (uint)addPointDic[FightCreatureProp.Agility.ToString()] + attr.minjie;
            tal.jingshen = (uint)addPointDic[FightCreatureProp.Spirit.ToString()] + attr.jingshen;
            tal.zhili    = (uint)addPointDic[FightCreatureProp.Intelligence.ToString()] + attr.zhili;
            tal.liliang  = (uint)addPointDic[FightCreatureProp.Strength.ToString()] + attr.liliang;


            if (attr.tizhi == 0 && attr.minjie == 0 && attr.jingshen == 0 && attr.zhili == 0 && attr.liliang == 0)
            {
                TipsManager.Instance.ShowTips(DataManager.Manager <TextManager>().GetLocalText(LocalTextType.Local_TXT_Notice_AlreadyResetPoint));
                return;
            }
            else
            {
                NetService.Instance.Send(cmd);
            }
        }
    }
Exemple #3
0
    void onClick_Chongzhishuxing_Btn(GameObject caster)
    {
        if (CurPet != null)
        {
            stAttrPointPetUserCmd_C cmd = new stAttrPointPetUserCmd_C();
            cmd.id = CurPet.GetID();
            PetTalent attr = CurPet.GetAttrTalent();
            PetTalent tal  = new PetTalent();
            tal.tizhi    = (uint)addPointDic[FightCreatureProp.Corporeity.ToString()] + attr.tizhi;
            tal.minjie   = (uint)addPointDic[FightCreatureProp.Agility.ToString()] + attr.minjie;
            tal.jingshen = (uint)addPointDic[FightCreatureProp.Spirit.ToString()] + attr.jingshen;
            tal.zhili    = (uint)addPointDic[FightCreatureProp.Intelligence.ToString()] + attr.zhili;
            tal.liliang  = (uint)addPointDic[FightCreatureProp.Strength.ToString()] + attr.liliang;


            if (attr.tizhi == 0 && attr.minjie == 0 && attr.jingshen == 0 && attr.zhili == 0 && attr.liliang == 0)
            {
                TipsManager.Instance.ShowTips(DataManager.Manager <TextManager>().GetLocalText(LocalTextType.Local_TXT_Notice_AlreadyResetPoint));
                return;
            }
            else
            {
                int  resetLevel = GameTableManager.Instance.GetGlobalConfig <int>("PetFreeResetPointCount");
                uint petLevel   = CurPet.GetFreeResetAttrNum();
                if (petLevel < resetLevel)
                {
                    string con = DataManager.Manager <TextManager>().GetLocalFormatText(LocalTextType.Pet_Commond_chongzhixiaohaotips, resetLevel - petLevel);
                    //string con = string.Format("{0}{1}", resetLevel, CommonData.GetLocalString("级之前可免费重置潜修点,重置后所有潜修点都会返还。"));
                    TipsManager.Instance.ShowTipWindow(TipWindowType.Custom, con, () =>
                    {
                        NetService.Instance.Send(cmd);
                    }, null, null, CommonData.GetLocalString("重置潜修点"), CommonData.GetLocalString("重置"));
                }
                else
                {
                    uint resetItemID     = GameTableManager.Instance.GetGlobalConfig <uint>("PetAddPointResetItemID");
                    CommonSingleParam cp = new CommonSingleParam();
                    cp.consumNum    = 1;
                    cp.autobuydes   = CommonData.GetLocalString("道具不足自动元宝购买");
                    cp.titletips    = CommonData.GetLocalString("提示");
                    cp.contentdes   = CommonData.GetLocalString("重置潜修点需要消耗如下道具");
                    cp.bShowAutoBuy = true;
                    cp.canceltext   = CommonData.GetLocalString("取消");
                    cp.oktext       = CommonData.GetLocalString("重置");
                    cp.itemID       = resetItemID;
                    cp.cancleAction = null;
                    cp.okAction     = RsetPoint;
                    TipsManager.Instance.ShowSingelConsumPanel(cp);
                }
            }
        }
    }