public override void Parse(GameBitBuffer buffer) { Field0 = buffer.ReadInt(32); tNPCInteraction = new NPCInteraction[buffer.ReadInt(5)]; for (int i = 0; i < tNPCInteraction.Length; i++) { tNPCInteraction[i] = new NPCInteraction(); tNPCInteraction[i].Parse(buffer); } Field2 = buffer.ReadInt(2); }
public override void Parse(GameBitBuffer buffer) { ActorID = buffer.ReadUInt(32); tNPCInteraction = new NPCInteraction[buffer.ReadInt(5)]; for (int i = 0; i < tNPCInteraction.Length; i++) { tNPCInteraction[i] = new NPCInteraction(); tNPCInteraction[i].Parse(buffer); } Type = (NPCInteractOptionsType) buffer.ReadInt(2); }
public override void OnTargeted(Player player, TargetMessage message) { player.SelectedNPC = this; var count = Interactions.Count + Conversations.Count; if (count == 0) return; NPCInteraction[] npcInters = new NPCInteraction[count]; var it = 0; foreach(var conv in Conversations) { npcInters[it] = conv.AsNPCInteraction(this, player); it++; } foreach(var inter in Interactions) { npcInters[it] = inter.AsNPCInteraction(this, player); it++; } player.InGameClient.SendMessage(new NPCInteractOptionsMessage() { ActorID = this.DynamicID, tNPCInteraction = npcInters, Type = NPCInteractOptionsType.Normal }); // TODO: this has no effect, why is it sent? player.InGameClient.SendMessage(new Mooege.Net.GS.Message.Definitions.Effect.PlayEffectMessage() { ActorId = this.DynamicID, Effect = Net.GS.Message.Definitions.Effect.Effect.Unknown36 }); }
public override void OnTargeted(Player player, TargetMessage message) { player.SelectedNPC = this; var count = Interactions.Count + Conversations.Count; if (count == 0) return; // If there is only one conversation option, immediatly select it without showing menu if (Interactions.Count == 0 && Conversations.Count == 1) { player.Conversations.StartConversation(Conversations[0].ConversationSNO); Conversations[0].MarkAsRead(); UpdateConversationList(); return; } NPCInteraction[] npcInters = new NPCInteraction[count]; var it = 0; foreach(var conv in Conversations) { npcInters[it] = conv.AsNPCInteraction(this, player); it++; } foreach(var inter in Interactions) { npcInters[it] = inter.AsNPCInteraction(this, player); it++; } player.InGameClient.SendMessage(new NPCInteractOptionsMessage() { ActorID = this.DynamicID, tNPCInteraction = npcInters, Type = NPCInteractOptionsType.Normal }); // TODO: this has no effect, why is it sent? player.InGameClient.SendMessage(new Mooege.Net.GS.Message.Definitions.Effect.PlayEffectMessage() { ActorId = this.DynamicID, Effect = Net.GS.Message.Definitions.Effect.Effect.Unknown36 }); }