Skip to content

Commit

Permalink
Change locale text to trinity string
Browse files Browse the repository at this point in the history
Change locale text to trinity string
  • Loading branch information
leelf00 committed Feb 8, 2023
1 parent bd59df9 commit 73008fa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- add wow token trinity string
DELETE FROM `trinity_string` WHERE `entry` IN (30007,30008,30009,30010);
INSERT INTO `trinity_string`(`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `content_loc9`, `content_loc10`, `content_loc11`, `content_female`, `content_female_loc1`, `content_female_loc2`, `content_female_loc3`, `content_female_loc4`, `content_female_loc5`, `content_female_loc6`, `content_female_loc7`, `content_female_loc8`, `content_female_loc9`, `content_female_loc10`, `content_female_loc11`) VALUES
(30007, 'Thanks for helping the Pandaria 5.4.8 project, you just received donate coins: %f', NULL, NULL, NULL, '感谢帮助 Pandaria 5.4.8 项目,你刚获得了%f代币.', '感謝幫助 Pandaria 5.4.8 項目,你剛獲得了%f代幣.', NULL, NULL, 'Спасибо за помощь проекту Pandaria 5.4.8, вы только что получили очков пожертвования: %f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(30008, 'You do not have the necessary token.', NULL, NULL, NULL, '你没有足够的代币.', '你沒有足夠的代幣.', NULL, NULL, 'У вас нет необходимого жетона.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(30009, 'You may not use this token whilst you are in combat or present in an arena or battleground.', NULL, NULL, NULL, '你无法在战斗中或者处于战场或竞技场中使用代币.', '你無法在戰鬥中或者處於戰場或競技場中使用代幣.', NULL, NULL, 'Вы не можете использовать этот жетон, пока находитесь в бою, на арене или поле боя.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(30010, 'Coins disabled.', NULL, NULL, NULL, '代币已禁用.', '代幣已禁用.', NULL, NULL, 'Жетоны отключены.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
20 changes: 11 additions & 9 deletions src/server/scripts/Custom/wow_token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
#include "DatabaseEnv.h"
#include "Chat.h"

#define GetText(a, b, c) a->GetSession()->GetSessionDbLocaleIndex() == LOCALE_ruRU ? b : c
enum BattlePayTokenTrinityStrings
{
BATTLEPAY_TOKEN_TRINITYSTRING_SUCCESS = 30007, // Thanks for helping the Pandaria 5.4.8 project, you just received donate coins: %f
BATTLEPAY_TOKEN_TRINITYSTRING_ERR_NOTENOUGH = 30008, // You do not have the necessary token.
BATTLEPAY_TOKEN_TRINITYSTRING_ERR_INBATTLE = 30009, // You may not use this token whilst you are in combat or present in an arena or battleground.
BATTLEPAY_TOKEN_TRINITYSTRING_ERR_DISABLED = 30010, // Coins disabled.
};

namespace BattlePay
{
Expand All @@ -43,11 +49,11 @@ class battle_pay_token : public ItemScript
{
if (player->IsInCombat() || player->InArena() || player->InBattleground())
{
player->GetSession()->SendNotification(GetText(player, "Вы не можете использовать этот жетон, пока находитесь в бою, на арене или поле боя.", "You may not use this token whilst you are in combat or present in an arena or battleground."));
ChatHandler(player->GetSession()).PSendSysMessage(player->GetSession()->GetTrinityString(BATTLEPAY_TOKEN_TRINITYSTRING_ERR_INBATTLE));
}
else if (!sWorld->getBoolConfig(CONFIG_WOW_TOKEN))
{
player->GetSession()->SendNotification(GetText(player, "Жетоны отключены.", "Coins disabled."));
ChatHandler(player->GetSession()).PSendSysMessage(player->GetSession()->GetTrinityString(BATTLEPAY_TOKEN_TRINITYSTRING_ERR_DISABLED));
player->CastSpell(player, 27880, true);
}
else
Expand All @@ -56,16 +62,12 @@ class battle_pay_token : public ItemScript
{
player->AddDonateTokenCount(Coins);
player->DestroyItemCount(item->GetEntry(), 1, true);

std::ostringstream coins_amount_message_ru, coins_amount_message_en;
coins_amount_message_ru << "Спасибо за помощь проекту Pandaria 5.4.8, вы только что получили очков пожертвования: " << Coins/10000;
coins_amount_message_en << "Thanks for helping the Pandaria 5.4.8 project, you just received donate coins: " << Coins/10000;
ChatHandler(player->GetSession()).SendSysMessage(GetText(player, coins_amount_message_ru.str().c_str(), coins_amount_message_en.str().c_str()));
ChatHandler(player->GetSession()).PSendSysMessage(player->GetSession()->GetTrinityString(BATTLEPAY_TOKEN_TRINITYSTRING_SUCCESS),Coins/10000);
player->SaveToDB();
}
else
{
ChatHandler(player->GetSession()).SendSysMessage(GetText(player, "У вас нет необходимого жетона.", "You do not have the necessary token."));
ChatHandler(player->GetSession()).SendNotification(player->GetSession()->GetTrinityString(BATTLEPAY_TOKEN_TRINITYSTRING_ERR_NOTENOUGH));
}
}
return true;
Expand Down

0 comments on commit 73008fa

Please sign in to comment.