Fix llamas and camel speciic stuff

This commit is contained in:
SilicaAndPina 2021-02-27 17:26:01 +13:00
parent 177122cd83
commit 14f9a5b379
7 changed files with 93 additions and 75 deletions

View file

@ -733,6 +733,8 @@
"dequip_saddle_pad":"^I%ICONID%^T5%NAME%^B3M2^R1", "dequip_saddle_pad":"^I%ICONID%^T5%NAME%^B3M2^R1",
"dequip_bridle":"^I%ICONID%^T5%NAME%^B3M3^R1", "dequip_bridle":"^I%ICONID%^T5%NAME%^B3M3^R1",
"you_have_following_tack":"^LYou have the following tack in your inventory:^R1", "you_have_following_tack":"^LYou have the following tack in your inventory:^R1",
"you_have_following_camel_tack":"^LYou have the following CAMEL tack in your inventory:^R1",
"you_have_following_llama_tack":"^LYou have the following LLAMA tack in your inventory:^R1",
"equip_tack":"^I%ICONID%^T5[ %COUNT% ] %NAME%^B3K%ID%^R1", "equip_tack":"^I%ICONID%^T5[ %COUNT% ] %NAME%^B3K%ID%^R1",
}, },
}, },

View file

@ -44,7 +44,7 @@ namespace HISP.Game.Horse
Breed = breed; Breed = breed;
Color = breed.Colors[GameServer.RandomNumberGenerator.Next(0, breed.Colors.Length)]; Color = breed.Colors[GameServer.RandomNumberGenerator.Next(0, breed.Colors.Length)];
BasicStats = new HorseInfo.BasicStats(this, 1000, 0, 1000, 1000, 500, 1000, 1000, 0); BasicStats = new HorseInfo.BasicStats(this, 1000, 0, 1000, 1000, 500, 200, 1000, 0);
int inteligence = (GameServer.RandomNumberGenerator.Next(breed.BaseStats.Inteligence, (breed.BaseStats.Inteligence * 2)) - breed.BaseStats.Inteligence); int inteligence = (GameServer.RandomNumberGenerator.Next(breed.BaseStats.Inteligence, (breed.BaseStats.Inteligence * 2)) - breed.BaseStats.Inteligence);
int personality = (GameServer.RandomNumberGenerator.Next(breed.BaseStats.Personality, (breed.BaseStats.Personality * 2)) - breed.BaseStats.Personality); int personality = (GameServer.RandomNumberGenerator.Next(breed.BaseStats.Personality, (breed.BaseStats.Personality * 2)) - breed.BaseStats.Personality);
int height = GameServer.RandomNumberGenerator.Next(breed.BaseStats.MinHeight, breed.BaseStats.MaxHeight); int height = GameServer.RandomNumberGenerator.Next(breed.BaseStats.MinHeight, breed.BaseStats.MaxHeight);

View file

@ -103,6 +103,8 @@ namespace HISP.Game.Items
toMuch = true; toMuch = true;
user.Hunger += effect.EffectAmount; user.Hunger += effect.EffectAmount;
break; break;
case "MOOD":
break;
default: default:
Logger.ErrorPrint("Unknown effect: " + effect.EffectsWhat); Logger.ErrorPrint("Unknown effect: " + effect.EffectsWhat);
break; break;

View file

@ -678,6 +678,8 @@ namespace HISP.Game
public static string HorseUnEquipSaddlePadFormat; public static string HorseUnEquipSaddlePadFormat;
public static string HorseUnEquipBridleFormat; public static string HorseUnEquipBridleFormat;
public static string HorseTackInInventory; public static string HorseTackInInventory;
public static string HorseLlamaTackInInventory;
public static string HorseCamelTackInInventory;
public static string HorseEquipFormat; public static string HorseEquipFormat;
public static string BackToHorse; public static string BackToHorse;

View file

