Script references patch
Cleared issue in a few scripts which would be trying to access Java Math library methods with unexpected parameter types. Fixed EllinPQ rewarder NPC handing out an unexpected itemid to the player. Cleared SQL foreign key constraint statement no longer supposed to be used.
This commit is contained in:
@@ -214,6 +214,7 @@ server:
|
||||
USE_DEBUG_SHOW_PACKET: false
|
||||
USE_SUPPLY_RATE_COUPONS: true #Allows rate coupons to be sold through the Cash Shop.
|
||||
USE_IP_VALIDATION: true #Enables IP checking when logging in.
|
||||
USE_CHARACTER_ACCOUNT_CHECK: false #Enables one-character-per-account check when logging in. This might be resource intensive.
|
||||
|
||||
USE_MAXRANGE: true #Will send and receive packets from all events on a map, rather than those of only view range.
|
||||
USE_MAXRANGE_ECHO_OF_HERO: true
|
||||
|
||||
@@ -2234,3 +2234,7 @@ Revisado lógica recente de uso de petid único levando a lançamento de exceç
|
||||
Corrigido portal relacionado a quest em Ariant inesperadamente levando jogadores à passagem secreta de Sleepywood, em caso de conclusão de questline da mesma.
|
||||
Corrigido loop em scripts de quest de associação a Alcadno/Zenumist em Magatia.
|
||||
Adicionado utilização de dispose em quest scripts para o comando homônimo.
|
||||
|
||||
30 Outubro 2019,
|
||||
Corrigido bug em scripts (que possivelmente passou a ocorrer ao utilizar Java8) relacionado ao tentar utilizar métodos da biblioteca Math sem corresponder parâmetros com a assinatura adequada.
|
||||
Corrigido entrega de itemid inesperado em script relacionado a EllinPQ.
|
||||
@@ -217,7 +217,7 @@ function action(mode, type, selection) {
|
||||
complete = false;
|
||||
}
|
||||
|
||||
if(java.lang.Math.random() >= 0.9) //A lucky find! Scroll 60%
|
||||
if(Math.random() >= 0.9) //A lucky find! Scroll 60%
|
||||
item += 1;
|
||||
|
||||
if (!complete || !cm.canHold(item, 1))
|
||||
@@ -251,7 +251,7 @@ function action(mode, type, selection) {
|
||||
var reward;
|
||||
if (rewdSet[selectedItem] instanceof Array) {
|
||||
var length = rewdSet[selectedItem][1] - rewdSet[selectedItem][0];
|
||||
reward = rewdSet[selectedItem][0] + java.lang.Math.round(java.lang.Math.random() * length);
|
||||
reward = rewdSet[selectedItem][0] + Math.round(Math.random() * length);
|
||||
}
|
||||
else reward = rewdSet[selectedItem];
|
||||
|
||||
|
||||
@@ -13,13 +13,14 @@ function action(mode, type, selection) {
|
||||
return;
|
||||
}
|
||||
if (status == 0) {
|
||||
cm.sendSimple("My name is Pergen, I am the strongest magician around these parts.#b\r\n#L0#Hey, take these rubbles. You can perform your magic on them.#l");
|
||||
cm.sendSimple("My name is #p2131001#, I am the strongest magician around these parts.#b\r\n#L0#Hey, take these rubbles. You can perform your magic on them.#l");
|
||||
} else if (status == 1) {
|
||||
if (!cm.haveItem(exchangeItem, 100)) {
|
||||
cm.sendNext("You don't have enough... I need at least 100.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", java.lang.Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, java.lang.Math.min(300, cm.itemQuantity(exchangeItem) / 100));
|
||||
// thanks yuxaij for noticing a few methods having parameters not matching the expected Math library function parameter types
|
||||
cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100));
|
||||
}
|
||||
} else if (status == 2) {
|
||||
if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) {
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
*/
|
||||
|
||||
function start(){
|
||||
cm.sendOk("My name is Euryth... As you can see, I am a fairy. People tell me I do not act fairy-like, but... I like making things out of metal objects. Shhh, don't tell this to anyone, but I also like MMA.");
|
||||
cm.sendOk("My name is #p2131002#... As you can see, I am a fairy. People tell me I do not act fairy-like, but... I like making things out of metal objects. Shhh, don't tell this to anyone, but I also like MMA.");
|
||||
cm.dispose();
|
||||
}
|
||||
@@ -19,7 +19,7 @@ function action(mode, type, selection) {
|
||||
cm.sendNext("You don't have enough... I need at least 100.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", java.lang.Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, java.lang.Math.min(300, cm.itemQuantity(exchangeItem) / 100));
|
||||
cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100));
|
||||
}
|
||||
} else if (status == 2) {
|
||||
if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) {
|
||||
|
||||
@@ -19,7 +19,7 @@ function action(mode, type, selection) {
|
||||
cm.sendNext("You don't have enough... I need at least 100.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", java.lang.Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, java.lang.Math.min(300, cm.itemQuantity(exchangeItem) / 100));
|
||||
cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100));
|
||||
}
|
||||
} else if (status == 2) {
|
||||
if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) {
|
||||
|
||||
@@ -19,7 +19,7 @@ function action(mode, type, selection) {
|
||||
cm.sendNext("You don't have enough... I need at least 100.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", java.lang.Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, java.lang.Math.min(300, cm.itemQuantity(exchangeItem) / 100));
|
||||
cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100));
|
||||
}
|
||||
} else if (status == 2) {
|
||||
if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) {
|
||||
|
||||
@@ -19,7 +19,7 @@ function action(mode, type, selection) {
|
||||
cm.sendNext("You don't have enough... I need at least 100.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", java.lang.Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, java.lang.Math.min(300, cm.itemQuantity(exchangeItem) / 100));
|
||||
cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100));
|
||||
}
|
||||
} else if (status == 2) {
|
||||
if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) {
|
||||
|
||||
@@ -111,9 +111,9 @@ function action(mode, type, selection) {
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (selection == 2){
|
||||
if (cm.haveItem(1032061) && !cm.haveItem(1032101) && cm.haveItem(4001198, 10)) {
|
||||
if (cm.haveItem(1032061) && !cm.haveItem(1032072) && cm.haveItem(4001198, 10)) {
|
||||
cm.gainItem(1032061,-1);
|
||||
cm.gainItem(1032101, 1);
|
||||
cm.gainItem(1032072, 1); // thanks yuxaij for noticing unexpected itemid here
|
||||
cm.gainItem(4001198, -10);
|
||||
cm.dispose();
|
||||
} else {
|
||||
|
||||
@@ -127,7 +127,7 @@ function action(mode, type, selection) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
var rand = java.lang.Math.floor(java.lang.Math.random() * pri.length);
|
||||
var rand = Math.floor(Math.random() * pri.length);
|
||||
if (!cm.haveItem(ite, quan)) {
|
||||
cm.sendOk("You need #b" + quan + " #t" + ite + "##k to exchange it with item.");
|
||||
} else if (cm.getInventory(1).getNextFreeSlot() <= -1 || cm.getInventory(2).getNextFreeSlot() <= -1 || cm.getInventory(3).getNextFreeSlot() <= -1 || cm.getInventory(4).getNextFreeSlot() <= -1) {
|
||||
|
||||
@@ -35,11 +35,11 @@ function action(mode, type, selection) {
|
||||
cm.mapMessage(6, "Engarde! Master Guardians approach!");
|
||||
for (var i = 0; i < 10; i++) {
|
||||
var mob = eim.getMonster(9400594);
|
||||
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (java.lang.Math.random() * 1337), 276));
|
||||
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (Math.random() * 1337), 276));
|
||||
}
|
||||
for (var i = 0; i < 20; i++) {
|
||||
var mob = eim.getMonster(9400582);
|
||||
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (java.lang.Math.random() * 1337), 276));
|
||||
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (Math.random() * 1337), 276));
|
||||
}
|
||||
eim.setIntProperty("glpq6", 1);
|
||||
cm.dispose();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "02st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "03st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "04st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "05st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "06st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "07st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "08st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "09st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "10st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "11st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "12st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "13st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "14st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "15st");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function enter(pi) {
|
||||
if (java.lang.Math.random() < 0.1) {
|
||||
if (Math.random() < 0.1) {
|
||||
pi.playPortalSound(); pi.warp(930000300,"16st");
|
||||
} else {
|
||||
pi.playPortalSound(); pi.warp(930000300, "01st");
|
||||
|
||||
@@ -16473,14 +16473,13 @@ CREATE TABLE IF NOT EXISTS `pets` (
|
||||
PRIMARY KEY (`petid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
||||
|
||||
ALTER TABLE `inventoryitems` ADD CONSTRAINT `fk_itempetid` FOREIGN KEY (`petid`) REFERENCES `pets` (`petid`) ON DELETE SET NULL ; # thanks Optimist for noticing queries over petid taking too long, shavit for pointing out an improvement using foreign key
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `petignores` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`petid` int(11) unsigned NOT NULL ,
|
||||
`itemid` int(10) unsigned NOT NULL ,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_petignorepetid` FOREIGN KEY (`petid`) REFERENCES `pets` (`petid`) ON DELETE CASCADE
|
||||
CONSTRAINT `fk_petignorepetid` FOREIGN KEY (`petid`) REFERENCES `pets` (`petid`) ON DELETE CASCADE # thanks Optimist for noticing queries over petid taking too long, shavit for pointing out an improvement using foreign key
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `playerdiseases` (
|
||||
|
||||
@@ -1233,7 +1233,7 @@ public class MapleClient {
|
||||
}
|
||||
|
||||
public void checkChar(int accid) { /// issue with multiple chars from same account login found by shavit, resinate
|
||||
if (true) {
|
||||
if (!YamlConfig.config.server.USE_CHARACTER_ACCOUNT_CHECK) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ public class ServerConfig {
|
||||
public boolean USE_DEBUG_SHOW_PACKET;
|
||||
public boolean USE_SUPPLY_RATE_COUPONS;
|
||||
public boolean USE_IP_VALIDATION;
|
||||
public boolean USE_CHARACTER_ACCOUNT_CHECK;
|
||||
|
||||
public boolean USE_MAXRANGE;
|
||||
public boolean USE_MAXRANGE_ECHO_OF_HERO;
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.util.HashSet;
|
||||
import java.util.Calendar;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import config.ServerConfig;
|
||||
import config.YamlConfig;
|
||||
import org.apache.mina.core.service.IoHandlerAdapter;
|
||||
import org.apache.mina.core.session.IdleStatus;
|
||||
|
||||
Reference in New Issue
Block a user