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!

NPC that change name.[closed due not wanting every server having it.]

Newbie Spellweaver
Joined
Apr 20, 2008
Messages
73
Reaction score
0
Re: [Release] NPC that change name. Credit to RMZero213

Credit goes to RMZero213

first add this in NPCConversationManager.java
Code:
	public void reloadChar() { // Basically !fakerelog in NPC function form.
            getPlayer().getClient().getSession().write(MaplePacketCreator.getCharInfo(getPlayer()));
            getPlayer().getMap().removePlayer(getPlayer());
            getPlayer().getMap().addPlayer(getPlayer());
        }

then

go MapleCharacter.java

find
Code:
+ "meso = ?, hpApUsed = ?, mpApUsed = ?, spawnpoint = ?, party = ?, buddyCapacity = ?, messengerid = ?, messengerposition = ?, reborns = ?, pvpkills = ?, pvpdeaths = ? WHERE id = ?");

replace it with
Code:
+ "meso = ?, hpApUsed = ?, mpApUsed = ?, spawnpoint = ?, party = ?, buddyCapacity = ?, messengerid = ?, messengerposition = ?, reborns = ?, pvpkills = ?, pvpdeaths = ?, name = ? WHERE id = ?");

then scroll down search for
Code:
			if (update) {
				ps.setInt(31, id);
			} else {
				ps.setInt(31, accountid);
                                ps.setString(32, name);
				ps.setInt(33, world); // TODO store world somewhere ;)
			}

replace it with
Code:
			if (update) {
                                ps.setString(31, name);
				ps.setInt(32, id);
			} else {
				ps.setInt(31, accountid);
                                ps.setString(32, name);
				ps.setInt(33, world); // TODO store world somewhere ;)
			}

lastly the NPC script
Code:
var status = 0;
var selected;
var fee = 30000000;

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

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.sendOk("Later.");
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
			cm.sendNext("Hello #h #. I am the name changer. I can change your name for just " + fee + " mesos. #e ");
		} else if (status == 1) {
			cm.sendGetText("Choose the name you wish to have. #e ");
		} else if (status == 2) {
			selected = cm.getText();
			cm.sendYesNo("Are you sure you want " + selected + " as a name, #h #? #e ");
		} else if (status == 3) {
			if (cm.getMeso() < fee) {
				cm.sendOk("You dont have enough mesos. #e ");
				cm.dispose();
			} else {
				cm.getChar().setName(selected);
				cm.gainMeso(-fee);
				cm.sendOk("Done! Your name is now " + selected + "! If you do not see the name change, please wait I will reload you. #e ");
			}
		} else if (status == 4) {
			cm.dispose();
			cm.reloadChar();
		}
	}
}
}


thanks to RMZero213 :D
Looks real nice tho i wont be using it D:
 
Experienced Elementalist
Loyal Member
Joined
Apr 23, 2008
Messages
240
Reaction score
0
Re: [Release] NPC that change name. Credit to RMZero213

You can just use a php name changer. o_0
 
Mother effin' clouds
Loyal Member
Joined
Apr 13, 2008
Messages
1,534
Reaction score
448
Re: [Release] NPC that change name. Credit to RMZero213

One Question...
Does this have name limitation?
I mean if you try to make your character name in the real way it has word limits, word filtering and some other stuff, if this doesnt have it that means their names might turn so messed up! and they can basically add gm or staff to their name or bad stuff.
 
Skilled Illusionist
Joined
Apr 17, 2008
Messages
386
Reaction score
0
Re: [Release] NPC that change name. Credit to RMZero213

One Question...
Does this have name limitation?
I mean if you try to make your character name in the real way it has word limits, word filtering and some other stuff, if this doesnt have it that means their names might turn so messed up! and they can basically add gm or staff to their name or bad stuff.

No it doesnt. I asked zero if there was a way to add that but he never replied
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
Re: [Release] NPC that change name. Credit to RMZero213

You should edit your first post...
You also need to add a ? at the part where there's like tons of ?
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
Re: [Release] NPC that change name. Credit to RMZero213

