fix quest unlocking

This commit is contained in:
SilicaAndPina 2021-02-05 21:46:26 +13:00
parent c9c81d721e
commit 6795f3143a
3 changed files with 22 additions and 17 deletions

View file

@ -124,7 +124,6 @@ namespace HISP.Game.Horse
if (Map.CheckPassable(tryX, tryY)) // Can the player stand here? if (Map.CheckPassable(tryX, tryY)) // Can the player stand here?
{ {
Logger.DebugPrint(this.Instance.Breed.Name + " Randomly wandered to: " + tryX.ToString() + ", " + tryY.ToString());
X = tryX; X = tryX;
Y = tryY; Y = tryY;
break; break;
@ -232,6 +231,7 @@ namespace HISP.Game.Horse
public static void Update() public static void Update()
{ {
Logger.DebugPrint("Making horses wander.");
foreach (WildHorse wildHorse in WildHorses) foreach (WildHorse wildHorse in WildHorses)
{ {
wildHorse.Timeout -= 1; wildHorse.Timeout -= 1;
@ -242,7 +242,7 @@ namespace HISP.Game.Horse
if (wildHorse.Timeout <= 0) if (wildHorse.Timeout <= 0)
Despawn(wildHorse); Despawn(wildHorse);
if (GameServer.RandomNumberGenerator.Next(0, 100) >= 50) if (GameServer.RandomNumberGenerator.Next(0, 100) >= 25)
wildHorse.RandomWander(); wildHorse.RandomWander();
} }
if(WildHorses.Length < 40) if(WildHorses.Length < 40)

View file

@ -109,12 +109,12 @@ namespace HISP.Game
// Has completed other required quests? // Has completed other required quests?
foreach (int questId in quest.RequiresQuestIdCompleted) foreach (int questId in quest.RequiresQuestIdCompleted)
if (user.Quests.GetTrackedQuestAmount(quest.Id) < 1) if (user.Quests.GetTrackedQuestAmount(questId) < 1)
return false; return false;
// Has NOT competed other MUST NOT BE required quests // Has NOT competed other MUST NOT BE required quests
foreach (int questId in quest.RequiresQuestIdNotCompleted) foreach (int questId in quest.RequiresQuestIdNotCompleted)
if (user.Quests.GetTrackedQuestAmount(quest.Id) > 1) if (user.Quests.GetTrackedQuestAmount(questId) > 1)
return false; return false;
// Has allready tracked this quest? // Has allready tracked this quest?

View file

@ -64,12 +64,16 @@ namespace HISP.Server
if(totalMinutesElapsed % 24 == 0) if(totalMinutesElapsed % 24 == 0)
Database.DoIntrestPayments(ConfigReader.IntrestRate); Database.DoIntrestPayments(ConfigReader.IntrestRate);
if (totalMinutesElapsed % 25 == 0)
{
Logger.DebugPrint("Randomizing Weather...");
foreach (World.Town town in World.Towns) foreach (World.Town town in World.Towns)
{ {
if (RandomNumberGenerator.Next(0, 100) < 25) if (RandomNumberGenerator.Next(0, 100) < 25)
{ {
town.Weather = town.SelectRandomWeather(); town.Weather = town.SelectRandomWeather();
Logger.DebugPrint("Changing the weather in " + town.Name + " to " + town.Weather);
} }
} }
@ -78,9 +82,10 @@ namespace HISP.Server
if (RandomNumberGenerator.Next(0, 100) < 25) if (RandomNumberGenerator.Next(0, 100) < 25)
{ {
isle.Weather = isle.SelectRandomWeather(); isle.Weather = isle.SelectRandomWeather();
Logger.DebugPrint("Changing the weather in " + isle.Name + " to " + isle.Weather);
} }
} }
}
Database.IncPlayerTirednessForOfflineUsers(); Database.IncPlayerTirednessForOfflineUsers();