Shane NPC (Ellinia) Fix

Discussion in 'Off Topic / Spam / Test' started by Galletas, May 20, 2013.

  1. Galletas
    Offline

    Galletas Member

    Joined:
    May 20, 2013
    Messages:
    1
    Likes Received:
    0
    To get (Sabritama and the Weird Medicine Quest complete)

    Shane NPC: 1032003.js

    Put this code please.

    Code:
    	function start() {
    	cm.sendSimple ("You want to go in? Must have heard that there's a precious medicinal herb in here, huh?\r\n#L0#The Forest of Patience#l");
    }
    
    function action(mode, type, selection) {
    	cm.dispose();
    	if (selection == 0) {
    		cm.warp (101000100, 0);
    		} else {
    		cm.warp (101000102, 0);
    		cm.sendOK ("Have Fun!");
    	}
    }
    
    Hope it helps,
    Thankies!~~

    Fito. ;)
     
  2. Matt
    Offline

    Matt Administrator

    Joined:
    May 8, 2013
    Messages:
    15,356
    Likes Received:
    19,469
    Your script doesn't work properly for both quests. I have added a function that checks to see if you have the quest active. This NPC is now fixed.

    Code:
    /*
    NPC Shane
    Script created by Matthew Prince of MapleRoyals.com ([email protected])
    */
    
    importPackage(net.sf.odinms.client);
    
    var status = 0;
    
    function start() {
        status = -1;
        action(1, 0, 0);
    }
    
    function action(mode, type, selection) {
        if (mode == -1) {
            cm.dispose();
        }else if (mode == 0){
            cm.dispose();
    		return;		
        } else {
            if (mode == 1)
                status++;
            else
                status--;
            if (status == 0) {
    		if (cm.getQuestStatus(2050).equals
    
    (MapleQuestStatus.Status.STARTED))
    		cm.warp (101000100, 0);
    		cm.dispose();
    		if (cm.getQuestStatus(2051).equals
    
    (MapleQuestStatus.Status.STARTED))
    		cm.warp (101000102, 0);
    		cm.dispose();
    		}
    	}
    }
     
  3. Galletas
    Offline

    Galletas Member

    Joined:
    May 20, 2013
    Messages:
    1
    Likes Received:
    0
    Yeah sorry, i only did that fast script to warp Forest of Patience (non-GMS Like), cuz trully needs to check about quest status, so you're right.

    Thanks for fixing it :)
     

Share This Page