{
activeChar.sendMessage("target is not a character");
return false;
}
Creature target = (Creature) obj;
CharacterAI ai = target.getAI();
if (ai == null)
{
activeChar.sendMessage("ai == null");
return false;
}
Creature actor = ai.getActor();
if (actor == null)
{
activeChar.sendMessage("actor == null");
return false;
}
activeChar.sendMessage("actor: " + actor);
break;
case admin_setvar:
if (wordList.length != 3)
{
activeChar.sendMessage("Incorrect argument count!!!");
return false;
}
ServerVariables.set(wordList[1], wordList[2]);
activeChar.sendMessage("Value changed.");
break;
case admin_set_ai_interval:
if (wordList.length != 2)
{
activeChar.sendMessage("Incorrect argument count!!!");
return false;
}
int interval = Integer.parseInt(wordList[1]);
int count = 0;
int count2 = 0;
for (final NpcInstance npc : GameObjectsStorage.getAllNpcsForIterate())
{
if ((npc == null) || (npc instanceof RaidBossInstance))
{
continue;
}
final CharacterAI char_ai = npc.getAI();
if (char_ai instanceof DefaultAI)
{
try
{
final java.lang.reflect.Field field = lineage2.gameserver.ai.DefaultAI.class.getDeclaredField("AI_TASK_DELAY");
field.setAccessible(true);
field.set(char_ai, interval);
if (char_ai.isActive())
{
char_ai.stopAITask();
count++;
WorldRegion region = npc.getCurrentRegion();
if ((region != null) && region.isActive())
{
char_ai.startAITask();
count2++;
}
}
}
catch (Exception e)