private async void Init() { await MobInfo.Load(new Progress <int>()); if (!isNewFile) { await QuestDialog.Load(new Progress <int>()); foreach (DataRow row in QuestDialog.Rows) { if (QuestStrings.ContainsKey(Convert.ToUInt16(row.ItemArray[0]))) { continue; } QuestStrings.Add(Convert.ToUInt16(row.ItemArray[0]), row.ItemArray[1].ToString()); } } foreach (DataRow row in MobInfo.Rows) { if (MobRows.ContainsKey(Convert.ToUInt16(row.ItemArray[0]))) { continue; } MobRows.Add(Convert.ToUInt16(row.ItemArray[0]), row.ItemArray); } }
public QuestDialog NextDialog() { if (currentDialogeIndex < questDialogs.Count) { currentQuestDialog = questDialogs[currentDialogeIndex]; currentDialogeIndex++; } return(currentQuestDialog); }
// QUEST LINES public bool StartDialog(QuestDialog questDialog, string speaker) { DialogueManager dialogue = GameObject.FindGameObjectWithTag("dialogWindow").GetComponent <DialogueManager>(); if (dialogue.speaker == speaker) { dialogue.SetDialog(questDialog.dialog); } return(dialogue.isLastPart()); }
public void StartDialog(QuestDialog q, string npcName) { ResetDialog(); _currentDialog = q.dialog; _dialogEvent = q.onDialogEnd; _invokeEvent = true; SetDialog(npcName); }
private void _questDialog(QuestState stateinfo, Dictionary <short, string> dialognames, List <string> pages, Dictionary <short, string> links) { if (QuestDialog.Instance == null) { QuestDialog.SetupInstance(m_packetAPI); } if (QuestDialog.Instance == null) { throw new InvalidOperationException("Something went wrong creating the instance"); } QuestDialog.Instance.SetDisplayData(stateinfo, dialognames, pages, links); }
private void HandleLeftClick() { bool mouseClicked = _currMouseState.LeftButton == ButtonState.Released && _prevMouseState.LeftButton == ButtonState.Pressed; if (mouseClicked && DrawArea.ContainsPoint(_currMouseState.X, _currMouseState.Y)) { if (OldWorld.Instance.MainPlayer.ActiveCharacter.NeedsSpellTarget) { var data = OldWorld.Instance.ESF[OldWorld.Instance.MainPlayer.ActiveCharacter.SelectedSpell]; if (data.TargetRestrict != SpellTargetRestrict.Friendly) { OldWorld.Instance.ActiveCharacterRenderer.SetSpellTarget(this); } else { //todo status label message "you cannot attack this NPC" OldWorld.Instance.MainPlayer.ActiveCharacter.SelectSpell(-1); } return; //don't process regular click on NPC while targeting a spell } PacketAPI api = ((EOGame)Game).API; switch (NPC.Data.Type) { case NPCType.Shop: ShopDialog.Show(api, this); break; case NPCType.Inn: break; case NPCType.Bank: BankAccountDialog.Show(api, NPC.Index); break; case NPCType.Barber: break; case NPCType.Guild: break; case NPCType.Priest: break; case NPCType.Law: break; case NPCType.Skills: SkillmasterDialog.Show(api, NPC.Index); break; case NPCType.Quest: QuestDialog.Show(api, NPC.Index, NPC.Data.VendorID, NPC.Data.Name); break; } } }
/// <summary> /// 선택이 종료되었을떄 호출된다 /// Called By SelectionUI /// </summary> private void OnSelectionComplete(int index) { this.selectedIndex = index; if (this.selectionList[this.selectedIndex].type == SelectionType.Chat) { // 잡담 ReadyDialog(this.chat); this.autoNextDialog = true; // 잡담이 끝나면 대사 종료 this.isEndDialog = true; } else if (this.selectionList[this.selectedIndex].type == SelectionType.Quest) { // 퀘스트 string questKey = this.selectionList[this.selectedIndex].key; // 퀘스트에 맞는 다이얼로그 정보를 불러온다. this.selectedDialog = GetDialog(questKey); if (!QuestManager.inst.HasQuest(questKey)) { // 퀘스트를 처음 받는다 ReadyDialog(this.selectedDialog.questText); this.questState = QuestState.First; } else { if (!QuestManager.inst.IsFinishProgress(questKey)) { // 퀘스트를 진행중이지만 완료를 못했다 ReadyDialog(this.selectedDialog.progressingText); this.questState = QuestState.Progrssing; this.isEndDialog = true; } else { // 퀘스트를 완료할 준비가 되었다. ReadyDialog(this.selectedDialog.completeText); this.questState = QuestState.Complete; } } this.autoNextDialog = true; } else if (this.selectionList[this.selectedIndex].type == SelectionType.Store) { //상점 ReadyDialog(new string[] { this.selectStoreText }); this.autoNextDialog = true; GameUI.inst.ViewStoreUI(() => { // 구매 완료 메세지 ReadyDialog(new string[] { this.buyText }); this.autoNextDialog = true; SoundManager.inst.PlaySound(SoundKeys.EFFECT_PURCHASE, this.transform.position); }, EndDialog); } }
public QuestDialog GetCurrentQuestDialog() { currentQuestDialog = questDialogs[currentDialogeIndex]; return(currentQuestDialog); }