public static void Response(ClientInfo _cInfo)
 {
     if (OpenLotto)
     {
         string _phrase536;
         if (!Phrases.Dict.TryGetValue(536, out _phrase536))
         {
             _phrase536 = "A lottery is open for {Value} {CoinName}. Minimum buy in is {BuyIn}. Enter it by typing {CommandPrivate}{Command85}.";
         }
         int _value = LottoValue * LottoEntries.Count;
         _phrase536 = _phrase536.Replace("{Value}", _value.ToString());
         _phrase536 = _phrase536.Replace("{CoinName}", Wallet.Coin_Name);
         _phrase536 = _phrase536.Replace("{BuyIn}", LottoValue.ToString());
         _phrase536 = _phrase536.Replace("{CommandPrivate}", ChatHook.Command_Private);
         _phrase536 = _phrase536.Replace("{Command85}", Command85);
         ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase536 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
     }
     else
     {
         string _phrase535;
         if (!Phrases.Dict.TryGetValue(535, out _phrase535))
         {
             _phrase535 = "There is no open lottery. Type {CommandPrivate}{Command84} # to open a new lottery at that buy in price. You must have enough in your wallet.";
         }
         _phrase535 = _phrase535.Replace("{CommandPrivate}", ChatHook.Command_Private);
         _phrase535 = _phrase535.Replace("{Command84}", Command84);
         ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase535 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
     }
 }
Exemple #2
0
 public static void NewLotto(ClientInfo _cInfo, string _message, string _playerName)
 {
     if (!ShuttingDown)
     {
         if (OpenLotto)
         {
             int _winnings = LottoValue * LottoEntries.Count;
             Phrases.Dict.TryGetValue(222, out string _phrase222);
             _phrase222 = _phrase222.Replace("{Value}", _winnings.ToString());
             _phrase222 = _phrase222.Replace("{CoinName}", Wallet.Coin_Name);
             _phrase222 = _phrase222.Replace("{BuyIn}", LottoValue.ToString());
             _phrase222 = _phrase222.Replace("{CommandPrivate}", ChatHook.Chat_Command_Prefix1);
             _phrase222 = _phrase222.Replace("{Command85}", Command85);
             ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase222 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
         }
         else
         {
             int _lottoValue;
             if (int.TryParse(_message, out _lottoValue))
             {
                 if (_lottoValue > 0)
                 {
                     if (Wallet.GetCurrentCoins(_cInfo.playerId) >= _lottoValue)
                     {
                         OpenLotto  = true;
                         LottoValue = _lottoValue;
                         LottoEntries.Add(_cInfo);
                         Wallet.SubtractCoinsFromWallet(_cInfo.playerId, LottoValue);
                         Phrases.Dict.TryGetValue(224, out string _phrase224);
                         _phrase224 = _phrase224.Replace("{Value}", _lottoValue.ToString());
                         _phrase224 = _phrase224.Replace("{CoinName}", Wallet.Coin_Name);
                         ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase224 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                         Phrases.Dict.TryGetValue(225, out string _phrase225);
                         _phrase225 = _phrase225.Replace("{Value}", LottoValue.ToString());
                         _phrase225 = _phrase225.Replace("{CoinName}", Wallet.Coin_Name);
                         _phrase225 = _phrase225.Replace("{CommandPrivate}", ChatHook.Chat_Command_Prefix1);
                         _phrase225 = _phrase225.Replace("{Command85}", Command85);
                         ChatHook.ChatMessage(null, Config.Chat_Response_Color + _phrase225 + "[-]", -1, Config.Server_Response_Name, EChatType.Global, null);
                     }
                     else
                     {
                         Phrases.Dict.TryGetValue(226, out string _phrase226);
                         _phrase226 = _phrase226.Replace("{CoinName}", Wallet.Coin_Name);
                         ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase226 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                     }
                 }
                 else
                 {
                     Phrases.Dict.TryGetValue(223, out string _phrase223);
                     ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase223 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                 }
             }
             else
             {
                 Phrases.Dict.TryGetValue(223, out string _phrase223);
                 ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase223 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
             }
         }
     }
 }
