GetStrongLevel() public method

public GetStrongLevel ( ) : byte
return byte
Example #1
0
        public MsgPtichItemInfo(RoleItemInfo item,uint _ptich_obj_id,int _price,byte sell_byte,bool isRemote = false/*是否是远程摊位*/)
        {
            mMsgLen = 88;
            mParam = PacketProtoco.S_PTICH_ITEMINFO;

            //幻兽起始id
            if (item.typeid >= 2000000000)
            {
                postion = NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK;
                id = item.typeid;
                max_dura = cur_dura = 0;
            }
            else
            {
                id = item.id;
                postion = NetMsg.MsgItemInfo.ITEMPOSITION_BACKPACK;
                max_dura = cur_dura = (short)item.amount;//游戏当前损耗度无用
            }
            forgetname = item.forgename;
           
            ptich_obj_id = _ptich_obj_id;
            price = _price;
            base_item_id = item.itemid;

          //  { 98, 0, 84, 4, 110, 134, 61, 138, 67, 162, 1, 0, 14, 0, 0, 0, 118, 91, 16, 0, 0, 0, 0, 0, 3, 0, 53, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 9, 198, 230, 210, 236, 202, 222, 79, 208, 205, 0, 0, 0 };
         
            gem1 = item.GetGemType(0);
            gem2 = item.GetGemType(1);
            gem3 = item.GetGemType(2);
            strong_lv = item.GetStrongLevel();
            soul_lv = (short)item.war_ghost_exp;
            di_attack = item.di_attack;
            shui_attack = item.shui_attack;
            huo_attack = item.huo_attack;
            feng_attack = item.feng_attack;

            if (isRemote)
            {
                if (sell_byte == NetMsg.MsgOperateItem.PTICH_SELL_ITEM_GAMEGOLD)
                {
                    tag = 5;
                }
                else
                {
                    tag = 4;
                }
                
            }
            else
            {
                if (sell_byte == NetMsg.MsgOperateItem.PTICH_SELL_ITEM_GAMEGOLD)
                {
                    tag = 3;
                }
                else tag = 1;
            }

        }
Example #2
0
        //装备提升魔魂等级参数:玩家对象 道具基本id 道具id 是否百分百成功
        public void EquipStrong(PlayerObject play, uint srcid, uint materialid)
        {
            const int MOHUNJINGSHI = 1037150; //魔魂晶石id
            const int MOHUNZHIXIN  = 1037159; //魔魂之心id

            GameStruct.RoleItemInfo item         = play.GetItemSystem().FindItem(srcid);
            GameStruct.RoleItemInfo materialitem = play.GetItemSystem().FindItem(materialid);
            if (item == null || materialitem == null)
            {
                return;
            }
            if (item.GetStrongLevel() >= MAX_STRONGLEVEL)
            {
                return;
            }
            if (item.GetStrongLevel() >= mListStrong.Count)
            {
                return;
            }
            int  rand    = GameStruct.IRandom.Random(1, 100);
            bool bUpdate = false;

            NetMsg.MsgEquipOperationRet ret = new NetMsg.MsgEquipOperationRet();
            ret.Create(null, play.GetGamePackKeyEx());
            ret.srcid  = srcid;
            ret.destid = materialid;
            ret.type   = 196611;//{3,0,3,0}

            if (materialitem.itemid != MOHUNJINGSHI && item.GetStrongLevel() > 9)
            {
                return;                                                                   //大于9级后必须使用魔魂晶石提升等级
            }
            if (materialitem.itemid == MOHUNJINGSHI)
            {
                //检测是否有足够的魔魂晶石
                if (!play.GetItemSystem().DeleteItemByID(materialid))
                {
                    return;
                }
                if (rand < mListStrong[item.GetStrongLevel()].chance)
                {
                    item.UpStrongLevel(1);
                    bUpdate = true;
                    ret.ret = 1;
                }
                else
                {
                    ret.ret = 0;
                    //强化等级9以下不往下掉了 2016.1.24
                    if (item.GetStrongLevel() > 9 && item.DecStrongLevel())
                    {
                        bUpdate = true;
                    }
                }
            }
            else if (materialitem.itemid == MOHUNZHIXIN) //魔魂之心必成功
            {
                if (!play.GetItemSystem().DeleteItemByID(materialid))
                {
                    return;
                }
                item.UpStrongLevel(1);
                bUpdate = true;
                ret.ret = 1;
            }

            if (bUpdate)
            {
                play.GetItemSystem().UpdateItemInfo(item.id);
            }

            play.SendData(ret.GetBuffer());
        }