mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-07 13:45:42 +12:00
Fix llamas and camel speciic stuff
This commit is contained in:
parent
177122cd83
commit
14f9a5b379
7 changed files with 93 additions and 75 deletions
|
@ -733,6 +733,8 @@
|
|||
"dequip_saddle_pad":"^I%ICONID%^T5%NAME%^B3M2^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_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",
|
||||
},
|
||||
},
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace HISP.Game.Horse
|
|||
Breed = breed;
|
||||
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 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);
|
||||
|
|
|
@ -103,6 +103,8 @@ namespace HISP.Game.Items
|
|||
toMuch = true;
|
||||
user.Hunger += effect.EffectAmount;
|
||||
break;
|
||||
case "MOOD":
|
||||
break;
|
||||
default:
|
||||
Logger.ErrorPrint("Unknown effect: " + effect.EffectsWhat);
|
||||
break;
|
||||
|
|
|
@ -678,6 +678,8 @@ namespace HISP.Game
|
|||
public static string HorseUnEquipSaddlePadFormat;
|
||||
public static string HorseUnEquipBridleFormat;
|
||||
public static string HorseTackInInventory;
|
||||
public static string HorseLlamaTackInInventory;
|
||||
public static string HorseCamelTackInInventory;
|
||||
public static string HorseEquipFormat;
|
||||
public static string BackToHorse;
|
||||
|
||||
|
|
|
@ -1966,7 +1966,10 @@ namespace HISP.Game
|
|||
foreach(InventoryItem item in user.Inventory.GetItemList())
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
@ -2243,12 +2246,24 @@ namespace HISP.Game
|
|||
message += Messages.FormatUnEquipSaddlePad(horse.Equipment.SaddlePad.IconId, horse.Equipment.SaddlePad.Name);
|
||||
if (horse.Equipment.Bridle != null)
|
||||
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())
|
||||
{
|
||||
Item.ItemInformation itemInfo = item.ItemInstances[0].GetItemInfo();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1484,6 +1484,8 @@ namespace HISP.Server
|
|||
Messages.HorseUnEquipSaddlePadFormat = gameData.messages.meta.horse.tack_menu.dequip_saddle_pad;
|
||||
Messages.HorseUnEquipBridleFormat = gameData.messages.meta.horse.tack_menu.dequip_bridle;
|
||||
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.BackToHorse = gameData.messages.meta.horse.back_to_horse;
|
||||
|
||||
|
|
|
@ -1088,81 +1088,75 @@ namespace HISP.Server
|
|||
Item.ItemInformation itemInfo = item.ItemInstances[0].GetItemInfo();
|
||||
HorseInstance horseInstance = sender.LoggedinUser.LastViewedHorse;
|
||||
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)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Health += effect.EffectAmount;
|
||||
break;
|
||||
case "HUNGER":
|
||||
if (horseInstance.BasicStats.Hunger + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Hunger += effect.EffectAmount;
|
||||
break;
|
||||
case "MOOD":
|
||||
if (horseInstance.BasicStats.Mood + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Mood += effect.EffectAmount;
|
||||
break;
|
||||
case "GROOM":
|
||||
if (horseInstance.BasicStats.Groom + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Groom += effect.EffectAmount;
|
||||
break;
|
||||
case "SHOES":
|
||||
if (horseInstance.BasicStats.Shoes + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Shoes += effect.EffectAmount;
|
||||
break;
|
||||
case "THIRST":
|
||||
if (horseInstance.BasicStats.Thirst + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Thirst += effect.EffectAmount;
|
||||
break;
|
||||
case "TIREDNESS":
|
||||
if (horseInstance.BasicStats.Tiredness + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Tiredness += effect.EffectAmount;
|
||||
break;
|
||||
case "HEALTH":
|
||||
if (horseInstance.BasicStats.Health + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Health += effect.EffectAmount;
|
||||
break;
|
||||
case "HUNGER":
|
||||
if (horseInstance.BasicStats.Hunger + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Hunger += effect.EffectAmount;
|
||||
break;
|
||||
case "MOOD":
|
||||
if (horseInstance.BasicStats.Mood + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Mood += effect.EffectAmount;
|
||||
break;
|
||||
case "GROOM":
|
||||
if (horseInstance.BasicStats.Groom + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Groom += effect.EffectAmount;
|
||||
break;
|
||||
case "SHOES":
|
||||
if (horseInstance.BasicStats.Shoes + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Shoes += effect.EffectAmount;
|
||||
break;
|
||||
case "THIRST":
|
||||
if (horseInstance.BasicStats.Thirst + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Thirst += effect.EffectAmount;
|
||||
break;
|
||||
case "TIREDNESS":
|
||||
if (horseInstance.BasicStats.Tiredness + effect.EffectAmount > 1000)
|
||||
tooMuch = true;
|
||||
horseInstance.BasicStats.Tiredness += effect.EffectAmount;
|
||||
break;
|
||||
|
||||
case "INTELLIGENCEOFFSET":
|
||||
horseInstance.AdvancedStats.Inteligence += effect.EffectAmount;
|
||||
horseInstance.MagicUsed++;
|
||||
break;
|
||||
case "PERSONALITYOFFSET":
|
||||
horseInstance.AdvancedStats.Personality += effect.EffectAmount;
|
||||
horseInstance.MagicUsed++;
|
||||
break;
|
||||
case "SPOILED":
|
||||
horseInstance.Spoiled += effect.EffectAmount;
|
||||
break;
|
||||
}
|
||||
case "INTELLIGENCEOFFSET":
|
||||
horseInstance.AdvancedStats.Inteligence += effect.EffectAmount;
|
||||
horseInstance.MagicUsed++;
|
||||
break;
|
||||
case "PERSONALITYOFFSET":
|
||||
horseInstance.AdvancedStats.Personality += effect.EffectAmount;
|
||||
horseInstance.MagicUsed++;
|
||||
break;
|
||||
case "SPOILED":
|
||||
horseInstance.Spoiled += effect.EffectAmount;
|
||||
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;
|
||||
}
|
||||
else
|
||||
|
@ -6569,10 +6563,11 @@ namespace HISP.Server
|
|||
}
|
||||
if (horseMountInst.Breed.Type == "camel")
|
||||
{
|
||||
if (horseMountInst.Color == "brown")
|
||||
incBy = 13;
|
||||
if (horseMountInst.Color == "white")
|
||||
incBy = 14;
|
||||
incBy = 13;
|
||||
}
|
||||
if(horseMountInst.Breed.Type == "llama")
|
||||
{
|
||||
incBy = 14;
|
||||
}
|
||||
if (horseMountInst.Breed.Type == "unicorn")
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue