func (c *Connection) ReceiveDialogAnswer(_packet *pnet.Packet) { msg := pnetmsg.NewDialogMessage(0) msg.ReadPacket(_packet) if c.Owner.InteractingNpc != nil { c.Owner.InteractingNpc.OnDialogueAnswer(c.Owner.GetUID(), msg.AnswerId) } }
func (c *Connection) SendDialog(_type int, _npcId uint64, _title string, _options []string) { msg := pnetmsg.NewDialogMessage(_type) msg.SetNpcId(_npcId) msg.SetQuestion(_title, _options) c.SendMessage(msg) }