Skip to content

Commit

Permalink
moved almost every text from playercommands into language file.
Browse files Browse the repository at this point in the history
Added zone translation into /who command.
  • Loading branch information
Mavcraft authored and NetDwarf committed Dec 5, 2022
1 parent adba83c commit ae5f734
Show file tree
Hide file tree
Showing 53 changed files with 809 additions and 408 deletions.
17 changes: 9 additions & 8 deletions GameServer/commands/playercommands/Formation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
*/
using DOL.GS.PacketHandler;
using DOL.Language;

namespace DOL.GS.Commands
{
Expand All @@ -36,24 +37,24 @@ public void OnCommand(GameClient client, string[] args)
//No one else needs to use this spell
if (player.CharacterClass.ID != (int)eCharacterClass.Bonedancer)
{
client.Out.SendMessage("Only Bonedancers can use this command!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Formation.BonedancerOnly"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}

//Help display
if (args.Length == 1)
{
client.Out.SendMessage("Formation commands:", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage("'/formation triangle' Place the pets in a triangle formation.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage("'/formation line' Place the pets in a line formation.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage("'/formation protect' Place the pets in a protect formation that surrounds the commander.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Formation.Commands"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Formation.Triangle"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Formation.Line"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Formation.Protect"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}

//Check to see if the BD has a commander and minions
if (player.ControlledBrain == null)
{
client.Out.SendMessage("You don't have a commander!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Formation.NoCommander"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
bool haveminion = false;
Expand All @@ -67,7 +68,7 @@ public void OnCommand(GameClient client, string[] args)
}
if (!haveminion)
{
client.Out.SendMessage("You don't have any minions!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Formation.NoMinions"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}

Expand All @@ -86,7 +87,7 @@ public void OnCommand(GameClient client, string[] args)
player.ControlledBrain.Body.Formation = GameNPC.eFormationType.Protect;
break;
default:
client.Out.SendMessage("Unrecognized argument: " + args[1], eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Formation.Unrecognized", args[1]), eChatType.CT_System, eChatLoc.CL_SystemWindow);
break;
}
}
Expand Down
9 changes: 5 additions & 4 deletions GameServer/commands/playercommands/GroundAssist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
*/
using DOL.GS.PacketHandler;
using DOL.Language;

namespace DOL.GS.Commands
{
Expand All @@ -38,15 +39,15 @@ public void OnCommand(GameClient client, string[] args)
myclient = WorldMgr.GetClientByPlayerName(args[1], true, true);
if (myclient == null)
{
client.Player.Out.SendMessage("No player with this name in game.", eChatType.CT_Say, eChatLoc.CL_SystemWindow);
client.Player.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Groundassist.NoPlayer"), eChatType.CT_Say, eChatLoc.CL_SystemWindow);
return;
}
target = myclient.Player;
}

if (target == client.Player)
{
client.Out.SendMessage("You can't groundassist yourself.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Groundassist.Yourself"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}

Expand All @@ -59,13 +60,13 @@ public void OnCommand(GameClient client, string[] args)

if (!client.Player.IsWithinRadius( target, 2048 ))
{
client.Out.SendMessage("You don't see " + args[1] + " around here!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Groundassist.NotAround", args[1]), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}

if (target.GroundTarget == null || (target.GroundTarget.X == 0 && target.GroundTarget.Y == 0 && target.GroundTarget.Z == 0))
{
client.Out.SendMessage(target.Name + " doesn't currently have a ground target.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Groundassist.NoTarget", target.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
client.Player.Out.SendChangeGroundTarget(target.GroundTarget);
Expand Down
3 changes: 2 additions & 1 deletion GameServer/commands/playercommands/QuestCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

using DOL.GS.Quests;
using DOL.Language;

namespace DOL.GS.Commands
{
Expand Down Expand Up @@ -69,7 +70,7 @@ public void OnCommand(GameClient client, string[] args)

if (searched == false)
{
player.Out.SendMessage("You can't do that here!", DOL.GS.PacketHandler.eChatType.CT_Important, DOL.GS.PacketHandler.eChatLoc.CL_SystemWindow);
player.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Questcommands.Cannot"), PacketHandler.eChatType.CT_Important, PacketHandler.eChatLoc.CL_SystemWindow);
}
}
}
Expand Down
37 changes: 19 additions & 18 deletions GameServer/commands/playercommands/Repair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System;
using DOL.Database;
using DOL.GS.Keeps;
using DOL.Language;

namespace DOL.GS.Commands
{
Expand Down Expand Up @@ -72,76 +73,76 @@ public bool PreFireChecks(GamePlayer player, GameLiving obj)
if (player.Client.Account.PrivLevel > (int)ePrivLevel.Player)
return true;

if ((obj as GameLiving).InCombat)
if (obj.InCombat)
{
DisplayMessage(player, "You can't repair object while it is under attack!");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.ObjectAttack"));
return false;
}
if (obj is GameKeepDoor)
{
GameKeepDoor doorcomponent = obj as GameKeepDoor;
if (doorcomponent.Component.Keep.InCombat)
{
DisplayMessage(player, "You can't repair the keep door while keep is under attack!");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.DoorAttack"));
return false;
}
}
if (obj is IKeepItem)
{
if (obj.CurrentRegion.Time - obj.LastAttackedByEnemyTick <= 60 * 1000)
{
DisplayMessage(player, "You can't repair the keep component while it is under attack!");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.CompAttack"));
return false;
}
}

if ((obj as GameLiving).HealthPercent == 100)
if (obj.HealthPercent == 100)
{
DisplayMessage(player, "The component is already at full health!");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.Full"));
return false;
}
if (obj is GameKeepComponent)
{
GameKeepComponent component = obj as GameKeepComponent;
if (component.IsRaized)
{
DisplayMessage(player, "You cannot repair a raized tower!");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.Raized"));
return false;
}
}

if (player.IsCrafting)
{
DisplayMessage(player, "You must end your current action before you repair anything!");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.EndAction"));
return false;
}
if (player.IsMoving)
{
DisplayMessage(player, "You can't repair while moving");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.Moving"));
return false;
}

if (!player.IsAlive)
{
DisplayMessage(player, "You can't repair while dead.");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.Dead"));
return false;
}

if (player.IsSitting)
{
DisplayMessage(player, "You can't repair while sitting.");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.Sitting"));
return false;
}

if (player.InCombat)
{
DisplayMessage(player, "You can't repair while in combat.");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.Combat"));
return false;
}

if (!player.IsWithinRadius(obj, WorldMgr.INTERACT_DISTANCE))
{
DisplayMessage(player, "You are too far away to repair this component.");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.TooFar"));
return false;
}

Expand All @@ -150,13 +151,13 @@ public bool PreFireChecks(GamePlayer player, GameLiving obj)

if (playerswood < repairamount)
{
DisplayMessage(player, "You need another " + (repairamount - playerswood) + " units of wood!");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.MoreWood", repairamount - playerswood));
return false;
}

if (player.GetCraftingSkillValue(eCraftingSkill.WoodWorking) < 1)
{
DisplayMessage(player, "You need woodworking skill to repair.");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.MissingSkill"));
return false;
}

Expand All @@ -168,7 +169,7 @@ public bool PreFireChecks(GamePlayer player, GameLiving obj)
static int workDuration = 20;
public void StartRepair(GamePlayer player, GameLiving obj)
{
player.Out.SendTimerWindow("Repairing: " + obj.Name, workDuration);
player.Out.SendTimerWindow(LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.MissingSkill", obj.Name), workDuration);
player.CraftTimer = new RegionTimer(player);
player.CraftTimer.Callback = new RegionTimerCallback(Proceed);
player.CraftTimer.Properties.setProperty("repair_player", player);
Expand Down Expand Up @@ -214,7 +215,7 @@ protected int Proceed(RegionTimer timer)
}
int finish = obj.HealthPercent;
CalculatePlayersWood(player, (GetTotalWoodForLevel(obj.Level + 1)));
DisplayMessage(player, "You successfully repair the component by 15%!");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.Success"));
/*
* - Realm points will now be awarded for successfully repairing a door or outpost piece.
* Players will receive approximately 10% of the amount repaired in realm points.
Expand All @@ -226,7 +227,7 @@ protected int Proceed(RegionTimer timer)
}
else
{
DisplayMessage(player, "You fail to repair the component!");
DisplayMessage(player, LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Repair.Fail"));
}

return 0;
Expand Down
6 changes: 3 additions & 3 deletions GameServer/commands/playercommands/advice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void OnCommand(GameClient client, string[] args)
{
if (client.Player.IsMuted)
{
client.Player.Out.SendMessage("You have been muted and are not allowed to speak in this channel.", eChatType.CT_Staff, eChatLoc.CL_SystemWindow);
client.Player.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Advice.Muted"), eChatType.CT_Staff, eChatLoc.CL_SystemWindow);
return;
}

Expand Down Expand Up @@ -65,7 +65,7 @@ public void OnCommand(GameClient client, string[] args)
}

}
client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Advice.AdvicersOn", total), eChatType.CT_System, eChatLoc.CL_PopupWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Advice.AdvicersOn", total), eChatType.CT_System, eChatLoc.CL_PopupWindow);
return;
}
foreach (GameClient playerClient in WorldMgr.GetAllClients())
Expand All @@ -74,7 +74,7 @@ public void OnCommand(GameClient client, string[] args)
if ((playerClient.Player.Advisor &&
playerClient.Player.Realm == client.Player.Realm) ||
playerClient.Account.PrivLevel > 1)
playerClient.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Advice.Advice", getRealmString(client.Player.Realm), client.Player.Name, msg), eChatType.CT_Staff, eChatLoc.CL_ChatWindow);
playerClient.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Advice.Advice", getRealmString(client.Player.Realm), client.Player.Name, msg), eChatType.CT_Staff, eChatLoc.CL_ChatWindow);

}
}
Expand Down
6 changes: 3 additions & 3 deletions GameServer/commands/playercommands/advisor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public void OnCommand(GameClient client, string[] args)
{
if (client.Player.IsMuted)
{
client.Player.Out.SendMessage("You have been muted and are not allowed to speak in this channel.", eChatType.CT_Staff, eChatLoc.CL_SystemWindow);
client.Player.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Advice.Muted"), eChatType.CT_Staff, eChatLoc.CL_SystemWindow);
return;
}

client.Player.Advisor = !client.Player.Advisor;
if (client.Player.Advisor)
DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Advisor.On"));
DisplayMessage(client, LanguageMgr.GetTranslation(client, "Scripts.Players.Advisor.On"));
else
DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Advisor.Off"));
DisplayMessage(client, LanguageMgr.GetTranslation(client, "Scripts.Players.Advisor.Off"));
}
}
}
9 changes: 5 additions & 4 deletions GameServer/commands/playercommands/cloak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
*/
using DOL.GS.PacketHandler;
using DOL.Language;


namespace DOL.GS.Commands
Expand Down Expand Up @@ -50,12 +51,12 @@ public void OnCommand(GameClient client, string[] args)
if(client.Player.IsCloakInvisible)
{
client.Player.IsCloakInvisible = false;
client.Out.SendMessage("Your cloak will no longer be hidden from view.", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Cloak.Visible"), eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
return;
}
else
{
client.Out.SendMessage("Your cloak is already visible.", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Cloak.AlreadyVisible"), eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
return;
}
}
Expand All @@ -64,13 +65,13 @@ public void OnCommand(GameClient client, string[] args)
{
if (client.Player.IsCloakInvisible)
{
client.Out.SendMessage("Your cloak is already invisible.", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Cloak.AlreadyInvisible"), eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
return;
}
else
{
client.Player.IsCloakInvisible = true;
client.Out.SendMessage("Your cloak will now be hidden from view.", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Cloak.Invisible"), eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
return;
}
}
Expand Down
16 changes: 9 additions & 7 deletions GameServer/commands/playercommands/emote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
*/
using DOL.GS.PacketHandler;
using DOL.Language;

namespace DOL.GS.Commands
{
Expand All @@ -43,27 +44,25 @@ public void OnCommand(GameClient client, string[] args)
// no emotes if dead
if (!client.Player.IsAlive)
{
client.Out.SendMessage("You can't emote while dead!", eChatType.CT_Emote, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Emote.Dead"), eChatType.CT_Emote, eChatLoc.CL_SystemWindow);
return;
}

if (args.Length < 2)
{
client.Out.SendMessage("You need something to emote.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Emote.Missing"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}

if (client.Player.IsMuted)
{
client.Player.Out.SendMessage("You have been muted and cannot emote!", eChatType.CT_Staff, eChatLoc.CL_SystemWindow);
client.Player.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Emote.Muted"), eChatType.CT_Staff, eChatLoc.CL_SystemWindow);
return;
}

string ownRealm = string.Join(" ", args, 1, args.Length - 1);
ownRealm = "<" + client.Player.Name + " " + ownRealm + " >";

string diffRealm = "<" + client.Player.Name + " makes strange motions.>";

foreach (GamePlayer player in client.Player.GetPlayersInRadius(WorldMgr.SAY_DISTANCE))
{
if (GameServer.ServerRules.IsAllowedToUnderstand(client.Player, player))
Expand All @@ -72,8 +71,11 @@ public void OnCommand(GameClient client, string[] args)
}
else
{
if (!player.IsIgnoring(client.Player as GameLiving))
player.Out.SendMessage(diffRealm, eChatType.CT_Emote, eChatLoc.CL_ChatWindow);
if (!player.IsIgnoring(client.Player as GameLiving))
{
string diffRealm = LanguageMgr.GetTranslation(player.Client, "Scripts.Players.Emote.OtherRealm", client.Player.Name);
player.Out.SendMessage(diffRealm, eChatType.CT_Emote, eChatLoc.CL_ChatWindow);
}
}
}
}
Expand Down
Loading

0 comments on commit ae5f734

Please sign in to comment.