• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Job Changer

Junior Spellweaver
Joined
Jul 10, 2015
Messages
119
Reaction score
3
I tried searching around for a job changer, but there is none for v83.. I don't need a job advancer I want a changer. Does anyone have a script I can use?

Thanks.
 
not a programmer
Joined
Mar 30, 2015
Messages
532
Reaction score
62
I think a selection of jobs to change to upon clicking?
Though there are already a few of those.
 
Upvote 0
(O_o(o_O(O_O)o_O)O_o)
Loyal Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
I think a selection of jobs to change to upon clicking?
Though there are already a few of those.

So basically this? (change Job might differ per source)
PHP:
/* 
	NPC Name: 		Unk
	Map(s): 		Unk
	Description: 	Changes your job to w/e in v83
	Author:			Novak
*/
var jobs = [0, 100, 110, 120, 130, 200, 210, 220, 230, 300, 310, 320, 400, 410, 420, 500, 510, 520, 1000, 1100, 1200, 1300, 1400, 1500, 2000, 2100]
var jobnames = ["Beginner", "Warrior", "Fighter", "page", "spearman", "Magician", "Fire/ Poison Mage", "Ice/ Lightning Mage", "Cleric", "Archer", "Hunter", "Crossbowman", "Thief", "Assassin", "Bandit", "Pirate", "Brawler", "Gunslinger", "Noblesse", "Dawn Warrior", "Blaze Wizard", "Wind Archer", "Night Walker", "Striker", "Legend", "Aran"];
var text = "";
var i;

function start() { 
    status = -1; 
    action(1, 0, 0); 
}  


function action(mode, type, selection) { 
    if (mode == 1) { 
        status--; 
	} else { 
        cm.dispose(); 
    } 
    if (status == 0) { 
		for (i = 0; i < jobs.length; i++) {
			text += "\r\n#L" + jobs[i] + "#" + jobnames[i] + "#l"
		}
		cm.sendSimple("Please select the job you would like to become:" + text);
    } else if (status == 1) { 
        cm.getPlayer().changeJobById(selection);
		cm.dispose();
	} else {
		cm.dispose();
	}
}
Edit: This one might actually work:
PHP:
/* 
	NPC Name: 		Unk
	Map(s): 		Unk
	Description: 	Changes your job to w/e in v83
	Author:			Novak
*/
var jobs = ["0", "100", "110", "120", "130", "200", "210", "220", "230", "300", "310", "320", "400", "410", "420", "500", "510", "520", "1000", "1100", "1200", "1300", "1400", "1500", "2000", "2100"]
var jobnames = ["Beginner", "Warrior", "Fighter", "page", "spearman", "Magician", "Fire/ Poison Mage", "Ice/ Lightning Mage", "Cleric", "Archer", "Hunter", "Crossbowman", "Thief", "Assassin", "Bandit", "Pirate", "Brawler", "Gunslinger", "Noblesse", "Dawn Warrior", "Blaze Wizard", "Wind Archer", "Night Walker", "Striker", "Legend", "Aran"];
var text = "";
var i;

function start() { 
    status = -1; 
    action(1, 0, 0); 
}  


function action(mode, type, selection) { 
    if (mode == 1) { 
        status--; 
	} else { 
        cm.dispose(); 
    } 
    if (status == 0) { 
		for (i = 0; i < jobs.length; i++) {
			text += "\r\n#L" + jobs[i] + "#" + jobnames[i] + "#l";
		}
		cm.sendSimple("Please select the job you would like to become:" + text);
    } else if (status == 1) { 
        cm.getPlayer().changeJobById(selection);
		cm.dispose();
	} else {
		cm.dispose();
	}
}
 
Last edited:
Upvote 0
Experienced Elementalist
Joined
Mar 28, 2015
Messages
237
Reaction score
69
So basically this? (change Job might differ per source)
Edit: This one might actually work:
PHP:
/* 
    NPC Name:         Unk
    Map(s):         Unk
    Description:     Changes your job to w/e in v83
    Author:            Novak
*/
var jobs = ["0", "100", "110", "120", "130", "200", "210", "220", "230", "300", "310", "320", "400", "410", "420", "500", "510", "520", "1000", "1100", "1200", "1300", "1400", "1500", "2000", "2100"]
var jobnames = ["Beginner", "Warrior", "Fighter", "page", "spearman", "Magician", "Fire/ Poison Mage", "Ice/ Lightning Mage", "Cleric", "Archer", "Hunter", "Crossbowman", "Thief", "Assassin", "Bandit", "Pirate", "Brawler", "Gunslinger", "Noblesse", "Dawn Warrior", "Blaze Wizard", "Wind Archer", "Night Walker", "Striker", "Legend", "Aran"];
var text = "";
var i;

function start() { 
    status = -1; 
    action(1, 0, 0); 
}  


function action(mode, type, selection) { 
    if (mode == 1) { 
        status--; 
    } else { 
        cm.dispose(); 
    } 
    if (status == 0) { 
        for (i = 0; i < jobs.length; i++) {
            text += "\r\n#L" + jobs[i] + "#" + jobnames[i] + "#l";
        }
        cm.sendSimple("Please select the job you would like to become:" + text);
    } else if (status == 1) { 
        cm.getPlayer().changeJobById(selection);
        cm.dispose();
    } else {
        cm.dispose();
    }
}
Why are the job id's strings? Also, as @Twdtwd taught me, you can PE selection, so someone could change their job to GM using this. It's better to iterate through the array and do changeJobById(jobs[selection]); and if selection < 0 || selection > jobs.length dispose/ban the user or w.e
 
Upvote 0
(O_o(o_O(O_O)o_O)O_o)
Loyal Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
Why are the job id's strings? Also, as @Twdtwd taught me, you can PE selection, so someone could change their job to GM using this. It's better to iterate through the array and do changeJobById(jobs[selection]); and if selection < 0 || selection > jobs.length dispose/ban the user or w.e

It's been a long time since I wrote scripts. I just did this asap. I knew it'd prolly work as strings, didn't know if they would else (dun question my logic sometimes, I just forgot how scripts would interpret it, I'm chaotic af) Usually I'd just try and see if it worked or not. But yeah, good call on the security issue. I think I never actually wrote any scripts that would prevent that. I will from now on.
 
Upvote 0
Experienced Elementalist
Joined
Mar 28, 2015
Messages
237
Reaction score
69
Granted I haven't tried it, but it should work. If not, at least you get the idea.
Code:
var jobIds = [0, 100, 110, 120, 130, 200, 210, 220, 230, 300, 310, 320, 400, 410, 420, 500, 510, 520, 1000, 1100, 1200, 1300, 1400, 1500, 2000, 2100];
var text = "";


function start() {
	for (var i = 0; i < jobIds.length; i++) {
		text += "\r\n#L"+i+"#"+cm.getJobById(jobIds[i])+"#l";
	} cm.sendSimple("Please select the job you would like to become: #b"+text);
}


function action(mode,type,selection) {
	if (mode < 1) {
		cm.dispose();
		return;
	} else {
		if (selection >= 0 && selection < jobIds.length) {
			cm.getPlayer().changeJobById(jobIds[selection]);			
		} cm.dispose();
	}
}
Where cm.getJobById is
Code:
    public String getJobById(int id) {
        return MapleJob.getJobName(id);
    }
 
Upvote 0
Experienced Elementalist
Joined
Mar 12, 2015
Messages
238
Reaction score
43
Why are the job id's strings? Also, as @Twdtwd taught me, you can PE selection, so someone could change their job to GM using this. It's better to iterate through the array and do changeJobById(jobs[selection]); and if selection < 0 || selection > jobs.length dispose/ban the user or w.e

What did you mean by PE selection?
 
Upvote 0
Experienced Elementalist
Joined
Mar 28, 2015
Messages
237
Reaction score
69
Ah, thanks.
I had no idea that was possible, wouldn't it be possible to change a selection within the array to gm job as well?
No. You can't change the contents of an array by packet editing. You can tell the server that youre selecting any integer you want, but unless it's handled it won't do anything. The check I added prevents selection outside of the given options. Even without the condition, cm.getPlayer().changeJobById(jobIds[-1]); for instance, would return an error since -1 is not defined within the jobIds array, same goes for anything outside of jobIds.length, that's the benefit of iterating through an array rather than accepting selection immediately. Accepting selection without an array of options would be more convenient if they were integers in order, but as you can see jobIds integer are spread out with some spreading more than hundred numbers apart. If they were for instance 1, 2, 3, 4, 5 we could just do
Code:
if (selection > 0 && selection < 6) {
code
}
 
Upvote 0
Junior Spellweaver
Joined
Jul 10, 2015
Messages
119
Reaction score
3
@Novak well you see I wanted a npc like the job advancer but you don't need to be a required level to job advance. So if you were level 200 night lord you could use this npc to change to a level 200 dark knight, but only people with 50 rebirths can use this npc
 
Upvote 0
Experienced Elementalist
Joined
Mar 28, 2015
Messages
237
Reaction score
69
@Novak well you see I wanted a npc like the job advancer but you don't need to be a required level to job advance. So if you were level 200 night lord you could use this npc to change to a level 200 dark knight, but only people with 50 rebirths can use this npc
You were given the script, just add a condition to check that the player has 50 rebirths and change the job id's array to whatever job options you want. If you want to factor in level to which job advancement you get, just add a condition that adds 1 if level >= 70, 2 if level >= 120 (at least for explorer jobs, idk how the others id's differentiate). Instead of asking for people to do everything for you, I advice you to think for yourself.
 
Upvote 0
Back
Top