diff --git a/DataCollection/gamedata.json b/DataCollection/gamedata.json
index a9fccea..eeb6d18 100755
--- a/DataCollection/gamedata.json
+++ b/DataCollection/gamedata.json
@@ -66,6 +66,10 @@
"ads_once_per_minute":"Ads may only be posted once per minute.",
"global_chats_limited":"CHAT NOT SENT: Global chats are limited (+1 earned per 2 minutes). Please chat using CHAT NEAR/ISLAND/BUDDIES when possible."
},
+ "mods_revenge":{
+ "awareded_others":"You earned $500 from Moderator %USERNAME%'s Splatterball!",
+ "awarded_you":"Mod Revenge taken upon %USERNAME%! $50 earned."
+ },
"events":{
"real_time_riddle":{
"event_start":"CHAT RIDDLE: %RIDDLETEXT% (answer first via any chat method)",
@@ -1104,7 +1108,7 @@
"item_info_itemid_button":"^B4LN%ITEMID%",
"item_wear_button":"^B4W%RANDOMID%",
"item_consume_button":"^B4E%RANDOMID%",
- "item_throw_button":"^B4T%RANDOMID%",
+ "item_throw_button":"^B4T%ITEMID%",
"item_use_button":"^B4UD%RANDOMID%",
"item_open_button":"^B4O%RANDOMID%",
"item_read_button":"^B4VL%ITEMID%",
@@ -8879,17 +8883,18 @@
"telescope":182,
"pitchfork":152,
"wishing_coin":50,
+ "mod_splatterball":713,
"fishing_poll":146,
"earthworm":83,
"birthday_token":1082
},
"throwable":[
- {"id":144,"message":"blanketing wet snow on "},
- {"id":333,"message":"bright red chunks are covering "},
- {"id":334,"message":"soaking "},
- {"id":639,"message":"twinkling magic on "},
- {"id":640,"message":"lightly bouncing off "},
- {"id":713,"message":"slimy goop exploded and dripped on "}
+ {"id":144,"message_hit":"SMACK!! %USERNAME% hit you with a Snowball, blanketing wet snow on you.", "message_throw":"SMACK!! You nailed %USERNAME% with a Snowball, blanketing wet snow on them.", "message_hit_yourself":"You toss the Snowball high into the air! SMACK! It comes back down and hits you on the head, blanketing wet snow on you."},
+ {"id":333,"message_hit":"SMACK!! %USERNAME% hit you with a Rotten Tomato, bright red chunks are covering you.", "message_throw":"SMACK!! You nailed %USERNAME% with a Rotten Tomato, bright red chunks are covering them.", "message_hit_yourself":"You toss the Rotten Tomato high into the air! SMACK! It comes back down and hits you on the head, bright red chunks are covering you"},
+ {"id":334,"message_hit":"SMACK!! %USERNAME% hit you with a Water Balloon, soaking you.", "message_throw":"SMACK!! You nailed %USERNAME% with a Water Balloon, soaking them.", "message_hit_yourself":"You toss the Water Balloon high into the air! SMACK! It comes back down and hits you on the head, soaking you."},
+ {"id":639,"message_hit":"SMACK!! %USERNAME% hit you with a Pixie Dust, twinkling magic on you", "message_throw":"SMACK!! You nailed %USERNAME% with a Pixie Dust, twinkling magic on them.", "message_hit_yourself":"You toss the Pixie Dust high into the air! SMACK! It comes back down and hits you on the head, twinkling magic on you."},
+ {"id":640,"message_hit":"SMACK!! %USERNAME% hit you with a Marshmallow, lightly bouncing off you.", "message_throw":"SMACK!! You nailed %USERNAME% with a Marshmallow, lightly bouncing off them.", "message_hit_yourself":"You toss the Marshmallow high into the air! SMACK! It comes back down and hits you on the head, lightly bouncing off you."},
+ {"id":713,"message_hit":"SMACK!! %USERNAME% hit you with a Mod Splatterball, slimy goop exploded and dripped on you.", "message_throw":"SMACK!! You nailed %USERNAME% with a Mod Splatterball, slimy goop exploded and dripped on them.", "message_hit_yourself":"You toss the Mod Splatterball high into the air! SMACK! It comes back down and hits you on the head, slimy goop exploded and dripped on you."}
],
"item_list":[
{
diff --git a/Horse Isle Server/HorseIsleServer/Game/Items/Item.cs b/Horse Isle Server/HorseIsleServer/Game/Items/Item.cs
index 6a3ca23..99b007f 100755
--- a/Horse Isle Server/HorseIsleServer/Game/Items/Item.cs
+++ b/Horse Isle Server/HorseIsleServer/Game/Items/Item.cs
@@ -53,7 +53,9 @@ namespace HISP.Game.Items
public struct ThrowableItem
{
public int Id;
- public string Message;
+ public string HitMessage;
+ public string ThrowMessage;
+ public string HitYourselfMessage;
}
public static List Items = new List();
@@ -66,6 +68,7 @@ namespace HISP.Game.Items
public static int Telescope;
public static int Pitchfork;
public static int WishingCoin;
+ public static int ModSplatterball;
public static int FishingPole;
public static int Earthworm;
public static int BirthdayToken;
diff --git a/Horse Isle Server/HorseIsleServer/Game/Messages.cs b/Horse Isle Server/HorseIsleServer/Game/Messages.cs
index a4a8ab3..4b31eb1 100755
--- a/Horse Isle Server/HorseIsleServer/Game/Messages.cs
+++ b/Horse Isle Server/HorseIsleServer/Game/Messages.cs
@@ -13,8 +13,10 @@ namespace HISP.Game
// Message Queue
public static string MessageQueueHeader;
- // Mod isle
+ // Mod
public static string ModIsleMessage;
+ public static string ModSplatterballEarnedYouFormat;
+ public static string ModSplatterballEarnedOtherFormat;
// Add Buddy
public static string AddBuddyPending;
@@ -1114,6 +1116,22 @@ namespace HISP.Game
// Event : Tack Shop Giveaway
+
+ // Throwables
+ public static string FormatModSplatterBallAwardedOther(string username)
+ {
+ return ModSplatterballEarnedOtherFormat.Replace("%USERNAME%", username);
+ }
+ public static string FormatModSplatterBallAwardedYou(string username)
+ {
+ return ModSplatterballEarnedYouFormat.Replace("%USERNAME%", username);
+ }
+ public static string FormatThrownItemMessage(string itemFormat, string username)
+ {
+ return itemFormat.Replace("%USERNAME%", username);
+ }
+
+ // Tack Shop Giveaway
public static string FormatEventTackShopGiveawayEnd(string shopName, string townName)
{
return EventEndTackShopGiveawayFormat.Replace("%SHOPNAME%", shopName).Replace("%TOWN%", townName);
@@ -2617,9 +2635,9 @@ namespace HISP.Game
return InventoryItemFormat.Replace("%ICONID%", iconid.ToString()).Replace("%COUNT%", count.ToString()).Replace("%TITLE%", name);
}
- public static string FormatItemThrowButton(int randomid)
+ public static string FormatItemThrowButton(int itemId)
{
- return ItemThrowButton.Replace("%RANDOMID%", randomid.ToString());
+ return ItemThrowButton.Replace("%ITEMID%", itemId.ToString());
}
public static string FormatItemConsumeButton(int randomid)
{
diff --git a/Horse Isle Server/HorseIsleServer/Game/Meta.cs b/Horse Isle Server/HorseIsleServer/Game/Meta.cs
index fe6ded5..6562452 100755
--- a/Horse Isle Server/HorseIsleServer/Game/Meta.cs
+++ b/Horse Isle Server/HorseIsleServer/Game/Meta.cs
@@ -2180,7 +2180,7 @@ namespace HISP.Game
message += Messages.FormatItemConsumeButton(randomId);
if (Item.IsThrowable(itemInfo.Id))
- message += Messages.FormatItemThrowButton(randomId);
+ message += Messages.FormatItemThrowButton(itemInfo.Id);
message += Messages.FormatItemInformationButton(randomId);
message += Messages.R1;
diff --git a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs
index f25f7ec..945889c 100755
--- a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs
+++ b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs
@@ -232,13 +232,15 @@ namespace HISP.Server
Logger.DebugPrint("Registered Item ID: " + item.Id + " Name: " + item.Name + " spawns on: " + item.SpawnParamaters.SpawnOnTileType);
Item.Items.Add(item);
}
-
+ // Register Throwables
int totalThrowable = gameData.item.throwable.Count;
for (int i = 0; i < totalThrowable; i++)
{
Item.ThrowableItem throwableItem = new Item.ThrowableItem();
throwableItem.Id = gameData.item.throwable[i].id;
- throwableItem.Message = gameData.item.throwable[i].message;
+ throwableItem.HitMessage = gameData.item.throwable[i].message_hit;
+ throwableItem.ThrowMessage = gameData.item.throwable[i].message_throw;
+ throwableItem.HitYourselfMessage = gameData.item.throwable[i].message_hit_yourself;
Item.ThrowableItems.Add(throwableItem);
}
@@ -843,6 +845,7 @@ namespace HISP.Server
Item.FishingPole = gameData.item.special.fishing_poll;
Item.Earthworm = gameData.item.special.earthworm;
Item.BirthdayToken = gameData.item.special.birthday_token;
+ Item.ModSplatterball = gameData.item.special.mod_splatterball;
GameServer.IdleWarning = Convert.ToInt32(gameData.messages.disconnect.client_timeout.warn_after);
GameServer.IdleTimeout = Convert.ToInt32(gameData.messages.disconnect.client_timeout.kick_after);
@@ -894,8 +897,9 @@ namespace HISP.Server
Messages.OnlyUnicornCanWarp = gameData.messages.commands.warp.only_unicorn;
Messages.FailedToUnderstandLocation = gameData.messages.commands.warp.location_unknown;
- // Mod Isle
-
+ // Mod
+ Messages.ModSplatterballEarnedYouFormat = gameData.messages.mods_revenge.awarded_you;
+ Messages.ModSplatterballEarnedOtherFormat = gameData.messages.mods_revenge.awareded_others;
Messages.ModIsleMessage = gameData.messages.commands.mod_isle.message;
Map.ModIsleX = gameData.messages.commands.mod_isle.x;
Map.ModIsleY = gameData.messages.commands.mod_isle.y;
diff --git a/Horse Isle Server/HorseIsleServer/Server/GameServer.cs b/Horse Isle Server/HorseIsleServer/Server/GameServer.cs
index 29d0a7e..b8553dc 100755
--- a/Horse Isle Server/HorseIsleServer/Server/GameServer.cs
+++ b/Horse Isle Server/HorseIsleServer/Server/GameServer.cs
@@ -143,6 +143,11 @@ namespace HISP.Server
isle.Weather = isle.SelectRandomWeather();
}
}
+ }
+ // Water Balloon Game
+ if(totalMinutesElapsed % (60 * 2) == 0)
+ {
+
}
// Tack Shop Giveaway
if(totalMinutesElapsed % (60 * 3) == 0)
@@ -154,7 +159,7 @@ namespace HISP.Server
if(totalMinutesElapsed % 30 == 0)
{
RiddleEvent = RealTimeRiddle.GetRandomRiddle();
- RiddleEvent.StartEvent();
+ RiddleEvent.StartEvent();
}
// Real Time Quiz
if(totalMinutesElapsed % 75 == 0)
@@ -5851,6 +5856,74 @@ namespace HISP.Server
sender.SendPacket(itemRemovedMessage);
}
+ break;
+ case PacketBuilder.ITEM_THROW:
+ packetStr = Encoding.UTF8.GetString(packet);
+ string itemidStr = packetStr.Substring(2, packet.Length - 2);
+ int itemId = 0;
+
+ try
+ {
+ itemId = Int32.Parse(itemidStr);
+ }
+ catch (FormatException)
+ {
+ Logger.ErrorPrint(sender.LoggedinUser.Username + " Sent an invalid object interaction packet. (THROW)");
+ return;
+ }
+ if (sender.LoggedinUser.Inventory.HasItemId(itemId))
+ {
+ if (!Item.IsThrowable(itemId))
+ {
+ Logger.HackerPrint(sender.LoggedinUser.Username + " Tried to throw an item that isnt throwable.");
+ return;
+ }
+
+ ItemInstance curItem = sender.LoggedinUser.Inventory.GetItemByItemId(itemId).ItemInstances[0];
+ User[] userAt = GetUsersAt(sender.LoggedinUser.X, sender.LoggedinUser.Y, false, true);
+
+ while (true)
+ {
+ int userIndx = RandomNumberGenerator.Next(0, userAt.Length);
+
+ if (userAt.Length > 1)
+ if (userAt[userIndx].Id == sender.LoggedinUser.Id)
+ continue;
+
+ Item.ThrowableItem throwableItem = Item.GetThrowableItem(curItem.ItemId);
+
+ if (userAt[userIndx].Id == sender.LoggedinUser.Id)
+ {
+ byte[] thrownHitYourself = PacketBuilder.CreateChat(throwableItem.HitYourselfMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
+ sender.SendPacket(thrownHitYourself);
+ break;
+ }
+
+ if(itemId == Item.ModSplatterball)
+ {
+ byte[] otherEarned = PacketBuilder.CreateChat(Messages.FormatModSplatterBallAwardedOther(sender.LoggedinUser.Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
+ byte[] youEarned = PacketBuilder.CreateChat(Messages.FormatModSplatterBallAwardedYou(userAt[userIndx].Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
+
+ sender.LoggedinUser.Money += 50;
+ userAt[userIndx].Money += 500;
+
+ sender.SendPacket(youEarned);
+ userAt[userIndx].LoggedinClient.SendPacket(otherEarned);
+ }
+
+ byte[] thrownForYou = PacketBuilder.CreateChat(Messages.FormatThrownItemMessage(throwableItem.ThrowMessage, userAt[userIndx].Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
+ byte[] thrownForOthers = PacketBuilder.CreateChat(Messages.FormatThrownItemMessage(throwableItem.HitMessage, sender.LoggedinUser.Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
+
+ sender.SendPacket(thrownForYou);
+ userAt[userIndx].LoggedinClient.SendPacket(thrownForOthers);
+
+ break;
+ }
+
+ sender.LoggedinUser.Inventory.Remove(curItem);
+ UpdateInventory(sender);
+
+ }
break;
case PacketBuilder.ITEM_WRAP:
packetStr = Encoding.UTF8.GetString(packet);
@@ -6326,7 +6399,7 @@ namespace HISP.Server
}
InventoryItem invItem = sender.LoggedinUser.Inventory.GetItemByRandomid(randomId);
- int itemId = invItem.ItemId;
+ itemId = invItem.ItemId;
goto doSell;
case PacketBuilder.ITEM_SELL_ALL:
packetStr = Encoding.UTF8.GetString(packet);
diff --git a/Horse Isle Server/HorseIsleServer/Server/PacketBuilder.cs b/Horse Isle Server/HorseIsleServer/Server/PacketBuilder.cs
index a891335..3759332 100755
--- a/Horse Isle Server/HorseIsleServer/Server/PacketBuilder.cs
+++ b/Horse Isle Server/HorseIsleServer/Server/PacketBuilder.cs
@@ -206,6 +206,7 @@ namespace HISP.Server
public const byte ITEM_CONSUME = 0x51;
public const byte ITEM_DRINK = 0x52;
public const byte ITEM_BINOCULARS = 0x5C;
+ public const byte ITEM_THROW = 0x1F;
public const byte ITEM_MAGNIFYING = 0x5D;
public const byte ITEM_CRAFT = 0x64;
public const byte ITEM_USE = 0x5F;