private void MakeReadySolList() { if (this.SortwithoutHelpsol) { this.SolSortTypeList.SetVisible(false); NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1); NrSoldierList soldierList = charPersonInfo.GetSoldierList(); NkSoldierInfo[] kSolInfo = soldierList.m_kSolInfo; for (int i = 0; i < kSolInfo.Length; i++) { NkSoldierInfo nkSoldierInfo = kSolInfo[i]; if (!nkSoldierInfo.IsLeader()) { if (nkSoldierInfo.GetFriendPersonID() <= 0L) { this.AddSolList(nkSoldierInfo, eSOL_POSTYPE.SOLPOS_BATTLE); } } } } NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList(); foreach (NkSoldierInfo current in readySolList.GetList().Values) { if (!this.SortwithoutHelpsol || current.GetFriendPersonID() <= 0L) { if (current.GetSolPosType() != 6) { this.AddSolList(current, eSOL_POSTYPE.SOLPOS_READY); } } } }
public NkSoldierInfo IsHelpSol(long FriendPersonID) { NkSoldierInfo[] kSolInfo = this.m_kSolInfo; for (int i = 0; i < kSolInfo.Length; i++) { NkSoldierInfo nkSoldierInfo = kSolInfo[i]; if (nkSoldierInfo.GetFriendPersonID() == FriendPersonID) { return(nkSoldierInfo); } } return(null); }
private void OnClickUnsetSolHelp(IUIObject obj) { NkSoldierInfo nkSoldierInfo = (NkSoldierInfo)obj.Data; if (nkSoldierInfo == null) { return; } GS_FRIEND_HELPSOL_UNSET_REQ gS_FRIEND_HELPSOL_UNSET_REQ = new GS_FRIEND_HELPSOL_UNSET_REQ(); gS_FRIEND_HELPSOL_UNSET_REQ.i64FriendPersonID = nkSoldierInfo.GetFriendPersonID(); gS_FRIEND_HELPSOL_UNSET_REQ.i64SolID = nkSoldierInfo.GetSolID(); gS_FRIEND_HELPSOL_UNSET_REQ.i64AddExp = nkSoldierInfo.AddHelpExp; SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_FRIEND_HELPSOL_UNSET_REQ, gS_FRIEND_HELPSOL_UNSET_REQ); }
public void MsgBoxOKUnsetSolHelp(object a_oObject) { NkSoldierInfo nkSoldierInfo = a_oObject as NkSoldierInfo; if (nkSoldierInfo == null) { return; } GS_FRIEND_HELPSOL_UNSET_REQ gS_FRIEND_HELPSOL_UNSET_REQ = new GS_FRIEND_HELPSOL_UNSET_REQ(); gS_FRIEND_HELPSOL_UNSET_REQ.i64FriendPersonID = nkSoldierInfo.GetFriendPersonID(); gS_FRIEND_HELPSOL_UNSET_REQ.i64SolID = nkSoldierInfo.GetSolID(); gS_FRIEND_HELPSOL_UNSET_REQ.i64AddExp = nkSoldierInfo.AddHelpExp; SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_FRIEND_HELPSOL_UNSET_REQ, gS_FRIEND_HELPSOL_UNSET_REQ); }
private bool SetButtonLegendReincarnate() { bool result = true; for (int i = 0; i < 5; i++) { if (this.m_eElement_Msg[i] >= eElement_MsgType.eElement_NOTSOL && this.m_eElement_Msg[i] <= eElement_MsgType.eElement_NEEDGRADE) { result = false; } } for (int j = 0; j < 5; j++) { NkSoldierInfo legendSolInfo = this.m_Element_SolID.GetLegendSolInfo(j); if (legendSolInfo == null) { result = false; break; } if (legendSolInfo.GetFriendPersonID() != 0L) { result = false; break; } for (int k = 0; k < 6; k++) { if (legendSolInfo.GetEquipItemInfo() != null) { ITEM item = legendSolInfo.GetEquipItemInfo().m_kItem[k].GetItem(); if (item != null) { if (item.m_nItemUnique != 0) { result = false; break; } } } } } return(result); }
private void MakeAllSolList() { NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1); NrSoldierList soldierList = charPersonInfo.GetSoldierList(); NkSoldierInfo[] kSolInfo = soldierList.m_kSolInfo; for (int i = 0; i < kSolInfo.Length; i++) { NkSoldierInfo nkSoldierInfo = kSolInfo[i]; bool flag = true; if (this.m_pkParentDlg != null && this.m_pkParentDlg.WindowID == 382) { flag = false; } if (!flag || this.loadType == SolMilitarySelectDlg.LoadType.SOLMILITARYGROUP_LEADERCHANGE || nkSoldierInfo.GetFriendPersonID() <= 0L) { this.AddSolList(nkSoldierInfo, eSOL_POSTYPE.SOLPOS_BATTLE); } } NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList(); foreach (NkSoldierInfo current in readySolList.GetList().Values) { if (current.GetSolPosType() != 6) { this.AddSolList(current, eSOL_POSTYPE.SOLPOS_READY); } } }
public void OnReincarnateOK(object a_oObject) { NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo; if (kMyCharInfo == null) { return; } int num = 0; byte bCharGrade = 0; long[] array = new long[5]; for (int i = 0; i < 5; i++) { if (this.m_MaterialSol.i32BaseCharKind == this.m_SelectSlotData.i32KindInfo) { this.m_MaterialSol.GetCharData((byte)i, ref num, ref bCharGrade); } this.m_eElement_Msg[i] = eElement_MsgType.eElement_NOTSOL; if (num == 0) { this.m_eElement_Msg[i] = eElement_MsgType.eElement_OK; array[i] = 0L; } else { NkSoldierInfo battleSolDataCheck = this.GetBattleSolDataCheck(ref this.m_eElement_Msg[i], num, bCharGrade); if (battleSolDataCheck == null) { Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1649"), SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE); return; } if (battleSolDataCheck.GetSolPosType() != 0) { if (battleSolDataCheck.GetSolPosType() == 2 || battleSolDataCheck.GetSolPosType() == 6) { Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("384"), SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE); return; } TsLog.LogWarning("!!!!!!!!!!!!!! CharKind {0} : SOL Pos{1} == Char Sol Pos Type", new object[] { num, battleSolDataCheck.GetSolPosType() }); return; } else { for (int j = 0; j < 6; j++) { ITEM item = battleSolDataCheck.GetEquipItemInfo().m_kItem[j].GetItem(); if (item == null) { TsLog.LogWarning("!!!!!!!!!!!!!! CharKind {0} : Item pos{1} == ITEM NULL ", new object[] { num, j }); return; } if (item.m_nItemUnique != 0) { Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("383"), SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE); return; } } if (battleSolDataCheck.GetFriendPersonID() != 0L) { TsLog.LogWarning("!!!!!!!!!!!!!! CharKind {0} : Set FriendSOLHELP ", new object[] { battleSolDataCheck.GetName() }); return; } array[i] = battleSolDataCheck.GetSolID(); } } } long num2 = 0L; if (this.m_MaterialSol.i32BaseCharKind == this.m_SelectSlotData.i32KindInfo) { num2 = this.m_MaterialSol.i64Money; } if (num2 > kMyCharInfo.m_Money) { Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("89"), SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE); return; } GS_ELEMENT_SOL_GET_REQ gS_ELEMENT_SOL_GET_REQ = new GS_ELEMENT_SOL_GET_REQ(); gS_ELEMENT_SOL_GET_REQ.i64PersonID = kMyCharInfo.m_PersonID; gS_ELEMENT_SOL_GET_REQ.i32CharKind = this.m_SelectSlotData.i32KindInfo; gS_ELEMENT_SOL_GET_REQ.i64SolID = array; SendPacket.GetInstance().SendObject(1838, gS_ELEMENT_SOL_GET_REQ); }
private void SetReincarnateListBox(ref NewListItem item, int i, int i32CharKind, byte bCharRank, bool bElement) { string text = string.Empty; NkSoldierInfo battleSolDataCheck = this.GetBattleSolDataCheck(ref this.m_eElement_Msg[i], i32CharKind, bCharRank); NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(i32CharKind); if (charKindInfo == null) { TsLog.LogOnlyEditor("!!!!!!!!!! SolGuild - Element CharKind " + i32CharKind + " Error"); return; } item.SetListItemData(8, false); item.SetListItemData(9, false); item.SetListItemData(10, false); item.SetListItemData(11, false); NkListSolInfo nkListSolInfo = new NkListSolInfo(); nkListSolInfo.SolCharKind = i32CharKind; nkListSolInfo.SolGrade = (int)(bCharRank - 1); item.SetListItemData(3, nkListSolInfo, null, null, null); item.SetListItemData(4, charKindInfo.GetName(), null, null, null); text = this.GetElementSolMsg(this.m_eElement_Msg[i]); item.SetListItemData(5, text, null, null, null); if (this.m_eElement_Msg[i] == eElement_MsgType.eElement_OK || this.m_eElement_Msg[i] == eElement_MsgType.eElement_SOLHEIGHT) { item.SetListItemData(0, true); item.SetListItemData(1, false); item.SetListItemData(7, battleSolDataCheck.GetListSolInfo(false), null, null, null); } else { item.SetListItemData(0, false); item.SetListItemData(1, true); if (battleSolDataCheck == null) { item.SetListItemData(7, false); return; } item.SetListItemData(7, battleSolDataCheck.GetListSolInfo(false), null, null, null); } if (bElement) { bool flag = false; for (int j = 0; j < 6; j++) { if (battleSolDataCheck.GetEquipItemInfo() != null) { ITEM item2 = battleSolDataCheck.GetEquipItemInfo().m_kItem[j].GetItem(); if (item2 == null) { TsLog.LogWarning("!!!!!!!!!!!!!! CharKind {0} : Item pos{1} == ITEM NULL ", new object[] { i32CharKind, j }); } else if (item2.m_nItemUnique != 0) { flag = true; } } } if (flag) { item.SetListItemData(5, false); text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("627"); item.SetListItemData(8, true); item.SetListItemData(9, true); item.SetListItemData(9, text, battleSolDataCheck, new EZValueChangedDelegate(this.OnClickReleaseEquip), null); } else if (battleSolDataCheck.GetFriendPersonID() != 0L) { item.SetListItemData(5, false); text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("74"); item.SetListItemData(8, true); item.SetListItemData(9, true); item.SetListItemData(9, text, battleSolDataCheck, new EZValueChangedDelegate(this.OnClickUnsetSolHelp), null); } } item.Data = battleSolDataCheck.GetSolID(); }
public void AddLegendElement(NkSoldierInfo kSoldierInfo, int iCount) { byte b = this.m_CharKind_Legendinfo.ui8Base_LegendGrade[iCount] - 1; NkSoldierInfo nkSoldierInfo = null; eElement_MsgType eElement_MsgType = eElement_MsgType.eElement_NONE; this.GetLegendSolGradeCheck(ref nkSoldierInfo, ref eElement_MsgType, kSoldierInfo, b); if (nkSoldierInfo == null) { return; } NewListItem newListItem = new NewListItem(this.m_NewListBox_Reincarnate.ColumnNum, true, string.Empty); NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(nkSoldierInfo.GetCharKind()); if (charKindInfo == null) { TsLog.LogOnlyEditor("!!!!!!!!!! SolGuild - Element CharKind " + nkSoldierInfo.GetCharKind() + " Error"); return; } int num = COMMON_CONSTANT_Manager.GetInstance().GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_LEGEND_ADVENT_HERO); if (num < 0) { num = 0; } this.m_eElement_Msg[iCount] = eElement_MsgType; if (kSoldierInfo.GetCharKind() == num) { this.m_eElement_Msg[iCount] = eElement_MsgType.eElement_OK; } newListItem.SetListItemData(8, false); newListItem.SetListItemData(9, false); newListItem.SetListItemData(3, new NkListSolInfo { SolCharKind = this.m_CharKind_Legendinfo.i32Base_CharKind[iCount], SolGrade = (int)b }, null, null, null); newListItem.SetListItemData(4, charKindInfo.GetName(), null, null, null); string text = this.GetElementSolMsg(this.m_eElement_Msg[iCount]); newListItem.SetListItemData(5, text, null, null, null); if (nkSoldierInfo == null) { UIBaseInfoLoader uIBaseInfoLoader = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_B_Addlist"); if (uIBaseInfoLoader != null) { newListItem.SetListItemData(10, uIBaseInfoLoader, iCount, new EZValueChangedDelegate(this.OnClickUseSol), null); } else { newListItem.SetListItemData(10, string.Empty, iCount, new EZValueChangedDelegate(this.OnClickUseSol), null); } } else { UIBaseInfoLoader uIBaseInfoLoader2 = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_B_Addlist"); if (uIBaseInfoLoader2 != null) { newListItem.SetListItemData(10, uIBaseInfoLoader2, iCount, new EZValueChangedDelegate(this.OnClickUseSol), null); } } if (this.m_eElement_Msg[iCount] == eElement_MsgType.eElement_OK || this.m_eElement_Msg[iCount] == eElement_MsgType.eElement_SOLHEIGHT) { newListItem.SetListItemData(0, true); newListItem.SetListItemData(1, false); newListItem.SetListItemData(11, false); if (nkSoldierInfo == null) { newListItem.SetListItemData(6, false); newListItem.SetListItemData(7, false); return; } newListItem.SetListItemData(6, true); newListItem.SetListItemData(7, nkSoldierInfo.GetListSolInfo(false), null, null, null); this.m_Element_SolID.SetLegendSol(nkSoldierInfo, iCount); } else { newListItem.SetListItemData(0, false); newListItem.SetListItemData(1, true); if (nkSoldierInfo == null) { newListItem.SetListItemData(6, false); newListItem.SetListItemData(7, false); newListItem.SetListItemData(11, false); return; } newListItem.SetListItemData(6, true); newListItem.SetListItemData(7, nkSoldierInfo.GetListSolInfo(false), null, null, null); newListItem.SetListItemData(11, true); this.m_Element_SolID.SetLegendSol(nkSoldierInfo, iCount); } bool flag = false; for (int i = 0; i < 6; i++) { if (nkSoldierInfo.GetEquipItemInfo() != null) { ITEM item = nkSoldierInfo.GetEquipItemInfo().m_kItem[i].GetItem(); if (item == null) { TsLog.LogWarning("!!!!!!!!!!!!!! CharKind {0} : Item pos{1} == ITEM NULL ", new object[] { nkSoldierInfo.GetCharKind(), i }); } else if (item.m_nItemUnique != 0) { flag = true; } } } if (flag) { newListItem.SetListItemData(5, false); text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("627"); newListItem.SetListItemData(8, true); newListItem.SetListItemData(9, true); newListItem.SetListItemData(9, text, nkSoldierInfo, new EZValueChangedDelegate(this.OnClickReleaseEquip), null); } else if (nkSoldierInfo.GetFriendPersonID() != 0L) { newListItem.SetListItemData(5, false); text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("74"); newListItem.SetListItemData(8, true); newListItem.SetListItemData(9, true); newListItem.SetListItemData(9, text, nkSoldierInfo, new EZValueChangedDelegate(this.OnClickUnsetSolHelp), null); } newListItem.Data = nkSoldierInfo.GetSolID(); this.m_NewListBox_Reincarnate.RemoveAdd(iCount, newListItem); this.m_NewListBox_Reincarnate.RepositionItems(); this.SetButtonLegendReincarnate(); bool flag2 = this.SetButtonLegendTime(); if (!flag2) { this.m_btn_Legend.SetEnabled(flag2); } this.GetTimeToString(); }
public virtual void OnReincarnateOK(object a_oObject) { NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo; if (kMyCharInfo == null) { return; } long[] array = new long[5]; for (int i = 0; i < 5; i++) { this.m_eElement_Msg[i] = eElement_MsgType.eElement_NOTSOL; if (this.m_CharKind_Legendinfo.i32Base_CharKind[i] == 0) { this.m_eElement_Msg[i] = eElement_MsgType.eElement_OK; array[i] = 0L; } else { NkSoldierInfo legendSolInfo = this.m_Element_SolID.GetLegendSolInfo(i); if (legendSolInfo == null) { Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1649"), SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE); return; } if (legendSolInfo.GetSolPosType() != 0) { if (legendSolInfo.GetSolPosType() == 2 || legendSolInfo.GetSolPosType() == 6) { Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("384"), SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE); return; } TsLog.LogWarning("!!!!!!!!!!!!!! CharKind {0} : SOL Pos{1} == Char Sol Pos Type", new object[] { this.m_CharKind_Legendinfo.i32Base_CharKind[i], legendSolInfo.GetSolPosType() }); return; } else { for (int j = 0; j < 6; j++) { ITEM item = legendSolInfo.GetEquipItemInfo().m_kItem[j].GetItem(); if (item == null) { TsLog.LogWarning("!!!!!!!!!!!!!! CharKind {0} : Item pos{1} == ITEM NULL ", new object[] { this.m_CharKind_Legendinfo.i32Base_CharKind[i], j }); return; } if (item.m_nItemUnique != 0) { Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("383"), SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE); return; } } if (legendSolInfo.GetFriendPersonID() != 0L) { TsLog.LogWarning("!!!!!!!!!!!!!! CharKind {0} : Set FriendSOLHELP ", new object[] { legendSolInfo.GetName() }); return; } array[i] = legendSolInfo.GetSolID(); } } } long i64NeedMoney = this.m_CharKind_Legendinfo.i64NeedMoney; int itemCnt = NkUserInventory.GetInstance().GetItemCnt(this.m_CharKind_Legendinfo.i32EssenceUnique); if (i64NeedMoney > kMyCharInfo.m_Money) { Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("89"), SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE); return; } if (itemCnt < this.m_CharKind_Legendinfo.i32NeedEssence) { string empty = string.Empty; string itemNameByItemUnique = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(this.m_CharKind_Legendinfo.i32EssenceUnique); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("780"), "target", itemNameByItemUnique }); Main_UI_SystemMessage.ADDMessage(empty, SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE); return; } GS_ELEMENT_LEGENDSOL_GET_REQ gS_ELEMENT_LEGENDSOL_GET_REQ = new GS_ELEMENT_LEGENDSOL_GET_REQ(); gS_ELEMENT_LEGENDSOL_GET_REQ.i64PersonID = kMyCharInfo.m_PersonID; gS_ELEMENT_LEGENDSOL_GET_REQ.i32CharKind = this.m_CharKind_Legendinfo.i32Element_LegendCharkind; gS_ELEMENT_LEGENDSOL_GET_REQ.i64SolID = array; SendPacket.GetInstance().SendObject(1840, gS_ELEMENT_LEGENDSOL_GET_REQ); }