Exemple #3
0
 public static void Response(ClientInfo _cInfo)
 {
     if (OpenLotto)
     {
         string _phrase536;
         if (!Phrases.Dict.TryGetValue(536, out _phrase536))
         {
             _phrase536 = "{PlayerName} a lottery is open for {Value} {CoinName}. Minimum buy in is {BuyIn}. Enter it by typing /lottery enter.";
         }
         int _value = LottoValue * LottoEntries.Count;
         _phrase536 = _phrase536.Replace("{PlayerName}", _cInfo.playerName);
         _phrase536 = _phrase536.Replace("{Value}", _value.ToString());
         _phrase536 = _phrase536.Replace("{CoinName}", Wallet.Coin_Name);
         _phrase536 = _phrase536.Replace("{BuyIn}", LottoValue.ToString());
         _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase536), Config.Server_Response_Name, false, "ServerTools", false));
     }
     else
     {
         string _phrase535;
         if (!Phrases.Dict.TryGetValue(535, out _phrase535))
         {
             _phrase535 = "{PlayerName} there is no open lottery. Type /lottery # to open a new lottery at that buy in price. You must have enough in your wallet.";
         }
         _phrase535 = _phrase535.Replace("{PlayerName}", _cInfo.playerName);
         _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase535), Config.Server_Response_Name, false, "ServerTools", false));
     }
 }
 public static void Response(ClientInfo _cInfo)
 {
     if (OpenLotto)
     {
         string _phrase536;
         if (!Phrases.Dict.TryGetValue(536, out _phrase536))
         {
             _phrase536 = "a lottery is open for {Value} {CoinName}. Minimum buy in is {BuyIn}. Enter it by typing /lottery enter.";
         }
         int _value = LottoValue * LottoEntries.Count;
         _phrase536 = _phrase536.Replace("{Value}", _value.ToString());
         _phrase536 = _phrase536.Replace("{CoinName}", Wallet.Coin_Name);
         _phrase536 = _phrase536.Replace("{BuyIn}", LottoValue.ToString());
         ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase536 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
     }
     else
     {
         string _phrase535;
         if (!Phrases.Dict.TryGetValue(535, out _phrase535))
         {
             _phrase535 = "there is no open lottery. Type /lottery # to open a new lottery at that buy in price. You must have enough in your wallet.";
         }
         ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase535 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
     }
 }
 public static void NewLotto(ClientInfo _cInfo, string _message)
 {
     if (!ShuttingDown)
     {
         if (OpenLotto)
         {
             int winnings = LottoValue * LottoEntries.Count;
             Phrases.Dict.TryGetValue("Lottery2", out string phrase);
             phrase = phrase.Replace("{Value1}", winnings.ToString());
             phrase = phrase.Replace("{CoinName}", Wallet.Currency_Name);
             phrase = phrase.Replace("{Value2}", LottoValue.ToString());
             phrase = phrase.Replace("{Command_Prefix1}", ChatHook.Chat_Command_Prefix1);
             phrase = phrase.Replace("{Command_lottery_enter}", Command_lottery_enter);
             ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
         }
         else
         {
             if (int.TryParse(_message, out int _lottoValue))
             {
                 if (_lottoValue > 0)
                 {
                     if (Wallet.GetCurrency(_cInfo.CrossplatformId.CombinedString) >= _lottoValue)
                     {
                         OpenLotto  = true;
                         LottoValue = _lottoValue;
                         LottoEntries.Add(_cInfo);
                         Wallet.RemoveCurrency(_cInfo.CrossplatformId.CombinedString, LottoValue);
                         Phrases.Dict.TryGetValue("Lottery4", out string phrase);
                         phrase = phrase.Replace("{Value}", _lottoValue.ToString());
                         phrase = phrase.Replace("{CoinName}", Wallet.Currency_Name);
                         ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                         Phrases.Dict.TryGetValue("Lottery5", out phrase);
                         phrase = phrase.Replace("{Value}", LottoValue.ToString());
                         phrase = phrase.Replace("{CoinName}", Wallet.Currency_Name);
                         phrase = phrase.Replace("{Command_Prefix1}", ChatHook.Chat_Command_Prefix1);
                         phrase = phrase.Replace("{Command_lottery_enter}", Command_lottery_enter);
                         ChatHook.ChatMessage(null, Config.Chat_Response_Color + phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Global, null);
                     }
                     else
                     {
                         Phrases.Dict.TryGetValue("Lottery6", out string phrase);
                         phrase = phrase.Replace("{CoinName}", Wallet.Currency_Name);
                         ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                     }
                 }
                 else
                 {
                     Phrases.Dict.TryGetValue("Lottery3", out string phrase);
                     ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
                 }
             }
             else
             {
                 Phrases.Dict.TryGetValue("Lottery3", out string phrase);
                 ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
             }
         }
     }
 }
