
Originally Posted by
yarden
Actaully with that extra bracket i get tons of errors XD
1) Technically, player.getMap().getCharacters() return a MapleCharacter type of ArrayList. So why not use
PHP Code:
List<MapleCharacter> listOfCharacter = player.getMap().getCharacters();
2)Why do you even bothering converting it to array if you can get element based on the arrangement of the array.
PHP Code:
MapleCharacter characterInList = charactersz.get(random);
3) Randomising
PHP Code:
int random = (int) Randomizer.rand(0, listOfCharacter.size());
4) For the broadcasting, just use a for loop to output to everyone to be safe. (the problem might be your broadcastMessage), debug it to get the problem.
PHP Code:
for(MapleCharacter chr : player.getMap().getCharacters()) {
chr.dropMessage("lalalala");
}
5) As on getting the name
PHP Code:
characterInList.getName();