Add Random Events

This commit is contained in:
SilicaAndPina 2021-05-12 10:11:53 +12:00
parent d7e350fef6
commit 9add26a6fa
5 changed files with 165 additions and 4 deletions

View file

@ -6,6 +6,7 @@ using System.Threading;
using HISP.Player;
using HISP.Game;
using HISP.Game.Horse;
using HISP.Game.Events;
namespace HISP.Server
{
@ -84,6 +85,12 @@ namespace HISP.Server
SendPacket(playTimeMessage);
}
if (GameServer.RandomNumberGenerator.Next(0, 100) == 59) // RANDOM EVENT HAS OCCURED!
{
RandomEvent.ExecuteRandomEvent(LoggedinUser);
}
bool gotoPrision = false;
foreach(HorseInstance horse in LoggedinUser.HorseInventory.HorseList)
{
@ -196,16 +203,16 @@ namespace HISP.Server
if (totalMinutesElapsed % 5 == 0)
LoggedinUser.Thirst--;
if (totalMinutesElapsed % 10 == 0)
if (totalMinutesElapsed % 15 == 0)
LoggedinUser.Hunger--;
if (totalMinutesElapsed % 15 == 0)
LoggedinUser.Tiredness--;
}
if (!isDisconnecting)
minuteTimer.Change(oneMinute, oneMinute);
dcLock = false;