[Solved] Confused with quest scripts

Results 1 to 8 of 8
  1. #1
    Enthusiast Kittyjessika is offline
    MemberRank
    Feb 2015 Join Date
    36Posts

    [Solved] Confused with quest scripts

    Let me start by saying I am a beginner on working on maplestory servers. And I am somewhat clueless about OOP programming. (Google is my best friend)

    Ok so, I wanted to fix the 1st drill hall on a Solaxia source for Cygnus knights.

    Once the quest is accepted you head to the drill hall and upon trying to enter the portal it gives you an error where it tells you that you need the quest.

    I was like, Oh okay ill look at the portal script.

    Code:
    var mapp = -1;var map = 0;
    function enter(pi) {
        if (pi.getQuestStatus(20701) == 1) {
            map = 913000000;
        } else if (pi.getQuestStatus(20702) == 1) {
            map = 913000100;
        } else if (pi.getQuestStatus(20703) == 1) {
            map = 913000200;
        }
        if (map > 0) {
        if (pi.getPlayerCount(map) == 0) {
            var mapp = pi.getMap(map);
            mapp.resetFully();
            mapp.respawn(true);
            pi.warp(map, 0);
        } else {
            pi.playerMessage(5, "Someone is already in this map.");
        }
        } else {
            pi.playerMessage(5, "Hall #1 can only be entered if you're engaged in Kiku's Acclimation Training.");
        }
    }
    Everything is fine here as long as the 20701 status == 1

    Yet i'm getting at the bottom of the Else tree.. Which means there is no status.

    Okay! Neat, this is also the quest ID! Should be easy to fix if I go in the quest and add a status. Lets go see in the scripts folder... And nope. Nothing there.

    Then i thought to myself.. It has to be somewhere? The client sends packets and the quest goes in the quest log?

    I think there's something I clearly don't understand.


    EDIT: I decided to find out the NPC that gives the quest, 1102000

    I do find his entry in the WZ xml but again, there doesn't seem to be any server side script for him.
    Last edited by Kittyjessika; 11-05-16 at 11:53 PM. Reason: Issue resolved


  2. #2
    Apprentice Artemis is offline
    MemberRank
    May 2016 Join Date
    16Posts

    Re: Confused with quest scripts

    Definitely make sure you have a Server-sided script for him!

    Be sure to look over your Quest.wz XMLs to edit how the quest works in correlation with ; Items Needs (Item ID and Quantity), What the quest will remove (Item IDs and Quantities) and other such things.

    This could also be an issue with the Portal's scripting -- Make sure it runs a check for quest start.

  3. #3
    Enthusiast Kittyjessika is offline
    MemberRank
    Feb 2015 Join Date
    36Posts

    Re: Confused with quest scripts

    Quote Originally Posted by Artemis View Post
    Definitely make sure you have a Server-sided script for him!

    Be sure to look over your Quest.wz XMLs to edit how the quest works in correlation with ; Items Needs (Item ID and Quantity), What the quest will remove (Item IDs and Quantities) and other such things.

    This could also be an issue with the Portal's scripting -- Make sure it runs a check for quest start.
    See whats peculiar is, even if you go in server.quest.maplequest and remove the getinstances.. The quest is still there.. I can't even remove it.. So I don't see how I could alter something that I can't even remove..

  4. #4
    Eternal Slumber Meteorite is offline
    MemberRank
    Jun 2008 Join Date
    875Posts

    Re: Confused with quest scripts

    Try
    Code:
    var mapp = -1;
    var map = 0;
    function enter(pi) {
        if (pi.getQuestStatus(20701) != 0) {
            map = 913000000;
        } else if (pi.getQuestStatus(20702) != 0) {
            map = 913000100;
        } else if (pi.getQuestStatus(20703) != 0) {
            map = 913000200;
        }
        if (map > 0) {
    		if (pi.getPlayerCount(map) == 0) {
    			var mapp = pi.getMap(map);
    			mapp.resetFully();
    			mapp.respawn(true);
    			pi.warp(map, 0);
    		} else {
    			pi.playerMessage(5, "Someone is already in this map.");
    		}
        } else {
            pi.playerMessage(5, "Hall #1 can only be entered if you're engaged in Kiku's Acclimation Training.");
        }
    }
    I assume your getQuestStatus is this:
    Code:
    public final byte getQuestStatus(final int quest) {
            final MapleQuest qq = MapleQuest.getInstance(quest);
            if (getQuestNoAdd(qq) == null) {
                return 0;
            }
            return getQuestNoAdd(qq).getStatus();
        }

  5. #5
    Enthusiast Kittyjessika is offline
    MemberRank
    Feb 2015 Join Date
    36Posts

    Re: Confused with quest scripts

    Unfortunately, might or might not work, the issue is that I do not get a status at all for the quest.

    So it's bound to stay at 0.


    EDIT: It worked! Thanks!
    Last edited by Kittyjessika; 11-05-16 at 11:53 PM.

  6. #6
    Proficient Member Twdtwd is offline
    MemberRank
    Apr 2008 Join Date
    USALocation
    162Posts

    Re: [Solved] Confused with quest scripts

    That may not work as intended because for completed quest, the status is 2. Therefore it may always take you to the first room to kill monsters in.

    Quest 20701 points to the quest "1st Acclimation Training." For finding the quest data on the server, you need to look in the XML WZ files. QuestInfo.xml.wz is a good place to start, but Act.img.xml and Check.img.xml can also be useful. For most quest, all of the info is in there as they are not scripted.

    I don't have time to crack open the Solaxia source right now and look for more info though. Hopefully this will help point you in the right direction.

  7. #7
    Eternal Slumber Meteorite is offline
    MemberRank
    Jun 2008 Join Date
    875Posts

    Re: [Solved] Confused with quest scripts

    Quote Originally Posted by Twdtwd View Post
    That may not work as intended because for completed quest, the status is 2. Therefore it may always take you to the first room to kill monsters in.

    Quest 20701 points to the quest "1st Acclimation Training." For finding the quest data on the server, you need to look in the XML WZ files. QuestInfo.xml.wz is a good place to start, but Act.img.xml and Check.img.xml can also be useful. For most quest, all of the info is in there as they are not scripted.

    I don't have time to crack open the Solaxia source right now and look for more info though. Hopefully this will help point you in the right direction.
    Edit: Nvm, I'm retarded. But to solve that, just change the beginning else if statements to if statements.
    But yeah, you're right in that it's not a proper fix; just a temporary workaround.
    Last edited by Meteorite; 12-05-16 at 03:17 AM.

  8. #8
    Proficient Member Twdtwd is offline
    MemberRank
    Apr 2008 Join Date
    USALocation
    162Posts

    Re: [Solved] Confused with quest scripts

    For future reference, the scripting method that should be used here is cm.isQuestStarted(20701) which returns a boolean true if the quest is in progress, false if not.



Advertisement