Пример #1
0
        public SkillSet(SkillSetData data, Dictionary <int, List <Behaviour> > behaviours)
        {
            Id         = data.Id;
            Icon       = data.Icon;
            Name       = I18N.Instance.Get(data.NameKey);
            Behaviours = behaviours;

            this.skillIds = data.Skills;
        }
Пример #2
0
    public void MakePlayerSyncData(bool bMakePartnerData)
    {
        //내 플레이어용 싱크데이터
        _playerSyncData = null;
        _playerSyncData = new _PlayerSyncData();

        PlayerUnitData myData = new PlayerUnitData();

        _playerSyncData.Init();

        Dictionary <AbilityType, float> playerStats = CalcPlayerStats();

        uint HELMETID = 0;
        uint CLOTHID  = 0;
        uint WEAPONID = 0;

        Item.EquipmentInfo tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.HELMET);
        if (tempInfo == null)
        {
            HELMETID = 0;
        }
        else
        {
            HELMETID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.CLOTH);
        if (tempInfo == null)
        {
            CLOTHID = 0;
        }
        else
        {
            CLOTHID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.WEAPON);
        if (tempInfo == null)
        {
            WEAPONID = 0;
        }
        else
        {
            WEAPONID = tempInfo.Id;
        }

        ushort[] skillLevel     = null;
        uint     equipCostumeId = 0;

        if (GetUserInfo().GetEquipCostume() == null)
        {
            Newbie.NewbieInfo newbieinfo = _LowDataMgr.instance.GetNewbieCharacterData(GetUserInfo()._userCharIndex);
            equipCostumeId = newbieinfo.CostumIdx;

            skillLevel = new ushort[] {
                1, 1, 1, 1, 1
            };
        }
        else
        {
            equipCostumeId = GetUserInfo().GetEquipCostume()._costmeDataIndex;
            skillLevel     = GetUserInfo().GetEquipCostume()._skillLevel;
        }

        SkillSetData skillSetData = GetUserInfo().GetEquipSKillSet();
        uint         skillSetId   = 0;

        uint[] skillIds = new uint[4];
        uint[] skillLv  = new uint[4];

        if (skillSetData == null)
        {
            switch (GetUserInfo().GetCharIdx())
            {
            case 11000:
                skillSetId = 100;
                break;

            case 12000:
                skillSetId = 200;
                break;

            case 13000:
                skillSetId = 300;
                break;
            }

            SkillTables.SkillSetInfo info = _LowDataMgr.instance.GetLowDataSkillSet(skillSetId);
            skillIds[0] = info.skill1;
            skillIds[1] = info.skill2;
            skillIds[2] = info.skill3;
            skillIds[3] = info.skill4;
            for (int i = 0; i < skillLv.Length; i++)
            {
                skillLv[i] = 1;
            }
        }
        else
        {
            skillSetId = skillSetData.SkillSetId;
            for (int i = 0; i < skillIds.Length; i++)
            {
                skillIds[i] = skillSetData.SkillId[i];
                skillLv[i]  = skillSetData.SkillLevel[i];
            }
        }

        myData.Init(0,
                    (int)eTeamType.Team1,
                    Nickname,
                    AccountUUID,
                    0,
                    GetUserInfo().GetCharIdx(),
                    HELMETID,
                    equipCostumeId,
                    CLOTHID,
                    WEAPONID,
                    skillSetId,
                    GetUserInfo().isHideCostum,
                    GetUserInfo()._Level,
                    GetUserInfo()._LeftTitle,
                    GetUserInfo()._RightTitle,
                    playerStats);

        uint skillIndex = 0;

        SkillTables.SkillSetInfo setInfo = _LowDataMgr.instance.GetLowDataSkillSet(skillSetId);
        for (int i = 0; i < setInfo.skill0.Count; i++)
        {
            uint.TryParse(setInfo.skill0[i], out skillIndex);
            myData.NormalAttackData[i] = new SkillData(skillIndex, (byte)skillLevel[0]);
        }

        myData.SkillData[0] = new SkillData(skillIds[0], (byte)skillLv[0]);
        myData.SkillData[1] = new SkillData(skillIds[1], (byte)skillLv[1]);
        myData.SkillData[2] = new SkillData(skillIds[2], (byte)skillLv[2]);
        myData.SkillData[3] = new SkillData(skillIds[3], (byte)skillLv[3]);

        for (int i = 0; i < setInfo.Chain.Count; i++)
        {
            uint.TryParse(setInfo.Chain[i], out skillIndex);
            myData.SkillData[4 + i] = new SkillData(skillIndex, (byte)skillLevel[1]);
        }

        _playerSyncData.playerSyncDatas.Add(myData);

        if (!bMakePartnerData)
        {
            return;
        }

        for (int i = 0; i < 2; i++)                                      //GetUserInfo().GetPartnerList().Count
        {
            _PartnerData partner = GetUserInfo().GetEquipPartner(i + 1); //슬롯 시작값이 1부터이다. i를 1부터 시작시키게 했다.

            if (partner != null)
            {
                Partner.PartnerDataInfo         partnerInfo  = partner.GetLowData();
                Dictionary <AbilityType, float> partnerStats = CalcPartnerStats(partner._NowLevel, partnerInfo, partnerInfo.Quality /*, partner._MinorGrade, partner._Enchant*/);

                PlayerUnitData partnerData = new PlayerUnitData();
                partnerData.Init((byte)(i + 1),
                                 (byte)eTeamType.Team1,
                                 partner.GetLocName(),                //"Partner0",
                                 2 + (ulong)i,
                                 0,
                                 partner._partnerDataIndex,
                                 partner._NowLevel,
                                 partnerStats);

                partnerData.NormalAttackData[0] = new SkillData(partnerInfo.skill0, 1);
                partnerData.SkillData[0]        = new SkillData(partnerInfo.skill1, 1);
                partnerData.SkillData[1]        = new SkillData(partnerInfo.skill2, 1);
                partnerData.SkillData[2]        = new SkillData(partnerInfo.skill3, 1);
                partnerData.SkillData[3]        = new SkillData(partnerInfo.skill4, 1);

                //파트너 버프 삭제
                //if (partner.GetBuffSkillToSlot(0) != null)
                //	if (partner.GetBuffSkillToSlot(0)._skillIndex != 0)
                //		partnerData.PassiveBuff[0] = new SkillData(partner.GetBuffSkillToSlot(0)._skillIndex, (byte)partner.GetBuffSkillToSlot(0)._skillLevel);

                //if (partner.GetBuffSkillToSlot(1) != null)
                //	if (partner.GetBuffSkillToSlot(1)._skillIndex != 0)
                //		partnerData.PassiveBuff[1] = new SkillData(partner.GetBuffSkillToSlot(1)._skillIndex, (byte)partner.GetBuffSkillToSlot(1)._skillLevel);

                //if (partner.GetBuffSkillToSlot(2) != null)
                //	if (partner.GetBuffSkillToSlot(2)._skillIndex != 0)
                //		partnerData.PassiveBuff[2] = new SkillData(partner.GetBuffSkillToSlot(2)._skillIndex, (byte)partner.GetBuffSkillToSlot(2)._skillLevel);

                //if (partner.GetBuffSkillToSlot(3) != null)
                //	if (partner.GetBuffSkillToSlot(3)._skillIndex != 0)
                //		partnerData.PassiveBuff[3] = new SkillData(partner.GetBuffSkillToSlot(3)._skillIndex, (byte)partner.GetBuffSkillToSlot(3)._skillLevel);

                _playerSyncData.partnerSyncDatas.Add(partnerData);
            }
        }
    }
Пример #3
0
    public void MakePlayerFreeFightSyncData(PMsgBattleMapEnterMapS netData)
    {
        //내 플레이어용 싱크데이터
        _playerSyncData = null;
        _playerSyncData = new _PlayerSyncData();

        PlayerUnitData myData = new PlayerUnitData();

        _playerSyncData.Init();

        Dictionary <AbilityType, float> playerStats = CalcPlayerStats();

        playerStats[AbilityType.HP]         = netData.UnHp;
        playerStats[AbilityType.SUPERARMOR] = netData.UnMaxSuperArmor;

        uint HELMETID = 0;
        uint CLOTHID  = 0;
        uint WEAPONID = 0;

        Item.EquipmentInfo tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.HELMET);
        if (tempInfo == null)
        {
            HELMETID = 0;
        }
        else
        {
            HELMETID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.CLOTH);
        if (tempInfo == null)
        {
            CLOTHID = 0;
        }
        else
        {
            CLOTHID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.WEAPON);
        if (tempInfo == null)
        {
            WEAPONID = 0;
        }
        else
        {
            WEAPONID = tempInfo.Id;
        }

        //ushort[] skillLevel = null;
        //uint equipCostumeId = 0;
        //if (GetUserInfo().GetEquipCostume() == null)
        //{
        //    Newbie.NewbieInfo newbieinfo = _LowDataMgr.instance.GetNewbieCharacterData(GetUserInfo()._userCharIndex);
        //    equipCostumeId = newbieinfo.CostumIdx;

        //    skillLevel = new ushort[] {
        //        1, 1, 1, 1, 1
        //    };
        //}
        //else
        //{
        //    equipCostumeId = GetUserInfo().GetEquipCostume()._costmeDataIndex;
        //    skillLevel = GetUserInfo().GetEquipCostume()._skillLevel;
        //}

        ushort[] skillLevel     = null;
        uint     equipCostumeId = 0;

        equipCostumeId = (uint)netData.UnCostumeId;
        skillLevel     = new ushort[] { 1, 1, 1, 1, 1 };

        //Item.CostumeInfo costumeData = _LowDataMgr.instance.GetLowDataCostumeInfo(equipCostumeId);
        SkillSetData skillSetData = GetUserInfo().GetEquipSKillSet();

        myData.Init(0,
                    0,
                    Nickname,
                    NetData.instance.AccountUUID,
                    0,
                    GetUserInfo().GetCharIdx(),
                    HELMETID,
                    equipCostumeId,
                    CLOTHID,
                    WEAPONID,
                    skillSetData.SkillSetId,
                    GetUserInfo().isHideCostum,
                    GetUserInfo()._Level,
                    GetUserInfo()._LeftTitle,
                    GetUserInfo()._RightTitle,
                    playerStats);

        uint skillIndex = 0;

        SkillTables.SkillSetInfo setInfo = _LowDataMgr.instance.GetLowDataSkillSet(skillSetData.SkillSetId);
        for (int i = 0; i < setInfo.skill0.Count; i++)
        {
            uint.TryParse(setInfo.skill0[i], out skillIndex);
            myData.NormalAttackData[i] = new SkillData(skillIndex, (byte)skillLevel[0]);
        }

        myData.SkillData[0] = new SkillData(skillSetData.SkillId[0], (byte)skillSetData.SkillLevel[0]);
        myData.SkillData[1] = new SkillData(skillSetData.SkillId[1], (byte)skillSetData.SkillLevel[1]);
        myData.SkillData[2] = new SkillData(skillSetData.SkillId[2], (byte)skillSetData.SkillLevel[2]);
        myData.SkillData[3] = new SkillData(skillSetData.SkillId[3], (byte)skillSetData.SkillLevel[3]);

        for (int i = 0; i < setInfo.Chain.Count; i++)
        {
            uint.TryParse(setInfo.Chain[i], out skillIndex);
            myData.SkillData[4 + i] = new SkillData(skillIndex, (byte)skillLevel[1]);
        }
        _playerSyncData.playerSyncDatas.Add(myData);
    }