mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-19 19:29:15 +12:00
allow for 'view breeds' in libary.
This commit is contained in:
parent
595d5e9797
commit
b66fe013ba
5 changed files with 37 additions and 2 deletions
|
@ -83,6 +83,9 @@ namespace HISP.Game
|
|||
public static string LibaryFindNpcSearchNoResults;
|
||||
public static string LibaryFindNpcLimit5;
|
||||
|
||||
public static string HorseBreedFormat;
|
||||
public static string HorseRelativeFormat;
|
||||
|
||||
// Records
|
||||
|
||||
public static string ProfileSavedMessage;
|
||||
|
@ -347,6 +350,14 @@ namespace HISP.Game
|
|||
// Click
|
||||
public static string NothingInterestingHere;
|
||||
|
||||
public static string FormatHorseRelative(string name, int id)
|
||||
{
|
||||
return HorseRelativeFormat.Replace("%NAME%", name).Replace("%ID%", id.ToString());
|
||||
}
|
||||
public static string FormatHorseBreed(string name, int id)
|
||||
{
|
||||
return HorseBreedFormat.Replace("%NAME%", name).Replace("%ID%", id.ToString());
|
||||
}
|
||||
public static string FormatNpcSearchResult(string name, string desc,int x, int y)
|
||||
{
|
||||
string mapXy = FormatMapLocation(x, y);
|
||||
|
|
|
@ -620,6 +620,22 @@ namespace HISP.Game
|
|||
return message;
|
||||
}
|
||||
|
||||
public static string BuildHorseList()
|
||||
{
|
||||
string message = "";
|
||||
foreach(Horse.Breed breed in Horse.Breeds.OrderBy(o => o.Name).ToList())
|
||||
{
|
||||
if (breed.Type == "unicorn" || breed.Type == "pegasus")
|
||||
continue;
|
||||
if (breed.Type == "horse")
|
||||
message += Messages.FormatHorseBreed(breed.Name, breed.Id);
|
||||
else
|
||||
message += Messages.FormatHorseRelative(breed.Name, breed.Id);
|
||||
}
|
||||
message += Messages.BackToMap;
|
||||
message += Messages.MetaTerminator;
|
||||
return message;
|
||||
}
|
||||
public static string BuildNpcSearch(string search)
|
||||
{
|
||||
List<Npc.NpcEntry> foundNpcs = new List<Npc.NpcEntry>();
|
||||
|
|
|
@ -594,6 +594,9 @@ namespace HISP.Server
|
|||
Messages.LibaryFindNpcSearchNoResults = gameData.messages.meta.libary.find_npc_no_results;
|
||||
Messages.LibaryFindNpcLimit5 = gameData.messages.meta.libary.find_npc_limit5;
|
||||
|
||||
Messages.HorseBreedFormat = gameData.messages.meta.libary.horse_breed_format;
|
||||
Messages.HorseRelativeFormat = gameData.messages.meta.libary.horse_relative_format;
|
||||
|
||||
// Chat
|
||||
|
||||
Messages.ChatViolationMessageFormat = gameData.messages.chat.violation_format;
|
||||
|
|
|
@ -356,7 +356,10 @@ namespace HISP.Server
|
|||
break;
|
||||
case "31": // Find Ranch
|
||||
break;
|
||||
case "4": // View Horse Breed
|
||||
case "4": // View Horse Breeds
|
||||
sender.LoggedinUser.MetaPriority = true;
|
||||
metaPacket = PacketBuilder.CreateMetaPacket(Meta.BuildHorseList());
|
||||
sender.SendPacket(metaPacket);
|
||||
break;
|
||||
case "9": // View Tack
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue