handleRes(activeChar, null);
}
private void handleRes(L2PcInstance activeChar, String resParam)
{
L2Object obj = activeChar.getTarget();
if (resParam != null)
{
// Check if a player name was specified as a param.
L2PcInstance plyr = L2World.getInstance().getPlayer(resParam);
if (plyr != null)
{
obj = plyr;
}
else
{
// Otherwise, check if the param was a radius.
try
{
int radius = Integer.parseInt(resParam);
for (L2PcInstance knownPlayer : activeChar.getKnownList().getKnownPlayersInRadius(radius))
doResurrect(knownPlayer);
activeChar.sendMessage("Resurrected all players within a " + radius + " unit radius.");
return;
}
catch (NumberFormatException e) {
activeChar.sendMessage("Enter a valid player name or radius.");
return;
}
}
}
if (obj == null)
obj = activeChar;
if (obj instanceof L2ControllableMobInstance)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
return;
}
doResurrect((L2Character)obj);
if (Config.DEBUG)
_log.fine("GM: "+activeChar.getName()+"("+activeChar.getObjectId()+") resurrected character "+ obj.getObjectId());
}