From b09148431c7eaede5467419b05a8aef0538dca8e Mon Sep 17 00:00:00 2001 From: SilicaAndPina Date: Mon, 5 Apr 2021 15:47:55 +1200 Subject: [PATCH] add more tack shop giveaway locations- --- .../Game/Events/TackShopGiveaway.cs | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Horse Isle Server/HorseIsleServer/Game/Events/TackShopGiveaway.cs b/Horse Isle Server/HorseIsleServer/Game/Events/TackShopGiveaway.cs index 7220dd3..6355c93 100644 --- a/Horse Isle Server/HorseIsleServer/Game/Events/TackShopGiveaway.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Events/TackShopGiveaway.cs @@ -41,26 +41,23 @@ namespace HISP.Game.Events public TackShopGiveaway() { List specialTiles = new List(); - - foreach(World.SpecialTile sTile in World.SpecialTiles) + + foreach (World.SpecialTile sTile in World.SpecialTiles) { - if(sTile.Code != null) + if (sTile.Code != null) { - if(sTile.Code.StartsWith("STORE-")) + if (sTile.Code.StartsWith("STORE-")) { int storeId = int.Parse(sTile.Code.Split("-")[1]); Shop shopData = Shop.GetShopById(storeId); - - if(shopData.BuysItemTypes.Contains("TACK")) + + if (shopData.BuysItemTypes.Contains("TACK")) { Npc.NpcEntry[] npcShop = Npc.GetNpcByXAndY(sTile.X, sTile.Y); - if(npcShop.Length > 0) + if (npcShop.Length > 0) { - if(npcShop[0].ShortDescription.ToLower().Contains("tack")) - { - specialTiles.Add(sTile); - } + specialTiles.Add(sTile); } } } @@ -75,10 +72,17 @@ namespace HISP.Game.Events Npc.NpcEntry[] npcShops = Npc.GetNpcByXAndY(Location.X, Location.Y); npcName = npcShops[0].Name.Split(" ")[0]; - npcDesc = npcShops[0].ShortDescription.Substring(npcShops[0].ShortDescription.ToLower().IndexOf("tack")); - - ShopName = npcName + "'s " + npcDesc; + if (npcShops[0].ShortDescription.ToLower().Contains("tack")) + { + npcDesc = npcShops[0].ShortDescription.Substring(npcShops[0].ShortDescription.ToLower().IndexOf("tack")); + ShopName = npcName + "'s " + npcDesc; + } + else + { + ShopName = npcName + "'s Gear"; + } + while(true) { int hrsIdx = GameServer.RandomNumberGenerator.Next(0, HorseInfo.Breeds.Count);