mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Translation support for a lot of messages in party
This commit is contained in:
@@ -422,7 +422,11 @@ api.abortQuest = {
|
||||
if (user._id !== group.leader && user._id !== group.quest.leader) throw new NotAuthorized(res.t('onlyLeaderAbortQuest'));
|
||||
|
||||
let questName = questScrolls[group.quest.key].text('en');
|
||||
group.sendChat(`\`${user.profile.name} aborted the party quest ${questName}.\``);
|
||||
group.sendChat(`\`${user.profile.name} aborted the party quest ${questName}.\``, null, null, {
|
||||
'type': 'quest_abort',
|
||||
'user': user._id,
|
||||
'quest': group.quest.key,
|
||||
});
|
||||
|
||||
let memberUpdates = User.update({
|
||||
'party._id': groupId,
|
||||
|
||||
@@ -735,7 +735,22 @@ api.castSpell = {
|
||||
|
||||
if (party && !spell.silent) {
|
||||
let message = `\`${user.profile.name} casts ${spell.text()}${targetType === 'user' ? ` on ${partyMembers.profile.name}` : ' for the party'}.\``;
|
||||
party.sendChat(message);
|
||||
if (targetType === 'user') {
|
||||
party.sendChat(message, null, null, {
|
||||
'type': 'spell_cast_user',
|
||||
'user': user._id,
|
||||
'class': klass,
|
||||
'spell': spellId,
|
||||
'target': partyMember._id,
|
||||
});
|
||||
} else {
|
||||
party.sendChat(message, null, null, {
|
||||
'type': 'spell_cast_party',
|
||||
'user': user._id,
|
||||
'class': klass,
|
||||
'spell': spellId,
|
||||
});
|
||||
}
|
||||
await party.save();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user