Exemple #6
0
 public static void Response(ClientInfo _cInfo)
 {
     if (OpenLotto)
     {
         int _value = LottoValue * LottoEntries.Count;
         Phrases.Dict.TryGetValue(222, out string _phrase222);
         _phrase222 = _phrase222.Replace("{Value}", _value.ToString());
         _phrase222 = _phrase222.Replace("{CoinName}", Wallet.Coin_Name);
         _phrase222 = _phrase222.Replace("{BuyIn}", LottoValue.ToString());
         _phrase222 = _phrase222.Replace("{CommandPrivate}", ChatHook.Chat_Command_Prefix1);
         _phrase222 = _phrase222.Replace("{Command85}", Command85);
         ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase222 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
     }
     else
     {
         Phrases.Dict.TryGetValue(221, out string _phrase221);
         _phrase221 = _phrase221.Replace("{CommandPrivate}", ChatHook.Chat_Command_Prefix1);
         _phrase221 = _phrase221.Replace("{Command84}", Command84);
         ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + _phrase221 + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
     }
 }
 public static void Response(ClientInfo _cInfo)
 {
     if (OpenLotto)
     {
         int value = LottoValue * LottoEntries.Count;
         Phrases.Dict.TryGetValue("Lottery2", out string phrase);
         phrase = phrase.Replace("{Value1}", value.ToString());
         phrase = phrase.Replace("{CoinName}", Wallet.Currency_Name);
         phrase = phrase.Replace("{Value2}", LottoValue.ToString());
         phrase = phrase.Replace("{Command_Prefix1}", ChatHook.Chat_Command_Prefix1);
         phrase = phrase.Replace("{Command_lottery_enter}", Command_lottery_enter);
         ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
     }
     else
     {
         Phrases.Dict.TryGetValue("Lottery1", out string phrase);
         phrase = phrase.Replace("{Command_Prefix1}", ChatHook.Chat_Command_Prefix1);
         phrase = phrase.Replace("{Command_lottery}", Command_lottery);
         ChatHook.ChatMessage(_cInfo, Config.Chat_Response_Color + phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Whisper, null);
     }
 }
 public static void NewLotto(ClientInfo _cInfo, string _message, string _playerName)
 {
     if (!ShuttingDown)
     {
         if (OpenLotto)
         {
             int    _winnings = LottoValue * LottoEntries.Count;
             string _phrase536;
             if (!Phrases.Dict.TryGetValue(536, out _phrase536))
             {
                 _phrase536 = "A lottery is open for {Value} {CoinName}. Minimum buy in is {BuyIn}. Enter it by typing {CommandPrivate}{Command85}.";
             }
             _phrase536 = _phrase536.Replace("{Value}", _winnings.ToString());
             _phrase536 = _phrase536.Replace("{CoinName}", Wallet.Coin_Name);
             _phrase536 = _phrase536.Replace("{BuyIn}", LottoValue.ToString());
             _phrase536 = _phrase536.Replace("{CommandPrivate}", ChatHook.Command_Private);
             _phrase536 = _phrase536.Replace("{Command85}", Command85);
             ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase536 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
         }
         else
         {
             int _lottoValue;
             if (int.TryParse(_message, out _lottoValue))
             {
                 if (_lottoValue > 0)
                 {
                     if (Wallet.GetCurrentCoins(_cInfo.playerId) >= _lottoValue)
                     {
                         OpenLotto  = true;
                         LottoValue = _lottoValue;
                         LottoEntries.Add(_cInfo);
                         Wallet.SubtractCoinsFromWallet(_cInfo.playerId, LottoValue);
                         string _phrase538;
                         if (!Phrases.Dict.TryGetValue(538, out _phrase538))
                         {
                             _phrase538 = "You have opened a new lottery for {Value} {CoinName}.";
                         }
                         _phrase538 = _phrase538.Replace("{Value}", _lottoValue.ToString());
                         _phrase538 = _phrase538.Replace("{CoinName}", Wallet.Coin_Name);
                         ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase538 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
                         string _phrase539;
                         if (!Phrases.Dict.TryGetValue(539, out _phrase539))
                         {
                             _phrase539 = "A lottery has opened for {Value} {CoinName} and will draw soon. Type {CommandPrivate}{Command85} to join.";
                         }
                         _phrase539 = _phrase539.Replace("{Value}", LottoValue.ToString());
                         _phrase539 = _phrase539.Replace("{CoinName}", Wallet.Coin_Name);
                         _phrase539 = _phrase539.Replace("{CommandPrivate}", ChatHook.Command_Private);
                         _phrase539 = _phrase539.Replace("{Command85}", Command85);
                         ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase538 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Global, null);
                     }
                     else
                     {
                         string _phrase540;
                         if (!Phrases.Dict.TryGetValue(540, out _phrase540))
                         {
                             _phrase540 = "You do not have enough {CoinName}. Earn some more and enter the lottery before it ends.";
                         }
                         _phrase540 = _phrase540.Replace("{CoinName}", Wallet.Coin_Name);
                         ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase540 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
                     }
                 }
                 else
                 {
                     string _phrase537;
                     if (!Phrases.Dict.TryGetValue(537, out _phrase537))
                     {
                         _phrase537 = "You must type a valid integer above zero for the lottery #.";
                     }
                     ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase537 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
                 }
             }
             else
             {
                 string _phrase537;
                 if (!Phrases.Dict.TryGetValue(537, out _phrase537))
                 {
                     _phrase537 = "You must type a valid integer above zero for the lottery #.";
                 }
                 ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _phrase537 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Whisper, null);
             }
         }
     }
 }
