static void SendNPCGFUpdateScripts(Character npc, uint charid) { List <string> scripts = BaseDB.GetScriptsForNPCInteraction(npc); //int scriptSize = 0; //foreach (string script in scripts) //scriptSize += 8 + script.Length; int scriptSize = scripts.Sum(script => 8 + script.Length); byte[] omsg = { 0x1A, 0x02 }; FLMsgType.AddUInt32(ref omsg, 56 + (uint)scriptSize); // size FLMsgType.AddUInt32(ref omsg, charid); // behaviourid FLMsgType.AddUInt32(ref omsg, npc.RoomID); FLMsgType.AddUInt8(ref omsg, 0); FLMsgType.AddUInt8(ref omsg, 0); FLMsgType.AddUInt8(ref omsg, 1); FLMsgType.AddUInt32(ref omsg, 0); FLMsgType.AddUInt32(ref omsg, 0); FLMsgType.AddUInt8(ref omsg, 1); FLMsgType.AddUInt32(ref omsg, 0); // count for some strings (maybe locations?) that don't appear to be used FLMsgType.AddInt32(ref omsg, scripts.Count); // count for behaviour scripts foreach (string script in scripts) { FLMsgType.AddAsciiStringLen32(ref omsg, script); // script name FLMsgType.AddUInt32(ref omsg, 0); // script path level } FLMsgType.AddUInt32(ref omsg, 0); // talkid (nothing, bribe, mission, rumor, info) FLMsgType.AddUInt32(ref omsg, charid); // charid FLMsgType.AddUInt32(ref omsg, 1); // dunno FLMsgType.AddUInt32(ref omsg, 0); // resourceid FLMsgType.AddUInt16(ref omsg, 0); // count FLMsgType.AddUInt32(ref omsg, 0); // resourceid FLMsgType.AddUInt16(ref omsg, 0); // count FLMsgType.AddUInt32(ref omsg, 0); // dunno Context.Sender.Tell(omsg); }