Exemple #1
0
    public bool UpdateData(ulong marketID, ItemPageInfo pageInfo = null, GameCmd.ItemSerialize serverdata = null, ItemSellTimeInfo selltime = null)
    {
        bool success = false;

        if (marketID != 0)
        {
            this.Market_ID = marketID;
            if (pageInfo != null)
            {
                this.page_info = pageInfo;
            }
            if (serverdata != null)
            {
                this.server_data = serverdata;
            }
            if (selltime != null)
            {
                this.sell_timeInfo = selltime;
            }
            success = true;
        }
        return(success);
    }
Exemple #2
0
    public static ViewPlayerData BuildViewData(uint uid, string name, uint job, int level, uint sex = 0)
    {
        retData          = new ViewPlayerData();
        retData.job      = job;
        retData.sex      = sex;
        retData.userid   = uid;
        retData.username = name;
        table.RobotDataBase data = GameTableManager.Instance.GetTableItem <table.RobotDataBase>(job, level);
        if (data != null)
        {
            retData.power = data.power;

            retData.user_level = data.dwLevel;

            retData.viewRoleData       = new GameCmd.ViewRoleData();
            retData.viewRoleData.maxhp = (uint)(data.hp * 1.15f);
            retData.viewRoleData.maxsp = (uint)(data.mp * 1.15f);

            retData.viewRoleData.pdam_min = (uint)(data.pdam * 0.8f);
            retData.viewRoleData.pdam_max = (uint)(data.pdam * 1.15f);

            retData.viewRoleData.mdam_min = (uint)(data.mdam * 0.8f);
            retData.viewRoleData.mdam_max = (uint)(data.mdam * 1.15f);

            retData.viewRoleData.pdef_min = (uint)(data.mdef * 0.8f);
            retData.viewRoleData.pdef_max = (uint)(data.mdef * 1.15f);

            retData.viewRoleData.liliang      = data.liliang;
            retData.viewRoleData.minjie       = data.minjie;
            retData.viewRoleData.zhili        = data.zhili;
            retData.viewRoleData.tizhi        = data.tizhi;
            retData.viewRoleData.jingshen     = data.jingshen;
            retData.viewRoleData.esdam        = data.esdam;
            retData.viewRoleData.ssdam        = data.ssdam;
            retData.viewRoleData.lsdam        = data.lsdam;
            retData.viewRoleData.vsdam        = data.vsdam;
            retData.viewRoleData.lucky        = data.lucky;
            retData.viewRoleData.mlucky       = data.mlucky;
            retData.viewRoleData.criti_ratio  = data.criti_ratio;
            retData.viewRoleData.cure         = data.cure;
            retData.viewRoleData.phit         = data.phit;
            retData.viewRoleData.hide_per     = data.hide_per;
            retData.viewRoleData.pabs         = data.pabs;
            retData.viewRoleData.mabs         = data.mabs;
            retData.viewRoleData.harm_add_per = data.harm_add_per;
            retData.viewRoleData.harm_sub_per = data.harm_sub_per;

            List <uint> equipList = new List <uint>();

            /*1;    //  头盔
            *  2;    //  护肩
            *  3;    //  上衣
            *  4;    //  护腿
            *  5;    //  戒指
            *  7;    //  盾牌
            *  8;    //  武器
            *  9;    //  鞋子
            *  10;   //  护腕
            *  11;   //  腰带
            *  12;   //  披风
            *  13;   //  项链*/
            equipList.Add(data.Hat);
            equipList.Add(data.Shoulder);
            equipList.Add(data.Coat);
            equipList.Add(data.Leg);
            equipList.Add(data.Adornl_1);
            equipList.Add(data.Adornl_2);
            equipList.Add(data.Shield);
            equipList.Add(data.Equip);
            equipList.Add(data.Shoes);
            equipList.Add(data.Cuff);
            equipList.Add(data.Belf);
            equipList.Add(data.Necklace);

            GameCmd.ItemSerialize item = null;
            for (int i = 0; i < equipList.Count; i++)
            {
                if (equipList[i] == 0)
                {
                    continue;
                }
                table.ItemDataBase itemdb = GameTableManager.Instance.GetTableItem <table.ItemDataBase>(equipList[i]);
                if (itemdb == null)
                {
                    continue;
                }
                //GameCmd.eItemAttribute
                item            = new GameCmd.ItemSerialize();
                item.dwObjectID = equipList[i];

                GameCmd.EquipPos[] pos = EquipDefine.GetEquipPosByEquipType((GameCmd.EquipType)itemdb.subType);
                if (pos.Length == 2)
                {
                    uint loc = 0;
                    if (i == 4)
                    {
                        loc = ItemDefine.TransformLocal2ServerLocation(GameCmd.PACKAGETYPE.PACKAGETYPE_EQUIP, new UnityEngine.Vector2()
                        {
                            x = 0, y = (int)pos[0]
                        });
                    }
                    else if (i == 5)
                    {
                        loc = ItemDefine.TransformLocal2ServerLocation(GameCmd.PACKAGETYPE.PACKAGETYPE_EQUIP, new UnityEngine.Vector2()
                        {
                            x = 0, y = (int)pos[1]
                        });
                    }

                    item.pos = new GameCmd.tItemLocation()
                    {
                        loc = loc
                    };
                }
                else if (pos.Length == 1)
                {
                    uint loc = ItemDefine.TransformLocal2ServerLocation(GameCmd.PACKAGETYPE.PACKAGETYPE_EQUIP, new UnityEngine.Vector2()
                    {
                        x = 0, y = (int)pos[0]
                    });
                    item.pos = new GameCmd.tItemLocation()
                    {
                        loc = loc
                    };
                }
                item.dwNum = 1;
                item.numbers.Add(new GameCmd.PairNumber()
                {
                    id = (int)GameCmd.eItemAttribute.Item_Attribute_Bind, value = itemdb.bindMask
                });
                item.numbers.Add(new GameCmd.PairNumber()
                {
                    id = (int)GameCmd.eItemAttribute.Item_Attribute_Grade, value = itemdb.grade
                });

                table.EquipDataBase equipdb = GameTableManager.Instance.GetTableItem <table.EquipDataBase>(itemdb.itemID);
                if (equipdb == null)
                {
                    continue;
                }
                item.numbers.Add(new GameCmd.PairNumber()
                {
                    id = (int)GameCmd.eItemAttribute.Item_Attribute_Dur, value = equipdb.maxDurable
                });
                item.numbers.Add(new GameCmd.PairNumber()
                {
                    id = (int)GameCmd.eItemAttribute.Item_Attribute_HoleNum, value = 0
                });
                item.numbers.Add(new GameCmd.PairNumber()
                {
                    id = (int)GameCmd.eItemAttribute.Item_Attribute_FightPower, value = equipdb.fightPower
                });

                retData.itemList.Add(item);

                if (equipdb.act_show != 0)
                {
                    table.SuitDataBase suitDb = GameTableManager.Instance.GetTableItem <table.SuitDataBase>(equipdb.act_show, 1);
                    if (suitDb != null)
                    {
                        retData.suit_data.Add(new GameCmd.SuitData()
                        {
                            baseid = suitDb.base_id, suit_type = (GameCmd.EquipSuitType)suitDb.type
                        });
                    }
                }
            }
        }

        return(retData);
    }
Exemple #3
0
 public ConsignmentItem(ulong marketID, ItemPageInfo pageInfo = null, GameCmd.ItemSerialize serverdata = null, ItemSellTimeInfo selltime = null)
 {
     UpdateData(marketID, pageInfo, serverdata, selltime);
 }