Exemple #9
0
 public static void NewLotto(ClientInfo _cInfo, string _message, string _playerName)
 {
     if (!ShuttingDown)
     {
         if (OpenLotto)
         {
             int    _winnings = LottoValue * LottoEntries.Count;
             string _phrase536;
             if (!Phrases.Dict.TryGetValue(536, out _phrase536))
             {
                 _phrase536 = "{PlayerName} a lottery is open for {Value} {CoinName}. Minimum buy in is {BuyIn}. Enter it by typing /lottery enter.";
             }
             _phrase536 = _phrase536.Replace("{PlayerName}", _cInfo.playerName);
             _phrase536 = _phrase536.Replace("{Value}", _winnings.ToString());
             _phrase536 = _phrase536.Replace("{CoinName}", Wallet.Coin_Name);
             _phrase536 = _phrase536.Replace("{BuyIn}", LottoValue.ToString());
             _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase536), Config.Server_Response_Name, false, "ServerTools", false));
         }
         else
         {
             int _lottoValue;
             if (int.TryParse(_message, out _lottoValue))
             {
                 if (_lottoValue > 0)
                 {
                     EntityPlayer _player = GameManager.Instance.World.Players.dict[_cInfo.entityId];
                     Player       p       = PersistentContainer.Instance.Players[_cInfo.playerId, false];
                     if (p != null)
                     {
                         int currentCoins;
                         if (GameManager.Instance.World.GetGameMode() == 7)
                         {
                             currentCoins = (_player.KilledZombies * Wallet.Zombie_Kills) + (_player.KilledPlayers * Wallet.Player_Kills) - (XUiM_Player.GetDeaths(_player) * Wallet.Deaths) + p.PlayerSpentCoins;
                         }
                         else
                         {
                             currentCoins = (_player.KilledZombies * Wallet.Zombie_Kills) - (XUiM_Player.GetDeaths(_player) * Wallet.Deaths) + p.PlayerSpentCoins;
                         }
                         if (currentCoins >= _lottoValue)
                         {
                             OpenLotto  = true;
                             LottoValue = _lottoValue;
                             LottoEntries.Add(_cInfo);
                             int _oldCoins = PersistentContainer.Instance.Players[_cInfo.playerId, true].PlayerSpentCoins;
                             PersistentContainer.Instance.Players[_cInfo.playerId, true].PlayerSpentCoins = _oldCoins - LottoValue;
                             PersistentContainer.Instance.Save();
                             string _phrase538;
                             if (!Phrases.Dict.TryGetValue(538, out _phrase538))
                             {
                                 _phrase538 = "{PlayerName} you have opened a new lottery for {Value} {CoinName}.";
                             }
                             _phrase538 = _phrase538.Replace("{PlayerName}", _cInfo.playerName);
                             _phrase538 = _phrase538.Replace("{Value}", _lottoValue.ToString());
                             _phrase538 = _phrase538.Replace("{CoinName}", Wallet.Coin_Name);
                             _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase538), Config.Server_Response_Name, false, "ServerTools", false));
                             string _phrase539;
                             if (!Phrases.Dict.TryGetValue(539, out _phrase539))
                             {
                                 _phrase539 = "A lottery has opened for {Value} {CoinName} and will draw soon. Type /lottery enter to join.";
                             }
                             _phrase539 = _phrase539.Replace("{Value}", LottoValue.ToString());
                             _phrase539 = _phrase539.Replace("{CoinName}", Wallet.Coin_Name);
                             GameManager.Instance.GameMessageServer((ClientInfo)null, EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase539), Config.Server_Response_Name, false, "ServerTools", false);
                         }
                         else
                         {
                             string _phrase540;
                             if (!Phrases.Dict.TryGetValue(540, out _phrase540))
                             {
                                 _phrase540 = "{PlayerName} you do not have enough {CoinName}. Earn some more and enter the lottery before it ends.";
                             }
                             _phrase540 = _phrase540.Replace("{PlayerName}", _cInfo.playerName);
                             _phrase540 = _phrase540.Replace("{CoinName}", Wallet.Coin_Name);
                             _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase540), Config.Server_Response_Name, false, "ServerTools", false));
                         }
                     }
                 }
                 else
                 {
                     string _phrase537;
                     if (!Phrases.Dict.TryGetValue(537, out _phrase537))
                     {
                         _phrase537 = "{PlayerName} you must type a valid integer above zero for the lottery #.";
                     }
                     _phrase537 = _phrase537.Replace("{PlayerName}", _cInfo.playerName);
                     _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase537), Config.Server_Response_Name, false, "ServerTools", false));
                 }
             }
             else
             {
                 string _phrase537;
                 if (!Phrases.Dict.TryGetValue(537, out _phrase537))
                 {
                     _phrase537 = "{PlayerName} you must type a valid integer above zero for the lottery #.";
                 }
                 _phrase537 = _phrase537.Replace("{PlayerName}", _cInfo.playerName);
                 _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase537), Config.Server_Response_Name, false, "ServerTools", false));
             }
         }
     }
 }