/// <summary> /// 装备技能[没有新技能提示弹出了] /// </summary> /// <param name="itemFielInfo"></param> public void SendEquiptItemToserver() { SkillEquipEntity skillEquipEntity = new SkillEquipEntity(); skillEquipEntity.Skills = new System.Collections.Generic.Dictionary <byte, ushort>(); for (int i = 0; i < m_equipSkillList.Length; i++) { if (m_equipSkillList[i] == null) { m_equipSkillList[i] = itemFielInfo; break; } } for (int i = 0; i < m_equipSkillList.Length; i++) { if (m_equipSkillList[i] != null) { skillEquipEntity.Skills.Add((byte)i, (byte)m_equipSkillList[i].localSkillData.m_skillId); } else { skillEquipEntity.Skills.Add((byte)i, 0); } } NetServiceManager.Instance.EntityService.SendSkillEquip(skillEquipEntity); }
//装备技能// public void UpdateAssembleSkill(SkillEquipEntity skillEquipEntity) { for (byte index = 0; index < wSkillEquipList.Length; index++) { if (skillEquipEntity.Skills.ContainsKey(index)) { wSkillEquipList[index] = skillEquipEntity.Skills[index]; } } SkillModel.Instance.DealSkillAdUpStrengthen(); }
public Dictionary <byte, ushort> Skills; //技能装备栏上的技能集合 public static SkillEquipEntity ParsePackage(byte[] data) { SkillEquipEntity skillEquipEntity = new SkillEquipEntity(); skillEquipEntity.Skills = new Dictionary <byte, ushort>(); int off = 0; ushort skill1, skill2, skill3, skill4; off += PackageHelper.ReadData(data.Skip(off).ToArray(), out skill1); off += PackageHelper.ReadData(data.Skip(off).ToArray(), out skill2); off += PackageHelper.ReadData(data.Skip(off).ToArray(), out skill3); off += PackageHelper.ReadData(data.Skip(off).ToArray(), out skill4); skillEquipEntity.Skills.Add(0, skill1); skillEquipEntity.Skills.Add(1, skill2); skillEquipEntity.Skills.Add(2, skill3); skillEquipEntity.Skills.Add(3, skill4); return(skillEquipEntity); }
void SetSkillEquipInfoToSever(SingleSkillInfo RemovesingleSkillInfo, SingleSkillInfo AddsingleSkillInfo, int index) { SkillEquipEntity skillEquipEntity = new SkillEquipEntity(); skillEquipEntity.Skills = new System.Collections.Generic.Dictionary <byte, ushort>(); SingleSkillInfo[] equipSkillsList = SingleSkillInfoList.EquipSkillsList; int addPreIndex = -1; for (int i = 0; i < equipSkillsList.Length; i++) { if (AddsingleSkillInfo == equipSkillsList[i]) { addPreIndex = i; } } //替换与被替换都不为空。由两个技能位置互换位置 if (addPreIndex != -1) { equipSkillsList[addPreIndex] = RemovesingleSkillInfo; } equipSkillsList[index] = AddsingleSkillInfo; for (int i = 0; i < equipSkillsList.Length; i++) { if (equipSkillsList[i] != null) { skillEquipEntity.Skills.Add((byte)i, (byte)equipSkillsList[i].localSkillData.m_skillId); } else { skillEquipEntity.Skills.Add((byte)i, 0); } } skillEquipEntity.Skills.ApplyAllItem(P => { TraceUtil.Log(SystemModel.Rocky, "Send:" + P.Key + ":" + P.Value); }); NetServiceManager.Instance.EntityService.SendSkillEquip(skillEquipEntity); }
void SetChuangeButtonToSever(SingleSkillInfo RemovesingleSkillInfo, SingleSkillInfo AddsingleSkillInfo) { SkillEquipEntity skillEquipEntity = new SkillEquipEntity(); skillEquipEntity.Skills = new System.Collections.Generic.Dictionary <byte, ushort>(); SingleSkillInfo[] equipSkillsList = SkillsPanelManager.m_playerSkillList.EquipSkillsList; if (RemovesingleSkillInfo != null) { for (int i = 0; i < equipSkillsList.Length; i++) { if (RemovesingleSkillInfo == equipSkillsList[i]) { equipSkillsList[i] = null; } } } if (AddsingleSkillInfo != null) { equipSkillsList[Index] = AddsingleSkillInfo; } for (int i = 0; i < equipSkillsList.Length; i++) { if (equipSkillsList[i] != null) { skillEquipEntity.Skills.Add((byte)i, (byte)equipSkillsList[i].localSkillData.m_skillId); } else { skillEquipEntity.Skills.Add((byte)i, 0); } } NetServiceManager.Instance.EntityService.SendSkillEquip(skillEquipEntity); //SoundManager.Instance.PlaySoundEffect("sound0048"); }