Nvm... It already has it sorry
 
Mother effin' clouds
Loyal Member
Joined
Apr 13, 2008
Messages
1,534
Reaction score
448
Re: [Release] NPC that change name. Credit to RMZero213

Sorry To Say But Its Not Good To Use This In A Way But Nice Release.
I Fear The In-Game Abusers With Long Name.
 
Newbie Spellweaver
Joined
Dec 26, 2007
Messages
37
Reaction score
0
Re: [Release] NPC that change name. Credit to RMZero213

Sorry To Say But Its Not Good To Use This In A Way But Nice Release.
I Fear The In-Game Abusers With Long Name.

You can add this, but it won't do much since I don't think there's something like a "contains" method or w/e. This code limits the name length from 3 to 12 and then blocks people using [GM] and GM_ in the beginning and end of names.

I referred to to help me out with the startsWith and endsWith.

Code:
} else if (selected.length() < 3 || selected.length() > 

12) {
                cm.sendOk("Your name must be between 3 ~ 12 

characters.");
                cm.dispose();
            } else if (selected.startsWith("[GM]") == true) {
                cm.sendOk("You are not allowed to impersonate as 

a GM!");
                cm.dispose();
            } else if (selected.endsWith("[GM]") == true) {
                cm.sendOk("You are not allowed to impersonate as 

a GM!");
                cm.dispose();
            } else if (selected.startsWith("GM_") == true) {
                cm.sendOk("You are not allowed to impersonate as 

a GM!");
                cm.dispose();
            } else if (selected.endsWith("GM_") == true) {
                cm.sendOk("You are not allowed to impersonate as 

a GM!");
                cm.dispose();
            }
 
Junior Spellweaver
Joined
Apr 24, 2008
Messages
142
Reaction score
0
Re: [Release] NPC that change name. Credit to RMZero213

Nice job, going to test.
 
Mother effin' clouds
Loyal Member
Joined
Apr 13, 2008
Messages
1,534
Reaction score
448
Re: [Release] NPC that change name. Credit to RMZero213

LOL RYUKO! Kurash DID IT, nice validation fix up for this script im definetly using it now.
 
Newbie Spellweaver
Joined
Dec 26, 2007
Messages
37
Reaction score
0
Re: [Release] NPC that change name. Credit to RMZero213

LOL RYUKO! Kurash DID IT, nice validation fix up for this script im definetly using it now.

I didn't completely do it, but I guess it's a start.
 
Junior Spellweaver
Joined
May 26, 2008
Messages
195
Reaction score
0
Re: [Release] NPC that change name. Credit to RMZero213

Does this have existing name checks + a-z, A-Z, 0-9 limit?
 
You've got my respect!
Joined
Apr 8, 2008
Messages
508
Reaction score
147
Re: [Release] NPC that change name. Credit to RMZero213

this doesn't check for existing names.
anyways why would you want this deleted, it looks like it took 5 minutes to make.
 
Mother effin' clouds
Loyal Member
Joined
Apr 13, 2008
Messages
1,534
Reaction score
448
Re: [Release] NPC that change name. Credit to RMZero213

Does this have existing name checks + a-z, A-Z, 0-9 limit?
Question Asked And Answered Already...

this doesn't check for existing names.
anyways why would you want this deleted, it looks like it took 5 minutes to make.
Ah i forgot about that.
Case Close This is Not Really Worth It UntiL Its Fully developed :)
 
Master Summoner
Loyal Member
Joined
Apr 20, 2008
Messages
578
Reaction score
76
Re: [Release] NPC that change name. Credit to RMZero213

this doesn't check for existing names.
anyways why would you want this deleted, it looks like it took 5 minutes to make.

Exactly its not done yet.
 
Legendary Battlemage
Loyal Member
Joined
May 18, 2008
Messages
614
Reaction score
53
Re: [Release] NPC that change name. Credit to RMZero213

lolz this should be deleted, if zero doesnt want it here
 
Back
Top