Weird Event Script

Joined
Dec 10, 2012
Messages
475
Reaction score
9
Hello guys.
My function for clearpq
I have a question about this.
PHP:
function disbandParty(eim) {
    var party = eim.getPlayers();
    for (var i = 0; i < party.size(); i++) {
        playerExit(eim, party.get(i));
    }
    eim.dispose();
}

Then this part where i finish te bosspq
PHP:
 if (monster_number > 4) {
        map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "[The Boss Quest] Congratulations! Your team has defeated all the bosses with " + points + " points!"));
        map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "[The Boss Quest] The points have been awarded, spend them as you wish."));
        disbandParty();
    }

And I got this error.
PHP:
javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: Typ
eError: Cannot call method "getPlayers" of undefined (<Unknown source>#66) in <U
nknown source> at line number 66
        at com.sun.script.javascript.RhinoScriptEngine.invoke(Unknown Source)
        at com.sun.script.javascript.RhinoScriptEngine.invokeFunction(Unknown So
urce)
        at scripting.event.EventInstanceManager.unregisterMonster(EventInstanceM
anager.java:122)
        at server.life.MapleMonster.killBy(MapleMonster.java:353)
        at server.maps.MapleMap.killMonster(MapleMap.java:678)
        at server.maps.MapleMap.killMonster(MapleMap.java:562)
        at server.maps.MapleMap.damageMonster(MapleMap.java:554)
        at net.server.channel.handlers.AbstractDealDamageHandler.applyAttack(Abs

I've checked for the error line which "var party = eim.getPlayers();"
Any Idea why?
I've tried ClearPQ(); and it didnt work as well.
 
eim is a variable you need to push when using that function. No, its not disbandParty(eim);
It's whatever eim is suppose to mean in your disband party function, I am assuming it is partyid.
 
Upvote 0
PHP:
function setup(partyid) {
    var instanceName = "BossQuest" + partyid;

    var eim = em.newInstance(instanceName);
    // If there are more than 1 map for this, you'll need to do mapid + instancename
    var map = eim.createInstanceMap(mapid);
    map.toggleDrops();

    eim.setProperty("points", 0);
    eim.setProperty("monster_number", 0);

    eim.schedule("beginQuest", 5000);
    return eim;
}

Im not really sure how to fix this..i've been scratching my head..
 
Upvote 0
this last thing you send returns eim, if its the same one you use at disbandParty, it should be
disbandParty(setup(partyid));

What are you talking about? That would never disband a previous party or instance because it creates a new one everytime setup is executed. He needs to send disbandparty with the instanceid of bosspq
 
Upvote 0
What are you talking about? That would never disband a previous party or instance because it creates a new one everytime setup is executed. He needs to send disbandparty with the instanceid of bosspq

You're right, now that I look closely I see it woudln't make any sense.
I assumed since that method returned eim it would also be needed in the other function, I was just being too hasty.
My bad.
 
Upvote 0
PHP:
    var map = eim.getMapInstance(mapId);
    var party = eim.getPlayers();

    if (monster_number > 13) {
    
        map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "[The Boss Quest] Congratulations! Your team has defeated all the bosses with " + points + " points!"));
        map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "[The Boss Quest] The points have been awarded, spend them as you wish."));
            disbandParty(map, party);
    }
    else {
 
Last edited:
Upvote 0
Back