Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

job advance v62 Problem with myrepack repack 0-0

Stay smart, be yourself
Joined
Sep 3, 2014
Messages
57
Reaction score
7
i searched already i think all websites and try'd all job advancement cody scripts... well
when im trying the script, im clicking inside the game cody and he isn't work, nothing happens...
its doesn't matter which command, if theres a job script it wont work.
i need help

NPCConversationManager.java
PHP:
package net.sf.odinms.scripting.npc;
import java.awt.Point;import java.util.ArrayList;import java.util.Arrays;import java.util.Calendar;import java.util.LinkedList;import java.util.List;import net.sf.odinms.client.IItem;import net.sf.odinms.client.Item;import net.sf.odinms.client.MapleCharacter;import net.sf.odinms.client.MapleClient;import net.sf.odinms.client.MapleInventory;import net.sf.odinms.client.MapleInventoryType;import net.sf.odinms.client.MapleJob;import net.sf.odinms.client.SkillFactory;import net.sf.odinms.scripting.AbstractPlayerInteraction;import net.sf.odinms.scripting.event.EventManager;import net.sf.odinms.server.MapleInventoryManipulator;import net.sf.odinms.server.MapleItemInformationProvider;import net.sf.odinms.server.MapleShopFactory;import net.sf.odinms.server.quest.MapleQuest;import net.sf.odinms.tools.MaplePacketCreator;import net.sf.odinms.client.MapleStat;import net.sf.odinms.net.world.guild.MapleGuild;import net.sf.odinms.server.MapleSquad;import net.sf.odinms.server.MapleSquadType;import net.sf.odinms.server.maps.MapleMap;import java.util.Map;import java.util.Map.Entry;import java.util.Random;import net.sf.odinms.client.ExpTable;import net.sf.odinms.client.ISkill;import net.sf.odinms.client.MapleBuffStat;import net.sf.odinms.client.MaplePet;import net.sf.odinms.net.channel.ChannelServer;import net.sf.odinms.net.world.MapleParty;import net.sf.odinms.net.world.MaplePartyCharacter;import net.sf.odinms.server.life.MapleLifeFactory;import net.sf.odinms.server.life.MapleMonster;import net.sf.odinms.server.life.MapleMonsterStats;import net.sf.odinms.server.life.MapleNPC;import net.sf.odinms.server.maps.MapleMapFactory;import net.sf.odinms.server.maps.MapleMapObject;import net.sf.odinms.server.maps.MapleMapObjectType;import net.sf.odinms.tools.Pair;import java.sql.*;import net.sf.odinms.database.*;import net.sf.odinms.client.Equip;
/** * * @author Matze */public class NPCConversationManager extends AbstractPlayerInteraction {
    private MapleClient c;    private int npc;    private String getText;    private ChannelServer cserv;    private MapleCharacter chr;
    public NPCConversationManager(MapleClient c, int npc) {        super(c);        this.c = c;        this.npc = npc;    }
    public NPCConversationManager(MapleClient c, int npc, MapleCharacter chr) {        super(c);        this.c = c;        this.npc = npc;        this.chr = chr;    }
    public void dispose() {        NPCScriptManager.getInstance().dispose(this);    }
    public void sendNext(String text) {        getClient().getSession().write(MaplePacketCreator.getNPCTalk(npc, (byte) 0, text, "00 01"));    }
    public void sendPrev(String text) {        getClient().getSession().write(MaplePacketCreator.getNPCTalk(npc, (byte) 0, text, "01 00"));    }
    public void sendNextPrev(String text) {        getClient().getSession().write(MaplePacketCreator.getNPCTalk(npc, (byte) 0, text, "01 01"));    }
    public void sendOk(String text) {        getClient().getSession().write(MaplePacketCreator.getNPCTalk(npc, (byte) 0, text, "00 00"));    }
    public void sendYesNo(String text) {        getClient().getSession().write(MaplePacketCreator.getNPCTalk(npc, (byte) 1, text, ""));    }
    public void sendAcceptDecline(String text) {        getClient().getSession().write(MaplePacketCreator.getNPCTalk(npc, (byte) 0x0C, text, ""));    }
    public void sendSimple(String text) {        getClient().getSession().write(MaplePacketCreator.getNPCTalk(npc, (byte) 4, text, ""));    }
    public void sendStyle(String text, int styles[]) {        getClient().getSession().write(MaplePacketCreator.getNPCTalkStyle(npc, text, styles));    }
    public void sendGetNumber(String text, int def, int min, int max) {        getClient().getSession().write(MaplePacketCreator.getNPCTalkNum(npc, text, def, min, max));    }
    public void sendGetText(String text) {        getClient().getSession().write(MaplePacketCreator.getNPCTalkText(npc, text));    }
    public void setGetText(String text) {        this.getText = text;    }
    public String getText() {        return this.getText;    }
    public void closePortal(int mapid, String pName) {        getClient().getChannelServer().getMapFactory().getMap(mapid).getPortal(pName).setPortalState(false);    }
    public void openPortal(int mapid, String pName) {        getClient().getChannelServer().getMapFactory().getMap(mapid).getPortal(pName).setPortalState(true);    }
    public void makeRing(String partner, int ringId) {        net.sf.odinms.client.MapleRing.createRing(c, ringId, c.getPlayer().getId(), c.getPlayer().getName(), c.getChannelServer().getPlayerStorage().getCharacterByName(partner).getId(), partner);    }
    public void closeDoor(int mapid) {        getClient().getChannelServer().getMapFactory().getMap(mapid).setReactorState();    }
    public void openDoor(int mapid) {        getClient().getChannelServer().getMapFactory().getMap(mapid).resetReactors();    }
    public void openShop(int id) {        MapleShopFactory.getInstance().getShop(id).sendShop(getClient());    }
    public void openNpc(int id) {        dispose();        NPCScriptManager.getInstance().start(getClient(), id, null, null);    }
    public boolean isPartyAllHere() {        int num = 0;        int myparty = 0;        while (getPlayer().getParty().getMembers().iterator().hasNext()) {            MaplePartyCharacter curChar = getPlayer().getParty().getMembers().iterator().next();            if (curChar.isOnline()) {                num += 1;            }        }        while (getPlayer().getMap().getCharacters().iterator().hasNext()) {            MapleCharacter curChar2 = getPlayer().getMap().getCharacters().iterator().next();            if (curChar2.getParty() == getPlayer().getParty()) {                myparty += 1;            }        }        return num == myparty;    }
    public void changeJob(MapleJob job) {        getPlayer().changeJob(job);    }
    public MapleJob getJob() {        return getPlayer().getJob();    }
    public void startQuest(int id) {        MapleQuest.getInstance(id).start(getPlayer(), npc);    }
    public void completeQuest(int id) {        MapleQuest.getInstance(id).complete(getPlayer(), npc);    }
    public void forfeitQuest(int id) {        MapleQuest.getInstance(id).forfeit(getPlayer());    }
    /**     * use getPlayer().getMeso() instead     * [USER=850422]return[/USER]     */    [USER=653973]depre[/USER]cated    public int getMeso() {        return getPlayer().getMeso();    }
    public void gainMeso(int gain) {        getPlayer().gainMeso(gain, true, false, true);    }
    public void gainExp(int gain) {        getPlayer().gainExp(gain, true, true);    }
    public int getNpc() {        return npc;    }
    /**     * use getPlayer().getLevel() instead     * [USER=850422]return[/USER]     */    [USER=653973]depre[/USER]cated    public int getLevel() {        return getPlayer().getLevel();    }
    public void unequipEverything() {        MapleInventory equipped = getPlayer().getInventory(MapleInventoryType.EQUIPPED);        MapleInventory equip = getPlayer().getInventory(MapleInventoryType.EQUIP);        List<Byte> ids = new LinkedList<Byte>();        for (IItem item : equipped.list()) {            ids.add(item.getPosition());        }        for (byte id : ids) {            MapleInventoryManipulator.unequip(getC(), id, equip.getNextFreeSlot());        }    }
    public void teachSkill(int id, int level, int masterlevel) {        getPlayer().changeSkillLevel(SkillFactory.getSkill(id), level, masterlevel);    }
    public void clearSkills() {        Map<ISkill, MapleCharacter.SkillEntry> skills = getPlayer().getSkills();        for (Entry<ISkill, MapleCharacter.SkillEntry> skill : skills.entrySet()) {            getPlayer().changeSkillLevel(skill.getKey(), 0, 0);        }    }
    /**     * Use getPlayer() instead (for consistency with MapleClient)     * [USER=850422]return[/USER]     */    [USER=653973]depre[/USER]cated    public MapleCharacter getChar() {        return getPlayer();    }
    public MapleClient getC() {        return getClient();    }
    public void rechargeStars() {        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();        IItem stars = getPlayer().getInventory(MapleInventoryType.USE).getItem((byte) 1);        if (ii.isThrowingStar(stars.getItemId()) || ii.isBullet(stars.getItemId())) {            stars.setQuantity(ii.getSlotMax(getClient(), stars.getItemId()));            getC().getSession().write(MaplePacketCreator.updateInventorySlot(MapleInventoryType.USE, (Item) stars));        }    }
    public EventManager getEventManager(String event) {        return getClient().getChannelServer().getEventSM().getEventManager(event);    }
    public void showEffect(String effect) {        getPlayer().getMap().broadcastMessage(MaplePacketCreator.showEffect(effect));    }
    public void playSound(String sound) {        getClient().getPlayer().getMap().broadcastMessage(MaplePacketCreator.playSound(sound));    }
    [USER=2000004426]Override[/USER]    public String toString() {        return "Conversation with NPC: " + npc;    }
    public void updateBuddyCapacity(int capacity) {        getPlayer().setBuddyCapacity(capacity);    }
    public int getBuddyCapacity() {        return getPlayer().getBuddyCapacity();    }
    public void setHair(int hair) {        getPlayer().setHair(hair);        getPlayer().updateSingleStat(MapleStat.HAIR, hair);        getPlayer().equipChanged();    }
    public void setFace(int face) {        getPlayer().setFace(face);        getPlayer().updateSingleStat(MapleStat.FACE, face);        getPlayer().equipChanged();    }
    public void setSkin(int color) {        getPlayer().setSkinColor(c.getPlayer().getSkinColor().getById(color));        getPlayer().updateSingleStat(MapleStat.SKIN, color);        getPlayer().equipChanged();    }
    public void warpParty(int mapId) {        MapleMap target = getMap(mapId);        for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {            MapleCharacter curChar = c.getChannelServer().getPlayerStorage().getCharacterByName(chr.getName());            if ((curChar.getEventInstance() == null && c.getPlayer().getEventInstance() == null) || curChar.getEventInstance() == getPlayer().getEventInstance()) {                curChar.changeMap(target, target.getPortal(0));            }        }    }
    public void warpPartyWithExp(int mapId, int exp) {        warpPartyWithExpMeso(mapId, exp, 0);    }
    public void warpPartyWithExpMeso(int mapId, int exp, int meso) {        MapleMap target = getMap(mapId);        for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {            MapleCharacter curChar = c.getChannelServer().getPlayerStorage().getCharacterByName(chr.getName());            if ((curChar.getEventInstance() == null && c.getPlayer().getEventInstance() == null) || curChar.getEventInstance() == getPlayer().getEventInstance()) {                curChar.changeMap(target, target.getPortal(0));                curChar.gainExp(exp, true, false, true);                curChar.gainMeso(meso, false); //which pq has mesos?            }        }    }
    public void warpRandom(int mapid) {        MapleMap target = c.getChannelServer().getMapFactory().getMap(mapid);        Random rand = new Random();        getPlayer().changeMap(target, target.getPortal(rand.nextInt(target.getPortals().size())));    }
    public int itemQuantity(int itemid) {        return getPlayer().getInventory(MapleItemInformationProvider.getInstance().getInventoryType(itemid)).countById(itemid);    }
    public MapleSquad createMapleSquad(MapleSquadType type) {        MapleSquad squad = new MapleSquad(c.getChannel(), getPlayer());        if (getSquadState(type) == 0) {            c.getChannelServer().addMapleSquad(squad, type);        } else {            return null;        }        return squad;    }
    public MapleCharacter getSquadMember(MapleSquadType type, int index) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        MapleCharacter ret = null;        if (squad != null) {            ret = squad.getMembers().get(index);        }        return ret;    }
    public void giveWonkyBuff(MapleCharacter chr) {        int Buffs[] = {2022090, 2022091, 2022092, 2022093};        MapleItemInformationProvider.getInstance().getItemEffect(Buffs[(int) Math.round(Math.random() * 4)]).applyTo((MapleCharacter) chr);    }
    public int getSquadState(MapleSquadType type) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        if (squad != null) {            return squad.getStatus();        } else {            return 0;        }    }
    public void setSquadState(MapleSquadType type, int state) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        if (squad != null) {            squad.setStatus(state);        }    }
    public boolean checkSquadLeader(MapleSquadType type) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        if (squad != null) {            return squad.getLeader().getId() == getPlayer().getId();        } else {            return false;        }    }
    public void removeMapleSquad(MapleSquadType type) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        if (squad != null) {            if (squad.getLeader().getId() == getPlayer().getId()) {                squad.clear();                c.getChannelServer().removeMapleSquad(squad, type);            }        }    }
    public int numSquadMembers(MapleSquadType type) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        int ret = 0;        if (squad != null) {            ret = squad.getSquadSize();        }        return ret;    }
    public boolean isSquadMember(MapleSquadType type) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        boolean ret = false;        if (squad.containsMember(getPlayer())) {            ret = true;        }        return ret;    }
    public void addSquadMember(MapleSquadType type) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        if (squad != null) {            squad.addMember(getPlayer());        }    }
    public void removeSquadMember(MapleSquadType type, MapleCharacter chr, boolean ban) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        if (squad != null) {            squad.banMember(chr, ban);        }    }
    public void removeSquadMember(MapleSquadType type, int index, boolean ban) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        if (squad != null) {            MapleCharacter chr = squad.getMembers().get(index);            squad.banMember(chr, ban);        }    }
    public boolean canAddSquadMember(MapleSquadType type) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        if (squad != null) {            return !squad.isBanned(getPlayer());        }        return false;    }
    public void warpSquadMembers(MapleSquadType type, int mapId) {        MapleSquad squad = c.getChannelServer().getMapleSquad(type);        MapleMap map = c.getChannelServer().getMapFactory().getMap(mapId);        if (squad != null) {            if (checkSquadLeader(type)) {                for (MapleCharacter chr : squad.getMembers()) {                    chr.changeMap(map, map.getPortal(0));                }            }        }    }
    public static boolean makeRing(MapleClient mc, String partner, int ringId) {        int partnerId = MapleCharacter.getIdByName(partner);        int[] ret = net.sf.odinms.client.MapleRing.createRing(mc, ringId, mc.getPlayer().getId(), mc.getPlayer().getName(), partnerId, partner);        return !(ret[0] == -1 || ret[1] == -1);    }
    public void WarpTo(String player) {        MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(player);        c.getPlayer().changeMap(victim.getMap(), victim.getMap().findClosestSpawnpoint(victim.getPosition()));    }
    public void displayGuildRanks() {        MapleGuild.displayGuildRanks(getClient(), npc);    }
    public boolean hasGuild() {        boolean goodMap = getPlayer().getMapId() > 910000008 && getPlayer().getMapId() < 910000012;        boolean goodStat = getPlayer().getStr() > 31 && getPlayer().getDex() > 4 && getPlayer().getInt() > 15;        return (goodMap && goodStat && getPlayer().getUpdated());    }
    public void increaseGuildStatus() {        getPlayer().increaseGuildStatus();    }
    public void openDuey() {        c.getSession().write(MaplePacketCreator.sendDueyAction((byte) 8));    }
    public void resetStats() {        List<Pair<MapleStat, Integer>> statup = new ArrayList<Pair<MapleStat, Integer>>(5);        int totAp = getPlayer().getRemainingAp() + getPlayer().getStr() + getPlayer().getDex() + getPlayer().getInt() + getPlayer().getLuk();        getPlayer().setStr(4);        getPlayer().setDex(4);        getPlayer().setInt(4);        getPlayer().setLuk(4);        getPlayer().setRemainingAp(totAp - 16);        statup.add(new Pair<MapleStat, Integer>(MapleStat.STR, Integer.valueOf(4)));        statup.add(new Pair<MapleStat, Integer>(MapleStat.DEX, Integer.valueOf(4)));        statup.add(new Pair<MapleStat, Integer>(MapleStat.LUK, Integer.valueOf(4)));        statup.add(new Pair<MapleStat, Integer>(MapleStat.INT, Integer.valueOf(4)));        statup.add(new Pair<MapleStat, Integer>(MapleStat.AVAILABLEAP, Integer.valueOf(getPlayer().getRemainingAp())));        getClient().getSession().write(MaplePacketCreator.updatePlayerStats(statup));    }
    public void changeSex() {        getPlayer().setGender(1 - getPlayer().getGender());        getClient().getSession().write(MaplePacketCreator.updateCharLook(getPlayer()));    }
    public boolean eventOn() {        return getPlayer().getClient().getChannelServer().eventOn;    }
    public void doEvent() {        if (eventOn()) {            this.warp(getPlayer().getClient().getChannelServer().eventMap);            getClient().getSession().write(MaplePacketCreator.serverNotice(5, "You have been warped to the event map!"));        }    }
    public int getPetLevel() {        for (MaplePet pet : getPlayer().getPets()) {            return pet.getLevel();        }        return 0;    }
    public int getFullness() {        for (MaplePet pet : getPlayer().getPets()) {            return pet.getFullness();        }        return 0;    }
    public String getPetName() {        for (MaplePet pet : getPlayer().getPets()) {            return pet.getName();        }        return "";    }
    public void setPetName(String petname) {        for (MaplePet pet : getPlayer().getPets()) {            pet.setName(petname);        }    }
    public ChannelServer getChannelServer() {        return cserv;    }
    public void startQuest(int id, MapleClient cg) {        MapleQuest.getInstance(id).start(cg.getPlayer(), npc);    }
    public void completeQuest(int id, MapleClient cg) {        MapleQuest.getInstance(id).complete(cg.getPlayer(), npc);    }
    public void forfeitQuest(int id, MapleClient cg) {        MapleQuest.getInstance(id).forfeit(cg.getPlayer());    }
    [USER=2000004426]Override[/USER]    public MapleParty getParty() {        return getPlayer().getParty();    }
    public void summonMob(int mobid, int customHP, int customEXP, int amount) {        spawnMonster(mobid, customHP, -1, -1, customEXP, 0, 0, amount, getPlayer().getPosition().x, getPlayer().getPosition().y);    }
    public void setLevel(int level) {        getPlayer().setLevel(level);        getPlayer().updateSingleStat(MapleStat.LEVEL, Integer.valueOf(level));    }
    public void spawnMonster(int mobid, int HP, int MP, int level, int EXP, int boss, int undead, int amount, int x, int y) {        MapleMonsterStats newStats = new MapleMonsterStats();        if (HP >= 0) {            newStats.setHp(HP);        }        if (MP >= 0) {            newStats.setMp(MP);        }        if (level >= 0) {            newStats.setLevel(level);        }        if (EXP >= 0) {            newStats.setExp(EXP);        }        newStats.setBoss(boss == 1);        newStats.setUndead(undead == 1);        for (int i = 0; i < amount; i++) {            MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);            npcmob.setOverrideStats(newStats);            npcmob.setHp(npcmob.getMaxHp());            npcmob.setMp(npcmob.getMaxMp());            getPlayer().getMap().spawnMonsterOnGroundBelow(npcmob, new Point(x, y),false);        }    }
    public void summonMob(int mobid) {        getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(mobid), getNPCPosition(),false);    }
    public void summonMobAtPosition(int mobid, int customHP, int customEXP, int amount, int posx, int posy) {        MapleMonsterStats newStats = new MapleMonsterStats();        if (customHP > 0) {            newStats.setHp(customHP);        }        if (customEXP >= 0) {            newStats.setExp(customEXP);        }        if (amount <= 1) {            MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);            npcmob.setOverrideStats(newStats);            npcmob.setHp(npcmob.getMaxHp());            getPlayer().getMap().spawnMonsterOnGroudBelow(npcmob, new Point(posx, posy),false);        } else {            for (int i = 0; i < amount; i++) {                MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);                npcmob.setOverrideStats(newStats);                npcmob.setHp(npcmob.getMaxHp());                getPlayer().getMap().spawnMonsterOnGroudBelow(npcmob, new Point(posx, posy),false);            }        }    }
    public void summonMobAtPosition(int mobid, int amount, int posx, int posy) {        if (amount <= 1) {            MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);            npcmob.setHp(npcmob.getMaxHp());            getPlayer().getMap().spawnMonsterOnGroudBelow(npcmob, new Point(posx, posy),false);        } else {            for (int i = 0; i < amount; i++) {                MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);                npcmob.setHp(npcmob.getMaxHp());                getPlayer().getMap().spawnMonsterOnGroudBelow(npcmob, new Point(posx, posy),false);            }        }    }
    public void killAllMobs() {        MapleMap map = getPlayer().getMap();        double range = Double.POSITIVE_INFINITY;        List<MapleMapObject> monsters = map.getMapObjectsInRange(getPlayer().getPosition(), range, Arrays.asList(MapleMapObjectType.MONSTER));        for (MapleMapObject monstermo : monsters) {            map.killMonster((MapleMonster) monstermo, getPlayer(), false);        }    }
    [USER=2000004426]Override[/USER]    public void changeMusic(String songName) {        getPlayer().getMap().broadcastMessage(MaplePacketCreator.musicChange(songName));    }
    public void levelUp() {        getPlayer().levelUp();        getPlayer().gainExp(-getPlayer().getExp(), false, false);    }
    public void setAP(int AP) {        getPlayer().setRemainingAp(AP);        getPlayer().updateSingleStat(MapleStat.AVAILABLEAP, Integer.valueOf(AP));    }
    public void gainAP(int g) {        getPlayer().setRemainingAp(g + getPlayer().getRemainingAp());        getPlayer().updateSingleStat(MapleStat.AVAILABLEAP, Integer.valueOf(g + getPlayer().getRemainingAp()));    }
    public void gainReborns(int reborns) {        getPlayer().setReborns(reborns + getPlayer().getReborns());    }
    public void setSP(int SP) {        getPlayer().setRemainingSp(SP);        getPlayer().updateSingleStat(MapleStat.AVAILABLESP, Integer.valueOf(SP));    }
    public void setStr(int str) {        getPlayer().setStr(str);        getPlayer().updateSingleStat(MapleStat.STR, Integer.valueOf(str));    }
    public void setDex(int dex) {        getPlayer().setDex(dex);        getPlayer().updateSingleStat(MapleStat.DEX, Integer.valueOf(dex));    }
    public void setInt(int inte) {        getPlayer().setInt(inte);        getPlayer().updateSingleStat(MapleStat.INT, Integer.valueOf(inte));    }
    public void setLuk(int luk) {        getPlayer().setLuk(luk);        getPlayer().updateSingleStat(MapleStat.LUK, Integer.valueOf(luk));    }
    public void spawnMob(int mapid, int mid, int xpos, int ypos) {        getClient().getChannelServer().getMapFactory().getMap(mapid).spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(mid), new Point(xpos, ypos),false);    }
    public boolean isPartyLeader() {        return getPlayer().isPartyLeader();    }
    public void setFame(int fame) {        getPlayer().setFame(fame);        getPlayer().updateSingleStat(MapleStat.FAME, Integer.valueOf(fame));    }
    public void gainFame(int fame) {        if (fame > 0) {            getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(6, "You have gained fame. (" + fame + ")"));        } else if (fame < 0) {            getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(6, "You have lost fame. (" + fame + ")"));        }        getPlayer().gainFame(fame);        getPlayer().updateSingleStat(MapleStat.FAME, Integer.valueOf(getPlayer().getFame()));    }
    public void setExp(int exp) {        getPlayer().updateSingleStat(MapleStat.EXP, Integer.valueOf(exp));    }
    [USER=2000004426]Override[/USER]    public void resetMap(int mapid) {        getClient().getChannelServer().getMapFactory().getMap(mapid).resetReactors();    }
    public void environmentChange(String env, int mode) {        getPlayer().getMap().broadcastMessage(MaplePacketCreator.environmentChange(env, mode));    }
    public int getCharsOnMap() {        return getPlayer().getMap().getCharacters().size();    }
    public int getHour() {        return Calendar.getInstance().get(Calendar.HOUR_OF_DAY);    }
    public int getMin() {        return Calendar.getInstance().get(Calendar.MINUTE);    }
    public int getSec() {        return Calendar.getInstance().get(Calendar.SECOND);    }
    public void killAllMonster(int mapid) {        getClient().getChannelServer().getMapFactory().getMap(mapid).killAllMonsters(true);    }
    public void giveBuff(int buff, int level) {        SkillFactory.getSkill(buff).getEffect(level).applyTo(getPlayer());    }
    public int getDay() {        return Calendar.getInstance().get(Calendar.DAY_OF_WEEK);    }
    public int getDonatorPoints() {        return getPlayer().getDonatorPoints();    }
    public void gainDonatorPoints(int gain) {        getPlayer().gainDonatorPoints(gain);    }
    public void setGMLevel(int l) {        getPlayer().setGMLevel(l);    }
    public void modifyNX(int amount, int type) {        getPlayer().modifyCSPoints(type, amount);        if (amount > 0) {            getClient().getSession().write(MaplePacketCreator.serverNotice(5, "You have gained NX Cash (" + amount + ")."));        } else {            getClient().getSession().write(MaplePacketCreator.serverNotice(5, "You have lost NX Cash (" + amount + ")."));        }    }
    public void reloadChar() {        getPlayer().getClient().getSession().write(MaplePacketCreator.getCharInfo(getPlayer()));        getPlayer().getMap().removePlayer(getPlayer());        getPlayer().getMap().addPlayer(getPlayer());    }
    public void gainCloseness(int closeness) {        for (MaplePet pet : getPlayer().getPets()) {            if (pet.getCloseness() < 30000 || pet.getLevel() < 30) {                if ((pet.getCloseness() + closeness) > 30000) {                    pet.setCloseness(30000);                } else {                    pet.setCloseness(pet.getCloseness() + closeness);                }                while (pet.getCloseness() > ExpTable.getClosenessNeededForLevel(pet.getLevel() + 1)) {                    pet.setLevel(pet.getLevel() + 1);                    getClient().getSession().write(MaplePacketCreator.showOwnPetLevelUp(getPlayer().getPetIndex(pet)));                }                getPlayer().getClient().getSession().write(MaplePacketCreator.updatePet(pet, true));            }        }    }
    public void doReborn() {        getPlayer().doReborn();    }
    public Point getNPCPosition() {        MapleNPC thenpc = MapleLifeFactory.getNPC(this.npc);        Point pos = thenpc.getPosition();        return pos;    }
    public Point getPosition() {        Point pos = getPlayer().getPosition();        return pos;    }
    public void giveItemBuff(int itemId) {        getPlayer().setItemEffect(itemId);    }
    public boolean isMorphed() {        boolean morph = false;        Integer morphed = getPlayer().getBuffedValue(MapleBuffStat.MORPH);        if (morphed != null) {            morph = true;        }        return morph;    }
    public int getMorphValue() { // 1= mushroom, 2= pig, 3= alien, 4= cornian, 5= arab Special person        try {            int morphid = getPlayer().getBuffedValue(MapleBuffStat.MORPH).intValue();            return morphid;        } catch (NullPointerException n) {            return -1;        }    }
    public MapleSquad getSquad(MapleSquadType Type) {        return c.getChannelServer().getMapleSquad(Type);    }
    public void setReborns(int r) {        c.getPlayer().setReborns(r);    }
    public int getReborns() {        return c.getPlayer().getReborns();    }
    public void resetReactors() {        c.getPlayer().getMap().resetReactors();    }
    public void resetReactorsFull() {        c.getPlayer().getMap().killAllMonster();        c.getPlayer().getMap().resetReactors();    }
    public void setHp(int hp) {        c.getPlayer().setHp(hp);    }
    public void setMp(int mp) {        c.getPlayer().setMp(mp);    }
    public void addHp(int hp) {        c.getPlayer().addHP(hp);    }
    public void addMp(int mp) {        c.getPlayer().addMP(mp);    }
    public void addCloseness(int increase) {        MaplePet pet = c.getPlayer().getPet(0);        if (pet.getCloseness() < 30000) {            int newCloseness = pet.getCloseness() + increase;            if (newCloseness > 30000) {                newCloseness = 30000;            }            pet.setCloseness(newCloseness);            if (newCloseness >= ExpTable.getClosenessNeededForLevel(pet.getLevel() + 1)) {                pet.setLevel(pet.getLevel() + 1);                c.getSession().write(MaplePacketCreator.showPetLevelUp(c.getPlayer(), 0));            }            c.getSession().write(MaplePacketCreator.updatePet(pet, true));        }    }
    public String getName() {        return c.getPlayer().getName();    }
    public int getGender() {        return c.getPlayer().getGender();    }
    public int countMonster() {        return c.getPlayer().getMap().getMapObjectsInRange(c.getPlayer().getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER)).size();    }
    public int countReactor() {        return c.getPlayer().getMap().getMapObjectsInRange(c.getPlayer().getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.REACTOR)).size();    }
    public int getDayOfWeek() {        return Calendar.getInstance().get(Calendar.DAY_OF_WEEK);    }
    public void giveNPCBuff(MapleCharacter chr, int itemID) {        MapleItemInformationProvider.getInstance().getItemEffect(itemID).applyTo(chr);    }
    public void warpAllInMap(int mapid, int portal) {        MapleMapFactory mapFactory = ChannelServer.getInstance(c.getChannel()).getMapFactory();        MapleMap outMap = mapFactory.getMap(mapid);        for (MapleCharacter aaa : outMap.getCharacters()) {            mapFactory = ChannelServer.getInstance(aaa.getClient().getChannel()).getMapFactory();//hmmm needed?            aaa.getClient().getPlayer().changeMap(outMap, outMap.getPortal(portal));            outMap = mapFactory.getMap(mapid);//hmmm needed?            aaa.getClient().getPlayer().getEventInstance().unregisterPlayer(aaa.getClient().getPlayer());        }    }
    public MapleCharacter getCharByName(String namee) {        try {            return getClient().getChannelServer().getPlayerStorage().getCharacterByName(namee);        } catch (Exception e) {            return null;        }    }
    public int getKarma() {        return getPlayer().getKarma();    }
    public void gainKarma(int gain) {        getPlayer().setKarma(getKarma() + gain);    }
    public int getHiredMerchantMesos(boolean zero) {        int mesos;        PreparedStatement ps;        try {            ps = DatabaseConnection.getConnection().prepareStatement("SELECT MerchantMesos FROM characters WHERE id = " + getPlayer().getId());            ResultSet rs = ps.executeQuery();            rs.next();            mesos = rs.getInt("MerchantMesos");            rs.close();            ps.close();        } catch (Exception e) {            return 0;        }        if (zero)            try {                ps = DatabaseConnection.getConnection().prepareStatement("UPDATE characters SET MerchantMesos = 0 WHERE id = " + getPlayer().getId());                ps.executeUpdate();                ps.close();            } catch (Exception e) {            }        return mesos;    }
    public List<IItem> getHiredMerchantItems(){        PreparedStatement ps;        List<IItem> items = new LinkedList<IItem>();        try {            ps = DatabaseConnection.getConnection().prepareStatement("SELECT * FROM hiredmerchant WHERE ownerid = " + getPlayer().getId());            ResultSet rs = ps.executeQuery();             while (rs.next()) {            MapleInventoryType type = MapleInventoryType.getByType((byte) rs.getInt("type"));            if (type.equals(MapleInventoryType.EQUIP)) {                int itemid = rs.getInt("itemid");                Equip equip = new Equip(itemid, (byte) -1);                equip.setOwner(rs.getString("owner"));                equip.setQuantity((short) rs.getInt("quantity"));                equip.setAcc((short) rs.getInt("acc"));                equip.setAvoid((short) rs.getInt("avoid"));                equip.setDex((short) rs.getInt("dex"));                equip.setHands((short) rs.getInt("hands"));                equip.setHp((short) rs.getInt("hp"));                equip.setInt((short) rs.getInt("int"));                equip.setJump((short) rs.getInt("jump"));                equip.setLuk((short) rs.getInt("luk"));                equip.setMatk((short) rs.getInt("matk"));                equip.setMdef((short) rs.getInt("mdef"));                equip.setMp((short) rs.getInt("mp"));                equip.setSpeed((short) rs.getInt("speed"));                equip.setStr((short) rs.getInt("str"));                equip.setWatk((short) rs.getInt("watk"));                equip.setWdef((short) rs.getInt("wdef"));                equip.setUpgradeSlots((byte) rs.getInt("upgradeslots"));                equip.setLocked((byte) 0); // Impossible. Has to be unlocked. x.x                equip.setLevel((byte) rs.getInt("level"));                items.add(equip);            } else {                Item item = new Item(rs.getInt("itemid"), (byte) -1, (short) rs.getInt("quantity"));                item.setOwner(rs.getString("owner"));                items.add(item);            }        }            rs.close();            ps.close();        } catch (Exception e) {            return null;        }        return items;    }
    public boolean GetHiredMerchantItem(int selection){        List<IItem> items = getHiredMerchantItems();        IItem item = items.get(selection);        byte inventory = item.getType();        boolean fullinventory = getPlayer().getInventory(MapleInventoryType.getByType(inventory)).isFull();        if(fullinventory) return false; // Sorry dude. xD        item.setPosition(getPlayer().getInventory(MapleInventoryType.getByType(item.getType())).getNextFreeSlot());        if(MapleInventoryManipulator.addFromDrop(c, item, "Retreiving item from Fredrick",true)){            if(deleteHiredMerchantItem(item)){                return true;            }else{                return false;            }        }else{            return false;        }    }
    public boolean deleteHiredMerchantItem(IItem item){        Connection con = DatabaseConnection.getConnection();        PreparedStatement ps;        try{            ps = con.prepareStatement("DELETE FROM `hiredmerchant` WHERE ownerid = ? AND itemid = ? AND quantity = ? AND type = ?");            ps.setInt(1, getPlayer().getId());            ps.setInt(2, item.getItemId());            ps.setInt(3, item.getQuantity());            ps.setInt(4, item.getType());            return ps.executeUpdate() > 0 ? true : false;        }catch(SQLException e){            return false;        }    }
}
 
Stay smart, be yourself
Joined
Sep 3, 2014
Messages
57
Reaction score
7
Well, i try'd all the scripts that i could find.. nothing works, it wont open npc.
 
Upvote 0
Stay smart, be yourself
Joined
Sep 3, 2014
Messages
57
Reaction score
7
named it 9200000.js
Tommy - job advance v62 Problem with myrepack repack 0-0 - RaGEZONE Forums

[/COLOR]
Tommy - job advance v62 Problem with myrepack repack 0-0 - RaGEZONE Forums

Tommy - job advance v62 Problem with myrepack repack 0-0 - RaGEZONE Forums

[IMG]https://forum.ragezone.com/ima... return false; } } }[/QUOTE]
 
Last edited:
Upvote 0
Stay smart, be yourself
Joined
Sep 3, 2014
Messages
57
Reaction score
7
You're asking why there's an under-line beneath MapleJob references. That's because you're missing an import to the package containing the class (or enum).
you mean ?
import net.sf.odinms.client.MapleJob;

how can i fix it?
 
Last edited:
Upvote 0
Stay smart, be yourself
Joined
Sep 3, 2014
Messages
57
Reaction score
7
I just told you wtf

Why are we all being ignored? @Fraysa
Sorry i didnt ignore you, but i already fix'd it,
i got a new problem, shows bat error when i click on the npc its shows me :
Sep 09, 2014 9:31:11 PM net.sf.odinms.scripting.AbstractScriptManager getInvocab
le
SEVERE: Error executing script.
javax.script.ScriptException: ReferenceError: "importPackage" is not defined in
<eval> at line number 6
at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(
NashornScriptEngine.java:586)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptE
ngine.java:570)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptE
ngine.java:525)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptE
ngine.java:521)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngin
e.java:187)
at javax.script.AbstractScriptEngine.eval(Unknown Source)
at net.sf.odinms.scripting.AbstractScriptManager.getInvocable(AbstractSc
riptManager.java:72)
at net.sf.odinms.scripting.npc.NPCScriptManager.start(NPCScriptManager.j
ava:59)
at net.sf.odinms.scripting.npc.NPCScriptManager.start(NPCScriptManager.j
ava:48)
at net.sf.odinms.net.channel.handler.NPCTalkHandler.handlePacket(NPCTalk
Handler.java:55)
at net.sf.odinms.net.MapleServerHandler.messageReceived(MapleServerHandl
er.java:157)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messa
geReceived(AbstractIoFilterChain.java:570)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageR
eceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(Abst
ractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.mess
ageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flus
h(SimpleProtocolDecoderOutput.java:58)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Prot
ocolCodecFilter.java:180)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageR
eceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(Abst
ractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.mess
ageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorF
ilter.java:220)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.
run(ExecutorFilter.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnabl
e.java:51)
at java.lang.Thread.run(Unknown Source)
Caused by: <eval>:6 ReferenceError: "importPackage" is not defined
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:58)
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.jav
a:320)
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.jav
a:292)
at jdk.nashorn.api.scripting.NashornScriptEngine.__noSuchProperty__(Nash
ornScriptEngine.java:272)
at jdk.nashorn.internal.scripts.Script$engine.L:35(nashorn:engine/resour
ces/engine.js:37)
at jdk.nashorn.internal.scripts.Script$\^eval\_.runScript(<eval>:6)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunction
Data.java:535)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.jav
a:209)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:3
78)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptE
ngine.java:568)
... 24 more
and its any npc...
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,108
Reaction score
1,140
Sorry i didnt ignore you, but i already fix'd it,
i got a new problem, shows bat error when i click on the npc its shows me :

