// ------------------------------------------------------------------ protected void SendScript(WorldClient client, DialogElement de) { var sb = new StringBuilder(); de.Render(ref sb); var xml = string.Format( "<call convention='thiscall' syncmode='non-sync'>" + "<this type='character'>{0}</this>" + "<function>" + "<prototype>void character::ShowTalkMessage(character, string)</prototype>" + "<arguments>" + "<argument type='character'>{0}</argument>" + "<argument type='string'>{1}</argument>" + "</arguments>" + "</function>" + "</call>", client.Character.Id, HttpUtility.HtmlEncode(sb.ToString())); this.SendScript(client, xml); }
public virtual void Msg(WorldClient client, string text, params DialogElement[] elements) { var msg = new DialogElement(); // Check for a custom face if (this.IsEnabled(client, Options.Face)) { var dval = this.GetDialogFace(client); if (dval != null) msg.Add(new DialogPortrait(dval)); } else msg.Add(new DialogPortrait(null)); // Check for a custom title if (this.IsEnabled(client, Options.Name)) { var dval = this.GetDialogName(client); if (dval != null) msg.Add(new DialogTitle(dval)); } else msg.Add(new DialogTitle(null)); msg.Add(new DialogText(text)); msg.Add(elements); this.SendScript(client, msg); }