Fix inconsistancies- Add f12 shortcut,

This commit is contained in:
SilicaAndPina 2021-06-27 01:08:56 +12:00
parent 72420c8e3c
commit 852b5f33ec
8 changed files with 176 additions and 47 deletions

View file

@ -57,7 +57,7 @@
"prof_reasons":{ "prof_reasons":{
"profanity":"Profanity detected.", "profanity":"Profanity detected.",
"personal_info":"No giving out personal info/websites.", "personal_info":"No giving out personal info/websites.",
} },
"private_notes_save":"Saved Private Notes.", "private_notes_save":"Saved Private Notes.",
"buddy_request":"Attempting to Add Buddy. The other player must click ADD BUDDY as well. (Many players reserve this for just a couple players so don't feel insulted if they do not).", "buddy_request":"Attempting to Add Buddy. The other player must click ADD BUDDY as well. (Many players reserve this for just a couple players so don't feel insulted if they do not).",
"click_nothing_message":"Nothing interesting here...", "click_nothing_message":"Nothing interesting here...",
@ -85,7 +85,9 @@
"chat_errors":{ "chat_errors":{
"cant_find_player":"Could not find player to Private chat!", "cant_find_player":"Could not find player to Private chat!",
"ads_once_per_minute":"Ads may only be posted once per minute.", "ads_once_per_minute":"Ads may only be posted once per minute.",
"global_chats_limited":"<B>CHAT NOT SENT:</B> Global chats are limited (+1 earned per 2 minutes). Please chat using CHAT NEAR/ISLAND/BUDDIES when possible." "global_chats_limited":"<B>CHAT NOT SENT:</B> Global chats are limited (+1 earned per 2 minutes). Please chat using CHAT NEAR/ISLAND/BUDDIES when possible.",
"global_too_long":"<B>CHAT NOT SENT:</B> Global chats are limited to 150 characters. Please try to keep the global chat brief when possible. (Use CTRL+UP arrow to edit)",
"ads_too_long":"<B>CHAT NOT SENT:</B> Ads chats are limited to 150 characters. Please try to keep the ads chat brief when possible. (Use CTRL+UP arrow to edit)"
}, },
"mods_revenge":{ "mods_revenge":{
"awareded_others":"You earned $500 from Moderator %USERNAME%'s Splatterball!", "awareded_others":"You earned $500 from Moderator %USERNAME%'s Splatterball!",
@ -195,7 +197,8 @@
"dropped_item_message":"You dropped an item on the ground.", "dropped_item_message":"You dropped an item on the ground.",
"grab_but_inv_full":"Your inventory is full! Cannot grab items.", "grab_but_inv_full":"Your inventory is full! Cannot grab items.",
"grab_all_but_inv_full":"You grabbed what you could, but your inventory is full.", "grab_all_but_inv_full":"You grabbed what you could, but your inventory is full.",
"drop_tile_full":"Cannot drop any more objects here, too many on ground already." "drop_tile_full":"Cannot drop any more objects here, too many on ground already.",
"other_picked_up":"You reached for it, but someone else must have grabbed it first."
}, },
"shop":{ "shop":{
"cant_afford_1":"You cannot afford that item!", "cant_afford_1":"You cannot afford that item!",
@ -625,7 +628,7 @@
"description_too_long":"4000 character Max for Ranch description!", "description_too_long":"4000 character Max for Ranch description!",
"title_contains_violations":"Title NOT SAVED, Chat Violations Present!", "title_contains_violations":"Title NOT SAVED, Chat Violations Present!",
"desc contains violations":"Description NOT SAVED, Chat Violations Present! (%REASON%)", "desc_contains_violations":"Description NOT SAVED, Chat Violations Present! (%REASON%)",
}, },
"build":{ "build":{
"build_on_this_spot":"You can build one of the following buildings on this spot:", "build_on_this_spot":"You can build one of the following buildings on this spot:",
@ -768,6 +771,7 @@
"horse_timer":"You have 60 seconds to capture the horse. Good luck!", "horse_timer":"You have 60 seconds to capture the horse. Good luck!",
"horse_escaped":"The Horse Evaded Capture.", "horse_escaped":"The Horse Evaded Capture.",
"horse_caught":"You Captured the Horse!", "horse_caught":"You Captured the Horse!",
"horse_cannot_catch_max":"You have reached your maximum number of horses. Build a barn on a ranch to have more!",
"horse_escaped_anyway":"Your lasso must have slipped?! The horse still got away!!", "horse_escaped_anyway":"Your lasso must have slipped?! The horse still got away!!",
"too_many_horses":"You cannot manage any more horses.", "too_many_horses":"You cannot manage any more horses.",
"horses_menu":"^ATYour Horses^H<B>You can have up to %MAXHORSE% horses. Here are your %TOTALHORSE%:</B><BR>", "horses_menu":"^ATYour Horses^H<B>You can have up to %MAXHORSE% horses. Here are your %TOTALHORSE%:</B><BR>",
@ -787,7 +791,7 @@
"name_profanity_detected":"Name NOT SAVED, Chat Violations Present!", "name_profanity_detected":"Name NOT SAVED, Chat Violations Present!",
"profile_profanity_detected":"Profile NOT SAVED, Chat Violations Present! (%REASON%)" "profile_profanity_detected":"Profile NOT SAVED, Chat Violations Present! (%REASON%)"
} },
"horse_set_new_category":"Horse set as %CATEGORY%", "horse_set_new_category":"Horse set as %CATEGORY%",
"back_to_horse":"^R1^D5|BACK TO HORSE^R1", "back_to_horse":"^R1^D5|BACK TO HORSE^R1",
"pet_horse":"%MESSAGES%Your horse whinnies lightly. (+%MOOD% mood / -%TIREDNESS% tiredness)", "pet_horse":"%MESSAGES%Your horse whinnies lightly. (+%MOOD% mood / -%TIREDNESS% tiredness)",

