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!

[Release] Job Advancer NPC. HAX.

Newbie Spellweaver
Joined
Dec 21, 2008
Messages
11
Reaction score
7
PHP:
/* [NPC]
	All-In-One Job Advancer Randi
 */


var status = 0;
var job = 0;
var newJob = 0;
var lvl = 1;
var jobs = Array(**** 120, 130, 210, 220, 230, 310, 320, 410, 420, 510, 520, **** 121, 131, 211, 221, 231, 311, 321, 411, 421, 511, 521, **** 122, 1*** 212, 222, 2*** 312, 322, 412, 422, 512, 522);
function start() 
{
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
	cm.voteMSG();
        cm.dispose();
    } else {
        if (mode == 1) {
            status++;
        } else {
            status--;
        }
        if (status == 0) {
			job = cm.getJobId();
			lvl = cm.getPlayer().getLevel();
            if (lvl < 10){                
                cm.sendOk("Sorry, but you have to be at least level 10 to get a job advance.");
            	cm.dispose();
			} else if (job == 0) {
				if (lvl < 30){
				cm.sendSimple("Choose What Job you want to be #b\r\n#L0# Warrior#l\r\n#L1# Magician#l\r\n#L2# Archer#l\r\n#L3# Thief#l\r\n#L4# Pirate#l");
				status = 9;
				} else if (lvl < 70) {
					cm.sendSimple("Choose What Job you want to be #b\r\n#L0# Fighter#l\r\n#L1# page#l\r\n#L2# spearman#l\r\n#L3# fire wizard#l\r\n#L4# Ice wizard#l\r\n#L5# Cleric#l\r\n#L6# Bowman#l\r\n#L7# Cross Bowman#l\r\n#L8# Assasin#l\r\n#L9# Bandit#l\r\n#L10# Brawler#l\r\n#L11# GunSlinger#l");
				status = 199;
				} else if (lvl < 120) {
					cm.sendSimple("Choose What Job you want to be #b\r\n#L12# Crusader#l\r\n#L13# Knight#l\r\n#L14# Dragon Knight#l\r\n#L15# fire Mage#l\r\n#L16# Ice Mage#l\r\n#L17# Preist#l\r\n#L18# Ranger#l\r\n#L19# Sniper#l\r\n#L20# Hermit#l\r\n#L21# Cheif Bandit#l\r\n#L22# Marauder#l\r\n#L23# Outlaw#l");
				status = 199;
				} else if (lvl >= 120) {
					cm.sendSimple("Choose What Job you want to be #b\r\n#L24# Hero#l\r\n#L25# Paladin#l\r\n#L26# Dark Knight#l\r\n#L27# Fire ArchMage#l\r\n#L28# Ice ArchMage#l\r\n#L29# Bishop#l\r\n#L30# BowMaster#l\r\n#L31# MarksMan#l\r\n#L32# NightLord#l\r\n#L33# Shadower#l\r\n#L34# Buccaneer#l\r\n#L35# Corsair#l");
				status = 199;
				} else {
					cm.sendOk("under construction");
					
				}
			} else if (job >= 100 && job % 100 == 0 ) {
				var duck = "Hi nub!";				
				if (lvl < 70){	
					if (job >= 100 && job < 200 && lvl >= 30) {
						duck = " Choose the Job you want : #b\r\n#L0# Fighter#l\r\n#L1# Page#l\r\n#L2# Spearman#l\r\n";
					} else if (job >= 200 && job < 300 && lvl >= 30) {
						duck = " Choose the Job You want : #b\r\n#L3# Fire Wizard#l\r\n#L4# Ice Wizard#l\r\n#L5# Cleric#l\r\n";
					}  else if (job >= 300 && job < 400 && lvl >= 30) {
						duck = " Choose the Job You want : #b\r\n#L6# Bow Man#l\r\n#L7# Cross Bow Man#l\r\n";
					}  else if (job >= 400 && job < 500 && lvl >= 30) {
						duck = " Choose the Job You want : #b\r\n#L8# Assasin#l\r\n#L9# Bandit#l\r\n";
					}  else if (job >= 500 && job < 600 && lvl >= 30) {
						duck = " Choose the Job You want : #b\r\n#L10# Brawler#l\r\n#L11# GunSlinger#l\r\n";
					} else {						
						cm.voteMSG();
						cm.dispose();
					}
				} else if (lvl < 120) {
					if (job >= 100 && job < 200 && lvl >= 70) {
						duck = " Choose the Job you want : #b\r\n#L12# Crusader#l\r\n#L13# Knight#l\r\n#L14# DragonKnight#l\r\n";
					} else if (job >= 200 && job < 300 && lvl >= 70) {
						duck = " Choose the Job You want : #b\r\n#L15# Fire Mage#l\r\n#L16# Ice Magel\r\n#L17# Preist#l\r\n";
					}  else if (job >= 300 && job < 400 && lvl >= 70) {
						duck = " Choose the Job You want : #b\r\n#L18# Ranger#l\r\n#L19# Sniper#l\r\n";
					}  else if (job >= 400 && job < 500 && lvl >= 70) {
						duck = " Choose the Job You want : #b\r\n#L20# Hermit#l\r\n#L21# Cheif Bandit#l\r\n";
					}  else if (job >= 500 && job < 600 && lvl >= 70) {
						duck = " Choose the Job You want : #b\r\n#L22# Marauder#l\r\n#L23# Outlaw#l\r\n";
					} else {	
						cm.voteMSG();
						cm.dispose();
					}
				} else if (lvl >= 120) {
					if (job >= 100 && job < 200 && lvl >= 120) {
						duck = " Choose the Job you want : #b\r\n#L24# Hero#l\r\n#L25# Paladin#l\r\n#L26# Darknight#l\r\n";
					} else if (job >= 200 && job < 300 && lvl >= 120) {
						duck = " Choose the Job You want : #b\r\n#L27# Fire ArchMage#l\r\n#L28# Ice ArchMage#l\r\n#L29# Bishop#l\r\n";
					}  else if (job >= 300 && job < 400 && lvl >= 120) {
						duck = " Choose the Job You want : #b\r\n#L30# Bow Master#l\r\n#L31# MarksMan#l\r\n";
					}  else if (job >= 400 && job < 500 && lvl >= 120) {
						duck = " Choose the Job You want : #b\r\n#L32# NightLord#l\r\n#L33# Shadower#l\r\n";
					}  else if (job >= 500 && job < 600 && lvl >= 120) {
						duck = " Choose the Job You want : #b\r\n#L34# Buccaneer#l\r\n#L35# Corsair#l\r\n";
					} else {		
						cm.voteMSG();
						cm.dispose();
					}
				}
				cm.sendSimple(duck);
				status = 199;
			} else if (job >= 100 && job % 10 == 0) {
				if (lvl >= 70 && lvl < 120){
					newJob = (job + 1);
					cm.changeJobById(newJob);
					cm.sendOk("There you go. Have Fun");
					status = 99;
				} else if (lvl >= 120){
					newJob = (job + 2);
					cm.changeJobById(newJob);
					cm.sendOk("There you go. Have Fun");
					status = 99;
				} else {
					cm.voteMSG();
					cm.dispose();
				}
			} else if (job >= 100 && job %10 == 1) {
				if (lvl >= 120){
					newJob = (job + 1);
					cm.changeJobById(newJob);
					cm.sendOk("There you go. Have Fun");
					status = 99;
				} else {
					cm.voteMSG();
					cm.dispose();
				} 
			} else {
				cm.voteMSG();
				cm.dispose();
			}			
		} else if (status == 10){
                    cm.changeJobById((selection + 1) * 100);
                    cm.sendOk("There u go. Have fun");
                    status = 99;
		} else if (status == 200){
			cm.changeJobById(jobs[selection]);
			cm.sendOk("there u go. Have fun");
			status = 99;
		} else {
			cm.voteMSG();
			cm.dispose();
		}
	}
}

1) it doesnt check for stats
2) it can change your job straight to 4th job if you have level 120 .

This is for servers with 'laid-back' game play.

note: remember to edit the jobs array . its just job id arranged in order. RZ censored it ><

you will have to add a couple of functions in npcconversationmanager.java

PHP:
        public void changeJobById(int a) {
            getPlayer().changeJob(MapleJob.getById(a));
        }

        public void voteMSG(){
            sendOk("Don't forget to vote for us #r#h #. #bhttp://your vote link witch.#k");
        }

        public int getJobId(){
            return getJob().getId();
        }

Credits: I don't remember copying it from some one. iDolly for helping me I guess.
 
Last edited:
Xephizion Development
Loyal Member
Joined
Apr 19, 2008
Messages
906
Reaction score
31
Re: Job Advancer NPC. HAX.

instead of declaring voteMSG then calling it .. just cm.sendOk("Vote pl0x");
 
Junior Spellweaver
Joined
Aug 11, 2009
Messages
172
Reaction score
8
Re: Job Advancer NPC. HAX.

Thanks for releasing.
It is helpful anywhere for newbie.

@Ehab
i agree with you.
 
Skilled Illusionist
Joined
Aug 15, 2009
Messages
307
Reaction score
40
Re: Job Advancer NPC. HAX.

No Ehab, cm.voteMSG is WAY easier if you want to add it to NPCs.
 
Junior Spellweaver
Joined
Sep 21, 2008
Messages
168
Reaction score
1
Re: Job Advancer NPC. HAX.

wow you added a lot of useless stuff.If I'm not mistaken this wastes Memory
 
Newbie Spellweaver
Joined
Dec 21, 2008
Messages
11
Reaction score
7
Re: Job Advancer NPC. HAX.

wow you added a lot of useless stuff.If I'm not mistaken this wastes Memory


You have no idea what you are talking about.

@ehab : Its easy to make a special function fo vote pl0x because you can use it in other NPCs too. Its just a matter or preference. :)

@sherry & Blue : Thanks for the feed back
 
Xephizion Development
Loyal Member
Joined
Apr 19, 2008
Messages
906
Reaction score
31
lol not to offend you, but votepl0x is useless in the first place :):
it saves space and everything .. but .. what? a few bytes?
and no, it doesn't waste memory o.o
 
Newbie Spellweaver
Joined
Dec 21, 2008
Messages
11
Reaction score
7
lol not to offend you, but votepl0x is useless in the first place :):
it saves space and everything .. but .. what? a few bytes?
and no, it doesn't waste memory o.o

Well actually for every function other than the cm.sendOk and stuff you can use cm.getPlayer(). blablabla, but we do make functions as cm.levelUp and stuff. They are basically not of any significant use but just lesser typing to do. Like I said, its just a matter of preference. I prefer to keep my NPCs shorter .I even have the common strings declared in the cm. you can easily avoid making new functions by typing a few more letters but making it shorter, I think makes it more pretty. I <3 pretty scripts xD
 
Back
Top