Adding translations to the module (#35)

* Adding translations to the module

* Update enum
This commit is contained in:
Walter Pagani
2023-06-15 20:19:40 -03:00
committed by GitHub
parent fd4357d1ce
commit 07dd4b3c7b
15 changed files with 59 additions and 47 deletions

10
.gitattributes vendored
View File

@@ -35,16 +35,16 @@
## For documentation
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
# Graphics

View File

View File

@@ -1,26 +1,33 @@
[worldserver]
#
# IndividualXp.Enabled
# IndividualXp.Enabled
# Description: Enable or Disable the IndividualXP Module.
# Default: IndividualXp.Enabled = 1
#
IndividualXp.Enabled = 1
#
# IndividualXp.Announce
# IndividualXp.Announce
# Description: Announce the IndividualXP Module at logon.
# Default: IndividualXp.Announce = 1
#
IndividualXp.Announce = 1
#
# MaxXPRate
# MaxXPRate
# Description: This is the max amount a player can set their xp to.
# Default: Default = 1
#
MaxXPRate = 10
#
# DefaultXPRate
# Description: This is the default rate players start with.
# Default: Default = 1
#
MaxXPRate = 10
DefaultXPRate = 1

View File

@@ -1,13 +0,0 @@
#!/usr/bin/env bash
#
# CUSTOM
#
DB_CHARACTERS_CUSTOM_PATHS+=(
$MOD_INDIVIDUAL_XP_ROOT"/sql/characters/"
)
DB_WORLD_CUSTOM_PATHS+=(
$MOD_INDIVIDUAL_XP_ROOT"/sql/world/"
)

View File

View File

View File

View File

View File

@@ -1,4 +1,4 @@
DELETE FROM `command` WHERE name IN ('xp', 'xp set', 'xp view', 'xp default', 'xp enable', 'xp disable');
DELETE FROM `command` WHERE `name` IN ('xp', 'xp set', 'xp view', 'xp default', 'xp enable', 'xp disable');
INSERT INTO `command` (`name`, `security`, `help`) VALUES
('xp', 0, 'Syntax: .xp $subcommand\nType .help xp to see a list of subcommands\nor .help xp $subcommand to see info on the subcommand.'),

View File

View File

@@ -0,0 +1,13 @@
SET @ENTRY:=35411;
DELETE FROM `acore_string` WHERE `entry` BETWEEN @ENTRY+0 AND @ENTRY+9;
INSERT INTO `acore_string` (`entry`, `content_default`, `locale_koKR`, `locale_frFR`, `locale_deDE`, `locale_zhCN`, `locale_zhTW`, `locale_esES`, `locale_esMX`, `locale_ruRU`) VALUES
(@ENTRY+0, 'This server is running the |cff4CFF00IndividualXpRate |rmodule.', '', '', '', '', '', 'Este servidor está ejecutando el módulo |cff4CFF00 mod-individual-xp.', 'Este servidor está ejecutando el módulo |cff4CFF00 mod-individual-xp.', ''),
(@ENTRY+1, '[XP] The Individual XP module is deactivated.', '', '', '', '', '', '[XP] El módulo XP individual está desactivado.', '[XP] El módulo XP individual está desactivado.', ''),
(@ENTRY+2, '[XP] Your Individual XP is currently disabled. Use .xp enable to re-enable it.', '', '', '', '', '', '[XP] Su XP individual está actualmente desactivado. Utilice .xp enable para volver a activarlo.', '[XP] Su XP individual está actualmente desactivado. Utilice .xp enable para volver a activarlo.', ''),
(@ENTRY+3, '[XP] Your current XP rate is %u.', '', '', '', '', '', '[XP] Su experiencia actual es %u.', '[XP] su experiencia actual es %u.', ''),
(@ENTRY+4, '[XP] The maximum rate limit is %u.', '', '', '', '', '', '[XP] El límite máximo de XP es %u.', '[XP] El límite máximo de XP es %u.', ''),
(@ENTRY+5, '[XP] The minimum rate limit is 1.', '', '', '', '', '', '[XP] El límite mínimo de XP es 1.', '[XP] El límite mínimo de XP es 1.', ''),
(@ENTRY+6, '[XP] You have updated your XP rate to %u.', '', '', '', '', '', '[XP] Has actualizado tu XP a %u', '[XP] Has actualizado tu XP a %u', ''),
(@ENTRY+7, '[XP] You have disabled your XP gain.', '', '', '', '', '', '[XP] Has desactivado tu ganancia de XP.', '[XP] Has desactivado tu ganancia de XP.', ''),
(@ENTRY+8, '[XP] You have enabled your XP gain.', '', '', '', '', '', '[XP] Has activado tu ganancia de XP.', '[XP] Has activado tu ganancia de XP.', ''),
(@ENTRY+9, '[XP] You have restored your XP rate to the default value of %u.', '', '', '', '', '', '[XP] Has restaurado tu tasa de XP al valor por defecto de %u.', '[XP] Has restaurado tu tasa de XP al valor por defecto de %u.', '');

View File

@@ -1,9 +0,0 @@
#!/usr/bin/env bash
MOD_INDIVIDUAL_XP_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" && pwd )"
source $MOD_INDIVIDUAL_XP_ROOT"/conf/conf.sh.dist"
if [ -f $MOD_INDIVIDUAL_XP_ROOT"/conf/conf.sh" ]; then
source $MOD_INDIVIDUAL_XP_ROOT"/conf/conf.sh"
fi

View File

@@ -36,6 +36,20 @@ public:
}
};
enum IndividualXP
{
ACORE_STRING_CREDIT = 35411,
ACORE_STRING_MODULE_DISABLED,
ACORE_STRING_RATES_DISABLED,
ACORE_STRING_COMMAND_VIEW,
ACORE_STRING_MAX_RATE,
ACORE_STRING_MIN_RATE,
ACORE_STRING_COMMAND_SET,
ACORE_STRING_COMMAND_DISABLED,
ACORE_STRING_COMMAND_ENABLED,
ACORE_STRING_COMMAND_DEFAULT
};
class Individual_Xp_Announce : public PlayerScript
{
public:
@@ -47,7 +61,7 @@ public:
// Announce Module
if (IndividualXpEnabled & IndividualXpAnnounceModule)
{
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00IndividualXpRate |rmodule");
ChatHandler(player->GetSession()).SendSysMessage(ACORE_STRING_CREDIT);
}
}
};
@@ -126,7 +140,7 @@ public:
{
if (!IndividualXpEnabled)
{
handler->PSendSysMessage("[XP] The Individual XP module is deactivated.");
handler->PSendSysMessage(ACORE_STRING_MODULE_DISABLED);
handler->SetSentErrorMessage(true);
return false;
}
@@ -141,7 +155,7 @@ public:
{
if (!IndividualXpEnabled)
{
handler->PSendSysMessage("[XP] The Individual XP module is deactivated.");
handler->PSendSysMessage(ACORE_STRING_MODULE_DISABLED);
handler->SetSentErrorMessage(true);
return false;
}
@@ -152,13 +166,13 @@ public:
if (me->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN))
{
handler->PSendSysMessage("[XP] Your Individual XP is currently disabled. Use .xp enable to re-enable it.");
handler->PSendSysMessage(ACORE_STRING_RATES_DISABLED);
handler->SetSentErrorMessage(true);
return false;
}
else
{
me->GetSession()->SendAreaTriggerMessage("Your current XP rate is %u", me->CustomData.GetDefault<PlayerXpRate>("Individual_XP")->XPRate);
me->GetSession()->SendAreaTriggerMessage(ACORE_STRING_COMMAND_VIEW, me->CustomData.GetDefault<PlayerXpRate>("Individual_XP")->XPRate);
}
return true;
}
@@ -168,7 +182,7 @@ public:
{
if (!IndividualXpEnabled)
{
handler->PSendSysMessage("[XP] The Individual XP module is deactivated.");
handler->PSendSysMessage(ACORE_STRING_MODULE_DISABLED);
handler->SetSentErrorMessage(true);
return false;
}
@@ -183,19 +197,19 @@ public:
uint32 rate = (uint32)atol(args);
if (rate > MaxRate)
{
handler->PSendSysMessage("[XP] The maximum rate limit is %u.", MaxRate);
handler->PSendSysMessage(ACORE_STRING_MAX_RATE, MaxRate);
handler->SetSentErrorMessage(true);
return false;
}
else if (rate == 0)
{
handler->PSendSysMessage("[XP] The minimum rate limit is 1.");
handler->PSendSysMessage(ACORE_STRING_MIN_RATE);
handler->SetSentErrorMessage(true);
return false;
}
me->CustomData.GetDefault<PlayerXpRate>("Individual_XP")->XPRate = rate;
me->GetSession()->SendAreaTriggerMessage("You have updated your XP rate to %u", rate);
me->GetSession()->SendAreaTriggerMessage(ACORE_STRING_COMMAND_SET, rate);
return true;
}
@@ -204,7 +218,7 @@ public:
{
if (!IndividualXpEnabled)
{
handler->PSendSysMessage("[XP] The Individual XP module is deactivated.");
handler->PSendSysMessage(ACORE_STRING_MODULE_DISABLED);
handler->SetSentErrorMessage(true);
return false;
}
@@ -215,7 +229,7 @@ public:
// Turn Disabled On But Don't Change Value...
me->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
me->GetSession()->SendAreaTriggerMessage("You have disabled your XP gain.");
me->GetSession()->SendAreaTriggerMessage(ACORE_STRING_COMMAND_DISABLED);
return true;
}
@@ -224,7 +238,7 @@ public:
{
if (!IndividualXpEnabled)
{
handler->PSendSysMessage("[XP] The Individual XP module is deactivated.");
handler->PSendSysMessage(ACORE_STRING_MODULE_DISABLED);
handler->SetSentErrorMessage(true);
return false;
}
@@ -234,7 +248,7 @@ public:
return false;
me->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
me->GetSession()->SendAreaTriggerMessage("You have enabled your XP gain.");
me->GetSession()->SendAreaTriggerMessage(ACORE_STRING_COMMAND_ENABLED);
return true;
}
@@ -243,7 +257,7 @@ public:
{
if (!IndividualXpEnabled)
{
handler->PSendSysMessage("[XP] The Individual XP module is deactivated.");
handler->PSendSysMessage(ACORE_STRING_MODULE_DISABLED);
handler->SetSentErrorMessage(true);
return false;
}
@@ -253,7 +267,7 @@ public:
return false;
me->CustomData.GetDefault<PlayerXpRate>("Individual_XP")->XPRate = DefaultRate;
me->GetSession()->SendAreaTriggerMessage("You have restored your XP rate to the default value of %u", DefaultRate);
me->GetSession()->SendAreaTriggerMessage(ACORE_STRING_COMMAND_DEFAULT, DefaultRate);
return true;
}
};