mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-10 07:05:41 +12:00
Fix Training not showing in barns.
Fix Crash on invalid ranch loading Add "Player here" click message.
This commit is contained in:
parent
2d2d6235e3
commit
afc232352d
6 changed files with 34 additions and 2 deletions
|
@ -12,6 +12,7 @@
|
||||||
"playtime_timeout":"You have run out of playtime for now. In one minute you will be disconnected. You gain one minute of playtime every 8 minutes. Please come back later!",
|
"playtime_timeout":"You have run out of playtime for now. In one minute you will be disconnected. You gain one minute of playtime every 8 minutes. Please come back later!",
|
||||||
"random_movement":"You are sooo <B>%STAT%</B>. You wander dizzily in a different direction.",
|
"random_movement":"You are sooo <B>%STAT%</B>. You wander dizzily in a different direction.",
|
||||||
"incorrect_password":"Incorrect. You will have to find the correct answer somewhere...",
|
"incorrect_password":"Incorrect. You will have to find the correct answer somewhere...",
|
||||||
|
"player_here":"%USERNAME% here",
|
||||||
"treasure":{
|
"treasure":{
|
||||||
"pirate_treasure":"Wow! You found buried treasure worth $%PRIZE%! Gotta love those pirates!",
|
"pirate_treasure":"Wow! You found buried treasure worth $%PRIZE%! Gotta love those pirates!",
|
||||||
"pot_of_gold":"YEA! You found the fabled pot of gold at the end of the rainbow! It was worth $%PRIZE%!"
|
"pot_of_gold":"YEA! You found the fabled pot of gold at the end of the rainbow! It was worth $%PRIZE%!"
|
||||||
|
@ -2406,7 +2407,7 @@
|
||||||
"categorys":[
|
"categorys":[
|
||||||
{"name":"LEASED","message":"^LLEASED - Horses only temporarily cared for, limited use:^R1","message_others":"^LLEASED - Horses only temporarily cared for, limited use:^R1"},
|
{"name":"LEASED","message":"^LLEASED - Horses only temporarily cared for, limited use:^R1","message_others":"^LLEASED - Horses only temporarily cared for, limited use:^R1"},
|
||||||
{"name":"KEEPER","message":"^LKEEPERS - Horses I would not sell for any price:^R1","message_others":"^LKEEPERS - Horses not for sale for any price^R1"},
|
{"name":"KEEPER","message":"^LKEEPERS - Horses I would not sell for any price:^R1","message_others":"^LKEEPERS - Horses not for sale for any price^R1"},
|
||||||
{"name":"TRAINING","message":"^LTRAINING - Horses I am actively training and competing with:^R1","message_others":"TRAINING - Horses actively being trained and competed with:^R1"},
|
{"name":"TRAINING","message":"^LTRAINING - Horses I am actively training and competing with:^R1","message_others":"^LTRAINING - Horses actively being trained and competed with:^R1"},
|
||||||
{"name":"TRADING","message":"^LTRADING - Horses I am trading or auctioning:^R1","message_others":"^LTRADING - Horses for trading or auctioning:^R1"},
|
{"name":"TRADING","message":"^LTRADING - Horses I am trading or auctioning:^R1","message_others":"^LTRADING - Horses for trading or auctioning:^R1"},
|
||||||
{"name":"RETIRED","message":"^LRETIRED - Horses that are still special to me but not used:^R1","message_others":"^LRETIRED - Horses that are still special to player but not used:^R1"}
|
{"name":"RETIRED","message":"^LRETIRED - Horses that are still special to me but not used:^R1","message_others":"^LRETIRED - Horses that are still special to player but not used:^R1"}
|
||||||
],
|
],
|
||||||
|
|
|
@ -12,6 +12,9 @@ namespace HISP.Game
|
||||||
// Mod isle
|
// Mod isle
|
||||||
public static string ModIsleMessage;
|
public static string ModIsleMessage;
|
||||||
|
|
||||||
|
// Click
|
||||||
|
public static string PlayerHereFormat;
|
||||||
|
|
||||||
// Ranch
|
// Ranch
|
||||||
public static string RanchUnownedRanchFormat;
|
public static string RanchUnownedRanchFormat;
|
||||||
public static string RanchYouCouldPurchaseThisRanch;
|
public static string RanchYouCouldPurchaseThisRanch;
|
||||||
|
@ -682,6 +685,11 @@ namespace HISP.Game
|
||||||
public static string NothingInterestingHere;
|
public static string NothingInterestingHere;
|
||||||
|
|
||||||
|
|
||||||
|
public static string FormatPlayerHereMessage(string playerName)
|
||||||
|
{
|
||||||
|
return PlayerHereFormat.Replace("%USERNAME%", playerName);
|
||||||
|
}
|
||||||
|
|
||||||
// Farrier Formats
|
// Farrier Formats
|
||||||
public static string FormatFarrierPutOnSteelShoesAllMesssage(int curShoes, int maxShoes)
|
public static string FormatFarrierPutOnSteelShoesAllMesssage(int curShoes, int maxShoes)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1197,6 +1197,13 @@ namespace HISP.Game
|
||||||
{
|
{
|
||||||
|
|
||||||
string message = "";
|
string message = "";
|
||||||
|
|
||||||
|
if(!Ranch.RanchExists(ranchId)) // Ghost ranchs exist.. apparently?
|
||||||
|
{
|
||||||
|
user.MetaPriority = false;
|
||||||
|
return BuildMetaInfo(user, user.X, user.Y);
|
||||||
|
}
|
||||||
|
|
||||||
Ranch ranch = Ranch.GetRanchById(ranchId);
|
Ranch ranch = Ranch.GetRanchById(ranchId);
|
||||||
bool mine = (ranch.OwnerId == user.Id);
|
bool mine = (ranch.OwnerId == user.Id);
|
||||||
string swfModule = ranch.GetSwf(mine);
|
string swfModule = ranch.GetSwf(mine);
|
||||||
|
|
|
@ -405,6 +405,15 @@ namespace HISP.Game
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
public static bool RanchExists(int ranchId)
|
||||||
|
{
|
||||||
|
foreach (Ranch ranch in Ranches)
|
||||||
|
{
|
||||||
|
if (ranch.Id == ranchId)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
public static Ranch GetRanchById(int ranchId)
|
public static Ranch GetRanchById(int ranchId)
|
||||||
{
|
{
|
||||||
foreach (Ranch ranch in Ranches)
|
foreach (Ranch ranch in Ranches)
|
||||||
|
|
|
@ -686,6 +686,9 @@ namespace HISP.Server
|
||||||
Map.ModIsleX = gameData.messages.commands.mod_isle.x;
|
Map.ModIsleX = gameData.messages.commands.mod_isle.x;
|
||||||
Map.ModIsleY = gameData.messages.commands.mod_isle.y;
|
Map.ModIsleY = gameData.messages.commands.mod_isle.y;
|
||||||
|
|
||||||
|
// Click
|
||||||
|
Messages.PlayerHereFormat = gameData.messages.player_here;
|
||||||
|
|
||||||
// Ranch
|
// Ranch
|
||||||
Messages.RanchUnownedRanchFormat = gameData.messages.meta.ranch.unowned_ranch;
|
Messages.RanchUnownedRanchFormat = gameData.messages.meta.ranch.unowned_ranch;
|
||||||
Messages.RanchYouCouldPurchaseThisRanch = gameData.messages.meta.ranch.you_could_purchase_this;
|
Messages.RanchYouCouldPurchaseThisRanch = gameData.messages.meta.ranch.you_could_purchase_this;
|
||||||
|
|
|
@ -3618,7 +3618,7 @@ namespace HISP.Server
|
||||||
if (tile.Title != null)
|
if (tile.Title != null)
|
||||||
returnedMsg = tile.Title;
|
returnedMsg = tile.Title;
|
||||||
}
|
}
|
||||||
if(Ranch.IsRanchHere(x, y))
|
if(Ranch.IsRanchHere(x, y)) // Ranch here?
|
||||||
{
|
{
|
||||||
Ranch ranch = Ranch.GetRanchAt(x, y);
|
Ranch ranch = Ranch.GetRanchAt(x, y);
|
||||||
if(ranch.OwnerId == -1)
|
if(ranch.OwnerId == -1)
|
||||||
|
@ -3633,6 +3633,10 @@ namespace HISP.Server
|
||||||
returnedMsg = Messages.FormatRanchClickMessage(Database.GetUsername(ranch.OwnerId), title);
|
returnedMsg = Messages.FormatRanchClickMessage(Database.GetUsername(ranch.OwnerId), title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(GetUsersAt(x,y, false, true).Length > 0) // Player here?
|
||||||
|
{
|
||||||
|
returnedMsg = Messages.FormatPlayerHereMessage(GetUsersAt(x, y, false, true)[0].Username);
|
||||||
|
}
|
||||||
|
|
||||||
byte[] tileInfoPacket = PacketBuilder.CreateClickTileInfoPacket(returnedMsg);
|
byte[] tileInfoPacket = PacketBuilder.CreateClickTileInfoPacket(returnedMsg);
|
||||||
sender.SendPacket(tileInfoPacket);
|
sender.SendPacket(tileInfoPacket);
|
||||||
|
|
Loading…
Add table
Reference in a new issue