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
Heal Player
Teleport player to your position
Change a players rank
Change your sprite
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
then add in code so it looks like this:
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:
public void messageReceived(IoSession session, Object msg) throws Exception {
Code:
String message = (String) msg;
String [] details;
String name;
Code:
name = message.substring(2,3).toUpperCase();
name = name + message.substring(3).toLowerCase();
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);
}
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 + ".");
}
/setpermission (o - Owner, a - Admin, m - Moderator, p - Player) (CharacterName)
/setpermission m LordUsagi
/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.");
}
}
/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.
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: