Adjusted translation key text, added a new one for releasing both. Added

releaseBoth function
This commit is contained in:
Blade Barringer 2015-01-02 13:20:25 -06:00
parent 312aa11272
commit 0053dd67bd
2 changed files with 19 additions and 1 deletions

View file

@ -52,7 +52,8 @@
"petKeyInfo2": "The Key to the Kennels resets all of your non-quest pets back to as if you'd never found them. Once you've used it, you'll be able to stack the Beastmaster achievement, showing off how many times you've been able to best the RNG.",
"petKeyInfo3": "There are two sets of Keys: you can either just release your pets for four gems or your pets and mounts for eight gems. If you're still working towards getting all of the mounts, you may not want to give them their freedom yet!",
"petKeyPets": "Release My Pets",
"petKeyMounts": "Release Both Please",
"petKeyMounts": "Release My Mounts",
"petKeyBoth": "Release Both",
"petKeyNeverMind": "Not Yet",
"gemsEach": "gems each"
}

View file

@ -760,6 +760,23 @@ api.wrap = (user, main=true) ->
user.achievements.mountMasterCount++
cb? null, user
releaseBoth: (req, cb) ->
if user.balance < 1.5
return cb? {code:401,message: i18n.t('notEnoughGems', req.language)}
else
user.balance -= 1
user.items.currentMount = ""
for animal of content.pets
user.items.pets[animal] = 0
delete user.items.mounts[animal]
if not user.achievements.beastMasterCount
user.achievements.beastMasterCount = 0
user.achievements.beastMasterCount++
if not user.achievements.mountMasterCount
user.achievements.mountMasterCount = 0
user.achievements.mountMasterCount++
cb? null, user
# buy is for gear, purchase is for gem-purchaseables (i know, I know...)
buy: (req, cb) ->
{key} = req.params