View file

@ -2,6 +2,7 @@
using HISP.Server; using HISP.Server;
using HISP.Game; using HISP.Game;
using System.Collections.Generic; using System.Collections.Generic;
using HISP.Game.Inventory;
namespace HISP.Game.Items namespace HISP.Game.Items
{ {
@ -42,7 +43,7 @@ namespace HISP.Game.Items
public int GetMiscFlag(int no) public int GetMiscFlag(int no)
{ {
if(MiscFlags.Length <= no) if (MiscFlags.Length <= no)
return 0; return 0;
else else
return MiscFlags[no]; return MiscFlags[no];
@ -85,10 +86,50 @@ namespace HISP.Game.Items
{ {
get get
{ {
return new int[4] { StallionTradingCard, MareTradingCard, ColtTradingCard, FillyTradingCard }; return new int[4] { StallionTradingCard, MareTradingCard, ColtTradingCard, FillyTradingCard };
}
}
public static void UseItem(User user, ItemInstance item)
{
if (user.Inventory.HasItem(item.RandomId))
{
InventoryItem itm = user.Inventory.GetItemByRandomid(item.RandomId);
if (itm.ItemId == Item.DorothyShoes)
{
if (World.InIsle(user.X, user.Y))
{
World.Isle isle = World.GetIsle(user.X, user.Y);
if (isle.Name == "Prison Isle")
{
byte[] dontWorkHere = PacketBuilder.CreateChat(Messages.RanchDorothyShoesPrisonIsleMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
user.LoggedinClient.SendPacket(dontWorkHere);
return;
}
}
if (user.OwnedRanch == null) // How????
{
Logger.HackerPrint(user.Username + " Tried to use Dorothy Shoes when they did *NOT* own a ranch.");
user.Inventory.Remove(itm.ItemInstances[0]);
return;
}
byte[] noPlaceLIke127001 = PacketBuilder.CreateChat(Messages.RanchDorothyShoesMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
user.LoggedinClient.SendPacket(noPlaceLIke127001);
user.Teleport(user.OwnedRanch.X, user.OwnedRanch.Y);
}
else if (itm.ItemId == Item.Telescope)
{
byte[] birdMap = PacketBuilder.CreateBirdMap(user.X, user.Y);
user.LoggedinClient.SendPacket(birdMap);
}
else
{
Logger.ErrorPrint(user.Username + "Tried to use item with undefined action- ID: " + itm.ItemId);
}
} }
} }
public static ItemInformation[] GetAllWishableItems() public static ItemInformation[] GetAllWishableItems()
{ {
List<ItemInformation> itemInfo = new List<ItemInformation>(); List<ItemInformation> itemInfo = new List<ItemInformation>();

View file

@ -54,6 +54,9 @@ namespace HISP.Game
public static string CantFindPlayerToPrivateMessage; public static string CantFindPlayerToPrivateMessage;
public static string AdsOnlyOncePerMinute; public static string AdsOnlyOncePerMinute;
public static string GlobalChatLimited; public static string GlobalChatLimited;
public static string GlobalChatTooLong;
public static string AdsChatTooLong;
// Auto Sell // Auto Sell
public static string AutoSellNotStandingInSamePlace; public static string AutoSellNotStandingInSamePlace;
@ -396,12 +399,20 @@ namespace HISP.Game
public static string RanchUnownedRanchClicked; public static string RanchUnownedRanchClicked;
public static string RanchClickMessageFormat; public static string RanchClickMessageFormat;
public static string RanchNoDorothyShoesMessage;
public static string RanchDorothyShoesMessage; public static string RanchDorothyShoesMessage;
public static string RanchDorothyShoesPrisonIsleMessage; public static string RanchDorothyShoesPrisonIsleMessage;
public static string RanchCantAffordRanch; public static string RanchCantAffordRanch;
public static string RanchRanchBroughtMessageFormat; public static string RanchRanchBroughtMessageFormat;
public static string RanchSavedRanchDescripton; public static string RanchSavedRanchDescripton;
public static string RanchSavedTitleTooLongError;
public static string RanchSavedDescrptionTooLongError;
public static string RanchSavedTitleViolationsError;
public static string RanchSavedDescrptionViolationsErrorFormat;
public static string RanchDefaultRanchTitle; public static string RanchDefaultRanchTitle;
public static string RanchEditDescriptionMetaFormat; public static string RanchEditDescriptionMetaFormat;
@ -659,6 +670,7 @@ namespace HISP.Game
public static string GrabbedAllItemsMessage; public static string GrabbedAllItemsMessage;
public static string DroppedAnItemMessage; public static string DroppedAnItemMessage;
public static string DroppedItemTileIsFull; public static string DroppedItemTileIsFull;
public static string DroppedItemCouldntPickup;
public static string ItemInformationFormat; public static string ItemInformationFormat;
// Pond // Pond
@ -794,7 +806,15 @@ namespace HISP.Game
public static string HorseOthers; public static string HorseOthers;
public static string HorseDescriptionEditFormat; public static string HorseDescriptionEditFormat;
public static string HorseSavedProfileMessageFormat; public static string HorseSavedProfileMessageFormat;
public static string HorseProfileMessageTooLongError;
public static string HorseNameTooLongError;
public static string HorseNameViolationsError;
public static string HorseProfileMessageProfileError;
public static string HorseCatchTooManyHorsesMessage;
public static string HorseEquipTackMessageFormat; public static string HorseEquipTackMessageFormat;
public static string HorseUnEquipTackMessageFormat; public static string HorseUnEquipTackMessageFormat;
public static string HorseStopRidingMessage; public static string HorseStopRidingMessage;

View file

@ -98,13 +98,13 @@ namespace HISP.Server
AllUsersSubbed = data == "true"; AllUsersSubbed = data == "true";
break; break;
case "enable_corrections": case "enable_corrections":
BadWords = data == "true"; DoCorrections = data == "true";
break; break;
case "non_violation": case "non_violation":
DoNonViolations = data == "true"; DoNonViolations = data == "true";
break; break;
case "enable_word_filter": case "enable_word_filter":
DoCorrections = data == "true"; BadWords = data == "true";
break; break;
case "intrest_rate": case "intrest_rate":
IntrestRate = int.Parse(data); IntrestRate = int.Parse(data);

View file

@ -953,6 +953,8 @@ namespace HISP.Server
Messages.CantFindPlayerToPrivateMessage = gameData.messages.chat_errors.cant_find_player; Messages.CantFindPlayerToPrivateMessage = gameData.messages.chat_errors.cant_find_player;
Messages.AdsOnlyOncePerMinute = gameData.messages.chat_errors.ads_once_per_minute; Messages.AdsOnlyOncePerMinute = gameData.messages.chat_errors.ads_once_per_minute;
Messages.GlobalChatLimited = gameData.messages.chat_errors.global_chats_limited; Messages.GlobalChatLimited = gameData.messages.chat_errors.global_chats_limited;
Messages.GlobalChatTooLong = gameData.messages.chat_errors.global_too_long;
Messages.AdsChatTooLong = gameData.messages.chat_errors.ads_too_long;
// Warp Command // Warp Command
@ -1307,12 +1309,21 @@ namespace HISP.Server
Messages.RanchUnownedRanchClicked = gameData.messages.meta.ranch.unowned_ranch_click; Messages.RanchUnownedRanchClicked = gameData.messages.meta.ranch.unowned_ranch_click;
Messages.RanchClickMessageFormat = gameData.messages.meta.ranch.click_message; Messages.RanchClickMessageFormat = gameData.messages.meta.ranch.click_message;
Messages.RanchNoDorothyShoesMessage = gameData.messages.meta.ranch.no_dorothy_shoes;
Messages.RanchDorothyShoesMessage = gameData.messages.meta.ranch.dorothy_message; Messages.RanchDorothyShoesMessage = gameData.messages.meta.ranch.dorothy_message;
Messages.RanchDorothyShoesPrisonIsleMessage = gameData.messages.meta.ranch.dorothy_prison_isle; Messages.RanchDorothyShoesPrisonIsleMessage = gameData.messages.meta.ranch.dorothy_prison_isle;
Messages.RanchCantAffordRanch = gameData.messages.meta.ranch.ranch_buy_cannot_afford; Messages.RanchCantAffordRanch = gameData.messages.meta.ranch.ranch_buy_cannot_afford;
Messages.RanchRanchBroughtMessageFormat = gameData.messages.meta.ranch.ranch_brought; Messages.RanchRanchBroughtMessageFormat = gameData.messages.meta.ranch.ranch_brought;
Messages.RanchSavedRanchDescripton = gameData.messages.meta.ranch.saved_ranch;
Messages.RanchSavedRanchDescripton = gameData.messages.meta.ranch.ranch_info.saved;
Messages.RanchSavedTitleTooLongError = gameData.messages.meta.ranch.ranch_info.title_too_long;
Messages.RanchSavedDescrptionTooLongError = gameData.messages.meta.ranch.ranch_info.description_too_long;
Messages.RanchSavedTitleViolationsError = gameData.messages.meta.ranch.ranch_info.title_contains_violations;
Messages.RanchSavedDescrptionViolationsErrorFormat = gameData.messages.meta.ranch.ranch_info.desc_contains_violations;
Messages.RanchDefaultRanchTitle = gameData.messages.meta.ranch.default_title; Messages.RanchDefaultRanchTitle = gameData.messages.meta.ranch.default_title;
Messages.RanchEditDescriptionMetaFormat = gameData.messages.meta.ranch.edit_description; Messages.RanchEditDescriptionMetaFormat = gameData.messages.meta.ranch.edit_description;
Messages.RanchTitleFormat = gameData.messages.meta.ranch.your_ranch_meta; Messages.RanchTitleFormat = gameData.messages.meta.ranch.your_ranch_meta;
@ -1692,8 +1703,14 @@ namespace HISP.Server
Messages.HorseTackButtonFormat = gameData.messages.meta.horse.horse_inventory.tack_button; Messages.HorseTackButtonFormat = gameData.messages.meta.horse.horse_inventory.tack_button;
Messages.HorsePetButtonFormat = gameData.messages.meta.horse.horse_inventory.pet_button; Messages.HorsePetButtonFormat = gameData.messages.meta.horse.horse_inventory.pet_button;
Messages.HorseProfileButtonFormat = gameData.messages.meta.horse.horse_inventory.profile_button; Messages.HorseProfileButtonFormat = gameData.messages.meta.horse.horse_inventory.profile_button;
Messages.HorseSavedProfileMessageFormat = gameData.messages.meta.horse.saved_profile;
Messages.HorseSavedProfileMessageFormat = gameData.messages.meta.horse.profile.saved;
Messages.HorseProfileMessageTooLongError = gameData.messages.meta.horse.profile.desc_too_long;
Messages.HorseNameTooLongError = gameData.messages.meta.horse.profile.name_too_long;
Messages.HorseNameViolationsError = gameData.messages.meta.horse.profile.name_profanity_detected;
Messages.HorseProfileMessageProfileError = gameData.messages.meta.horse.profile.profile_profanity_detected;
Messages.HorseCatchTooManyHorsesMessage = gameData.messages.meta.horse.horse_inventory.horse_cannot_catch_max;
Messages.HorseNoAutoSell = gameData.messages.meta.horse.horse_inventory.no_auto_sell; Messages.HorseNoAutoSell = gameData.messages.meta.horse.horse_inventory.no_auto_sell;
Messages.HorseAutoSellPriceFormat = gameData.messages.meta.horse.horse_inventory.auto_sell_format; Messages.HorseAutoSellPriceFormat = gameData.messages.meta.horse.horse_inventory.auto_sell_format;
Messages.HorseAutoSellOthersFormat = gameData.messages.meta.horse.horse_inventory.auto_sell_others; Messages.HorseAutoSellOthersFormat = gameData.messages.meta.horse.horse_inventory.auto_sell_others;
@ -1868,6 +1885,7 @@ namespace HISP.Server
Messages.GrabAllItemsButton = gameData.messages.meta.dropped_items.grab_all; Messages.GrabAllItemsButton = gameData.messages.meta.dropped_items.grab_all;
Messages.DroppedAnItemMessage = gameData.messages.dropped_items.dropped_item_message; Messages.DroppedAnItemMessage = gameData.messages.dropped_items.dropped_item_message;
Messages.DroppedItemTileIsFull = gameData.messages.dropped_items.drop_tile_full; Messages.DroppedItemTileIsFull = gameData.messages.dropped_items.drop_tile_full;
Messages.DroppedItemCouldntPickup = gameData.messages.dropped_items.other_picked_up;
Messages.GrabbedAllItemsMessage = gameData.messages.dropped_items.grab_all_message; Messages.GrabbedAllItemsMessage = gameData.messages.dropped_items.grab_all_message;
Messages.GrabbedItemMessage = gameData.messages.dropped_items.grab_message; Messages.GrabbedItemMessage = gameData.messages.dropped_items.grab_message;
Messages.GrabAllItemsMessage = gameData.messages.dropped_items.grab_all_message; Messages.GrabAllItemsMessage = gameData.messages.dropped_items.grab_all_message;

View file

@ -2141,6 +2141,14 @@ namespace HISP.Server
Logger.HackerPrint(sender.LoggedinUser.Username + " Tried to catch a horse that doesnt exist."); Logger.HackerPrint(sender.LoggedinUser.Username + " Tried to catch a horse that doesnt exist.");
return; return;
} }
if(sender.LoggedinUser.HorseInventory.HorseList.Length >= sender.LoggedinUser.MaxHorses)
{
byte[] payUsPlz = PacketBuilder.CreateChat(Messages.HorseCatchTooManyHorsesMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(payUsPlz);
return;
}
sender.LoggedinUser.CapturingHorseId = randomId; sender.LoggedinUser.CapturingHorseId = randomId;
byte[] chatPacket = PacketBuilder.CreateChat(Messages.HorseCaptureTimer, PacketBuilder.CHAT_BOTTOM_RIGHT); byte[] chatPacket = PacketBuilder.CreateChat(Messages.HorseCaptureTimer, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(chatPacket); sender.SendPacket(chatPacket);
@ -2412,6 +2420,25 @@ namespace HISP.Server
{ {
if(sender.LoggedinUser.LastViewedHorse != null) if(sender.LoggedinUser.LastViewedHorse != null)
{ {
string desc = dynamicInput[2];
string name = dynamicInput[1];
name.Trim();
desc.Trim();
if(name.Length > 50)
{
byte[] horseNameTooLongPacket = PacketBuilder.CreateChat(Messages.HorseNameTooLongError, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(horseNameTooLongPacket);
break;
}
if (desc.Length > 250)
{
byte[] horseNameTooLongPacket = PacketBuilder.CreateChat(Messages.HorseNameTooLongError, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(horseNameTooLongPacket);
break;
}
sender.LoggedinUser.MetaPriority = true; sender.LoggedinUser.MetaPriority = true;
sender.LoggedinUser.LastViewedHorse.Name = dynamicInput[1]; sender.LoggedinUser.LastViewedHorse.Name = dynamicInput[1];
sender.LoggedinUser.LastViewedHorse.Description = dynamicInput[2]; sender.LoggedinUser.LastViewedHorse.Description = dynamicInput[2];
@ -2496,6 +2523,20 @@ namespace HISP.Server
string desc = dynamicInput[2]; string desc = dynamicInput[2];
if(sender.LoggedinUser.OwnedRanch != null) if(sender.LoggedinUser.OwnedRanch != null)
{ {
title.Trim();
desc.Trim();
if(title.Length > 100)
{
byte[] tooLongPacket = PacketBuilder.CreateChat(Messages.RanchSavedTitleTooLongError, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(tooLongPacket);
break;
}
if (desc.Length > 4000)
{
byte[] tooLongPacket = PacketBuilder.CreateChat(Messages.RanchSavedTitleTooLongError, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(tooLongPacket);
break;
}
sender.LoggedinUser.OwnedRanch.Title = title; sender.LoggedinUser.OwnedRanch.Title = title;
sender.LoggedinUser.OwnedRanch.Description = desc; sender.LoggedinUser.OwnedRanch.Description = desc;
} }
@ -5537,18 +5578,23 @@ namespace HISP.Server
case "/ads": case "/ads":
channel = Chat.ChatChannel.Ads; channel = Chat.ChatChannel.Ads;
break; break;
case "/a":
case "/all": case "/all":
channel = Chat.ChatChannel.All; channel = Chat.ChatChannel.All;
break; break;
case "/h":
case "/here": case "/here":
channel = Chat.ChatChannel.Here; channel = Chat.ChatChannel.Here;
break; break;
case "/n":
case "/near": case "/near":
channel = Chat.ChatChannel.Near; channel = Chat.ChatChannel.Near;
break; break;
case "/b":
case "/buddy": case "/buddy":
channel = Chat.ChatChannel.Buddies; channel = Chat.ChatChannel.Buddies;
break; break;
case "/i":
case "/island": case "/island":
channel = Chat.ChatChannel.Isle; channel = Chat.ChatChannel.Isle;
break; break;
@ -5573,6 +5619,19 @@ namespace HISP.Server
message = message.Trim(); message = message.Trim();
if(channel == Chat.ChatChannel.All && message.Length > 150)
{
byte[] tooLong = PacketBuilder.CreateChat(Messages.GlobalChatTooLong, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(tooLong);
return;
}
if (channel == Chat.ChatChannel.Ads && message.Length > 150)
{
byte[] tooLong = PacketBuilder.CreateChat(Messages.AdsChatTooLong, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(tooLong);
return;
}
if (Chat.ProcessCommand(sender.LoggedinUser, message)) if (Chat.ProcessCommand(sender.LoggedinUser, message))
{ {
Logger.DebugPrint(sender.LoggedinUser.Username + " Attempting to run command '" + message + "' in channel: " + channel.ToString()); Logger.DebugPrint(sender.LoggedinUser.Username + " Attempting to run command '" + message + "' in channel: " + channel.ToString());
@ -5858,6 +5917,9 @@ namespace HISP.Server
} }
catch(KeyNotFoundException) catch(KeyNotFoundException)
{ {
byte[] pickedUp = PacketBuilder.CreateChat(Messages.DroppedItemCouldntPickup, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(pickedUp);
Logger.HackerPrint(sender.LoggedinUser.Username + " Tried to grab a non existing object."); Logger.HackerPrint(sender.LoggedinUser.Username + " Tried to grab a non existing object.");
return; return;
} }
@ -6119,7 +6181,23 @@ namespace HISP.Server
break; break;
case PacketBuilder.ITEM_USE: case PacketBuilder.ITEM_USE:
packetStr = Encoding.UTF8.GetString(packet); packetStr = Encoding.UTF8.GetString(packet);
randomIdStr = packetStr.Substring(2, packet.Length - 2); randomIdStr = packetStr.Substring(2, packet.Length - 4);
if(randomIdStr == "") // f12 ranch shortcut
{
if (sender.LoggedinUser.Inventory.HasItemId(Item.DorothyShoes))
{
InventoryItem itm = sender.LoggedinUser.Inventory.GetItemByItemId(Item.DorothyShoes);
Item.UseItem(sender.LoggedinUser, itm.ItemInstances[0]);
}
else
{
byte[] noShoesMessage = PacketBuilder.CreateChat(Messages.RanchNoDorothyShoesMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(noShoesMessage);
return;
}
}
randomId = 0; randomId = 0;
try try
@ -6134,39 +6212,7 @@ namespace HISP.Server
if (sender.LoggedinUser.Inventory.HasItem(randomId)) if (sender.LoggedinUser.Inventory.HasItem(randomId))
{ {
InventoryItem itm = sender.LoggedinUser.Inventory.GetItemByRandomid(randomId); InventoryItem itm = sender.LoggedinUser.Inventory.GetItemByRandomid(randomId);
if(itm.ItemId == Item.DorothyShoes) Item.UseItem(sender.LoggedinUser, itm.ItemInstances[0]);
{
if(World.InIsle(sender.LoggedinUser.X, sender.LoggedinUser.Y))
{
World.Isle isle = World.GetIsle(sender.LoggedinUser.X, sender.LoggedinUser.Y);
if(isle.Name == "Prison Isle")
{
byte[] dontWorkHere = PacketBuilder.CreateChat(Messages.RanchDorothyShoesPrisonIsleMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(dontWorkHere);
break;
}
}
if(sender.LoggedinUser.OwnedRanch == null) // How????
{
Logger.HackerPrint(sender.LoggedinUser.Username + " Tried to use Dorothy Shoes when they did *NOT* own a ranch.");
sender.LoggedinUser.Inventory.Remove(itm.ItemInstances[0]);
break;
}
byte[] noPlaceLIke127001 = PacketBuilder.CreateChat(Messages.RanchDorothyShoesMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
sender.SendPacket(noPlaceLIke127001);
sender.LoggedinUser.Teleport(sender.LoggedinUser.OwnedRanch.X, sender.LoggedinUser.OwnedRanch.Y);
}
else if(itm.ItemId == Item.Telescope)
{
byte[] birdMap = PacketBuilder.CreateBirdMap(sender.LoggedinUser.X, sender.LoggedinUser.Y);
sender.SendPacket(birdMap);
}
else
{
Logger.ErrorPrint(sender.LoggedinUser.Username + "Tried to use item with undefined action- ID: " + itm.ItemId);
}
} }
break; break;
case PacketBuilder.ITEM_WEAR: case PacketBuilder.ITEM_WEAR:

View file

@ -212,7 +212,7 @@ namespace HISP.Server
public const byte ITEM_USE = 0x5F; public const byte ITEM_USE = 0x5F;
public const byte ITEM_RAKE = 0x5B; public const byte ITEM_RAKE = 0x5B;
public const byte ITEM_SHOVEL = 0x5A; public const byte ITEM_SHOVEL = 0x5A;
public const byte LOGIN_INVALID_USER_PASS = 0x15; public const byte LOGIN_INVALID_USER_PASS = 0x15;
public const byte LOGIN_CUSTOM_MESSAGE = 0x16; public const byte LOGIN_CUSTOM_MESSAGE = 0x16;
public const byte LOGIN_SUCCESS = 0x14; public const byte LOGIN_SUCCESS = 0x14;