public GuildQuest(Tera.Game.TeraMessageReader r) : base(r) { targetsCount = r.ReadUInt16(); targetsOffset = r.ReadUInt16(); unk1 = r.ReadUInt16(); unk2 = r.ReadUInt16(); rewardsCount = r.ReadUInt16(); rewardsOffset = r.ReadUInt16(); unkOffset = r.ReadUInt16(); questIdOffset = r.ReadUInt16(); guildNameOffset = r.ReadUInt16(); questId = r.ReadUInt16(); unk3 = r.ReadUInt16(); questType = r.ReadUInt16(); unk5 = r.ReadUInt16(); guildSize = r.ReadUInt16(); unk6 = r.ReadUInt16(); unk7 = r.ReadUInt16(); unk8 = r.ReadUInt16(); unk9 = r.ReadUInt16(); unk10 = r.ReadUInt16(); questStatus = r.ReadUInt32(); timeLeft = r.ReadUInt32(); unk11 = r.ReadUInt32(); unk12 = r.ReadUInt32(); completed = r.ReadByte(); s1 = r.ReadTeraString(); s2 = r.ReadTeraString(); guildName = r.ReadTeraString(); Targets = new List <GuildQuestTarget>(); for (int i = 0; i < targetsCount; i++) { var t = new GuildQuestTarget(); r.Skip(4); t.ZoneId = r.ReadUInt32(); t.TemplateId = r.ReadUInt32(); t.AmountDone = r.ReadUInt32(); t.AmountRequired = r.ReadUInt32(); Targets.Add(t); } Rewards = new List <GuildQuestReward>(); for (int i = 0; i < rewardsCount; i++) { var re = new GuildQuestReward(); r.Skip(4); re.Id = r.ReadUInt32(); re.Amount = r.ReadUInt32(); re.Unk16 = r.ReadUInt32(); Rewards.Add(re); } }
private ParsedMessage Instantiate(string opCodeName, TeraMessageReader reader) { Type type; if (!OpcodeNameToType.TryGetValue(opCodeName, out type)) type = typeof(UnknownMessage); var constructor = type.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, CallingConventions.Any, new[] { typeof(TeraMessageReader) }, null); if (constructor == null) throw new Exception("Constructor not found"); return (ParsedMessage)constructor.Invoke(new object[] { reader }); }
public ParsedMessage Create(Message message) { var reader = new TeraMessageReader(message, _opCodeNamer); var opCodeName = _opCodeNamer.GetName(message.OpCode); return Instantiate(opCodeName, reader); }
public ParsedMessage Create(Message message) { var reader = new TeraMessageReader(message, _opCodeNamer, this, _sysMsgNamer); return(Instantiate(message.OpCode, reader)); }