오윤석

Merge branch 'develop'

1 axios = require('axios'); 1 axios = require('axios');
2 2
3 -const crwalCharacterCode = async function(nickname) { 3 +const crwalCharacterCode = async function(nickname, isReboot = false) {
4 try { 4 try {
5 - const resp = await axios.get("https://maplestory.nexon.com/Ranking/World/Total?c=" + encodeURI(nickname)); 5 + const resp = await axios.get("https://maplestory.nexon.com/Ranking/World/Total?c=" + encodeURI(nickname) + "&w=" + (isReboot ? "0" : "254"));
6 6
7 const regex = new RegExp(`<dt><a href=\\"\\/Common\\/Character\\/Detail\\/[^\\?]+?\\?p=(.+?)\\"\\s+target=.+?\\/>${nickname}<\\/a><\\/dt>`); 7 const regex = new RegExp(`<dt><a href=\\"\\/Common\\/Character\\/Detail\\/[^\\?]+?\\?p=(.+?)\\"\\s+target=.+?\\/>${nickname}<\\/a><\\/dt>`);
8 const regexResult = regex.exec(resp.data); 8 const regexResult = regex.exec(resp.data);
9 9
10 - if (!regexResult) 10 + if (!regexResult) {
11 - return -2; 11 + if (isReboot)
12 + return -2;
13 + else
14 + return await crwalCharacterCode(nickname, true);
15 + }
12 16
13 return regexResult[1]; 17 return regexResult[1];
14 } catch (error) { 18 } catch (error) {
...@@ -245,6 +249,13 @@ const analyzeStats = function(characterInfo, analysisEquipment) { ...@@ -245,6 +249,13 @@ const analyzeStats = function(characterInfo, analysisEquipment) {
245 const job = jobModel[characterInfo.character.job]; 249 const job = jobModel[characterInfo.character.job];
246 const jobDefault = jobModel.default; 250 const jobDefault = jobModel.default;
247 const weaponConst = require('../model/weapon')[analysisEquipment.weapon] || 1; 251 const weaponConst = require('../model/weapon')[analysisEquipment.weapon] || 1;
252 +
253 + let rebootDamage = 0;
254 + if (characterInfo.character.server.name.indexOf("리부트") == 0) {
255 + // 리부트, 리부트2 월드 반영
256 + rebootDamage = parseInt(characterInfo.character.level / 2);
257 + }
258 +
248 const stats = { 259 const stats = {
249 major: { 260 major: {
250 pure: 0, 261 pure: 0,
...@@ -258,7 +269,8 @@ const analyzeStats = function(characterInfo, analysisEquipment) { ...@@ -258,7 +269,8 @@ const analyzeStats = function(characterInfo, analysisEquipment) {
258 all: characterInfo.stats.damageHyper + 269 all: characterInfo.stats.damageHyper +
259 analysisEquipment.damagePercent + 270 analysisEquipment.damagePercent +
260 job.stats.passive.damage.all + 271 job.stats.passive.damage.all +
261 - jobDefault.stats.passive.damage.all, 272 + jobDefault.stats.passive.damage.all +
273 + rebootDamage,
262 boss: characterInfo.stats.bossAttackDamage 274 boss: characterInfo.stats.bossAttackDamage
263 }, 275 },
264 finalDamage: job.stats.passive.finalDamage, 276 finalDamage: job.stats.passive.finalDamage,
......