Add rules and modhorse command

This commit is contained in:
Bluzume 2021-11-05 00:13:02 -04:00
parent 9031367be4
commit 6c70fe597c
6 changed files with 111 additions and 2 deletions

@ -1 +1 @@
Subproject commit 1f9bc06a178dc61964b989a44231c263cdd4edbb
Subproject commit d4d232ee45a8e3714a5f96904500f6a7cfada566

View file

@ -100,6 +100,8 @@ namespace HISP.Game.Chat
return Command.Kick(message, args, user);
if (message.ToUpper().StartsWith("%RULES"))
return Command.Rules(message, args, user);
if (message.ToUpper().StartsWith("%PRISON"))
return Command.Prision(message, args, user);
if (message.ToUpper().StartsWith("%NOCLIP"))
return Command.NoClip(message, args, user);
if (message.ToUpper().StartsWith("%STEALTH"))
@ -110,6 +112,8 @@ namespace HISP.Game.Chat
return Command.UnBan(message, args, user);
if (message.ToUpper().StartsWith("%ESCAPE"))
return Command.Escape(message, args, user);
if (message.ToUpper().StartsWith("%MODHORSE"))
return Command.ModHorse(message, args, user);
if (message.ToUpper().StartsWith("%CALL HORSE"))
return Command.CallHorse(message, args, user);
return false;

View file

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using HISP.Game.Events;
using HISP.Game.Horse;
using System.Linq;
namespace HISP.Game.Chat
{
@ -264,6 +265,31 @@ namespace HISP.Game.Chat
return true;
}
public static bool Prision(string message, string[] args, User user)
{
if (!(user.Administrator || user.Moderator))
return false;
if (args.Length <= 0)
return false;
try
{
User toSend = GameServer.GetUserByName(args[0]);
toSend.Teleport(Map.PrisonIsleX, Map.PrisonIsleY);
byte[] dontDoTheTime = PacketBuilder.CreateChat(Messages.PrisonIsleSentMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
toSend.LoggedinClient.SendPacket(dontDoTheTime);
}
catch (KeyNotFoundException)
{
return false;
}
byte[] chatPacket = PacketBuilder.CreateChat(Messages.FormatAdminCommandCompleteMessage(message.Substring(1)) + Messages.FormatPrisonCommandMessage(args[0]), PacketBuilder.CHAT_BOTTOM_LEFT);
user.LoggedinClient.SendPacket(chatPacket);
return true;
}
public static bool Kick(string message, string[] args, User user)
{
if (!(user.Administrator || user.Moderator))
@ -421,6 +447,65 @@ namespace HISP.Game.Chat
return true;
}
public static bool ModHorse(string message, string[] args, User user)
{
if (!user.Administrator)
return false;
if (args.Length < 3)
return false;
HorseInstance[] instances = user.HorseInventory.HorseList.OrderBy(o => o.Name).ToArray();
int id = 0;
int amount = 0;
try
{
id = int.Parse(args[0]);
amount = int.Parse(args[2]);
}
catch (Exception)
{
return false;
}
if (id < 0 && id > instances.Length)
return false;
switch (args[1].ToUpper())
{
case "INTELIGENCE":
instances[id].AdvancedStats.Inteligence = amount;
break;
case "PERSONALITY":
instances[id].AdvancedStats.Personality = amount;
break;
case "EXPERIENCE":
instances[id].BasicStats.Experience = amount;
break;
case "SPEED":
instances[id].AdvancedStats.Speed = amount;
break;
case "STRENGTH":
instances[id].AdvancedStats.Strength = amount;
break;
case "CONFORMATION":
instances[id].AdvancedStats.Conformation = amount;
break;
case "ENDURANCE":
instances[id].AdvancedStats.Endurance = amount;
break;
case "AGILITY":
instances[id].AdvancedStats.Agility = amount;
break;
}
byte[] chatPacket = PacketBuilder.CreateChat(Messages.FormatAdminCommandCompleteMessage(message.Substring(1)), PacketBuilder.CHAT_BOTTOM_LEFT);
user.LoggedinClient.SendPacket(chatPacket);
return true;
}
public static bool Warp(string message, string[] args, User user)
{

View file

@ -32,6 +32,9 @@ namespace HISP.Game
public static int RulesIsleX;
public static int RulesIsleY;
public static int PrisonIsleX;
public static int PrisonIsleY;
public static int GetTileId(int x, int y, bool overlay)
{
int pos = ((x * Height) + y);

View file

@ -17,6 +17,10 @@ namespace HISP.Game
public static string PlaytimeMessageFormat;
public static string[] RngMessages;
// Prision Isle
public static string PrisonIsleSentMessage;
public static string PrisonIsleCommandMessageFormat;
// Rules Isle
public static string RulesIsleSentMessage;
public static string RulesIsleCommandMessageFormat;
@ -1298,6 +1302,12 @@ namespace HISP.Game
return EventWonRealTimeRiddleForYouFormat.Replace("%PRIZE%", prize.ToString("N0", CultureInfo.InvariantCulture));
}
// Prison Command
public static string FormatPrisonCommandMessage(string username)
{
return PrisonIsleCommandMessageFormat.Replace("%USERNAME%", username.ToUpper());
}
// Rules Command
public static string FormatRulesCommandMessage(string username)
{

View file

@ -963,7 +963,7 @@ namespace HISP.Server
Messages.OnlyUnicornCanWarp = gameData.messages.commands.warp.only_unicorn;
Messages.FailedToUnderstandLocation = gameData.messages.commands.warp.location_unknown;
// Mod
// Mod Isle
Messages.ModSplatterballEarnedYouFormat = gameData.messages.mods_revenge.awarded_you;
Messages.ModSplatterballEarnedOtherFormat = gameData.messages.mods_revenge.awareded_others;
Messages.ModIsleMessage = gameData.messages.commands.mod_isle.message;
@ -976,6 +976,13 @@ namespace HISP.Server
Messages.RulesIsleSentMessage = gameData.messages.commands.rules_isle.message;
Messages.RulesIsleCommandMessageFormat = gameData.messages.commands.rules_isle.command_msg;
// Prison Isle
Map.PrisonIsleX = gameData.messages.commands.prison_isle.x;
Map.PrisonIsleY = gameData.messages.commands.prison_isle.y;
Messages.PrisonIsleSentMessage = gameData.messages.commands.prison_isle.message;
Messages.PrisonIsleCommandMessageFormat = gameData.messages.commands.prison_isle.command_msg;
// Tag
Messages.TagYourItFormat = gameData.messages.meta.player_interaction.tag.tag_player;