@ -1966,7 +1966,10 @@ namespace HISP.Game
foreach(InventoryItem item in user.Inventory.GetItemList()) foreach(InventoryItem item in user.Inventory.GetItemList())
{ {
Item.ItemInformation itemInfo = item.ItemInstances[0].GetItemInfo(); Item.ItemInformation itemInfo = item.ItemInstances[0].GetItemInfo();
if(itemInfo.Type == "HORSEFOOD") bool isHorseFood = false;
if (itemInfo.Effects.Length >= 2)
isHorseFood = (itemInfo.Effects[1].EffectsWhat == "MOOD" && itemInfo.Effects[0].EffectsWhat == "HUNGER");
if (itemInfo.Type == "HORSEFOOD" || isHorseFood)
{ {
message += Messages.FormatHorseFeedEntry(itemInfo.IconId, item.ItemInstances.Count, itemInfo.Name, item.ItemInstances[0].RandomId); message += Messages.FormatHorseFeedEntry(itemInfo.IconId, item.ItemInstances.Count, itemInfo.Name, item.ItemInstances[0].RandomId);
} }
@ -2243,12 +2246,24 @@ namespace HISP.Game
message += Messages.FormatUnEquipSaddlePad(horse.Equipment.SaddlePad.IconId, horse.Equipment.SaddlePad.Name); message += Messages.FormatUnEquipSaddlePad(horse.Equipment.SaddlePad.IconId, horse.Equipment.SaddlePad.Name);
if (horse.Equipment.Bridle != null) if (horse.Equipment.Bridle != null)
message += Messages.FormatUnEquipBridle(horse.Equipment.Bridle.IconId, horse.Equipment.Bridle.Name); message += Messages.FormatUnEquipBridle(horse.Equipment.Bridle.IconId, horse.Equipment.Bridle.Name);
message += Messages.HorseTackInInventory; if (horse.Breed.Type == "llama")
message += Messages.HorseLlamaTackInInventory;
else if (horse.Breed.Type == "camel")
message += Messages.HorseCamelTackInInventory;
else
message += Messages.HorseTackInInventory;
foreach(InventoryItem item in user.Inventory.GetItemList()) foreach(InventoryItem item in user.Inventory.GetItemList())
{ {
Item.ItemInformation itemInfo = item.ItemInstances[0].GetItemInfo(); Item.ItemInformation itemInfo = item.ItemInstances[0].GetItemInfo();
if (itemInfo.Type == "TACK") if (itemInfo.Type == "TACK")
{ {
if (horse.Breed.Type == "camel" && itemInfo.GetMiscFlag(2) != 1)
continue;
else if (horse.Breed.Type == "llama" && itemInfo.GetMiscFlag(2) != 2)
continue;
else if (itemInfo.GetMiscFlag(2) != 0)
continue;
message += Messages.FormatHorseEquip(itemInfo.IconId, item.ItemInstances.Count, itemInfo.Name, itemInfo.Id); message += Messages.FormatHorseEquip(itemInfo.IconId, item.ItemInstances.Count, itemInfo.Name, itemInfo.Id);
} }
} }

View file

@ -1484,6 +1484,8 @@ namespace HISP.Server
Messages.HorseUnEquipSaddlePadFormat = gameData.messages.meta.horse.tack_menu.dequip_saddle_pad; Messages.HorseUnEquipSaddlePadFormat = gameData.messages.meta.horse.tack_menu.dequip_saddle_pad;
Messages.HorseUnEquipBridleFormat = gameData.messages.meta.horse.tack_menu.dequip_bridle; Messages.HorseUnEquipBridleFormat = gameData.messages.meta.horse.tack_menu.dequip_bridle;
Messages.HorseTackInInventory = gameData.messages.meta.horse.tack_menu.you_have_following_tack; Messages.HorseTackInInventory = gameData.messages.meta.horse.tack_menu.you_have_following_tack;
Messages.HorseLlamaTackInInventory = gameData.messages.meta.horse.tack_menu.you_have_following_llama_tack;
Messages.HorseCamelTackInInventory = gameData.messages.meta.horse.tack_menu.you_have_following_camel_tack;
Messages.HorseEquipFormat = gameData.messages.meta.horse.tack_menu.equip_tack; Messages.HorseEquipFormat = gameData.messages.meta.horse.tack_menu.equip_tack;
Messages.BackToHorse = gameData.messages.meta.horse.back_to_horse; Messages.BackToHorse = gameData.messages.meta.horse.back_to_horse;

View file

@ -1088,81 +1088,75 @@ namespace HISP.Server
Item.ItemInformation itemInfo = item.ItemInstances[0].GetItemInfo(); Item.ItemInformation itemInfo = item.ItemInstances[0].GetItemInfo();
HorseInstance horseInstance = sender.LoggedinUser.LastViewedHorse; HorseInstance horseInstance = sender.LoggedinUser.LastViewedHorse;
bool tooMuch = false; bool tooMuch = false;
if (itemInfo.Type == "HORSEFOOD") foreach(Item.Effects effect in itemInfo.Effects)
{ {
foreach(Item.Effects effect in itemInfo.Effects) switch(effect.EffectsWhat)
{ {
switch(effect.EffectsWhat) case "HEALTH":
{ if (horseInstance.BasicStats.Health + effect.EffectAmount > 1000)
case "HEALTH": tooMuch = true;
if (horseInstance.BasicStats.Health + effect.EffectAmount > 1000) horseInstance.BasicStats.Health += effect.EffectAmount;
tooMuch = true; break;
horseInstance.BasicStats.Health += effect.EffectAmount; case "HUNGER":
break; if (horseInstance.BasicStats.Hunger + effect.EffectAmount > 1000)
case "HUNGER": tooMuch = true;
if (horseInstance.BasicStats.Hunger + effect.EffectAmount > 1000) horseInstance.BasicStats.Hunger += effect.EffectAmount;
tooMuch = true; break;
horseInstance.BasicStats.Hunger += effect.EffectAmount; case "MOOD":
break; if (horseInstance.BasicStats.Mood + effect.EffectAmount > 1000)
case "MOOD": tooMuch = true;
if (horseInstance.BasicStats.Mood + effect.EffectAmount > 1000) horseInstance.BasicStats.Mood += effect.EffectAmount;
tooMuch = true; break;
horseInstance.BasicStats.Mood += effect.EffectAmount; case "GROOM":
break; if (horseInstance.BasicStats.Groom + effect.EffectAmount > 1000)
case "GROOM": tooMuch = true;
if (horseInstance.BasicStats.Groom + effect.EffectAmount > 1000) horseInstance.BasicStats.Groom += effect.EffectAmount;
tooMuch = true; break;
horseInstance.BasicStats.Groom += effect.EffectAmount; case "SHOES":
break; if (horseInstance.BasicStats.Shoes + effect.EffectAmount > 1000)
case "SHOES": tooMuch = true;
if (horseInstance.BasicStats.Shoes + effect.EffectAmount > 1000) horseInstance.BasicStats.Shoes += effect.EffectAmount;
tooMuch = true; break;
horseInstance.BasicStats.Shoes += effect.EffectAmount; case "THIRST":
break; if (horseInstance.BasicStats.Thirst + effect.EffectAmount > 1000)
case "THIRST": tooMuch = true;
if (horseInstance.BasicStats.Thirst + effect.EffectAmount > 1000) horseInstance.BasicStats.Thirst += effect.EffectAmount;
tooMuch = true; break;
horseInstance.BasicStats.Thirst += effect.EffectAmount; case "TIREDNESS":
break; if (horseInstance.BasicStats.Tiredness + effect.EffectAmount > 1000)
case "TIREDNESS": tooMuch = true;
if (horseInstance.BasicStats.Tiredness + effect.EffectAmount > 1000) horseInstance.BasicStats.Tiredness += effect.EffectAmount;
tooMuch = true; break;
horseInstance.BasicStats.Tiredness += effect.EffectAmount;
break;
case "INTELLIGENCEOFFSET": case "INTELLIGENCEOFFSET":
horseInstance.AdvancedStats.Inteligence += effect.EffectAmount; horseInstance.AdvancedStats.Inteligence += effect.EffectAmount;
horseInstance.MagicUsed++; horseInstance.MagicUsed++;
break; break;
case "PERSONALITYOFFSET": case "PERSONALITYOFFSET":
horseInstance.AdvancedStats.Personality += effect.EffectAmount; horseInstance.AdvancedStats.Personality += effect.EffectAmount;
horseInstance.MagicUsed++; horseInstance.MagicUsed++;
break; break;
case "SPOILED": case "SPOILED":
horseInstance.Spoiled += effect.EffectAmount; horseInstance.Spoiled += effect.EffectAmount;
break; break;
}
} }
sender.LoggedinUser.Inventory.Remove(item.ItemInstances[0]);
byte[] horseNeighThanksPacket = PacketBuilder.CreateChat(Messages.HorseNeighsThanks, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(horseNeighThanksPacket);
if (tooMuch)
{
byte[] horseCouldntFinishItAll = PacketBuilder.CreateChat(Messages.HorseCouldNotFinish, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(horseCouldntFinishItAll);
}
sender.LoggedinUser.MetaPriority = true;
byte[] metaPacket = PacketBuilder.CreateMetaPacket(Meta.BuildHorseFeedMenu(sender.LoggedinUser.LastViewedHorse, sender.LoggedinUser));
sender.SendPacket(metaPacket);
break;
} }
else sender.LoggedinUser.Inventory.Remove(item.ItemInstances[0]);
byte[] horseNeighThanksPacket = PacketBuilder.CreateChat(Messages.HorseNeighsThanks, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(horseNeighThanksPacket);
if (tooMuch)
{ {
Logger.HackerPrint(sender.LoggedinUser.Username + "Tried to feed a horse a non-HORSEFOOD item."); byte[] horseCouldntFinishItAll = PacketBuilder.CreateChat(Messages.HorseCouldNotFinish, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(horseCouldntFinishItAll);
} }
sender.LoggedinUser.MetaPriority = true;
byte[] metaPacket = PacketBuilder.CreateMetaPacket(Meta.BuildHorseFeedMenu(sender.LoggedinUser.LastViewedHorse, sender.LoggedinUser));
sender.SendPacket(metaPacket);
break; break;
} }
else else
@ -6569,10 +6563,11 @@ namespace HISP.Server
} }
if (horseMountInst.Breed.Type == "camel") if (horseMountInst.Breed.Type == "camel")
{ {
if (horseMountInst.Color == "brown") incBy = 13;
incBy = 13; }
if (horseMountInst.Color == "white") if(horseMountInst.Breed.Type == "llama")
incBy = 14; {
incBy = 14;
} }
if (horseMountInst.Breed.Type == "unicorn") if (horseMountInst.Breed.Type == "unicorn")
{ {