diff --git a/DataCollection/Useful Info/mirandalog.html b/DataCollection/Useful Info/mirandalog.html new file mode 100644 index 0000000..6e2192e --- /dev/null +++ b/DataCollection/Useful Info/mirandalog.html @@ -0,0 +1,134 @@ + +HORSE ISLE - Online Multiplayer Horse Game + + + + + + + + + + + + + + + + + + + + + +
Welcome to Horse Isle 
+ + + + + +
USER:
PASS:
(Forgot?)
+ +
 
+
+ + Username or Password is not valid or your account has timed out. Please Log in again.

+ + + + +
+
+[ New Player Guide ]
+[ Rules ] +[ Terms and Conditions ] +[ Privacy Policy ]

+[ Expected Behavior ] +[ Contact Us ] +[ Credits ]
+Copyright © 2021 Horse Isle + + + + diff --git a/DataCollection/gamedata.json b/DataCollection/gamedata.json index c88aa21..75a20a2 100755 --- a/DataCollection/gamedata.json +++ b/DataCollection/gamedata.json @@ -59,6 +59,7 @@ "incorrect_password":"Incorrect. You will have to find the correct answer somewhere...", "player_here":"%USERNAME% here", "no_telescope":"You do not have a telescope to use! You try making circles with your hands and placing them in front of one eye, but it is of minimal aid...", + "starved_horse":"You have been sent to Prison Isle for starving one of your horses! They have been fed for you.", "horse_leaser":{ "cant_afford":"You cannot afford the lease fee.", "temporary_horse_added":"New temporary horse added to your horse list.", @@ -209,6 +210,26 @@ "password_input":"
^PLReply:|^PS14|ANSWER^R1", "last_poet":"^R1^LLast Player Poet:%USERNAME% ^R1", "hammock":"You and all of your horses have fully rested.", + "auction":{ + "auctions_running":"The following auctions are running:
", + "auction_horse_entry":"^I252^T8%USERNAME%'s %COLOR% %BREED% %GENDER% (%EXP%exp)^B3L%RANDOMID%^R1^T8In %TIME%m going to %WINNINGPLAYER% for $%WINNINGBID%^R1^B72%RANDOMID%^B73%RANDOMID%^B74%RANDOMID%^B75%RANDOMID%^B76%RANDOMID%^B77%RANDOMID%^B78%RANDOMID%^R1", + "players_here":"^HPlayers Here: %USERNAMES%", + "auction_horse":"^T0(2b max)^D41|AUCTION A HORSE^R1", + + "list_horse":"^HIt costs you $1,000 to auction. If you wish to set a minimum bid for your horse, bid on it yourself. All auctions run for 8 minutes.
Select from one of your horses to auction:^R1", + "horse_list_entry":"^I252^T3%HORSENAME%%TACKEDORNO%^D42c%RANDOMID%|AUCTION^R1", + "tacked":"[tacked!]", + + "bid_raised":"Your bid raised $%AMOUNT% to $%NEWAMOUNT%.", + "top_bid":" TOP BID", + "existing_higher":" Existing Bid is Higher", + + "outbid_by":"You have been outbid by %USERNAME%. High bid is now $%AMOUNT%.", + "cant_afford_bid":"You cannot afford that bid.", + "brought_horse":"You bought a horse at auction for $%MONEY%", + "no_one_brought":"No one bought your horse at auction.", + "horse_sold":"You sold a horse at auction for $%MONEY%" + }, "horse_games":{ "select_a_horse":"
^LSelect a horse to compete with:^R1", "horse_entry":"^I252^T7#%PLACING%: %HORSENAME%^BM%SWF%^R1" @@ -466,7 +487,7 @@ "horse_status":"^LYour horse %HORSENAME%: (tired %TIREDNESS%)(hunger %HUNGER%) (thirst %THIRST%)^R1", "horse_maxed":"^I241^T9This barn cannot help this horse in any way.^R1", "let_relax":"^I241^T8Let the horse relax for $%PRICE% ^B3B%RANDOMID%^R1", - "relax_all":"^R1^LYou could also rest all of your horses at once:^R1^I241^T7Let all the horses relax for $%PRICE% ^B3H^R1^" + "relax_all":"^LYou could also rest all of your horses at once:^R1^I241^T7Let all the horses relax for $%PRICE% ^B3H^R1^" }, "pond":{ "header":"^LYou can go fishing at this pond!^R1", diff --git a/Horse Isle Server/HorseIsleServer/Game/Horse/HorseInstance.cs b/Horse Isle Server/HorseIsleServer/Game/Horse/HorseInstance.cs index a4fa2b1..4c11951 100755 --- a/Horse Isle Server/HorseIsleServer/Game/Horse/HorseInstance.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Horse/HorseInstance.cs @@ -6,7 +6,7 @@ namespace HISP.Game.Horse { public class HorseInstance { - public HorseInstance(HorseInfo.Breed breed, int randomId = -1, string loadName=null, string loadDescription = "", int loadSpoiled=0, string loadCategory="KEEPER", int loadMagicUsed=0, int loadAutoSell=0, int leaseTimer=0) + public HorseInstance(HorseInfo.Breed breed, int randomId = -1, string loadName=null, string loadDescription = "", int loadSpoiled=0, string loadCategory="KEEPER", int loadMagicUsed=0, int loadAutoSell=0, int leaseTimer=0, bool loadHidden=false) { RandomId = RandomID.NextRandomId(randomId); Owner = 0; @@ -56,11 +56,25 @@ namespace HISP.Game.Horse spoiled = loadSpoiled; magicUsed = loadMagicUsed; leaseTime = leaseTimer; + hidden = loadHidden; Leaser = 0; } public int Leaser; public int RandomId; public int Owner; + + public bool Hidden + { + get + { + return hidden; + } + set + { + hidden = value; + Database.SetHorseHidden(RandomId, value); + } + } public int LeaseTime { get @@ -171,6 +185,7 @@ namespace HISP.Game.Horse private string description; private int spoiled; private int leaseTime; + private bool hidden; private int magicUsed; private int autosell; private string category; diff --git a/Horse Isle Server/HorseIsleServer/Game/Messages.cs b/Horse Isle Server/HorseIsleServer/Game/Messages.cs index 422d840..9132555 100755 --- a/Horse Isle Server/HorseIsleServer/Game/Messages.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Messages.cs @@ -324,6 +324,8 @@ namespace HISP.Game public static string ModChatFormat; public static string AdminChatFormat; + public static string YouWereSentToPrisionIsle; + public static string AdminCommandFormat; public static string PlayerCommandFormat; diff --git a/Horse Isle Server/HorseIsleServer/Game/Meta.cs b/Horse Isle Server/HorseIsleServer/Game/Meta.cs index 414b4e2..c9b7b4d 100755 --- a/Horse Isle Server/HorseIsleServer/Game/Meta.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Meta.cs @@ -1495,6 +1495,8 @@ namespace HISP.Game { string message = ""; int totalPrice = 0; + + foreach (HorseInstance horse in user.HorseInventory.HorseList) { message += Messages.FormatVetServiceHorseMeta(horse.Name, horse.BasicStats.Health, 1000); @@ -1510,7 +1512,8 @@ namespace HISP.Game } } - message += Messages.FormatVetApplyAllServiceMeta(totalPrice); + if (user.HorseInventory.HorseList.Length > 0) + message += Messages.FormatVetApplyAllServiceMeta(totalPrice); message += Messages.ExitThisPlace; message += Messages.MetaTerminator; return message; diff --git a/Horse Isle Server/HorseIsleServer/Game/Treasure.cs b/Horse Isle Server/HorseIsleServer/Game/Treasure.cs index e18f001..d256bdc 100644 --- a/Horse Isle Server/HorseIsleServer/Game/Treasure.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Treasure.cs @@ -136,6 +136,7 @@ namespace HISP.Game { treasures.Remove(this); + Database.DeleteTreasure(this.RandomId); GenerateTreasure(); byte[] MovementPacket = PacketBuilder.CreateMovementPacket(user.X, user.Y, user.CharacterId, user.Facing, PacketBuilder.DIRECTION_TELEPORT, true); diff --git a/Horse Isle Server/HorseIsleServer/Player/User.cs b/Horse Isle Server/HorseIsleServer/Player/User.cs index 73af366..d99d48a 100755 --- a/Horse Isle Server/HorseIsleServer/Player/User.cs +++ b/Horse Isle Server/HorseIsleServer/Player/User.cs @@ -456,6 +456,7 @@ namespace HISP.Player byte[] MovementPacket = PacketBuilder.CreateMovementPacket(X, Y, CharacterId, Facing, PacketBuilder.DIRECTION_TELEPORT, true); LoggedinClient.SendPacket(MovementPacket); + GameServer.UpdateWeather(LoggedinClient); GameServer.Update(LoggedinClient); } diff --git a/Horse Isle Server/HorseIsleServer/Server/Database.cs b/Horse Isle Server/HorseIsleServer/Server/Database.cs index 3e4c4f5..af45f6e 100755 --- a/Horse Isle Server/HorseIsleServer/Server/Database.cs +++ b/Horse Isle Server/HorseIsleServer/Server/Database.cs @@ -41,7 +41,7 @@ namespace HISP.Server string PoetryRooms = "CREATE TABLE PoetryRooms(poetId INT, X INT, Y INT, roomId INT)"; string SavedDrawings = "CREATE TABLE SavedDrawings(playerId INT, Drawing1 TEXT(65535), Drawing2 TEXT(65535), Drawing3 TEXT(65535))"; string DrawingRooms = "CREATE TABLE DrawingRooms(roomId INT, Drawing TEXT(65535))"; - string Horses = "CREATE TABLE Horses(randomId INT, ownerId INT, leaseTime INT, leaser INT, breed INT, name TEXT(128), description TEXT(1028), sex TEXT(128), color TEXT(128), health INT, shoes INT, hunger INT, thirst INT, mood INT, groom INT, tiredness INT, experience INT, speed INT, strength INT, conformation INT, agility INT, endurance INT, inteligence INT, personality INT, height INT, saddle INT, saddlepad INT, bridle INT, companion INT, autoSell INT, trainTimer INT, category TEXT(128), spoiled INT, magicUsed INT)"; + string Horses = "CREATE TABLE Horses(randomId INT, ownerId INT, leaseTime INT, leaser INT, breed INT, name TEXT(128), description TEXT(1028), sex TEXT(128), color TEXT(128), health INT, shoes INT, hunger INT, thirst INT, mood INT, groom INT, tiredness INT, experience INT, speed INT, strength INT, conformation INT, agility INT, endurance INT, inteligence INT, personality INT, height INT, saddle INT, saddlepad INT, bridle INT, companion INT, autoSell INT, trainTimer INT, category TEXT(128), spoiled INT, magicUsed INT, hidden TEXT(3))"; string WildHorse = "CREATE TABLE WildHorse(randomId INT, originalOwner INT, breed INT, x INT, y INT, name TEXT(128), description TEXT(1028), sex TEXT(128), color TEXT(128), health INT, shoes INT, hunger INT, thirst INT, mood INT, groom INT, tiredness INT, experience INT, speed INT, strength INT, conformation INT, agility INT, endurance INT, inteligence INT, personality INT, height INT, saddle INT, saddlepad INT, bridle INT, companion INT, timeout INT, autoSell INT, trainTimer INT, category TEXT(128), spoiled INT, magicUsed INT)"; string LastPlayer = "CREATE TABLE LastPlayer(roomId TEXT(1028), playerId INT)"; string TrackingStats = "CREATE TABLE Tracking(playerId INT, what TEXT(128), count INT)"; @@ -1157,7 +1157,8 @@ namespace HISP.Server { db.Open(); MySqlCommand sqlCommand = db.CreateCommand(); - sqlCommand.CommandText = "UPDATE Treasure SET value=@value"; + sqlCommand.CommandText = "UPDATE Treasure SET value=@value WHERE randomId=@randomId"; + sqlCommand.Parameters.AddWithValue("@randomId", randomId); sqlCommand.Parameters.AddWithValue("@value", value); sqlCommand.Prepare(); sqlCommand.ExecuteNonQuery(); @@ -1166,6 +1167,21 @@ namespace HISP.Server } } + public static void DeleteTreasure(int randomId) + { + using (MySqlConnection db = new MySqlConnection(ConnectionString)) + { + db.Open(); + MySqlCommand sqlCommand = db.CreateCommand(); + sqlCommand.CommandText = "DELETE FROM Treasure WHERE randomId=@randomId"; + sqlCommand.Parameters.AddWithValue("@randomId", randomId); + sqlCommand.Prepare(); + sqlCommand.ExecuteNonQuery(); + + sqlCommand.Dispose(); + } + } + public static void AddTreasure(int randomId, int x, int y, int value, string type) { using (MySqlConnection db = new MySqlConnection(ConnectionString)) @@ -1448,6 +1464,7 @@ namespace HISP.Server int magicUsed = reader.GetInt32(33); int autosell = reader.GetInt32(29); int leaseTime = reader.GetInt32(2); + bool hidden = reader.GetString(33) == "YES"; HorseInstance inst = new HorseInstance(horseBreed, randomId, name, description, spoiled, category, magicUsed, autosell, leaseTime); inst.Owner = reader.GetInt32(1); @@ -1485,6 +1502,8 @@ namespace HISP.Server inst.Equipment.Bridle = Item.GetItemById(reader.GetInt32(27)); if (!reader.IsDBNull(28)) inst.Equipment.Companion = Item.GetItemById(reader.GetInt32(28)); + + return inst; } @@ -1642,6 +1661,7 @@ namespace HISP.Server } + public static void LoadWildHorses() { using (MySqlConnection db = new MySqlConnection(ConnectionString)) @@ -2106,6 +2126,8 @@ namespace HISP.Server } + + public static bool WeatherExists(string Area) { using (MySqlConnection db = new MySqlConnection(ConnectionString)) @@ -2236,6 +2258,22 @@ namespace HISP.Server return trainTimer; } } + + + public static void SetHorseHidden(int randomId, bool hidden) + { + using (MySqlConnection db = new MySqlConnection(ConnectionString)) + { + db.Open(); + MySqlCommand sqlCommand = db.CreateCommand(); + sqlCommand.CommandText = "UPDATE Horses SET hidden=@hidden WHERE randomId=@randomId"; + sqlCommand.Parameters.AddWithValue("@hidden", hidden ? "YES" : "NO"); + sqlCommand.Parameters.AddWithValue("@randomId", randomId); + sqlCommand.Prepare(); + sqlCommand.ExecuteNonQuery(); + sqlCommand.Dispose(); + } + } public static void SetHorseTrainTimeout(int horseRandomId, int trainTimeout) { using (MySqlConnection db = new MySqlConnection(ConnectionString)) diff --git a/Horse Isle Server/HorseIsleServer/Server/GameClient.cs b/Horse Isle Server/HorseIsleServer/Server/GameClient.cs index b993677..c65cdb0 100755 --- a/Horse Isle Server/HorseIsleServer/Server/GameClient.cs +++ b/Horse Isle Server/HorseIsleServer/Server/GameClient.cs @@ -53,7 +53,7 @@ namespace HISP.Server } } - + bool gotoPrision = false; foreach(HorseInstance horse in LoggedinUser.HorseInventory.HorseList) { if (totalMinutesElapsed % 2 == 0) @@ -61,16 +61,21 @@ namespace HISP.Server horse.BasicStats.Thirst--; horse.BasicStats.Hunger--; - if (horse.BasicStats.Thirst <= 0) + if (horse.BasicStats.Thirst <= 0 && horse.BasicStats.Hunger <= 0) + { horse.BasicStats.Health -= 5; + if(horse.BasicStats.Hunger <= 0) + { + gotoPrision = true; // Goto jail, go directly to jail, do not pass go, do not collect 200$ + + horse.BasicStats.Health = 10; + horse.BasicStats.Hunger = 500; + horse.BasicStats.Thirst = 500; + } + } } - if (totalMinutesElapsed % 60 == 0) - { - horse.BasicStats.Shoes--; - horse.BasicStats.Tiredness--; - } - + if(horse.Leaser > 0) { horse.LeaseTime--; @@ -149,7 +154,12 @@ namespace HISP.Server } } - + if(gotoPrision) + { + byte[] sendToPrision = PacketBuilder.CreateChat(Messages.YouWereSentToPrisionIsle, PacketBuilder.CHAT_BOTTOM_RIGHT); + SendPacket(sendToPrision); + LoggedinUser.Teleport(45, 35); + } if (totalMinutesElapsed % 2 == 0) { @@ -162,7 +172,9 @@ namespace HISP.Server LoggedinUser.Tiredness--; } - if(!isDisconnecting) + + + if (!isDisconnecting) minuteTimer.Change(oneMinute, oneMinute); dcLock = false; } diff --git a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs index 51ce845..c25f8a2 100755 --- a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs +++ b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs @@ -1395,6 +1395,7 @@ namespace HISP.Server Messages.GlobalChatFormatForModerators = gameData.messages.chat.for_others.global_format_moderator; Messages.DirectChatFormatForModerators = gameData.messages.chat.for_others.dm_format_moderator; + Messages.YouWereSentToPrisionIsle = gameData.messages.starved_horse; Messages.HereChatFormat = gameData.messages.chat.for_others.here_format; Messages.IsleChatFormat = gameData.messages.chat.for_others.isle_format; diff --git a/Horse Isle Server/HorseIsleServer/Server/GameServer.cs b/Horse Isle Server/HorseIsleServer/Server/GameServer.cs index 6167f49..75f88e1 100755 --- a/Horse Isle Server/HorseIsleServer/Server/GameServer.cs +++ b/Horse Isle Server/HorseIsleServer/Server/GameServer.cs @@ -5128,7 +5128,7 @@ namespace HISP.Server sender.LoggedinUser.Money += sellPrice; - UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y); + UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y, true); if(message == 1) { byte[] soldItemMessage = PacketBuilder.CreateChat(Messages.FormatSellMessage(itemInfo.Name, sellPrice), PacketBuilder.CHAT_BOTTOM_RIGHT); @@ -5306,7 +5306,7 @@ namespace HISP.Server // Send chat message to client. - UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y); + UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y, true); if (message == 1) { byte[] broughtItemMessage = PacketBuilder.CreateChat(Messages.FormatBuyMessage(itemInfo.Name, buyCost), PacketBuilder.CHAT_BOTTOM_RIGHT); @@ -5898,7 +5898,6 @@ namespace HISP.Server if(!nearbyUser.MetaPriority) UpdateArea(nearbyUser.LoggedinClient); - UpdateWeather(client); UpdateUserInfo(client.LoggedinUser); }