diff --git a/DataCollection/gamedata.json b/DataCollection/gamedata.json
index 9a30fd7..0ec0cdf 100644
--- a/DataCollection/gamedata.json
+++ b/DataCollection/gamedata.json
@@ -143,7 +143,7 @@
"too_many_horses":"You cannot manage any more horses.",
"horses_menu":"^ATYour Horses^HYou can have up to %MAXHORSE% horses. Here are your %TOTALHORSE%:
",
"update_category":"Horse set as %CATEGORY%",
- "horse_format":"^I252^T7#%NUMB%: %NAME% (%BREED%) ^B3L%ID%^R1",
+ "horse_format":"^I252^T7#%NUMB%: %NAME% (%BREED%) %ISAUTOSELL% ^B3L%ID%^R1",
"view_basic_stats":"^T6View all of basic stats together:^D33|BASIC STATS^R1",
"view_advanced_stats":"^T6View all advanced stats together:^D34|ALL STATS^R1",
"equip_tack_message":"You put the %NAME% on %HORSENAME%.",
@@ -157,6 +157,12 @@
"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)",
"description_edit":"^PLHorse's Name:|%HORSENAME%^D11|GENERATE RANDOM HORSE NAME^R1^LDescription: (reset if you generate name)^R1^PB120|%DESCRIPTION%^PS5|SAVE CHANGES",
+ "auto_sell":{
+ "auto_sell_meta":"Auto-Selling a horse:
By setting this value, any other player can buy this horse from you at any time. If you have a Ranch, they can even buy the horse when you are offline! (Put the cost to 0 to stop it from being for auto-sale.)^PMAuto-Sell horse for:|%AUTOSELL%^PS10|SET COST",
+ "auto_sell_confirmed":"Setting up Auto-Sell for horse at $%MONEY%",
+ "auto_sell_remove":"Removing auto-sell off horse.",
+ "is_auto_sell":"[$] "
+ },
"feed_horse":{
"horse_neigh":"Your horse neighs a thank you!",
"horse_could_not_finish":"The horse could not finish it all. Some was wasted.",
diff --git a/Horse Isle Server/Horse Isle Server/Game/Horse/HorseInstance.cs b/Horse Isle Server/Horse Isle Server/Game/Horse/HorseInstance.cs
index d5e4394..ea79022 100644
--- a/Horse Isle Server/Horse Isle Server/Game/Horse/HorseInstance.cs
+++ b/Horse Isle Server/Horse Isle Server/Game/Horse/HorseInstance.cs
@@ -178,6 +178,11 @@ namespace HISP.Game.Horse
private int autosell;
private string category;
+ public void ChangeNameWithoutUpdatingDatabase(string newName)
+ {
+ name = newName;
+ }
+
}
}
diff --git a/Horse Isle Server/Horse Isle Server/Game/Messages.cs b/Horse Isle Server/Horse Isle Server/Game/Messages.cs
index 8124ce2..5435220 100644
--- a/Horse Isle Server/Horse Isle Server/Game/Messages.cs
+++ b/Horse Isle Server/Horse Isle Server/Game/Messages.cs
@@ -194,8 +194,8 @@ namespace HISP.Game
public static string HorseProfileButtonFormat;
public static string HorseNoAutoSell;
- public static string HorseAutoSellPriceFormat;
public static string HorseAutoSellFormat;
+ public static string HorseAutoSellPriceFormat;
public static string HorseCantAutoSellTacked;
public static string HorseCurrentlyCategoryFormat;
public static string HorseStats;
@@ -222,6 +222,10 @@ namespace HISP.Game
public static string HorsePetTooHappyFormat;
public static string HorseSetNewCategoryMessageFormat;
+ public static string HorseAutoSellMenuFormat;
+ public static string HorseIsAutoSell;
+ public static string HorseAutoSellConfirmedFormat;
+ public static string HorseAutoSellRemoved;
// Horse Feed Menu
public static string HorseCurrentStatusFormat;
@@ -431,6 +435,14 @@ namespace HISP.Game
// Click
public static string NothingInterestingHere;
+ public static string FormatAutoSellConfirmedMessage(int money)
+ {
+ return HorseAutoSellConfirmedFormat.Replace("%MONEY%", money.ToString("N0"));
+ }
+ public static string FormatAutoSellMenu(int currentAutoSellPrice)
+ {
+ return HorseAutoSellMenuFormat.Replace("%AUTOSELL%", currentAutoSellPrice.ToString());
+ }
public static string FormatHorseSetToNewCategory(string category)
{
return HorseSetNewCategoryMessageFormat.Replace("%CATEGORY%", category);
@@ -587,9 +599,9 @@ namespace HISP.Game
{
return UpdateHorseCategory.Replace("%CATEGORY%", newCategory);
}
- public static string FormatHorseEntry(int numb, string horseName, string breedName, int randomId)
+ public static string FormatHorseEntry(int numb, string horseName, string breedName, int randomId, bool hasAutoSell)
{
- return HorseEntryFormat.Replace("%NUMB%", numb.ToString()).Replace("%NAME%", horseName).Replace("%BREED%", breedName).Replace("%ID%", randomId.ToString());
+ return HorseEntryFormat.Replace("%NUMB%", numb.ToString()).Replace("%NAME%", horseName).Replace("%BREED%", breedName).Replace("%ID%", randomId.ToString()).Replace("%ISAUTOSELL%", hasAutoSell ? HorseIsAutoSell : "");
}
public static string FormatHorseHeader(int maxHorses, int numHorses)
{
diff --git a/Horse Isle Server/Horse Isle Server/Game/Meta.cs b/Horse Isle Server/Horse Isle Server/Game/Meta.cs
index aca6d86..4d0e3f5 100644
--- a/Horse Isle Server/Horse Isle Server/Game/Meta.cs
+++ b/Horse Isle Server/Horse Isle Server/Game/Meta.cs
@@ -890,7 +890,7 @@ namespace HISP.Game
message += category.Meta;
foreach (HorseInstance instance in horsesInCategory)
{
- message += Messages.FormatHorseEntry(i, instance.Name, instance.Breed.Name, instance.RandomId);
+ message += Messages.FormatHorseEntry(i, instance.Name, instance.Breed.Name, instance.RandomId, instance.AutoSell > 0);
i++;
}
}
@@ -989,6 +989,15 @@ namespace HISP.Game
message += Messages.BackToHorse;
return message;
}
+
+ public static string BuildAutoSellMenu(HorseInstance horse)
+ {
+ string message = "";
+ message += Messages.FormatAutoSellMenu(horse.AutoSell);
+ message += Messages.ExitThisPlace;
+ message += Messages.MetaTerminator;
+ return message;
+ }
public static string BuildHorseDescriptionEditMeta(HorseInstance horse)
{
string message = Messages.FormatDescriptionEditMeta(horse.Name, horse.Description);
@@ -1018,10 +1027,17 @@ namespace HISP.Game
message += Messages.FormatPetButton(horse.RandomId);
message += Messages.FormatProfileButton(horse.RandomId);
- string autoSellMessage = Messages.HorseNoAutoSell;
- if (horse.AutoSell > 0)
- autoSellMessage = Messages.FormatAutoSellPrice(horse.AutoSell);
- message += Messages.FormatAutoSell(autoSellMessage);
+ if (horse.Equipment.Saddle == null && horse.Equipment.SaddlePad == null && horse.Equipment.Bridle == null)
+ {
+ string autoSellMessage = Messages.HorseNoAutoSell;
+ if (horse.AutoSell > 0)
+ autoSellMessage = Messages.FormatAutoSellPrice(horse.AutoSell);
+ message += Messages.FormatAutoSell(autoSellMessage);
+ }
+ else
+ {
+ message += Messages.HorseCantAutoSellTacked;
+ }
message += Messages.FormatHorseCategory(horse.Category);
message += Messages.HorseStats;
diff --git a/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs b/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs
index c882c49..b7e9e29 100644
--- a/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs
+++ b/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs
@@ -631,8 +631,8 @@ namespace HISP.Server
Messages.HorseSavedProfileMessageFormat = gameData.messages.meta.horse.saved_profile;
Messages.HorseNoAutoSell = gameData.messages.meta.horse.horse_inventory.no_auto_sell;
- Messages.HorseAutoSellFormat = gameData.messages.meta.horse.horse_inventory.auto_sell_format;
- Messages.HorseAutoSellPriceFormat = gameData.messages.meta.horse.horse_inventory.auto_sell;
+ Messages.HorseAutoSellPriceFormat = gameData.messages.meta.horse.horse_inventory.auto_sell_format;
+ Messages.HorseAutoSellFormat = gameData.messages.meta.horse.horse_inventory.auto_sell;
Messages.HorseCantAutoSellTacked = gameData.messages.meta.horse.horse_inventory.cannot_auto_sell_tacked;
Messages.HorseCurrentlyCategoryFormat = gameData.messages.meta.horse.horse_inventory.marked_as;
@@ -660,6 +660,12 @@ namespace HISP.Server
Messages.HorsePetTooHappyFormat = gameData.messages.meta.horse.pet_horse_too_happy;
Messages.HorseSetNewCategoryMessageFormat = gameData.messages.meta.horse.horse_set_new_category;
+ Messages.HorseAutoSellMenuFormat = gameData.messages.meta.horse.auto_sell.auto_sell_meta;
+ Messages.HorseIsAutoSell = gameData.messages.meta.auto_sell.horse.is_auto_sell;
+ Messages.HorseAutoSellConfirmedFormat = gameData.messages.meta.auto_sell.horse.auto_sell_confirmed;
+ Messages.HorseAutoSellRemoved = gameData.messages.meta.auto_sell.horse.auto_sell_remove;
+
+
// Horse Feed Menu
Messages.HorseCurrentStatusFormat = gameData.messages.meta.horse.feed_horse.current_status;
Messages.HorseHoldingHorseFeed = gameData.messages.meta.horse.feed_horse.holding_horse_feed;
diff --git a/Horse Isle Server/Horse Isle Server/Server/GameServer.cs b/Horse Isle Server/Horse Isle Server/Server/GameServer.cs
index 2ea9e49..1d13e73 100644
--- a/Horse Isle Server/Horse Isle Server/Server/GameServer.cs
+++ b/Horse Isle Server/Horse Isle Server/Server/GameServer.cs
@@ -809,6 +809,42 @@ namespace HISP.Server
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to send a invalid dynamic input (private notes, wrong size)");
break;
}
+ case 10: // Change auto sell price
+ if (dynamicInput.Length >= 2)
+ {
+ if (sender.LoggedinUser.LastViewedHorse != null)
+ {
+ sender.LoggedinUser.MetaPriority = true;
+ HorseInstance horseInstance = sender.LoggedinUser.LastViewedHorse;
+ int newSellPrice = 0;
+ try
+ {
+ newSellPrice = int.Parse(dynamicInput[1]);
+ }
+ catch (FormatException)
+ {
+ Logger.ErrorPrint(sender.LoggedinUser.Username + " tried to set sell price to non int value.");
+ break;
+ }
+
+ byte[] sellPricePacket;
+ if (newSellPrice > 0)
+ sellPricePacket = PacketBuilder.CreateChat(Messages.FormatAutoSellConfirmedMessage(newSellPrice), PacketBuilder.CHAT_BOTTOM_RIGHT);
+ else
+ sellPricePacket = PacketBuilder.CreateChat(Messages.HorseAutoSellRemoved, PacketBuilder.CHAT_BOTTOM_RIGHT);
+ sender.SendPacket(sellPricePacket);
+ horseInstance.AutoSell = newSellPrice;
+
+ UpdateHorseMenu(sender, sender.LoggedinUser.LastViewedHorse);
+ }
+ }
+ else
+ {
+ Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to send a invalid dynamic input (autosell, wrong size)");
+ break;
+ }
+ break;
+
case 12: // Abuse Report
if (dynamicInput.Length >= 2)
{
@@ -961,7 +997,7 @@ namespace HISP.Server
{
sender.LoggedinUser.MetaPriority = true;
HorseInstance horseInstance = sender.LoggedinUser.LastViewedHorse;
- horseInstance.Name = HorseInfo.GenerateHorseName();
+ horseInstance.ChangeNameWithoutUpdatingDatabase(HorseInfo.GenerateHorseName());
metaPacket = PacketBuilder.CreateMetaPacket(Meta.BuildHorseDescriptionEditMeta(horseInstance));
sender.SendPacket(metaPacket);
}
@@ -1006,6 +1042,15 @@ namespace HISP.Server
metaPacket = PacketBuilder.CreateMetaPacket(Meta.BuildFindNpcMenu());
sender.SendPacket(metaPacket);
break;
+ case "25": // Set auto sell price
+ if (sender.LoggedinUser.LastViewedHorse != null)
+ {
+ sender.LoggedinUser.MetaPriority = true;
+ HorseInstance horseInstance = sender.LoggedinUser.LastViewedHorse;
+ metaPacket = PacketBuilder.CreateMetaPacket(Meta.BuildAutoSellMenu(horseInstance));
+ sender.SendPacket(metaPacket);
+ }
+ break;
case "31": // Find Ranch
break;
case "9": // View Tack