Conditional Buffs & M. Magnet & Loot Patch + Exp Split + Duey Rework

Fixed Monster Magnet skill when used on bosses disconnecting the caster.
Improved conditional buff system, no longer updating buffs that are not supposed to toggle.
Added party hunting in the conditional buffs system.
Refactored usage of DB by Duey. Registered Duey items now make use of the same table as the other inventory items.
Fixed non-encapsulated unlocking in reactor class.
Fixed stylish NPCs disconnecting players when trying to display empty styles list.
Fixed a deadlock case within recently implemented update buff effects (conditional buffs mechanic).
Fixed AOE mobskills not behaving well for fixed mobs (those shouldn't take into account attribute "facingLeft").
Fixed non-flipping mobs having attribute "facingLeft" updated according to controller position.
Revised aggro system no longer having bosses expire player chase.
Fixed chalkboard being depleted upon use.
Refactored MapleMapFactory, looking for normalization of the Factory design pattern the class was intended to make use at its conception.
Added MP replenishing system for mobs, gains based on its level.
Fixed indisponibility of one-of-a-kind loots due to the killer's team already having one sample each.
Reworked the EXP split system within the source. New behavior is expected to be GMS-like.
Adjusted interaction within the NPC Nein Spirit's Baby Dragon area. Only players who interacts with quests within can access the area now. One player at a time, with a timeout timer.
Fixed check of level requisites for expeditions.
This commit is contained in:
ronancpl
2019-06-15 15:10:56 -03:00
parent 04b11e2518
commit a39a210c1f
54 changed files with 1217 additions and 866 deletions

105
scripts/event/NineSpirit.js Normal file
View File

@@ -0,0 +1,105 @@
var minPlayers = 1;
var timeLimit = 5; //5 minutes
var eventTimer = 1000 * 60 * timeLimit;
var exitMap = 240040610;
var eventMap = 240040611;
var minMapId = 240040611;
var maxMapId = 240040611;
function init(){}
function setup(difficulty, lobbyId){
var eim = em.newInstance("NineSpirit_" +lobbyId);
eim.getInstanceMap(eventMap).resetFully();
eim.getInstanceMap(eventMap).allowSummonState(false);
respawn(eim);
eim.startEventTimer(eventTimer);
return eim;
}
function afterSetup(eim){}
function respawn(eim){}
function playerEntry(eim, player){
var nest = eim.getMapInstance(eventMap);
if (!player.haveItem(4001094)) {
eim.spawnNpc(2081008, nest.getReactorById(2406000).getPosition(), nest);
}
player.changeMap(nest, 1);
}
function scheduledTimeout(eim){
var party = eim.getPlayers();
for(var i = 0; i < party.size(); i++)
playerExit(eim, party.get(i));
eim.dispose();
}
function playerRevive(eim, player){
player.respawn(eim, exitMap);
return false;
}
function playerDead(eim, player){}
function playerDisconnected(eim, player){
var party = eim.getPlayers();
for(var i = 0; i < party.size(); i++){
if(party.get(i).equals(player))
removePlayer(eim, player);
else
playerExit(eim, party.get(i));
}
eim.dispose();
}
function monsterValue(eim, mobId){
return -1;
}
function leftParty(eim, player){}
function disbandParty(eim){}
function playerUnregistered(eim, player){}
function playerExit(eim, player){
eim.unregisterPlayer(player);
player.changeMap(exitMap);
}
function changedMap(eim, chr, mapid){
if(mapid < minMapId || mapid > maxMapId){
removePlayer(eim, chr);
eim.stopEventTimer();
eim.setEventCleared();
eim.dispose();
}
}
function removePlayer(eim, player){
eim.unregisterPlayer(player);
player.getMap().removePlayer(player);
player.setMap(exitMap);
}
function cancelSchedule(){}
function dispose(){}
function clearPQ(eim){}
function monsterKilled(mob, eim){}
function allMonstersDead(eim){}
// ---------- FILLER FUNCTIONS ----------
function changedLeader(eim, leader) {}

View File

@@ -4,6 +4,9 @@ var eventTimer = 1000 * 60 * timeLimit;
var exitMap = 105070300;
var eventMap = 910510000;
var minMapId = 910510000;
var maxMapId = 910510000;
function init(){}
function setup(difficulty, lobbyId){
@@ -67,9 +70,9 @@ function playerExit(eim, player){
player.changeMap(exitMap);
}
function changedMap(eim, player){
if(player.getMap().getId() < eventMap || player.getMap().getId() > next){
removePlayer(eim, player);
function changedMap(eim, chr, mapid){
if(mapid < minMapId || mapid > maxMapId){
removePlayer(eim, chr);
eim.stopEventTimer();
eim.setEventCleared();
eim.dispose();

View File

@@ -58,7 +58,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition

View File

@@ -48,7 +48,7 @@ function action(mode, type, selection){
var party = cm.getPlayer().getParty();
if (party != null) {
if (!em.startInstance(party, cm.getMap())) {
if (!em.startInstance(party, cm.getMap(), 1)) {
cm.sendOk("Another party is already challenging the boss in this channel.");
}
} else {

View File

@@ -59,7 +59,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition

View File

@@ -57,7 +57,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition

View File

@@ -60,7 +60,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition

View File

@@ -58,7 +58,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition

View File

@@ -54,7 +54,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
if (player.getLevel() < cwkpq.getMinLevel() && player.getLevel() > cwkpq.getMaxLevel()) { //Don't fit requirement
if (player.getLevel() < cwkpq.getMinLevel() || player.getLevel() > cwkpq.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to take attempt Crimsonwood Keep Party Quest!");
cm.dispose();
} else if (expedition == null) { //Start an expedition

View File

@@ -59,7 +59,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition

View File

@@ -29,7 +29,7 @@ function enter(pi) {
if (party != null) {
var eli = em.getEligibleParty(pi.getParty()); // thanks Conrad for pointing out missing eligible party declaration here
if(eli.size() > 0) {
if (em.startInstance(party, pi.getMap())) {
if (em.startInstance(party, pi.getMap(), 1)) {
pi.playPortalSound();
return true;
} else {
@@ -54,7 +54,7 @@ function enter(pi) {
if (party != null) {
var eli = em.getEligibleParty(pi.getParty());
if(eli.size() > 0) {
if (em.startInstance(1, party, pi.getMap())) {
if (em.startInstance(party, pi.getMap(), 1)) {
pi.playPortalSound();
return true;
} else {

View File

@@ -20,11 +20,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function enter(pi) {
if (!pi.isQuestStarted(100203)) { // thanks Conrad for suggesting grant players access to area with Nein Spirit's Baby Dragon after hatching egg
pi.playPortalSound(); pi.warp(240040611, "out00");
if (pi.isQuestCompleted(3706)) {
pi.playPortalSound(); pi.warp(240040612, "out00");
return true;
} else if (pi.isQuestStarted(100203) || pi.getPlayer().haveItem(4001094)) {
var em = pi.getEventManager("NineSpirit");
if (!em.startInstance(pi.getPlayer())) {
pi.message("There is currently someone in this map, come back later.");
return false;
} else {
pi.playPortalSound(); pi.warp(240040612, "out00");
pi.playPortalSound();
return true;
}
return true;
} else {
pi.message("A strange force is blocking you from entering.");
return false;
}
}

View File

@@ -3,9 +3,9 @@ Dragon nest
*/
function sendToHeaven() {
rm.destroyNpc(2081008);
rm.mapMessage(6, "In a flicker of light, Nine Spirit's Little Dragon returns to the place it belongs, high above the skies.");
rm.getReactor().getMap().resetReactors();
rm.spawnNpc(2081008);
rm.startQuest(100203);
rm.mapMessage(6, "In a flicker of light the egg has matured and cracked, thus born a radiant baby dragon.");
}
function touch() {
@@ -18,9 +18,5 @@ function touch() {
function untouch() {}
function act() {
rm.message("With your latest efforts the egg has matured and cracked, thus born a radiant baby dragon.");
rm.startQuest(100203);
rm.spawnNpc(2081008);
rm.schedule("sendToHeaven", 12 * 1000);
sendToHeaven(); // thanks Conrad for pointing out the GMS-like way of Nine Spirit's Nest
}