[Tut]How to change DISREGARD THAT I......

Junior Spellweaver
Joined
Jul 21, 2008
Messages
124
Reaction score
47
First open your GeneralchatHandler and inside is

Code:
/*
	This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <[email protected]> 
                       Matthias Butz <[email protected]>
                       Jan Christian Meyer <[email protected]>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation. You may not use, modify
    or distribute this program under any other version of the
    GNU Affero General Public License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package net.sf.odinms.net.channel.handler;

import net.sf.odinms.client.MapleClient;
import net.sf.odinms.client.messages.CommandProcessor;
import net.sf.odinms.net.AbstractMaplePacketHandler;
import net.sf.odinms.tools.MaplePacketCreator;
import net.sf.odinms.tools.StringUtil;
import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;

public class GeneralchatHandler extends AbstractMaplePacketHandler {
	@Override
	public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
		String text = slea.readMapleAsciiString();

		if (!CommandProcessor.processCommand(c, text)) {
			if (StringUtil.countCharacters(text, '@') > 4 || StringUtil.countCharacters(text, '%') > 4 ||
				StringUtil.countCharacters(text, '+') > 6 || StringUtil.countCharacters(text, '$') > 6 ||
				StringUtil.countCharacters(text, '&') > 6 || StringUtil.countCharacters(text, '~') > 6 ||
				StringUtil.countCharacters(text, 'W') > 6) {
				text = "[COLOR="Red"]DISREGARD THAT I SUCK COCK[/COLOR]";
			}
			if(!c.getPlayer().isHidden())
			c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(), text, c.getPlayer().isGM() ? 1 : 0));
                    else {
                
                        c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.serverNotice(2, c.getPlayer().getName() + " : " + text));
                    }
		}
	}
}

Changed the red area to whatever you want but if you want to remove the message do this, thank you xazerrx:
if (!CommandProcessor.processCommand(c, text)) {
/*
if (StringUtil.countCharacters(text, '@') > 4 || StringUtil.countCharacters(text, '%') > 4 ||
StringUtil.countCharacters(text, '+') > 6 || StringUtil.countCharacters(text, '$') > 6 ||
StringUtil.countCharacters(text, '&') > 6 || StringUtil.countCharacters(text, '~') > 6 ||
StringUtil.countCharacters(text, 'W') > 6) {
text = "DISREGARD THAT I SUCK COCK";
}
*/
if(!c.getPlayer().isHidden())
c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(), text, c.getPlayer().isGM() ? 1 : 0));
else {

c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.serverNotice(2, c.getPlayer().getName() + " : " + text));
}
}
}
}
Compile when you're done and if you don't know how to compile I found a guide for you :kisss:

http://forum.ragezone.com/f428/guide-compiling-netbeans-odin-406097/ - How to compile with netbeans
 
Last edited:
Re: [Guide] How to change the message for @@@@@

nice release :P

Lol i will not change it btw xD
 
Re: [Guide] How to change the message for @@@@@

lol but you can change it to something like "Bow down to xelkin" xD
 
Re: [Guide] How to change the message for @@@@@

I changed and it didnt change in the game still says disregard that i suck cok O.O
 
Re: [Guide] How to change DISREGARD THAT I......

Great guide. but, I think the Developer's added it in to prevent spam, which can be a good thing.
 
Re: [Guide] How to change DISREGARD THAT I......

Code:
		if (!CommandProcessor.processCommand(c, text)) {
			if (StringUtil.countCharacters(text, '@') > [B][COLOR="Red"]4[/COLOR][/B] || StringUtil.countCharacters(text, '%') > [B][COLOR="Red"]4[/COLOR][/B] ||
				StringUtil.countCharacters(text, '+') > [B][COLOR="Red"]6[/COLOR][/B] || StringUtil.countCharacters(text, '$') > [B][COLOR="Red"]6[/COLOR][/B] ||
				StringUtil.countCharacters(text, '&') > [B][COLOR="Red"]6[/COLOR][/B] || StringUtil.countCharacters(text, '~') > [B][COLOR="Red"]6[/COLOR][/B] ||
				StringUtil.countCharacters(text, 'W') > [B][COLOR="Red"]6[/COLOR][/B]) {
				text = "DISREGARD THAT I SUCK COCK";
I'm not a coder myself but, see the red text above?

Change the 4's and the 6's to like 500 if you don't want the "DISREGARD THAT I" to pop up. Don't blame me if it doesn't work. I'm simply guessing.
 
Re: [Guide] How to change DISREGARD THAT I......

Code:
		if (!CommandProcessor.processCommand(c, text)) {
			if (StringUtil.countCharacters(text, '@') > [B][COLOR="Red"]4[/COLOR][/B] || StringUtil.countCharacters(text, '%') > [B][COLOR="Red"]4[/COLOR][/B] ||
				StringUtil.countCharacters(text, '+') > [B][COLOR="Red"]6[/COLOR][/B] || StringUtil.countCharacters(text, '$') > [B][COLOR="Red"]6[/COLOR][/B] ||
				StringUtil.countCharacters(text, '&') > [B][COLOR="Red"]6[/COLOR][/B] || StringUtil.countCharacters(text, '~') > [B][COLOR="Red"]6[/COLOR][/B] ||
				StringUtil.countCharacters(text, 'W') > [B][COLOR="Red"]6[/COLOR][/B]) {
				text = "DISREGARD THAT I SUCK COCK";
I'm not a coder myself but, see the red text above?

Change the 4's and the 6's to like 500 if you don't want the "DISREGARD THAT I" to pop up. Don't blame me if it doesn't work. I'm simply guessing.

Did you try it firstly? Maybe I may try.
 
Re: [Guide] How to change DISREGARD THAT I......

I'm not a coder myself but, see the red text above?

Change the 4's and the 6's to like 500 if you don't want the "DISREGARD THAT I" to pop up. Don't blame me if it doesn't work. I'm simply guessing.

Code:
/*
	This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <[email protected]> 
                       Matthias Butz <[email protected]>
                       Jan Christian Meyer <[email protected]>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation. You may not use, modify
    or distribute this program under any other version of the
    GNU Affero General Public License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package net.sf.odinms.net.channel.handler;

import net.sf.odinms.client.MapleClient;
import net.sf.odinms.client.messages.CommandProcessor;
import net.sf.odinms.net.AbstractMaplePacketHandler;
import net.sf.odinms.tools.MaplePacketCreator;
import net.sf.odinms.tools.StringUtil;
import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;

public class GeneralchatHandler extends AbstractMaplePacketHandler {
	@Override
	public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
		String text = slea.readMapleAsciiString();

		if (!CommandProcessor.processCommand(c, text)) {
[COLOR=Red]			if (StringUtil.countCharacters(text, '@') > 4 || StringUtil.countCharacters(text, '%') > 4 ||
				StringUtil.countCharacters(text, '+') > 6 || StringUtil.countCharacters(text, '$') > 6 ||
				StringUtil.countCharacters(text, '&') > 6 || StringUtil.countCharacters(text, '~') > 6 ||
				StringUtil.countCharacters(text, 'W') > 6) {
				text = "[/COLOR][COLOR=Red]DISREGARD THAT I SUCK COCK";
			}[/COLOR]
			if(!c.getPlayer().isHidden())
			c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(), text, c.getPlayer().isGM() ? 1 : 0));
                    else {
                
                        c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.serverNotice(2, c.getPlayer().getName() + " : " + text));
                    }
		}
	}
}
If you REALLY wanted to get rid of the message entirely you would just have to take out the red section. Then compile of course =jD
 
Back