return Commands.values();
}
private void spawnMonster(L2Player activeChar, String monsterId, int respawnTime, int mobCount)
{
L2Object target = activeChar.getTarget();
if(target == null)
{
target = activeChar;
}
Pattern pattern = Pattern.compile("[0-9]*");
Matcher regexp = pattern.matcher(monsterId);
L2NpcTemplate template;
if(regexp.matches())
{
// First parameter was an ID number
int monsterTemplate = Integer.parseInt(monsterId);
template = NpcTable.getTemplate(monsterTemplate);
}
else
{
// First parameter wasn't just numbers so go by name not ID
monsterId = monsterId.replace('_', ' ');
template = NpcTable.getTemplateByName(monsterId);
}
if(template == null)
{
activeChar.sendMessage("Incorrect monster template.");
return;
}
try
{
L2Spawn spawn = new L2Spawn(template);
spawn.setLoc(target.getLoc());
spawn.setLocation(0);
spawn.setAmount(mobCount);
spawn.setHeading(activeChar.getHeading());
spawn.setRespawnDelay(respawnTime);
spawn.setReflection(activeChar.getReflection().getId());
if(RaidBossSpawnManager.getInstance().isDefined(spawn.getNpcId()))
{
activeChar.sendMessage("Raid Boss " + template.name + " already spawned.");
}
else
{
spawn.init();
if(respawnTime == 0)
{
spawn.stopRespawn();
}
activeChar.sendMessage("Created " + template.name + " on " + target.getObjectId() + ".");
}
}
catch(Exception e)
{
activeChar.sendMessage("Target is not ingame.");