this is a simple command that took about 10 minutes to make. it enables you to slap sombody with a certain amount of damage.
EDIT: made three separate command out of bordum..
here is the command put it in your commandprocessor.java
This is the one that can hit up to 12 people at once.This is more stable, only hits one person at a time.PHP Code:else if (splitted[0].equals("!slap")) {
int loss = Integer.parseInt(splitted[2]);
MapleCharacter victim1 = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim1.setHp(victim1.getHp()-loss);
victim1.setMp(victim1.getMp()-loss);
victim1.updateSingleStat(MapleStat.HP, victim1.getHp()-loss);
victim1.updateSingleStat(MapleStat.MP, victim1.getMp()-loss);
mc.dropMessage("You slapped " +victim1.getName()+".");
MapleCharacter victim2 = cserv.getPlayerStorage().getCharacterByName(splitted[2]);
victim2.setHp(victim2.getHp()-loss);
victim2.setMp(victim2.getMp()-loss);
victim2.updateSingleStat(MapleStat.HP, victim2.getHp()-loss);
victim2.updateSingleStat(MapleStat.MP, victim2.getMp()-loss);
mc.dropMessage("You slapped " +victim2.getName()+".");
MapleCharacter victim3 = cserv.getPlayerStorage().getCharacterByName(splitted[3]);
victim3.setHp(victim3.getHp()-loss);
victim3.setMp(victim3.getMp()-loss);
victim3.updateSingleStat(MapleStat.HP, victim3.getHp()-loss);
victim3.updateSingleStat(MapleStat.MP, victim3.getMp()-loss);
mc.dropMessage("You slapped " +victim3.getName()+".");
MapleCharacter victim4 = cserv.getPlayerStorage().getCharacterByName(splitted[4]);
victim4.setHp(victim4.getHp()-loss);
victim4.setMp(victim4.getMp()-loss);
victim4.updateSingleStat(MapleStat.HP, victim4.getHp()-loss);
victim4.updateSingleStat(MapleStat.MP, victim4.getMp()-loss);
mc.dropMessage("You slapped " +victim4.getName()+".");
MapleCharacter victim5 = cserv.getPlayerStorage().getCharacterByName(splitted[5]);
victim5.setHp(victim5.getHp()-loss);
victim5.setMp(victim5.getMp()-loss);
victim5.updateSingleStat(MapleStat.HP, victim5.getHp()-loss);
victim5.updateSingleStat(MapleStat.MP, victim5.getMp()-loss);
mc.dropMessage("You slapped " +victim5.getName()+".");
MapleCharacter victim6 = cserv.getPlayerStorage().getCharacterByName(splitted[6]);
victim6.setHp(victim6.getHp()-loss);
victim6.setMp(victim6.getMp()-loss);
victim6.updateSingleStat(MapleStat.HP, victim6.getHp()-loss);
victim6.updateSingleStat(MapleStat.MP, victim6.getMp()-loss);
mc.dropMessage("You slapped " +victim6.getName()+".");
MapleCharacter victim7 = cserv.getPlayerStorage().getCharacterByName(splitted[6]);
victim7.setHp(victim7.getHp()-loss);
victim7.setMp(victim7.getMp()-loss);
victim7.updateSingleStat(MapleStat.HP, victim7.getHp()-loss);
victim7.updateSingleStat(MapleStat.MP, victim7.getMp()-loss);
mc.dropMessage("You slapped " +victim7.getName()+".");
MapleCharacter victim8 = cserv.getPlayerStorage().getCharacterByName(splitted[6]);
victim8.setHp(victim8.getHp()-loss);
victim8.setMp(victim8.getMp()-loss);
victim8.updateSingleStat(MapleStat.HP, victim8.getHp()-loss);
victim8.updateSingleStat(MapleStat.MP, victim8.getMp()-loss);
mc.dropMessage("You slapped " +victim8.getName()+".");
MapleCharacter victim9 = cserv.getPlayerStorage().getCharacterByName(splitted[6]);
victim9.setHp(victim9.getHp()-loss);
victim9.setMp(victim9.getMp()-loss);
victim9.updateSingleStat(MapleStat.HP, victim9.getHp()-loss);
victim9.updateSingleStat(MapleStat.MP, victim9.getMp()-loss);
mc.dropMessage("You slapped " +victim9.getName()+".");
MapleCharacter victim10 = cserv.getPlayerStorage().getCharacterByName(splitted[6]);
victim10.setHp(victim10.getHp()-loss);
victim10.setMp(victim10.getMp()-loss);
victim10.updateSingleStat(MapleStat.HP, victim10.getHp()-loss);
victim10.updateSingleStat(MapleStat.MP, victim10.getMp()-loss);
mc.dropMessage("You slapped " +victim10.getName()+".");
MapleCharacter victim11 = cserv.getPlayerStorage().getCharacterByName(splitted[6]);
victim11.setHp(victim11.getHp()-loss);
victim11.setMp(victim11.getMp()-loss);
victim11.updateSingleStat(MapleStat.HP, victim11.getHp()-loss);
victim11.updateSingleStat(MapleStat.MP, victim11.getMp()-loss);
mc.dropMessage("You slapped " +victim11.getName()+".");
MapleCharacter victim12 = cserv.getPlayerStorage().getCharacterByName(splitted[6]);
victim12.setHp(victim12.getHp()-loss);
victim12.setMp(victim12.getMp()-loss);
victim12.updateSingleStat(MapleStat.HP, victim12.getHp()-loss);
victim12.updateSingleStat(MapleStat.MP, victim12.getMp()-loss);
mc.dropMessage("You slapped " +victim12.getName()+".");
// made by Kirby
This one slaps everybody in the room (tested)PHP Code:else if (splitted[0].equals("!slap")) {
int loss = Integer.parseInt(splitted[2]);
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setHp(victim.getHp()-loss);
victim.setMp(victim.getMp()-loss);
victim.updateSingleStat(MapleStat.HP, victim.getHp()-loss);
victim.updateSingleStat(MapleStat.MP, victim.getMp()-loss);
mc.dropMessage("You slapped " +victim.getName()+".");
}
to use this one type simply this: !slapeveryone <anycharactername> <amount>if this was already released somwhere, i did not no that. well enjoy tell me if there are any problems with itPHP Code:else if (splitted[0].equals("!slapeveryone")) {
int loss = Integer.parseInt(splitted[2]);
for (MapleCharacter victims : cserv.getPlayerStorage().getAllCharacters())
if (victims != null) {
victims.setHp(victims.getHp()-loss);;
victims.setMp(victims.getMp()-loss);
victims.updateSingleStat(MapleStat.HP, victims.getHp()-loss);
victims.updateSingleStat(MapleStat.MP, victims.getMp()-loss);
mc.dropMessage("You slapped EVERYBODY! People you slapped include: " +victims.getName()+".");
// remove line above if you have a GIANT server with houndreds of people in one town at a time
}
}


Reply With Quote![[Release] !slap command](http://ragezone.com/hyper728.png)


