[Release] My Hitall Command

Newbie Spellweaver
Joined
Sep 18, 2008
Messages
8
Reaction score
0
I tried to find this command, but seems there is nothing in the forum.
therefore, i created this simple command from the !killall command.
What this command do is set all the monsters in the map to be a certain HP.
I think this is better than just Killing the monster, as we wont get any drops

}else if (splitted[0].equals("!hitall")){
MapleMap map = c.getPlayer().getMap();
double range = Double.POSITIVE_INFINITY;
if (splitted.length > 1) {
int irange = Integer.parseInt(splitted[1]);
range = irange * irange;
}
List<MapleMapObject> monsters = map.getMapObjectsInRange(c.getPlayer().getPosition(), range, Arrays
.asList(MapleMapObjectType.MONSTER));
for(MapleMapObject monstermo : monsters) {
MapleMonster monster = (MapleMonster) monstermo;
monster.setHp(10000);
}
 
PHP:
}else if (splitted[0].equals("!hitall")){
MapleMap map = c.getPlayer().getMap();
double range = Double.POSITIVE_INFINITY;
if (splitted.length > 1) {
int irange = Integer.parseInt(splitted[1]);
range = irange * irange;
}
List<MapleMapObject> monsters = map.getMapObjectsInRange(c.getPlayer().getPosition (), range, Arrays
.asList(MapleMapObjectType.MONSTER));
for(MapleMapObject monstermo : monsters) {
MapleMonster monster = (MapleMonster) monstermo;
monster.setHp(10000);
}

So basically, you just set the monsters HP to 10k?
 
where do we put
}else if (splitted[0].equals("!hitall")){
MapleMap map = c.getPlayer().getMap();
double range = Double.POSITIVE_INFINITY;
if (splitted.length > 1) {
int irange = Integer.parseInt(splitted[1]);
range = irange * irange;
}
List<MapleMapObject> monsters = map.getMapObjectsInRange(c.getPlayer().getPosition (), range, Arrays
.asList(MapleMapObjectType.MONSTER));
for(MapleMapObject monstermo : monsters) {
MapleMonster monster = (MapleMonster) monstermo;
monster.setHp(10000);
}


o_0
 
@HydroBenZ : U can set the HP to whatever number that you like. To make it more challenging, u can change it to 1 million.

@Rick: this is a command... so u put it in commandprocessor?
 
So, you put !hitall, and mosnter have 10,000HP, plus, If i'm not wrong, it's !hitall <range> =/
btw, 10k is a lot.

You can make snails having 10k hp or even 100k Hp, that will be fun.
Or u can make horntail having only 10 HP, the number can be changed
 
worst way to do this... and this does NOT make you a programmer...
If you didn't know... You can simply type in !spawn monsterid (numberOfHP) HP
that's how u set a monster's hp :/
 
worst way to do this... and this does NOT make you a programmer...
If you didn't know... You can simply type in !spawn monsterid (numberOfHP) HP
that's how u set a monster's hp :/

this will be summoning the monster and setting the monster HP.
slightly different logic from mine i guess.
 
PHP:
}else if (splitted[0].equals("!hitall")){
int dmg = Integer.parseInt(splitted[1]);
MapleMap map = c.getPlayer().getMap();
double range = Double.POSITIVE_INFINITY;
List<MapleMapObject> monsters = map.getMapObjectsInRange(c.getPlayer().getPosition (), range, Arrays
.asList(MapleMapObjectType.MONSTER));
for(MapleMapObject monstermo : monsters) {
MapleMonster monster = (MapleMonster) monstermo;
monster.setHp(dmg);
}

Try that one, it should set their HP to the number you chose.
Aka
!hitall 1 sets their HP to 1.
Not sure if it works though, just wrote it based off of authmn's.
 
Back