The great MCPQ Merge offensive
Fulfilled the lovely pull request #427 from @dragoso, which added in backing code content to HeavenMS. Implemented structural changes for the Marriage wishlist, in order to receive, maintain and distribute gifts to spouses. Added untradeable check on wishlist gift handler. Adjusted CPQ drops to actually load from DB rathe than hard-coded. Fixed CPQ "random disease to player/party" functionality not applying properly. Adjusted how CPQ maps are generated. It directly loads a new area from WZ (this process should at least removes the player's spawned mobs) rather than reset the cache at every MCPQ creation.
This commit is contained in:
+15
-1
@@ -1711,4 +1711,18 @@ Implementado mecânica de pescaria no código-fonte.
|
|||||||
|
|
||||||
09 Março 2019,
|
09 Março 2019,
|
||||||
Corrigido membros de party não recebendo bonus devidamente após membros sairem do mapa/party em alguns casos.
|
Corrigido membros de party não recebendo bonus devidamente após membros sairem do mapa/party em alguns casos.
|
||||||
Revisado sistema de experiência em party. Ganhos de bonus agora levam em conta valores-base que membros de party ganham ao derrotar um mob para definir o ganho geral da equipe. Contabilização de ganhos remodelado, buscando por um modo de distribuição mais coerente.
|
Revisado sistema de experiência em party. Ganhos de bonus agora levam em conta valores-base que membros de party ganham ao derrotar um mob para definir o ganho geral da equipe. Contabilização de ganhos remodelado, buscando por um modo de distribuição mais coerente.
|
||||||
|
|
||||||
|
12 - 13 Março 2019,
|
||||||
|
Iniciado operação de introdução da wishlist de casamento e MCPQ no fonte, a partir do pull request feito pelo Dragohe4rt.
|
||||||
|
Implementado estrutura back-end para comportar e manter (em DB) o wishlist de casamento.
|
||||||
|
Ajustado mecânicas de wishlist iniciadas nos scripts do evento de casamento.
|
||||||
|
|
||||||
|
14 Março 2019,
|
||||||
|
Adicionado checagem por itens untradeable no handler de wishlist ao enviar itens.
|
||||||
|
Adicionado drops da CPQ na DB.
|
||||||
|
Corrigido diversas diseases da CPQ não funcionando corretamente ao pegar do chão item que aleatoriza disease no time/pessoa oponente.
|
||||||
|
Modificado geração de mapas da CPQ, agora sempre carregando um novo mapa da WZ ao invés de sempre buscar e resetar o mapa carregado na cache.
|
||||||
|
|
||||||
|
15 Março 2019,
|
||||||
|
Adicionado SFX nos portais da CPQ.
|
||||||
@@ -77,7 +77,7 @@ function spawnCakeBoss(eim) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setup(level, lobbyid) {
|
function setup(level, lobbyid) {
|
||||||
var eim = em.newInstance("Wedding" + lobbyid);
|
var eim = em.newMarriage("Wedding" + lobbyid);
|
||||||
eim.setProperty("weddingId", "0");
|
eim.setProperty("weddingId", "0");
|
||||||
eim.setProperty("weddingStage", "0"); // 0: gathering time, 1: wedding time, 2: ready to fulfill the wedding, 3: just married
|
eim.setProperty("weddingStage", "0"); // 0: gathering time, 1: wedding time, 2: ready to fulfill the wedding, 3: just married
|
||||||
eim.setProperty("guestBlessings", "0");
|
eim.setProperty("guestBlessings", "0");
|
||||||
@@ -86,6 +86,9 @@ function setup(level, lobbyid) {
|
|||||||
eim.setProperty("groomId", "0");
|
eim.setProperty("groomId", "0");
|
||||||
eim.setProperty("brideId", "0");
|
eim.setProperty("brideId", "0");
|
||||||
eim.setProperty("confirmedVows", "-1");
|
eim.setProperty("confirmedVows", "-1");
|
||||||
|
eim.setProperty("groomWishlist", "");
|
||||||
|
eim.setProperty("brideWishlist", "");
|
||||||
|
eim.initializeGiftItems();
|
||||||
|
|
||||||
eim.getInstanceMap(680000400).resetPQ(level);
|
eim.getInstanceMap(680000400).resetPQ(level);
|
||||||
if(eventBoss) spawnCakeBoss(eim);
|
if(eventBoss) spawnCakeBoss(eim);
|
||||||
@@ -105,9 +108,11 @@ function respawnStages(eim) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function playerEntry(eim, player) {
|
function playerEntry(eim, player) {
|
||||||
var map = eim.getMapInstance(entryMap);
|
eim.setProperty("giftedItemG" + player.getId(), "0");
|
||||||
|
eim.setProperty("giftedItemB" + player.getId(), "0");
|
||||||
player.getClient().getAbstractPlayerInteraction().gainItem(4000313, 1);
|
player.getClient().getAbstractPlayerInteraction().gainItem(4000313, 1);
|
||||||
|
|
||||||
|
var map = eim.getMapInstance(entryMap);
|
||||||
player.changeMap(map, map.getPortal(0));
|
player.changeMap(map, map.getPortal(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ function spawnCakeBoss(eim) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setup(level, lobbyid) {
|
function setup(level, lobbyid) {
|
||||||
var eim = em.newInstance("Wedding" + lobbyid);
|
var eim = em.newMarriage("Wedding" + lobbyid);
|
||||||
eim.setProperty("weddingId", "0");
|
eim.setProperty("weddingId", "0");
|
||||||
eim.setProperty("weddingStage", "0"); // 0: gathering time, 1: wedding time, 2: ready to fulfill the wedding, 3: just married
|
eim.setProperty("weddingStage", "0"); // 0: gathering time, 1: wedding time, 2: ready to fulfill the wedding, 3: just married
|
||||||
eim.setProperty("guestBlessings", "0");
|
eim.setProperty("guestBlessings", "0");
|
||||||
@@ -86,6 +86,9 @@ function setup(level, lobbyid) {
|
|||||||
eim.setProperty("groomId", "0");
|
eim.setProperty("groomId", "0");
|
||||||
eim.setProperty("brideId", "0");
|
eim.setProperty("brideId", "0");
|
||||||
eim.setProperty("confirmedVows", "-1");
|
eim.setProperty("confirmedVows", "-1");
|
||||||
|
eim.setProperty("groomWishlist", "");
|
||||||
|
eim.setProperty("brideWishlist", "");
|
||||||
|
eim.initializeGiftItems();
|
||||||
|
|
||||||
eim.getInstanceMap(680000400).resetPQ(level);
|
eim.getInstanceMap(680000400).resetPQ(level);
|
||||||
if(eventBoss) spawnCakeBoss(eim);
|
if(eventBoss) spawnCakeBoss(eim);
|
||||||
@@ -105,9 +108,11 @@ function respawnStages(eim) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function playerEntry(eim, player) {
|
function playerEntry(eim, player) {
|
||||||
var map = eim.getMapInstance(entryMap);
|
eim.setProperty("giftedItemG" + player.getId(), "0");
|
||||||
|
eim.setProperty("giftedItemB" + player.getId(), "0");
|
||||||
player.getClient().getAbstractPlayerInteraction().gainItem(4000313, 1);
|
player.getClient().getAbstractPlayerInteraction().gainItem(4000313, 1);
|
||||||
|
|
||||||
|
var map = eim.getMapInstance(entryMap);
|
||||||
player.changeMap(map, map.getPortal(0));
|
player.changeMap(map, map.getPortal(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+537
-54
@@ -1,8 +1,23 @@
|
|||||||
var map = 980000000;
|
|
||||||
var minLvl = 0;
|
var status = 0;
|
||||||
var maxLvl = 255;
|
var rnk = -1;
|
||||||
var minAmt = 0;
|
var n1 = 50; //???
|
||||||
var maxAmt = 6;
|
var n2 = 40; //??? ???
|
||||||
|
var n3 = 7; //35
|
||||||
|
var n4 = 10; //40
|
||||||
|
var n5 = 20; //50
|
||||||
|
|
||||||
|
var cpqMap = 980000000;
|
||||||
|
var cpqMinLvl = 0;
|
||||||
|
var cpqMaxLvl = 255;
|
||||||
|
var cpqMinAmt = 0;
|
||||||
|
var cpqMaxAmt = 6;
|
||||||
|
|
||||||
|
// Ronan's custom ore refiner NPC
|
||||||
|
var refineRocks = true; // enables moon rock, star rock
|
||||||
|
var refineCrystals = true; // enables common crystals
|
||||||
|
var refineSpecials = true; // enables lithium, special crystals
|
||||||
|
var feeMultiplier = 7.0;
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
status = -1;
|
status = -1;
|
||||||
@@ -13,7 +28,7 @@ function action(mode, type, selection) {
|
|||||||
if (mode == -1) {
|
if (mode == -1) {
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
if (mode == 0 && status == 0) {
|
if (status >= 0 && mode == 0) {
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -21,64 +36,532 @@ function action(mode, type, selection) {
|
|||||||
status++;
|
status++;
|
||||||
else
|
else
|
||||||
status--;
|
status--;
|
||||||
if (status == 0) {
|
|
||||||
if (cm.getParty() == null) {
|
if (cm.getPlayer().getMapId() == 980000010) {
|
||||||
status = 10;
|
if (status == 0) {
|
||||||
cm.sendOk("#eÉ necessário criar um grupo antes de começar o Festival de Monstros!#k");
|
cm.sendNext("Eu espero que voc� tenha divertido na Folia dos Monstros!");
|
||||||
} else if (!cm.isLeader()) {
|
} else if (status > 0) {
|
||||||
status = 10;
|
cm.warp(980000000, 0);
|
||||||
cm.sendOk("Se você quer começar o Festival, avise o #blíder do grupo#k para falar comigo.");
|
cm.dispose();
|
||||||
} else {
|
}
|
||||||
var party = cm.getParty().getMembers();
|
} else if (cm.getChar().getMap().isCPQLoserMap()) {
|
||||||
var inMap = cm.partyMembersInMap();
|
if (status == 0) {
|
||||||
var lvlOk = 0;
|
if (cm.getChar().getParty() != null) {
|
||||||
var isInMap = 0;
|
var shiu = "";
|
||||||
for (var i = 0; i < party.size(); i++) {
|
if (cm.getPlayer().getFestivalPoints() >= 300) {
|
||||||
if (party.get(i).getLevel() >= minLvl && party.get(i).getLevel() <= maxLvl) {
|
shiu += "#rA#k";
|
||||||
lvlOk++;
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha, apesar da sua excelente performance. A vit�ria pode ser sua da pr�xima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
|
rnk = 10;
|
||||||
|
} else if (cm.getPlayer().getFestivalPoints() >= 100) {
|
||||||
|
shiu += "#rB#k";
|
||||||
|
rnk = 20;
|
||||||
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha, mesmo com sua �tima performance. S� mais um pouquinho, e a vit�ria poderia ter sido sua.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
|
} else if (cm.getPlayer().getFestivalPoints() >= 50) {
|
||||||
|
shiu += "#rC#k";
|
||||||
|
rnk = 30;
|
||||||
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha. A vit�ria est� para aqueles que se esfor�am. Vejo seus esfor�os, ent�o a vit�ria n�o est� t�o longe do seu alcance. Continue assim!\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
|
} else {
|
||||||
|
shiu += "#rD#k";
|
||||||
|
rnk = 40;
|
||||||
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha, e sua performance claramente reflete nisso. Espero mais de voc� da pr�xima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
}
|
}
|
||||||
if (party.get(i).getPlayer().getMapId() != 980000000) {
|
|
||||||
//isInMap = false;
|
|
||||||
isInMap++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (party >= 1) {
|
|
||||||
status = 10;
|
|
||||||
cm.sendOk("Você não tem número suficiente de pessoas em seu grupo. Você precisa de um grupo com #b" + minAmt + "#k - #r" + maxAmt + "#k membros e eles devem estar no mapa com você.");
|
|
||||||
} else if (lvlOk != inMap) {
|
|
||||||
status = 10;
|
|
||||||
cm.sendOk("Certifique se todos em seu grupo estão dentre os níveis corretos (" + minLvl + "~" + maxLvl + ")!");
|
|
||||||
} else if (isInMap > 0) {
|
|
||||||
status = 10;
|
|
||||||
cm.sendOk("Existe alguém do grupo que não esta no mapa!");
|
|
||||||
} else {
|
} else {
|
||||||
cm.sendCPQMapLists();
|
cm.warp(980000000, 0);
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else if (status == 1) {
|
||||||
|
switch (rnk) {
|
||||||
|
case 10:
|
||||||
|
cm.warp(980000000, 0);
|
||||||
|
cm.gainExp(17500);
|
||||||
|
cm.dispose();
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
cm.warp(980000000, 0);
|
||||||
|
cm.gainExp(1200);
|
||||||
|
cm.dispose();
|
||||||
|
break;
|
||||||
|
case 30:
|
||||||
|
cm.warp(980000000, 0);
|
||||||
|
cm.gainExp(5000);
|
||||||
|
cm.dispose();
|
||||||
|
break;
|
||||||
|
case 40:
|
||||||
|
cm.warp(980000000, 0);
|
||||||
|
cm.gainExp(2500);
|
||||||
|
cm.dispose();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
cm.warp(980000000, 0);
|
||||||
|
cm.dispose();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (status == 1) {
|
} else if (cm.getChar().getMap().isCPQWinnerMap()) {
|
||||||
|
if (status == 0) {
|
||||||
if (cm.fieldTaken(selection)) {
|
if (cm.getChar().getParty() != null) {
|
||||||
if (cm.fieldLobbied(selection)) {
|
var shi = "";
|
||||||
cm.challengeParty(selection);
|
if (cm.getPlayer().getFestivalPoints() >= 300) {
|
||||||
cm.dispose();
|
shi += "#rA#k";
|
||||||
|
rnk = 1;
|
||||||
|
cm.sendOk("Parab�ns pela sua vit�ria!!! Que �tima performance! O grupo advers�rio n�o p�de fazer nada! Espero o mesmo bom trabalho da pr�xima vez!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
|
} else if (cm.getPlayer().getFestivalPoints() >= 100) {
|
||||||
|
shi += "#rB#k";
|
||||||
|
rnk = 2;
|
||||||
|
cm.sendOk("Parab�ns pela sua vit�ria! Isso foi impressionante! Voc� fez um bom trabalho contra o grupo advers�rio! S� mais um pouco, e voc� definitivamente vai conseguir um A na pr�xima vez. \r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
|
} else if (cm.getPlayer().getFestivalPoints() >= 50) {
|
||||||
|
shi += "#rC#k";
|
||||||
|
rnk = 3;
|
||||||
|
cm.sendOk("Parab�ns pela sua vit�ria. Voc� fez algumas coisas c� e l�, mas essa n�o pode ser considerada uma boa vit�ria. Espero mais de ti da pr�xima vez.\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
|
} else {
|
||||||
|
shi += "#rD#k";
|
||||||
|
rnk = 4;
|
||||||
|
cm.sendOk("Parab�ns pela sua vit�ria, entretanto sua performance n�o refletiu muito bem isso. Seja mais ativo na sua pr�xima participa��o da Folia de Monstros!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("A sala esta cheia.");
|
cm.warp(980000000, 0);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (status == 1) {
|
||||||
var party = cm.getParty().getMembers();
|
switch (rnk) {
|
||||||
if ((selection === 0 || selection === 1 || selection === 2 || selection === 3) && party.size() < 2) {
|
case 1:
|
||||||
cm.sendOk("Você precisa de no mínimo 2 player para entrar na competição.");
|
cm.warp(980000000, 0);
|
||||||
} else if ((selection === 4 || selection === 5) && party.size() < 3) {
|
cm.gainExp(50000);
|
||||||
cm.sendOk("Você precisa de no mínimo 3 player para entrar na competição.");
|
cm.dispose();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
cm.warp(980000000, 0);
|
||||||
|
cm.gainExp(25500);
|
||||||
|
cm.dispose();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
cm.warp(980000000, 0);
|
||||||
|
cm.gainExp(21000);
|
||||||
|
cm.dispose();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
cm.warp(980000000, 0);
|
||||||
|
cm.gainExp(19505);
|
||||||
|
cm.dispose();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
cm.warp(980000000, 0);
|
||||||
|
cm.dispose();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (cm.getMapId() == cpqMap) { // only CPQ1
|
||||||
|
if (status == 0) {
|
||||||
|
if (cm.getParty() == null) {
|
||||||
|
status = 10;
|
||||||
|
cm.sendOk("#eÉ necessário criar um grupo antes de começar o Festival de Monstros!#k");
|
||||||
|
} else if (!cm.isLeader()) {
|
||||||
|
status = 10;
|
||||||
|
cm.sendOk("Se você quer começar o Festival, avise o #blíder do grupo#k para falar comigo.");
|
||||||
} else {
|
} else {
|
||||||
cm.cpqLobby(selection);
|
var party = cm.getParty().getMembers();
|
||||||
|
var inMap = cm.partyMembersInMap();
|
||||||
|
var lvlOk = 0;
|
||||||
|
var isOutMap = 0;
|
||||||
|
for (var i = 0; i < party.size(); i++) {
|
||||||
|
if (party.get(i).getLevel() >= cpqMinLvl && party.get(i).getLevel() <= cpqMaxLvl) {
|
||||||
|
lvlOk++;
|
||||||
|
|
||||||
|
if (party.get(i).getPlayer().getMapId() != cpqMap) {
|
||||||
|
isOutMap++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (party >= 1) {
|
||||||
|
status = 10;
|
||||||
|
cm.sendOk("Você não tem número suficiente de pessoas em seu grupo. Você precisa de um grupo com #b" + cpqMinAmt + "#k - #r" + cpqMaxAmt + "#k membros e eles devem estar no mapa com você.");
|
||||||
|
} else if (lvlOk != inMap) {
|
||||||
|
status = 10;
|
||||||
|
cm.sendOk("Certifique se todos em seu grupo estão dentre os níveis corretos (" + cpqMinLvl + "~" + cpqMaxLvl + ")!");
|
||||||
|
} else if (isOutMap > 0) {
|
||||||
|
status = 10;
|
||||||
|
cm.sendOk("Existe alguém do grupo que não esta no mapa!");
|
||||||
|
} else {
|
||||||
|
cm.sendCPQMapLists();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (status == 1) {
|
||||||
|
if (cm.fieldTaken(selection)) {
|
||||||
|
if (cm.fieldLobbied(selection)) {
|
||||||
|
cm.challengeParty(selection);
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("A sala esta cheia.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var party = cm.getParty().getMembers();
|
||||||
|
if ((selection >= 0 && selection <= 3) && party.size() < 1) {
|
||||||
|
cm.sendOk("Você precisa de no mínimo 2 player para entrar na competição.");
|
||||||
|
} else if ((selection >= 4 && selection <= 5) && party.size() < 1) {
|
||||||
|
cm.sendOk("Você precisa de no mínimo 3 player para entrar na competição.");
|
||||||
|
} else {
|
||||||
|
cm.cpqLobby(selection);
|
||||||
|
}
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else if (status == 11) {
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (status == 0) {
|
||||||
|
var talk = "O que gostaria de fazer? Se voc� nunca participou da Folia de Monstros, voc� precisar� saber de algumas coisas antes de participar.\r\n#b#L0# Ir para o campo da Folia de Monstros 1.#l\r\n#L3# Ir para o campo da Folia de Monstros 2.#l\r\n#L1# Aprender sobre a Folia de Monstros.#l\r\n#L2# Trocar #t4001129#.#l";
|
||||||
|
if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||||
|
talk += "\r\n#L4# ... Can I just refine my ores?#l";
|
||||||
|
}
|
||||||
|
cm.sendSimple(talk);
|
||||||
|
} else if (status == 1) {
|
||||||
|
if (selection == 0) {
|
||||||
|
if ((cm.getLevel() > 29 && cm.getLevel() < 51) || cm.getPlayer().isGM()) {
|
||||||
|
cm.getChar().saveLocation("MONSTER_CARNIVAL");
|
||||||
|
cm.warp(980000000, 0);
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
} else if (cm.getLevel() < 30) {
|
||||||
|
cm.sendOk("Voc� precisa ser no m�nimo n�vel 30 para participar da Folia de Monstros. Fale comigo quando for forte o bastante.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Sinto muito, mas apenas os jogadores de n�vel 30~50 podem participar da Folia de Monstros.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (selection == 1) {
|
||||||
|
status = 60;
|
||||||
|
cm.sendSimple("O que gostaria de fazer?\r\n#b#L0# O que � a Folia de Monstros?#l\r\n#L1# Vis�o geral sobre a Folia de Monstros#l\r\n#L2# Informa��es detalhadas sobre a Folia de Monstros#l\r\n#L3# Nada, de verdade. Mudei de ideia.#l");
|
||||||
|
} else if (selection == 2) {
|
||||||
|
cm.sendSimple("Lembre-se se voc� possui #t4001129#, voc� pode troc�-las por itens. Tenha certeza que voc� possui #t4001129# suficientes para o item que voc� deseja. Selecione o item que voc� gostaria de troc�-las! \r\n#b#L0# #t1122007#(" + n1 + " moedas)#l\r\n#L1# #t2041211#(" + n2 + " moedas)#l\r\n#L2# Armas para Guerreiros#l\r\n#L3# Armas para Bruxos#l\r\n#L4# Armas para Arqueiros#l\r\n#L5# Armas para Gatunos#l");
|
||||||
|
} else if (selection == 3) {
|
||||||
|
cm.getChar().saveLocation("MONSTER_CARNIVAL");
|
||||||
|
cm.warp(980030000, 0);
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
} else if (selection == 4) {
|
||||||
|
var selStr = "Very well, instead I offer a steadfast #bore refining#k service for you, taxing #r" + ((feeMultiplier * 100) | 0) + "%#k over the usual fee to synthetize them. What will you do?#b";
|
||||||
|
|
||||||
|
var options = new Array("Refine mineral ores","Refine jewel ores");
|
||||||
|
if(refineCrystals) {
|
||||||
|
options.push("Refine crystal ores");
|
||||||
|
}
|
||||||
|
if(refineRocks) {
|
||||||
|
options.push("Refine plates/jewels");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < options.length; i++){
|
||||||
|
selStr += "\r\n#L" + i + "# " + options[i] + "#l";
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.sendSimple(selStr);
|
||||||
|
|
||||||
|
status = 76;
|
||||||
|
}
|
||||||
|
} else if (status == 2) {
|
||||||
|
select = selection;
|
||||||
|
if (select == 0) {
|
||||||
|
if (cm.haveItem(4001129, n1) && cm.canHold(4001129)) {
|
||||||
|
cm.gainItem(1122007, 1);
|
||||||
|
cm.gainItem(4001129, -n1);
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Verifique e veja se est�o faltando #b#t4001129##k ou se seu invent�rio de Equipamentos est� cheio.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else if (select == 1) {
|
||||||
|
if (cm.haveItem(4001129, n2) && cm.canHold(2041211)) {
|
||||||
|
cm.gainItem(2041211, 1);
|
||||||
|
cm.gainItem(4001129, -n2);
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Verifique e veja se est�o faltando #b#t4001129##k ou se seu invent�rio de Uso est� cheio.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else if (select == 2) {//S2 Warrior 26 S3 Magician 6 S4 Bowman 6 S5 Thief 8
|
||||||
|
status = 10;
|
||||||
|
cm.sendSimple("Por favor tenha certeza que voc� possui #t4001129# para a arma que voc� deseja. Selecione a arma que voc� gostaria de trocar #t4001129# por. As op��es que tenho s�o realmente boas, e eu n�o sou eu que falo � o povo que diz! \r\n#b#L0# #z1302004#(" + n3 + " moedas)#l\r\n#L1# #z1402006#(" + n3 + " moedas)#l\r\n#L2# #z1302009#(" + n4 + " moedas)#l\r\n#L3# #z1402007#(" + n4 + " moedas)#l\r\n#L4# #z1302010#(" + n5 + " moedas)#l\r\n#L5# #z1402003#(" + n5 + " moedas)#l\r\n#L6# #z1312006#(" + n3 + " moedas)#l\r\n#L7# #z1412004#(" + n3 + " moedas)#l\r\n#L8# #z1312007#(" + n4 + " moedas)#l\r\n#L9# #z1412005#(" + n4 + " moedas)#l\r\n#L10# #z1312008#(" + n5 + " moedas)#l\r\n#L11# #z1412003#(" + n5 + " moedas)#l\r\n#L12# Ir para a pr�xima p�gina(1/2)#l");
|
||||||
|
} else if (select == 3) {
|
||||||
|
status = 20;
|
||||||
|
cm.sendSimple("Selecione a arma que voc� gostaria de trocar. As armas que eu tenho aqui s�o extremamente atraentes. Veja voc� mesmo! \r\n#b#L0# #z1372001#(" + n3 + " moedas)#l\r\n#L1# #z1382018#(" + n3 + " moedas)#l\r\n#L2# #z1372012#(" + n4 + "moedas)#l\r\n#L3# #z1382019#(" + n4 + "moedas)#l\r\n#L4# #z1382001#(" + n5 + " moedas)#l\r\n#L5# #z1372007#(" + n5 + " moedas)#l");
|
||||||
|
} else if (select == 4) {
|
||||||
|
status = 30;
|
||||||
|
cm.sendSimple("Selecione a arma que voc� gostaria de trocar. As armas que eu tenho aqui s�o extremamente atraentes. Veja voc� mesmo! \r\n#b#L0# #z1452006#(" + n3 + " moedas)#l\r\n#L1# #z1452007#(" + n4 + " moedas)#l\r\n#L2# #z1452008#(" + n5 + " moedas)#l\r\n#L3# #z1462005#(" + n3 + " moedas)#l\r\n#L4# #z1462006#(" + n4 + " moedas)#l\r\n#L5# #z1462007#(" + n5 + " moedas)#l");
|
||||||
|
} else if (select == 5) {
|
||||||
|
status = 40;
|
||||||
|
cm.sendSimple("Selecione a arma que voc� gostaria de trocar por. As armas que eu tenho s�o da maior qualidade. Seleciona a mais atraente para voc�! \r\n#b#L0# #z1472013#(" + n3 + " moedas)#l\r\n#L1# #z1472017#(" + n4 + "moedas)#l\r\n#L2# #z1472021#(" + n5 + " moedas)#l\r\n#L3# #z1332014#(" + n3 + " moedas)#l\r\n#L4# #z1332031#(" + n4 + "moedas)#l\r\n#L5# #z1332011#(" + n4 + "moedas)#l\r\n#L6# #z1332016#(" + n5 + " moedas)#l\r\n#L7# #z1332003#(" + n5 + " moedas)#l");
|
||||||
|
}
|
||||||
|
} else if (status == 11) {
|
||||||
|
if (selection == 12) {
|
||||||
|
cm.sendSimple("Selecione a arma que voc� gostaria de trocar. As armas que eu tenho aqui s�o extremamente �teis. D� uma olhada! \r\n#b#L0# #z1322015#(" + n3 + " moedas)#l\r\n#L1# #z1422008#(" + n3 + " moedas)#l\r\n#L2# #z1322016#(" + n4 + "moedas)#l\r\n#L3# #z1422007#(" + n4 + "moedas)#l\r\n#L4# #z1322017#(" + n5 + " moedas)#l\r\n#L5# #z1422005#(" + n5 + " moedas)#l\r\n#L6# #z1432003#(" + n3 + " moedas)#l\r\n#L7# #z1442003#(" + n3 + " moedas)#l\r\n#L8# #z1432005#(" + n4 + "moedas)#l\r\n#L9# #z1442009#(" + n4 + "moedas)#l\r\n#L10# #z1442005#(" + n5 + " moedas)#l\r\n#L11# #z1432004#(" + n5 + " moedas)#l\r\n#L12# Voltar para a p�gina inicial(2/2)#l");
|
||||||
|
} else {
|
||||||
|
var item = new Array(1302004, 1402006, 1302009, 1402007, 1302010, 1402003, 1312006, 1412004, 1312007, 1412005, 1312008, 1412003);
|
||||||
|
var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5);
|
||||||
|
if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) {
|
||||||
|
cm.gainItem(item[selection], 1);
|
||||||
|
cm.gainItem(4001129, -cost[selection]);
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Voc� ou n�o possui #b#t4001129##k suficientes, ou seu invent�rio est� cheio. Verifique novamente.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (status == 12) {
|
||||||
|
if (selection == 12) {
|
||||||
|
status = 10;
|
||||||
|
cm.sendSimple("Por favor tenha certeza que voc� possui #t4001129# para a arma que voc� deseja. Selecione a arma que voc� gostaria de trocar #t4001129# por. As op��es que tenho s�o realmente boas, e eu n�o sou eu que falo � o povo que diz! \r\n#b#L0# #z1302004#(" + n3 + " moedas)#l\r\n#L1# #z1402006#(" + n3 + " moedas)#l\r\n#L2# #z1302009#(" + n4 + " moedas)#l\r\n#L3# #z1402007#(" + n4 + " moedas)#l\r\n#L4# #z1302010#(" + n5 + " moedas)#l\r\n#L5# #z1402003#(" + n5 + " moedas)#l\r\n#L6# #z1312006#(" + n3 + " moedas)#l\r\n#L7# #z1412004#(" + n3 + " moedas)#l\r\n#L8# #z1312007#(" + n4 + " moedas)#l\r\n#L9# #z1412005#(" + n4 + " moedas)#l\r\n#L10# #z1312008#(" + n5 + " moedas)#l\r\n#L11# #z1412003#(" + n5 + " moedas)#l\r\n#L12# Ir para a pr�xima p�gina(1/2)#l");
|
||||||
|
} else {
|
||||||
|
var item = new Array(1322015, 1422008, 1322016, 1422007, 1322017, 1422005, 1432003, 1442003, 1432005, 1442009, 1442005, 1432004);
|
||||||
|
var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5, n5);
|
||||||
|
if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) {
|
||||||
|
cm.gainItem(item[selection], 1);
|
||||||
|
cm.gainItem(4001129, -cost[selection]);
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Voc� ou n�o possui #b#t4001129##k suficientes, ou seu invent�rio est� cheio. Verifique novamente.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (status == 21) {
|
||||||
|
var item = new Array(1372001, 1382018, 1372012, 1382019, 1382001, 1372007);
|
||||||
|
var cost = new Array(n3, n3, n4, n4, n5, n5);
|
||||||
|
if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) {
|
||||||
|
cm.gainItem(item[selection], 1);
|
||||||
|
cm.gainItem(4001129, -cost[selection]);
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Ou voc� n�o possui #b#t4001129##k suficientes, ou seu invent�rio est� cheio. Verifique novamente.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else if (status == 31) {
|
||||||
|
var item = new Array(1452006, 1452007, 1452008, 1462005, 1462006, 1462007);
|
||||||
|
var cost = new Array(n3, n4, n5, n3, n4, n5);
|
||||||
|
if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) {
|
||||||
|
cm.gainItem(item[selection], 1);
|
||||||
|
cm.gainItem(4001129, -cost[selection]);
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Ou voc� n�o possui #b#t4001129##k suficientes, ou seu invent�rio est� cheio. Verifique novamente.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else if (status == 41) {
|
||||||
|
var item = new Array(1472013, 1472017, 1472021, 1332014, 1332031, 1332011, 1332016, 1332003);
|
||||||
|
var cost = new Array(n3, n4, n5, n3, n4, n4, n5, n5);
|
||||||
|
if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) {
|
||||||
|
cm.gainItem(item[selection], 1);
|
||||||
|
cm.gainItem(4001129, -cost[selection]);
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Ou voc� n�o possui #b#t4001129##k suficientes, ou seu invent�rio est� cheio. Verifique novamente.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else if (status == 61) {
|
||||||
|
select = selection;
|
||||||
|
if (selection == 0) {
|
||||||
|
cm.sendNext("Haha! Eu sou Spiegelmann, o l�der dessa Folia. Eu comecei a primeira #bFolia de Monstros#k aqui, aguardando por viajantes como voc� para participar dessa extravaganza!");
|
||||||
|
} else if (selection == 1) {
|
||||||
|
cm.sendNext("#bFolia de Monstros#k consiste em 2 grupos entrando no campo de batalha, e ca�ando os monstros invocados pelo outro grupo. � uma #bmiss�o de combate que determina o vitorioso pela quantia de Pontos de Folia (CP) recebidos#k.");
|
||||||
|
} else if (selection == 2) {
|
||||||
|
cm.sendNext("Quando entrar no Campo da Folia, voc� ver� a janela da Folia de Monstros aparecer. Tudo que precisa fazer � #bselecionar o que voc�e quer usar, e pressionar OK#k. Muito f�cil, n�?");
|
||||||
|
} else {
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else if (status == 62) {
|
||||||
|
if (select == 0) {
|
||||||
|
cm.sendNext("O que � a #bFolia de Monstros#k? Hahaha! Vamos dizer que � uma experi�ncia que jamais esquecer�! � uma #bbatalha contra outros viajantes assim como voc�!#k");
|
||||||
|
} else if (select == 1) {
|
||||||
|
cm.sendNext("Quando entrar no Campo da Folia, sua tarefa � #breceber CP ca�ando os monstros do grupo oposto, e usar estes CP's para distrair o grupo oposto de ca�ar monstros.#k.");
|
||||||
|
} else if (select == 2) {
|
||||||
|
cm.sendNext("Assim que se acostumar com os comandos, tente usar #bas teclas TAB e F1 ~ F12#k. #bTAB alterna entre Invoca��o de Monstros/Habilidades/Protetor,#k e, #bF1~ F12 possibilita-o de acessar uma das janelas diretamente#k.");
|
||||||
|
}
|
||||||
|
} else if (status == 63) {
|
||||||
|
if (select == 0) {
|
||||||
|
cm.sendNext("Eu sei que � muito perigoso para voc�s lutarem uns com os outros usando armas de verdade; e eu n�o sugeriria um ato t�o barb�rico. N�o meu amigo, o que eu ofere�o � competi��o. A emo��o da batalha e a emo��o de competir contra pessoas t�o fortes e motivadas. Eu ofere�o a premissa de que seu grupo e o grupo oposto ambos #binvoquem os monstros, e derrote os monstros invocados pelo grupo advers�rio. Essa � a ess�ncia da Folia de Monstros. Al�m disso, voc� pode usar Maple Coins ganhos durante a Folia de Monstros para obter novos itens e armas! #k");
|
||||||
|
} else if (select == 1) {
|
||||||
|
cm.sendNext("Existem 3 maneiras de distrair o grupo advers�rio: #bInvodar um monstro, Habilidade, and Protetor#k. Vou dar-lhe um olhar mais aprofundado, se voc� quiser saber mais sobre 'Instru��es detalhadas'.");
|
||||||
|
} else if (select == 2) {
|
||||||
|
cm.sendNext("#bInvocar um Monstro#k chama um monstro que ataca o grupo advers�rio, sob seu controle. Use CP para trazer um Monstro Invocado, e ele ir� aparecer na mesma �rea, atacando o grupo oposto.");
|
||||||
|
}
|
||||||
|
} else if (status == 64) {
|
||||||
|
if (select == 0) {
|
||||||
|
cm.sendNext("Claro, n�o � t�o simples assim. Existem outras maneiras de prevenir o outro grupo de ca�ar monstros, e cabe a voc� descobrir como faz�-lo. O que acha? Interessado em uma competi��o amig�vel?");
|
||||||
|
cm.dispose();
|
||||||
|
} else if (select == 1) {
|
||||||
|
cm.sendNext("Por favor lembre-se. Nunca � uma boa ideia guardar seus CP's. #bOs CP's que voc� usou ir�o ajudar a determinar o vencedor e o perdedor da Folia.");
|
||||||
|
} else if (select == 2) {
|
||||||
|
cm.sendNext("#bHabilidade#k � uma op��o de usar habilidades tais como Escurid�o, Fraqueza, e outras para prevenir o grupo oposto de matar outros monstros. S�o necess�rios muitos CP's, mas vale muito a pena. O �nico problema � que eles n�o duram muito. Use essa t�tica com sabedoria!");
|
||||||
|
}
|
||||||
|
} else if (status == 65) {
|
||||||
|
if (select == 1) {
|
||||||
|
cm.sendNext("Oh, e n�o se preocupe em tranformar-se em um fantasma. Na Folia de Monstros, #bvoc� n�o perder� EXP ap�s a morte#k. � realmente uma exper�ncia como nenhuma outra!");
|
||||||
|
cm.dispose();
|
||||||
|
} else if (select == 2) {
|
||||||
|
cm.sendNext("#bProtetor#k � basicamente um item invocado que aumenta dr�sticamente as habilidades dos monstros invocados pelo seu grupo. Protetor funciona enquanto n�o for demolido pelo grupo oposto, ent�o eu surigo que voc� invoque v�rios monstros primeiro, e ent�o traga o Protetor.");
|
||||||
|
}
|
||||||
|
} else if (status == 66) {
|
||||||
|
cm.sendNext("Por �ltimo, enquanto estiver na Folia de Monstros, #bvoc� n�o pode usar items/po��es de recupera��o que voc� leva por ai contigo.#k Entretanto, os monstros deixam esses items cair de vez em quando, e #bassim que peg�-los, o item ativar� imediatamente#k. � por isso que � importante saber quando pegar estes items.");
|
||||||
|
cm.dispose();
|
||||||
|
} else if (status == 77) {
|
||||||
|
var allDone;
|
||||||
|
|
||||||
|
if (selection == 0) {
|
||||||
|
allDone = refineItems(0); // minerals
|
||||||
|
} else if (selection == 1) {
|
||||||
|
allDone = refineItems(1); // jewels
|
||||||
|
} else if (selection == 2 && refineCrystals) {
|
||||||
|
allDone = refineItems(2); // crystals
|
||||||
|
} else if (selection == 2 && !refineCrystals || selection == 3) {
|
||||||
|
allDone = refineRockItems(); // moon/star rock
|
||||||
|
}
|
||||||
|
|
||||||
|
if(allDone) {
|
||||||
|
cm.sendOk("Done. Thanks for showing up~.");
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Done. Be aware some of the items #rcould not be synthetized#k because either you have a lack of space on your ETC inventory or there's not enough mesos to cover the fee.");
|
||||||
}
|
}
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else if (status == 11) {
|
|
||||||
cm.dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRefineFee(fee) {
|
||||||
|
return ((feeMultiplier * fee) | 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isRefineTarget(refineType, refineItemid) {
|
||||||
|
if(refineType == 0) { //mineral refine
|
||||||
|
return refineItemid >= 4010000 && refineItemid <= 4010007 && !(refineItemid == 4010007 && !refineSpecials);
|
||||||
|
} else if(refineType == 1) { //jewel refine
|
||||||
|
return refineItemid >= 4020000 && refineItemid <= 4020008 && !(refineItemid == 4020008 && !refineSpecials);
|
||||||
|
} else if(refineType == 2) { //crystal refine
|
||||||
|
return refineItemid >= 4004000 && refineItemid <= 4004004 && !(refineItemid == 4004004 && !refineSpecials);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRockRefineTarget(refineItemid) {
|
||||||
|
if(refineItemid >= 4011000 && refineItemid <= 4011006) {
|
||||||
|
return 0;
|
||||||
|
} else if(refineItemid >= 4021000 && refineItemid <= 4021008) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function refineItems(refineType) {
|
||||||
|
var allDone = true;
|
||||||
|
|
||||||
|
var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]];
|
||||||
|
var itemCount = {};
|
||||||
|
|
||||||
|
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
var it = iter.next();
|
||||||
|
var itemid = it.getItemId();
|
||||||
|
|
||||||
|
if(isRefineTarget(refineType, itemid)) {
|
||||||
|
var ic = itemCount[itemid];
|
||||||
|
|
||||||
|
if(ic != undefined) {
|
||||||
|
itemCount[itemid] += it.getQuantity();
|
||||||
|
} else {
|
||||||
|
itemCount[itemid] = it.getQuantity();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var key in itemCount) {
|
||||||
|
var itemqty = itemCount[key];
|
||||||
|
var itemid = parseInt(key);
|
||||||
|
|
||||||
|
var refineQty = ((itemqty / 10) | 0);
|
||||||
|
if(refineQty <= 0) continue;
|
||||||
|
|
||||||
|
while(true) {
|
||||||
|
itemqty = refineQty * 10;
|
||||||
|
|
||||||
|
var fee = getRefineFee(refineFees[refineType][(itemid % 100) | 0] * refineQty);
|
||||||
|
if(cm.canHold(itemid + 1000, refineQty, itemid, itemqty) && cm.getMeso() >= fee) {
|
||||||
|
cm.gainMeso(-fee);
|
||||||
|
cm.gainItem(itemid, -itemqty);
|
||||||
|
cm.gainItem(itemid + (itemid != 4010007 ? 1000 : 1001), refineQty);
|
||||||
|
|
||||||
|
break;
|
||||||
|
} else if(refineQty <= 1) {
|
||||||
|
allDone = false;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
refineQty--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return allDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
function refineRockItems() {
|
||||||
|
var allDone = true;
|
||||||
|
var minItems = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
|
||||||
|
var minRocks = [2147483647, 2147483647];
|
||||||
|
|
||||||
|
var rockItems = [4011007, 4021009];
|
||||||
|
var rockFees = [10000, 15000];
|
||||||
|
|
||||||
|
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
var it = iter.next();
|
||||||
|
var itemid = it.getItemId();
|
||||||
|
var rockRefine = getRockRefineTarget(itemid);
|
||||||
|
if(rockRefine >= 0) {
|
||||||
|
var rockItem = ((itemid % 100) | 0);
|
||||||
|
var itemqty = it.getQuantity();
|
||||||
|
|
||||||
|
minItems[rockRefine][rockItem] += itemqty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i = 0; i < minRocks.length; i++) {
|
||||||
|
for(var j = 0; j < minItems[i].length; j++) {
|
||||||
|
if(minRocks[i] > minItems[i][j]) {
|
||||||
|
minRocks[i] = minItems[i][j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(minRocks[i] <= 0 || minRocks[i] == 2147483647) continue;
|
||||||
|
|
||||||
|
var refineQty = minRocks[i];
|
||||||
|
while(true) {
|
||||||
|
var fee = getRefineFee(rockFees[i] * refineQty);
|
||||||
|
if(cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) {
|
||||||
|
cm.gainMeso(-fee);
|
||||||
|
|
||||||
|
var j;
|
||||||
|
if(i == 0) {
|
||||||
|
for(j = 4011000; j < 4011007; j++) {
|
||||||
|
cm.gainItem(j, -refineQty);
|
||||||
|
}
|
||||||
|
cm.gainItem(j, refineQty);
|
||||||
|
} else {
|
||||||
|
for(j = 4021000; j < 4021009; j++) {
|
||||||
|
cm.gainItem(j, -refineQty);
|
||||||
|
}
|
||||||
|
cm.gainItem(j, refineQty);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
} else if(refineQty <= 1) {
|
||||||
|
allDone = false;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
refineQty--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return allDone;
|
||||||
|
}
|
||||||
|
|||||||
+232
-50
@@ -1,4 +1,3 @@
|
|||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
var status = 0;
|
var status = 0;
|
||||||
var rnk = -1;
|
var rnk = -1;
|
||||||
@@ -8,6 +7,12 @@ var n3 = 7; //35
|
|||||||
var n4 = 10; //40
|
var n4 = 10; //40
|
||||||
var n5 = 20; //50
|
var n5 = 20; //50
|
||||||
|
|
||||||
|
// Ronan's custom ore refiner NPC
|
||||||
|
var refineRocks = true; // enables moon rock, star rock
|
||||||
|
var refineCrystals = true; // enables common crystals
|
||||||
|
var refineSpecials = true; // enables lithium, special crystals
|
||||||
|
var feeMultiplier = 7.0;
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
status = -1;
|
status = -1;
|
||||||
action(1, 0, 0);
|
action(1, 0, 0);
|
||||||
@@ -25,9 +30,10 @@ function action(mode, type, selection) {
|
|||||||
status++;
|
status++;
|
||||||
else
|
else
|
||||||
status--;
|
status--;
|
||||||
|
|
||||||
if (cm.getPlayer().getMapId() == 980000010) {
|
if (cm.getPlayer().getMapId() == 980000010) {
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
cm.sendNext("Eu espero que você tinha divertido na Folia dos Monstros!");
|
cm.sendNext("Eu espero que voc� tenha divertido na Folia dos Monstros!");
|
||||||
} else if (status > 0) {
|
} else if (status > 0) {
|
||||||
cm.warp(980000000, 0);
|
cm.warp(980000000, 0);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
@@ -36,22 +42,22 @@ function action(mode, type, selection) {
|
|||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
if (cm.getChar().getParty() != null) {
|
if (cm.getChar().getParty() != null) {
|
||||||
var shiu = "";
|
var shiu = "";
|
||||||
if (cm.getPlayer().getFestivalPoints() >= 100) {
|
if (cm.getPlayer().getFestivalPoints() >= 300) {
|
||||||
shiu += "#rA#k";
|
shiu += "#rA#k";
|
||||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, apesar da sua excelente performance. A vitória pode ser sua da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha, apesar da sua excelente performance. A vit�ria pode ser sua da pr�xima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
rnk = 10;
|
rnk = 10;
|
||||||
} else if (cm.getPlayer().getFestivalPoints() >= 50 && cm.getPlayer().getFestivalPoints() < 100) {
|
} else if (cm.getPlayer().getFestivalPoints() >= 100) {
|
||||||
shiu += "#rB#k";
|
shiu += "#rB#k";
|
||||||
rnk = 20;
|
rnk = 20;
|
||||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, mesmo com sua ótima performance. Só mais um pouquinho, e a vitória poderia ter sido sua.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha, mesmo com sua �tima performance. S� mais um pouquinho, e a vit�ria poderia ter sido sua.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
} else if (cm.getPlayer().getFestivalPoints() >= 30 && cm.getPlayer().getFestivalPoints() < 50) {
|
} else if (cm.getPlayer().getFestivalPoints() >= 50) {
|
||||||
shiu += "#rC#k";
|
shiu += "#rC#k";
|
||||||
rnk = 30;
|
rnk = 30;
|
||||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha. A vitória está para aqueles que se esforçam. Vejo seus esforços, então a vitória não está tão longe do seu alcance. Continue assim!\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha. A vit�ria est� para aqueles que se esfor�am. Vejo seus esfor�os, ent�o a vit�ria n�o est� t�o longe do seu alcance. Continue assim!\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
} else {
|
} else {
|
||||||
shiu += "#rD#k";
|
shiu += "#rD#k";
|
||||||
rnk = 40;
|
rnk = 40;
|
||||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, e sua performance claramente reflete nisso. Espero mais de você da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha, e sua performance claramente reflete nisso. Espero mais de voc� da pr�xima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cm.warp(980000000, 0);
|
cm.warp(980000000, 0);
|
||||||
@@ -92,19 +98,19 @@ function action(mode, type, selection) {
|
|||||||
if (cm.getPlayer().getFestivalPoints() >= 300) {
|
if (cm.getPlayer().getFestivalPoints() >= 300) {
|
||||||
shi += "#rA#k";
|
shi += "#rA#k";
|
||||||
rnk = 1;
|
rnk = 1;
|
||||||
cm.sendOk("Parabéns pela sua vitória!!! Que ótima performance! O grupo adversário não pôde fazer nada! Espero o mesmo bom trabalho da próxima vez!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
cm.sendOk("Parab�ns pela sua vit�ria!!! Que �tima performance! O grupo advers�rio n�o p�de fazer nada! Espero o mesmo bom trabalho da pr�xima vez!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
} else if (cm.getPlayer().getFestivalPoints() >= 100 && cm.getPlayer().getFestivalPoints() < 300) {
|
} else if (cm.getPlayer().getFestivalPoints() >= 100) {
|
||||||
shi += "#rB#k";
|
shi += "#rB#k";
|
||||||
rnk = 2;
|
rnk = 2;
|
||||||
cm.sendOk("Parabéns pela sua vitória! Isso foi impressionante! Você fez um bom trabalho contra o grupo adversário! Só mais um pouco, e você definitivamente vai conseguir um A na próxima vez. \r\n\r\n#bNota da Folia de Monstros : " + shi);
|
cm.sendOk("Parab�ns pela sua vit�ria! Isso foi impressionante! Voc� fez um bom trabalho contra o grupo advers�rio! S� mais um pouco, e voc� definitivamente vai conseguir um A na pr�xima vez. \r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
} else if (cm.getPlayer().getFestivalPoints() >= 50 && cm.getPlayer().getFestivalPoints() < 100) {
|
} else if (cm.getPlayer().getFestivalPoints() >= 50) {
|
||||||
shi += "#rC#k";
|
shi += "#rC#k";
|
||||||
rnk = 3;
|
rnk = 3;
|
||||||
cm.sendOk("Parabéns pela sua vitória. Você fez algumas coisas cá e lá, mas essa não pode ser considerada uma boa vitória. Espero mais de ti da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
cm.sendOk("Parab�ns pela sua vit�ria. Voc� fez algumas coisas c� e l�, mas essa n�o pode ser considerada uma boa vit�ria. Espero mais de ti da pr�xima vez.\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
} else {
|
} else {
|
||||||
shi += "#rD#k";
|
shi += "#rD#k";
|
||||||
rnk = 4;
|
rnk = 4;
|
||||||
cm.sendOk("Parabéns pela sua vitória, entretanto sua performance não refletiu muito bem isso. Seja mais ativo na sua próxima participação da Folia de Monstros!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
cm.sendOk("Parab�ns pela sua vit�ria, entretanto sua performance n�o refletiu muito bem isso. Seja mais ativo na sua pr�xima participa��o da Folia de Monstros!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cm.warp(980000000, 0);
|
cm.warp(980000000, 0);
|
||||||
@@ -140,8 +146,11 @@ function action(mode, type, selection) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
// cm.sendSimple("O que gostaria de fazer? Se você nunca participou da Folia de Monstros, você precisará saber de algumas coisas antes de participar.\r\n#b#L0# Ir para o campo da Folia de Monstros 1.#l\r\n#L1# Aprender sobre a Folia de Monstros.#l\r\n#L2# Trocar #t4001129#.#l");
|
var talk = "O que gostaria de fazer? Se voc� nunca participou da Folia de Monstros, voc� precisar� saber de algumas coisas antes de participar.\r\n#b#L0# Ir para o campo da Folia de Monstros 1.#l\r\n#L3# Ir para o campo da Folia de Monstros 2.#l\r\n#L1# Aprender sobre a Folia de Monstros.#l\r\n#L2# Trocar #t4001129#.#l";
|
||||||
cm.sendSimple("O que gostaria de fazer? Se você nunca participou da Folia de Monstros, você precisará saber de algumas coisas antes de participar.\r\n#b#L0# Ir para o campo da Folia de Monstros 1.#l\r\n#L3# Ir para o campo da Folia de Monstros 2.#l\r\n#L1# Aprender sobre a Folia de Monstros.#l\r\n#L2# Trocar #t4001129#.#l");
|
if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||||
|
talk += "\r\n#L4# ... Can I just refine my ores?#l";
|
||||||
|
}
|
||||||
|
cm.sendSimple(talk);
|
||||||
} else if (status == 1) {
|
} else if (status == 1) {
|
||||||
if (selection == 0) {
|
if (selection == 0) {
|
||||||
if ((cm.getLevel() > 29 && cm.getLevel() < 51) || cm.getPlayer().isGM()) {
|
if ((cm.getLevel() > 29 && cm.getLevel() < 51) || cm.getPlayer().isGM()) {
|
||||||
@@ -150,26 +159,43 @@ function action(mode, type, selection) {
|
|||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
} else if (cm.getLevel() < 30) {
|
} else if (cm.getLevel() < 30) {
|
||||||
cm.sendOk("Você precisa ser no mínimo nível 30 para participar da Folia de Monstros. Fale comigo quando for forte o bastante.");
|
cm.sendOk("Voc� precisa ser no m�nimo n�vel 30 para participar da Folia de Monstros. Fale comigo quando for forte o bastante.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("Sinto muito, mas apenas os jogadores de nível 30~50 podem participar da Folia de Monstros.");
|
cm.sendOk("Sinto muito, mas apenas os jogadores de n�vel 30~50 podem participar da Folia de Monstros.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (selection == 1) {
|
} else if (selection == 1) {
|
||||||
status = 60;
|
status = 60;
|
||||||
cm.sendSimple("O que gostaria de fazer?\r\n#b#L0# O que é a Folia de Monstros?#l\r\n#L1# Visão geral sobre a Folia de Monstros#l\r\n#L2# Informações detalhadas sobre a Folia de Monstros#l\r\n#L3# Nada, de verdade. Mudei de ideia.#l");
|
cm.sendSimple("O que gostaria de fazer?\r\n#b#L0# O que � a Folia de Monstros?#l\r\n#L1# Vis�o geral sobre a Folia de Monstros#l\r\n#L2# Informa��es detalhadas sobre a Folia de Monstros#l\r\n#L3# Nada, de verdade. Mudei de ideia.#l");
|
||||||
} else if (selection == 2) {
|
} else if (selection == 2) {
|
||||||
cm.sendSimple("Lembre-se se você possui #t4001129#, você pode trocá-las por itens. Tenha certeza que você possui #t4001129# suficientes para o item que você deseja. Selecione o item que você gostaria de trocá-las! \r\n#b#L0# #t1122007#(" + n1 + " moedas)#l\r\n#L1# #t2041211#(" + n2 + " moedas)#l\r\n#L2# Armas para Guerreiros#l\r\n#L3# Armas para Bruxos#l\r\n#L4# Armas para Arqueiros#l\r\n#L5# Armas para Gatunos#l");
|
cm.sendSimple("Lembre-se se voc� possui #t4001129#, voc� pode troc�-las por itens. Tenha certeza que voc� possui #t4001129# suficientes para o item que voc� deseja. Selecione o item que voc� gostaria de troc�-las! \r\n#b#L0# #t1122007#(" + n1 + " moedas)#l\r\n#L1# #t2041211#(" + n2 + " moedas)#l\r\n#L2# Armas para Guerreiros#l\r\n#L3# Armas para Bruxos#l\r\n#L4# Armas para Arqueiros#l\r\n#L5# Armas para Gatunos#l");
|
||||||
} else if (selection == 3) {
|
} else if (selection == 3) {
|
||||||
cm.getChar().saveLocation("MONSTER_CARNIVAL");
|
cm.getChar().saveLocation("MONSTER_CARNIVAL");
|
||||||
cm.warp(980030000, 0);
|
cm.warp(980030000, 0);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
} else if (selection == 4) {
|
||||||
|
var selStr = "Very well, instead I offer a steadfast #bore refining#k service for you, taxing #r" + ((feeMultiplier * 100) | 0) + "%#k over the usual fee to synthetize them. What will you do?#b";
|
||||||
|
|
||||||
|
var options = new Array("Refine mineral ores","Refine jewel ores");
|
||||||
|
if(refineCrystals) {
|
||||||
|
options.push("Refine crystal ores");
|
||||||
|
}
|
||||||
|
if(refineRocks) {
|
||||||
|
options.push("Refine plates/jewels");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < options.length; i++){
|
||||||
|
selStr += "\r\n#L" + i + "# " + options[i] + "#l";
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.sendSimple(selStr);
|
||||||
|
|
||||||
|
status = 76;
|
||||||
|
}
|
||||||
} else if (status == 2) {
|
} else if (status == 2) {
|
||||||
select = selection;
|
select = selection;
|
||||||
if (select == 0) {
|
if (select == 0) {
|
||||||
@@ -178,7 +204,7 @@ function action(mode, type, selection) {
|
|||||||
cm.gainItem(4001129, -n1);
|
cm.gainItem(4001129, -n1);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("Verifique e veja se estão faltando #b#t4001129##k ou se seu inventário de Equipamentos está cheio.");
|
cm.sendOk("Verifique e veja se est�o faltando #b#t4001129##k ou se seu invent�rio de Equipamentos est� cheio.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else if (select == 1) {
|
} else if (select == 1) {
|
||||||
@@ -187,25 +213,25 @@ function action(mode, type, selection) {
|
|||||||
cm.gainItem(4001129, -n2);
|
cm.gainItem(4001129, -n2);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("Verifique e veja se estão faltando #b#t4001129##k ou se seu inventário de Uso está cheio.");
|
cm.sendOk("Verifique e veja se est�o faltando #b#t4001129##k ou se seu invent�rio de Uso est� cheio.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else if (select == 2) {//S2 Warrior 26 S3 Magician 6 S4 Bowman 6 S5 Thief 8
|
} else if (select == 2) {//S2 Warrior 26 S3 Magician 6 S4 Bowman 6 S5 Thief 8
|
||||||
status = 10;
|
status = 10;
|
||||||
cm.sendSimple("Por favor tenha certeza que você possui #t4001129# para a arma que você deseja. Selecione a arma que você gostaria de trocar #t4001129# por. As opções que tenho são realmente boas, e eu não sou eu que falo é o povo que diz! \r\n#b#L0# #z1302004#(" + n3 + " moedas)#l\r\n#L1# #z1402006#(" + n3 + " moedas)#l\r\n#L2# #z1302009#(" + n4 + " moedas)#l\r\n#L3# #z1402007#(" + n4 + " moedas)#l\r\n#L4# #z1302010#(" + n5 + " moedas)#l\r\n#L5# #z1402003#(" + n5 + " moedas)#l\r\n#L6# #z1312006#(" + n3 + " moedas)#l\r\n#L7# #z1412004#(" + n3 + " moedas)#l\r\n#L8# #z1312007#(" + n4 + " moedas)#l\r\n#L9# #z1412005#(" + n4 + " moedas)#l\r\n#L10# #z1312008#(" + n5 + " moedas)#l\r\n#L11# #z1412003#(" + n5 + " moedas)#l\r\n#L12# Ir para a próxima página(1/2)#l");
|
cm.sendSimple("Por favor tenha certeza que voc� possui #t4001129# para a arma que voc� deseja. Selecione a arma que voc� gostaria de trocar #t4001129# por. As op��es que tenho s�o realmente boas, e eu n�o sou eu que falo � o povo que diz! \r\n#b#L0# #z1302004#(" + n3 + " moedas)#l\r\n#L1# #z1402006#(" + n3 + " moedas)#l\r\n#L2# #z1302009#(" + n4 + " moedas)#l\r\n#L3# #z1402007#(" + n4 + " moedas)#l\r\n#L4# #z1302010#(" + n5 + " moedas)#l\r\n#L5# #z1402003#(" + n5 + " moedas)#l\r\n#L6# #z1312006#(" + n3 + " moedas)#l\r\n#L7# #z1412004#(" + n3 + " moedas)#l\r\n#L8# #z1312007#(" + n4 + " moedas)#l\r\n#L9# #z1412005#(" + n4 + " moedas)#l\r\n#L10# #z1312008#(" + n5 + " moedas)#l\r\n#L11# #z1412003#(" + n5 + " moedas)#l\r\n#L12# Ir para a pr�xima p�gina(1/2)#l");
|
||||||
} else if (select == 3) {
|
} else if (select == 3) {
|
||||||
status = 20;
|
status = 20;
|
||||||
cm.sendSimple("Selecione a arma que você gostaria de trocar. As armas que eu tenho aqui são extremamente atraentes. Veja você mesmo! \r\n#b#L0# #z1372001#(" + n3 + " moedas)#l\r\n#L1# #z1382018#(" + n3 + " moedas)#l\r\n#L2# #z1372012#(" + n4 + "moedas)#l\r\n#L3# #z1382019#(" + n4 + "moedas)#l\r\n#L4# #z1382001#(" + n5 + " moedas)#l\r\n#L5# #z1372007#(" + n5 + " moedas)#l");
|
cm.sendSimple("Selecione a arma que voc� gostaria de trocar. As armas que eu tenho aqui s�o extremamente atraentes. Veja voc� mesmo! \r\n#b#L0# #z1372001#(" + n3 + " moedas)#l\r\n#L1# #z1382018#(" + n3 + " moedas)#l\r\n#L2# #z1372012#(" + n4 + "moedas)#l\r\n#L3# #z1382019#(" + n4 + "moedas)#l\r\n#L4# #z1382001#(" + n5 + " moedas)#l\r\n#L5# #z1372007#(" + n5 + " moedas)#l");
|
||||||
} else if (select == 4) {
|
} else if (select == 4) {
|
||||||
status = 30;
|
status = 30;
|
||||||
cm.sendSimple("Selecione a arma que você gostaria de trocar. As armas que eu tenho aqui são extremamente atraentes. Veja você mesmo! \r\n#b#L0# #z1452006#(" + n3 + " moedas)#l\r\n#L1# #z1452007#(" + n4 + " moedas)#l\r\n#L2# #z1452008#(" + n5 + " moedas)#l\r\n#L3# #z1462005#(" + n3 + " moedas)#l\r\n#L4# #z1462006#(" + n4 + " moedas)#l\r\n#L5# #z1462007#(" + n5 + " moedas)#l");
|
cm.sendSimple("Selecione a arma que voc� gostaria de trocar. As armas que eu tenho aqui s�o extremamente atraentes. Veja voc� mesmo! \r\n#b#L0# #z1452006#(" + n3 + " moedas)#l\r\n#L1# #z1452007#(" + n4 + " moedas)#l\r\n#L2# #z1452008#(" + n5 + " moedas)#l\r\n#L3# #z1462005#(" + n3 + " moedas)#l\r\n#L4# #z1462006#(" + n4 + " moedas)#l\r\n#L5# #z1462007#(" + n5 + " moedas)#l");
|
||||||
} else if (select == 5) {
|
} else if (select == 5) {
|
||||||
status = 40;
|
status = 40;
|
||||||
cm.sendSimple("Selecione a arma que você gostaria de trocar por. As armas que eu tenho são da maior qualidade. Seleciona a mais atraente para você! \r\n#b#L0# #z1472013#(" + n3 + " moedas)#l\r\n#L1# #z1472017#(" + n4 + "moedas)#l\r\n#L2# #z1472021#(" + n5 + " moedas)#l\r\n#L3# #z1332014#(" + n3 + " moedas)#l\r\n#L4# #z1332031#(" + n4 + "moedas)#l\r\n#L5# #z1332011#(" + n4 + "moedas)#l\r\n#L6# #z1332016#(" + n5 + " moedas)#l\r\n#L7# #z1332003#(" + n5 + " moedas)#l");
|
cm.sendSimple("Selecione a arma que voc� gostaria de trocar por. As armas que eu tenho s�o da maior qualidade. Seleciona a mais atraente para voc�! \r\n#b#L0# #z1472013#(" + n3 + " moedas)#l\r\n#L1# #z1472017#(" + n4 + "moedas)#l\r\n#L2# #z1472021#(" + n5 + " moedas)#l\r\n#L3# #z1332014#(" + n3 + " moedas)#l\r\n#L4# #z1332031#(" + n4 + "moedas)#l\r\n#L5# #z1332011#(" + n4 + "moedas)#l\r\n#L6# #z1332016#(" + n5 + " moedas)#l\r\n#L7# #z1332003#(" + n5 + " moedas)#l");
|
||||||
}
|
}
|
||||||
} else if (status == 11) {
|
} else if (status == 11) {
|
||||||
if (selection == 12) {
|
if (selection == 12) {
|
||||||
cm.sendSimple("Selecione a arma que você gostaria de trocar. As armas que eu tenho aqui são extremamente úteis. Dá uma olhada! \r\n#b#L0# #z1322015#(" + n3 + " moedas)#l\r\n#L1# #z1422008#(" + n3 + " moedas)#l\r\n#L2# #z1322016#(" + n4 + "moedas)#l\r\n#L3# #z1422007#(" + n4 + "moedas)#l\r\n#L4# #z1322017#(" + n5 + " moedas)#l\r\n#L5# #z1422005#(" + n5 + " moedas)#l\r\n#L6# #z1432003#(" + n3 + " moedas)#l\r\n#L7# #z1442003#(" + n3 + " moedas)#l\r\n#L8# #z1432005#(" + n4 + "moedas)#l\r\n#L9# #z1442009#(" + n4 + "moedas)#l\r\n#L10# #z1442005#(" + n5 + " moedas)#l\r\n#L11# #z1432004#(" + n5 + " moedas)#l\r\n#L12# Voltar para a página inicial(2/2)#l");
|
cm.sendSimple("Selecione a arma que voc� gostaria de trocar. As armas que eu tenho aqui s�o extremamente �teis. D� uma olhada! \r\n#b#L0# #z1322015#(" + n3 + " moedas)#l\r\n#L1# #z1422008#(" + n3 + " moedas)#l\r\n#L2# #z1322016#(" + n4 + "moedas)#l\r\n#L3# #z1422007#(" + n4 + "moedas)#l\r\n#L4# #z1322017#(" + n5 + " moedas)#l\r\n#L5# #z1422005#(" + n5 + " moedas)#l\r\n#L6# #z1432003#(" + n3 + " moedas)#l\r\n#L7# #z1442003#(" + n3 + " moedas)#l\r\n#L8# #z1432005#(" + n4 + "moedas)#l\r\n#L9# #z1442009#(" + n4 + "moedas)#l\r\n#L10# #z1442005#(" + n5 + " moedas)#l\r\n#L11# #z1432004#(" + n5 + " moedas)#l\r\n#L12# Voltar para a p�gina inicial(2/2)#l");
|
||||||
} else {
|
} else {
|
||||||
var item = new Array(1302004, 1402006, 1302009, 1402007, 1302010, 1402003, 1312006, 1412004, 1312007, 1412005, 1312008, 1412003);
|
var item = new Array(1302004, 1402006, 1302009, 1402007, 1302010, 1402003, 1312006, 1412004, 1312007, 1412005, 1312008, 1412003);
|
||||||
var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5);
|
var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5);
|
||||||
@@ -214,14 +240,14 @@ function action(mode, type, selection) {
|
|||||||
cm.gainItem(4001129, -cost[selection]);
|
cm.gainItem(4001129, -cost[selection]);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("Você ou não possui #b#t4001129##k suficientes, ou seu inventário está cheio. Verifique novamente.");
|
cm.sendOk("Voc� ou n�o possui #b#t4001129##k suficientes, ou seu invent�rio est� cheio. Verifique novamente.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (status == 12) {
|
} else if (status == 12) {
|
||||||
if (selection == 12) {
|
if (selection == 12) {
|
||||||
status = 10;
|
status = 10;
|
||||||
cm.sendSimple("Por favor tenha certeza que você possui #t4001129# para a arma que você deseja. Selecione a arma que você gostaria de trocar #t4001129# por. As opções que tenho são realmente boas, e eu não sou eu que falo é o povo que diz! \r\n#b#L0# #z1302004#(" + n3 + " moedas)#l\r\n#L1# #z1402006#(" + n3 + " moedas)#l\r\n#L2# #z1302009#(" + n4 + " moedas)#l\r\n#L3# #z1402007#(" + n4 + " moedas)#l\r\n#L4# #z1302010#(" + n5 + " moedas)#l\r\n#L5# #z1402003#(" + n5 + " moedas)#l\r\n#L6# #z1312006#(" + n3 + " moedas)#l\r\n#L7# #z1412004#(" + n3 + " moedas)#l\r\n#L8# #z1312007#(" + n4 + " moedas)#l\r\n#L9# #z1412005#(" + n4 + " moedas)#l\r\n#L10# #z1312008#(" + n5 + " moedas)#l\r\n#L11# #z1412003#(" + n5 + " moedas)#l\r\n#L12# Ir para a próxima página(1/2)#l");
|
cm.sendSimple("Por favor tenha certeza que voc� possui #t4001129# para a arma que voc� deseja. Selecione a arma que voc� gostaria de trocar #t4001129# por. As op��es que tenho s�o realmente boas, e eu n�o sou eu que falo � o povo que diz! \r\n#b#L0# #z1302004#(" + n3 + " moedas)#l\r\n#L1# #z1402006#(" + n3 + " moedas)#l\r\n#L2# #z1302009#(" + n4 + " moedas)#l\r\n#L3# #z1402007#(" + n4 + " moedas)#l\r\n#L4# #z1302010#(" + n5 + " moedas)#l\r\n#L5# #z1402003#(" + n5 + " moedas)#l\r\n#L6# #z1312006#(" + n3 + " moedas)#l\r\n#L7# #z1412004#(" + n3 + " moedas)#l\r\n#L8# #z1312007#(" + n4 + " moedas)#l\r\n#L9# #z1412005#(" + n4 + " moedas)#l\r\n#L10# #z1312008#(" + n5 + " moedas)#l\r\n#L11# #z1412003#(" + n5 + " moedas)#l\r\n#L12# Ir para a pr�xima p�gina(1/2)#l");
|
||||||
} else {
|
} else {
|
||||||
var item = new Array(1322015, 1422008, 1322016, 1422007, 1322017, 1422005, 1432003, 1442003, 1432005, 1442009, 1442005, 1432004);
|
var item = new Array(1322015, 1422008, 1322016, 1422007, 1322017, 1422005, 1432003, 1442003, 1432005, 1442009, 1442005, 1432004);
|
||||||
var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5, n5);
|
var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5, n5);
|
||||||
@@ -230,7 +256,7 @@ function action(mode, type, selection) {
|
|||||||
cm.gainItem(4001129, -cost[selection]);
|
cm.gainItem(4001129, -cost[selection]);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("Você ou não possui #b#t4001129##k suficientes, ou seu inventário está cheio. Verifique novamente.");
|
cm.sendOk("Voc� ou n�o possui #b#t4001129##k suficientes, ou seu invent�rio est� cheio. Verifique novamente.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,7 +268,7 @@ function action(mode, type, selection) {
|
|||||||
cm.gainItem(4001129, -cost[selection]);
|
cm.gainItem(4001129, -cost[selection]);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("Ou você não possui #b#t4001129##k suficientes, ou seu inventário está cheio. Verifique novamente.");
|
cm.sendOk("Ou voc� n�o possui #b#t4001129##k suficientes, ou seu invent�rio est� cheio. Verifique novamente.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else if (status == 31) {
|
} else if (status == 31) {
|
||||||
@@ -253,7 +279,7 @@ function action(mode, type, selection) {
|
|||||||
cm.gainItem(4001129, -cost[selection]);
|
cm.gainItem(4001129, -cost[selection]);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("Ou você não possui #b#t4001129##k suficientes, ou seu inventário está cheio. Verifique novamente.");
|
cm.sendOk("Ou voc� n�o possui #b#t4001129##k suficientes, ou seu invent�rio est� cheio. Verifique novamente.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else if (status == 41) {
|
} else if (status == 41) {
|
||||||
@@ -264,57 +290,213 @@ function action(mode, type, selection) {
|
|||||||
cm.gainItem(4001129, -cost[selection]);
|
cm.gainItem(4001129, -cost[selection]);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("Ou você não possui #b#t4001129##k suficientes, ou seu inventário está cheio. Verifique novamente.");
|
cm.sendOk("Ou voc� n�o possui #b#t4001129##k suficientes, ou seu invent�rio est� cheio. Verifique novamente.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else if (status == 61) {
|
} else if (status == 61) {
|
||||||
select = selection;
|
select = selection;
|
||||||
if (selection == 0) {
|
if (selection == 0) {
|
||||||
cm.sendNext("Haha! Eu sou Spiegelmann, o líder dessa Folia. Eu comecei a primeira #bFolia de Monstros#k aqui, aguardando por viajantes como você para participar dessa extravaganza!");
|
cm.sendNext("Haha! Eu sou Spiegelmann, o l�der dessa Folia. Eu comecei a primeira #bFolia de Monstros#k aqui, aguardando por viajantes como voc� para participar dessa extravaganza!");
|
||||||
} else if (selection == 1) {
|
} else if (selection == 1) {
|
||||||
cm.sendNext("#bFolia de Monstros#k consiste em 2 grupos entrando no campo de batalha, e caçando os monstros invocados pelo outro grupo. É uma #bmissão de combate que determina o vitorioso pela quantia de Pontos de Folia (CP) recebidos#k.");
|
cm.sendNext("#bFolia de Monstros#k consiste em 2 grupos entrando no campo de batalha, e ca�ando os monstros invocados pelo outro grupo. � uma #bmiss�o de combate que determina o vitorioso pela quantia de Pontos de Folia (CP) recebidos#k.");
|
||||||
} else if (selection == 2) {
|
} else if (selection == 2) {
|
||||||
cm.sendNext("Quando entrar no Campo da Folia, você verá a janela da Folia de Monstros aparecer. Tudo que precisa fazer é #bselecionar o que vocêe quer usar, e pressionar OK#k. Muito fácil, né?");
|
cm.sendNext("Quando entrar no Campo da Folia, voc� ver� a janela da Folia de Monstros aparecer. Tudo que precisa fazer � #bselecionar o que voc�e quer usar, e pressionar OK#k. Muito f�cil, n�?");
|
||||||
} else {
|
} else {
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else if (status == 62) {
|
} else if (status == 62) {
|
||||||
if (select == 0) {
|
if (select == 0) {
|
||||||
cm.sendNext("O que é a #bFolia de Monstros#k? Hahaha! Vamos dizer que é uma experiência que jamais esquecerá! É uma #bbatalha contra outros viajantes assim como você!#k");
|
cm.sendNext("O que � a #bFolia de Monstros#k? Hahaha! Vamos dizer que � uma experi�ncia que jamais esquecer�! � uma #bbatalha contra outros viajantes assim como voc�!#k");
|
||||||
} else if (select == 1) {
|
} else if (select == 1) {
|
||||||
cm.sendNext("Quando entrar no Campo da Folia, sua tarefa é #breceber CP caçando os monstros do grupo oposto, e usar estes CP's para distrair o grupo oposto de caçar monstros.#k.");
|
cm.sendNext("Quando entrar no Campo da Folia, sua tarefa � #breceber CP ca�ando os monstros do grupo oposto, e usar estes CP's para distrair o grupo oposto de ca�ar monstros.#k.");
|
||||||
} else if (select == 2) {
|
} else if (select == 2) {
|
||||||
cm.sendNext("Assim que se acostumar com os comandos, tente usar #bas teclas TAB e F1 ~ F12#k. #bTAB alterna entre Invocação de Monstros/Habilidades/Protetor,#k e, #bF1~ F12 possibilita-o de acessar uma das janelas diretamente#k.");
|
cm.sendNext("Assim que se acostumar com os comandos, tente usar #bas teclas TAB e F1 ~ F12#k. #bTAB alterna entre Invoca��o de Monstros/Habilidades/Protetor,#k e, #bF1~ F12 possibilita-o de acessar uma das janelas diretamente#k.");
|
||||||
}
|
}
|
||||||
} else if (status == 63) {
|
} else if (status == 63) {
|
||||||
if (select == 0) {
|
if (select == 0) {
|
||||||
cm.sendNext("Eu sei que é muito perigoso para vocês lutarem uns com os outros usando armas de verdade; e eu não sugeriria um ato tão barbárico. Não meu amigo, o que eu ofereço é competição. A emoção da batalha e a emoção de competir contra pessoas tão fortes e motivadas. Eu ofereço a premissa de que seu grupo e o grupo oposto ambos #binvoquem os monstros, e derrote os monstros invocados pelo grupo adversário. Essa é a essência da Folia de Monstros. Além disso, você pode usar Maple Coins ganhos durante a Folia de Monstros para obter novos itens e armas! #k");
|
cm.sendNext("Eu sei que � muito perigoso para voc�s lutarem uns com os outros usando armas de verdade; e eu n�o sugeriria um ato t�o barb�rico. N�o meu amigo, o que eu ofere�o � competi��o. A emo��o da batalha e a emo��o de competir contra pessoas t�o fortes e motivadas. Eu ofere�o a premissa de que seu grupo e o grupo oposto ambos #binvoquem os monstros, e derrote os monstros invocados pelo grupo advers�rio. Essa � a ess�ncia da Folia de Monstros. Al�m disso, voc� pode usar Maple Coins ganhos durante a Folia de Monstros para obter novos itens e armas! #k");
|
||||||
} else if (select == 1) {
|
} else if (select == 1) {
|
||||||
cm.sendNext("Existem 3 maneiras de distrair o grupo adversário: #bInvodar um monstro, Habilidade, and Protetor#k. Vou dar-lhe um olhar mais aprofundado, se você quiser saber mais sobre 'Instruções detalhadas'.");
|
cm.sendNext("Existem 3 maneiras de distrair o grupo advers�rio: #bInvodar um monstro, Habilidade, and Protetor#k. Vou dar-lhe um olhar mais aprofundado, se voc� quiser saber mais sobre 'Instru��es detalhadas'.");
|
||||||
} else if (select == 2) {
|
} else if (select == 2) {
|
||||||
cm.sendNext("#bInvocar um Monstro#k chama um monstro que ataca o grupo adversário, sob seu controle. Use CP para trazer um Monstro Invocado, e ele irá aparecer na mesma área, atacando o grupo oposto.");
|
cm.sendNext("#bInvocar um Monstro#k chama um monstro que ataca o grupo advers�rio, sob seu controle. Use CP para trazer um Monstro Invocado, e ele ir� aparecer na mesma �rea, atacando o grupo oposto.");
|
||||||
}
|
}
|
||||||
} else if (status == 64) {
|
} else if (status == 64) {
|
||||||
if (select == 0) {
|
if (select == 0) {
|
||||||
cm.sendNext("Claro, não é tão simples assim. Existem outras maneiras de prevenir o outro grupo de caçar monstros, e cabe a você descobrir como fazê-lo. O que acha? Interessado em uma competição amigável?");
|
cm.sendNext("Claro, n�o � t�o simples assim. Existem outras maneiras de prevenir o outro grupo de ca�ar monstros, e cabe a voc� descobrir como faz�-lo. O que acha? Interessado em uma competi��o amig�vel?");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else if (select == 1) {
|
} else if (select == 1) {
|
||||||
cm.sendNext("Por favor lembre-se. Nunca é uma boa ideia guardar seus CP's. #bOs CP's que você usou irão ajudar a determinar o vencedor e o perdedor da Folia.");
|
cm.sendNext("Por favor lembre-se. Nunca � uma boa ideia guardar seus CP's. #bOs CP's que voc� usou ir�o ajudar a determinar o vencedor e o perdedor da Folia.");
|
||||||
} else if (select == 2) {
|
} else if (select == 2) {
|
||||||
cm.sendNext("#bHabilidade#k é uma opção de usar habilidades tais como Escuridão, Fraqueza, e outras para prevenir o grupo oposto de matar outros monstros. São necessários muitos CP's, mas vale muito a pena. O único problema é que eles não duram muito. Use essa tática com sabedoria!");
|
cm.sendNext("#bHabilidade#k � uma op��o de usar habilidades tais como Escurid�o, Fraqueza, e outras para prevenir o grupo oposto de matar outros monstros. S�o necess�rios muitos CP's, mas vale muito a pena. O �nico problema � que eles n�o duram muito. Use essa t�tica com sabedoria!");
|
||||||
}
|
}
|
||||||
} else if (status == 65) {
|
} else if (status == 65) {
|
||||||
if (select == 1) {
|
if (select == 1) {
|
||||||
cm.sendNext("Oh, e não se preocupe em tranformar-se em um fantasma. Na Folia de Monstros, #bvocê não perderá EXP após a morte#k. É realmente uma experência como nenhuma outra!");
|
cm.sendNext("Oh, e n�o se preocupe em tranformar-se em um fantasma. Na Folia de Monstros, #bvoc� n�o perder� EXP ap�s a morte#k. � realmente uma exper�ncia como nenhuma outra!");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else if (select == 2) {
|
} else if (select == 2) {
|
||||||
cm.sendNext("#bProtetor#k é basicamente um item invocado que aumenta drásticamente as habilidades dos monstros invocados pelo seu grupo. Protetor funciona enquanto não for demolido pelo grupo oposto, então eu surigo que você invoque vários monstros primeiro, e então traga o Protetor.");
|
cm.sendNext("#bProtetor#k � basicamente um item invocado que aumenta dr�sticamente as habilidades dos monstros invocados pelo seu grupo. Protetor funciona enquanto n�o for demolido pelo grupo oposto, ent�o eu surigo que voc� invoque v�rios monstros primeiro, e ent�o traga o Protetor.");
|
||||||
}
|
}
|
||||||
} else if (status == 66) {
|
} else if (status == 66) {
|
||||||
cm.sendNext("Por último, enquanto estiver na Folia de Monstros, #bvocê não pode usar items/poções de recuperação que você leva por ai contigo.#k Entretanto, os monstros deixam esses items cair de vez em quando, e #bassim que pegá-los, o item ativará imediatamente#k. É por isso que é importante saber quando pegar estes items.");
|
cm.sendNext("Por �ltimo, enquanto estiver na Folia de Monstros, #bvoc� n�o pode usar items/po��es de recupera��o que voc� leva por ai contigo.#k Entretanto, os monstros deixam esses items cair de vez em quando, e #bassim que peg�-los, o item ativar� imediatamente#k. � por isso que � importante saber quando pegar estes items.");
|
||||||
|
cm.dispose();
|
||||||
|
} else if (status == 77) {
|
||||||
|
var allDone;
|
||||||
|
|
||||||
|
if (selection == 0) {
|
||||||
|
allDone = refineItems(0); // minerals
|
||||||
|
} else if (selection == 1) {
|
||||||
|
allDone = refineItems(1); // jewels
|
||||||
|
} else if (selection == 2 && refineCrystals) {
|
||||||
|
allDone = refineItems(2); // crystals
|
||||||
|
} else if (selection == 2 && !refineCrystals || selection == 3) {
|
||||||
|
allDone = refineRockItems(); // moon/star rock
|
||||||
|
}
|
||||||
|
|
||||||
|
if(allDone) {
|
||||||
|
cm.sendOk("Done. Thanks for showing up~.");
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Done. Be aware some of the items #rcould not be synthetized#k because either you have a lack of space on your ETC inventory or there's not enough mesos to cover the fee.");
|
||||||
|
}
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRefineFee(fee) {
|
||||||
|
return ((feeMultiplier * fee) | 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isRefineTarget(refineType, refineItemid) {
|
||||||
|
if(refineType == 0) { //mineral refine
|
||||||
|
return refineItemid >= 4010000 && refineItemid <= 4010007 && !(refineItemid == 4010007 && !refineSpecials);
|
||||||
|
} else if(refineType == 1) { //jewel refine
|
||||||
|
return refineItemid >= 4020000 && refineItemid <= 4020008 && !(refineItemid == 4020008 && !refineSpecials);
|
||||||
|
} else if(refineType == 2) { //crystal refine
|
||||||
|
return refineItemid >= 4004000 && refineItemid <= 4004004 && !(refineItemid == 4004004 && !refineSpecials);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRockRefineTarget(refineItemid) {
|
||||||
|
if(refineItemid >= 4011000 && refineItemid <= 4011006) {
|
||||||
|
return 0;
|
||||||
|
} else if(refineItemid >= 4021000 && refineItemid <= 4021008) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function refineItems(refineType) {
|
||||||
|
var allDone = true;
|
||||||
|
|
||||||
|
var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]];
|
||||||
|
var itemCount = {};
|
||||||
|
|
||||||
|
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
var it = iter.next();
|
||||||
|
var itemid = it.getItemId();
|
||||||
|
|
||||||
|
if(isRefineTarget(refineType, itemid)) {
|
||||||
|
var ic = itemCount[itemid];
|
||||||
|
|
||||||
|
if(ic != undefined) {
|
||||||
|
itemCount[itemid] += it.getQuantity();
|
||||||
|
} else {
|
||||||
|
itemCount[itemid] = it.getQuantity();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var key in itemCount) {
|
||||||
|
var itemqty = itemCount[key];
|
||||||
|
var itemid = parseInt(key);
|
||||||
|
|
||||||
|
var refineQty = ((itemqty / 10) | 0);
|
||||||
|
if(refineQty <= 0) continue;
|
||||||
|
|
||||||
|
while(true) {
|
||||||
|
itemqty = refineQty * 10;
|
||||||
|
|
||||||
|
var fee = getRefineFee(refineFees[refineType][(itemid % 100) | 0] * refineQty);
|
||||||
|
if(cm.canHold(itemid + 1000, refineQty, itemid, itemqty) && cm.getMeso() >= fee) {
|
||||||
|
cm.gainMeso(-fee);
|
||||||
|
cm.gainItem(itemid, -itemqty);
|
||||||
|
cm.gainItem(itemid + (itemid != 4010007 ? 1000 : 1001), refineQty);
|
||||||
|
|
||||||
|
break;
|
||||||
|
} else if(refineQty <= 1) {
|
||||||
|
allDone = false;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
refineQty--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return allDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
function refineRockItems() {
|
||||||
|
var allDone = true;
|
||||||
|
var minItems = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
|
||||||
|
var minRocks = [2147483647, 2147483647];
|
||||||
|
|
||||||
|
var rockItems = [4011007, 4021009];
|
||||||
|
var rockFees = [10000, 15000];
|
||||||
|
|
||||||
|
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
var it = iter.next();
|
||||||
|
var itemid = it.getItemId();
|
||||||
|
var rockRefine = getRockRefineTarget(itemid);
|
||||||
|
if(rockRefine >= 0) {
|
||||||
|
var rockItem = ((itemid % 100) | 0);
|
||||||
|
var itemqty = it.getQuantity();
|
||||||
|
|
||||||
|
minItems[rockRefine][rockItem] += itemqty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i = 0; i < minRocks.length; i++) {
|
||||||
|
for(var j = 0; j < minItems[i].length; j++) {
|
||||||
|
if(minRocks[i] > minItems[i][j]) {
|
||||||
|
minRocks[i] = minItems[i][j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(minRocks[i] <= 0 || minRocks[i] == 2147483647) continue;
|
||||||
|
|
||||||
|
var refineQty = minRocks[i];
|
||||||
|
while(true) {
|
||||||
|
var fee = getRefineFee(rockFees[i] * refineQty);
|
||||||
|
if(cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) {
|
||||||
|
cm.gainMeso(-fee);
|
||||||
|
|
||||||
|
var j;
|
||||||
|
if(i == 0) {
|
||||||
|
for(j = 4011000; j < 4011007; j++) {
|
||||||
|
cm.gainItem(j, -refineQty);
|
||||||
|
}
|
||||||
|
cm.gainItem(j, refineQty);
|
||||||
|
} else {
|
||||||
|
for(j = 4021000; j < 4021009; j++) {
|
||||||
|
cm.gainItem(j, -refineQty);
|
||||||
|
}
|
||||||
|
cm.gainItem(j, refineQty);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
} else if(refineQty <= 1) {
|
||||||
|
allDone = false;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
refineQty--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return allDone;
|
||||||
|
}
|
||||||
|
|||||||
+21
-21
@@ -1,8 +1,7 @@
|
|||||||
var map = 980030000;
|
var cpqMinLvl = 30;
|
||||||
var minLvl = 30;
|
var cpqMaxLvl = 255;
|
||||||
var maxLvl = 255;
|
var cpqMinAmt = 0;
|
||||||
var minAmt = 0;
|
var cpqMaxAmt = 6;
|
||||||
var maxAmt = 6;
|
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
status = -1;
|
status = -1;
|
||||||
@@ -24,34 +23,35 @@ function action(mode, type, selection) {
|
|||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
if (cm.getParty() == null) {
|
if (cm.getParty() == null) {
|
||||||
status = 10;
|
status = 10;
|
||||||
cm.sendOk("#eÉ necessário criar um grupo antes de começar o Festival de Monstros!#k");
|
cm.sendOk("#e� necess�rio criar um grupo antes de come�ar o Festival de Monstros!#k");
|
||||||
} else if (!cm.isLeader()) {
|
} else if (!cm.isLeader()) {
|
||||||
status = 10;
|
status = 10;
|
||||||
cm.sendOk("Se você quer começar o Festival, avise o #blíder do grupo#k para falar comigo.");
|
cm.sendOk("Se voc� quer come�ar o Festival, avise o #bl�der do grupo#k para falar comigo.");
|
||||||
} else {
|
} else {
|
||||||
|
var leaderMapid = cm.getMapId();
|
||||||
var party = cm.getParty().getMembers();
|
var party = cm.getParty().getMembers();
|
||||||
var inMap = cm.partyMembersInMap();
|
var inMap = cm.partyMembersInMap();
|
||||||
var lvlOk = 0;
|
var lvlOk = 0;
|
||||||
var isInMap = 0;
|
var isOutMap = 0;
|
||||||
for (var i = 0; i < party.size(); i++) {
|
for (var i = 0; i < party.size(); i++) {
|
||||||
if (party.get(i).getLevel() >= minLvl && party.get(i).getLevel() <= maxLvl) {
|
if (party.get(i).getLevel() >= cpqMinLvl && party.get(i).getLevel() <= cpqMaxLvl) {
|
||||||
lvlOk++;
|
lvlOk++;
|
||||||
}
|
|
||||||
if (party.get(i).getPlayer().getMapId()!= 980030000) {
|
if (party.get(i).getPlayer().getMapId() != leaderMapid) {
|
||||||
//isInMap = false;
|
isOutMap++;
|
||||||
isInMap++
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (party >= 1) {
|
if (party >= 1) {
|
||||||
status = 10;
|
status = 10;
|
||||||
cm.sendOk("Você não tem número suficiente de pessoas em seu grupo. Você precisa de um grupo com #b" + minAmt + "#k - #r" + maxAmt + "#k membros e eles devem estar no mapa com você.");
|
cm.sendOk("Voc� n�o tem n�mero suficiente de pessoas em seu grupo. Voc� precisa de um grupo com #b" + cpqMinAmt + "#k - #r" + cpqMaxAmt + "#k membros e eles devem estar no mapa com voc�.");
|
||||||
} else if (lvlOk != inMap) {
|
} else if (lvlOk != inMap) {
|
||||||
status = 10;
|
status = 10;
|
||||||
cm.sendOk("Certifique se todos em seu grupo estão dentre os níveis corretos (" + minLvl + "~" + maxLvl + ")!");
|
cm.sendOk("Certifique se todos em seu grupo est�o dentre os n�veis corretos (" + cpqMinLvl + "~" + cpqMaxLvl + ")!");
|
||||||
} else if (isInMap > 0) {
|
} else if (isOutMap > 0) {
|
||||||
status = 10;
|
status = 10;
|
||||||
cm.sendOk("Existe alguém do grupo que não esta no mapa!");
|
cm.sendOk("Existe algu�m do grupo que n�o esta no mapa!");
|
||||||
} else {
|
} else {
|
||||||
cm.sendCPQMapLists2();
|
cm.sendCPQMapLists2();
|
||||||
}
|
}
|
||||||
@@ -67,10 +67,10 @@ function action(mode, type, selection) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var party = cm.getParty().getMembers();
|
var party = cm.getParty().getMembers();
|
||||||
if ((selection === 0 || selection === 1 ) && party.size() < 2) {
|
if ((selection === 0 || selection === 1 ) && party.size() < 1) {
|
||||||
cm.sendOk("Você precisa de no mínimo 2 player para entrar na competição.");
|
cm.sendOk("Voc� precisa de no m�nimo 2 player para entrar na competi��o.");
|
||||||
} else if ((selection === 2 ) && party.size() < 3) {
|
} else if ((selection === 2 ) && party.size() < 1) {
|
||||||
cm.sendOk("Você precisa de no mínimo 3 player para entrar na competição.");
|
cm.sendOk("Voc� precisa de no m�nimo 3 player para entrar na competi��o.");
|
||||||
} else {
|
} else {
|
||||||
cm.cpqLobby2(selection);
|
cm.cpqLobby2(selection);
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-14
@@ -1,4 +1,3 @@
|
|||||||
importPackage(net.sf.odinms.server.maps);
|
|
||||||
|
|
||||||
var status = 0;
|
var status = 0;
|
||||||
var rnk = -1;
|
var rnk = -1;
|
||||||
@@ -21,26 +20,27 @@ function action(mode, type, selection) {
|
|||||||
status++;
|
status++;
|
||||||
else
|
else
|
||||||
status--;
|
status--;
|
||||||
|
|
||||||
if (cm.getChar().getMap().isCPQLoserMap()) {
|
if (cm.getChar().getMap().isCPQLoserMap()) {
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
if (cm.getChar().getParty() != null) {
|
if (cm.getChar().getParty() != null) {
|
||||||
var shiu = "";
|
var shiu = "";
|
||||||
if (cm.getPlayer().getFestivalPoints() >= 100) {
|
if (cm.getPlayer().getFestivalPoints() >= 300) {
|
||||||
shiu += "#rA#k";
|
shiu += "#rA#k";
|
||||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, apesar da sua excelente performance. A vitória pode ser sua da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha, apesar da sua excelente performance. A vit�ria pode ser sua da pr�xima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
rnk = 10;
|
rnk = 10;
|
||||||
} else if (cm.getPlayer().getFestivalPoints() >= 50 && cm.getPlayer().getFestivalPoints() < 100) {
|
} else if (cm.getPlayer().getFestivalPoints() >= 100) {
|
||||||
shiu += "#rB#k";
|
shiu += "#rB#k";
|
||||||
rnk = 20;
|
rnk = 20;
|
||||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, mesmo com sua ótima performance. Só mais um pouquinho, e a vitória poderia ter sido sua.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha, mesmo com sua �tima performance. S� mais um pouquinho, e a vit�ria poderia ter sido sua.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
} else if (cm.getPlayer().getFestivalPoints() >= 30 && cm.getPlayer().getFestivalPoints() < 50) {
|
} else if (cm.getPlayer().getFestivalPoints() >= 50) {
|
||||||
shiu += "#rC#k";
|
shiu += "#rC#k";
|
||||||
rnk = 30;
|
rnk = 30;
|
||||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha. A vitória está para aqueles que se esforçam. Vejo seus esforços, então a vitória não está tão longe do seu alcance. Continue assim!\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha. A vit�ria est� para aqueles que se esfor�am. Vejo seus esfor�os, ent�o a vit�ria n�o est� t�o longe do seu alcance. Continue assim!\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
} else {
|
} else {
|
||||||
shiu += "#rD#k";
|
shiu += "#rD#k";
|
||||||
rnk = 40;
|
rnk = 40;
|
||||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, e sua performance claramente reflete nisso. Espero mais de você da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
cm.sendOk("Infelizmente, voc� ou empatou ou perdeu a batalha, e sua performance claramente reflete nisso. Espero mais de voc� da pr�xima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cm.warp(980030000, 0);
|
cm.warp(980030000, 0);
|
||||||
@@ -81,19 +81,19 @@ function action(mode, type, selection) {
|
|||||||
if (cm.getPlayer().getFestivalPoints() >= 300) {
|
if (cm.getPlayer().getFestivalPoints() >= 300) {
|
||||||
shi += "#rA#k";
|
shi += "#rA#k";
|
||||||
rnk = 1;
|
rnk = 1;
|
||||||
cm.sendOk("Parabéns pela sua vitória!!! Que ótima performance! O grupo adversário não pôde fazer nada! Espero o mesmo bom trabalho da próxima vez!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
cm.sendOk("Parab�ns pela sua vit�ria!!! Que �tima performance! O grupo advers�rio n�o p�de fazer nada! Espero o mesmo bom trabalho da pr�xima vez!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
} else if (cm.getPlayer().getFestivalPoints() >= 100 && cm.getPlayer().getFestivalPoints() < 300) {
|
} else if (cm.getPlayer().getFestivalPoints() >= 100) {
|
||||||
shi += "#rB#k";
|
shi += "#rB#k";
|
||||||
rnk = 2;
|
rnk = 2;
|
||||||
cm.sendOk("Parabéns pela sua vitória! Isso foi impressionante! Você fez um bom trabalho contra o grupo adversário! Só mais um pouco, e você definitivamente vai conseguir um A na próxima vez. \r\n\r\n#bNota da Folia de Monstros : " + shi);
|
cm.sendOk("Parab�ns pela sua vit�ria! Isso foi impressionante! Voc� fez um bom trabalho contra o grupo advers�rio! S� mais um pouco, e voc� definitivamente vai conseguir um A na pr�xima vez. \r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
} else if (cm.getPlayer().getFestivalPoints() >= 50 && cm.getPlayer().getFestivalPoints() < 100) {
|
} else if (cm.getPlayer().getFestivalPoints() >= 50) {
|
||||||
shi += "#rC#k";
|
shi += "#rC#k";
|
||||||
rnk = 3;
|
rnk = 3;
|
||||||
cm.sendOk("Parabéns pela sua vitória. Você fez algumas coisas cá e lá, mas essa não pode ser considerada uma boa vitória. Espero mais de ti da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
cm.sendOk("Parab�ns pela sua vit�ria. Voc� fez algumas coisas c� e l�, mas essa n�o pode ser considerada uma boa vit�ria. Espero mais de ti da pr�xima vez.\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
} else {
|
} else {
|
||||||
shi += "#rD#k";
|
shi += "#rD#k";
|
||||||
rnk = 4;
|
rnk = 4;
|
||||||
cm.sendOk("Parabéns pela sua vitória, entretanto sua performance não refletiu muito bem isso. Seja mais ativo na sua próxima participação da Folia de Monstros!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
cm.sendOk("Parab�ns pela sua vit�ria, entretanto sua performance n�o refletiu muito bem isso. Seja mais ativo na sua pr�xima participa��o da Folia de Monstros!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cm.warp(980030000, 0);
|
cm.warp(980030000, 0);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
* @Name: So Gong
|
* @Name: So Gong
|
||||||
* @Map(s): Dojo Hall
|
* @Map(s): Dojo Hall
|
||||||
*/
|
*/
|
||||||
importPackage(Packages.server.maps);
|
|
||||||
importPackage(Packages.constants);
|
importPackage(Packages.constants);
|
||||||
|
|
||||||
var disabled = false;
|
var disabled = false;
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
* @Name: So Gong
|
* @Name: So Gong
|
||||||
* @Map(s): Dojo Hall
|
* @Map(s): Dojo Hall
|
||||||
*/
|
*/
|
||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
var disabled = false;
|
var disabled = false;
|
||||||
var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004);
|
var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004);
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
importPackage(Packages.client);
|
|
||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
var status;
|
var status;
|
||||||
var sel;
|
var sel;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
importPackage(Packages.client);
|
|
||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
var status;
|
var status;
|
||||||
var sel;
|
var sel;
|
||||||
|
|||||||
@@ -158,6 +158,12 @@ function action(mode, type, selection) {
|
|||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!cm.getUnclaimedMarriageGifts().isEmpty() || !partner.getClient().getAbstractPlayerInteraction().getUnclaimedMarriageGifts().isEmpty()) {
|
||||||
|
cm.sendOk("Eerhm... I'm sorry, something doesn't seem right according to the Amoria's Wedding Gift Registry reserve. Please check in the situation with #b#p9201014##k.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var hasCommon = cm.haveItem(weddingEntryTicketCommon);
|
var hasCommon = cm.haveItem(weddingEntryTicketCommon);
|
||||||
var hasPremium = cm.haveItem(weddingEntryTicketPremium);
|
var hasPremium = cm.haveItem(weddingEntryTicketPremium);
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ function action(mode, type, selection) {
|
|||||||
var eim = cm.getEventInstance();
|
var eim = cm.getEventInstance();
|
||||||
if(eim == null) {
|
if(eim == null) {
|
||||||
cm.warp(680000000,0);
|
cm.warp(680000000,0);
|
||||||
//cm.criarLista();
|
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -72,7 +71,9 @@ function action(mode, type, selection) {
|
|||||||
cm.sendOk("Congratulations on your wedding. Please talk to #b#p9201007##k to start the afterparty.");
|
cm.sendOk("Congratulations on your wedding. Please talk to #b#p9201007##k to start the afterparty.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else if(hasEngagement) {
|
} else if(hasEngagement) {
|
||||||
cm.criarLista();
|
if (!cm.createMarriageWishlist()) {
|
||||||
|
cm.sendOk("You have already sent your wishlist...");
|
||||||
|
}
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("You do not have the required item to continue through this wedding. Unfortunately, it's over...");
|
cm.sendOk("You do not have the required item to continue through this wedding. Unfortunately, it's over...");
|
||||||
|
|||||||
@@ -158,6 +158,12 @@ function action(mode, type, selection) {
|
|||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!cm.getUnclaimedMarriageGifts().isEmpty() || !partner.getClient().getAbstractPlayerInteraction().getUnclaimedMarriageGifts().isEmpty()) {
|
||||||
|
cm.sendOk("Eerhm... I'm sorry, something doesn't seem right according to the Amoria's Wedding Gift Registry reserve. Please check in the situation with #b#p9201014##k.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var hasCommon = cm.haveItem(weddingEntryTicketCommon);
|
var hasCommon = cm.haveItem(weddingEntryTicketCommon);
|
||||||
var hasPremium = cm.haveItem(weddingEntryTicketPremium);
|
var hasPremium = cm.haveItem(weddingEntryTicketPremium);
|
||||||
|
|||||||
@@ -74,7 +74,9 @@ function action(mode, type, selection) {
|
|||||||
cm.sendOk("You guys totally rocked the stage!!! Go go, talk to #b#p9201007##k to start the afterparty.");
|
cm.sendOk("You guys totally rocked the stage!!! Go go, talk to #b#p9201007##k to start the afterparty.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else if(hasEngagement) {
|
} else if(hasEngagement) {
|
||||||
cm.sendOk("Please continue rocking on the stage, you are our superstars today!");
|
if (!cm.createMarriageWishlist()) {
|
||||||
|
cm.sendOk("You have already sent your wishlist...");
|
||||||
|
}
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("Oh, hey, where are the credentials for the this so-lauded party? Oh man, we can't continue at this rate now... Sorry, the party is over.");
|
cm.sendOk("Oh, hey, where are the credentials for the this so-lauded party? Oh man, we can't continue at this rate now... Sorry, the party is over.");
|
||||||
|
|||||||
+90
-4
@@ -27,12 +27,22 @@
|
|||||||
1.0 - First Version by Angel
|
1.0 - First Version by Angel
|
||||||
2.0 - Second Version by happydud3 & XotiCraze
|
2.0 - Second Version by happydud3 & XotiCraze
|
||||||
3.0 - Third Version by RonanLana (HeavenMS)
|
3.0 - Third Version by RonanLana (HeavenMS)
|
||||||
4.0 - Four Version bby Drago(MapleStorySA)
|
4.0 - Four Version bby Drago (MapleStorySA)
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
**/
|
**/
|
||||||
var status = -1;
|
var status = -1;
|
||||||
|
|
||||||
|
var marriageRoom;
|
||||||
|
var marriageAction = 0;
|
||||||
|
var marriageGifts;
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
|
marriageRoom = cm.getPlayer().getMarriageInstance() != null;
|
||||||
|
if (!marriageRoom) {
|
||||||
|
marriageGifts = cm.getUnclaimedMarriageGifts();
|
||||||
|
marriageAction = (!marriageGifts.isEmpty() ? 2 : ((cm.haveItem(4031423) || cm.haveItem(4031424)) ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
status = -1;
|
status = -1;
|
||||||
action(1, 0, 0);
|
action(1, 0, 0);
|
||||||
}
|
}
|
||||||
@@ -44,8 +54,84 @@ function action(mode, type, selection) {
|
|||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (status == 0) {
|
if (marriageRoom) {
|
||||||
cm.enviarLista();
|
if (status == 0) {
|
||||||
cm.dispose();
|
var talk = "Hi there, welcome to the wedding's Gift Registry. From which spouse's wishlist would you like to take a look?";
|
||||||
|
var options = ["Groom", "Bride"];
|
||||||
|
|
||||||
|
cm.sendSimple(talk + "\r\n\r\n#b" + generateSelectionMenu(options) + "#k");
|
||||||
|
} else {
|
||||||
|
cm.sendMarriageWishlist(selection == 0);
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (marriageAction == 2) { // unclaimed gifts
|
||||||
|
if (status == 0) {
|
||||||
|
var talk = "Hi there, it seems you have unclaimed gifts from your wedding. Claim them here on the wedding's Gift Registry reserve.";
|
||||||
|
cm.sendNext(talk);
|
||||||
|
} else {
|
||||||
|
cm.sendMarriageGifts(marriageGifts);
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else if (marriageAction == 1) { // onyx prizes
|
||||||
|
if (status == 0) {
|
||||||
|
var msg = "Hello I exchange Onyx Chest for Bride and Groom and the Onyx Chest for prizes!#b";
|
||||||
|
var choice1 = new Array("I have an Onyx Chest for Bride and Groom", "I have an Onyx Chest");
|
||||||
|
for (var i = 0; i < choice1.length; i++) {
|
||||||
|
msg += "\r\n#L" + i + "#" + choice1[i] + "#l";
|
||||||
|
}
|
||||||
|
cm.sendSimple(msg);
|
||||||
|
} else if (status == 1) {
|
||||||
|
if (selection == 0) {
|
||||||
|
if (cm.haveItem(4031424)) {
|
||||||
|
if (cm.getPlayer().isMarried()) { // thanks MedicOP for solving an issue here
|
||||||
|
if(cm.getInventory(2).getNextFreeSlot() >= 0) {
|
||||||
|
var rand = Math.floor(Math.random() * bgPrizes.length);
|
||||||
|
cm.gainItem(bgPrizes[rand][0], bgPrizes[rand][1]);
|
||||||
|
|
||||||
|
cm.gainItem(4031424,-1);
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("You don't have a free USE slot right now.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cm.sendOk("You must be married to claim the prize for this box.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cm.sendOk("You don't have an Onyx Chest for Bride and Groom.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else if (selection == 1) {
|
||||||
|
if (cm.haveItem(4031423)) {
|
||||||
|
if(cm.getInventory(2).getNextFreeSlot() >= 0) {
|
||||||
|
var rand = Math.floor(Math.random() * cmPrizes.length);
|
||||||
|
cm.gainItem(cmPrizes[rand][0], cmPrizes[rand][1]);
|
||||||
|
|
||||||
|
cm.gainItem(4031423,-1);
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("You don't have a free USE slot right now.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cm.sendOk("You don't have an Onyx Chest.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cm.sendOk("Hi there, welcome to Amoria's Wedding Gift Registry reserve. We redistribute and tender gifts for both wedding spouses and lucky ceremonial attenders.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateSelectionMenu(array) {
|
||||||
|
var menu = "";
|
||||||
|
for (var i = 0; i < array.length; i++) {
|
||||||
|
menu += "#L" + i + "#" + array[i] + "#l\r\n";
|
||||||
|
}
|
||||||
|
return menu;
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,6 @@ function action(mode, type, selection) {
|
|||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
if (mode == 0) {
|
if (mode == 0) {
|
||||||
cm.sendOk("Come back once you have thought about it some more.");
|
|
||||||
cm.getChar().setChallenged(false);
|
cm.getChar().setChallenged(false);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
@@ -46,7 +45,7 @@ function action(mode, type, selection) {
|
|||||||
cm.getChar().getParty().setEnemy(ch.getParty());
|
cm.getChar().getParty().setEnemy(ch.getParty());
|
||||||
cm.getChar().setChallenged(false);
|
cm.getChar().setChallenged(false);
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("O numero de players entre os times não esta igual.");
|
cm.sendOk("O numero de players entre os times nao esta igual.");
|
||||||
}
|
}
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
[CelticMS] Monster Carnival Reviving Field 1
|
[CelticMS] Monster Carnival Reviving Field 1
|
||||||
@@ -6,5 +5,6 @@ importPackage(Packages.server.maps);
|
|||||||
|
|
||||||
function enter(pi) {
|
function enter(pi) {
|
||||||
pi.warp(980000101, 0);
|
pi.warp(980000101, 0);
|
||||||
|
pi.playPortalSound();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
[CelticMS] Monster Carnival Reviving Field 1
|
[CelticMS] Monster Carnival Reviving Field 1
|
||||||
@@ -6,5 +5,6 @@ importPackage(Packages.server.maps);
|
|||||||
|
|
||||||
function enter(pi) {
|
function enter(pi) {
|
||||||
pi.warp(980000201, 0);
|
pi.warp(980000201, 0);
|
||||||
|
pi.playPortalSound();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
[CelticMS] Monster Carnival Reviving Field 1
|
[CelticMS] Monster Carnival Reviving Field 1
|
||||||
@@ -15,5 +14,6 @@ function enter(pi) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pi.warp(980000301, portal);
|
pi.warp(980000301, portal);
|
||||||
|
pi.playPortalSound();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
[CelticMS] Monster Carnival Reviving Field 1
|
[CelticMS] Monster Carnival Reviving Field 1
|
||||||
@@ -15,5 +14,6 @@ function enter(pi) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pi.warp(980000401, portal);
|
pi.warp(980000401, portal);
|
||||||
|
pi.playPortalSound();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
[CelticMS] Monster Carnival Reviving Field 1
|
[CelticMS] Monster Carnival Reviving Field 1
|
||||||
@@ -6,5 +5,6 @@ importPackage(Packages.server.maps);
|
|||||||
|
|
||||||
function enter(pi) {
|
function enter(pi) {
|
||||||
pi.warp(980000501, 0);
|
pi.warp(980000501, 0);
|
||||||
|
pi.playPortalSound();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
[CelticMS] Monster Carnival Reviving Field 1
|
[CelticMS] Monster Carnival Reviving Field 1
|
||||||
@@ -6,5 +5,6 @@ importPackage(Packages.server.maps);
|
|||||||
|
|
||||||
function enter(pi) {
|
function enter(pi) {
|
||||||
pi.warp(980000601, 0);
|
pi.warp(980000601, 0);
|
||||||
|
pi.playPortalSound();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,6 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
importPackage(Packages.server.maps);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*/
|
|
||||||
|
|
||||||
function enter(pi) {
|
function enter(pi) {
|
||||||
var returnMap = pi.getPlayer().getSavedLocation("MONSTER_CARNIVAL");
|
var returnMap = pi.getPlayer().getSavedLocation("MONSTER_CARNIVAL");
|
||||||
if (returnMap < 0) {
|
if (returnMap < 0) {
|
||||||
@@ -31,5 +26,6 @@ function enter(pi) {
|
|||||||
}
|
}
|
||||||
var target = pi.getPlayer().getClient().getChannelServer().getMapFactory().getMap(returnMap);
|
var target = pi.getPlayer().getClient().getChannelServer().getMapFactory().getMap(returnMap);
|
||||||
pi.getPlayer().changeMap(target);
|
pi.getPlayer().changeMap(target);
|
||||||
|
pi.playPortalSound();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -20765,6 +20765,472 @@ USE `heavenms`;
|
|||||||
(9400606, 4031348, 1, 1, 0, 100000),
|
(9400606, 4031348, 1, 1, 0, 100000),
|
||||||
(9400606, 0, 25000, 30000, 0, 600000);
|
(9400606, 0, 25000, 30000, 0, 600000);
|
||||||
|
|
||||||
|
DELETE FROM temp_data WHERE dropperid >= 9300127 AND dropperid <= 9300136;
|
||||||
|
DELETE FROM temp_data WHERE dropperid >= 9300315 AND dropperid <= 9300324;
|
||||||
|
|
||||||
|
# add CPQ items, CPQ specific items found thanks to Dragohe4rt
|
||||||
|
INSERT IGNORE INTO temp_data (`dropperid`, `itemid`, `minimum_quantity`, `maximum_quantity`, `questid`, `chance`) VALUES
|
||||||
|
(9300127, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300127, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300127, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300128, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300128, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300128, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300129, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300129, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300129, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300130, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300130, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300130, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300131, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300131, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300131, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300132, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300132, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300132, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300133, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300133, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300133, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300134, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300134, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300134, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300135, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300135, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300135, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300136, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300136, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300136, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300315, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300315, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300315, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300316, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300316, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300316, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300317, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300317, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300317, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300318, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300318, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300318, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300319, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300319, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300319, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300320, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300320, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300320, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300321, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300321, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300321, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300322, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300322, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300322, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300323, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300323, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300323, 4001129, 1, 1, 0, 12987),
|
||||||
|
(9300324, 2022157, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022158, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022159, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022160, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022161, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022162, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022163, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022164, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022165, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022166, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022167, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022168, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022169, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022170, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022171, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022172, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022173, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022174, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022175, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022176, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022177, 1, 1, 0, 200000),
|
||||||
|
(9300324, 2022178, 1, 1, 0, 200000),
|
||||||
|
(9300324, 4001129, 1, 1, 0, 12987);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `drop_data` (
|
CREATE TABLE IF NOT EXISTS `drop_data` (
|
||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
`dropperid` int(11) NOT NULL,
|
`dropperid` int(11) NOT NULL,
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ import scripting.event.EventInstanceManager;
|
|||||||
import server.CashShop;
|
import server.CashShop;
|
||||||
import server.MapleItemInformationProvider;
|
import server.MapleItemInformationProvider;
|
||||||
import server.MapleItemInformationProvider.ScriptedItem;
|
import server.MapleItemInformationProvider.ScriptedItem;
|
||||||
|
import server.MapleMarriage;
|
||||||
import server.MaplePortal;
|
import server.MaplePortal;
|
||||||
import server.MapleShop;
|
import server.MapleShop;
|
||||||
import server.MapleStatEffect;
|
import server.MapleStatEffect;
|
||||||
@@ -130,7 +131,7 @@ import client.processor.FredrickProcessor;
|
|||||||
import constants.ExpTable;
|
import constants.ExpTable;
|
||||||
import constants.GameConstants;
|
import constants.GameConstants;
|
||||||
import constants.ItemConstants;
|
import constants.ItemConstants;
|
||||||
import constants.LinguaConstants;
|
import constants.LanguageConstants;
|
||||||
import constants.ServerConstants;
|
import constants.ServerConstants;
|
||||||
import constants.skills.Aran;
|
import constants.skills.Aran;
|
||||||
import constants.skills.Beginner;
|
import constants.skills.Beginner;
|
||||||
@@ -166,6 +167,7 @@ import server.life.MobSkillFactory;
|
|||||||
import server.maps.MapleMapItem;
|
import server.maps.MapleMapItem;
|
||||||
import net.server.audit.locks.MonitoredLockType;
|
import net.server.audit.locks.MonitoredLockType;
|
||||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||||
|
import scripting.AbstractPlayerInteraction;
|
||||||
|
|
||||||
public class MapleCharacter extends AbstractMapleCharacterObject {
|
public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||||
private static final MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
private static final MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||||
@@ -277,7 +279,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
private ScheduledFuture<?> extraRecoveryTask = null;
|
private ScheduledFuture<?> extraRecoveryTask = null;
|
||||||
private ScheduledFuture<?> chairRecoveryTask = null;
|
private ScheduledFuture<?> chairRecoveryTask = null;
|
||||||
private ScheduledFuture<?> pendantOfSpirit = null; //1122017
|
private ScheduledFuture<?> pendantOfSpirit = null; //1122017
|
||||||
public ScheduledFuture<?> timer;
|
private ScheduledFuture<?> cpqSchedule = null;
|
||||||
private Lock chrLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_CHR, true);
|
private Lock chrLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_CHR, true);
|
||||||
private Lock evtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_EVT, true);
|
private Lock evtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_EVT, true);
|
||||||
private Lock petLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PET, true);
|
private Lock petLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PET, true);
|
||||||
@@ -4383,6 +4385,16 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
evtLock.unlock();
|
evtLock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MapleMarriage getMarriageInstance() {
|
||||||
|
EventInstanceManager eim = getEventInstance();
|
||||||
|
|
||||||
|
if (eim != null || !(eim instanceof MapleMarriage)) {
|
||||||
|
return (MapleMarriage) eim;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void resetExcluded(int petId) {
|
public void resetExcluded(int petId) {
|
||||||
chrLock.lock();
|
chrLock.lock();
|
||||||
@@ -9848,6 +9860,15 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
this.partyQuest = pq;
|
this.partyQuest = pq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCpqTimer(ScheduledFuture timer) {
|
||||||
|
this.cpqSchedule = timer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearCpqTimer() {
|
||||||
|
if (cpqSchedule != null) { cpqSchedule.cancel(true); }
|
||||||
|
cpqSchedule = null;
|
||||||
|
}
|
||||||
|
|
||||||
public final void empty(final boolean remove) {
|
public final void empty(final boolean remove) {
|
||||||
if (dragonBloodSchedule != null) { dragonBloodSchedule.cancel(true); }
|
if (dragonBloodSchedule != null) { dragonBloodSchedule.cancel(true); }
|
||||||
dragonBloodSchedule = null;
|
dragonBloodSchedule = null;
|
||||||
@@ -9886,8 +9907,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
if (pendantOfSpirit != null) { pendantOfSpirit.cancel(true); }
|
if (pendantOfSpirit != null) { pendantOfSpirit.cancel(true); }
|
||||||
pendantOfSpirit = null;
|
pendantOfSpirit = null;
|
||||||
|
|
||||||
if (timer != null) { timer.cancel(true); }
|
clearCpqTimer();
|
||||||
timer = null;
|
|
||||||
|
|
||||||
evtLock.lock();
|
evtLock.lock();
|
||||||
try {
|
try {
|
||||||
@@ -10130,9 +10150,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
private MapleFitness fitness;
|
private MapleFitness fitness;
|
||||||
private MapleOla ola;
|
private MapleOla ola;
|
||||||
private long snowballattack;
|
private long snowballattack;
|
||||||
public static final List<String> itens = new ArrayList();
|
|
||||||
public static final List<Item> item = new ArrayList();
|
|
||||||
|
|
||||||
public byte getTeam() {
|
public byte getTeam() {
|
||||||
return team;
|
return team;
|
||||||
}
|
}
|
||||||
@@ -10289,38 +10307,5 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
public int getLingua() {
|
public int getLingua() {
|
||||||
return getClient().getLingua();
|
return getClient().getLingua();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setItens(String item) {
|
|
||||||
if (!itens.contains(item)) {
|
|
||||||
this.itens.add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<String> getItens() {
|
|
||||||
return itens;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEquips(Item item) {
|
|
||||||
this.item.add(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Item> getItem() {
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Item getItemid(int numb) {
|
|
||||||
return this.item.get(numb);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeItem(Item item) {
|
|
||||||
if (this.item.contains(item)) {
|
|
||||||
this.item.remove(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void obterItens() {
|
|
||||||
for (Item item : getItem()) {
|
|
||||||
getClient().getAbstractPlayerInteraction().gainItem(item.getItemId(), item.getQuantity());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
package client;
|
package client;
|
||||||
|
|
||||||
import tools.Randomizer;
|
import constants.GameConstants;
|
||||||
|
|
||||||
public enum MapleDisease {
|
public enum MapleDisease {
|
||||||
NULL(0x0),
|
NULL(0x0),
|
||||||
@@ -39,16 +39,20 @@ public enum MapleDisease {
|
|||||||
|
|
||||||
private long i;
|
private long i;
|
||||||
private boolean first;
|
private boolean first;
|
||||||
private int disease;
|
private int mobskill;
|
||||||
|
|
||||||
private MapleDisease(long i) {
|
private MapleDisease(long i) {
|
||||||
this.i = i;
|
this(i, false, 0);
|
||||||
this.first = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MapleDisease(long i, int disease) {
|
private MapleDisease(long i, int skill) {
|
||||||
|
this(i, false, skill);
|
||||||
|
}
|
||||||
|
|
||||||
|
private MapleDisease(long i, boolean first, int skill) {
|
||||||
this.i = i;
|
this.i = i;
|
||||||
this.disease = disease;
|
this.first = first;
|
||||||
|
this.mobskill = skill;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getValue() {
|
public long getValue() {
|
||||||
@@ -56,11 +60,11 @@ public enum MapleDisease {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFirst() {
|
public boolean isFirst() {
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDisease() {
|
public int getDisease() {
|
||||||
return disease;
|
return mobskill;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MapleDisease ordinal(int ord) {
|
public static MapleDisease ordinal(int ord) {
|
||||||
@@ -72,13 +76,8 @@ public enum MapleDisease {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final MapleDisease getRandom() {
|
public static final MapleDisease getRandom() {
|
||||||
while (true) {
|
MapleDisease[] diseases = GameConstants.CPQ_DISEASES;
|
||||||
for (MapleDisease dis : MapleDisease.values()) {
|
return diseases[(int) (Math.random() * diseases.length)];
|
||||||
if (Randomizer.nextInt(MapleDisease.values().length) == 0) {
|
|
||||||
return dis;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final MapleDisease getBySkill(final int skill) {
|
public static final MapleDisease getBySkill(final int skill) {
|
||||||
@@ -90,4 +89,4 @@ public enum MapleDisease {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,8 @@ public enum ItemFactory {
|
|||||||
CASH_CYGNUS(4, true),
|
CASH_CYGNUS(4, true),
|
||||||
CASH_ARAN(5, true),
|
CASH_ARAN(5, true),
|
||||||
MERCHANT(6, false),
|
MERCHANT(6, false),
|
||||||
CASH_OVERALL(7, true);
|
CASH_OVERALL(7, true),
|
||||||
|
MARRIAGE_GIFTS(8, false);
|
||||||
private final int value;
|
private final int value;
|
||||||
private final boolean account;
|
private final boolean account;
|
||||||
private static final Lock locks[] = new Lock[200]; // thanks Masterrulax for pointing out a bottleneck issue here
|
private static final Lock locks[] = new Lock[200]; // thanks Masterrulax for pointing out a bottleneck issue here
|
||||||
|
|||||||
@@ -436,7 +436,16 @@ public class MapleInventory implements Iterable<Item> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkSpot(MapleCharacter chr, Item item) { // thanks Vcoc for noticing pshops not checking item stacks when taking item back
|
public static boolean checkSpot(MapleCharacter chr, Item item) { // thanks Vcoc for noticing pshops not checking item stacks when taking item back
|
||||||
return checkSpotsAndOwnership(chr, Collections.singletonList(new Pair<>(item, item.getInventoryType())));
|
return checkSpot(chr, Collections.singletonList(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean checkSpot(MapleCharacter chr, List<Item> items) {
|
||||||
|
List<Pair<Item, MapleInventoryType>> listItems = new LinkedList<>();
|
||||||
|
for (Item item : items) {
|
||||||
|
listItems.add(new Pair<>(item, item.getInventoryType()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return checkSpotsAndOwnership(chr, listItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkSpots(MapleCharacter chr, List<Pair<Item, MapleInventoryType>> items) {
|
public static boolean checkSpots(MapleCharacter chr, List<Pair<Item, MapleInventoryType>> items) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package constants;
|
package constants;
|
||||||
|
|
||||||
|
import client.MapleDisease;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -33,6 +34,9 @@ public class GameConstants {
|
|||||||
private final static NumberFormat nfFormatter = new DecimalFormat("#,###,###,###");
|
private final static NumberFormat nfFormatter = new DecimalFormat("#,###,###,###");
|
||||||
private final static NumberFormat nfParser = NumberFormat.getInstance(ServerConstants.USE_UNITPRICE_WITH_COMMA ? Locale.FRANCE : Locale.UK);
|
private final static NumberFormat nfParser = NumberFormat.getInstance(ServerConstants.USE_UNITPRICE_WITH_COMMA ? Locale.FRANCE : Locale.UK);
|
||||||
|
|
||||||
|
public static final MapleDisease[] CPQ_DISEASES = {MapleDisease.SLOW, MapleDisease.SEDUCE, MapleDisease.STUN, MapleDisease.POISON,
|
||||||
|
MapleDisease.SEAL, MapleDisease.DARKNESS, MapleDisease.WEAKEN, MapleDisease.CURSE};
|
||||||
|
|
||||||
public static int getPlayerBonusDropRate(int slot) {
|
public static int getPlayerBonusDropRate(int slot) {
|
||||||
return(DROP_RATE_GAIN[slot]);
|
return(DROP_RATE_GAIN[slot]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package constants;
|
||||||
|
|
||||||
|
import client.MapleCharacter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Drago - Dragohe4rt
|
||||||
|
*/
|
||||||
|
public class LanguageConstants {
|
||||||
|
// Portugues
|
||||||
|
public static String CPQAzul;
|
||||||
|
public static String CPQErro;
|
||||||
|
public static String CPQEntrada;
|
||||||
|
public static String CPQEscolha;
|
||||||
|
public static String CPQVermelho;
|
||||||
|
public static String CPQPlayerExit;
|
||||||
|
public static String CPQEntradaLobby;
|
||||||
|
public static String CPQInicioEscolha;
|
||||||
|
public static String CPQTempoExtendido;
|
||||||
|
public static String CPQLiderNaoEncontrado;
|
||||||
|
public static String CPQInicioEscolhaEmEscolha;
|
||||||
|
public static String CPQInicioEscolhaEnviada;
|
||||||
|
|
||||||
|
public static LanguageConstants Linguas(MapleCharacter chr) {
|
||||||
|
if (chr.getLingua() == 0) {
|
||||||
|
LanguageConstants.CPQAzul = "Maple Azul";
|
||||||
|
LanguageConstants.CPQVermelho = "Maple Vermelho";
|
||||||
|
LanguageConstants.CPQTempoExtendido = "O tempo foi estendido.";
|
||||||
|
LanguageConstants.CPQPlayerExit = " deixou o Carnaval de Monstros.";
|
||||||
|
LanguageConstants.CPQErro = "Ocorreu um problema. Favor recriar a sala.";
|
||||||
|
LanguageConstants.CPQLiderNaoEncontrado = "Nao foi possivel encontrar o Lider.";
|
||||||
|
LanguageConstants.CPQInicioEscolha = "Inscreva-se no Festival de Monstros!\\r\\n";
|
||||||
|
LanguageConstants.CPQInicioEscolhaEmEscolha = "O grupo esta respondendo um desafio no momento.";
|
||||||
|
LanguageConstants.CPQInicioEscolhaEnviada = "Um desafio foi enviado para o grupo na sala. Aguarde um momento.";
|
||||||
|
LanguageConstants.CPQEscolha = "Nao foi possivel encontrar um grupo nesta sala.\\r\\nProvavelmente o grupo foi desfeito dentro da sala!";
|
||||||
|
LanguageConstants.CPQEntradaLobby = "Agora voce ira receber desafios de outros grupos. Se voce nao aceitar um desafio em 3 minutos, voce sera levado para fora.";
|
||||||
|
LanguageConstants.CPQEntrada = "Voce pode selecionar \"Invocar Monstros\", \"Habilidade\", ou \"Protetor\" como sua tatica durante o Carnaval dos Monstros. Use Tab a F1~F12 para acesso rapido!";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} else if (chr.getLingua() == 1) {
|
||||||
|
LanguageConstants.CPQAzul = "Maple Azul";
|
||||||
|
LanguageConstants.CPQVermelho = "Maple Rojo";
|
||||||
|
LanguageConstants.CPQTempoExtendido = "El tiempo se ha ampliado.";
|
||||||
|
LanguageConstants.CPQPlayerExit = " ha dejado el Carnaval de Monstruos.";
|
||||||
|
LanguageConstants.CPQLiderNaoEncontrado = "No se pudo encontrar el Lider.";
|
||||||
|
LanguageConstants.CPQInicioEscolha = "!Inscribete en el Festival de Monstruos!\\r\\n";
|
||||||
|
LanguageConstants.CPQErro = "Se ha producido un problema. Por favor, volver a crear una sala.";
|
||||||
|
LanguageConstants.CPQInicioEscolhaEmEscolha = "El grupo esta respondiendo un desafio en el momento.";
|
||||||
|
LanguageConstants.CPQInicioEscolhaEnviada = "Un desafio fue enviado al grupo en la sala. Espera un momento.";
|
||||||
|
LanguageConstants.CPQEscolha = "No se pudo encontrar un grupo en esta sala.\\r\\nProbablemente el grupo fue deshecho dentro de la sala!";
|
||||||
|
LanguageConstants.CPQEntradaLobby = "Ahora usted recibira los retos de otros grupos. Si usted no acepta un desafio en 3 minutos, usted sera llevado hacia fuera.";
|
||||||
|
LanguageConstants.CPQEntrada = "Usted puede seleccionar \"Invocar Monstruos \", \"Habilidad \", o \"Protector \" como su tactica durante el Carnaval de los Monstruos. Utilice Tab y F1 ~ F12 para acceso rapido!";
|
||||||
|
|
||||||
|
|
||||||
|
} else if (chr.getLingua() == 2) {
|
||||||
|
LanguageConstants.CPQAzul = "Maple Blue";
|
||||||
|
LanguageConstants.CPQVermelho = "Maple Red";
|
||||||
|
LanguageConstants.CPQPlayerExit = " left the Carnival of Monsters.";
|
||||||
|
LanguageConstants.CPQTempoExtendido = "The time has been extended.";
|
||||||
|
LanguageConstants.CPQLiderNaoEncontrado = "Could not find the Leader.";
|
||||||
|
LanguageConstants.CPQErro = "There was a problem. Please re-create a room.";
|
||||||
|
LanguageConstants.CPQInicioEscolha = "Sign up for the Monster Festival!\\r\\n";
|
||||||
|
LanguageConstants.CPQInicioEscolhaEmEscolha = "The group is currently facing a challenge.";
|
||||||
|
LanguageConstants.CPQInicioEscolhaEnviada = "A challenge has been sent to the group in the room. Please wait a while.";
|
||||||
|
LanguageConstants.CPQEscolha = "We could not find a group in this room.\\r\\nProbably the group was scrapped inside the room!";
|
||||||
|
LanguageConstants.CPQEntradaLobby = "You will now receive challenges from other groups. If you do not accept a challenge within 3 minutes, you will be taken out.";
|
||||||
|
LanguageConstants.CPQEntrada = "You can select \"Summon Monsters \", \"Ability \", or \"Protector \" as your tactic during the Monster Carnival. Use Tab and F1 ~ F12 for quick access!";
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
package constants;
|
|
||||||
|
|
||||||
import client.MapleCharacter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Drago - Dragohe4rt
|
|
||||||
*/
|
|
||||||
public class LinguaConstants {
|
|
||||||
// Portugues
|
|
||||||
public static String CPQAzul;
|
|
||||||
public static String CPQErro;
|
|
||||||
public static String CPQEntrada;
|
|
||||||
public static String CPQEscolha;
|
|
||||||
public static String CPQVermelho;
|
|
||||||
public static String CPQPlayerExit;
|
|
||||||
public static String CPQEntradaLobby;
|
|
||||||
public static String CPQInicioEscolha;
|
|
||||||
public static String CPQTempoExtendido;
|
|
||||||
public static String CPQLiderNaoEncontrado;
|
|
||||||
public static String CPQInicioEscolhaEmEscolha;
|
|
||||||
|
|
||||||
public static LinguaConstants Linguas(MapleCharacter chr) {
|
|
||||||
if (chr.getLingua() == 0) {
|
|
||||||
LinguaConstants.CPQAzul = "Maple Azul";
|
|
||||||
LinguaConstants.CPQVermelho = "Maple Vermelho";
|
|
||||||
LinguaConstants.CPQTempoExtendido = "O tempo foi estendido.";
|
|
||||||
LinguaConstants.CPQPlayerExit = " deixou o Carnaval de Monstros.";
|
|
||||||
LinguaConstants.CPQErro = "Ocorreu um problema. Favor recriar a sala.";
|
|
||||||
LinguaConstants.CPQLiderNaoEncontrado = "Não foi possível encontrar o Lider.";
|
|
||||||
LinguaConstants.CPQInicioEscolha = "Inscreva-se no Festival de Monstros!\\r\\n";
|
|
||||||
LinguaConstants.CPQInicioEscolhaEmEscolha = "O grupo esta respondendo um desafio no momento.";
|
|
||||||
LinguaConstants.CPQEscolha = "Não foi possível encontrar um grupo nesta sala.\\r\\nProvavelmente o grupo foi desfeito dentro da sala!";
|
|
||||||
LinguaConstants.CPQEntradaLobby = "[CPQ MapleStorySA] Agora você irá receber desafios de outros grupos. Se você não aceitar um desafio em 3 minutos, você será levado para fora.";
|
|
||||||
LinguaConstants.CPQEntrada = "Você pode selecionar \"Invocar Monstros\", \"Habilidade\", ou \"Protetor\" como sua tática durante o Carnaval dos Monstros. Use Tab a F1~F12 para acesso rápido!";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else if (chr.getLingua() == 1) {
|
|
||||||
LinguaConstants.CPQAzul = "Maple Azul";
|
|
||||||
LinguaConstants.CPQVermelho = "Maple Rojo";
|
|
||||||
LinguaConstants.CPQTempoExtendido = "El tiempo se ha ampliado.";
|
|
||||||
LinguaConstants.CPQPlayerExit = " ha dejado el Carnaval de Monstruos.";
|
|
||||||
LinguaConstants.CPQLiderNaoEncontrado = "No se pudo encontrar el Lider.";
|
|
||||||
LinguaConstants.CPQInicioEscolha = "¡Inscríbete en el Festival de Monstruos!\\r\\n";
|
|
||||||
LinguaConstants.CPQErro = "Se ha producido un problema. Por favor, volver a crear una sala.";
|
|
||||||
LinguaConstants.CPQInicioEscolhaEmEscolha = "El grupo esta respondiendo un desafío en el momento.";
|
|
||||||
LinguaConstants.CPQEscolha = "No se pudo encontrar un grupo en esta sala.\\r\\nProbablemente el grupo fue deshecho dentro de la sala!";
|
|
||||||
LinguaConstants.CPQEntradaLobby = "[CPQ MapleStorySA] Ahora usted recibirá los retos de otros grupos. Si usted no acepta un desafío en 3 minutos, usted será llevado hacia fuera.";
|
|
||||||
LinguaConstants.CPQEntrada = "Usted puede seleccionar \"Invocar Monstruos \", \"Habilidad \", o \"Protector \" como su táctica durante el Carnaval de los Monstruos. Utilice Tab y F1 ~ F12 para acceso rápido!";
|
|
||||||
|
|
||||||
|
|
||||||
} else if (chr.getLingua() == 2) {
|
|
||||||
LinguaConstants.CPQAzul = "Maple Blue";
|
|
||||||
LinguaConstants.CPQVermelho = "Maple Red";
|
|
||||||
LinguaConstants.CPQPlayerExit = " left the Carnival of Monsters.";
|
|
||||||
LinguaConstants.CPQTempoExtendido = "The time has been extended.";
|
|
||||||
LinguaConstants.CPQLiderNaoEncontrado = "Could not find the Leader.";
|
|
||||||
LinguaConstants.CPQErro = "There was a problem. Please re-create a room.";
|
|
||||||
LinguaConstants.CPQInicioEscolha = "Sign up for the Monster Festival!\\r\\n";
|
|
||||||
LinguaConstants.CPQInicioEscolhaEmEscolha = "The group is currently facing a challenge.";
|
|
||||||
LinguaConstants.CPQEscolha = "We could not find a group in this room.\\r\\nProbably the group was scrapped inside the room!";
|
|
||||||
LinguaConstants.CPQEntradaLobby = "[CPQ MapleStorySA] You will now receive challenges from other groups. If you do not accept a challenge within 3 minutes, you will be taken out.";
|
|
||||||
LinguaConstants.CPQEntrada = "You can select \"Summon Monsters \", \"Ability \", or \"Protector \" as your tactic during the Monster Carnival. Use Tab and F1 ~ F12 for quick access!";
|
|
||||||
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -34,7 +34,7 @@ public class ServerConstants {
|
|||||||
public static final int BYPASS_PIC_EXPIRATION = 20; //Enables PIC bypass, which will remain active for that account by that client machine for N minutes. Set 0 to disable.
|
public static final int BYPASS_PIC_EXPIRATION = 20; //Enables PIC bypass, which will remain active for that account by that client machine for N minutes. Set 0 to disable.
|
||||||
public static final int BYPASS_PIN_EXPIRATION = 15; //Enables PIN bypass, which will remain active for that account by that client machine for N minutes. Set 0 to disable.
|
public static final int BYPASS_PIN_EXPIRATION = 15; //Enables PIN bypass, which will remain active for that account by that client machine for N minutes. Set 0 to disable.
|
||||||
|
|
||||||
public static final boolean AUTOMATIC_REGISTER = false; //Automatically register players when they login with a nonexistent username.
|
public static final boolean AUTOMATIC_REGISTER = true; //Automatically register players when they login with a nonexistent username.
|
||||||
public static final boolean BCRYPT_MIGRATION = true; //Performs a migration from old SHA-1 and SHA-512 password to bcrypt.
|
public static final boolean BCRYPT_MIGRATION = true; //Performs a migration from old SHA-1 and SHA-512 password to bcrypt.
|
||||||
public static final boolean COLLECTIVE_CHARSLOT = false; //Available character slots are contabilized globally rather than per world server.
|
public static final boolean COLLECTIVE_CHARSLOT = false; //Available character slots are contabilized globally rather than per world server.
|
||||||
public static final boolean DETERRED_MULTICLIENT = false; //Enables multi-client and suspicious remote IP detection on the login system.
|
public static final boolean DETERRED_MULTICLIENT = false; //Enables multi-client and suspicious remote IP detection on the login system.
|
||||||
@@ -59,7 +59,7 @@ public class ServerConstants {
|
|||||||
public static final boolean USE_CUSTOM_KEYSET = true; //Enables auto-setup of the HeavenMS's custom keybindings when creating characters.
|
public static final boolean USE_CUSTOM_KEYSET = true; //Enables auto-setup of the HeavenMS's custom keybindings when creating characters.
|
||||||
public static final boolean USE_DEBUG = false; //Will enable some text prints on the client, oriented for debugging purposes.
|
public static final boolean USE_DEBUG = false; //Will enable some text prints on the client, oriented for debugging purposes.
|
||||||
public static final boolean USE_DEBUG_SHOW_INFO_EQPEXP = false; //Prints on the cmd all equip exp gain info.
|
public static final boolean USE_DEBUG_SHOW_INFO_EQPEXP = false; //Prints on the cmd all equip exp gain info.
|
||||||
public static boolean USE_DEBUG_SHOW_RCVD_PACKET = true; //Prints on the cmd all received packet ids.
|
public static boolean USE_DEBUG_SHOW_RCVD_PACKET = false; //Prints on the cmd all received packet ids.
|
||||||
public static boolean USE_DEBUG_SHOW_RCVD_MVLIFE = false; //Prints on the cmd all received move life content.
|
public static boolean USE_DEBUG_SHOW_RCVD_MVLIFE = false; //Prints on the cmd all received move life content.
|
||||||
public static boolean USE_SUPPLY_RATE_COUPONS = true; //Allows rate coupons to be sold through the Cash Shop.
|
public static boolean USE_SUPPLY_RATE_COUPONS = true; //Allows rate coupons to be sold through the Cash Shop.
|
||||||
|
|
||||||
@@ -277,6 +277,7 @@ public class ServerConstants {
|
|||||||
public static final int WEDDING_RESERVATION_TIMEOUT = 10; //Limit time in minutes for the couple to show up before cancelling the wedding reservation.
|
public static final int WEDDING_RESERVATION_TIMEOUT = 10; //Limit time in minutes for the couple to show up before cancelling the wedding reservation.
|
||||||
public static final int WEDDING_RESERVATION_INTERVAL = 60; //Time between wedding starts in minutes.
|
public static final int WEDDING_RESERVATION_INTERVAL = 60; //Time between wedding starts in minutes.
|
||||||
public static final int WEDDING_BLESS_EXP = 30000; //Exp gained per bless count.
|
public static final int WEDDING_BLESS_EXP = 30000; //Exp gained per bless count.
|
||||||
|
public static final int WEDDING_GIFT_LIMIT = 1; //Max number of gifts per person to same wishlist on marriage instances.
|
||||||
public static final boolean WEDDING_BLESSER_SHOWFX = true; //Pops bubble sprite effect on players blessing the couple. Setting this false shows the blessing effect on the couple instead.
|
public static final boolean WEDDING_BLESSER_SHOWFX = true; //Pops bubble sprite effect on players blessing the couple. Setting this false shows the blessing effect on the couple instead.
|
||||||
|
|
||||||
//Buyback Configuration
|
//Buyback Configuration
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import server.life.MapleLifeFactory;
|
|||||||
import server.life.MapleMonster;
|
import server.life.MapleMonster;
|
||||||
import server.partyquest.MapleCarnivalFactory;
|
import server.partyquest.MapleCarnivalFactory;
|
||||||
import server.partyquest.MapleCarnivalFactory.MCSkill;
|
import server.partyquest.MapleCarnivalFactory.MCSkill;
|
||||||
|
import server.partyquest.MonsterCarnival;
|
||||||
import tools.MaplePacketCreator;
|
import tools.MaplePacketCreator;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
import tools.data.input.SeekableLittleEndianAccessor;
|
import tools.data.input.SeekableLittleEndianAccessor;
|
||||||
@@ -46,87 +47,95 @@ public final class MonsterCarnivalHandler extends AbstractMaplePacketHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||||
|
c.tryacquireClient();
|
||||||
try {
|
try {
|
||||||
int tab = slea.readByte();
|
try {
|
||||||
int num = slea.readByte();
|
int tab = slea.readByte();
|
||||||
int neededCP = 0;
|
int num = slea.readByte();
|
||||||
if (tab == 0) {
|
int neededCP = 0;
|
||||||
final List<Pair<Integer, Integer>> mobs = c.getPlayer().getMap().getMobsToSpawn();
|
if (tab == 0) {
|
||||||
if (num >= mobs.size() || c.getPlayer().getCP() < mobs.get(num).right) {
|
final List<Pair<Integer, Integer>> mobs = c.getPlayer().getMap().getMobsToSpawn();
|
||||||
c.announce(MaplePacketCreator.CPQMessage((byte) 1));
|
if (num >= mobs.size() || c.getPlayer().getCP() < mobs.get(num).right) {
|
||||||
c.getSession().write(MaplePacketCreator.enableActions());
|
c.announce(MaplePacketCreator.CPQMessage((byte) 1));
|
||||||
return;
|
c.announce(MaplePacketCreator.enableActions());
|
||||||
}
|
|
||||||
|
|
||||||
final MapleMonster mob = MapleLifeFactory.getMonster(mobs.get(num).left);
|
|
||||||
if (c.getPlayer().getMonsterCarnival() != null) {
|
|
||||||
Point spawnPos = c.getPlayer().getMap().getRandomSP(c.getPlayer().getTeam());
|
|
||||||
if (!c.getPlayer().getMonsterCarnival().canSummon() && c.getPlayer().getTeam() == 0 || !c.getPlayer().getMonsterCarnival().canSummons() && c.getPlayer().getTeam() == 1) {
|
|
||||||
c.announce(MaplePacketCreator.CPQMessage((byte) 2));
|
|
||||||
c.getSession().write(MaplePacketCreator.enableActions());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mob.setPosition(spawnPos);
|
|
||||||
if (c.getPlayer().getTeam() == 0) {
|
final MapleMonster mob = MapleLifeFactory.getMonster(mobs.get(num).left);
|
||||||
c.getPlayer().getMonsterCarnival().summon();
|
MonsterCarnival mcpq = c.getPlayer().getMonsterCarnival();
|
||||||
} else {
|
if (mcpq != null) {
|
||||||
c.getPlayer().getMonsterCarnival().summons();
|
if (!mcpq.canSummonR() && c.getPlayer().getTeam() == 0 || !mcpq.canSummonB() && c.getPlayer().getTeam() == 1) {
|
||||||
}
|
c.announce(MaplePacketCreator.CPQMessage((byte) 2));
|
||||||
|
c.announce(MaplePacketCreator.enableActions());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c.getPlayer().getTeam() == 0) {
|
||||||
|
mcpq.summonR();
|
||||||
|
} else {
|
||||||
|
mcpq.summonB();
|
||||||
|
}
|
||||||
|
|
||||||
|
Point spawnPos = c.getPlayer().getMap().getRandomSP(c.getPlayer().getTeam());
|
||||||
|
mob.setPosition(spawnPos);
|
||||||
|
|
||||||
c.getPlayer().getMap().addMonsterSpawn(mob, 1, c.getPlayer().getTeam());
|
c.getPlayer().getMap().addMonsterSpawn(mob, 1, c.getPlayer().getTeam());
|
||||||
c.getSession().write(MaplePacketCreator.enableActions());
|
c.getPlayer().getMap().addAllMonsterSpawn(mob, 1, c.getPlayer().getTeam());
|
||||||
|
c.announce(MaplePacketCreator.enableActions());
|
||||||
}
|
}
|
||||||
|
|
||||||
neededCP = mobs.get(num).right;
|
neededCP = mobs.get(num).right;
|
||||||
} else if (tab == 1) { //debuffs
|
} else if (tab == 1) { //debuffs
|
||||||
final List<Integer> skillid = c.getPlayer().getMap().getSkillIds();
|
final List<Integer> skillid = c.getPlayer().getMap().getSkillIds();
|
||||||
if (num >= skillid.size()) {
|
if (num >= skillid.size()) {
|
||||||
c.getPlayer().dropMessage(5, "Ocorreu um erro.");
|
c.getPlayer().dropMessage(5, "Ocorreu um erro.");
|
||||||
c.getSession().write(MaplePacketCreator.enableActions());
|
c.announce(MaplePacketCreator.enableActions());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final MCSkill skil = MapleCarnivalFactory.getInstance().getSkill(skillid.get(num)); //ugh wtf
|
final MCSkill skill = MapleCarnivalFactory.getInstance().getSkill(skillid.get(num)); //ugh wtf
|
||||||
if (skil == null || c.getPlayer().getCP() < skil.cpLoss) {
|
if (skill == null || c.getPlayer().getCP() < skill.cpLoss) {
|
||||||
c.announce(MaplePacketCreator.CPQMessage((byte) 1));
|
c.announce(MaplePacketCreator.CPQMessage((byte) 1));
|
||||||
c.getSession().write(MaplePacketCreator.enableActions());
|
c.announce(MaplePacketCreator.enableActions());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final MapleDisease dis = skil.getDisease();
|
final MapleDisease dis = skill.getDisease();
|
||||||
MapleParty inimigos = c.getPlayer().getParty().getEnemy();
|
MapleParty enemies = c.getPlayer().getParty().getEnemy();
|
||||||
if (skil.targetsAll) {
|
if (skill.targetsAll) {
|
||||||
int chanceAcerto = 0;
|
int chanceAcerto = 0;
|
||||||
if (dis.getDisease() == 121 || dis.getDisease() == 122 || dis.getDisease() == 125 || dis.getDisease() == 126) {
|
if (dis.getDisease() == 121 || dis.getDisease() == 122 || dis.getDisease() == 125 || dis.getDisease() == 126) {
|
||||||
chanceAcerto = (int) (Math.random() * 100);
|
chanceAcerto = (int) (Math.random() * 100);
|
||||||
}
|
}
|
||||||
if (chanceAcerto <= 80) {
|
if (chanceAcerto <= 80) {
|
||||||
for (MaplePartyCharacter chrS : inimigos.getPartyMembers()) {
|
for (MaplePartyCharacter chrS : enemies.getPartyMembers()) {
|
||||||
if (dis == null) {
|
if (dis == null) {
|
||||||
chrS.getPlayer().dispel();
|
chrS.getPlayer().dispel();
|
||||||
} else {
|
} else {
|
||||||
chrS.getPlayer().giveDebuff(dis, skil.getSkill());
|
chrS.getPlayer().giveDebuff(dis, skill.getSkill());
|
||||||
}
|
}
|
||||||
if (!skil.targetsAll) {
|
if (!skill.targetsAll) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int amount = inimigos.getMembers().size() - 1;
|
int amount = enemies.getMembers().size() - 1;
|
||||||
int randd = (int) Math.floor(Math.random() * amount);
|
int randd = (int) Math.floor(Math.random() * amount);
|
||||||
MapleCharacter chrApp = c.getChannelServer().getPlayerStorage().getCharacterById(inimigos.getMemberByPos(randd).getId());
|
MapleCharacter chrApp = c.getChannelServer().getPlayerStorage().getCharacterById(enemies.getMemberByPos(randd).getId());
|
||||||
if (chrApp != null && chrApp.getMap().isCPQMap()) {
|
if (chrApp != null && chrApp.getMap().isCPQMap()) {
|
||||||
if (dis == null) {
|
if (dis == null) {
|
||||||
chrApp.dispel();
|
chrApp.dispel();
|
||||||
} else {
|
} else {
|
||||||
chrApp.giveDebuff(dis, skil.getSkill());
|
chrApp.giveDebuff(dis, skill.getSkill());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
neededCP = skil.cpLoss;
|
neededCP = skill.cpLoss;
|
||||||
c.getSession().write(MaplePacketCreator.enableActions());
|
c.announce(MaplePacketCreator.enableActions());
|
||||||
} else if (tab == 2) { //protectors
|
} else if (tab == 2) { //protectors
|
||||||
final MCSkill skil = MapleCarnivalFactory.getInstance().getGuardian(num);
|
final MCSkill skill = MapleCarnivalFactory.getInstance().getGuardian(num);
|
||||||
if (skil == null || c.getPlayer().getCP() < skil.cpLoss) {
|
if (skill == null || c.getPlayer().getCP() < skill.cpLoss) {
|
||||||
c.announce(MaplePacketCreator.CPQMessage((byte) 1));
|
c.announce(MaplePacketCreator.CPQMessage((byte) 1));
|
||||||
c.getSession().write(MaplePacketCreator.enableActions());
|
c.announce(MaplePacketCreator.enableActions());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int success = c.getPlayer().getMap().spawnGuardian(c.getPlayer().getTeam(), num);
|
int success = c.getPlayer().getMap().spawnGuardian(c.getPlayer().getTeam(), num);
|
||||||
@@ -138,17 +147,20 @@ public final class MonsterCarnivalHandler extends AbstractMaplePacketHandler {
|
|||||||
} else if (success == 2) {
|
} else if (success == 2) {
|
||||||
c.announce(MaplePacketCreator.CPQMessage((byte) 3));
|
c.announce(MaplePacketCreator.CPQMessage((byte) 3));
|
||||||
}
|
}
|
||||||
c.getSession().write(MaplePacketCreator.enableActions());
|
c.announce(MaplePacketCreator.enableActions());
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
neededCP = skil.cpLoss;
|
neededCP = skill.cpLoss;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.getPlayer().gainCP(-neededCP);
|
c.getPlayer().gainCP(-neededCP);
|
||||||
c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.playerSummoned(c.getPlayer().getName(), tab, num));
|
c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.playerSummoned(c.getPlayer().getName(), tab, num));
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
c.releaseClient();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,32 +21,34 @@
|
|||||||
*/
|
*/
|
||||||
package net.server.channel.handlers;
|
package net.server.channel.handlers;
|
||||||
|
|
||||||
import client.MapleClient;
|
|
||||||
import client.MapleCharacter;
|
|
||||||
import client.inventory.MapleInventoryType;
|
|
||||||
import client.processor.DueyProcessor;
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import net.AbstractMaplePacketHandler;
|
|
||||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
import client.MapleClient;
|
||||||
import tools.DatabaseConnection;
|
import client.MapleCharacter;
|
||||||
import tools.data.input.SeekableLittleEndianAccessor;
|
|
||||||
import tools.Pair;
|
|
||||||
import tools.MaplePacketCreator;
|
|
||||||
import tools.packets.Wedding;
|
|
||||||
import net.server.world.World;
|
|
||||||
import net.server.channel.Channel;
|
|
||||||
import server.MapleItemInformationProvider;
|
|
||||||
import client.MapleRing;
|
import client.MapleRing;
|
||||||
import client.inventory.Equip;
|
import client.inventory.Equip;
|
||||||
import client.inventory.Item;
|
import client.inventory.Item;
|
||||||
|
import client.inventory.MapleInventoryType;
|
||||||
|
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||||
|
import client.processor.DueyProcessor;
|
||||||
|
import net.AbstractMaplePacketHandler;
|
||||||
|
import net.server.world.World;
|
||||||
|
import net.server.channel.Channel;
|
||||||
|
import server.MapleItemInformationProvider;
|
||||||
|
import scripting.event.EventInstanceManager;
|
||||||
|
import tools.DatabaseConnection;
|
||||||
|
import tools.Pair;
|
||||||
|
import tools.MaplePacketCreator;
|
||||||
|
import tools.data.input.SeekableLittleEndianAccessor;
|
||||||
|
import tools.packets.Wedding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Jvlaple
|
* @author Jvlaple
|
||||||
* @author Ronan - major overhaul on Ring handling mechanics
|
* @author Ronan - major overhaul on Ring handling mechanics
|
||||||
* @author Drago/Dragohe4rt on Wishlist
|
* @author Drago/Dragohe4rt - on Wishlist
|
||||||
*/
|
*/
|
||||||
public final class RingActionHandler extends AbstractMaplePacketHandler {
|
public final class RingActionHandler extends AbstractMaplePacketHandler {
|
||||||
private static int getBoxId(int useItemId) {
|
private static int getBoxId(int useItemId) {
|
||||||
@@ -463,57 +465,42 @@ public final class RingActionHandler extends AbstractMaplePacketHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 9:
|
case 9:
|
||||||
// By Drago/Dragohe4rt
|
try {
|
||||||
// Groom and Bride's Wishlist
|
// By Drago/Dragohe4rt
|
||||||
//short size = slea.readShort();
|
// Groom and Bride's Wishlist
|
||||||
int amount = slea.readShort();
|
|
||||||
if (amount > 10) {
|
MapleCharacter player = c.getPlayer();
|
||||||
amount = 10;
|
|
||||||
}
|
EventInstanceManager eim = player.getEventInstance();
|
||||||
for (int i = 0; i < amount; i++) {
|
if (eim != null) {
|
||||||
c.getPlayer().setItens(slea.readMapleAsciiString());
|
boolean isMarrying = (player.getId() == eim.getIntProperty("groomId") || player.getId() == eim.getIntProperty("brideId"));
|
||||||
}
|
|
||||||
|
if (isMarrying) {
|
||||||
//System.out.println("G&B WISHLIST: " + itemnames);
|
int amount = slea.readShort();
|
||||||
|
if (amount > 10) {
|
||||||
/*
|
amount = 10;
|
||||||
if (c.getPlayer().getMarriageItemId() > -1) {
|
}
|
||||||
switch(c.getPlayer().getMarriageItemId()) {
|
|
||||||
case 10: // Premium Cathedral
|
String wishlistItems = "";
|
||||||
c.getAbstractPlayerInteraction().gainItem(4031375, (short)1);
|
for (int i = 0; i < amount; i++) {
|
||||||
c.getAbstractPlayerInteraction().gainItem(4031395, (short)15);
|
String s = slea.readMapleAsciiString();
|
||||||
break;
|
wishlistItems += (s + "\r\n");
|
||||||
case 11: // Normal Cathedral
|
}
|
||||||
c.getAbstractPlayerInteraction().gainItem(4031480, (short)1);
|
|
||||||
c.getAbstractPlayerInteraction().gainItem(4031395, (short)15);
|
String wlKey;
|
||||||
break;
|
if (player.getId() == eim.getIntProperty("groomId")) {
|
||||||
case 20: // Premium Chapel
|
wlKey = "groomWishlist";
|
||||||
c.getAbstractPlayerInteraction().gainItem(4031376, (short)1);
|
} else {
|
||||||
c.getAbstractPlayerInteraction().gainItem(4031377, (short)15);
|
wlKey = "brideWishlist";
|
||||||
break;
|
}
|
||||||
case 21: // Normal Chapel
|
|
||||||
c.getAbstractPlayerInteraction().gainItem(4031481, (short)1);
|
if (eim.getProperty(wlKey).contentEquals("")) {
|
||||||
c.getAbstractPlayerInteraction().gainItem(4031377, (short)15);
|
eim.setProperty(wlKey, wishlistItems);
|
||||||
break;
|
}
|
||||||
default: {
|
|
||||||
System.out.println("Invalid Wedding Type for player " + c.getPlayer().getName() + "!");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (NumberFormatException nfe) {}
|
||||||
//c.getPlayer().setMarriageItemId(-1); ?????
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c.getPlayer().getWishlist() == null) {
|
|
||||||
c.getPlayer().registerWishlist(itemnames);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c.getPlayer().getWedding() != null) {
|
|
||||||
if (c.getPlayer().getGender() == 0 ? c.getPlayer().getWedding().isExistantGroom(c.getPlayer().getId()) : c.getPlayer().getWedding().isExistantBride(c.getPlayer().getId())) {
|
|
||||||
c.getPlayer().getWedding().registerWishlist(c.getPlayer().getGender() == 1, itemnames);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -6,19 +6,23 @@
|
|||||||
|
|
||||||
package net.server.channel.handlers;
|
package net.server.channel.handlers;
|
||||||
|
|
||||||
import client.inventory.Item;
|
|
||||||
import client.inventory.MapleInventoryType;
|
|
||||||
import client.MapleCharacter;
|
import client.MapleCharacter;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.inventory.Equip;
|
import client.inventory.Item;
|
||||||
import constants.ItemConstants;
|
import client.inventory.MapleInventory;
|
||||||
import net.AbstractMaplePacketHandler;
|
import client.inventory.MapleInventoryType;
|
||||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||||
import net.server.channel.Channel;
|
import client.inventory.manipulator.MapleKarmaManipulator;
|
||||||
import scripting.event.EventInstanceManager;
|
import constants.ItemConstants;
|
||||||
|
import constants.ServerConstants;
|
||||||
|
import net.AbstractMaplePacketHandler;
|
||||||
|
import server.MapleMarriage;
|
||||||
import tools.MaplePacketCreator;
|
import tools.MaplePacketCreator;
|
||||||
import tools.data.input.SeekableLittleEndianAccessor;
|
import tools.data.input.SeekableLittleEndianAccessor;
|
||||||
import tools.packets.Wedding;
|
import tools.packets.Wedding;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -28,43 +32,123 @@ public final class WeddingHandler extends AbstractMaplePacketHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||||
MapleCharacter chr = c.getPlayer();
|
|
||||||
final byte mode = slea.readByte();
|
|
||||||
Channel cs = c.getChannelServer();
|
|
||||||
|
|
||||||
if (mode == 6) { //additem
|
c.tryacquireClient();
|
||||||
short slot = slea.readShort();
|
try {
|
||||||
int itemid = slea.readInt();
|
MapleCharacter chr = c.getPlayer();
|
||||||
short quantity = slea.readShort();
|
final byte mode = slea.readByte();
|
||||||
EventInstanceManager eim = c.getPlayer().getEventInstance();
|
|
||||||
if (eim != null) {
|
|
||||||
String name = eim.getProperty("brideId");
|
|
||||||
MapleCharacter chrs = cs.getPlayerStorage().getCharacterById(Integer.parseInt(name));
|
|
||||||
//MapleCharacter chrs = cs.getPlayerStorage().getCharacterById(3);
|
|
||||||
MapleInventoryType type = ItemConstants.getInventoryType(itemid);
|
|
||||||
Item item = chr.getInventory(type).getItem((byte) slot);
|
|
||||||
if (itemid == item.getItemId() && quantity <= item.getQuantity()) {
|
|
||||||
if(!(item instanceof Equip)) {
|
|
||||||
item = new Item(itemid, slot, quantity);
|
|
||||||
}
|
|
||||||
chrs.setEquips(item);
|
|
||||||
MapleInventoryManipulator.removeById(chr.getClient(), type, itemid, quantity, false, false);
|
|
||||||
c.announce(Wedding.OnWeddingGiftResult((byte) 0xB, chrs.getItens(), chrs.getItem()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (mode == 7) { // noiva abre e pega itens
|
|
||||||
byte inventId = slea.readByte();
|
|
||||||
int itemPos = slea.readByte();
|
|
||||||
MapleInventoryType inv = MapleInventoryType.getByType(inventId);
|
|
||||||
Item item = chr.getItemid(itemPos);
|
|
||||||
c.getAbstractPlayerInteraction().gainItem(item.getItemId(), item.getQuantity());
|
|
||||||
chr.removeItem(item);
|
|
||||||
c.announce(Wedding.OnWeddingGiftResult((byte) 0xF, chr.getItens(), chr.getItem()));
|
|
||||||
} else if (mode == 8) { // sair update?
|
|
||||||
|
|
||||||
c.announce(MaplePacketCreator.enableActions());
|
if (mode == 6) { //additem
|
||||||
} else {
|
short slot = slea.readShort();
|
||||||
System.out.println(mode);
|
int itemid = slea.readInt();
|
||||||
|
short quantity = slea.readShort();
|
||||||
|
|
||||||
|
MapleMarriage marriage = c.getPlayer().getMarriageInstance();
|
||||||
|
if (marriage != null) {
|
||||||
|
try {
|
||||||
|
boolean groomWishlist = marriage.giftItemToSpouse(chr.getId());
|
||||||
|
String groomWishlistProp = "giftedItem" + (groomWishlist ? "G" : "B") + chr.getId();
|
||||||
|
|
||||||
|
int giftCount = marriage.getIntProperty(groomWishlistProp);
|
||||||
|
if (giftCount < ServerConstants.WEDDING_GIFT_LIMIT) {
|
||||||
|
int cid = marriage.getIntProperty(groomWishlist ? "groomId" : "brideId");
|
||||||
|
if (chr.getId() != cid) { // cannot gift yourself
|
||||||
|
MapleCharacter spouse = marriage.getPlayerById(cid);
|
||||||
|
if (spouse != null) {
|
||||||
|
MapleInventoryType type = ItemConstants.getInventoryType(itemid);
|
||||||
|
MapleInventory chrInv = chr.getInventory(type);
|
||||||
|
|
||||||
|
chrInv.lockInventory();
|
||||||
|
try {
|
||||||
|
Item item = chrInv.getItem((byte) slot);
|
||||||
|
if (item != null) {
|
||||||
|
if (!item.isUntradeable()) {
|
||||||
|
if (itemid == item.getItemId() && quantity <= item.getQuantity()) {
|
||||||
|
Item newItem = item.copy();
|
||||||
|
|
||||||
|
marriage.addGiftItem(groomWishlist, newItem);
|
||||||
|
MapleInventoryManipulator.removeFromSlot(c, type, slot, quantity, false, false);
|
||||||
|
|
||||||
|
if (ServerConstants.USE_ENFORCE_MERCHANT_SAVE) chr.saveCharToDB(false);
|
||||||
|
marriage.saveGiftItemsToDb(c, groomWishlist, cid);
|
||||||
|
|
||||||
|
MapleKarmaManipulator.toggleKarmaFlagToUntradeable(newItem);
|
||||||
|
marriage.setIntProperty(groomWishlistProp, giftCount + 1);
|
||||||
|
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xB, marriage.getWishlistItems(groomWishlist), Collections.singletonList(newItem)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xE, marriage.getWishlistItems(groomWishlist), null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
chrInv.unlockInventory();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xE, marriage.getWishlistItems(groomWishlist), null));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xE, marriage.getWishlistItems(groomWishlist), null));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xC, marriage.getWishlistItems(groomWishlist), null));
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException nfe) {}
|
||||||
|
} else {
|
||||||
|
c.announce(MaplePacketCreator.enableActions());
|
||||||
|
}
|
||||||
|
} else if (mode == 7) { // take items
|
||||||
|
slea.readByte(); // invType
|
||||||
|
int itemPos = slea.readByte();
|
||||||
|
|
||||||
|
MapleMarriage marriage = chr.getMarriageInstance();
|
||||||
|
if (marriage != null) {
|
||||||
|
Boolean groomWishlist = marriage.isMarriageGroom(chr);
|
||||||
|
if (groomWishlist != null) {
|
||||||
|
Item item = marriage.getGiftItem(c, groomWishlist, itemPos);
|
||||||
|
if (item != null) {
|
||||||
|
if (MapleInventory.checkSpot(chr, item)) {
|
||||||
|
marriage.removeGiftItem(groomWishlist, item);
|
||||||
|
marriage.saveGiftItemsToDb(c, groomWishlist, chr.getId());
|
||||||
|
|
||||||
|
MapleInventoryManipulator.addFromDrop(c, item, true);
|
||||||
|
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xF, marriage.getWishlistItems(groomWishlist), marriage.getGiftItems(c, groomWishlist)));
|
||||||
|
} else {
|
||||||
|
c.getPlayer().dropMessage(1, "Free a slot on your inventory before collecting this item.");
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xE, marriage.getWishlistItems(groomWishlist), marriage.getGiftItems(c, groomWishlist)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
c.getPlayer().dropMessage(1, "You have already collected this item.");
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xE, marriage.getWishlistItems(groomWishlist), marriage.getGiftItems(c, groomWishlist)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
List<Item> items = c.getAbstractPlayerInteraction().getUnclaimedMarriageGifts();
|
||||||
|
try {
|
||||||
|
Item item = items.get(itemPos);
|
||||||
|
if (MapleInventory.checkSpot(chr, item)) {
|
||||||
|
items.remove(itemPos);
|
||||||
|
MapleMarriage.saveGiftItemsToDb(c, items, chr.getId());
|
||||||
|
|
||||||
|
MapleInventoryManipulator.addFromDrop(c, item, true);
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xF, Collections.singletonList(""), items));
|
||||||
|
} else {
|
||||||
|
c.getPlayer().dropMessage(1, "Free a slot on your inventory before collecting this item.");
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xE, Collections.singletonList(""), items));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
c.getPlayer().dropMessage(1, "You have already collected this item.");
|
||||||
|
c.announce(Wedding.OnWeddingGiftResult((byte) 0xE, Collections.singletonList(""), items));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (mode == 8) { // out of Wedding Registry
|
||||||
|
c.announce(MaplePacketCreator.enableActions());
|
||||||
|
} else {
|
||||||
|
System.out.println(mode);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
c.releaseClient();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,7 +182,7 @@ public class MaplePartyCharacter {
|
|||||||
case 222:
|
case 222:
|
||||||
return "Arquimago (Gelo, Raio)";
|
return "Arquimago (Gelo, Raio)";
|
||||||
case 230:
|
case 230:
|
||||||
return "Clérigo";
|
return "Clerigo";
|
||||||
case 231:
|
case 231:
|
||||||
return "Sacerdote";
|
return "Sacerdote";
|
||||||
case 232:
|
case 232:
|
||||||
@@ -191,7 +191,7 @@ public class MaplePartyCharacter {
|
|||||||
case 300:
|
case 300:
|
||||||
return "Arqueiro";
|
return "Arqueiro";
|
||||||
case 310:
|
case 310:
|
||||||
return "Caçador";
|
return "Cacador";
|
||||||
case 311:
|
case 311:
|
||||||
return "Rastreador";
|
return "Rastreador";
|
||||||
case 312:
|
case 312:
|
||||||
@@ -231,7 +231,7 @@ public class MaplePartyCharacter {
|
|||||||
case 521:
|
case 521:
|
||||||
return "Bucaneiro";
|
return "Bucaneiro";
|
||||||
case 522:
|
case 522:
|
||||||
return "Captain";
|
return "Capitao";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "Unknown Job";
|
return "Unknown Job";
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ import tools.MaplePacketCreator;
|
|||||||
import client.MapleCharacter;
|
import client.MapleCharacter;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.MapleQuestStatus;
|
import client.MapleQuestStatus;
|
||||||
import client.MapleStat;
|
|
||||||
import client.SkillFactory;
|
import client.SkillFactory;
|
||||||
import client.inventory.Equip;
|
import client.inventory.Equip;
|
||||||
import client.inventory.Item;
|
import client.inventory.Item;
|
||||||
@@ -68,6 +67,7 @@ import client.inventory.manipulator.MapleInventoryManipulator;
|
|||||||
import constants.GameConstants;
|
import constants.GameConstants;
|
||||||
import constants.ItemConstants;
|
import constants.ItemConstants;
|
||||||
import constants.ServerConstants;
|
import constants.ServerConstants;
|
||||||
|
import server.MapleMarriage;
|
||||||
import server.life.MapleNPC;
|
import server.life.MapleNPC;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
|
|
||||||
@@ -1048,6 +1048,10 @@ public class AbstractPlayerInteraction {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Item> getUnclaimedMarriageGifts() {
|
||||||
|
return MapleMarriage.loadGiftItemsFromDb(this.getClient(), this.getPlayer().getId());
|
||||||
|
}
|
||||||
|
|
||||||
public boolean startDungeonInstance(int dungeonid) {
|
public boolean startDungeonInstance(int dungeonid) {
|
||||||
return c.getChannelServer().addMiniDungeon(dungeonid);
|
return c.getChannelServer().addMiniDungeon(dungeonid);
|
||||||
}
|
}
|
||||||
@@ -1101,7 +1105,7 @@ public class AbstractPlayerInteraction {
|
|||||||
c.announce(MaplePacketCreator.getNPCTalk(npcid, (byte) 0, message, "00 00", (byte) 0));
|
c.announce(MaplePacketCreator.getNPCTalk(npcid, (byte) 0, message, "00 00", (byte) 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getCurrentTime() {
|
public long getCurrentTime() {
|
||||||
return System.currentTimeMillis();
|
return Server.getInstance().getCurrentTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,10 +55,16 @@ import tools.DatabaseConnection;
|
|||||||
import client.MapleCharacter;
|
import client.MapleCharacter;
|
||||||
import client.SkillFactory;
|
import client.SkillFactory;
|
||||||
import client.Skill;
|
import client.Skill;
|
||||||
|
import client.inventory.Item;
|
||||||
|
import client.inventory.ItemFactory;
|
||||||
|
import client.inventory.MapleInventory;
|
||||||
|
import client.inventory.MapleInventoryType;
|
||||||
|
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||||
import constants.ItemConstants;
|
import constants.ItemConstants;
|
||||||
import constants.ServerConstants;
|
import constants.ServerConstants;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||||
@@ -73,6 +79,7 @@ import server.ThreadManager;
|
|||||||
import server.life.MapleLifeFactory;
|
import server.life.MapleLifeFactory;
|
||||||
import server.life.MapleNPC;
|
import server.life.MapleNPC;
|
||||||
import tools.MaplePacketCreator;
|
import tools.MaplePacketCreator;
|
||||||
|
import tools.Randomizer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -89,6 +96,7 @@ public class EventInstanceManager {
|
|||||||
private MapleMapFactory mapFactory;
|
private MapleMapFactory mapFactory;
|
||||||
private String name;
|
private String name;
|
||||||
private Properties props = new Properties();
|
private Properties props = new Properties();
|
||||||
|
private Map<String, Object> objectProps = new HashMap<>();
|
||||||
private long timeStarted = 0;
|
private long timeStarted = 0;
|
||||||
private long eventTime = 0;
|
private long eventTime = 0;
|
||||||
private MapleExpedition expedition = null;
|
private MapleExpedition expedition = null;
|
||||||
@@ -628,6 +636,7 @@ public class EventInstanceManager {
|
|||||||
killCount.clear();
|
killCount.clear();
|
||||||
mapIds.clear();
|
mapIds.clear();
|
||||||
props.clear();
|
props.clear();
|
||||||
|
objectProps.clear();
|
||||||
|
|
||||||
disposeExpedition();
|
disposeExpedition();
|
||||||
|
|
||||||
@@ -741,6 +750,15 @@ public class EventInstanceManager {
|
|||||||
pL.unlock();
|
pL.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setObjectProperty(String key, Object obj) {
|
||||||
|
pL.lock();
|
||||||
|
try {
|
||||||
|
objectProps.put(key, obj);
|
||||||
|
} finally {
|
||||||
|
pL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String getProperty(String key) {
|
public String getProperty(String key) {
|
||||||
pL.lock();
|
pL.lock();
|
||||||
@@ -759,6 +777,15 @@ public class EventInstanceManager {
|
|||||||
pL.unlock();
|
pL.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Object getObjectProperty(String key) {
|
||||||
|
pL.lock();
|
||||||
|
try {
|
||||||
|
return objectProps.get(key);
|
||||||
|
} finally {
|
||||||
|
pL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void leftParty(final MapleCharacter chr) {
|
public void leftParty(final MapleCharacter chr) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import net.server.guild.MapleGuild;
|
|||||||
import net.server.world.MapleParty;
|
import net.server.world.MapleParty;
|
||||||
import net.server.world.MaplePartyCharacter;
|
import net.server.world.MaplePartyCharacter;
|
||||||
import scripting.event.worker.EventScriptScheduler;
|
import scripting.event.worker.EventScriptScheduler;
|
||||||
|
import server.MapleMarriage;
|
||||||
import server.expeditions.MapleExpedition;
|
import server.expeditions.MapleExpedition;
|
||||||
import server.maps.MapleMap;
|
import server.maps.MapleMap;
|
||||||
import server.life.MapleMonster;
|
import server.life.MapleMonster;
|
||||||
@@ -279,6 +280,19 @@ public class EventManager {
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MapleMarriage newMarriage(String name) throws EventInstanceInProgressException {
|
||||||
|
MapleMarriage ret = new MapleMarriage(this, name);
|
||||||
|
|
||||||
|
synchronized (instances) {
|
||||||
|
if (instances.containsKey(name)) {
|
||||||
|
throw new EventInstanceInProgressException(name, this.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
instances.put(name, ret);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public void disposeInstance(final String name) {
|
public void disposeInstance(final String name) {
|
||||||
ess.registerEntry(new Runnable() {
|
ess.registerEntry(new Runnable() {
|
||||||
|
|||||||
@@ -58,22 +58,23 @@ import client.inventory.Item;
|
|||||||
import client.inventory.ItemFactory;
|
import client.inventory.ItemFactory;
|
||||||
import client.inventory.MaplePet;
|
import client.inventory.MaplePet;
|
||||||
import constants.ItemConstants;
|
import constants.ItemConstants;
|
||||||
import constants.LinguaConstants;
|
import constants.LanguageConstants;
|
||||||
|
import net.server.PlayerStorage;
|
||||||
import net.server.channel.Channel;
|
import net.server.channel.Channel;
|
||||||
import scripting.event.EventInstanceManager;
|
|
||||||
import server.MapleSkillbookInformationProvider;
|
import server.MapleSkillbookInformationProvider;
|
||||||
import server.MapleSkillbookInformationProvider.SkillBookEntry;
|
import server.MapleSkillbookInformationProvider.SkillBookEntry;
|
||||||
import server.TimerManager;
|
import server.TimerManager;
|
||||||
import server.maps.MapleMapObject;
|
import server.maps.MapleMapObject;
|
||||||
import server.maps.MapleMapObjectType;
|
import server.maps.MapleMapObjectType;
|
||||||
import server.partyquest.MonsterCarnival;
|
import server.partyquest.MonsterCarnival;
|
||||||
import tools.FilePrinter;
|
|
||||||
import tools.packets.Wedding;
|
import tools.packets.Wedding;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import server.MapleMarriage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -619,8 +620,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
public int calcAvgLvl(int map) {
|
public int calcAvgLvl(int map) {
|
||||||
int num = 0;
|
int num = 0;
|
||||||
int avg = 0;
|
int avg = 0;
|
||||||
for (MapleMapObject mmo
|
for (MapleMapObject mmo : c.getChannelServer().getMapFactory().getMap(map).getAllPlayer()) {
|
||||||
: c.getChannelServer().getMapFactory().getMap(map).getAllPlayer()) {
|
|
||||||
avg += ((MapleCharacter) mmo).getLevel();
|
avg += ((MapleCharacter) mmo).getLevel();
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
@@ -629,7 +629,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendCPQMapLists() {
|
public void sendCPQMapLists() {
|
||||||
String msg = LinguaConstants.Linguas(getPlayer()).CPQInicioEscolha;
|
String msg = LanguageConstants.Linguas(getPlayer()).CPQInicioEscolha;
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
if (fieldTaken(i)) {
|
if (fieldTaken(i)) {
|
||||||
if (fieldLobbied(i)) {
|
if (fieldLobbied(i)) {
|
||||||
@@ -641,7 +641,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (i == 0 || i == 1 || i == 2 || i == 3) {
|
if (i >= 0 && i <= 3) {
|
||||||
msg += "#b#L" + i + "#Map " + (i + 1) + " (2x2) #l\\r\\n";
|
msg += "#b#L" + i + "#Map " + (i + 1) + " (2x2) #l\\r\\n";
|
||||||
} else {
|
} else {
|
||||||
msg += "#b#L" + i + "#Map " + (i + 1) + " (3x3) #l\\r\\n";
|
msg += "#b#L" + i + "#Map " + (i + 1) + " (3x3) #l\\r\\n";
|
||||||
@@ -673,16 +673,18 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
|
|
||||||
public void cpqLobby(int field) {
|
public void cpqLobby(int field) {
|
||||||
try {
|
try {
|
||||||
final MapleMap map, mapsaida;
|
final MapleMap map, mapExit;
|
||||||
Channel cs = c.getChannelServer();
|
Channel cs = c.getChannelServer();
|
||||||
|
PlayerStorage ps = cs.getPlayerStorage();
|
||||||
|
|
||||||
map = cs.getMapFactory().getMap(980000100 + 100 * field);
|
map = cs.getMapFactory().getMap(980000100 + 100 * field);
|
||||||
mapsaida = cs.getMapFactory().getMap(980000000);
|
mapExit = cs.getMapFactory().getMap(980000000);
|
||||||
for (MaplePartyCharacter mpc : c.getPlayer().getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : c.getPlayer().getParty().getMembers()) {
|
||||||
final MapleCharacter mc;
|
final MapleCharacter mc;
|
||||||
mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
mc = ps.getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.changeMap(map, map.getPortal(0));
|
mc.changeMap(map, map.getPortal(0));
|
||||||
mc.getClient().getSession().write(MaplePacketCreator.serverNotice(6, LinguaConstants.Linguas(mc).CPQEntradaLobby));
|
mc.announce(MaplePacketCreator.serverNotice(6, LanguageConstants.Linguas(mc).CPQEntradaLobby));
|
||||||
TimerManager tMan = TimerManager.getInstance();
|
TimerManager tMan = TimerManager.getInstance();
|
||||||
tMan.schedule(new Runnable() {
|
tMan.schedule(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -690,13 +692,14 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
mapClock(3 * 60);
|
mapClock(3 * 60);
|
||||||
}
|
}
|
||||||
}, 1500);
|
}, 1500);
|
||||||
|
|
||||||
|
mc.setCpqTimer(TimerManager.getInstance().schedule(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
mc.changeMap(mapExit, mapExit.getPortal(0));
|
||||||
|
}
|
||||||
|
}, 3 * 60 * 1000));
|
||||||
}
|
}
|
||||||
mc.timer = TimerManager.getInstance().schedule(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mc.changeMap(mapsaida, mapsaida.getPortal(0));
|
|
||||||
}
|
|
||||||
}, 3 * 60 * 1000);
|
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
@@ -704,17 +707,15 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MapleCharacter getChrById(int id) {
|
public MapleCharacter getChrById(int id) {
|
||||||
Channel cs = c.getChannelServer();
|
return c.getChannelServer().getPlayerStorage().getCharacterById(id);
|
||||||
return cs.getPlayerStorage().getCharacterById(id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelarSaida() {
|
public void cancelarSaida() {
|
||||||
Channel cs = c.getChannelServer();
|
PlayerStorage ps = c.getChannelServer().getPlayerStorage();
|
||||||
for (MaplePartyCharacter mpc : c.getPlayer().getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : c.getPlayer().getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = ps.getCharacterById(mpc.getId());
|
||||||
if (mc.timer != null) {
|
if (mc != null) {
|
||||||
mc.timer.cancel(true);
|
mc.clearCpqTimer();
|
||||||
mc.timer = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -726,8 +727,9 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
if (challenger.getParty() == null) {
|
if (challenger.getParty() == null) {
|
||||||
throw new RuntimeException("Nao existe oponente!");
|
throw new RuntimeException("Nao existe oponente!");
|
||||||
}
|
}
|
||||||
|
PlayerStorage ps = c.getChannelServer().getPlayerStorage();
|
||||||
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
||||||
MapleCharacter mc = c.getChannelServer().getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = ps.getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.changeMap(getPlayer().getMap(), getPlayer().getMap().getPortal(0));
|
mc.changeMap(getPlayer().getMap(), getPlayer().getMap().getPortal(0));
|
||||||
TimerManager tMan = TimerManager.getInstance();
|
TimerManager tMan = TimerManager.getInstance();
|
||||||
@@ -740,7 +742,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
||||||
MapleCharacter mc = c.getChannelServer().getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = ps.getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
TimerManager tMan = TimerManager.getInstance();
|
TimerManager tMan = TimerManager.getInstance();
|
||||||
tMan.schedule(new Runnable() {
|
tMan.schedule(new Runnable() {
|
||||||
@@ -757,17 +759,17 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
tMan.schedule(new Runnable() {
|
tMan.schedule(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Channel cs = c.getChannelServer();
|
PlayerStorage ps = c.getChannelServer().getPlayerStorage();
|
||||||
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = ps.getCharacterById(mpc.getId());
|
||||||
mc.setMonsterCarnival(null);
|
mc.setMonsterCarnival(null);
|
||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = ps.getCharacterById(mpc.getId());
|
||||||
mc.setMonsterCarnival(null);
|
mc.setMonsterCarnival(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
new MonsterCarnival(getPlayer().getParty(), challenger.getParty(), mapid, true);
|
new MonsterCarnival(getPlayer().getParty(), challenger.getParty(), mapid, true, (field / 100) % 10);
|
||||||
}
|
}
|
||||||
}, 11000);
|
}, 11000);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -782,8 +784,9 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
if (challenger.getParty() == null) {
|
if (challenger.getParty() == null) {
|
||||||
throw new RuntimeException("Não existe oponente!");
|
throw new RuntimeException("Não existe oponente!");
|
||||||
}
|
}
|
||||||
|
PlayerStorage ps = c.getChannelServer().getPlayerStorage();
|
||||||
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
||||||
MapleCharacter mc = c.getChannelServer().getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = ps.getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.changeMap(getPlayer().getMap(), getPlayer().getMap().getPortal(0));
|
mc.changeMap(getPlayer().getMap(), getPlayer().getMap().getPortal(0));
|
||||||
mapClock(10);
|
mapClock(10);
|
||||||
@@ -795,17 +798,18 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
tMan.schedule(new Runnable() {
|
tMan.schedule(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Channel cs = c.getChannelServer();
|
PlayerStorage ps = c.getChannelServer().getPlayerStorage();
|
||||||
|
|
||||||
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = ps.getCharacterById(mpc.getId());
|
||||||
mc.setMonsterCarnival(null);
|
mc.setMonsterCarnival(null);
|
||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = ps.getCharacterById(mpc.getId());
|
||||||
mc.setMonsterCarnival(null);
|
mc.setMonsterCarnival(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
new MonsterCarnival(getPlayer().getParty(), challenger.getParty(), mapid, false);
|
new MonsterCarnival(getPlayer().getParty(), challenger.getParty(), mapid, false, (field / 1000) % 10);
|
||||||
}
|
}
|
||||||
}, 10000);
|
}, 10000);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -814,7 +818,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendCPQMapLists2() {
|
public void sendCPQMapLists2() {
|
||||||
String msg = LinguaConstants.Linguas(getPlayer()).CPQInicioEscolha;
|
String msg = LanguageConstants.Linguas(getPlayer()).CPQInicioEscolha;
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
if (fieldTaken2(i)) {
|
if (fieldTaken2(i)) {
|
||||||
if (fieldLobbied2(i)) {
|
if (fieldLobbied2(i)) {
|
||||||
@@ -856,16 +860,18 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
|
|
||||||
public void cpqLobby2(int field) {
|
public void cpqLobby2(int field) {
|
||||||
try {
|
try {
|
||||||
final MapleMap map, mapsaida;
|
final MapleMap map, mapExit;
|
||||||
Channel cs = c.getChannelServer();
|
Channel cs = c.getChannelServer();
|
||||||
mapsaida = cs.getMapFactory().getMap(980030000);
|
PlayerStorage ps = c.getChannelServer().getPlayerStorage();
|
||||||
|
|
||||||
|
mapExit = cs.getMapFactory().getMap(980030000);
|
||||||
map = cs.getMapFactory().getMap(980031000 + 1000 * field);
|
map = cs.getMapFactory().getMap(980031000 + 1000 * field);
|
||||||
for (MaplePartyCharacter mpc : c.getPlayer().getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : c.getPlayer().getParty().getMembers()) {
|
||||||
final MapleCharacter mc;
|
final MapleCharacter mc;
|
||||||
mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
mc = ps.getCharacterByName(mpc.getName());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.changeMap(map, map.getPortal(0));
|
mc.changeMap(map, map.getPortal(0));
|
||||||
mc.getClient().getSession().write(MaplePacketCreator.serverNotice(6, LinguaConstants.Linguas(mc).CPQEntradaLobby));
|
mc.announce(MaplePacketCreator.serverNotice(6, LanguageConstants.Linguas(mc).CPQEntradaLobby));
|
||||||
TimerManager tMan = TimerManager.getInstance();
|
TimerManager tMan = TimerManager.getInstance();
|
||||||
tMan.schedule(new Runnable() {
|
tMan.schedule(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -873,13 +879,14 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
mapClock(3 * 60);
|
mapClock(3 * 60);
|
||||||
}
|
}
|
||||||
}, 1500);
|
}, 1500);
|
||||||
|
|
||||||
|
mc.setCpqTimer(TimerManager.getInstance().schedule(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
mc.changeMap(mapExit, mapExit.getPortal(0));
|
||||||
|
}
|
||||||
|
}, 3 * 60 * 1000));
|
||||||
}
|
}
|
||||||
mc.timer = TimerManager.getInstance().schedule(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mc.changeMap(mapsaida, mapsaida.getPortal(0));
|
|
||||||
}
|
|
||||||
}, 3 * 60 * 1000);
|
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
@@ -892,7 +899,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
for (MapleMapObject mmo : map.getAllPlayer()) {
|
for (MapleMapObject mmo : map.getAllPlayer()) {
|
||||||
MapleCharacter mc = (MapleCharacter) mmo;
|
MapleCharacter mc = (MapleCharacter) mmo;
|
||||||
if (mc.getParty() == null) {
|
if (mc.getParty() == null) {
|
||||||
sendOk(LinguaConstants.Linguas(mc).CPQEscolha);
|
sendOk(LanguageConstants.Linguas(mc).CPQEscolha);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mc.getParty().getLeader().getId() == mc.getId()) {
|
if (mc.getParty().getLeader().getId() == mc.getId()) {
|
||||||
@@ -908,15 +915,14 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
}
|
}
|
||||||
NPCScriptManager.getInstance().start("cpqchallenge2", leader.getClient(), npc, members);
|
NPCScriptManager.getInstance().start("cpqchallenge2", leader.getClient(), npc, members);
|
||||||
} else {
|
} else {
|
||||||
sendOk(LinguaConstants.Linguas(leader).CPQInicioEscolhaEmEscolha);
|
sendOk(LanguageConstants.Linguas(leader).CPQInicioEscolhaEmEscolha);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendOk(LinguaConstants.Linguas(leader).CPQLiderNaoEncontrado);
|
sendOk(LanguageConstants.Linguas(leader).CPQLiderNaoEncontrado);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void mapClock(int time) {
|
public void mapClock(int time) {
|
||||||
//getPlayer().getMap().broadcastMessage(MaplePacketCreator.serverNotice(type, message));
|
|
||||||
getPlayer().getMap().broadcastMessage(MaplePacketCreator.getClock(time));
|
getPlayer().getMap().broadcastMessage(MaplePacketCreator.getClock(time));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -930,7 +936,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
for (MapleMapObject mmo : map.getAllPlayer()) {
|
for (MapleMapObject mmo : map.getAllPlayer()) {
|
||||||
MapleCharacter mc = (MapleCharacter) mmo;
|
MapleCharacter mc = (MapleCharacter) mmo;
|
||||||
if (mc.getParty() == null) {
|
if (mc.getParty() == null) {
|
||||||
sendOk(LinguaConstants.Linguas(mc).CPQEscolha);
|
sendOk(LanguageConstants.Linguas(mc).CPQEscolha);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mc.getParty().getLeader().getId() == mc.getId()) {
|
if (mc.getParty().getLeader().getId() == mc.getId()) {
|
||||||
@@ -941,15 +947,17 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
if (leader != null) {
|
if (leader != null) {
|
||||||
if (!leader.isChallenged()) {
|
if (!leader.isChallenged()) {
|
||||||
List<MaplePartyCharacter> members = new LinkedList<>();
|
List<MaplePartyCharacter> members = new LinkedList<>();
|
||||||
for (MaplePartyCharacter fucker : c.getPlayer().getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : c.getPlayer().getParty().getMembers()) {
|
||||||
members.add(fucker);
|
members.add(mpc);
|
||||||
}
|
}
|
||||||
|
|
||||||
NPCScriptManager.getInstance().start("cpqchallenge", leader.getClient(), npc, members);
|
NPCScriptManager.getInstance().start("cpqchallenge", leader.getClient(), npc, members);
|
||||||
|
sendOk(LanguageConstants.Linguas(leader).CPQInicioEscolhaEnviada);
|
||||||
} else {
|
} else {
|
||||||
sendOk(LinguaConstants.Linguas(leader).CPQInicioEscolhaEmEscolha);
|
sendOk(LanguageConstants.Linguas(leader).CPQInicioEscolhaEmEscolha);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendOk(LinguaConstants.Linguas(leader).CPQLiderNaoEncontrado);
|
sendOk(LanguageConstants.Linguas(leader).CPQLiderNaoEncontrado);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -961,24 +969,46 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enviarLista() {
|
public void sendMarriageWishlist(boolean groom) {
|
||||||
EventInstanceManager eim = getEventInstance();
|
MapleCharacter player = this.getPlayer();
|
||||||
if(eim != null) {
|
MapleMarriage marriage = player.getMarriageInstance();
|
||||||
String name = eim.getProperty("brideId");
|
if(marriage != null) {
|
||||||
MapleCharacter chr = getChrById(Integer.parseInt(name));
|
int cid = marriage.getIntProperty(groom ? "groomId" : "brideId");
|
||||||
//MapleCharacter chr = getChrById(3);
|
MapleCharacter chr = marriage.getPlayerById(cid);
|
||||||
if (chr != null) {
|
if (chr != null) {
|
||||||
if (chr.getId() == getPlayer().getId()) {
|
if (chr.getId() == player.getId()) {
|
||||||
getPlayer().announce(Wedding.OnWeddingGiftResult((byte) 0xA, chr.getItens(), chr.getItem()));
|
player.announce(Wedding.OnWeddingGiftResult((byte) 0xA, marriage.getWishlistItems(groom), marriage.getGiftItems(player.getClient(), groom)));
|
||||||
} else {
|
} else {
|
||||||
getPlayer().announce(Wedding.OnWeddingGiftResult((byte) 0x09, chr.getItens(), chr.getItem()));
|
marriage.setIntProperty("wishlistSelection", groom ? 0 : 1);
|
||||||
|
player.announce(Wedding.OnWeddingGiftResult((byte) 0x09, marriage.getWishlistItems(groom), marriage.getGiftItems(player.getClient(), groom)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void criarLista() {
|
|
||||||
getClient().getSession().write(Wedding.sendWishList());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public void sendMarriageGifts(List<Item> gifts) {
|
||||||
|
this.getPlayer().announce(Wedding.OnWeddingGiftResult((byte) 0xA, Collections.singletonList(""), gifts));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean createMarriageWishlist() {
|
||||||
|
MapleMarriage marriage = this.getPlayer().getMarriageInstance();
|
||||||
|
if (marriage != null) {
|
||||||
|
Boolean groom = marriage.isMarriageGroom(this.getPlayer());
|
||||||
|
if (groom != null) {
|
||||||
|
String wlKey;
|
||||||
|
if (groom) {
|
||||||
|
wlKey = "groomWishlist";
|
||||||
|
} else {
|
||||||
|
wlKey = "brideWishlist";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (marriage.getProperty(wlKey).contentEquals("")) {
|
||||||
|
getClient().announce(Wedding.sendWishList());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
/*
|
||||||
|
This file is part of the HeavenMS MapleStory Server
|
||||||
|
Copyleft (L) 2016 - 2018 RonanLana
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation version 3 as published by
|
||||||
|
the Free Software Foundation. You may not use, modify or distribute
|
||||||
|
this program under any other version of the GNU Affero General Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package server;
|
||||||
|
|
||||||
|
import client.MapleClient;
|
||||||
|
import client.MapleCharacter;
|
||||||
|
import client.inventory.Item;
|
||||||
|
import client.inventory.ItemFactory;
|
||||||
|
import client.inventory.MapleInventory;
|
||||||
|
import client.inventory.MapleInventoryType;
|
||||||
|
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||||
|
import scripting.event.EventInstanceManager;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import scripting.event.EventManager;
|
||||||
|
import tools.DatabaseConnection;
|
||||||
|
import tools.Pair;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Ronan
|
||||||
|
*/
|
||||||
|
public class MapleMarriage extends EventInstanceManager {
|
||||||
|
|
||||||
|
public MapleMarriage(EventManager em, String name) {
|
||||||
|
super(em, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean giftItemToSpouse(int cid) {
|
||||||
|
return this.getIntProperty("wishlistSelection") == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getWishlistItems(boolean groom) {
|
||||||
|
String strItems = this.getProperty(groom ? "groomWishlist" : "brideWishlist");
|
||||||
|
if (strItems != null) {
|
||||||
|
return Arrays.asList(strItems.split("\r\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return new LinkedList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initializeGiftItems() {
|
||||||
|
List<Item> groomGifts = new ArrayList<>();
|
||||||
|
this.setObjectProperty("groomGiftlist", groomGifts);
|
||||||
|
|
||||||
|
List<Item> brideGifts = new ArrayList<>();
|
||||||
|
this.setObjectProperty("brideGiftlist", brideGifts);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Item> getGiftItems(MapleClient c, boolean groom) {
|
||||||
|
c.tryacquireClient();
|
||||||
|
try {
|
||||||
|
List<Item> gifts = getGiftItemsList(groom);
|
||||||
|
synchronized (gifts) {
|
||||||
|
return new LinkedList<>(gifts);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
c.releaseClient();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Item> getGiftItemsList(boolean groom) {
|
||||||
|
return (List<Item>) this.getObjectProperty(groom ? "groomGiftlist" : "brideGiftlist");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Item getGiftItem(MapleClient c, boolean groom, int idx) {
|
||||||
|
try {
|
||||||
|
return getGiftItems(c, groom).get(idx);
|
||||||
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addGiftItem(boolean groom, Item item) {
|
||||||
|
List<Item> gifts = getGiftItemsList(groom);
|
||||||
|
synchronized (gifts) {
|
||||||
|
gifts.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeGiftItem(boolean groom, Item item) {
|
||||||
|
List<Item> gifts = getGiftItemsList(groom);
|
||||||
|
synchronized (gifts) {
|
||||||
|
gifts.remove(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isMarriageGroom(MapleCharacter chr) {
|
||||||
|
Boolean groom = null;
|
||||||
|
try {
|
||||||
|
int groomid = this.getIntProperty("groomId"), brideid = this.getIntProperty("brideId");
|
||||||
|
if (chr.getId() == groomid) {
|
||||||
|
groom = true;
|
||||||
|
} else if (chr.getId() == brideid) {
|
||||||
|
groom = false;
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException nfe) {}
|
||||||
|
|
||||||
|
return groom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean claimGiftItems(MapleClient c, MapleCharacter chr) {
|
||||||
|
List<Item> gifts = loadGiftItemsFromDb(c, chr.getId());
|
||||||
|
if (MapleInventory.checkSpot(chr, gifts)) {
|
||||||
|
try {
|
||||||
|
Connection con = DatabaseConnection.getConnection();
|
||||||
|
ItemFactory.MARRIAGE_GIFTS.saveItems(new LinkedList<Pair<Item, MapleInventoryType>>(), chr.getId(), con);
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException sqle) {}
|
||||||
|
|
||||||
|
for (Item item : gifts) {
|
||||||
|
MapleInventoryManipulator.addFromDrop(chr.getClient(), item, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<Item> loadGiftItemsFromDb(MapleClient c, int cid) {
|
||||||
|
c.tryacquireClient();
|
||||||
|
try {
|
||||||
|
List<Item> items = new LinkedList<>();
|
||||||
|
try {
|
||||||
|
for (Pair<Item, MapleInventoryType> it : ItemFactory.MARRIAGE_GIFTS.loadItems(cid, false)) {
|
||||||
|
items.add(it.getLeft());
|
||||||
|
}
|
||||||
|
} catch (SQLException sqle) {
|
||||||
|
sqle.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return items;
|
||||||
|
} finally {
|
||||||
|
c.releaseClient();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveGiftItemsToDb(MapleClient c, boolean groom, int cid) {
|
||||||
|
MapleMarriage.saveGiftItemsToDb(c, getGiftItems(c, groom), cid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveGiftItemsToDb(MapleClient c, List<Item> giftItems, int cid) {
|
||||||
|
List<Pair<Item, MapleInventoryType>> items = new LinkedList<>();
|
||||||
|
for (Item it : giftItems) {
|
||||||
|
items.add(new Pair<>(it, it.getInventoryType()));
|
||||||
|
}
|
||||||
|
|
||||||
|
c.tryacquireClient();
|
||||||
|
try {
|
||||||
|
try {
|
||||||
|
Connection con = DatabaseConnection.getConnection();
|
||||||
|
ItemFactory.MARRIAGE_GIFTS.saveItems(items, cid, con);
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException sqle) {
|
||||||
|
sqle.printStackTrace();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
c.releaseClient();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -940,26 +940,17 @@ public class MapleStatEffect {
|
|||||||
} else if (cp != 0 && applyto.getMonsterCarnival() != null) {
|
} else if (cp != 0 && applyto.getMonsterCarnival() != null) {
|
||||||
applyto.gainCP(cp);
|
applyto.gainCP(cp);
|
||||||
} else if (nuffSkill != 0 && applyto.getParty() != null && applyto.getMap().isCPQMap()) { // by Drago-Dragohe4rt
|
} else if (nuffSkill != 0 && applyto.getParty() != null && applyto.getMap().isCPQMap()) { // by Drago-Dragohe4rt
|
||||||
final MCSkill skil = MapleCarnivalFactory.getInstance().getSkill(nuffSkill);
|
final MCSkill skill = MapleCarnivalFactory.getInstance().getSkill(nuffSkill);
|
||||||
if (skil != null) {
|
if (skill != null) {
|
||||||
final MapleDisease dis = skil.getDisease();
|
final MapleDisease dis = skill.getDisease();
|
||||||
MapleParty inimigos = applyfrom.getParty().getEnemy();
|
MapleParty opposition = applyfrom.getParty().getEnemy();
|
||||||
if (nuffSkill == 8) {
|
for (MaplePartyCharacter enemyChrs : opposition.getPartyMembers()) {
|
||||||
int amount = inimigos.getMembers().size() - 1;
|
MapleCharacter chrApp = enemyChrs.getPlayer();
|
||||||
int randd = (int) Math.floor(Math.random() * amount);
|
|
||||||
MapleCharacter chrApp = applyfrom.getClient().getChannelServer().getPlayerStorage().getCharacterById(inimigos.getMemberByPos(randd).getId());
|
|
||||||
if (chrApp != null && chrApp.getMap().isCPQMap()) {
|
if (chrApp != null && chrApp.getMap().isCPQMap()) {
|
||||||
chrApp.dispel();
|
if (dis == null) {
|
||||||
}
|
chrApp.dispel();
|
||||||
} else {
|
} else {
|
||||||
for (MaplePartyCharacter chrsInimigos : inimigos.getPartyMembers()) {
|
chrApp.giveDebuff(dis, MCSkill.getMobSkill(dis.getDisease()));
|
||||||
MapleCharacter chrApp = chrsInimigos.getPlayer();
|
|
||||||
if (chrApp != null && chrApp.getMap().isCPQMap()) {
|
|
||||||
if (dis == null) {
|
|
||||||
chrApp.dispel();
|
|
||||||
} else if (skil.getSkill() != null) {
|
|
||||||
chrApp.giveDebuff(dis, skil.getSkill());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,45 +182,38 @@ public class MapleMonsterInformationProvider {
|
|||||||
return drops.get(monsterId);
|
return drops.get(monsterId);
|
||||||
}
|
}
|
||||||
final List<MonsterDropEntry> ret = new LinkedList<>();
|
final List<MonsterDropEntry> ret = new LinkedList<>();
|
||||||
|
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
Connection con = null;
|
||||||
|
try {
|
||||||
|
con = DatabaseConnection.getConnection();
|
||||||
|
ps = con.prepareStatement("SELECT itemid, chance, minimum_quantity, maximum_quantity, questid FROM drop_data WHERE dropperid = ?");
|
||||||
|
ps.setInt(1, monsterId);
|
||||||
|
rs = ps.executeQuery();
|
||||||
|
|
||||||
if (monsterId >= 9300127 && monsterId <= 9300136 || monsterId >= 9300315 && monsterId <= 9300324) {
|
while (rs.next()) {
|
||||||
int dropArray[] = {2022157, 2022158, 2022159, 2022160, 2022161, 2022162, 2022163, 2022164, 2022165, 2022166, 2022167, 2022168, 2022169, 2022170, 2022171, 2022172, 2022173, 2022174, 2022175, 2022176, 2022177, 2022178, 4001129}; //These are the drops, -1 means meso :D
|
ret.add(new MonsterDropEntry(rs.getInt("itemid"), rs.getInt("chance"), rs.getInt("minimum_quantity"), rs.getInt("maximum_quantity"), rs.getShort("questid")));
|
||||||
for (int id : dropArray) {
|
|
||||||
ret.add(new MonsterDropEntry(id, 2000, 1, 1, (short) 0));
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
PreparedStatement ps = null;
|
con.close();
|
||||||
ResultSet rs = null;
|
} catch (SQLException e) {
|
||||||
Connection con = null;
|
e.printStackTrace();
|
||||||
|
return ret;
|
||||||
|
} finally {
|
||||||
try {
|
try {
|
||||||
con = DatabaseConnection.getConnection();
|
if (ps != null && !ps.isClosed()) {
|
||||||
ps = con.prepareStatement("SELECT itemid, chance, minimum_quantity, maximum_quantity, questid FROM drop_data WHERE dropperid = ?");
|
ps.close();
|
||||||
ps.setInt(1, monsterId);
|
|
||||||
rs = ps.executeQuery();
|
|
||||||
|
|
||||||
while (rs.next()) {
|
|
||||||
ret.add(new MonsterDropEntry(rs.getInt("itemid"), rs.getInt("chance"), rs.getInt("minimum_quantity"), rs.getInt("maximum_quantity"), rs.getShort("questid")));
|
|
||||||
}
|
}
|
||||||
|
if (rs != null && !rs.isClosed()) {
|
||||||
con.close();
|
rs.close();
|
||||||
} catch (SQLException e) {
|
}
|
||||||
e.printStackTrace();
|
if (con != null && !con.isClosed()) {
|
||||||
|
con.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ignore) {
|
||||||
|
ignore.printStackTrace();
|
||||||
return ret;
|
return ret;
|
||||||
} finally {
|
|
||||||
try {
|
|
||||||
if (ps != null && !ps.isClosed()) {
|
|
||||||
ps.close();
|
|
||||||
}
|
|
||||||
if (rs != null && !rs.isClosed()) {
|
|
||||||
rs.close();
|
|
||||||
}
|
|
||||||
if (con != null && !con.isClosed()) {
|
|
||||||
con.close();
|
|
||||||
}
|
|
||||||
} catch (SQLException ignore) {
|
|
||||||
ignore.printStackTrace();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drops.put(monsterId, ret);
|
drops.put(monsterId, ret);
|
||||||
|
|||||||
@@ -166,18 +166,20 @@ public class MapleMapFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized MapleMap loadMapFromWz(int mapid, Integer omapid) {
|
private synchronized MapleMap loadMapFromWz(int mapid, Integer omapid, boolean cache) {
|
||||||
MapleMap map;
|
MapleMap map;
|
||||||
|
|
||||||
mapsRLock.lock();
|
if (cache) {
|
||||||
try {
|
mapsRLock.lock();
|
||||||
map = maps.get(omapid);
|
try {
|
||||||
} finally {
|
map = maps.get(omapid);
|
||||||
mapsRLock.unlock();
|
} finally {
|
||||||
}
|
mapsRLock.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
if (map != null) {
|
if (map != null) {
|
||||||
return map;
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String mapName = getMapName(mapid);
|
String mapName = getMapName(mapid);
|
||||||
@@ -389,11 +391,13 @@ public class MapleMapFactory {
|
|||||||
map.setBackgroundTypes(backTypes);
|
map.setBackgroundTypes(backTypes);
|
||||||
map.generateMapDropRangeCache();
|
map.generateMapDropRangeCache();
|
||||||
|
|
||||||
mapsWLock.lock();
|
if (cache) {
|
||||||
try {
|
mapsWLock.lock();
|
||||||
maps.put(omapid, map);
|
try {
|
||||||
} finally {
|
maps.put(omapid, map);
|
||||||
mapsWLock.unlock();
|
} finally {
|
||||||
|
mapsWLock.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
@@ -410,7 +414,11 @@ public class MapleMapFactory {
|
|||||||
mapsRLock.unlock();
|
mapsRLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (map != null) ? map : loadMapFromWz(mapid, omapid);
|
return (map != null) ? map : loadMapFromWz(mapid, omapid, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapleMap getDisposableMap(int mapid) {
|
||||||
|
return loadMapFromWz(mapid, mapid, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMapLoaded(int mapId) {
|
public boolean isMapLoaded(int mapId) {
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ public class MapleCarnivalFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MobSkill getSkill() {
|
public MobSkill getSkill() {
|
||||||
|
return getMobSkill(skillid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MobSkill getMobSkill(int skillid) {
|
||||||
return MobSkillFactory.getMobSkill(skillid, 1); //level?
|
return MobSkillFactory.getMobSkill(skillid, 1); //level?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ package server.partyquest;
|
|||||||
|
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import client.MapleCharacter;
|
import client.MapleCharacter;
|
||||||
import constants.LinguaConstants;
|
import constants.LanguageConstants;
|
||||||
|
import constants.ServerConstants;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
import net.server.channel.Channel;
|
import net.server.channel.Channel;
|
||||||
import net.server.world.MapleParty;
|
import net.server.world.MapleParty;
|
||||||
@@ -24,22 +25,23 @@ public class MonsterCarnival {
|
|||||||
|
|
||||||
private MapleParty p1, p2;
|
private MapleParty p1, p2;
|
||||||
private MapleMap map;
|
private MapleMap map;
|
||||||
private ScheduledFuture<?> timer, effectTimer;
|
private ScheduledFuture<?> timer, effectTimer, respawnTask;
|
||||||
private long startTime = 0;
|
private long startTime = 0;
|
||||||
private int summons = 8, summonss = 8;
|
private int summonsR = 8, summonsB = 8, room = 0;
|
||||||
private MapleCharacter leader1, leader2, Grupo1, Grupo2;
|
private MapleCharacter leader1, leader2, Grupo1, Grupo2;
|
||||||
private int redCP, blueCP, redTotalCP, blueTotalCP;
|
private int redCP, blueCP, redTotalCP, blueTotalCP;
|
||||||
private boolean cpq1;
|
private boolean cpq1;
|
||||||
|
|
||||||
public MonsterCarnival(MapleParty p1, MapleParty p2, int mapid, boolean cpq1) {
|
public MonsterCarnival(MapleParty p1, MapleParty p2, int mapid, boolean cpq1, int room) {
|
||||||
try {
|
try {
|
||||||
this.cpq1 = cpq1;
|
this.cpq1 = cpq1;
|
||||||
|
this.room = room;
|
||||||
this.p1 = p1;
|
this.p1 = p1;
|
||||||
this.p2 = p2;
|
this.p2 = p2;
|
||||||
Channel cs = Server.getInstance().getWorld(p2.getLeader().getWorld()).getChannel(p2.getLeader().getChannel());
|
Channel cs = Server.getInstance().getWorld(p2.getLeader().getWorld()).getChannel(p2.getLeader().getChannel());
|
||||||
p1.setEnemy(p2);
|
p1.setEnemy(p2);
|
||||||
p2.setEnemy(p1);
|
p2.setEnemy(p1);
|
||||||
map = cs.getMapFactory().resetMap(mapid);
|
map = cs.getMapFactory().getDisposableMap(mapid);
|
||||||
int redPortal = 0;
|
int redPortal = 0;
|
||||||
int bluePortal = 0;
|
int bluePortal = 0;
|
||||||
if (map.isPurpleCPQMap()) {
|
if (map.isPurpleCPQMap()) {
|
||||||
@@ -47,13 +49,13 @@ public class MonsterCarnival {
|
|||||||
bluePortal = 1;
|
bluePortal = 1;
|
||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : p1.getMembers()) {
|
for (MaplePartyCharacter mpc : p1.getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = cs.getPlayerStorage().getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.setMonsterCarnival(this);
|
mc.setMonsterCarnival(this);
|
||||||
mc.setTeam(0);
|
mc.setTeam(0);
|
||||||
mc.setFestivalPoints(0);
|
mc.setFestivalPoints(0);
|
||||||
mc.changeMap(map, map.getPortal(redPortal));
|
mc.forceChangeMap(map, map.getPortal(redPortal));
|
||||||
mc.dropMessage(6, LinguaConstants.Linguas(mc).CPQEntrada);
|
mc.dropMessage(6, LanguageConstants.Linguas(mc).CPQEntrada);
|
||||||
if (p1.getLeader().getId() == mc.getId()) {
|
if (p1.getLeader().getId() == mc.getId()) {
|
||||||
leader1 = mc;
|
leader1 = mc;
|
||||||
}
|
}
|
||||||
@@ -61,13 +63,13 @@ public class MonsterCarnival {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : p2.getMembers()) {
|
for (MaplePartyCharacter mpc : p2.getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = cs.getPlayerStorage().getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.setMonsterCarnival(this);
|
mc.setMonsterCarnival(this);
|
||||||
mc.setTeam(1);
|
mc.setTeam(1);
|
||||||
mc.setFestivalPoints(0);
|
mc.setFestivalPoints(0);
|
||||||
mc.changeMap(map, map.getPortal(bluePortal));
|
mc.forceChangeMap(map, map.getPortal(bluePortal));
|
||||||
mc.dropMessage(6, LinguaConstants.Linguas(mc).CPQEntrada);
|
mc.dropMessage(6, LanguageConstants.Linguas(mc).CPQEntrada);
|
||||||
if (p2.getLeader().getId() == mc.getId()) {
|
if (p2.getLeader().getId() == mc.getId()) {
|
||||||
leader2 = mc;
|
leader2 = mc;
|
||||||
}
|
}
|
||||||
@@ -76,10 +78,10 @@ public class MonsterCarnival {
|
|||||||
}
|
}
|
||||||
if (Grupo1 == null || Grupo2 == null) {
|
if (Grupo1 == null || Grupo2 == null) {
|
||||||
for (MaplePartyCharacter mpc : p2.getMembers()) {
|
for (MaplePartyCharacter mpc : p2.getMembers()) {
|
||||||
mpc.getPlayer().dropMessage(5, LinguaConstants.Linguas(mpc.getPlayer()).CPQErro);
|
mpc.getPlayer().dropMessage(5, LanguageConstants.Linguas(mpc.getPlayer()).CPQErro);
|
||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : p2.getMembers()) {
|
for (MaplePartyCharacter mpc : p2.getMembers()) {
|
||||||
mpc.getPlayer().dropMessage(5, LinguaConstants.Linguas(mpc.getPlayer()).CPQErro);
|
mpc.getPlayer().dropMessage(5, LanguageConstants.Linguas(mpc.getPlayer()).CPQErro);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -98,6 +100,12 @@ public class MonsterCarnival {
|
|||||||
complete();
|
complete();
|
||||||
}
|
}
|
||||||
}, 10 * 60 * 1000 - 10 * 1000);
|
}, 10 * 60 * 1000 - 10 * 1000);
|
||||||
|
respawnTask = TimerManager.getInstance().register(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
respawn();
|
||||||
|
}
|
||||||
|
}, ServerConstants.RESPAWN_INTERVAL);
|
||||||
TimerManager.getInstance().schedule(new Runnable() {
|
TimerManager.getInstance().schedule(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -109,6 +117,10 @@ public class MonsterCarnival {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void respawn() {
|
||||||
|
map.respawn();
|
||||||
|
}
|
||||||
|
|
||||||
public void playerDisconnected(int charid) {
|
public void playerDisconnected(int charid) {
|
||||||
int team = -1;
|
int team = -1;
|
||||||
for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) {
|
||||||
@@ -128,13 +140,13 @@ public class MonsterCarnival {
|
|||||||
String teamS = "";
|
String teamS = "";
|
||||||
switch (team) {
|
switch (team) {
|
||||||
case 0:
|
case 0:
|
||||||
teamS = LinguaConstants.Linguas(chrMap).CPQVermelho;
|
teamS = LanguageConstants.Linguas(chrMap).CPQVermelho;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
teamS = LinguaConstants.Linguas(chrMap).CPQAzul;
|
teamS = LanguageConstants.Linguas(chrMap).CPQAzul;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
chrMap.dropMessage(5, teamS + LinguaConstants.Linguas(chrMap).CPQPlayerExit);
|
chrMap.dropMessage(5, teamS + LanguageConstants.Linguas(chrMap).CPQPlayerExit);
|
||||||
}
|
}
|
||||||
earlyFinish();
|
earlyFinish();
|
||||||
}
|
}
|
||||||
@@ -151,20 +163,20 @@ public class MonsterCarnival {
|
|||||||
dispose(false);
|
dispose(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void summon() {
|
public void summonR() {
|
||||||
this.summons--;
|
this.summonsR--;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSummon() {
|
public boolean canSummonR() {
|
||||||
return this.summons > 0;
|
return this.summonsR > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void summons() {
|
public void summonB() {
|
||||||
this.summonss--;
|
this.summonsB--;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSummons() {
|
public boolean canSummonB() {
|
||||||
return this.summonss > 0;
|
return this.summonsB > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void dispose(boolean warpout) {
|
protected void dispose(boolean warpout) {
|
||||||
@@ -176,7 +188,7 @@ public class MonsterCarnival {
|
|||||||
out = cs.getMapFactory().getMap(980000000);
|
out = cs.getMapFactory().getMap(980000000);
|
||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = cs.getPlayerStorage().getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.resetCP();
|
mc.resetCP();
|
||||||
mc.setTeam(-1);
|
mc.setTeam(-1);
|
||||||
@@ -187,7 +199,7 @@ public class MonsterCarnival {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = cs.getPlayerStorage().getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.resetCP();
|
mc.resetCP();
|
||||||
mc.setTeam(-1);
|
mc.setTeam(-1);
|
||||||
@@ -205,10 +217,16 @@ public class MonsterCarnival {
|
|||||||
this.effectTimer.cancel(true);
|
this.effectTimer.cancel(true);
|
||||||
this.effectTimer = null;
|
this.effectTimer = null;
|
||||||
}
|
}
|
||||||
|
if (this.respawnTask != null) {
|
||||||
|
this.respawnTask.cancel(true);
|
||||||
|
this.respawnTask = null;
|
||||||
|
}
|
||||||
redTotalCP = 0;
|
redTotalCP = 0;
|
||||||
blueTotalCP = 0;
|
blueTotalCP = 0;
|
||||||
leader1.getParty().setEnemy(null);
|
leader1.getParty().setEnemy(null);
|
||||||
leader2.getParty().setEnemy(null);
|
leader2.getParty().setEnemy(null);
|
||||||
|
map.dispose();
|
||||||
|
map = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +243,7 @@ public class MonsterCarnival {
|
|||||||
Channel cs = Server.getInstance().getWorld(p1.getLeader().getWorld()).getChannel(p1.getLeader().getChannel());
|
Channel cs = Server.getInstance().getWorld(p1.getLeader().getWorld()).getChannel(p1.getLeader().getChannel());
|
||||||
if (winningTeam == 0) {
|
if (winningTeam == 0) {
|
||||||
for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = cs.getPlayerStorage().getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.gainFestivalPoints(this.redTotalCP);
|
mc.gainFestivalPoints(this.redTotalCP);
|
||||||
mc.setMonsterCarnival(null);
|
mc.setMonsterCarnival(null);
|
||||||
@@ -239,7 +257,7 @@ public class MonsterCarnival {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = cs.getPlayerStorage().getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.gainFestivalPoints(this.blueTotalCP);
|
mc.gainFestivalPoints(this.blueTotalCP);
|
||||||
mc.setMonsterCarnival(null);
|
mc.setMonsterCarnival(null);
|
||||||
@@ -254,7 +272,7 @@ public class MonsterCarnival {
|
|||||||
}
|
}
|
||||||
} else if (winningTeam == 1) {
|
} else if (winningTeam == 1) {
|
||||||
for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = cs.getPlayerStorage().getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.gainFestivalPoints(this.blueTotalCP);
|
mc.gainFestivalPoints(this.blueTotalCP);
|
||||||
mc.setMonsterCarnival(null);
|
mc.setMonsterCarnival(null);
|
||||||
@@ -268,7 +286,7 @@ public class MonsterCarnival {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) {
|
||||||
MapleCharacter mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
MapleCharacter mc = cs.getPlayerStorage().getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
mc.gainFestivalPoints(this.redTotalCP);
|
mc.gainFestivalPoints(this.redTotalCP);
|
||||||
mc.setMonsterCarnival(null);
|
mc.setMonsterCarnival(null);
|
||||||
@@ -312,7 +330,7 @@ public class MonsterCarnival {
|
|||||||
|
|
||||||
public void extendTime() {
|
public void extendTime() {
|
||||||
for (MapleCharacter chrMap : map.getAllPlayers()) {
|
for (MapleCharacter chrMap : map.getAllPlayers()) {
|
||||||
chrMap.dropMessage(5, LinguaConstants.Linguas(chrMap).CPQTempoExtendido);
|
chrMap.dropMessage(5, LanguageConstants.Linguas(chrMap).CPQTempoExtendido);
|
||||||
}
|
}
|
||||||
startTime = System.currentTimeMillis() + 3 * 1000;
|
startTime = System.currentTimeMillis() + 3 * 1000;
|
||||||
map.addClock(3 * 60);
|
map.addClock(3 * 60);
|
||||||
@@ -340,14 +358,14 @@ public class MonsterCarnival {
|
|||||||
int chnl = leader1.getClient().getChannel();
|
int chnl = leader1.getClient().getChannel();
|
||||||
int chnl1 = leader2.getClient().getChannel();
|
int chnl1 = leader2.getClient().getChannel();
|
||||||
if (chnl != chnl1) {
|
if (chnl != chnl1) {
|
||||||
throw new RuntimeException("Os líderes estão em canais diferentes.");
|
throw new RuntimeException("Os lideres estao em canais diferentes.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Channel cs = Server.getInstance().getWorld(p1.getLeader().getWorld()).getChannel(p1.getLeader().getChannel());
|
Channel cs = Server.getInstance().getWorld(p1.getLeader().getWorld()).getChannel(p1.getLeader().getChannel());
|
||||||
map.killAllMonsters();
|
map.killAllMonsters();
|
||||||
for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) {
|
||||||
MapleCharacter mc;
|
MapleCharacter mc;
|
||||||
mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
mc = cs.getPlayerStorage().getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
if (redWin) {
|
if (redWin) {
|
||||||
mc.getClient().announce(MaplePacketCreator.showEffect("quest/carnival/win"));
|
mc.getClient().announce(MaplePacketCreator.showEffect("quest/carnival/win"));
|
||||||
@@ -362,7 +380,7 @@ public class MonsterCarnival {
|
|||||||
}
|
}
|
||||||
for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) {
|
for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) {
|
||||||
MapleCharacter mc;
|
MapleCharacter mc;
|
||||||
mc = cs.getPlayerStorage().getCharacterByName(mpc.getName());
|
mc = cs.getPlayerStorage().getCharacterById(mpc.getId());
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
if (!redWin) {
|
if (!redWin) {
|
||||||
mc.getClient().announce(MaplePacketCreator.showEffect("quest/carnival/win"));
|
mc.getClient().announce(MaplePacketCreator.showEffect("quest/carnival/win"));
|
||||||
@@ -486,4 +504,8 @@ public class MonsterCarnival {
|
|||||||
this.blueCP = CP;
|
this.blueCP = CP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getRoom() {
|
||||||
|
return this.room;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class MonsterCarnivalParty {
|
|||||||
private MapleCharacter leader;
|
private MapleCharacter leader;
|
||||||
private byte team;
|
private byte team;
|
||||||
private short availableCP = 0, totalCP = 0;
|
private short availableCP = 0, totalCP = 0;
|
||||||
private int summons = 7;
|
private int summons = 8;
|
||||||
private boolean winner = false;
|
private boolean winner = false;
|
||||||
|
|
||||||
public MonsterCarnivalParty(final MapleCharacter owner, final List<MapleCharacter> members1, final byte team1) {
|
public MonsterCarnivalParty(final MapleCharacter owner, final List<MapleCharacter> members1, final byte team1) {
|
||||||
@@ -24,7 +24,7 @@ public class MonsterCarnivalParty {
|
|||||||
team = team1;
|
team = team1;
|
||||||
|
|
||||||
for (final MapleCharacter chr : members) {
|
for (final MapleCharacter chr : members) {
|
||||||
chr.setCarnivalParty(this);
|
chr.setMonsterCarnivalParty(this);
|
||||||
chr.setTeam(team);
|
chr.setTeam(team);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,8 +63,8 @@ public class MonsterCarnivalParty {
|
|||||||
public void warpOut(final int map) {
|
public void warpOut(final int map) {
|
||||||
for (MapleCharacter chr : members) {
|
for (MapleCharacter chr : members) {
|
||||||
chr.changeMap(map, 0);
|
chr.changeMap(map, 0);
|
||||||
chr.setCarnivalParty(null);
|
chr.setMonsterCarnivalParty(null);
|
||||||
chr.setCarnival(null);
|
chr.setMonsterCarnival(null);
|
||||||
}
|
}
|
||||||
members.clear();
|
members.clear();
|
||||||
}
|
}
|
||||||
@@ -77,9 +77,9 @@ public class MonsterCarnivalParty {
|
|||||||
|
|
||||||
public void warpOut() {
|
public void warpOut() {
|
||||||
if (winner == true)
|
if (winner == true)
|
||||||
warpOut(980000003 + (leader.getCarnival().getRoom() * 100));
|
warpOut(980000003 + (leader.getMonsterCarnival().getRoom() * 100));
|
||||||
else
|
else
|
||||||
warpOut(980000004 + (leader.getCarnival().getRoom() * 100));
|
warpOut(980000004 + (leader.getMonsterCarnival().getRoom() * 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean allInMap(MapleMap map) {
|
public boolean allInMap(MapleMap map) {
|
||||||
@@ -95,8 +95,8 @@ public class MonsterCarnivalParty {
|
|||||||
public void removeMember(MapleCharacter chr) {
|
public void removeMember(MapleCharacter chr) {
|
||||||
members.remove(chr);
|
members.remove(chr);
|
||||||
chr.changeMap(980000010);
|
chr.changeMap(980000010);
|
||||||
chr.setCarnivalParty(null);
|
chr.setMonsterCarnivalParty(null);
|
||||||
chr.setCarnival(null);
|
chr.setMonsterCarnival(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isWinner() {
|
public boolean isWinner() {
|
||||||
|
|||||||
@@ -4213,7 +4213,7 @@ public class MaplePacketCreator {
|
|||||||
mplew.write(reactor.getState());
|
mplew.write(reactor.getState());
|
||||||
mplew.writePos(pos);
|
mplew.writePos(pos);
|
||||||
mplew.writeShort(0);
|
mplew.writeShort(0);
|
||||||
mplew.write(reactor.getFacingDirection()); // stance, thanks to Drago/Dragohe4rt
|
mplew.write(0);
|
||||||
return mplew.getPacket();
|
return mplew.getPacket();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import constants.CharsetConstants.MapleLanguageType;
|
|||||||
* @since Revision 323
|
* @since Revision 323
|
||||||
*/
|
*/
|
||||||
public class GenericLittleEndianWriter implements LittleEndianWriter {
|
public class GenericLittleEndianWriter implements LittleEndianWriter {
|
||||||
private static Charset ASCII = Charset.forName(MapleLanguageType.LANGUAGE_PT_BR.getAscii());
|
private static Charset ASCII = Charset.forName(MapleLanguageType.LANGUAGE_US.getAscii());
|
||||||
private ByteOutputStream bos;
|
private ByteOutputStream bos;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
package tools.packets;
|
package tools.packets;
|
||||||
|
|
||||||
import client.inventory.Item;
|
import client.inventory.Item;
|
||||||
import client.inventory.MapleInventoryType;
|
|
||||||
import client.MapleCharacter;
|
import client.MapleCharacter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -383,59 +382,32 @@ public class Wedding extends MaplePacketCreator {
|
|||||||
* @return mplew
|
* @return mplew
|
||||||
*/
|
*/
|
||||||
public static byte[] OnWeddingGiftResult(byte mode, List<String> itemnames, List<Item> items) {
|
public static byte[] OnWeddingGiftResult(byte mode, List<String> itemnames, List<Item> items) {
|
||||||
// if (itemnames == null || itemnames.size() < 1) { // for now lol
|
|
||||||
// itemnames = new ArrayList<>();
|
|
||||||
// itemnames.add("mesos");
|
|
||||||
// itemnames.add("rare items");
|
|
||||||
// itemnames.add("more mesos");
|
|
||||||
// }
|
|
||||||
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
|
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
|
||||||
mplew.writeShort(WEDDING_GIFT_RESULT);
|
mplew.writeShort(WEDDING_GIFT_RESULT);
|
||||||
mplew.write(mode);
|
mplew.write(mode);
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
case 0xC: // 12 : You cannot give more than one present for each wishlist
|
||||||
|
case 0xE: // 14 : Failed to send the gift.
|
||||||
|
break;
|
||||||
|
|
||||||
case 0x09: { // Load Wedding Registry
|
case 0x09: { // Load Wedding Registry
|
||||||
mplew.write(itemnames.size());
|
mplew.write(itemnames.size());
|
||||||
for (String names : itemnames) {
|
for (String names : itemnames) {
|
||||||
mplew.writeMapleAsciiString(names);
|
mplew.writeMapleAsciiString(names);
|
||||||
}
|
}
|
||||||
mplew.write(items.size());
|
|
||||||
for (Item item : items) {
|
|
||||||
addItemInfo(mplew, item, true);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0xA: // Load Bride's Wishlist
|
case 0xA: // Load Bride's Wishlist
|
||||||
case 0xF: // 10, 15, 16 = CWishListRecvDlg::OnPacket
|
case 0xF: // 10, 15, 16 = CWishListRecvDlg::OnPacket
|
||||||
case 0xB: { // Add Item to Wedding Registry
|
case 0xB: { // Add Item to Wedding Registry
|
||||||
// 11 : You have sent a gift | 12 : You cannot give more than one present for each wishlist | 13 : Failed to send the gift. | 14 : Failed to send the gift.
|
// 11 : You have sent a gift | | 13 : Failed to send the gift. |
|
||||||
if (mode == 0xB) {
|
if (mode == 0xB) {
|
||||||
mplew.write(itemnames.size());
|
mplew.write(itemnames.size());
|
||||||
for (String names : itemnames) {
|
for (String names : itemnames) {
|
||||||
mplew.writeMapleAsciiString(names);
|
mplew.writeMapleAsciiString(names);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (items.size() >= 1) {
|
mplew.writeLong(32);
|
||||||
switch (items.get((items.size() - 1)).getInventoryType()) {
|
|
||||||
case EQUIP:
|
|
||||||
mplew.writeLong(4);
|
|
||||||
break;
|
|
||||||
case USE:
|
|
||||||
mplew.writeLong(8);
|
|
||||||
break;
|
|
||||||
case SETUP:
|
|
||||||
mplew.writeLong(16);
|
|
||||||
break;
|
|
||||||
case ETC:
|
|
||||||
mplew.writeLong(32);
|
|
||||||
break;
|
|
||||||
default: // impossible flag, cash item can't be sent
|
|
||||||
if (items.get((items.size() - 1)).getInventoryType() != MapleInventoryType.CASH) {
|
|
||||||
mplew.writeLong(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mplew.writeLong(0);
|
|
||||||
}
|
|
||||||
mplew.write(items.size());
|
mplew.write(items.size());
|
||||||
for (Item item : items) {
|
for (Item item : items) {
|
||||||
addItemInfo(mplew, item, true);
|
addItemInfo(mplew, item, true);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<float name="fs" value="10.0"/>
|
<float name="fs" value="10.0"/>
|
||||||
<int name="summonType" value="1"/>
|
<int name="summonType" value="1"/>
|
||||||
<int name="getCP" value="3"/>
|
<int name="getCP" value="3"/>
|
||||||
<string name="link" value="4230110"/>
|
<string name="link" value="3230103"/>
|
||||||
<int name="firstAttack" value="1"/>
|
<int name="firstAttack" value="1"/>
|
||||||
<string name="elemAttr" value="L2"/>
|
<string name="elemAttr" value="L2"/>
|
||||||
<int name="mobType" value="8"/>
|
<int name="mobType" value="8"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user