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!

[COLLECTION] Commands

Newbie Spellweaver
Joined
Aug 9, 2012
Messages
69
Reaction score
10
Howdy, I'm new around here so forgive me if I go about things the wrong way, or I've posted this in the wrong section. I'll be adding in all of the commands I write in this post, some may be useful, others useless. Either way, I hope someone will find use out of anything I post here.

After doing a lot of GM and development work on WoW private servers, I found a lot of the commands are insanely useful and could be/should be implemented into PokeNet.

I'd like to thank DeathLord17 for his awesome command creating tutorial over @ http://forum.ragezone.com/f706/creating-commands-866258/
A lot of my commands are inspiration from his.

Just a note: This is all the server side handling of each command etc. I won't be adding client side, but you can learn from reading the tutorial linked above.

A solution for case-sensitive names
First, you'll want to search for
Code:
	public void messageReceived(IoSession session, Object msg) throws Exception {
then add in code so it looks like this:
Code:
String message = (String) msg;
String [] details;
String name;
Then just throw this in front of any command you create. It grabs the first letter of the name, changes it to uppercase and then adds the rest of the name onto it in lower case. Sloppy, but it works.
Code:
name = message.substring(2,3).toUpperCase();
name = name + message.substring(3).toLowerCase();
Heal Player
This command works like "/heal LordUsagi" and will let the player, and you know that you've successfully healed that player.
Code:
String name = message.substring(2,3).toUpperCase();
name = name + message.substring(3).toLowerCase();
if(m_players.containsKey(name)) {
PlayerChar o = m_players.get(name);
o.healPokemon();
o.getTcpSession().write("qYour pokemon have been restored to health by " + p.getName());
p.getTcpSession().write("qYou healed all of " + name + "'s pokemon.");
} else {
p.getTcpSession().write("qCannot find player " + name);
}
Teleport player to your position
This command works like "/namego LordUsagi" and will teleport the player (In this case LordUsagi), to your current position. This is a simple reversal of the warpto command.
Code:
String name = message.substring(2,3).toUpperCase();
name = name + message.substring(3).toLowerCase();
if(m_players.containsKey(name)) {
PlayerChar o = m_players.get(name);
o.setX(p.getX());
o.setY(p.getY());
o.setMap(p.getMap(), null);
p.getTcpSession().write("qTeleporting " + name + " to your position.");
} else {
p.getTcpSession().write("qCan't find player " + name + ".");
}
Change a players rank
/setpermission (o - Owner, a - Admin, m - Moderator, p - Player) (CharacterName)
/setpermission m LordUsagi
Code:
String level = message.substring(2,3);
name = message.substring(4,5).toUpperCase();
name = name + message.substring(5).toLowerCase();
if(m_players.containsKey(name)) {
PlayerChar o = m_players.get(name);
if (level.equalsIgnoreCase("p")) {
o.setAdminLevel(0);
o.getTcpSession().write("qYou are now a Player.");
}
if (level.equalsIgnoreCase("m")) {
o.setAdminLevel(25);
o.getTcpSession().write("qYou are now a Moderator.");
}
if (level.equalsIgnoreCase("a")) {
o.setAdminLevel(50);
o.getTcpSession().write("qYou are now an Administrator.");
}
if (level.equalsIgnoreCase("o")) {
o.setAdminLevel(100);
o.getTcpSession().write("qYou are now an Owner.");
}
}
Change your sprite
/morph <id>
This command can be edited to work on other players, but for now I've only made it work on the person using the command.
Code:
String sprite = message.substring(2);
p.setSprite(Integer.parseInt(sprite));
p.updateClientSprite();
p.getTcpSession().write("qYou are now using Sprite ID " + sprite + ".");
 
Last edited:
Experienced Elementalist
Joined
May 28, 2012
Messages
289
Reaction score
51
I will start coding 4 pokenet tomorrow, cause the tutorial of deathlord17 helped me and now i see a future for pokenet :)
 

xkl

Experienced Elementalist
Joined
Dec 26, 2011
Messages
284
Reaction score
116
Good idea. I'll implement some commands in my server and if I come up with something cool, I'll share in this thread <3
 
Newbie Spellweaver
Joined
Aug 9, 2012
Messages
69
Reaction score
10
It'd be nice :) For open licensed code a lot of people are keeping things to themselves. I know commands aren't much and hardly compare to what people can do but they do come in handy and they are interesting to play with.
 
Back
Top