public Conversation(string playerName, NPC npc) { PlayerI = Player.GlobalList[playerName]; NPC = npc; PlayerI.InConversation = true; PlayerI.CurrentConversation = this; CheckMessage = npc.ConversationChecks; SendNPCGreeting(); Server.OnUpdate += () => { if (PlayerI.InConversation) { Update(); } }; RegisterGoodbyeChecks(); }
private void RegisterGoodbyeChecks() { CheckMessage += (PlayerMessage pm) => { string[] comparisonString = new string[] { "BYE", "GOODBYE", "GOOD BYE", "CYA", "SEE YOU", "LATER", "CIAO", "SO LONG", "AU REVOIR", "ADIOS", "GODSPEED", "FAREWELL", "SEE YOU LATER" }; if (StringHelper.ContainsWordsInSequence(pm.Message, comparisonString)) { //End Conversation; PlayerI.InConversation = false; SendNPCFarewell(); } }; }