public static void Stop()
 {
     Asda2EventMgr.SendMessageToWorld("STAY ONLINE Event ended.");
     GetRewardQueue.CancelTimer(_timer);
     _timer  = null;
     Started = false;
 }
Esempio n. 2
0
 public static void Stop()
 {
     Asda2EventMgr.SendMessageToWorld("Kill Monster Event ended.");
     lock (CompletedCharacters)
     {
         CompletedCharacters.Clear();
     }
     Started = false;
 }
Esempio n. 3
0
 /// <summary>
 /// Начинает эвент угадай слово
 /// </summary>
 /// <param name="word">секретное слово</param>
 /// <param name="precison">точность от 50 до 100 в процентах</param>
 public static void Start(string word, int precison, string gmName)
 {
     if (Started || word == null)
     {
         return;
     }
     Asda2EventMgr.SendMessageToWorld("Guess word event started. {0} is event manager. Type your answer to global chat.", gmName);
     Started    = true;
     _percision = 100f / precison;
     _word      = word.ToLower();
 }
Esempio n. 4
0
        public static void Start(int monsterId, int itemId)
        {
            var template = Asda2ItemMgr.GetTemplate(itemId);

            if (Started || template == null)
            {
                return;
            }

            Asda2EventMgr.SendMessageToWorld("Kill monster event started.");
            Started    = true;
            _itemId    = itemId;
            _monsterId = monsterId;
        }
        public static void Start(int intervalMins, int itemId)
        {
            var template = Asda2ItemMgr.GetTemplate(itemId);

            if (Started || template == null)
            {
                return;
            }

            _timer = GetRewardQueue.CallPeriodically(_tickInterval, GiveReward);

            Asda2EventMgr.SendMessageToWorld("STAY ONLINE Event started. Every ~{0} mins you will get a prize! Stay ONLINE!",
                                             intervalMins);
            Started       = true;
            _itemId       = itemId;
            _intervalMins = intervalMins;
        }
Esempio n. 6
0
 public static void TryGuess(string word, Character senderChr)
 {
     lock (typeof(Asda2EventMgr))
     {
         if (!Started)
         {
             return;
         }
         var   fixedWord   = word.ToLower();
         float correctHits = 0f;
         for (int i = 0; i < fixedWord.Length; i++)
         {
             if (i >= _word.Length)
             {
                 break;
             }
             if (fixedWord[i] == _word[i])
             {
                 correctHits++;
             }
         }
         if (correctHits / _word.Length >= _percision)
         {
             //character is winner
             var exp        = CharacterFormulas.CalcExpForGuessWordEvent(senderChr.Level);
             var eventItems = CharacterFormulas.EventItemsForGuessEvent;
             Asda2EventMgr.SendMessageToWorld("{0} is winner. Prize is {1} exp and {2} event items.", senderChr.Name, exp, eventItems);
             senderChr.GainXp(exp, "guess_event");
             RealmServer.IOQueue.AddMessage(() => senderChr.Asda2Inventory.AddDonateItem(Asda2ItemMgr.GetTemplate(CharacterFormulas.EventItemId), eventItems, "guess_event"));
             Stop();
             Log.Create(Log.Types.EventOperations, LogSourceType.Character, senderChr.EntryId)
             .AddAttribute("win", eventItems, "guess_event")
             .Write();
         }
     }
 }
Esempio n. 7
0
 public static void Stop()
 {
     Asda2EventMgr.SendMessageToWorld("Guess word event ended.");
     Started = false;
 }