diff --git a/DataCollection/gamedata.json b/DataCollection/gamedata.json
index 15c91ba..26edd4a 100644
--- a/DataCollection/gamedata.json
+++ b/DataCollection/gamedata.json
@@ -147,6 +147,7 @@
"view_advanced_stats":"^T6View all advanced stats together:^D34|ALL STATS^R1",
"equip_tack_message":"You put the %NAME% on %HORSENAME%.",
"riding_message":"You are now riding %HORSENAME%!",
+ "stop_riding_message":"You are now not riding a horse!",
"unequip_tack_message":"You removed the tack off %HORSENAME%.",
"horse_inventory":{
"your_horse_format":"Your horse: %NAME%:
",
@@ -157,6 +158,7 @@
"trainable_in":" Trainable again in %TIME%m.
",
"currently_trainable":" Currently trainable.
",
+ "dismount_button":"^B3N%ID%",
"mount_button":"^B3O%ID%",
"feed_button":"^B3F%ID%",
"tack_button":"^B3T%ID%",
diff --git a/Horse Isle Server/Horse Isle Server/Game/Messages.cs b/Horse Isle Server/Horse Isle Server/Game/Messages.cs
index c6bb805..26a58bb 100644
--- a/Horse Isle Server/Horse Isle Server/Game/Messages.cs
+++ b/Horse Isle Server/Horse Isle Server/Game/Messages.cs
@@ -187,6 +187,7 @@ namespace HISP.Game
public static string HorseIsTrainable;
public static string HorseMountButtonFormat;
+ public static string HorseDisMountButtonFormat;
public static string HorseFeedButtonFormat;
public static string HorseTackButtonFormat;
public static string HorsePetButtonFormat;
@@ -214,7 +215,7 @@ namespace HISP.Game
public static string HorseEquipTackMessageFormat;
public static string HorseUnEquipTackMessageFormat;
-
+ public static string HorseStopRidingMessage;
// Tack horse menu
public static string HorseTackedAsFollowsFormat;
@@ -473,6 +474,10 @@ namespace HISP.Game
return HorseTrainableInFormat.Replace("%TIME%", minutes.ToString());
}
+ public static string FormatDisMountButton(int randomId)
+ {
+ return HorseDisMountButtonFormat.Replace("%ID%", randomId.ToString());
+ }
public static string FormatMountButton(int randomId)
{
return HorseMountButtonFormat.Replace("%ID%", randomId.ToString());
diff --git a/Horse Isle Server/Horse Isle Server/Game/Meta.cs b/Horse Isle Server/Horse Isle Server/Game/Meta.cs
index 9b54403..a1996f4 100644
--- a/Horse Isle Server/Horse Isle Server/Game/Meta.cs
+++ b/Horse Isle Server/Horse Isle Server/Game/Meta.cs
@@ -984,7 +984,11 @@ namespace HISP.Game
else
message += Messages.HorseIsTrainable;
- message += Messages.FormatMountButton(horse.RandomId);
+ if (user.Facing <= 5)
+ message += Messages.FormatMountButton(horse.RandomId);
+ else
+ message += Messages.FormatDisMountButton(horse.RandomId);
+
message += Messages.FormatFeedButton(horse.RandomId);
message += Messages.FormatTackButton(horse.RandomId);
message += Messages.FormatPetButton(horse.RandomId);
diff --git a/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs b/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs
index cb34b0c..0b299ca 100644
--- a/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs
+++ b/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs
@@ -621,6 +621,7 @@ namespace HISP.Server
Messages.HorseIsTrainable = gameData.messages.meta.horse.horse_inventory.currently_trainable;
Messages.HorseMountButtonFormat = gameData.messages.meta.horse.horse_inventory.mount_button;
+ Messages.HorseDisMountButtonFormat = gameData.messages.meta.horse.horse_inventory.dismount_button;
Messages.HorseFeedButtonFormat = gameData.messages.meta.horse.horse_inventory.feed_button;
Messages.HorseTackButtonFormat = gameData.messages.meta.horse.horse_inventory.tack_button;
Messages.HorsePetButtonFormat = gameData.messages.meta.horse.horse_inventory.pet_button;
@@ -649,6 +650,7 @@ namespace HISP.Server
Messages.HorseEquipTackMessageFormat = gameData.messages.meta.horse.equip_tack_message;
Messages.HorseUnEquipTackMessageFormat = gameData.messages.meta.horse.unequip_tack_message;
+ Messages.HorseStopRidingMessage = gameData.messages.meta.horse.stop_riding_message;
// Tack menu (horses)
Messages.HorseTackedAsFollowsFormat = gameData.messages.meta.horse.tack_menu.tacked_as_follows;
diff --git a/Horse Isle Server/Horse Isle Server/Server/GameServer.cs b/Horse Isle Server/Horse Isle Server/Server/GameServer.cs
index 2ea917a..7b69e78 100644
--- a/Horse Isle Server/Horse Isle Server/Server/GameServer.cs
+++ b/Horse Isle Server/Horse Isle Server/Server/GameServer.cs
@@ -254,6 +254,38 @@ namespace HISP.Server
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to unequip items from non existnat horse");
}
break;
+ case PacketBuilder.HORSE_DISMOUNT:
+ randomId = 0;
+ packetStr = Encoding.UTF8.GetString(packet);
+ randomIdStr = packetStr.Substring(2, packetStr.Length - 4);
+ try
+ {
+ randomId = int.Parse(randomIdStr);
+
+ }
+ catch (Exception)
+ {
+ Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid randomid to horse interaction packet ");
+ break;
+ }
+ if (sender.LoggedinUser.HorseInventory.HorseIdExist(randomId))
+ {
+ byte[] stopRidingHorseMessagePacket = PacketBuilder.CreateChat(Messages.HorseStopRidingMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
+ sender.SendPacket(stopRidingHorseMessagePacket);
+
+
+ sender.LoggedinUser.Facing %= 5;
+ byte[] rideHorsePacket = PacketBuilder.CreateHorseRidePacket(sender.LoggedinUser.X, sender.LoggedinUser.Y, sender.LoggedinUser.CharacterId, sender.LoggedinUser.Facing, 10, true);
+ sender.SendPacket(rideHorsePacket);
+
+ UpdateUserInfo(sender.LoggedinUser);
+ }
+ else
+ {
+ Logger.HackerPrint(sender.LoggedinUser.Username + " Tried to dismount at a non existant horse.");
+ break;
+ }
+ break;
case PacketBuilder.HORSE_MOUNT:
randomId = 0;
packetStr = Encoding.UTF8.GetString(packet);
@@ -318,6 +350,11 @@ namespace HISP.Server
{
incBy = 11;
}
+ if(horseInst.Breed.Id == 5) // Appaloosa
+ {
+ if(horseInst.Color == "brown")
+ incBy = 12;
+ }
if (horseInst.Breed.Type == "camel")
{
if (horseInst.Color == "brown")
@@ -340,8 +377,10 @@ namespace HISP.Server
}
incBy *= 5;
+ sender.LoggedinUser.Facing %= 5;
sender.LoggedinUser.Facing += incBy;
+
byte[] rideHorsePacket = PacketBuilder.CreateHorseRidePacket(sender.LoggedinUser.X, sender.LoggedinUser.Y, sender.LoggedinUser.CharacterId, sender.LoggedinUser.Facing, 10, true);
sender.SendPacket(rideHorsePacket);
diff --git a/Horse Isle Server/Horse Isle Server/Server/PacketBuilder.cs b/Horse Isle Server/Horse Isle Server/Server/PacketBuilder.cs
index ea2ce42..30e8fd1 100644
--- a/Horse Isle Server/Horse Isle Server/Server/PacketBuilder.cs
+++ b/Horse Isle Server/Horse Isle Server/Server/PacketBuilder.cs
@@ -53,6 +53,7 @@ namespace HISP.Server
public const byte HORSE_TACK_EQUIP = 0x3C;
public const byte HORSE_TACK_UNEQUIP = 0x3D;
public const byte HORSE_MOUNT = 0x46;
+ public const byte HORSE_DISMOUNT = 0x47;
public const byte HORSE_ESCAPE = 0x1E;
public const byte HORSE_CAUGHT = 0x1D;