public NpcTalkDialog(Character character, Npc npc, NpcActionRecord action) : base(character) { this.Npc = npc; this.Action = action; this.MessageId = ushort.Parse(Action.Value1); this.Replies = GetPossibleReply(NpcReplyRecord.GetNpcReplies(this.MessageId)); }
static void Talk(WorldClient client, NpcSpawnRecord npc, NpcActionsRecord action) { if (action == null) { client.Character.Reply("Ce PNJ n'est pas apte a parler."); return; } ushort messageId = ushort.Parse(action.OptionalValue1); List <NpcReplyRecord> replies = NpcsRepliesProvider.GetPossibleReply(client, NpcReplyRecord.GetNpcReplies(messageId)); client.Character.CurrentDialogType = DialogTypeEnum.DIALOG_DIALOG; client.Send(new NpcDialogCreationMessage(npc.MapId, -npc.Id)); client.Send(new NpcDialogQuestionMessage(messageId, new string[] { "0" }, replies.ConvertAll <ushort>(x => (ushort)x.ReplyId))); }