public void SetTitle(uint title) { var updateTitle = new GameEventUpdateTitle(Session, title); var message = new GameMessageSystemChat($"Your title is now {title}!", ChatMessageType.Broadcast); Session.Network.EnqueueSend(updateTitle, message); }
public void SetTitle(uint title) { var updateTitle = new GameEventUpdateTitle(Session, title); var message = new GameMessageSystemChat($"Your title is now {title}!", ChatMessageType.Broadcast); NetworkManager.SendWorldMessages(Session, new GameMessage[] { updateTitle, message }); }
/// <summary> /// Add Title to Title Registry /// </summary> /// <param name="titleId">Id of Title to Add</param> /// <param name="setAsDisplayTitle">If this is true, make this the player's current title</param> public void AddTitle(uint titleId, bool setAsDisplayTitle = false) { if (!Enum.IsDefined(typeof(CharacterTitle), titleId)) { return; } var titlebook = new List <uint>(); foreach (var title in Biota.CharacterPropertiesTitleBook) { titlebook.Add(title.TitleId); } NumCharacterTitles = titlebook.Count(); bool sendMsg = false; bool notifyNewTitle = false; if (!titlebook.Contains(titleId)) { Biota.CharacterPropertiesTitleBook.Add(new Database.Models.Shard.CharacterPropertiesTitleBook { ObjectId = Guid.Full, TitleId = titleId }); titlebook.Add(titleId); NumCharacterTitles++; sendMsg = true; notifyNewTitle = true; } if (setAsDisplayTitle && CharacterTitleId != titleId) { CharacterTitleId = (int)titleId; sendMsg = true; } if (sendMsg && FirstEnterWorldDone) { var message = new GameEventUpdateTitle(Session, titleId, setAsDisplayTitle); Session.Network.EnqueueSend(message); if (notifyNewTitle) { Session.Network.EnqueueSend(new GameEventCommunicationTransientString(Session, "You have been granted a new title.")); } } }