mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 21:25:52 +12:00
Add Random Events
This commit is contained in:
parent
d7e350fef6
commit
9add26a6fa
5 changed files with 165 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue