Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // script load should NOT be used in place of reload. If a script is already loaded
- // successfully, quest_reload ought to be used. The script_load command should only
- // be used for scripts that failed to load altogether (eg. due to errors) or that
- // did not at all exist during server boot. Using script_load to re-load a previously
- // loaded script may cause unpredictable script flow, minor loss of data, and more.
- // This provides a way to load new scripts without having to reboot the server.
- else if (command.startsWith("admin_script_load"))
- {
- String[] parts = command.split(" ");
- if (parts.length < 2)
- {
- //activeChar.sendMessage("Example: //script_load <questFolder>/<questSubFolders...>/<filename>.<ext> ");
- activeChar.sendMessage("Example: //script_load quests/SagasSuperclass/__init__.py");
- }
- else
- {
- File file = new File(L2ScriptEngineManager.SCRIPT_FOLDER, parts[1]);
- if (file.isFile())
- {
- if (RunS(file, activeChar))
- return true;
- }
- else
- {
- String cmd = parts[1];
- if ((!cmd.contains(".java")) && (!cmd.contains(".py")))
- {
- cmd = "ai/individual/"+parts[1]+".java";
- File file2 = new File(L2ScriptEngineManager.SCRIPT_FOLDER, cmd);
- if (file2.isFile())
- if (RunS(file2, activeChar))
- return true;
- cmd = "ai/individual/"+parts[1]+".py";
- file2 = new File(L2ScriptEngineManager.SCRIPT_FOLDER, cmd);
- if (file2.isFile())
- if (RunS(file2, activeChar))
- return true;
- cmd = "ai/group_template/"+parts[1]+".java";
- file2 = new File(L2ScriptEngineManager.SCRIPT_FOLDER, cmd);
- if (file2.isFile())
- if (RunS(file2, activeChar))
- return true;
- cmd = "ai/group_template/"+parts[1]+".py";
- file2 = new File(L2ScriptEngineManager.SCRIPT_FOLDER, cmd);
- if (file2.isFile())
- if (RunS(file2, activeChar))
- return true;
- cmd = "instances/"+parts[1]+"/"+parts[1]+".java";
- file2 = new File(L2ScriptEngineManager.SCRIPT_FOLDER, cmd);
- if (file2.isFile())
- if (RunS(file2, activeChar))
- return true;
- cmd = "instances/"+parts[1]+"/"+parts[1]+".py";
- file2 = new File(L2ScriptEngineManager.SCRIPT_FOLDER, cmd);
- if (file2.isFile())
- if (RunS(file2, activeChar))
- return true;
- cmd = "quests/"+parts[1]+"/"+parts[1]+".java";
- file2 = new File(L2ScriptEngineManager.SCRIPT_FOLDER, cmd);
- if (file2.isFile())
- if (RunS(file2, activeChar))
- return true;
- cmd = "quests/"+parts[1]+"/"+parts[1]+".py";
- file2 = new File(L2ScriptEngineManager.SCRIPT_FOLDER, cmd);
- if (file2.isFile())
- if (RunS(file2, activeChar))
- return true;
- cmd = "quests/"+parts[1]+"/__init__.py";
- file2 = new File(L2ScriptEngineManager.SCRIPT_FOLDER, cmd);
- if (file2.isFile())
- if (RunS(file2, activeChar))
- return true;
- }
- activeChar.sendMessage("File Not Found: " + parts[1]);
- }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement