private static void SendCommandToTileItem(string msg, string itemName, string pName) { if (itemName[itemName.Length - 1] == ' ') { itemName = itemName.Substring(0, itemName.Length - 1); } PlayerMessage plym = new PlayerMessage() { Message = msg, PlayerName = pName }; Tile tile = Player.GlobalList[pName.ToUpper()].CurrentTile; if (tile.ItemList.ContainsKey(itemName)) { tile.ItemList[itemName].CommandQueue.Enqueue(plym); } else { Chat.SendMessageToPlayer(pName, "There is no such thing silly."); } }
private static void SortLocal(string[] msg, string pName) { //Add colons back if split due to server split removal. string finString = msg[3]; if (msg.Length > 4) { for (int i = 4; i < msg.Length; i++) { finString += ":" + msg[i]; } } string[] firstWordSplit = finString.Split(' '); if (StringHelper.ContainsWordsInSequence(firstWordSplit[0], Spells.SpellInstancer.SpellNames())) { SendMessageToTile(Spells.SpellInstancer.GetParticleCastString(firstWordSplit[0]) + finString, Player.GlobalList[pName.ToUpper()]); } else { SendMessageToTile(finString, Player.GlobalList[pName.ToUpper()]); } //Checks if (LocalChatChecks != null) { LocalChatChecks.Invoke(finString, pName); } //Duck if (StringHelper.ContainsWordsInSequence(finString, "SUMMON DUCK")) { SendAnonymousMessageToTile(msg[1] + " summons a duck.", Player.GlobalList[msg[1].ToUpper()]); } //NPC if (firstWordSplit.Length > 1) { switch (firstWordSplit[0].ToUpper()) { case "HI": case "GREETINGS": case "HELLO": case "YO": case "SUP": case "HEY": case "HOWDY": case "MORNING": case "AFTERNOON": case "EVENING": case "ALOHA": case "BONJOUR": if (Player.GlobalList[pName.ToUpper()].CurrentTile.ContainsNPC(firstWordSplit[1])) { PlayerMessage ms = new PlayerMessage(); ms.PlayerName = pName; ms.Message = "TALK"; Player.GlobalList[pName.ToUpper()].CurrentTile.GetNPCFromResponsiveName(firstWordSplit[1]).CommandQueue.Enqueue(ms); } break; } } if (Player.GlobalList[pName.ToUpper()].InConversation) { if (Player.GlobalList[pName.ToUpper()].CurrentConversation != null) { PlayerMessage pm = new PlayerMessage(); pm.Message = finString; pm.PlayerName = pName.ToUpper(); Player.GlobalList[pName.ToUpper()].CurrentConversation.MessageQueue.Enqueue(pm); } } }