mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-18 19:01:32 +12:00
Add !WARP
This commit is contained in:
parent
0222475f09
commit
b4c4a6c137
6 changed files with 90 additions and 3 deletions
|
@ -156,6 +156,12 @@
|
||||||
"mute_help":"Mute Channel Not Recognized. (ALL/ADS/GLOBAL/ISLAND/NEAR/HERE/BUDDY/PM/BR/SOCIALS/LOGINS)",
|
"mute_help":"Mute Channel Not Recognized. (ALL/ADS/GLOBAL/ISLAND/NEAR/HERE/BUDDY/PM/BR/SOCIALS/LOGINS)",
|
||||||
"player_command_completed":"<FONT COLOR='#FF0000'><B>PLAYER COMMAND [%COMMAND%] COMPLETED</B></FONT>",
|
"player_command_completed":"<FONT COLOR='#FF0000'><B>PLAYER COMMAND [%COMMAND%] COMPLETED</B></FONT>",
|
||||||
"admin_command_completed":"<FONT COLOR='#FF0000'><B>COMMAND [%COMMAND%]:</B></FONT>",
|
"admin_command_completed":"<FONT COLOR='#FF0000'><B>COMMAND [%COMMAND%]:</B></FONT>",
|
||||||
|
"warp":{
|
||||||
|
"player":"Unicorn Successfully Warped to Player",
|
||||||
|
"location":"Unicorn Successfully Warped to Location",
|
||||||
|
"only_unicorn":"Only a ridden unicorn can respond to such a request.",
|
||||||
|
"location_unknown":"Unicorn Failed to understand location or player name to warp to."
|
||||||
|
},
|
||||||
"mod_isle":{
|
"mod_isle":{
|
||||||
"x":165,
|
"x":165,
|
||||||
"y":465,
|
"y":465,
|
||||||
|
|
|
@ -102,6 +102,9 @@ namespace HISP.Game.Chat
|
||||||
|
|
||||||
else if (message.StartsWith("!MUTE"))
|
else if (message.StartsWith("!MUTE"))
|
||||||
return Command.Mute(message, args, user);
|
return Command.Mute(message, args, user);
|
||||||
|
else if (message.StartsWith("!WARP"))
|
||||||
|
return Command.Warp(message, args, user);
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,7 +222,6 @@ namespace HISP.Game.Chat
|
||||||
user.LoggedinClient.SendPacket(chatPacket);
|
user.LoggedinClient.SendPacket(chatPacket);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool Goto(string message, string[] args, User user)
|
public static bool Goto(string message, string[] args, User user)
|
||||||
{
|
{
|
||||||
if (args.Length <= 0)
|
if (args.Length <= 0)
|
||||||
|
@ -320,6 +319,73 @@ namespace HISP.Game.Chat
|
||||||
user.LoggedinClient.SendPacket(chatPacket);
|
user.LoggedinClient.SendPacket(chatPacket);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public static bool Warp(string message, string[] args, User user)
|
||||||
|
{
|
||||||
|
|
||||||
|
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message.Substring(1));
|
||||||
|
|
||||||
|
if (user.CurrentlyRidingHorse == null)
|
||||||
|
goto onlyRiddenUnicorn;
|
||||||
|
|
||||||
|
if (user.CurrentlyRidingHorse.Breed.Type == "unicorn")
|
||||||
|
goto doCommand;
|
||||||
|
|
||||||
|
goto onlyRiddenUnicorn;
|
||||||
|
|
||||||
|
onlyRiddenUnicorn:;
|
||||||
|
formattedmessage = Messages.OnlyUnicornCanWarp;
|
||||||
|
goto sendText;
|
||||||
|
|
||||||
|
|
||||||
|
cantUnderstandCommand:;
|
||||||
|
formattedmessage += Messages.FailedToUnderstandLocation;
|
||||||
|
goto sendText;
|
||||||
|
|
||||||
|
|
||||||
|
doCommand:;
|
||||||
|
if (args.Length <= 0)
|
||||||
|
{
|
||||||
|
goto cantUnderstandCommand;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (GameClient client in GameServer.ConnectedClients)
|
||||||
|
{
|
||||||
|
if (client.LoggedIn)
|
||||||
|
{
|
||||||
|
if(client.LoggedinUser.Username.ToLower().Contains(args[0].ToLower()))
|
||||||
|
{
|
||||||
|
user.Teleport(client.LoggedinUser.X, client.LoggedinUser.Y);
|
||||||
|
formattedmessage += Messages.SuccessfullyWarpedToPlayer;
|
||||||
|
goto playSwf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(World.Waypoint waypoint in World.Waypoints)
|
||||||
|
{
|
||||||
|
if(waypoint.Name.ToLower().Contains(args[0].ToLower()))
|
||||||
|
{
|
||||||
|
user.Teleport(waypoint.PosX, waypoint.PosY);
|
||||||
|
formattedmessage += Messages.SuccessfullyWarpedToLocation;
|
||||||
|
goto playSwf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
goto cantUnderstandCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
playSwf:;
|
||||||
|
byte[] swfPacket = PacketBuilder.CreateSwfModulePacket("warpcutscene", PacketBuilder.PACKET_SWF_CUTSCENE);
|
||||||
|
user.LoggedinClient.SendPacket(swfPacket);
|
||||||
|
|
||||||
|
|
||||||
|
sendText:;
|
||||||
|
byte[] chatPacket = PacketBuilder.CreateChat(formattedmessage, PacketBuilder.CHAT_BOTTOM_LEFT);
|
||||||
|
user.LoggedinClient.SendPacket(chatPacket);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public static bool Mute(string message, string[] args, User user)
|
public static bool Mute(string message, string[] args, User user)
|
||||||
|
|
|
@ -45,8 +45,8 @@ namespace HISP.Game.Horse
|
||||||
Color = breed.Colors[GameServer.RandomNumberGenerator.Next(0, breed.Colors.Length)];
|
Color = breed.Colors[GameServer.RandomNumberGenerator.Next(0, breed.Colors.Length)];
|
||||||
|
|
||||||
BasicStats = new HorseInfo.BasicStats(this, 1000, 0, 1000, 1000, 500, 1000, 1000, 0);
|
BasicStats = new HorseInfo.BasicStats(this, 1000, 0, 1000, 1000, 500, 1000, 1000, 0);
|
||||||
int inteligence = (GameServer.RandomNumberGenerator.Next(breed.BaseStats.Inteligence, breed.BaseStats.Inteligence * 2)) - breed.BaseStats.Inteligence;
|
int inteligence = (GameServer.RandomNumberGenerator.Next(breed.BaseStats.Inteligence, (breed.BaseStats.Inteligence * 2)-1) - breed.BaseStats.Inteligence);
|
||||||
int personality = (GameServer.RandomNumberGenerator.Next(breed.BaseStats.Personality, breed.BaseStats.Personality * 2)) - breed.BaseStats.Personality;
|
int personality = (GameServer.RandomNumberGenerator.Next(breed.BaseStats.Personality, (breed.BaseStats.Personality * 2)-1) - breed.BaseStats.Personality);
|
||||||
int height = GameServer.RandomNumberGenerator.Next(breed.BaseStats.MinHeight, breed.BaseStats.MaxHeight);
|
int height = GameServer.RandomNumberGenerator.Next(breed.BaseStats.MinHeight, breed.BaseStats.MaxHeight);
|
||||||
AdvancedStats = new HorseInfo.AdvancedStats(this, 0, 0, 0, 0, inteligence, 0, personality, height);
|
AdvancedStats = new HorseInfo.AdvancedStats(this, 0, 0, 0, 0, inteligence, 0, personality, height);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,11 @@ namespace HISP.Game
|
||||||
|
|
||||||
// Mod isle
|
// Mod isle
|
||||||
public static string ModIsleMessage;
|
public static string ModIsleMessage;
|
||||||
|
// Warp Command
|
||||||
|
public static string SuccessfullyWarpedToLocation;
|
||||||
|
public static string SuccessfullyWarpedToPlayer;
|
||||||
|
public static string OnlyUnicornCanWarp;
|
||||||
|
public static string FailedToUnderstandLocation;
|
||||||
|
|
||||||
// Click
|
// Click
|
||||||
public static string PlayerHereFormat;
|
public static string PlayerHereFormat;
|
||||||
|
@ -321,6 +326,7 @@ namespace HISP.Game
|
||||||
|
|
||||||
public static string AdminCommandFormat;
|
public static string AdminCommandFormat;
|
||||||
public static string PlayerCommandFormat;
|
public static string PlayerCommandFormat;
|
||||||
|
|
||||||
public static string MuteHelp;
|
public static string MuteHelp;
|
||||||
|
|
||||||
public static string GlobalChatFormatForModerators;
|
public static string GlobalChatFormatForModerators;
|
||||||
|
|
|
@ -810,6 +810,12 @@ namespace HISP.Server
|
||||||
Map.NewUserStartX = gameData.messages.new_user.starting_x;
|
Map.NewUserStartX = gameData.messages.new_user.starting_x;
|
||||||
Map.NewUserStartY = gameData.messages.new_user.starting_y;
|
Map.NewUserStartY = gameData.messages.new_user.starting_y;
|
||||||
|
|
||||||
|
// Warp Command
|
||||||
|
Messages.SuccessfullyWarpedToPlayer = gameData.messages.commands.warp.player;
|
||||||
|
Messages.SuccessfullyWarpedToLocation = gameData.messages.commands.warp.location;
|
||||||
|
Messages.OnlyUnicornCanWarp = gameData.messages.commands.warp.only_unicorn;
|
||||||
|
Messages.FailedToUnderstandLocation = gameData.messages.commands.warp.location_unknown;
|
||||||
|
|
||||||
// Mod Isle
|
// Mod Isle
|
||||||
Messages.ModIsleMessage = gameData.messages.commands.mod_isle.message;
|
Messages.ModIsleMessage = gameData.messages.commands.mod_isle.message;
|
||||||
Map.ModIsleX = gameData.messages.commands.mod_isle.x;
|
Map.ModIsleX = gameData.messages.commands.mod_isle.x;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue