diff --git a/DataCollection/gamedata.json b/DataCollection/gamedata.json index 5587e08..1c91258 100755 --- a/DataCollection/gamedata.json +++ b/DataCollection/gamedata.json @@ -225,8 +225,9 @@ "saved_profile":"Saved profile for horse %HORSENAME%.", "horse_set_new_category":"Horse set as %CATEGORY%", "back_to_horse":"^R1^D5|BACK TO HORSE^R1", - "pet_horse":"Your horse whinnies lightly. (+%MOOD% mood / -%TIREDNESS% tiredness)", - "pet_horse_too_happy":"Your horse is as happy as it can be now. Your horse whinnies lightly. (+%MOOD% mood / -%TIREDNESS% tiredness)", + "pet_horse":"%MESSAGES%Your horse whinnies lightly. (+%MOOD% mood / -%TIREDNESS% tiredness)", + "pet_horse_too_happy":"Your horse is as happy as it can be now. ", + "pet_horse_too_sleepy":"It can barely keep its eyes open. ", "description_edit":"^PLHorse's Name:|%HORSENAME%^D11|GENERATE RANDOM HORSE NAME^R1^LDescription: (reset if you generate name)^R1^PB120|%DESCRIPTION%^PS5|SAVE CHANGES", "tack_fail_autosell":"You cannot put tack on a horse with Auto-Sell set.", "horse_release":"Are you SURE you want to let the horse go?^T2If so, click ^B3X%RANDOMID%^R6", diff --git a/Horse Isle Server/HorseIsleServer/Game/Messages.cs b/Horse Isle Server/HorseIsleServer/Game/Messages.cs index f6fd31b..52ca69a 100755 --- a/Horse Isle Server/HorseIsleServer/Game/Messages.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Messages.cs @@ -289,7 +289,8 @@ namespace HISP.Game public static string HorseStopRidingMessage; public static string HorsePetMessageFormat; - public static string HorsePetTooHappyFormat; + public static string HorsePetTooHappy; + public static string HorsePetTooTired; public static string HorseSetNewCategoryMessageFormat; public static string HorseAutoSellMenuFormat; @@ -815,15 +816,10 @@ namespace HISP.Game { return HorseDescriptionEditFormat.Replace("%HORSENAME%", username).Replace("%DESCRIPTION%", description); } - public static string FormatHorsePetMessage(int mood, int tiredness) + public static string FormatHorsePetMessage(string messages, int mood, int tiredness) { - return HorsePetMessageFormat.Replace("%MOOD%", mood.ToString()).Replace("%TIREDNESS%", tiredness.ToString()); + return HorsePetMessageFormat.Replace("%MESSAGES%", messages).Replace("%MOOD%", mood.ToString()).Replace("%TIREDNESS%", tiredness.ToString()); } - public static string FormatHorsePetTooHappyMessage(int mood, int tiredness) - { - return HorsePetTooHappyFormat.Replace("%MOOD%", mood.ToString()).Replace("%TIREDNESS%", tiredness.ToString()); - } - public static string FormatHorseCurrentStatus(string name) { return HorseCurrentStatusFormat.Replace("%HORSENAME%", name); diff --git a/Horse Isle Server/HorseIsleServer/Game/Meta.cs b/Horse Isle Server/HorseIsleServer/Game/Meta.cs index c4bf83c..abd7d76 100755 --- a/Horse Isle Server/HorseIsleServer/Game/Meta.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Meta.cs @@ -1088,7 +1088,7 @@ namespace HISP.Game string npc = buildNpc(user, specialTile.X, specialTile.Y); message += npc; - if (specialTile.Code == null) + if (specialTile.Code == null || specialTile.Code == "") message += buildCommonInfo(specialTile.X, specialTile.Y); else { diff --git a/Horse Isle Server/HorseIsleServer/Game/World.cs b/Horse Isle Server/HorseIsleServer/Game/World.cs index 629f7d6..829815b 100755 --- a/Horse Isle Server/HorseIsleServer/Game/World.cs +++ b/Horse Isle Server/HorseIsleServer/Game/World.cs @@ -201,6 +201,8 @@ namespace HISP.Game { ServerTime.Days += 1; ServerTime.Minutes = 0; + + Database.DoIntrestPayments(ConfigReader.IntrestRate); } if (ServerTime.Days == 366) // 1 year! diff --git a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs index f753f78..e8a65b9 100755 --- a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs +++ b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs @@ -835,7 +835,8 @@ namespace HISP.Server Messages.HorseStopRidingMessage = gameData.messages.meta.horse.stop_riding_message; Messages.HorsePetMessageFormat = gameData.messages.meta.horse.pet_horse; - Messages.HorsePetTooHappyFormat = gameData.messages.meta.horse.pet_horse_too_happy; + Messages.HorsePetTooHappy = gameData.messages.meta.horse.pet_horse_too_happy; + Messages.HorsePetTooTired = gameData.messages.meta.horse.pet_horse_too_sleepy; Messages.HorseSetNewCategoryMessageFormat = gameData.messages.meta.horse.horse_set_new_category; Messages.HorseAutoSellMenuFormat = gameData.messages.meta.horse.auto_sell.auto_sell_meta; diff --git a/Horse Isle Server/HorseIsleServer/Server/GameServer.cs b/Horse Isle Server/HorseIsleServer/Server/GameServer.cs index 07c8ab3..94d7524 100755 --- a/Horse Isle Server/HorseIsleServer/Server/GameServer.cs +++ b/Horse Isle Server/HorseIsleServer/Server/GameServer.cs @@ -61,8 +61,6 @@ namespace HISP.Server Database.IncAllUsersFreeTime(1); } - if(totalMinutesElapsed % 20 == 0) - Database.DoIntrestPayments(ConfigReader.IntrestRate); if (totalMinutesElapsed % 25 == 0) @@ -202,18 +200,19 @@ namespace HISP.Server - string message = ""; - if(horseInst.BasicStats.Mood + randMoodAddition > 1000) - message = Messages.FormatHorsePetMessage(randMoodAddition, randTiredMinus); - else - message = Messages.FormatHorsePetTooHappyMessage(randMoodAddition, randTiredMinus); + string msgs = ""; + if (horseInst.BasicStats.Mood + randMoodAddition >= 1000) + msgs += Messages.HorsePetTooHappy; + if (horseInst.BasicStats.Tiredness - randTiredMinus <= 0) + msgs += Messages.HorsePetTooTired; + horseInst.BasicStats.Tiredness -= randTiredMinus; horseInst.BasicStats.Mood += randMoodAddition; - byte[] petMessagePacket = PacketBuilder.CreateChat(message, PacketBuilder.CHAT_BOTTOM_RIGHT); + byte[] petMessagePacket = PacketBuilder.CreateChat(Messages.FormatHorsePetMessage(msgs,randMoodAddition, randTiredMinus), PacketBuilder.CHAT_BOTTOM_RIGHT); sender.SendPacket(petMessagePacket); break; @@ -716,9 +715,9 @@ namespace HISP.Server { if(sender.LoggedinUser.CurrentlyRidingHorse.RandomId == sender.LoggedinUser.LastViewedHorse.RandomId) { - sender.LoggedinUser.CurrentlyRidingHorse = null; - sender.LoggedinUser.Facing %= 5; byte[] disMounted = PacketBuilder.CreateChat(Messages.FormatHorseDismountedBecauseTackedMessage(sender.LoggedinUser.CurrentlyRidingHorse.Name), PacketBuilder.CHAT_BOTTOM_RIGHT); + sender.LoggedinUser.Facing %= 5; + sender.LoggedinUser.CurrentlyRidingHorse = null; sender.SendPacket(disMounted); } } @@ -2572,7 +2571,7 @@ namespace HISP.Server newY -= 1; - if (loggedInUser.Facing == (direction + (onHorse * 5))&& onHorse != 0) // Double move + if (loggedInUser.CurrentlyRidingHorse != null && !World.InTown(loggedInUser.X, loggedInUser.Y)) // Double move if (Map.CheckPassable(newX, newY - 1) || loggedInUser.NoClip) { newY -= 1; @@ -2586,7 +2585,7 @@ namespace HISP.Server newX -= 1; - if (loggedInUser.Facing == (direction + (onHorse * 5)) && onHorse != 0) // Double move + if (loggedInUser.CurrentlyRidingHorse != null && !World.InTown(loggedInUser.X, loggedInUser.Y)) // Double move if (Map.CheckPassable(newX - 1, newY) || loggedInUser.NoClip) { newX -= 1; @@ -2600,7 +2599,7 @@ namespace HISP.Server newX += 1; - if (loggedInUser.Facing == (direction + (onHorse * 5)) && onHorse != 0) // Double move + if (loggedInUser.CurrentlyRidingHorse != null && !World.InTown(loggedInUser.X, loggedInUser.Y)) // Double move if (Map.CheckPassable(newX + 1, newY) || loggedInUser.NoClip) { newX += 1; @@ -2614,7 +2613,7 @@ namespace HISP.Server newY += 1; - if (loggedInUser.Facing == (direction + (onHorse * 5)) && onHorse != 0) // Double move + if (loggedInUser.CurrentlyRidingHorse != null && !World.InTown(loggedInUser.X, loggedInUser.Y)) // Double move if (Map.CheckPassable(newX, newY + 1) || loggedInUser.NoClip) { newY += 1; @@ -3439,6 +3438,8 @@ namespace HISP.Server for(int i = 0; i < reqItem.RequiredItemCount; i++) sender.LoggedinUser.Inventory.Remove(sender.LoggedinUser.Inventory.GetItemByItemId(reqItem.RequiredItemId).ItemInstances[0]); + sender.LoggedinUser.TrackedItems.GetTrackedItem(Tracking.TrackableItem.Crafting).Count++; + byte[] itemCraftSuccess = PacketBuilder.CreateChat(Messages.WorkshopCraftingSuccess, PacketBuilder.CHAT_BOTTOM_RIGHT); sender.SendPacket(itemCraftSuccess); break;