and its any npc...
Fraysa had posted this on some other guys' thread.
Code:
load([COLOR=#800000]"nashorn:mozilla_compat.js"[/COLOR]);

Put that into your npc script, or any NPC script that requires importPackage.
 
Upvote 0
Stay smart, be yourself
Joined
Sep 3, 2014
Messages
57
Reaction score
7
like this?
/* [NPC] Universal Job Advancer and Rebirth
Made by Moogra
Took 2 lines from airflow0's code
*/


importPackage(net.sf.odinms.client);
load("nashorn:mozilla_compat.js");
var status = 0;
var jobName;
var job;


function start() {
cm.sendNext("Hello, I'm in charge of Job Advancing.");
}


function action(mode, type, selection) {
var jobId=cm.getPlayer().getJob().getId();
if (mode == -1) {
cm.sendOk("Well okay then. Come back if you change your mind.\r\n\r\nGood luck on your training.");
cm.dispose();
} else {
if (mode == 1)
status++;
else
status--;
if (status == 1) {
if (cm.getLevel() < 200 && cm.getJob().equals(net.sf.odinms.client.MapleJob.BEGINNER)) {
if (cm.getLevel() < 8) {
cm.sendNext("Sorry, but you have to be at least level 8 to use my services.");
cm.dispose();
} else if (cm.getLevel() < 10) {
cm.sendYesNo("Congratulations of reaching such a high level. Would you like to make the #rFirst Job Advancement#k as a #rMagician#k?");
status = 150;
} else {
cm.sendYesNo("Congratulations on reaching such a high level. Would you like to make the #rFirst Job Advancement#k?");
status = 153;
}
} else if (cm.getLevel() < 30) {
cm.sendOk("Sorry, but you have to be at least level 30 to make the #rSecond Job Advancement#k.");
cm.dispose();
} else if (cm.getJob().equals(net.sf.odinms.client.MapleJob.THIEF))
cm.sendSimple("Congratulations on reaching such a high level. Which would you like to be? #b\r\n#L0#Assassin#l\r\n#L1#Bandit#l#k");
else if (cm.getJob().equals(net.sf.odinms.client.MapleJob.WARRIOR))
cm.sendSimple("Congratulations on reaching such a high level. Which would you like to be? #b\r\n#L2#Fighter#l\r\n#L3#Page#l\r\n#L4#Spearman#l#k");
else if (cm.getJob().equals(net.sf.odinms.client.MapleJob.MAGICIAN))
cm.sendSimple("Congratulations on reaching such a high level. Which would you like to be? #b\r\n#L5#Ice Lightning Wizard#l\r\n#L6#Fire Poison Wizard#l\r\n#L7#Cleric#l#k");
else if (cm.getJob().equals(net.sf.odinms.client.MapleJob.BOWMAN))
cm.sendSimple("Congratulations on reaching such a high level. Which would you like to be? #b\r\n#L8#Hunter#l\r\n#L9#Crossbowman#l#k");
else if (cm.getJob().equals(net.sf.odinms.client.MapleJob.PIRATE))
cm.sendSimple("Congratulations on reaching such a high level. Which would you like to be? #b\r\n#L10#Brawler#l\r\n#L11#Gunslinger#l#k");
else if (cm.getLevel() < 70) {
cm.sendOk("Sorry, but you have to be at least level 70 to make the #rThird Job Advancement#k.");
cm.dispose();
}
else if (jobId % 100 != 0 && (cm.getLevel() >= 70 && jobId % 10 == 0 || cm.getLevel() >= 120 && jobId % 10 == 1)){
cm.getPlayer().changeJob(MapleJob.getById(jobId + 1));
cm.sendOk("Congratulations, you have been job advanced!");
cm.dispose();
}
else if (cm.getLevel() < 200) {
cm.sendNext("Sorry, but you have already attained the highest level of your job's mastery. \r\n\r\nHowever, you can #rrebirth#k when you are level 200.");
status = 98;
} else if (cm.getLevel() >= 200) {
cm.sendYesNo("Ahh... It is good to see you again. Your skills have finally reached the maximum of its potential. So, with all my heart, I congratulate you, great hero. \r\n\r\nYou have been through a long and challenging road, and in so doing, have become immensely strong. However, I can increase your power even further, and surpass your limits! If you accept, you will become a level 1 #bBeginner#k again, but all your abilities, skills, items and mesos, will remain as they are. However, you will only be able to keep the skills that you have placed in your #bkey setting#k. \r\n\r\nSo, tell me, do you wish to be #rreborn#k?");
status = 160;
} else
cm.dispose();
} else if (status == 2) {
switch(selection) {
case 0: jobName = "Assassin"; job = net.sf.odinms.client.MapleJob.ASSASSIN; break;
case 1: jobName = "Bandit"; job = net.sf.odinms.client.MapleJob.BANDIT; break;
case 2: jobName = "Fighter"; job = net.sf.odinms.client.MapleJob.FIGHTER; break;
case 3: jobName = "Page"; job = net.sf.odinms.client.MapleJob.PAGE; break;
case 4: jobName = "Spearman"; job = net.sf.odinms.client.MapleJob.SPEARMAN; break;
case 5: jobName = "Ice/Lightning Wizard"; job = net.sf.odinms.client.MapleJob.IL_WIZARD; break;
case 6: jobName = "Fire/Poison Wizard"; job = net.sf.odinms.client.MapleJob.FP_WIZARD; break;
case 7: jobName = "Cleric"; job = net.sf.odinms.client.MapleJob.CLERIC; break;
case 8: jobName = "Hunter"; job = net.sf.odinms.client.MapleJob.HUNTER; break;
case 9: jobName = "Crossbowman"; job = net.sf.odinms.client.MapleJob.CROSSBOWMAN; break;
case 10:jobName = "Brawler"; job = net.sf.odinms.client.MapleJob.BRAWLER; break;
case 11:jobName = "Gunslinger"; job = net.sf.odinms.client.MapleJob.GUNSLINGER; break;
}
cm.sendYesNo("Do you want to become a #r" + jobName + "#k?");
} else if (status == 3) {
cm.changeJob(job);
cm.sendOk("There you go. Hope you enjoy it. See you around in the future.");
cm.dispose();
}
else if (status == 151) {
if (cm.c.getPlayer().getInt() >= 20) {
cm.changeJob(net.sf.odinms.client.MapleJob.MAGICIAN);
cm.sendOk("There you go. Hope you enjoy it. See you around in the future.");
cm.dispose();
} else {
cm.sendOk("You did not meet the minimum requirement of #r20 INT#k.");
cm.dispose();
}
} else if (status == 154) {
cm.sendSimple("Which would you like to be? #b\r\n#L0#Warrior#l\r\n#L1#Magician#l\r\n#L2#Bowman#l\r\n#L3#Thief#l\r\n#L4#Pirate#l#k");
} else if (status == 155) {
job = 100 * (selection + 1);
if (selection == 0) jobName = "Warrior";
else if (selection == 1) jobName = "Magician";
else if (selection == 2) jobName = "Bowman";
else if (selection == 3) jobName = "Thief";
else if (selection == 4) jobName = "Pirate";
cm.sendYesNo("Do you want to become a #r" + jobName + "#k?");
} else if (status == 156) {
if (job == net.sf.odinms.client.MapleJob.WARRIOR && cm.c.getPlayer().getStr() < 35) {
cm.sendOk("You did not meet the minimum requirement of #r35 STR#k.");
cm.dispose();
} else if (job == net.sf.odinms.client.MapleJob.MAGICIAN && cm.c.getPlayer().getInt() < 20) {
cm.sendOk("You did not meet the minimum requirement of #r20 INT#k.");
cm.dispose();
} else if (job == net.sf.odinms.client.MapleJob.BOWMAN && cm.c.getPlayer().getDex() < 25) {
cm.sendOk("You did not meet the minimum requirement of #r25 DEX#k.");
cm.dispose();
} else if (job == net.sf.odinms.client.MapleJob.THIEF && cm.c.getPlayer().getDex() < 25) {
cm.sendOk("You did not meet the minimum requirement of #r25 DEX#k.");
cm.dispose();
} else if (job == net.sf.odinms.client.MapleJob.PIRATE && cm.c.getPlayer().getDex() < 20) {
cm.sendOk("You did not meet the minimum requirement of #r20 DEX#k.");
cm.dispose();
} else {
cm.getPlayer().setJob(job);
cm.sendOk("There you go. Hope you enjoy it. See you around in the future.");
cm.dispose();
}
} else if (status == 161) {
cm.doReborn();
cm.sendOk("You have been reborn! Good luck on your next journey!");
cm.dispose();
} else {
cm.dispose();
}
}
}

its still doesn't work.
 
Upvote 0
Stay smart, be yourself
Joined
Sep 3, 2014
Messages
57
Reaction score
7
Post a screenshot of the error from your batch file.

Same problem :
SEVERE: Error executing script.
javax.script.ScriptException: ReferenceError: "importPackage" is not defined in
<eval> at line number 6
at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(
NashornScriptEngine.java:586)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptE
ngine.java:570)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptE
ngine.java:525)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptE
ngine.java:521)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngin
e.java:187)
at javax.script.AbstractScriptEngine.eval(Unknown Source)
at net.sf.odinms.scripting.AbstractScriptManager.getInvocable(AbstractSc
riptManager.java:72)
at net.sf.odinms.scripting.npc.NPCScriptManager.start(NPCScriptManager.j
ava:59)
at net.sf.odinms.scripting.npc.NPCScriptManager.start(NPCScriptManager.j
ava:48)
at net.sf.odinms.net.channel.handler.NPCTalkHandler.handlePacket(NPCTalk
Handler.java:55)
at net.sf.odinms.net.MapleServerHandler.messageReceived(MapleServerHandl
er.java:157)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messa
geReceived(AbstractIoFilterChain.java:570)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageR
eceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(Abst
ractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.mess
ageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flus
h(SimpleProtocolDecoderOutput.java:58)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Prot
ocolCodecFilter.java:180)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageR
eceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(Abst
ractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.mess
ageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorF
ilter.java:220)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.
run(ExecutorFilter.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnabl
e.java:51)
at java.lang.Thread.run(Unknown Source)
Caused by: <eval>:6 ReferenceError: "importPackage" is not defined
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:58)
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.jav
a:320)
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.jav
a:292)
at jdk.nashorn.api.scripting.NashornScriptEngine.__noSuchProperty__(Nash
ornScriptEngine.java:272)
at jdk.nashorn.internal.scripts.Script$engine.L:35(nashorn:engine/resour
ces/engine.js:37)
at jdk.nashorn.internal.scripts.Script$\^eval\_.runScript(<eval>:6)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunction
Data.java:535)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.jav
a:209)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:3
78)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptE
ngine.java:568)
... 24 more

When im trying to use
importPackage load("nashorn:mozilla_compat.js");

its says the npc not coded.
now im trying xiuzsource
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,108
Reaction score
1,140
are you actually doing importPackage load("nashorn:mozilla_compat.js");?

You do it like so:
Code:
load("nashorn:mozilla_compat.js");
importPackage(Packages.tools.packet); // example package

function start() {
    cm.getPlayer().getClient().getSession().write(CWvsContext.enableActions());
    cm.dispose();
}

You put load on the top, and then you imporrt package, and after the import is your npc.
 
Upvote 0
Back
Top