mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-07 13:45:42 +12:00
Implement riddle rooms
This commit is contained in:
parent
64671ef186
commit
10c1c32518
11 changed files with 1276 additions and 91 deletions
Binary file not shown.
|
@ -139,6 +139,18 @@
|
|||
"venus_flytrap_format":"The Giant Venus Flytrap chomped at you!<BR><B>OUCH!!</B><BR>It chomped your pocket, taking $%MONEY% with it!!",
|
||||
"password_input":"<BR>^PLReply:|^PS14|ANSWER^R1",
|
||||
"last_poet":"^R1^LLast Player Poet:%USERNAME% ^R1",
|
||||
"ranch":{
|
||||
"unowned_ranch":"<B>This is an unowned ranch.</B><BR>It is available for purchase for $%PRICE%<BR>^T6You could purchase this ranch:^B6P^R1",
|
||||
"unowned_ranch_click":"Unowned Ranch",
|
||||
"ranch_buy_default_name":"%USERNAME%'s Ranch",
|
||||
"ranch_buy_cannot_afford":"You cannot afford this property!"
|
||||
},
|
||||
"riddler":{
|
||||
"riddle_format":"Welcome to an Enigmatic Perplexing Conundrum!<BR>(Answer with the simplest form possible. There is no penalty for wrong answers. DO NOT discuss the riddles in Global Chat)<BR><BR><BR><B>The following Riddling Riddle Riddles you:</B><BR>%RIDDLE%^PLAnswer Riddle:|^PS6|SOLVE RIDDLE",
|
||||
"riddle_correct":"CORRECT! %REASON%. You earned $10,000.",
|
||||
"riddle_incorrect":"Incorrect! Better luck next time.",
|
||||
"riddle_all_complete":"Welcome to an Enigmatic Perplexing Conundrum!<BR>You have solved all of the riddles! Maybe there will be more later."
|
||||
},
|
||||
"workshop":{
|
||||
"craft_entry":"^I%ICONID%^T6Craft a %ITEMNAME% for $%PRICE%^B4LN%ITEMID%^B4C%CRAFTID%^R1",
|
||||
"requires":"^H(Requires: %REQUIRES%)",
|
||||
|
@ -549376,5 +549388,80 @@
|
|||
{"id":973,"x":804,"y":282,"value":500000},
|
||||
{"id":974,"x":802,"y":282,"value":500000}
|
||||
]
|
||||
}
|
||||
},
|
||||
"riddle_room":[
|
||||
{"id":1,"riddle":"Because it's all ready. An equine of this coloring rarely needs to do any work.","answers":["dun"],"reason":"Dun as in 'Done'"},
|
||||
{"id":2,"riddle":"This colored equine must really enjoy beans.","answers":["pinto"],"reason":"Pinto is also a type of bean"},
|
||||
{"id":3,"riddle":"An equine coloring; high in the forest; an open fire.","answers":["chestnut","a chestnut"],"reason":"Chestnuts in trees. Chestnuts roasting on an open fire."},
|
||||
{"id":4,"riddle":"Hudson, Chesapeake, Equine Coloring","answers":["bay"],"reason":"Hudson Bay, Chesapeake Bay"},
|
||||
{"id":5,"riddle":"An equine coloring and yet not a color. Without light, likely visible at night.","answers":["white"],"reason":"White is all colors of light, and most visible coloring at night"},
|
||||
{"id":6,"riddle":"A confusing equine coloring. Using either first or second alphabetical vowels. Better use 'e' for me.","answers":["grey"],"reason":"Spelled either Grey or Gray"},
|
||||
{"id":7,"riddle":"This equine coloring, mispronounced, suggests it is a friend of yours.","answers":["palomino"],"reason":"Can be mispronounced: Pal o' mine o'"},
|
||||
{"id":8,"riddle":"Take a horse, divide it in two, repeat. Resemble a breed?","answers":["quarter horse","quarter horse breed"],"reason":"Quarter Horse is one-half of one-half of a horse"},
|
||||
{"id":9,"riddle":"You may receive this equine breed for valentines day, but smaller and it tastes like chocolate!","answers":["belgian","belgian breed"," belgian draft horse"],"reason":"Belgian Chocolates"},
|
||||
{"id":10,"riddle":"You are in a field with 3 horses, Babe, Bob, and Ben. Ben is standing on his back legs, Bob is standing on one more leg than Ben. Babe is standing normally. How many legs are touching the ground?","answers":["11","11 legs"],"reason":"You need to count your legs too. Babe:4 Bob:3 Ben:2 You:2 = 11"},
|
||||
{"id":16,"riddle":"Your horse is in a race. You are picking up speed and pass the horse that is in 2nd place. What place are you in now?","answers":["2","2nd","second","2nd place","second place"],"reason":"2nd place because you passed the guy that was in 2nd not 1st"},
|
||||
{"id":11,"riddle":"A type of shoe. Dogs like to chew some shoes, but not this. In fact, people like to play with this shoe when it's old more than dogs!","answers":["horseshoe","horse shoe"],"reason":"They can play Horseshoes"},
|
||||
{"id":12,"riddle":"It's Monday. You ride into town on Tuesday. One day passes. What day is it?","answers":["tuesday","its tuesday"],"reason":"The name of your horse was 'Tuesday'"},
|
||||
{"id":13,"riddle":"It's at the beginning of steeplechase, at the end of rodeos, and within horses? What is it?","answers":["s","letter s","the letter s"],"reason":"The Letter S is found in those places in those words"},
|
||||
{"id":14,"riddle":"Your horse might be fast but still, it cannot beat this in a race. While it might be smaller than your horse at noon, it can be quite larger at other times of the day. At night, you will have trouble finding it.","answers":["shadow","its shadow","horse shadow"],"reason":"A shadow follows the horse around. At noon, the sun is above, and the shadow is smallest. At different times of the day it's bigger."},
|
||||
{"id":15,"riddle":"Buried alive? I surely once was. Unburied I died. Should have been a 'Parrot', then that horse wouldn't have done what it did to me. What was I?","answers":["carrot","a carrot"],"reason":"A carrot grows underground, and dies when you pick it. Rhymes with parrot. Horses eat it."},
|
||||
{"id":17,"riddle":"This horse breed and waffles go well together.","answers":["belgian"],"reason":"Belgian waffles"},
|
||||
{"id":18,"riddle":"What 9 letter horse breed starts with A and ends with A?","answers":["appaloosa","an appaloosa"],"reason":"Appaloosa is a breed"},
|
||||
{"id":19,"riddle":"A horse breed and a machine. What am I? ","answers":["mustang","a mustang"],"reason":"Mustang is a model of car"},
|
||||
{"id":20,"riddle":"What is an Equus Caballus?","answers":["horse","a horse","scientific name for horse"],"reason":"Equus Caballus is the scientific name for a horse"},
|
||||
{"id":21,"riddle":"In the desert sun I may look like gold and as a breed I'm very old.","answers":["akhal-teke","akhalteke","an akhalteke","akhal teke"],"reason":""},
|
||||
{"id":22,"riddle":"Peanuts are named after the country this breed is from. Look hard. I'm no illusion.","answers":["andalusian","an andalusian"],"reason":"Spanish peanuts, rhymes with illusion"},
|
||||
{"id":23,"riddle":"My hooves are striped but my body is not. I can run a great distance without getting hot. What breed am I?","answers":["appaloosa","appaloosa breed"],"reason":""},
|
||||
{"id":24,"riddle":"This breed says this when left in very cold weather. I'm ____!","answers":["friesian","friesian!","im friesian"],"reason":"Sounds like freezing!"},
|
||||
{"id":25,"riddle":"A meticulous loaf of wheat that is also an equine breed.","answers":["thoroughbred","a thoroughbred"],"reason":"Sounds like thorough-bread"},
|
||||
{"id":26,"riddle":"You could paint this horse breed red, white and blue.","answers":["american paint","an american paint"],"reason":"Red, white and blue are America's colors"},
|
||||
{"id":27,"riddle":"This horse breed may live in Germany, perhaps in Hanover?","answers":["hanoverian","a hanoverian"],"reason":"Sounds like Hanover"},
|
||||
{"id":28,"riddle":"When mature this horse breed is white and don't give it any lip about it!","answers":["lipizzan","a lipizzan"],"reason":"White and starts with lip"},
|
||||
{"id":29,"riddle":"I may be stubborn but I'm always ready to listen.","answers":["mule","a mule"],"reason":"Expression: stubborn as a mule"},
|
||||
{"id":30,"riddle":"I'm a breed from Central America...don't pass me by, and with an Italian accent I'm so fine!","answers":["paso fino","a paso fino","pasofino"],"reason":""},
|
||||
{"id":31,"riddle":"This breed has a big heart but comes in a small package and is from the island it is named after.","answers":["shetland pony","a shetland pony","shetland","a shetland"],"reason":""},
|
||||
{"id":32,"riddle":"What has 1,000 eyes, 2,000 shoes and eats grass?","answers":["500 horses","500 horse"],"reason":""},
|
||||
{"id":33,"riddle":"If a king sits on gold, who sits on Silver?","answers":["lone ranger","the lone ranger"],"reason":"Silver was the name of Lone Ranger's horse"},
|
||||
{"id":34,"riddle":"It's small and sharp but a horse will wear it.","answers":["tack"],"reason":"Tacks are tiny, and horse equipment is called tack"},
|
||||
{"id":35,"riddle":"Your horse might shout this, or shout for this.","answers":["hay"],"reason":""},
|
||||
{"id":36,"riddle":"What word has these in common: tack, shower and to restrain.","answers":["bridle","a bridle"],"reason":""},
|
||||
{"id":37,"riddle":"This footwear is very lucky.","answers":["horseshoe","a horseshoe","horse shoe","a horse shoe"],"reason":""},
|
||||
{"id":38,"riddle":"This breed is no hobbit, though you might have thought it at first, until you saw one.","answers":["shire","a shire"],"reason":"Hobbits are from the Shire"},
|
||||
{"id":39,"riddle":"Justin's favorite horse is more than awesome, but what is its name?","answers":["morgan","a morgan"],"reason":"Justin Morgan is the founder of the Morgan"},
|
||||
{"id":40,"riddle":"Not only is this a salad dressing, you might find a horse here too!","answers":["ranch","a ranch"],"reason":""},
|
||||
{"id":41,"riddle":"This breed only throws half of what it's got.","answers":["the haflinger","haflinger","a haflinger"],"reason":"It sounds slightly like half-flinger"},
|
||||
{"id":42,"riddle":"This tack isn't very happy.","answers":["saddle","a saddle"],"reason":""},
|
||||
{"id":43,"riddle":"I was on my way to Treeton one day, when I met a girl with five horses. Each horse had five dogs, each dog had five cat friends, and each cat had five mice. All in all, how many were going to Treeton?","answers":["1","one"],"reason":"You met them because they were going the other way"},
|
||||
{"id":44,"riddle":"This sounds like the most important thing, it sits between two corn and lies above a double 'i'.","answers":["mane","the mane","a mane"],"reason":"The mane sounds like main, is between two ears (ears of corn) and above two 'eyes'"},
|
||||
{"id":45,"riddle":"The question with this gait is, can you or can't you?","answers":["canter"],"reason":""},
|
||||
{"id":46,"riddle":"This brush isn't made out of a tasty dish.","answers":["curry","curry brush"],"reason":"Curry is a spicy dish but also a horse brush"},
|
||||
{"id":47,"riddle":"What equine color is also part of a horse?","answers":["chestnut"],"reason":"The chestnut is located on the forearm of the horse"},
|
||||
{"id":49,"riddle":"Name a breed that is from Kentucky, and is named after a piece of tack?","answers":["American Saddlebred","Saddlebred"],"reason":""},
|
||||
{"id":50,"riddle":"Your friend always keeps water bottles in her backpack. What animal does this remind you of?","answers":["Camel","A camel"],"reason":"Camels store water in the fatty tissue of their hump(s) on their back"},
|
||||
{"id":51,"riddle":"This animal spelled backwards is a very common destination for girls.","answers":["llama","a mall"],"reason":"Spells \"A Mall\" backwards"},
|
||||
{"id":52,"riddle":"What has 4 hooves, 2 ears, and blends with a crowd?","answers":["Zebra","a zebra"],"reason":"Zebra's black and white stripes provide for excellent camouflage blending them all together so that predators cannot distinguish them"},
|
||||
{"id":53,"riddle":"A Breed named after steep sided ocean inlets in Norway.","answers":["Norwegian Fjord","Fjord"],"reason":""},
|
||||
{"id":54,"riddle":"\"Stubborn as a ?\" or \"Kicks like a ?\"","answers":["Mule"],"reason":"\"Stubborn as a mule\" is an old saying"},
|
||||
{"id":55,"riddle":"I don't think I'd like a nice Hawaiian one, but one from Suffolk might do. What breed am I?","answers":["Suffolk Punch"],"reason":"\"Punch\" here refers to a fruity party drink"},
|
||||
{"id":56,"riddle":"Do you get hungry when you hear my name? Many people do! But I am not a breakfast pastry. What am I?","answers":["Danish Warmblood"],"reason":"A \"danish\" is also a popular breakfast or snack treat"},
|
||||
{"id":57,"riddle":"My ears are my distinguishing mark. If they were charged up, you might see a spark! What breed am I?","answers":["Kathiawari"],"reason":"The tips of the Kathiawari's ears almost touch; if they were wired hooked up to a battery, you might see a spark jump across them"},
|
||||
{"id":58,"riddle":"I'm not the breed used by the RCMP, but you might yell, \"Oh, Canada!\" when you see me! What am I?","answers":["Canadian Horse"],"reason":"'O Canada' is the national anthem of Canada"},
|
||||
{"id":59,"riddle":"I'm a big, milky-white horse who's risen to the top in America. I can truly say I'm the top of the crop! What breed am I?","answers":["Cream Draft","American Cream Draft"],"reason":"To say that something is \"The cream of the crop\" means that it is the best of its kind. There is also a saying that \"The cream rises to the top,\" referring to milk fresh from the cow"},
|
||||
{"id":60,"riddle":"I don't pile up points, but I garner lots of praise! But please don't put wet dishes on me! What breed am I?","answers":["Racking","Racking Horse"],"reason":"\"To rack up points\" means to get lots and lots of them, and one puts wet dishes in a drying rack to let them drain"},
|
||||
{"id":61,"riddle":"I love oysters, saltines and the Sunshine State! What breed of horse am I?","answers":["Florida Cracker"],"reason":"Two types of crackers and the Sunshine State is Florida"},
|
||||
{"id":62,"riddle":"I'm ardent about drafting, and so I should be! I'm the oldest known draft breed and I fought with Napoleon. What breed am I?","answers":["Ardennais"],"reason":""},
|
||||
{"id":63,"riddle":"I'm the \"horse of the sea.\" My coat is white or grey like the sea foam, so bring your camera for a picture!","answers":["Camargue"],"reason":"Camera is similar to Camargue, the Camargue is called the \"horse of the sea.\""},
|
||||
{"id":64,"riddle":"If my mother was my father and my father was my mother, my name would be Hinny. Instead I joined the army and I'm a plain old ____.","answers":["mule"],"reason":"The mule is the Army mascot, and opposed to the hinny, the offspring of male horse and female donkey."},
|
||||
{"id":65,"riddle":"Don't let my name scare you. I'm not angry, although I might be a little hungry! I love a good steeplechase and I'm fast in the harness.","answers":["Furioso"],"reason":"The is similar to \"furious\" and the bloodline includes Hungarians."},
|
||||
{"id":66,"riddle":"You may think it's a little corny, but I'm a pony and a horse! I can stand as low as 13.2 hands, but as high as 16, and that's a whale of a pony!","answers":["Welsh cob"],"reason":"Corn cob and originates out of Wales."},
|
||||
{"id":67,"riddle":"I like to give MORE! They crossed two great breeds to make me, and now I'm my own breed. What am I?","answers":["Morab"],"reason":""},
|
||||
{"id":68,"riddle":"My bloodlines are ancient. I was a warhorse for the Romans, a draft horse for medieval peasants, and a sure-footed, hard-wintering mountain horse for all of Austria. What am I?","answers":["Noriker"],"reason":""},
|
||||
{"id":69,"riddle":"I must be done by now. I've been domesticated for 4,000 years! I have a thick shaggy coat and love the snow, but I can jump and even do dressage. There's no way you won't love me.","answers":["Norwegian Fjord"],"reason":"Fjords are dun and \"no way\" hints at Norway."},
|
||||
{"id":70,"riddle":"I'm a souped-up horse with plenty of spirit. I'm a star jumper who really knows how to leap up from down under, and I come in every color - even Botany Bay!","answers":["Australian Stock Horse"],"reason":"References to Australia (down under, Botany Bay) and soup stock."},
|
||||
{"id":71,"riddle":"I am a horse robed in bright red gems! What am I?","answers":["Kladruby"],"reason":"Clad is another word for robed and ruby is a red gem."},
|
||||
{"id":72,"riddle":"I won't fall apart while moving, as my name might suggest.","answers":["Walkaloosa"],"reason":"Name makes it sound like it would come loose while walking."},
|
||||
{"id":73,"riddle":"There. In few words: what breed?","answers":["Tersky"],"reason":"When one says something in as few words as possible, one is being \"terse.\""},
|
||||
{"id":74,"riddle":"No, I'm not made of French maize! I'm an old, proud breed.","answers":["Norman Cob"],"reason":"Normandy is a coastal region of France, and maize grows on a cob."}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -31,18 +31,14 @@ namespace HISP.Game
|
|||
|
||||
if (pos >= oMapData.Length && overlay)
|
||||
return 1;
|
||||
else if (pos >= MapData.Length && !overlay)
|
||||
return 1;
|
||||
else if (overlay && oMapData[pos] != 1)
|
||||
return oMapData[pos];
|
||||
else if (overlay && Treasure.IsTileBuiredTreasure(x, y))
|
||||
return 193; // Burried Treasure tile.
|
||||
else if (overlay && Treasure.IsTilePotOfGold(x, y))
|
||||
return 186; // Pot of Gold tile.
|
||||
else if (overlay && Ranch.IsRanchHere(x, y))
|
||||
return 170 + Ranch.GetRanchAt(x, y).Upgraded; // Ranch Tile + Upgraded amount
|
||||
return 170 + Ranch.GetRanchAt(x, y).UpgradedLevel; // Ranch Tile + Upgraded amount
|
||||
else if (overlay)
|
||||
return 1;
|
||||
return oMapData[pos];
|
||||
else if (!overlay)
|
||||
return MapData[pos];
|
||||
else // Not sure how you could even get here.
|
||||
|
|
|
@ -580,6 +580,12 @@ namespace HISP.Game
|
|||
public static string KickReasonIdleFormat;
|
||||
public static string KickReasonNoTime;
|
||||
|
||||
// Riddler
|
||||
public static string RiddlerEnterAnswerFormat;
|
||||
public static string RiddlerCorrectAnswerFormat;
|
||||
public static string RiddlerIncorrectAnswer;
|
||||
public static string RiddlerAnsweredAll;
|
||||
|
||||
// Password
|
||||
public static string IncorrectPasswordMessage;
|
||||
|
||||
|
@ -591,6 +597,15 @@ namespace HISP.Game
|
|||
// Click
|
||||
public static string NothingInterestingHere;
|
||||
|
||||
public static string FormatRiddlerRiddle(string riddle)
|
||||
{
|
||||
return RiddlerEnterAnswerFormat.Replace("%RIDDLE%", riddle);
|
||||
}
|
||||
public static string FormatRiddlerAnswerCorrect(string reason)
|
||||
{
|
||||
return RiddlerCorrectAnswerFormat.Replace("%REASON%", reason);
|
||||
}
|
||||
|
||||
public static string FormatPirateTreasure(int prize)
|
||||
{
|
||||
return PirateTreasureFormat.Replace("%PRIZE%", prize.ToString("N0"));
|
||||
|
|
|
@ -121,10 +121,10 @@ namespace HISP.Game
|
|||
message += "^R1" + Messages.ThingsYouSellMe;
|
||||
InventoryItem[] shopperItemList = shopperInventory.GetItemList();
|
||||
|
||||
foreach(InventoryItem shopperitem in shopperItemList)
|
||||
foreach (InventoryItem shopperitem in shopperItemList)
|
||||
{
|
||||
Item.ItemInformation itemInfo = Item.GetItemById(shopperitem.ItemId);
|
||||
|
||||
|
||||
// Prevent items that cannot be sold to this shopkeeper.
|
||||
if (!shop.CanSell(itemInfo))
|
||||
continue;
|
||||
|
@ -150,7 +150,7 @@ namespace HISP.Game
|
|||
{
|
||||
string message = "";
|
||||
bool hasCoins = user.Inventory.HasItemId(Item.WishingCoin);
|
||||
if(!hasCoins)
|
||||
if (!hasCoins)
|
||||
{
|
||||
message += Messages.NoWishingCoins;
|
||||
}
|
||||
|
@ -181,12 +181,12 @@ namespace HISP.Game
|
|||
else
|
||||
{
|
||||
message += Messages.ItemsOnGroundMessage;
|
||||
foreach(DroppedItems.DroppedItem item in Items)
|
||||
foreach (DroppedItems.DroppedItem item in Items)
|
||||
{
|
||||
Item.ItemInformation itemInfo = item.Instance.GetItemInfo();
|
||||
message += Messages.FormatGrabItemMessage(itemInfo.Name, item.Instance.RandomId, itemInfo.IconId);
|
||||
}
|
||||
if(Items.Length > 1)
|
||||
if (Items.Length > 1)
|
||||
message += Messages.GrabAllItemsButton;
|
||||
}
|
||||
return message;
|
||||
|
@ -212,23 +212,23 @@ namespace HISP.Game
|
|||
|
||||
private static string buildMultiroom(string id, User user)
|
||||
{
|
||||
string message = Messages.MultiroomPlayersParticipating;
|
||||
foreach(User userOnTile in GameServer.GetUsersOnSpecialTileCode("MULTIROOM-"+id))
|
||||
string message = Messages.MultiroomPlayersParticipating;
|
||||
foreach (User userOnTile in GameServer.GetUsersOnSpecialTileCode("MULTIROOM-" + id))
|
||||
{
|
||||
if (userOnTile.Id == user.Id)
|
||||
continue;
|
||||
message += Messages.FormatMultiroomParticipent(userOnTile.Username);
|
||||
}
|
||||
if(id[0] == 'P') // Poet
|
||||
if (id[0] == 'P') // Poet
|
||||
{
|
||||
int lastPoet = Database.GetLastPlayer(id);
|
||||
string username = "";
|
||||
if(lastPoet != -1)
|
||||
if (lastPoet != -1)
|
||||
username = Database.GetUsername(lastPoet);
|
||||
|
||||
message += Messages.FormatLastPoet(username);
|
||||
}
|
||||
if(id[0] == 'D') // Drawning room
|
||||
if (id[0] == 'D') // Drawning room
|
||||
{
|
||||
int lastDraw = Database.GetLastPlayer(id);
|
||||
string username = "";
|
||||
|
@ -300,7 +300,7 @@ namespace HISP.Game
|
|||
public static string buildInn(Inn inn)
|
||||
{
|
||||
string message = Messages.InnBuyMeal;
|
||||
foreach(Item.ItemInformation item in inn.MealsOffered)
|
||||
foreach (Item.ItemInformation item in inn.MealsOffered)
|
||||
{
|
||||
message += Messages.FormatInnItemEntry(item.IconId, item.Name, inn.CalculateBuyCost(item), item.Id);
|
||||
}
|
||||
|
@ -340,16 +340,16 @@ namespace HISP.Game
|
|||
{
|
||||
string message = "";
|
||||
|
||||
foreach(Tack.TackSet set in Tack.TackSets.OrderBy(o => o.SortPosition()).ToArray())
|
||||
foreach (Tack.TackSet set in Tack.TackSets.OrderBy(o => o.SortPosition()).ToArray())
|
||||
{
|
||||
string[] setSwfs = set.GetSwfNames();
|
||||
string swf = "breedviewer.swf?terrain=book2&breed=tackonly";
|
||||
if(setSwfs.Length >= 1)
|
||||
swf += "&saddle="+setSwfs[0];
|
||||
if(setSwfs.Length >= 2)
|
||||
swf += "&saddlepad="+setSwfs[1];
|
||||
if(setSwfs.Length >= 3)
|
||||
swf += "&bridle="+setSwfs[2];
|
||||
if (setSwfs.Length >= 1)
|
||||
swf += "&saddle=" + setSwfs[0];
|
||||
if (setSwfs.Length >= 2)
|
||||
swf += "&saddlepad=" + setSwfs[1];
|
||||
if (setSwfs.Length >= 3)
|
||||
swf += "&bridle=" + setSwfs[2];
|
||||
swf += "&j=";
|
||||
|
||||
message += Messages.FormatTackSetView(set.IconId, set.SetName, swf);
|
||||
|
@ -361,7 +361,7 @@ namespace HISP.Game
|
|||
message += buildTackPeiceLibary(set.GetSaddlePad());
|
||||
message += buildTackPeiceLibary(set.GetBridle());
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.ErrorPrint(e.Message);
|
||||
}
|
||||
|
@ -374,36 +374,36 @@ namespace HISP.Game
|
|||
{
|
||||
string message = "";
|
||||
message += Messages.MinigameSingleplayer;
|
||||
foreach(World.SpecialTile tile in World.SpecialTiles.OrderBy(o => o.Title))
|
||||
foreach (World.SpecialTile tile in World.SpecialTiles.OrderBy(o => o.Title))
|
||||
{
|
||||
if(tile.TypeFlag == "1PLAYER")
|
||||
if (tile.TypeFlag == "1PLAYER")
|
||||
{
|
||||
string mapXy = Messages.FormatMapLocation(tile.X, tile.Y);
|
||||
message += Messages.FormatMinigameEntry(tile.Title, mapXy);
|
||||
}
|
||||
}
|
||||
message += Messages.MinigameTwoplayer;
|
||||
foreach(World.SpecialTile tile in World.SpecialTiles.OrderBy(o => o.Title))
|
||||
foreach (World.SpecialTile tile in World.SpecialTiles.OrderBy(o => o.Title))
|
||||
{
|
||||
if(tile.TypeFlag == "2PLAYER")
|
||||
if (tile.TypeFlag == "2PLAYER")
|
||||
{
|
||||
string mapXy = Messages.FormatMapLocation(tile.X, tile.Y);
|
||||
message += Messages.FormatMinigameEntry(tile.Title, mapXy);
|
||||
}
|
||||
}
|
||||
message += Messages.MinigameMultiplayer;
|
||||
foreach(World.SpecialTile tile in World.SpecialTiles.OrderBy(o => o.Title))
|
||||
foreach (World.SpecialTile tile in World.SpecialTiles.OrderBy(o => o.Title))
|
||||
{
|
||||
if(tile.TypeFlag == "MULTIPLAYER")
|
||||
if (tile.TypeFlag == "MULTIPLAYER")
|
||||
{
|
||||
string mapXy = Messages.FormatMapLocation(tile.X, tile.Y);
|
||||
message += Messages.FormatMinigameEntry(tile.Title, mapXy);
|
||||
}
|
||||
}
|
||||
message += Messages.MinigameCompetitions;
|
||||
foreach(World.SpecialTile tile in World.SpecialTiles.OrderBy(o => o.Title))
|
||||
foreach (World.SpecialTile tile in World.SpecialTiles.OrderBy(o => o.Title))
|
||||
{
|
||||
if(tile.TypeFlag == "ARENA")
|
||||
if (tile.TypeFlag == "ARENA")
|
||||
{
|
||||
string mapXy = Messages.FormatMapLocation(tile.X, tile.Y);
|
||||
message += Messages.FormatMinigameEntry(tile.Title, mapXy);
|
||||
|
@ -416,11 +416,11 @@ namespace HISP.Game
|
|||
public static string BuildCompanionLibary()
|
||||
{
|
||||
string message = "";
|
||||
foreach(Item.ItemInformation itm in Item.Items.OrderBy(o => o.GetMiscFlag(0)).ToArray())
|
||||
foreach (Item.ItemInformation itm in Item.Items.OrderBy(o => o.GetMiscFlag(0)).ToArray())
|
||||
{
|
||||
if(itm.Type == "COMPANION" && itm.EmbedSwf != null)
|
||||
if (itm.Type == "COMPANION" && itm.EmbedSwf != null)
|
||||
{
|
||||
string swf = "breedviewer.swf?terrain=book2&breed=tackonly&companion="+itm.EmbedSwf+"&j=";
|
||||
string swf = "breedviewer.swf?terrain=book2&breed=tackonly&companion=" + itm.EmbedSwf + "&j=";
|
||||
message += Messages.FormatCompanionViewButton(itm.IconId, itm.Name, swf);
|
||||
message += Messages.FormatCompanionEntry(itm.Description);
|
||||
}
|
||||
|
@ -433,9 +433,9 @@ namespace HISP.Game
|
|||
{
|
||||
string message = "";
|
||||
message += Messages.LocationKnownIslands;
|
||||
foreach(World.Waypoint waypoint in World.Waypoints.OrderBy(o => o.Name).ToArray())
|
||||
foreach (World.Waypoint waypoint in World.Waypoints.OrderBy(o => o.Name).ToArray())
|
||||
{
|
||||
if(waypoint.Type == "ISLE")
|
||||
if (waypoint.Type == "ISLE")
|
||||
{
|
||||
string mapxy = Messages.FormatMapLocation(waypoint.PosX, waypoint.PosY);
|
||||
message += Messages.FormatIslandLocation(waypoint.Name, mapxy);
|
||||
|
@ -443,9 +443,9 @@ namespace HISP.Game
|
|||
}
|
||||
}
|
||||
message += Messages.LocationKnownTowns;
|
||||
foreach(World.Waypoint waypoint in World.Waypoints.OrderBy(o => o.Name).ToArray())
|
||||
foreach (World.Waypoint waypoint in World.Waypoints.OrderBy(o => o.Name).ToArray())
|
||||
{
|
||||
if(waypoint.Type == "TOWN")
|
||||
if (waypoint.Type == "TOWN")
|
||||
{
|
||||
string mapxy = Messages.FormatMapLocation(waypoint.PosX, waypoint.PosY);
|
||||
message += Messages.FormatTownLocation(waypoint.Name, mapxy);
|
||||
|
@ -460,7 +460,7 @@ namespace HISP.Game
|
|||
{
|
||||
string message = "";
|
||||
message += Messages.AwardsAvalible;
|
||||
foreach(Award.AwardEntry award in Award.GlobalAwardList.OrderBy(o => o.Sort).ToArray())
|
||||
foreach (Award.AwardEntry award in Award.GlobalAwardList.OrderBy(o => o.Sort).ToArray())
|
||||
{
|
||||
message += Messages.FormatAwardEntry(award.IconId, award.Title, award.MoneyBonus, award.Description);
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ namespace HISP.Game
|
|||
{
|
||||
string message = "";
|
||||
message += Messages.BooksOfHorseIsle;
|
||||
foreach(Book libaryBook in Book.LibaryBooks.OrderBy(o => o.Title).ToArray())
|
||||
foreach (Book libaryBook in Book.LibaryBooks.OrderBy(o => o.Title).ToArray())
|
||||
{
|
||||
message += Messages.FormatBookEntry(libaryBook.Title, libaryBook.Author, libaryBook.Id);
|
||||
}
|
||||
|
@ -510,7 +510,7 @@ namespace HISP.Game
|
|||
|
||||
for (int i = 0; i < scores.Length; i++)
|
||||
{
|
||||
message += Messages.FormatHighscoreListEntry(i+1, scores[i].Score, Database.GetUsername(scores[i].UserId), scores[i].TimesPlayed);
|
||||
message += Messages.FormatHighscoreListEntry(i + 1, scores[i].Score, Database.GetUsername(scores[i].UserId), scores[i].TimesPlayed);
|
||||
}
|
||||
message += Messages.BackToMap;
|
||||
message += Messages.MetaTerminator;
|
||||
|
@ -522,12 +522,12 @@ namespace HISP.Game
|
|||
if (scores.Length <= 0)
|
||||
return "No times recorded.";
|
||||
string message = "";
|
||||
|
||||
|
||||
message += Messages.FormatBestTimeHeader(gameName);
|
||||
|
||||
for (int i = 0; i < scores.Length; i++)
|
||||
{
|
||||
message += Messages.FormatBestTimeListEntry(i+1, scores[i].Score, Database.GetUsername(scores[i].UserId), scores[i].TimesPlayed);
|
||||
message += Messages.FormatBestTimeListEntry(i + 1, scores[i].Score, Database.GetUsername(scores[i].UserId), scores[i].TimesPlayed);
|
||||
}
|
||||
message += Messages.BackToMap;
|
||||
message += Messages.MetaTerminator;
|
||||
|
@ -536,11 +536,11 @@ namespace HISP.Game
|
|||
public static string BuildMinigameRankingsForUser(User user)
|
||||
{
|
||||
string message = Messages.HighscoreHeaderMeta;
|
||||
foreach(Highscore.HighscoreTableEntry highscore in user.Highscores.HighscoreList)
|
||||
foreach (Highscore.HighscoreTableEntry highscore in user.Highscores.HighscoreList)
|
||||
{
|
||||
if (highscore.Type == "SCORE")
|
||||
message += Messages.FormatHighscoreStat(highscore.GameName, Database.GetRanking(highscore.Score, highscore.GameName), highscore.Score, highscore.TimesPlayed);
|
||||
else if(highscore.Type == "TIME")
|
||||
else if (highscore.Type == "TIME")
|
||||
message += Messages.FormatBestTimeStat(highscore.GameName, Database.GetRanking(highscore.Score, highscore.GameName), highscore.Score, highscore.TimesPlayed);
|
||||
}
|
||||
message += Messages.BackToMap;
|
||||
|
@ -594,7 +594,7 @@ namespace HISP.Game
|
|||
if (areaString != "")
|
||||
message += Messages.FormatStatsArea(areaString);
|
||||
message += Messages.FormatMoneyStat(user.Money);
|
||||
if(!user.Subscribed)
|
||||
if (!user.Subscribed)
|
||||
message += Messages.FormatFreeTime(user.FreeMinutes);
|
||||
message += Messages.FormatPlayerDescriptionForStatsMenu(user.ProfilePage);
|
||||
message += Messages.FormatExperience(user.Experience);
|
||||
|
@ -620,10 +620,10 @@ namespace HISP.Game
|
|||
{
|
||||
string message = "";
|
||||
WildHorse[] horses = WildHorse.GetHorsesAt(user.X, user.Y);
|
||||
if(horses.Length > 0)
|
||||
if (horses.Length > 0)
|
||||
{
|
||||
message = Messages.HorsesHere;
|
||||
foreach(WildHorse horse in horses)
|
||||
foreach (WildHorse horse in horses)
|
||||
{
|
||||
message += Messages.FormatWildHorse(horse.Instance.Name, horse.Instance.Breed.Name, horse.Instance.RandomId);
|
||||
}
|
||||
|
@ -636,10 +636,10 @@ namespace HISP.Game
|
|||
if (user.Awards.AwardsEarned.Length <= 0)
|
||||
message += Messages.NoAwards;
|
||||
else
|
||||
foreach(Award.AwardEntry award in user.Awards.AwardsEarned)
|
||||
foreach (Award.AwardEntry award in user.Awards.AwardsEarned)
|
||||
message += Messages.FormatAwardEntry(award.IconId, award.Title, award.MoneyBonus);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
message += Messages.BackToMap;
|
||||
|
@ -659,7 +659,7 @@ namespace HISP.Game
|
|||
else
|
||||
fmsg = Messages.QuestNotCompleted;
|
||||
|
||||
foreach(int questId in quest.RequiresQuestIdCompleteStatsMenu)
|
||||
foreach (int questId in quest.RequiresQuestIdCompleteStatsMenu)
|
||||
{
|
||||
if (user.Quests.GetTrackedQuestAmount(questId) > 0)
|
||||
continue;
|
||||
|
@ -750,9 +750,9 @@ namespace HISP.Game
|
|||
{
|
||||
string message = Messages.PlayerListAllHeader;
|
||||
GameClient[] clients = GameServer.ConnectedClients;
|
||||
foreach(GameClient client in clients)
|
||||
foreach (GameClient client in clients)
|
||||
{
|
||||
if(client.LoggedIn)
|
||||
if (client.LoggedIn)
|
||||
{
|
||||
if (client.LoggedinUser.Stealth)
|
||||
continue;
|
||||
|
@ -776,7 +776,7 @@ namespace HISP.Game
|
|||
public static string BuildBuddyList(User user)
|
||||
{
|
||||
string message = Messages.BuddyListHeader;
|
||||
foreach(int id in user.Friends.List.ToArray())
|
||||
foreach (int id in user.Friends.List.ToArray())
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -797,7 +797,7 @@ namespace HISP.Game
|
|||
}
|
||||
message += Messages.BuddyListOfflineBuddys;
|
||||
|
||||
foreach(int id in user.Friends.List.ToArray())
|
||||
foreach (int id in user.Friends.List.ToArray())
|
||||
{
|
||||
if (GameServer.IsUserOnline(id))
|
||||
continue;
|
||||
|
@ -831,11 +831,11 @@ namespace HISP.Game
|
|||
message += Messages.MetaTerminator;
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
public static string BuildHorseList()
|
||||
{
|
||||
string message = "";
|
||||
foreach(HorseInfo.Breed breed in HorseInfo.Breeds.OrderBy(o => o.Name).ToList())
|
||||
foreach (HorseInfo.Breed breed in HorseInfo.Breeds.OrderBy(o => o.Name).ToList())
|
||||
{
|
||||
if (breed.Swf == "")
|
||||
continue;
|
||||
|
@ -851,11 +851,11 @@ namespace HISP.Game
|
|||
public static string BuildNpcSearch(string search)
|
||||
{
|
||||
List<Npc.NpcEntry> foundNpcs = new List<Npc.NpcEntry>();
|
||||
foreach(Npc.NpcEntry npc in Npc.NpcList)
|
||||
foreach (Npc.NpcEntry npc in Npc.NpcList)
|
||||
{
|
||||
if(npc.Name.ToLower().Contains(search.ToLower()))
|
||||
if (npc.Name.ToLower().Contains(search.ToLower()))
|
||||
{
|
||||
if(npc.LibarySearchable)
|
||||
if (npc.LibarySearchable)
|
||||
{
|
||||
if (foundNpcs.Count >= 5)
|
||||
break;
|
||||
|
@ -872,17 +872,17 @@ namespace HISP.Game
|
|||
}
|
||||
}
|
||||
string message = Messages.LibaryFindNpcSearchNoResults;
|
||||
if(foundNpcs.Count >= 1)
|
||||
if (foundNpcs.Count >= 1)
|
||||
{
|
||||
message = Messages.LibaryFindNpcSearchResultsHeader;
|
||||
foreach(Npc.NpcEntry npc in foundNpcs)
|
||||
foreach (Npc.NpcEntry npc in foundNpcs)
|
||||
{
|
||||
string searchResult = Messages.FormatNpcSearchResult(npc.Name, npc.ShortDescription, npc.X, npc.Y);
|
||||
Logger.DebugPrint(searchResult);
|
||||
message += searchResult;
|
||||
}
|
||||
}
|
||||
if(foundNpcs.Count >= 5)
|
||||
if (foundNpcs.Count >= 5)
|
||||
{
|
||||
message += Messages.LibaryFindNpcLimit5;
|
||||
}
|
||||
|
@ -903,14 +903,14 @@ namespace HISP.Game
|
|||
public static string BuildWhisperSearchResults(WildHorse[] results)
|
||||
{
|
||||
string message = Messages.WhispererSearchingAmoungHorses;
|
||||
if(results.Length <= 0)
|
||||
if (results.Length <= 0)
|
||||
{
|
||||
message = Messages.WhispererNoneFound;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Point> locations = new List<Point>();
|
||||
foreach(WildHorse result in results)
|
||||
foreach (WildHorse result in results)
|
||||
{
|
||||
Point location = new Point();
|
||||
location.X = result.X;
|
||||
|
@ -932,11 +932,11 @@ namespace HISP.Game
|
|||
private static string buildPond(User user)
|
||||
{
|
||||
string message = Messages.PondHeader;
|
||||
if(!user.Inventory.HasItemId(Item.FishingPole))
|
||||
if (!user.Inventory.HasItemId(Item.FishingPole))
|
||||
{
|
||||
message += Messages.PondNoFishingPole;
|
||||
}
|
||||
else if(!user.Inventory.HasItemId(Item.Earthworm))
|
||||
else if (!user.Inventory.HasItemId(Item.Earthworm))
|
||||
{
|
||||
message += Messages.PondNoEarthWorms;
|
||||
}
|
||||
|
@ -945,7 +945,7 @@ namespace HISP.Game
|
|||
message += Messages.PondGoFishing;
|
||||
}
|
||||
message += Messages.PondDrinkHereIfSafe;
|
||||
foreach(HorseInstance horse in user.HorseInventory.HorseList)
|
||||
foreach (HorseInstance horse in user.HorseInventory.HorseList)
|
||||
{
|
||||
message += Messages.FormatPondDrinkHorseFormat(horse.Name, horse.BasicStats.Thirst, 1000, horse.RandomId);
|
||||
}
|
||||
|
@ -956,7 +956,7 @@ namespace HISP.Game
|
|||
private static string buildMudHole(User user)
|
||||
{
|
||||
string message = "";
|
||||
if(user.HorseInventory.HorseList.Length > 0)
|
||||
if (user.HorseInventory.HorseList.Length > 0)
|
||||
{
|
||||
int rngHorseIndex = GameServer.RandomNumberGenerator.Next(0, user.HorseInventory.HorseList.Length);
|
||||
HorseInstance horse = user.HorseInventory.HorseList[rngHorseIndex];
|
||||
|
@ -979,11 +979,11 @@ namespace HISP.Game
|
|||
private static string buildHorseWhisperer()
|
||||
{
|
||||
string message = "";
|
||||
foreach(HorseInfo.Breed breed in HorseInfo.Breeds.OrderBy(o => o.Name).ToList())
|
||||
foreach (HorseInfo.Breed breed in HorseInfo.Breeds.OrderBy(o => o.Name).ToList())
|
||||
{
|
||||
if (breed.Swf == "")
|
||||
continue;
|
||||
if(breed.SpawnInArea == "none")
|
||||
if (breed.SpawnInArea == "none")
|
||||
continue;
|
||||
message += Messages.FormatWhispererHorseBreedButton(breed.Name, breed.Id);
|
||||
}
|
||||
|
@ -1022,13 +1022,13 @@ namespace HISP.Game
|
|||
{
|
||||
Workshop shop = Workshop.GetWorkshopAt(user.X, user.Y);
|
||||
string message = "";
|
||||
foreach(Workshop.CraftableItem craft in shop.CraftableItems)
|
||||
foreach (Workshop.CraftableItem craft in shop.CraftableItems)
|
||||
{
|
||||
Item.ItemInformation itmInfo = Item.GetItemById(craft.GiveItemId);
|
||||
message += Messages.FormatWorkshopCraftEntry(itmInfo.IconId, itmInfo.Name, craft.MoneyCost, itmInfo.Id, craft.Id);
|
||||
// Get requirements
|
||||
List<string> Requirements = new List<string>();
|
||||
foreach(Workshop.RequiredItem reqItem in craft.RequiredItems)
|
||||
foreach (Workshop.RequiredItem reqItem in craft.RequiredItems)
|
||||
{
|
||||
|
||||
Item.ItemInformation requiredItemInfo = Item.GetItemById(reqItem.RequiredItemId);
|
||||
|
@ -1052,7 +1052,7 @@ namespace HISP.Game
|
|||
foreach (HorseInstance horse in user.HorseInventory.HorseList)
|
||||
{
|
||||
message += Messages.FormatVetServiceHorseMeta(horse.Name, horse.BasicStats.Health, 1000);
|
||||
|
||||
|
||||
if (horse.BasicStats.Health >= 1000)
|
||||
message += Messages.VetSerivcesNotNeeded;
|
||||
else
|
||||
|
@ -1062,13 +1062,23 @@ namespace HISP.Game
|
|||
|
||||
message += Messages.FormatVetApplyServiceMeta(price, horse.RandomId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
message += Messages.FormatVetApplyAllServiceMeta(totalPrice);
|
||||
message += Messages.ExitThisPlace;
|
||||
message += Messages.MetaTerminator;
|
||||
return message;
|
||||
}
|
||||
private static string buildRiddlerRiddle(User user)
|
||||
{
|
||||
Riddler riddle = Riddler.GetRandomRiddle(user);
|
||||
user.LastRiddle = riddle;
|
||||
string message = "";
|
||||
message += Messages.FormatRiddlerRiddle(riddle.Riddle);
|
||||
message += Messages.ExitThisPlace;
|
||||
message += Messages.MetaTerminator;
|
||||
return message;
|
||||
}
|
||||
|
||||
public static string BuildSpecialTileInfo(User user, World.SpecialTile specialTile)
|
||||
{
|
||||
|
@ -1146,6 +1156,10 @@ namespace HISP.Game
|
|||
{
|
||||
message += buildVenusFlyTrap(user);
|
||||
}
|
||||
if(TileCode == "RIDDLER")
|
||||
{
|
||||
message += buildRiddlerRiddle(user);
|
||||
}
|
||||
if(TileCode == "LIBRARY")
|
||||
{
|
||||
message += buildLibary();
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using System;
|
||||
using HISP.Server;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HISP.Game
|
||||
{
|
||||
|
@ -17,6 +14,25 @@ namespace HISP.Game
|
|||
public string Title;
|
||||
public string Description;
|
||||
public int Limit;
|
||||
|
||||
public static bool RanchBuildingExists(int id)
|
||||
{
|
||||
foreach (RanchBuilding ranchBuilding in RanchBuildings)
|
||||
{
|
||||
if (ranchBuilding.Id == id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static RanchBuilding GetRanchBuildingById(int id)
|
||||
{
|
||||
foreach(RanchBuilding ranchBuilding in RanchBuildings)
|
||||
{
|
||||
if (ranchBuilding.Id == id)
|
||||
return ranchBuilding;
|
||||
}
|
||||
throw new KeyNotFoundException("No ranch found.");
|
||||
}
|
||||
}
|
||||
public static List<Ranch> Ranches = new List<Ranch>();
|
||||
|
||||
|
@ -25,21 +41,250 @@ namespace HISP.Game
|
|||
public int Id;
|
||||
public int Value;
|
||||
|
||||
public int OwnerId;
|
||||
public int UpgradedLevel;
|
||||
public int InvestedMoney;
|
||||
public string Title;
|
||||
public string Description;
|
||||
private int ownerId;
|
||||
private int upgradedLevel;
|
||||
private int investedMoney;
|
||||
private string title;
|
||||
private string description;
|
||||
|
||||
public int OwnerId
|
||||
{
|
||||
get
|
||||
{
|
||||
return ownerId;
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
ownerId = value;
|
||||
|
||||
if (value == -1)
|
||||
{
|
||||
Database.DeleteRanchOwner(this.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Database.IsRanchOwned(this.Id))
|
||||
{
|
||||
Database.SetRanchOwner(this.Id, ownerId);
|
||||
}
|
||||
else
|
||||
{
|
||||
title = "";
|
||||
description = "";
|
||||
investedMoney = 0;
|
||||
upgradedLevel = 0;
|
||||
for (int i = 0; i < 16; i++)
|
||||
buildings[i] = null;
|
||||
|
||||
Database.AddRanch(this.Id, OwnerId, "", "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int UpgradedLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
return upgradedLevel;
|
||||
}
|
||||
set
|
||||
{
|
||||
upgradedLevel = value;
|
||||
Database.SetRanchUpgradeLevel(Id, value);
|
||||
}
|
||||
}
|
||||
public int InvestedMoney
|
||||
{
|
||||
get
|
||||
{
|
||||
return investedMoney;
|
||||
}
|
||||
set
|
||||
{
|
||||
investedMoney = 0;
|
||||
Database.SetRanchUpgradeLevel(Id, value);
|
||||
}
|
||||
}
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
return title;
|
||||
}
|
||||
set
|
||||
{
|
||||
title = value;
|
||||
Database.SetRanchTitle(Id, value);
|
||||
}
|
||||
}
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return description;
|
||||
}
|
||||
set
|
||||
{
|
||||
description = value;
|
||||
Database.SetRanchDescription(Id, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private RanchBuilding[] buildings = new RanchBuilding[16];
|
||||
|
||||
public RanchBuilding[] Buildings
|
||||
{
|
||||
get
|
||||
{
|
||||
return buildings;
|
||||
}
|
||||
set
|
||||
{
|
||||
buildings = value;
|
||||
if (buildings[0] != null)
|
||||
Database.SetRanchBuilding1(this.Id, buildings[0].Id);
|
||||
else
|
||||
Database.SetRanchBuilding1(this.Id, 0);
|
||||
if (buildings[1] != null)
|
||||
Database.SetRanchBuilding2(this.Id, buildings[1].Id);
|
||||
else
|
||||
Database.SetRanchBuilding2(this.Id, 0);
|
||||
if (buildings[2] != null)
|
||||
Database.SetRanchBuilding3(this.Id, buildings[2].Id);
|
||||
else
|
||||
Database.SetRanchBuilding3(this.Id, 0);
|
||||
if (buildings[3] != null)
|
||||
Database.SetRanchBuilding4(this.Id, buildings[3].Id);
|
||||
else
|
||||
Database.SetRanchBuilding4(this.Id, 0);
|
||||
if (buildings[4] != null)
|
||||
Database.SetRanchBuilding5(this.Id, buildings[4].Id);
|
||||
else
|
||||
Database.SetRanchBuilding5(this.Id, 0);
|
||||
if (buildings[5] != null)
|
||||
Database.SetRanchBuilding6(this.Id, buildings[5].Id);
|
||||
else
|
||||
Database.SetRanchBuilding6(this.Id, 0);
|
||||
if (buildings[6] != null)
|
||||
Database.SetRanchBuilding7(this.Id, buildings[6].Id);
|
||||
else
|
||||
Database.SetRanchBuilding7(this.Id, 0);
|
||||
if (buildings[7] != null)
|
||||
Database.SetRanchBuilding8(this.Id, buildings[7].Id);
|
||||
else
|
||||
Database.SetRanchBuilding8(this.Id, 0);
|
||||
if (buildings[8] != null)
|
||||
Database.SetRanchBuilding9(this.Id, buildings[8].Id);
|
||||
else
|
||||
Database.SetRanchBuilding9(this.Id, 0);
|
||||
if (buildings[9] != null)
|
||||
Database.SetRanchBuilding10(this.Id, buildings[9].Id);
|
||||
else
|
||||
Database.SetRanchBuilding10(this.Id, 0);
|
||||
if (buildings[10] != null)
|
||||
Database.SetRanchBuilding11(this.Id, buildings[10].Id);
|
||||
else
|
||||
Database.SetRanchBuilding11(this.Id, 0);
|
||||
if (buildings[11] != null)
|
||||
Database.SetRanchBuilding12(this.Id, buildings[11].Id);
|
||||
else
|
||||
Database.SetRanchBuilding12(this.Id, 0);
|
||||
if (buildings[12] != null)
|
||||
Database.SetRanchBuilding13(this.Id, buildings[12].Id);
|
||||
else
|
||||
Database.SetRanchBuilding13(this.Id, 0);
|
||||
if (buildings[13] != null)
|
||||
Database.SetRanchBuilding14(this.Id, buildings[13].Id);
|
||||
else
|
||||
Database.SetRanchBuilding14(this.Id, 0);
|
||||
if (buildings[14] != null)
|
||||
Database.SetRanchBuilding15(this.Id, buildings[14].Id);
|
||||
else
|
||||
Database.SetRanchBuilding15(this.Id, 0);
|
||||
if (buildings[15] != null)
|
||||
Database.SetRanchBuilding16(this.Id, buildings[15].Id);
|
||||
else
|
||||
Database.SetRanchBuilding16(this.Id, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public RanchBuilding[] Buildings = new RanchBuilding[16];
|
||||
public Ranch(int x, int y, int id, int value)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Id = id;
|
||||
Value = value;
|
||||
Title = "";
|
||||
Description = "";
|
||||
UpgradedLevel = 0;
|
||||
OwnerId = -1;
|
||||
InvestedMoney = 0;
|
||||
for (int i = 0; i < 16; i++)
|
||||
buildings[i] = null;
|
||||
|
||||
if (Database.IsRanchOwned(id))
|
||||
{
|
||||
UpgradedLevel = Database.GetRanchUpgradeLevel(id);
|
||||
Title = Database.GetRanchTitle(id);
|
||||
Description = Database.GetRanchDescription(id);
|
||||
OwnerId = Database.GetRanchOwner(id);
|
||||
int b1 = Database.GetRanchBuilding1(id);
|
||||
int b2 = Database.GetRanchBuilding2(id);
|
||||
int b3 = Database.GetRanchBuilding3(id);
|
||||
int b4 = Database.GetRanchBuilding4(id);
|
||||
int b5 = Database.GetRanchBuilding5(id);
|
||||
int b6 = Database.GetRanchBuilding6(id);
|
||||
int b7 = Database.GetRanchBuilding7(id);
|
||||
int b8 = Database.GetRanchBuilding8(id);
|
||||
int b9 = Database.GetRanchBuilding9(id);
|
||||
int b10 = Database.GetRanchBuilding10(id);
|
||||
int b11 = Database.GetRanchBuilding11(id);
|
||||
int b12 = Database.GetRanchBuilding12(id);
|
||||
int b13 = Database.GetRanchBuilding13(id);
|
||||
int b14 = Database.GetRanchBuilding14(id);
|
||||
int b15 = Database.GetRanchBuilding15(id);
|
||||
int b16 = Database.GetRanchBuilding16(id);
|
||||
|
||||
if (RanchBuilding.RanchBuildingExists(b1))
|
||||
buildings[0] = RanchBuilding.GetRanchBuildingById(b1);
|
||||
if (RanchBuilding.RanchBuildingExists(b2))
|
||||
buildings[1] = RanchBuilding.GetRanchBuildingById(b2);
|
||||
if (RanchBuilding.RanchBuildingExists(b3))
|
||||
buildings[2] = RanchBuilding.GetRanchBuildingById(b3);
|
||||
if (RanchBuilding.RanchBuildingExists(b4))
|
||||
buildings[3] = RanchBuilding.GetRanchBuildingById(b4);
|
||||
if (RanchBuilding.RanchBuildingExists(b5))
|
||||
buildings[4] = RanchBuilding.GetRanchBuildingById(b5);
|
||||
if (RanchBuilding.RanchBuildingExists(b6))
|
||||
buildings[5] = RanchBuilding.GetRanchBuildingById(b6);
|
||||
if (RanchBuilding.RanchBuildingExists(b7))
|
||||
buildings[6] = RanchBuilding.GetRanchBuildingById(b7);
|
||||
if (RanchBuilding.RanchBuildingExists(b8))
|
||||
buildings[7] = RanchBuilding.GetRanchBuildingById(b8);
|
||||
if (RanchBuilding.RanchBuildingExists(b9))
|
||||
buildings[8] = RanchBuilding.GetRanchBuildingById(b9);
|
||||
if (RanchBuilding.RanchBuildingExists(b10))
|
||||
buildings[9] = RanchBuilding.GetRanchBuildingById(b10);
|
||||
if (RanchBuilding.RanchBuildingExists(b11))
|
||||
buildings[10] = RanchBuilding.GetRanchBuildingById(b11);
|
||||
if (RanchBuilding.RanchBuildingExists(b12))
|
||||
buildings[11] = RanchBuilding.GetRanchBuildingById(b12);
|
||||
if (RanchBuilding.RanchBuildingExists(b13))
|
||||
buildings[12] = RanchBuilding.GetRanchBuildingById(b13);
|
||||
if (RanchBuilding.RanchBuildingExists(b14))
|
||||
buildings[13] = RanchBuilding.GetRanchBuildingById(b14);
|
||||
if (RanchBuilding.RanchBuildingExists(b15))
|
||||
buildings[14] = RanchBuilding.GetRanchBuildingById(b15);
|
||||
if (RanchBuilding.RanchBuildingExists(b16))
|
||||
buildings[15] = RanchBuilding.GetRanchBuildingById(b16);
|
||||
|
||||
|
||||
InvestedMoney = Database.GetRanchInvestment(id);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsRanchHere(int x, int y)
|
||||
|
@ -60,5 +305,28 @@ namespace HISP.Game
|
|||
}
|
||||
throw new KeyNotFoundException("No Ranch found at x" + x + " y" + y);
|
||||
}
|
||||
|
||||
public static bool IsRanchOwned(int playerId)
|
||||
{
|
||||
foreach (Ranch ranch in Ranches)
|
||||
{
|
||||
if (ranch.OwnerId == playerId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static Ranch GetRanchOwnedBy(int playerId)
|
||||
{
|
||||
foreach(Ranch ranch in Ranches)
|
||||
{
|
||||
if(ranch.OwnerId == playerId)
|
||||
{
|
||||
return ranch;
|
||||
}
|
||||
}
|
||||
throw new KeyNotFoundException("Player " + playerId + " does not own a ranch.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
81
Horse Isle Server/HorseIsleServer/Game/Riddler.cs
Normal file
81
Horse Isle Server/HorseIsleServer/Game/Riddler.cs
Normal file
|
@ -0,0 +1,81 @@
|
|||
using HISP.Player;
|
||||
using HISP.Server;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HISP.Game
|
||||
{
|
||||
public class Riddler
|
||||
{
|
||||
private static List<Riddler> riddlerRiddles = new List<Riddler>();
|
||||
public static Riddler[] Riddles
|
||||
{
|
||||
get
|
||||
{
|
||||
return riddlerRiddles.ToArray();
|
||||
}
|
||||
}
|
||||
public Riddler(int id, string riddle, string[] answers, string reason)
|
||||
{
|
||||
Id = id;
|
||||
Riddle = riddle;
|
||||
Answers = answers;
|
||||
Reason = reason;
|
||||
riddlerRiddles.Add(this);
|
||||
}
|
||||
public int Id;
|
||||
public string Riddle;
|
||||
public string[] Answers;
|
||||
public string Reason;
|
||||
public void AnswerSuccess(User user)
|
||||
{
|
||||
if (!Database.HasPlayerCompletedRiddle(this.Id, user.Id))
|
||||
Database.CompleteRiddle(this.Id, user.Id);
|
||||
|
||||
byte[] riddleAnswerCorrectPacket = PacketBuilder.CreateChat(Messages.FormatRiddlerAnswerCorrect(this.Reason), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
user.LoggedinClient.SendPacket(riddleAnswerCorrectPacket);
|
||||
user.Money += 10000;
|
||||
|
||||
if(Database.TotalRiddlesCompletedByPlayer(user.Id) >= riddlerRiddles.Count)
|
||||
user.Awards.AddAward(Award.GetAwardById(11)); // Riddlers Riddles
|
||||
}
|
||||
|
||||
public void AnswerFail(User user)
|
||||
{
|
||||
byte[] riddleIncorrect = PacketBuilder.CreateChat(Messages.RiddlerIncorrectAnswer, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
user.LoggedinClient.SendPacket(riddleIncorrect);
|
||||
}
|
||||
|
||||
public bool CheckAnswer(User user, string txt)
|
||||
{
|
||||
foreach(string Answer in Answers)
|
||||
{
|
||||
if(Answer.ToLower() == txt.ToLower())
|
||||
{
|
||||
AnswerSuccess(user);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
AnswerFail(user);
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool HasCompletedAllRiddles(User user)
|
||||
{
|
||||
if (Database.TotalRiddlesCompletedByPlayer(user.Id) > Riddles.Length)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Riddler GetRandomRiddle(User user)
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
|
||||
int rng = GameServer.RandomNumberGenerator.Next(0, Riddles.Length);
|
||||
if (Database.HasPlayerCompletedRiddle(rng, user.Id))
|
||||
continue;
|
||||
return Riddles[rng];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -48,8 +48,10 @@ namespace HISP.Player
|
|||
public HorseInstance LastViewedHorse;
|
||||
public HorseInstance CurrentlyRidingHorse;
|
||||
public Tracking TrackedItems;
|
||||
public Ranch OwnedRanch = null;
|
||||
public PlayerQuests Quests;
|
||||
public Highscore Highscores;
|
||||
public Riddler LastRiddle;
|
||||
public Award Awards;
|
||||
public int CapturingHorseId;
|
||||
public DateTime LoginTime;
|
||||
|
@ -443,6 +445,19 @@ namespace HISP.Player
|
|||
thirst = Database.GetPlayerThirst(UserId);
|
||||
tired = Database.GetPlayerTiredness(UserId);
|
||||
|
||||
if(Ranch.IsRanchOwned(this.Id))
|
||||
{
|
||||
if (this.Subscribed)
|
||||
{
|
||||
OwnedRanch = Ranch.GetRanchOwnedBy(this.Id);
|
||||
}
|
||||
else // idk what it does here ...
|
||||
{
|
||||
OwnedRanch = null;
|
||||
Ranch.GetRanchOwnedBy(this.Id).OwnerId = -1;
|
||||
}
|
||||
}
|
||||
|
||||
Gender = Database.GetGender(UserId);
|
||||
MailBox = new Mailbox(this);
|
||||
Highscores = new Highscore(this);
|
||||
|
|
|
@ -46,8 +46,22 @@ namespace HISP.Server
|
|||
string Treasure = "CREATE TABLE Treasure(randomId INT, x INT, y INT, value INT, type TEXT(128))";
|
||||
string Ranches = "CREATE TABLE Ranches(ranchId INT, playerId INT, title TEXT(1028), description TEXT(1028), upgradeLevel INT, building1 INT, building2 INT, building3 INT, building4 INT, building5 INT, building6 INT, building7 INT, building8 INT, building9 INT, building10 INT, building11 INT, building12 INT, building13 INT, building14 INT, building15 INT, building16 INT, investedMoney INT)";
|
||||
string BannedPlayers = "CREATE TABLE BannedPlayers(playerId INT, ipAddress TEXT(1028), reason TEXT(1028))";
|
||||
string RiddlesComplete = "CREATE TABLE RiddlesComplete(playerId INT, riddleId INT, solved TEXT(1028))";
|
||||
string DeleteOnlineUsers = "DELETE FROM OnlineUsers";
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = RiddlesComplete;
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.WarnPrint(e.Message);
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
|
@ -426,6 +440,667 @@ namespace HISP.Server
|
|||
|
||||
}
|
||||
|
||||
public static void DeleteRanchOwner(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "DELETE FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static bool IsRanchOwned(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT COUNT(1) FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int count = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return count >= 1;
|
||||
}
|
||||
}
|
||||
public static int GetRanchInvestment(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT investedMoney FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int invested = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return invested;
|
||||
}
|
||||
}
|
||||
public static void SetRanchUpgradeLevel(int ranchId, int upgradeLevel)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET upgradeLevel=@upgradeLevel";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@upgradeLevel", upgradeLevel);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchInvestment(int ranchId, int investedMoney)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET investedMoney=@investedMoney";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@investedMoney", investedMoney);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchOwner(int ranchId, int ownerId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET playerId=@ownerId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@ownerId", ownerId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchDescription(int ranchId, string description)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET description=@description";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@description", description);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchTitle(int ranchId, string title)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET title=@title";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@title", title);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding16(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building16=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding15(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building15=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding14(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building14=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding13(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building13=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding12(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building12=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding11(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building11=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding10(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building10=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding9(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building9=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding8(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building8=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding7(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building7=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding6(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building6=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding5(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building5=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding4(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building4=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding3(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building3=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding2(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building2=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void SetRanchBuilding1(int ranchId, int buildingId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Ranches SET building1=@buildingId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Parameters.AddWithValue("@buildingId", buildingId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding16(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building16 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding15(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building15 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding14(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building14 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding13(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building13 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding12(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building12 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding11(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building11 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding10(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building10 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding9(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building9 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding8(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building8 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding7(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building7 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding6(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building6 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding5(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building5 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding4(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building4 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding3(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building3 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding2(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building2 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchBuilding1(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT building1 FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int building = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return building;
|
||||
}
|
||||
}
|
||||
public static int GetRanchUpgradeLevel(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT upgradeLevel FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int upgradeLevel = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return upgradeLevel;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetRanchDescription(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT description FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
string description = sqlCommand.ExecuteScalar().ToString();
|
||||
sqlCommand.Dispose();
|
||||
return description;
|
||||
}
|
||||
}
|
||||
public static string GetRanchTitle(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT title FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
string title = sqlCommand.ExecuteScalar().ToString();
|
||||
sqlCommand.Dispose();
|
||||
return title;
|
||||
}
|
||||
}
|
||||
public static int GetRanchOwner(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT playerId FROM Ranches WHERE ranchId=@ranchId";
|
||||
sqlCommand.Parameters.AddWithValue("@ranchId", ranchId);
|
||||
sqlCommand.Prepare();
|
||||
int playerId = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return playerId;
|
||||
}
|
||||
}
|
||||
|
||||
public static int TotalRiddlesCompletedByPlayer(int playerId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT COUNT(*) FROM RiddlesComplete WHERE playerId=@playerId AND solved=\"YES\"";
|
||||
sqlCommand.Parameters.AddWithValue("@playerId", playerId);
|
||||
sqlCommand.Prepare();
|
||||
int count = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return count;
|
||||
}
|
||||
}
|
||||
public static bool HasPlayerCompletedRiddle(int riddleId, int playerId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT COUNT(*) FROM RiddlesComplete WHERE riddleId=@riddleId AND playerId=@playerId AND solved=\"YES\"";
|
||||
sqlCommand.Parameters.AddWithValue("@riddleId", riddleId);
|
||||
sqlCommand.Parameters.AddWithValue("@playerId", playerId);
|
||||
sqlCommand.Prepare();
|
||||
int count = Convert.ToInt32(sqlCommand.ExecuteScalar());
|
||||
sqlCommand.Dispose();
|
||||
return count >= 1;
|
||||
}
|
||||
}
|
||||
public static void CompleteRiddle(int riddleId, int playerId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "INSERT INTO RiddlesComplete VALUES(@riddleId, @playerId, \"YES\")";
|
||||
sqlCommand.Parameters.AddWithValue("@riddleId", riddleId);
|
||||
sqlCommand.Parameters.AddWithValue("@playerId", playerId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddRanch(int ranchId, int playerId, string title, string description, int upgradeLevel, int building1, int building2, int building3, int building4, int building5, int building6, int building7, int building8, int building9, int building10, int building11, int building12, int building13, int building14, int building15, int building16, int investedMoney)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
|
|
|
@ -609,6 +609,17 @@ namespace HISP.Server
|
|||
Ranch.RanchBuilding.RanchBuildings.Add(building);
|
||||
Logger.DebugPrint("Registered Ranch Building: "+building.Title);
|
||||
|
||||
}
|
||||
int totalRiddles = gameData.riddle_room.Count;
|
||||
for (int i = 0; i < totalRiddles; i++)
|
||||
{
|
||||
int id = gameData.riddle_room[i].id;
|
||||
string riddle = gameData.riddle_room[i].riddle;
|
||||
string[] answers = gameData.riddle_room[i].answers.ToObject<string[]>();
|
||||
string reason = gameData.riddle_room[i].reason;
|
||||
Riddler riddlerRiddle = new Riddler(id, riddle, answers, reason);
|
||||
Logger.DebugPrint("Registered Riddler Riddle: " + riddlerRiddle.Riddle);
|
||||
|
||||
}
|
||||
|
||||
HorseInfo.HorseNames = gameData.horses.names.ToObject<string[]>();
|
||||
|
@ -801,6 +812,12 @@ namespace HISP.Server
|
|||
Messages.BankDepositedMoneyFormat = gameData.messages.bank.deposit_format;
|
||||
Messages.BankWithdrewMoneyFormat = gameData.messages.bank.withdraw_format;
|
||||
|
||||
// Riddler
|
||||
Messages.RiddlerAnsweredAll = gameData.messages.meta.riddler.riddle_all_complete;
|
||||
Messages.RiddlerIncorrectAnswer = gameData.messages.meta.riddler.riddle_incorrect;
|
||||
Messages.RiddlerCorrectAnswerFormat = gameData.messages.meta.riddler.riddle_correct;
|
||||
Messages.RiddlerEnterAnswerFormat = gameData.messages.meta.riddler.riddle_format;
|
||||
|
||||
// Workshop
|
||||
Messages.WorkshopCraftEntryFormat = gameData.messages.meta.workshop.craft_entry;
|
||||
Messages.WorkshopRequiresFormat = gameData.messages.meta.workshop.requires;
|
||||
|
|
|
@ -1067,6 +1067,23 @@ namespace HISP.Server
|
|||
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to send a invalid dynamic input (private notes, wrong size)");
|
||||
break;
|
||||
}
|
||||
case 6: // Riddle Room
|
||||
if (dynamicInput.Length >= 2)
|
||||
{
|
||||
if (sender.LoggedinUser.LastRiddle != null)
|
||||
{
|
||||
string answer = dynamicInput[1];
|
||||
if(sender.LoggedinUser.LastRiddle.CheckAnswer(sender.LoggedinUser, answer))
|
||||
sender.LoggedinUser.LastRiddle = null;
|
||||
UpdateArea(sender);
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to send a invalid dynamic input (LastRiddle, wrong size)");
|
||||
break;
|
||||
}
|
||||
case 5: // Horse Description
|
||||
if (dynamicInput.Length >= 3)
|
||||
{
|
||||
|
@ -2498,7 +2515,7 @@ namespace HISP.Server
|
|||
{
|
||||
if(loggedInUser.CurrentlyRidingHorse.BasicStats.Experience < 25)
|
||||
{
|
||||
if(GameServer.RandomNumberGenerator.Next(0,10) == 7 || sender.LoggedinUser.Username.ToLower() == "dream")
|
||||
if(GameServer.RandomNumberGenerator.Next(0,50) == 25 || sender.LoggedinUser.Username.ToLower() == "dream")
|
||||
{
|
||||
loggedInUser.CurrentlyRidingHorse.BasicStats.Experience++;
|
||||
sender.LoggedinUser.CurrentlyRidingHorse = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue