GetMoneyCount() 공개 메소드

public GetMoneyCount ( MONEYTYPE type ) : int
type MONEYTYPE
리턴 int
예제 #1
0
        public bool Action_Legion_Create(ActionInfo info, PlayerObject play)
        {
            String legionname = mszStr;
            mszStr = "";
            if (legionname.Length <= 0) return false;
            if (play.GetLegionSystem().IsHaveLegion())
            {
                return false;
            }
            //是否有重复的军团
            if (LegionManager.Instance().IsExist(legionname))
            {
                return false;
            }
            String[] option = info.param.Split(' ');
            int level = Convert.ToInt32(option[0]);//创建军团所需等级
            int money = Convert.ToInt32(option[1]); //创建军团的费用
            int capital = Convert.ToInt32(option[2]); //军团起始资金
            if (play.GetBaseAttr().level < level )
            {
                return false;
            }

            if (play.GetMoneyCount(MONEYTYPE.GOLD) < money )
            {
                return false;
            }

            play.ChangeMoney(MONEYTYPE.GOLD, money);

            LegionManager.Instance().CreateLegion(play.GetBaseAttr().player_id, legionname,play.GetName(), GameBase.Config.Define.LEGION_JUNTUAN, capital, "公告");
            //发给数据库服务器创建军团

            return true;
            //246, 0, 0, 0 为军团id
            //1107 为军团协议
               // 收到网络协议:长度:16协议号:1302
            //            byte[] dat1 = {16,0,22,5,61,2,0,0,182,113,0,0,88,2,0,0};
            //            play.GetGamePackKeyEx().EncodePacket(ref dat1, dat1.Length);
            //            play.SendData(dat1);
            //            //收到网络协议:长度:20协议号:1017

            //            byte[] dat2 = { 20, 0, 249, 3, 64, 66, 15, 0, 1, 0, 0, 0, 9, 0, 0, 0, 100, 0, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref dat2, dat2.Length);
            //            play.SendData(dat2);
            ////收到网络协议:长度:20协议号:1017
            //            byte[] dat3 = {20,0,249,3,65,66,15,0,1,0,0,0,70,0,0,0,64,0,0,0};
            //            play.GetGamePackKeyEx().EncodePacket(ref dat3, dat3.Length);
            //            play.SendData(dat3);

            ////收到网络协议:长度:16协议号:1012

            //            byte[] dat4 = { 16, 0, 244, 3, 64, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref dat4, dat4.Length);
            //            play.SendData(dat4);
            //收到网络协议:长度:108协议号:1106/
              //头衔注释
            //0.1.军团长 2.帮主  3.教主 4.会长
               // byte[] dat5 = {108,0,82,4,246,0,0,0,144,208,3,0,144,208,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,232,3,1,0,4/*!!!头衔*/,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210,176,177,200,186,243,204,236,0,0,0,0,0,0,0,0,0,0,246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
            //byte[] dat5 = { 108, 0, 82, 4, 246, 0, 0, 0, 144, 208, 3, 0, 144, 208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4/*!!!头衔*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, 176, 177, 200, 186, 243, 204, 236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref dat5, dat5.Length);
            //play.SendData(dat5);

            //收到网络协议:长度:21协议号:1015
            //{27,0,247,3,117,1,0,0,3,0,1,14,169,89,211,200,207,170,161,239,180,180,187,212,187,205,0}
            //byte[] data10 = { 21, 0, 247, 3, 246, 0, 0, 0, 3, 0, 1, 8, 196, 234, 201, 217, 187, 196, 204, 198, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref data10, data10.Length);
            //play.SendData(data10);

            //收到网络协议:长度:172协议号:2056
            //            byte[] dat6 = { 172, 0, 8, 8, 64, 66, 15, 0, 20, 0, 0, 0, 3, 0, 0, 0, 144, 208, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 144, 208, 3, 0, 11, 0, 0, 0, 144, 208, 3, 0, 12, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref dat6, dat6.Length);
            //            play.SendData(dat6);

            ////收到网络协议:长度:108协议号:1106
            //            byte[] dat7 = {108,0,82,4,246,0,0,0,144,208,3,0,144,208,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,232,3,0,0,0,0,232,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210,176,177,200,186,243,204,236,0,0,0,0,0,0,0,0,0,0,246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
            //            play.GetGamePackKeyEx().EncodePacket(ref dat7, dat7.Length);
            //            play.SendData(dat7);

            ////收到网络协议:长度:172协议号:2056
            //            byte[] dat8 = { 172, 0, 8, 8, 64, 66, 15, 0, 20, 0, 0, 0, 3, 0, 0, 0, 144, 208, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 144, 208, 3, 0, 11, 0, 0, 0, 144, 208, 3, 0, 12, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref dat8, dat8.Length);
            //            play.SendData(dat8);

            ////收到网络协议:长度:108协议号:1106
            //            byte[] dat9={108,0,82,4,246,0,0,0,144,208,3,0,160,247,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,232,3,0,0,0,0,232,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210,176,177,200,186,243,204,236,0,0,0,0,0,0,0,0,0,0,246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
            //            play.GetGamePackKeyEx().EncodePacket(ref dat9, dat9.Length);
            //            play.SendData(dat9);

            ////收到网络协议:长度:172协议号:2056
            //            byte[] dat10 = { 172, 0, 8, 8, 64, 66, 15, 0, 20, 0, 0, 0, 3, 0, 0, 0, 144, 208, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 144, 208, 3, 0, 11, 0, 0, 0, 144, 208, 3, 0, 12, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref dat10, dat10.Length);
            //            play.SendData(dat10);

            ////收到网络协议:长度:108协议号:1106
            //            byte[] dat11={108,0,82,4,246,0,0,0,144,208,3,0,160,247,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,232,3,0,0,0,0,232,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210,176,177,200,186,243,204,236,0,0,0,0,0,0,0,0,0,0,246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
            //            play.GetGamePackKeyEx().EncodePacket(ref dat11, dat11.Length);
            //            play.SendData(dat11);
            //收到网络协议:长度:172协议号:2056
            //            byte[] dat12 = { 172, 0, 8, 8, 64, 66, 15, 0, 20, 0, 0, 0, 3, 0, 0, 0, 144, 208, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 144, 208, 3, 0, 11, 0, 0, 0, 144, 208, 3, 0, 12, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref dat12, dat12.Length);
            //            play.SendData(dat12);

            ////收到网络协议:长度:189协议号:1014
            //            byte[] dat13 = { 189, 0, 246, 3, 64, 66, 15, 0, 33, 191, 2, 0, 33, 191, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 0, 0, 0, 21, 0, 2, 0, 102, 66, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 0, 114, 1, 132, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 97, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, 10, 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 210, 176, 177, 200, 186, 243, 204, 236, 0, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref dat13, dat13.Length);
            //            play.SendData(dat13);

            ////收到网络协议:长度:46协议号:1004
            //            byte[] dat15 = { 46, 0, 236, 3, 0, 255, 255, 0, 63, 8, 0, 0, 71, 8, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, 6, 83, 89, 83, 84, 69, 77, 8, 210, 176, 177, 200, 186, 243, 204, 236, 0, 0, 0, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref dat15, dat15.Length);
            //            play.SendData(dat15);

            //收到网络协议:长度:16协议号:1015

            //byte[] data = { 16, 0, 247, 3, 1, 0, 0, 0, 101, 0, 1, 3, 50, 52, 54, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref data, data.Length);
            //play.SendData(data);
            ////收到网络协议:长度:16协议号:1015

            //byte[] data1 = { 16, 0, 247, 3, 1, 0, 0, 0, 100, 0, 1, 3, 50, 52, 54, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
            //play.SendData(data1);
            //收到网络协议:长度:29协议号:1107

            //byte[] data2 = { 29, 0, 83, 4, 14, 0, 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 196, 234, 201, 217, 187, 196, 204, 198, 0, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
            //play.SendData(data2);
            //收到网络协议:长度:20协议号:1107

            //byte[] data3 = { 20, 0, 83, 4, 119, 0, 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
            //play.SendData(data3);
            //收到网络协议:长度:16协议号:2036

            //byte[] data4 = { 16, 0, 244, 7, 205, 0, 2, 0, 246, 0, 0, 0, 0, 0, 0, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
            //play.SendData(data4);
            ////收到网络协议:长度:56协议号:2036

            //byte[] data5 = { 56, 0, 244, 7, 210, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 0, 0, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
            //play.SendData(data5);
            //收到网络协议:长度:12协议号:1015

            //byte[] data6 = { 12, 0, 247, 3, 0, 0, 0, 0, 152, 0, 0, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref data6, data6.Length);
            //play.SendData(data6);
            ////收到网络协议:长度:20协议号:1017

            //byte[] data7 = { 20, 0, 249, 3, 64, 66, 15, 0, 1, 0, 0, 0, 4, 0, 0, 0, 11, 139, 16, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref data7, data7.Length);
            //play.SendData(data7);

            //收到网络协议:长度:74协议号:1107
            //            byte[] data8 = { 74, 0, 83, 4, 171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 5, 48, 32, 48, 32, 48, 5, 49, 32, 48, 32, 48, 5, 50, 32, 48, 32, 48, 5, 51, 32, 48, 32, 48, 5, 52, 32, 48, 32, 48, 5, 53, 32, 48, 32, 48, 5, 54, 32, 48, 32, 48, 5, 55, 32, 48, 32, 48, 5, 56, 32, 48, 32, 48, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref data8, data8.Length);
            //            play.SendData(data8);
            ////
            ////收到网络协议:长度:16协议号:1182
            ////
            //            byte[] data9 = { 16, 0, 158, 4, 7, 0, 0, 0, 232, 3, 0, 0, 3, 0, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref data9, data9.Length);
            //            play.SendData(data9);

            //收到网络协议:长度:16协议号:1302
            //
            //            byte[] data11 = { 16, 0, 22, 5, 61, 2, 0, 0, 253, 101, 0, 0, 88, 2, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref data11, data11.Length);
            //            play.SendData(data11);
            ////收到网络协议:长度:28协议号:1010
            ////
            //            byte[] data12 = { 28, 0, 242, 3, 118, 202, 19, 86, 65, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 37, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref data12, data12.Length);
            //            play.SendData(data12);
            //收到网络协议:长度:28协议号:1010
            //
            //            byte[] data13 = { 28, 0, 242, 3, 118, 202, 19, 86, 65, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 37, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref data13, data13.Length);
            //            play.SendData(data13);
            ////收到网络协议:长度:28协议号:1010
            ////
            //            byte[] data14 = { 28, 0, 242, 3, 118, 202, 19, 86, 194, 148, 53, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 37, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref data14, data14.Length);
            //            play.SendData(data14);
            //收到网络协议:长度:28协议号:1010
            //
            //            byte[] data15 = { 28, 0, 242, 3, 118, 202, 19, 86, 193, 148, 53, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 37, 0, 0 };
            //            play.GetGamePackKeyEx().EncodePacket(ref data15, data15.Length);
            //            play.SendData(data15);
            ////收到网络协议:长度:20协议号:1017
            ////{
            //            byte[] data16 ={20,0,249,3,65,66,15,0,1,0,0,0,70,0,0,0,64,0,0,0};
            //            play.GetGamePackKeyEx().EncodePacket(ref data16, data16.Length);
            //            play.SendData(data16);
            //收到网络协议:长度:192协议号:1014 天晴猪宝贝
                    //byte[] data17 ={192,0,246,3,65,66,15,0,3,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,16,2,0,0,0,0,0,0,0,0,0,0,0,0,0,159,0,110,1,100,0,0,0,0,5,0,0,0,0,0,0,125,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,197,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,11,183,201,184,235,54,50,56,91,71,77,93,0,0,0};
                    //play.GetGamePackKeyEx().EncodePacket(ref data17, data17.Length);
                    //play.SendData(data17);
            //
            //收到网络协议:长度:28协议号:2036
            //
                    //byte[] data18= { 28, 0, 244, 7, 109, 0, 5, 0, 65, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                    //play.GetGamePackKeyEx().EncodePacket(ref data18, data18.Length);
                    //play.SendData(data18);
            //收到网络协议:长度:28协议号:1017
            //
                    //byte[] data19 = { 28, 0, 249, 3, 65, 66, 15, 0, 2, 0, 0, 0, 36, 0, 0, 0, 0, 4, 0, 0, 70, 0, 0, 0, 64, 0, 0, 0 };
                    //play.GetGamePackKeyEx().EncodePacket(ref data19, data19.Length);
                    //play.SendData(data19);

            //收到网络协议:长度:108协议号:1106
            //这个是更改军团头衔 会长 军团战 帮主之类的
                    //byte[] data20 = { 108, 0, 82, 4, 246, 0, 0, 0, 144, 208, 3, 0, 160, 247, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 232, 3, 0, 0, 0, 0, 232, 3, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, 176, 177, 200, 186, 243, 204, 236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                    //play.GetGamePackKeyEx().EncodePacket(ref data20, data20.Length);
                    //play.SendData(data20);

            //收到网络协议:长度:172协议号:2056
                    //byte[] data21 = { 172, 0, 8, 8, 76, 152, 15, 0, 20, 0, 0, 0, 3, 0, 0, 0, 144, 208, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 144, 208, 3, 0, 11, 0, 0, 0, 144, 208, 3, 0, 12, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0 };
                    //play.GetGamePackKeyEx().EncodePacket(ref data21, data21.Length);
                    //play.SendData(data21);
            //
            //收到网络协议:长度:189协议号:1014 野比后天
                    //byte[] data22 = { 189, 0, 246, 3, 76, 152, 15, 0, 33, 191, 2, 0, 33, 191, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 0, 0, 0, 21, 0, 2, 0, 102, 66, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 0, 114, 1, 132, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 97, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, 10, 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 210, 176, 177, 200, 186, 243, 204, 236, 0, 0, 0 };
                    //play.GetGamePackKeyEx().EncodePacket(ref data22, data22.Length);
                    //play.SendData(data22);
            //
            //return true;
        }
예제 #2
0
        public void BuyItem(PlayerObject play, uint ptich_obj_id, uint item_id)
        {
            if (play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_PTICH) != null)
            {
                play.MsgBox("摆摊中不允许购买!");
                return;
            }
            int ptich_id = -1;
            for (int i = 0; i < mListPtichInfo.Count; i++)
            {
                if (mListPtichInfo[i].PtichObj == null) continue;
                if (mListPtichInfo[i].PtichObj.GetTypeId() == ptich_obj_id)
                {
                    ptich_id = i;
                    break;
                }
            }
            if (ptich_id == -1) return;

            //检测是否有道具
            int price = 0;
            byte sell_type = 0;

            RoleItemInfo item = null;
             RoleData_Eudemon eudemon  = null;
             bool bFind = false;
            for (int i = 0; i < mListPtichInfo[ptich_id].mSellItemList.Count; i++)
            {

                if (mListPtichInfo[ptich_id].mSellItemList[i].item_id == item_id)
                {
                    bFind = true;
                    if (item_id >= IDManager.eudemon_start_id)
                    {
                        eudemon = mListPtichInfo[ptich_id].play.GetEudemonSystem().FindEudemon(item_id);
                        if (eudemon == null) return;
                        item = mListPtichInfo[ptich_id].play.GetItemSystem().FindItem(eudemon.itemid);
                     }else
                    {
                         item = mListPtichInfo[ptich_id].play.GetItemSystem().FindItem(item_id);
                    }

                    if (item == null)
                    {
                        play.MsgBox("购买失败!");
                        return;
                    }
                    price = mListPtichInfo[ptich_id].mSellItemList[i].price;
                    sell_type = mListPtichInfo[ptich_id].mSellItemList[i].sell_type;
                    if (sell_type == NetMsg.MsgOperateItem.PTICH_SELL_ITEM_GAMEGOLD)
                    {
                        if (price > play.GetMoneyCount(MONEYTYPE.GOLD))
                        {
                            play.MsgBox("购买失败,魔石不足!");
                            return;
                        }
                        play.ChangeMoney(MONEYTYPE.GAMEGOLD, -price);
                        mListPtichInfo[ptich_id].play.ChangeMoney(MONEYTYPE.GAMEGOLD, price);
                    }
                    else if (sell_type == NetMsg.MsgOperateItem.PTICH_SELL_ITEM_GOLD)
                    {
                        if (price > play.GetMoneyCount(MONEYTYPE.GOLD))
                        {
                            play.MsgBox("购买失败,金币不足!");
                            return;
                        }
                        play.ChangeMoney(MONEYTYPE.GOLD, -price);
                        mListPtichInfo[ptich_id].play.ChangeMoney(MONEYTYPE.GOLD, price);
                    }
                    else return;
                    mListPtichInfo[ptich_id].mSellItemList.RemoveAt(i);
                    break;
                }
            }
            if (!bFind)
            {
                play.MsgBox("购买失败,该道具已下架!");
                return;
            }

            if (item_id >= IDManager.eudemon_start_id)
            {
                item.postion = NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK;
                play.GetEudemonSystem().AddTempEudemon(eudemon);//加到临时表

            }
            else
            {
                //添加道具
                item.postion = NetMsg.MsgItemInfo.ITEMPOSITION_BACKPACK;

            }
            play.GetItemSystem().AwardItem(item);
            //删除卖方道具
            //刷新摊位道具栏 卖方
            GetBackItem(mListPtichInfo[ptich_id].play, item_id);
            mListPtichInfo[ptich_id].play.GetItemSystem().DeleteItemByID(item_id);

            //买方
            //{28,0,241,3,140,87,212,7,70,160,1,0,23,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0}
            PacketOut outpack = new PacketOut();
            outpack.WriteInt16(28);
            outpack.WriteInt16(1009);
            outpack.WriteUInt32(item_id);
            outpack.WriteUInt32(ptich_obj_id);
            outpack.WriteInt32(23); //购买完的标识
            outpack.WriteInt16(0);
            outpack.WriteInt32(1);
            outpack.WriteInt32(0);
            outpack.WriteInt16(0);
            play.SendData(outpack.Flush(), true);
               // this.LookPtich(play, ptich_obj_id);
              //  this.LookPtich(mListPtichInfo[ptich_id].play, ptich_obj_id);
        }
예제 #3
0
        //玩家捐献爵位
        public void Donation(PlayerObject play, GameStruct.MONEYTYPE type, int value)
        {
            const int MIN_GOLD = 3000000; //最低捐献金额- 防封包
            GameStruct.GUANGJUELEVEL oldlv = play.GetGuanJue();
            int gold = 0;
            switch (type )
            {
                case GameStruct.MONEYTYPE.GOLD:
                    {
                        if (gold < MIN_GOLD)
                        {
                            play.LeftNotice("最低捐献" + MIN_GOLD.ToString() + "万金币起。");
                            return;
                        }
                        if (play.GetMoneyCount(GameStruct.MONEYTYPE.GOLD) < value)
                        {
                            play.LeftNotice("金币不足,无法捐献!");
                            return;
                        }
                        gold = value;
                        play.ChangeAttribute(GameStruct.UserAttribute.GOLD, -gold);
                        break;
                    }
                case GameStruct.MONEYTYPE.GAMEGOLD:
                    {
                        if (play.GetMoneyCount(GameStruct.MONEYTYPE.GAMEGOLD) < value)
                        {
                            play.LeftNotice("魔石不足,无法捐献!");
                            return;
                        }
                        play.ChangeAttribute(GameStruct.UserAttribute.GAMEGOLD, -value);
                        //转换成金币 一个魔石等于7100金币
                        const int _gold = 7100;
                        gold = value * _gold;
                        if (gold < MIN_GOLD)
                        {
                            play.LeftNotice("最低捐献"+MIN_GOLD.ToString()+"万金币起。");
                            return;
                        }
                        break;
                    }
            }

            play.GetBaseAttr().guanjue += (uint)gold;

            SetValue(play.GetBaseAttr().player_id,play.GetName() ,play.GetBaseAttr().guanjue);
            //通知客户端

            //重新计算一下等级
            GameStruct.GUANGJUELEVEL level = this.GetLevel(play);
            //爵位被改变- 发公告
            if (oldlv != level)
            {
                this.SendChangeGuanJueMsg(play, level);
            }
            if (level != play.GetGuanJue())
            {
                play.SetGuanJue(level);

            }
            this.SendGuanJueInfo(play);

            DB_Update(play);
        }