{
activeChar.sendMessage("USAGE: //toobject objectId");
return false;
}
Integer target = Integer.parseInt(wordList[1]);
L2Object obj;
if((obj = L2ObjectsStorage.findObject(target)) != null)
{
teleportToCharacter(activeChar, obj);
return true;
}
activeChar.sendMessage("Object " + target + " not found");
break;
}
if(!activeChar.getPlayerAccess().CanEditChar)
{
return false;
}
switch(command)
{
case admin_teleport_character:
if(wordList.length < 2)
{
activeChar.sendMessage("USAGE: //teleport_character x y z");
return false;
}
teleportCharacter(activeChar, Util.joinStrings(" ", wordList, 1));
showTeleportCharWindow(activeChar);
break;
case admin_recall:
if(wordList.length < 2)
{
activeChar.sendMessage("USAGE: //recall charName");
return false;
}
String targetName = Util.joinStrings(" ", wordList, 1);
L2Player recall_player = L2ObjectsStorage.getPlayer(targetName);
if(recall_player != null)
{
teleportTo(activeChar, recall_player, activeChar.getLoc());
return true;
}
int obj_id = Util.GetCharIDbyName(targetName);
if(obj_id > 0)
{
teleportCharacter_offline(obj_id, activeChar.getLoc());
activeChar.sendMessage(targetName + " is offline. Offline teleport used...");
}
else
{
activeChar.sendMessage("->" + targetName + "<- is incorrect.");
}
break;
case admin_fix_gh_1:
L2Territory gh_spawn_loc;
// Зона крафта
gh_spawn_loc = new L2Territory(10000001);
gh_spawn_loc.add(45704, 186617, -3480, -3380);
gh_spawn_loc.add(46086, 186419, -3488, -3388);
gh_spawn_loc.add(46733, 187506, -3480, -3380);
gh_spawn_loc.add(46294, 187709, -3480, -3380);
for(L2Player player : L2ObjectsStorage.getAllPlayers())
{
if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_MANUFACTURE && player.getReflection().getId() == -2)
{
int[] point = gh_spawn_loc.getRandomPoint();
player.decayMe();
player.setXYZ(point[0], point[1], point[2]);
player.spawnMe();
}
}
// Зона покупки
gh_spawn_loc = new L2Territory(10000002);
gh_spawn_loc.add(46091, 186412, -3488, -3388);
gh_spawn_loc.add(47218, 185902, -3488, -3388);
gh_spawn_loc.add(47761, 186929, -3480, -3380);
gh_spawn_loc.add(46742, 187511, -3480, -3380);
for(L2Player player : L2ObjectsStorage.getAllPlayers())
{
if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_BUY && player.getReflection().getId() == -2)
{
int[] point = gh_spawn_loc.getRandomPoint();
player.decayMe();
player.setXYZ(point[0], point[1], point[2]);
player.spawnMe();
}
}
// Зона продажи
gh_spawn_loc = new L2Territory(10000003);
gh_spawn_loc.add(47665, 186755, -3480, -3380);
gh_spawn_loc.add(48167, 186488, -3480, -3380);
gh_spawn_loc.add(48397, 186625, -3480, -3380);
gh_spawn_loc.add(50156, 184674, -3488, -3388);
gh_spawn_loc.add(49292, 183916, -3488, -3388);
gh_spawn_loc.add(47758, 185654, -3488, -3388);
gh_spawn_loc.add(47244, 185894, -3488, -3388);
for(L2Player player : L2ObjectsStorage.getAllPlayers())
{
if((player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL || player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL_PACKAGE) && player.getReflection().getId() == -2)
{
int[] point = gh_spawn_loc.getRandomPoint();
player.decayMe();
player.setXYZ(point[0], point[1], point[2]);
player.spawnMe();
}
}
break;
case admin_fix_gh_2:
L2Territory gh_spawn_loc2;
// Зона покупки
gh_spawn_loc2 = new L2Territory(10000004);
gh_spawn_loc2.add(46091, 186412, -3488, -3388);
gh_spawn_loc2.add(47218, 185902, -3488, -3388);
gh_spawn_loc2.add(47761, 186929, -3480, -3380);
gh_spawn_loc2.add(46742, 187511, -3480, -3380);
for(L2Player player : L2ObjectsStorage.getAllPlayers())
{
if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_BUY)
{
int[] point = gh_spawn_loc2.getRandomPoint();
player.decayMe();
if(player.getReflection().getId() != -2)
{
player.setVar("backCoords", player.getLoc().toXYZString());
player.setReflection(-2);
}
player.setXYZ(point[0], point[1], point[2]);
player.spawnMe();
}
}
// Зона крафта
gh_spawn_loc2 = new L2Territory(10000005);
gh_spawn_loc2.add(45704, 186617, -3480, -3380);
gh_spawn_loc2.add(46086, 186419, -3488, -3388);
gh_spawn_loc2.add(46733, 187506, -3480, -3380);
gh_spawn_loc2.add(46294, 187709, -3480, -3380);
for(L2Player player : L2ObjectsStorage.getAllPlayers())
{
if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_MANUFACTURE)
{
int[] point = gh_spawn_loc2.getRandomPoint();
player.decayMe();
if(player.getReflection().getId() != -2)
{
player.setVar("backCoords", player.getLoc().toXYZString());
player.setReflection(-2);
}
player.setXYZ(point[0], point[1], point[2]);
player.spawnMe();
}
}
// Зона продажи
gh_spawn_loc2 = new L2Territory(10000006);
gh_spawn_loc2.add(47665, 186755, -3480, -3380);
gh_spawn_loc2.add(48167, 186488, -3480, -3380);
gh_spawn_loc2.add(48397, 186625, -3480, -3380);
gh_spawn_loc2.add(50156, 184674, -3488, -3388);
gh_spawn_loc2.add(49292, 183916, -3488, -3388);
gh_spawn_loc2.add(47758, 185654, -3488, -3388);
gh_spawn_loc2.add(47244, 185894, -3488, -3388);
for(L2Player player : L2ObjectsStorage.getAllPlayers())
{
if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL || player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL_PACKAGE)
{
int[] point = gh_spawn_loc2.getRandomPoint();
player.decayMe();
if(player.getReflection().getId() != -2)
{
player.setVar("backCoords", player.getLoc().toXYZString());
player.setReflection(-2);
}
player.setXYZ(point[0], point[1], point[2]);
player.spawnMe();
}
}
break;
case admin_fix_gh_r:
int radius = 500;
if(wordList.length > 1)
{
radius = Integer.parseInt(wordList[1]);
}
L2Territory spawn_loc;
// Зона покупки
spawn_loc = new L2Territory(10000004);
spawn_loc.add(46091, 186412, -3488, -3388);
spawn_loc.add(47218, 185902, -3488, -3388);
spawn_loc.add(47761, 186929, -3480, -3380);
spawn_loc.add(46742, 187511, -3480, -3380);
for(L2Player player : L2World.getAroundPlayers(activeChar, radius, 200))
{
if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_BUY)
{
int[] point = spawn_loc.getRandomPoint();
player.decayMe();
if(player.getReflection().getId() != -2)
{
player.setVar("backCoords", player.getLoc().toXYZString());
player.setReflection(-2);
}
player.setXYZ(point[0], point[1], point[2]);
player.spawnMe();
}
}
// Зона крафта
spawn_loc = new L2Territory(10000005);
spawn_loc.add(45704, 186617, -3480, -3380);
spawn_loc.add(46086, 186419, -3488, -3388);
spawn_loc.add(46733, 187506, -3480, -3380);
spawn_loc.add(46294, 187709, -3480, -3380);
for(L2Player player : L2World.getAroundPlayers(activeChar, radius, 200))
{
if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_MANUFACTURE)
{
int[] point = spawn_loc.getRandomPoint();
player.decayMe();
if(player.getReflection().getId() != -2)
{
player.setVar("backCoords", player.getLoc().toXYZString());
player.setReflection(-2);
}
player.setXYZ(point[0], point[1], point[2]);
player.spawnMe();
}
}
// Зона продажи
spawn_loc = new L2Territory(10000006);
spawn_loc.add(47665, 186755, -3480, -3380);
spawn_loc.add(48167, 186488, -3480, -3380);
spawn_loc.add(48397, 186625, -3480, -3380);
spawn_loc.add(50156, 184674, -3488, -3388);
spawn_loc.add(49292, 183916, -3488, -3388);
spawn_loc.add(47758, 185654, -3488, -3388);
spawn_loc.add(47244, 185894, -3488, -3388);
for(L2Player player : L2World.getAroundPlayers(activeChar, radius, 200))
{
if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL || player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL_PACKAGE)
{
int[] point = spawn_loc.getRandomPoint();
player.decayMe();
if(player.getReflection().getId() != -2)
{
player.setVar("backCoords", player.getLoc().toXYZString());
player.setReflection(-2);
}
player.setXYZ(point[0], point[1], point[2]);
player.spawnMe();
}
}
break;
case admin_setref:
{
if(wordList.length < 2)
{
activeChar.sendMessage("Usage: //setref <reflection>");
return false;
}
int ref_id = Integer.parseInt(wordList[1]);
if(ref_id != 0 && ReflectionTable.getInstance().get(ref_id) == null)
{
activeChar.sendMessage("Reflection <" + ref_id + "> not found.");
return false;
}
L2Object target = activeChar;
L2Object obj = activeChar.getTarget();
if(obj != null)
{
target = obj;
}
target.setReflection(ref_id);