
heladito
Members-
Posts
59 -
Credits
0 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by heladito
-
Help Adapt automatic backup Acis to Frozen
heladito replied to heladito's question in Request Server Development Help [L2J]
Hi @Rootware ! thanks for answer. can, maybe if u have some time, tell me how can i do it that? -
Help Adapt automatic backup Acis to Frozen
heladito posted a question in Request Server Development Help [L2J]
hi guys! anyone can help me to adapt this code for jfrozen rev 1132? Index: net.sf.l2j;Config.JAVA =================================================================== --- net.sf.l2j;Config.JAVA (revision) +++ net.sf.l2j;Config.JAVA (working copy) + /** Auto Save Data Base */ + public static boolean ENABLE_BACKUP_BOOLEAN; + public static String NAME_DATA_BASE; + ENABLE_BACKUP_BOOLEAN = Boolean.parseBoolean(aCis.getProperty("AutoSaveDB", "True")); + NAME_DATA_BASE = aCis.getProperty("URL_DB", "aCis"); Index: Dev.AutoBackup;BackupDBSave.JAVA =================================================================== --- Dev.AutoBackup;BackupDBSave.JAVA (revision) +++ Dev.AutoBackup;BackupDBSave.JAVA (working copy) + package Dev.AutoBackup; + + import java.io.BufferedReader; + import java.io.File; + import java.io.FileInputStream; + import java.io.FileOutputStream; + import java.io.IOException; + import java.io.InputStreamReader; + import java.net.URL; + import java.sql.Connection; + import java.sql.PreparedStatement; + import java.sql.ResultSet; + import java.text.DateFormat; + import java.text.SimpleDateFormat; + import java.util.Date; + import java.util.zip.ZipEntry; + import java.util.zip.ZipOutputStream; + + import net.sf.l2j.commons.concurrent.ThreadPool; + + import net.sf.l2j.Config; + import net.sf.l2j.L2DatabaseFactory; + import net.sf.l2j.util.Mysql; + + + /** + * @author COMBATE + * + * note to RESTORE + * Unzip the file + * Then go to database via navicat and run Execute SQL File + * Then declick the option "Run multiple queries in each execution" to avoid conflict with locks of tables + */ + public class BackupDBSave + { + private String database_name = Config.NAME_DATA_BASE; + private boolean DEBUG_SYSTEM = false; + private long initializeAfterTime = 1000 * 60 * 60 * 1; // Start in 2 hour + private long checkEveryTime = 1000 * 60 * 60 * 1; // Every 6 hours + + protected BackupDBSave() + { + ThreadPool.scheduleAtFixedRate(() -> BackupDBToSql(), initializeAfterTime, checkEveryTime); + + System.out.println("Database Backup Manager: Loaded"); + } + + public void BackupDBToSql() + { + String pathOfMysql = "\""; + + Connection con = null; + PreparedStatement statement = null; + ResultSet rs = null; + + try + { + con = L2DatabaseFactory.getInstance().getConnection(); + statement = con.prepareStatement("SELECT @@basedir"); + rs = statement.executeQuery(); + + while (rs.next()) + { + pathOfMysql += rs.getString(1); + } + } + catch (Exception e) + { + e.printStackTrace(); + } + finally + { + Mysql.closeQuietly(con, statement, rs); + } + + if (pathOfMysql.isEmpty()) + { + System.out.println("Error on backup database. Empty path of mysql."); + return; + } + + // Give the specific path (pathOfMysql out = C:\Program Files\MySQL\MySQL Server 5.7\) + pathOfMysql += "bin\\mysqldump" + "\""; + + if(DEBUG_SYSTEM) System.out.println("Path of mysql: " + pathOfMysql); + + // Initialize code for backup + try + { + // Section for path of system + URL applicationRootPathURL = getClass().getProtectionDomain().getCodeSource().getLocation(); + File applicationRootPath = new File(applicationRootPathURL.getPath()); + File myFile = new File(applicationRootPath.getParent()); + File lastMyFile = new File(myFile.getParent()); + + String dbUser = Config.DATABASE_LOGIN; + String dbPass = Config.DATABASE_PASSWORD; + + String commandOfMysqlDump = " " + database_name + " --single-transaction -u" + dbUser + " -p" + dbPass + " --skip-create-options --skip-comments --disable-keys > "; + + /* NOTE: Creating Path Constraints for folder saving */ + /* NOTE: Here the backup folder is created for saving inside it */ + String folderPath = "backup"; + + /* NOTE: Creating Folder if it does not exist */ + File f1 = new File(folderPath); + f1.mkdir(); + + /* NOTE: Creating Path Constraints for backup saving */ + /* NOTE: Here the backup is saved in a folder called backup with the name backup.sql */ + String pathUntilDirectory = (lastMyFile.getAbsolutePath() + "\\backup\\").replaceAll("%20", " "); + String savePath = ("\""+pathUntilDirectory + "backup.sql\"").replaceAll("%20", " "); + + /* NOTE: Used to create a cmd command */ + String commandToExecute = "cmd /c "+ pathOfMysql + commandOfMysqlDump + savePath; + + if (DEBUG_SYSTEM) + { + System.out.println("Save path of sql file: " + savePath); + System.out.println("Command To Execute: " + commandToExecute); + } + + /* NOTE: Executing the command here */ + Process runtimeProcess = Runtime.getRuntime().exec(new String[] {"cmd", "/c", commandToExecute }); + + if (DEBUG_SYSTEM) + { + BufferedReader stdInput = new BufferedReader(new InputStreamReader(runtimeProcess.getInputStream())); + BufferedReader stdError = new BufferedReader(new InputStreamReader(runtimeProcess.getErrorStream())); + + // read the output from the command + System.out.println("Here is the standard output of the command:\n"); + String s = null; + while ((s = stdInput.readLine()) != null) { + System.out.println(s); + } + + // read any errors from the attempted command + System.out.println("Here is the standard error of the command (if any):\n"); + while ((s = stdError.readLine()) != null) { + System.out.println(s); + } + } + + int processComplete = runtimeProcess.waitFor(); + + /* NOTE: processComplete=0 if correctly executed, will contain other values if not */ + if (processComplete == 0) + { + System.out.println("Backup to SQL Complete"); + + // Zip the sql file + zipAFile(pathUntilDirectory); + + // Delete the backup.sql file + deleteAFile(savePath.replaceAll("\"", "")); + } + else + { + System.out.println("Backup to SQL Failure"); + } + } + catch (IOException | InterruptedException ex) + { + System.out.println("Error at Backuprestore" + ex.getMessage()); + } + } + + @SuppressWarnings("resource") + private static void zipAFile(String pathToSave) + { + byte[] buffer = new byte[1024]; + + try + { + DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH-mm-ss"); + Date date = new Date(); + + FileOutputStream fos = new FileOutputStream(pathToSave + "Backup_"+dateFormat.format(date)+".zip"); + ZipOutputStream zos = new ZipOutputStream(fos); + ZipEntry ze = new ZipEntry("backup.sql"); + zos.putNextEntry(ze); + FileInputStream in = new FileInputStream(pathToSave + "\\backup.sql"); + + int len; + while ((len = in.read(buffer)) > 0) + { + zos.write(buffer, 0, len); + } + + in.close(); + zos.closeEntry(); + + // remember close it + zos.close(); + + System.out.println("Done the zip of backup."); + + } + catch (IOException ex) + { + ex.printStackTrace(); + } + + } + + private static void deleteAFile(String path) { + try{ + File file = new File(path); + System.out.println(file.delete() ? (file.getName() + " is deleted!") : ("Delete operation is failed.")); + + }catch(Exception e){ + + e.printStackTrace(); + + } + } + + public static BackupDBSave getInstance() + { + return SingletonHolder._instance; + } + + private static class SingletonHolder + { + protected static final BackupDBSave _instance = new BackupDBSave(); + } + } + Index: Dev.AutoBackup;Mysql.JAVA =================================================================== --- Dev.AutoBackup;Mysql.JAVA (revision) +++ Dev.AutoBackup;Mysql.JAVA (working copy) + package Dev.AutoBackup; + + + import java.sql.Connection; + import java.sql.PreparedStatement; + import java.sql.ResultSet; + import java.sql.SQLException; + import java.sql.Statement; + import java.util.logging.Logger; + + import net.sf.l2j.L2DatabaseFactory; + + /** + * @author COMBATE + * + */ + public abstract class Mysql + { + private static final Logger _log = Logger.getLogger(Mysql.class.getName()); + + /** + * Performs a simple sql queries where unnecessary control parameters <BR> + * NOTE: In this method, the parameters passed are not valid for SQL-injection! + * @param db + * @param query + * @param vars + * @return + */ + public static boolean setEx(L2DatabaseFactory db, String query, Object... vars) + { + Connection con = null; + Statement statement = null; + PreparedStatement pstatement = null; + boolean successed = true; + + try + { + if(db == null) + db = L2DatabaseFactory.getInstance(); + + con = db.getConnection(); + if(vars.length == 0) + { + statement = con.createStatement(); + statement.executeUpdate(query); + statement.close(); + } + else + { + pstatement = con.prepareStatement(query); + setVars(pstatement, vars); + pstatement.executeUpdate(); + pstatement.close(); + } + con.close(); + } + catch(Exception e) + { + _log.warning("Could not execute update '" + query + "': " + e); + e.printStackTrace(); + successed = false; + } + finally + { + closeQuietly(con, pstatement); + closeQuietly(statement); + } + return successed; + } + + public static void setVars(PreparedStatement statement, Object... vars) throws SQLException + { + Number n; + long long_val; + double double_val; + for(int i = 0; i < vars.length; i++) + if(vars[i] instanceof Number) + { + n = (Number) vars[i]; + long_val = n.longValue(); + double_val = n.doubleValue(); + if(long_val == double_val) + statement.setLong(i + 1, long_val); + else + statement.setDouble(i + 1, double_val); + } + else if(vars[i] instanceof String) + statement.setString(i + 1, (String) vars[i]); + } + + public static boolean set(String query, Object... vars) + { + return setEx(null, query, vars); + } + + public static boolean set(String query) + { + return setEx(null, query); + } + + public static void closeQuietly(Connection conn) + { + try { + close(conn); + } catch (SQLException e) { // NOPMD + // quiet + } + } + + public static void closeQuietly(Connection conn, Statement stmt, ResultSet rs) { + + try { + closeQuietly(rs); + } finally { + try { + closeQuietly(stmt); + } finally { + closeQuietly(conn); + } + } + } + + public static void closeQuietly(Connection conn, Statement stmt) + { + try { + closeQuietly(stmt); + } finally { + closeQuietly(conn); + } + } + + public static void closeQuietly(ResultSet rs) { + try { + close(rs); + } catch (SQLException e) { // NOPMD + // quiet + } + } + + public static void closeQuietly(Statement stmt) { + try { + close(stmt); + } catch (SQLException e) { // NOPMD + // quiet + } + } + + public static void close(Connection conn) throws SQLException { + if (conn != null) { + conn.close(); + } + } + + public static void close(ResultSet rs) throws SQLException { + if (rs != null) { + rs.close(); + } + } + + public static void close(Statement stmt) throws SQLException { + if (stmt != null) { + stmt.close(); + } + } + } + Index: net.sf.l2j.gameserver;GameServer.JAVA =================================================================== --- net.sf.l2j.gameserver;GameServer.JAVA (revision) +++ net.sf.l2j.gameserver;GameServer.JAVA (working copy) + import Dev.AutoBackup.BackupDBSave; + StringUtil.printSection("DataBase Auto Save"); + if (Config.ENABLE_BACKUP_BOOLEAN) { + BackupDBSave.getInstance(); + LOGGER.info("[DataBase Auto Save]: Enabled"); + }else + { + LOGGER.info("[DataBase Auto Save]: Desatived"); + } Index: gameserver.config.aCis.aCis.properties =================================================================== --- gameserver.config.aCis.aCis.properties (revision) +++ gameserver.config.aCis.aCis.properties (working copy) # Enable Auto Save DataBase AutoSaveDB = True #Name DataBase #Ex: l2jdb URL_DB = aCis -
Item spawn protection double click Interlude
heladito posted a question in Request Server Development Help [L2J]
Hello guys. I would like to know if anyone could help me to create an item that with double click, generate spawn protection for 15 seconds. Its for frozen 1132 -
Code .dressme for L2JFrozen users
heladito replied to HowardStern's topic in Server Shares & Files [L2J]
hi bro! like this skin system mode https://maxcheaters.com/topic/236274-code-adaption-from-l2jlisvus-to-l2jfrozen -
Code .dressme for L2JFrozen users
heladito replied to HowardStern's topic in Server Shares & Files [L2J]
anyone have it with the skin system mode + 2 click item? -
Help code adaption from l2jlisvus to l2jfrozen
heladito posted a question in Request Server Development Help [L2J]
Hello friends! how are you? Today I bring this code to adapt to everyone, because in the "requests" part I did not receive an answer. I hope we can do this together as the great community that we are. Let's start! I try to adapt the skin + 2 click item system for Jfrozen rev 1132. At first, I made a mistake when the character logged in, because he reappeared inside the flood. I think i fix it from charinfo.java and userinfo.java Now, the problem is that I go in and when I click on the coin to give me the skin, it does not take any action. There are no errors in the gameserver or in java. We can adapt the rest among everyone and make a post line so that each one contributes their part! Sorry for my english :) Original Code Lisvus: Pastebin Adapted to Frozen rev 1132: Pastebin -
Help problem with skin system mode jfrozen
heladito replied to heladito's question in Request Server Development Help [L2J]
@HowardStern hi bro! thanks for answer. i dont think so, i trying to adapt from lisvus to frozen but i cant do it. can send me your share or post adapted to frozen? please. or say me how can i fix it i just saw your share. its .dressme but this i try to adapt its dressme + skin with 2 click item -
Help problem with skin system mode jfrozen
heladito posted a question in Request Server Development Help [L2J]
hi guys! i thy to adapt this skin system mode from lisvus to frozen. And dont give me any error in eclipse or gameserver, but when i log with the character, happens you can see in the pics. this is the code from lisvus pastebin -
Help Adapt to jfrozen
heladito replied to heladito's question in Request Server Development Help [L2J]
hi bro! thanks for answer. that code its .dressme , i want, if possible, the code i shared because its a dressme skin system with 2 click item -
hi guys! i hope anyone can help me with this. can adapt this dressme + 2 click skin for Jfrozen rev 1132? please Pastebin code
-
Help help npc subclass acumulative by Allen
heladito posted a question in Request Server Development Help [L2J]
hi! i loaded the npc in my pack frozen rev 1132 and the NPC is working, but I have a problem. When player takes stucksub, he don't get subclass, but access player gets subclass. Please for reply. Sorry for my english. this npc this is the code of .py import sys from java.lang import System from java.util import Iterator from com.l2jfrozen.util.database import L2DatabaseFactory from com.l2jfrozen.gameserver.model.quest import State from com.l2jfrozen.gameserver.model.quest import QuestState from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest from com.l2jfrozen.gameserver.network.serverpackets import CharInfo from com.l2jfrozen.gameserver.network.serverpackets import UserInfo from com.l2jfrozen.gameserver.network.serverpackets import SetupGauge from com.l2jfrozen.gameserver.model.base import ClassId from com.l2jfrozen.gameserver.managers import QuestManager from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance from com.l2jfrozen.gameserver.datatables import SkillTable from com.l2jfrozen.gameserver.datatables.sql import SkillTreeTable from com.l2jfrozen.gameserver.model import L2Skill NPC = [8000] QuestId = 855 QuestName = "SubclassNpc" QuestDesc = "custom" QUEST_INFO = str(QuestId)+"_"+QuestName print "INFO Loaded ClassMaster NPC" #------------------------------------------------------------------------------------------------------------------------------------- # SETTINGS #------------------------------------------------------------------------------------------------------------------------------------- #For more than 3 subclasses, you must increase the variable number into the SQL and add to the database. #inside the sql you will find some variables named SubclassidX. Just change the "X" increasing the number. #This value shouldn't be changed if you don't want to increase the subclasses number beyond 3. #Increase or decrease the "maxsubsindb" value without make these changes, will cause errors. Be carefull!. maxsubsindb = 1 #True, allows reloading the configuration script from the game, without restarting the server (for GMs only). False, disables it. ShowReloadScriptPanel = True # Subclasses number that can be added. Must be less than or equal to "maxsubsindb". SubsNumber = 1 # True, allows add stackable subclasses in every original game subclass (Mainclass and every retails). # False, allows add stackable subclasses in only one original game subclass AllowMultiSubs = False # True, allows any stackable subclass. False, allows add your own race's subclasses only. AllowAllSubs = True #This option work if "AllowAllSubs = False", Also you need to be using a original game subclass (Retail) to get available this. #True, allow add a subclass with the same main class's race. False, allow add a subclass with the same Retail's race. AllowMutantRetail = True #The next two options work if "AllowAllSubs = True" only. #True, allows everybody add Kamael subclass. False otherwise. AllowKamaelSubs = False #True, allows Kamaels add any subclass. False, allows Kamaels to add their own race only. AllowAllSubsToKamael = False #True, allows delete the main class or any subclass added. False, allow to delete added subclasses only. Default: False AllowDelMainClass = False # Minimum Level to add a subclass. Default: 76 MinLevel = 76 #True, allows add subsclasses if the character is a Noblesse only. False, otherwise. Default: False AllowOnlyNobles = True #True, allow to add subclass or any other actions if you have the required items only. False, otherwise ReqItems = True #Required Item to switch between the subclasses. Default: 57 (Adena) #Required items number. Item1_Req = 57 Item1_Num = 1000000 #Required Item to add a subclass. #Required items number. Item2_Req = 9997 Item2_Num = 3 #Required Item to delete subclasses. #Required items number. Item3_Req = 57 Item3_Num = 50000000 # True: Change level after add a subclass # False: Not to change level after add a subclass. Default: True DecLevel= False # True: HTML will show 3rd Class trasfer to choose, also it disallow add subclasses if the characters haven't added 3rd job. # False: HTML Will show 2nd Class trasfer to choose, also it disallow add subclasses if the characters haven't added 2nd or 3rd job. AllowThirdJob = True #Level at which the character will be changed after add a subclass. Default: 40 NewLevel= 40 # True: The user must wait a while before take any action. Default: True # False: The user can do any action without time constraints. Not recommended Block = True #Blocking time in seconds before take any action. BlockTime = 20 #------------------------------------------------------------------------------------------------------------------------------------- def MainHtml(st) : xsubsamount=getsubsammount(st) if xsubsamount >= 0 : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=250 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td></td></tr>" HTML_MESSAGE += "<tr><td align=\"left\"><font color=\"0088EE\"> Antes de tomar qualquer atitude, certifique-se</font></td></tr>" HTML_MESSAGE += "<tr><td align=\"left\"><font color=\"0088EE\"> esta usando a classe principal ou o bom</font></td></tr>" HTML_MESSAGE += "<tr><td align=\"left\"><font color=\"0088EE\"> Subclasse, que solicitou as alteracoes.</font></td></tr>" if ReqItems == True: HTML_MESSAGE += "<tr><td align=\"left\"><font color=\"0088EE\"> Besides you need the required items.</font></td></tr>" HTML_MESSAGE += "<tr><td><br></td></tr>" if xsubsamount < SubsNumber and Item2_Num >= 1: HTML_MESSAGE += "<tr><td align=\"left\"><font color=\"0088EE\"> Choose Sub: <font color=\"FFFF00\">"+str(Item2_Num)+" "+str(getitemname(st,Item2_Req))+"</font></font></td></tr>" if Item3_Num >= 1: HTML_MESSAGE += "<tr><td align=\"left\"><font color=\"0088EE\"> Deletar Sub: <font color=\"FFFF00\">"+str(Item3_Num)+" "+str(getitemname(st,Item3_Req))+"</font></font></td></tr>" if Item1_Num >= 1: HTML_MESSAGE += "<tr><td align=\"left\"><font color=\"0088EE\"> Trocar Sub: <font color=\"FFFF00\">"+str(Item1_Num)+" "+str(getitemname(st,Item1_Req))+"</font></font></td></tr>" HTML_MESSAGE += "<tr><td></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<tr><td width=90 align=\"center\"><table width=90 border=0 bgcolor=444444><tr><td width=90 align=\"center\"><table width=85 border=0 bgcolor=444444>" if xsubsamount < SubsNumber : HTML_MESSAGE += "<tr><td><button value=\"Choose Sub\" action=\"bypass -h Quest " +QUEST_INFO + " gethtml 1\" width=80 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br1>" HTML_MESSAGE += "<tr><td><button value=\"Delete Sub\" action=\"bypass -h Quest " +QUEST_INFO + " gethtml 3\" width=80 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br1>" HTML_MESSAGE += "<tr><td><button value=\"Switch Sub\" action=\"bypass -h Quest " +QUEST_INFO + " gethtml 2\" width=80 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br1>" HTML_MESSAGE += "</table></td></tr></table></td></tr>" HTML_MESSAGE += "</center></body></html>" return HTML_MESSAGE else: if st.getQuestItemsCount(Item2_Req) < Item2_Num and ReqItems == True: return comunerrors(st,"0") if getVarcharacters(st,"race") == "5" and AllowAllSubsToKamael == False : return MainHtmlIV(st,"5") if AllowAllSubs == False : if AllowMutantRetail == False and st.player.isSubClassActive(): return MainHtmlIV(st,getclassname(st,str(st.player.getClassId().getId()),"RaceId")) else: return MainHtmlIV(st,getVarcharacters(st,"race")) else: return MainHtmlI(st) def MainHtmlI(st) : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=250 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td></td></tr>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"0088EE\">Choose a Race</font></td></tr>" HTML_MESSAGE += "<tr><td></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br><br>" HTML_MESSAGE += "<tr><td width=110 align=\"center\"><table width=110 border=0 bgcolor=444444><tr><td width=110 align=\"center\"><table width=105 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td><button value=\"Human\" action=\"bypass -h Quest " +QUEST_INFO + " escraza 0\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br>" HTML_MESSAGE += "<tr><td><button value=\"Elf\" action=\"bypass -h Quest " +QUEST_INFO + " escraza 1\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br>" HTML_MESSAGE += "<tr><td><button value=\"Dark Elf\" action=\"bypass -h Quest " +QUEST_INFO + " escraza 2\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br>" HTML_MESSAGE += "<tr><td><button value=\"Orc\" action=\"bypass -h Quest " +QUEST_INFO + " escraza 3\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br>" HTML_MESSAGE += "<tr><td><button value=\"Dwarf\" action=\"bypass -h Quest " +QUEST_INFO + " escraza 4\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br>" if AllowKamaelSubs == True or getVarcharacters(st,"race") == "5": HTML_MESSAGE += "<tr><td><button value=\"Kamael\" action=\"bypass -h Quest " +QUEST_INFO + " escraza 5\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br>" HTML_MESSAGE += "</table></td></tr></table></td></tr>" HTML_MESSAGE += "</center></body></html>" return HTML_MESSAGE def MainHtmlII(st) : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=250 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td></td></tr>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"0088EE\">Choose a subclass to Switch</font></td></tr>" HTML_MESSAGE += "<tr><td></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br><br>" HTML_MESSAGE += "<tr><td width=140 align=\"center\"><table width=140 border=0 bgcolor=444444><tr><td width=140 align=\"center\"><table width=135 border=0 bgcolor=444444>" temp = getVar(st,"currentsub"); j=-1 for i in range(maxsubsindb + 1): var = getVar(st,"subclassid"+str(i)) if int(var) >= 0 and int(var) <= 136: j+=1 if temp != str(i) and SubsNumber >= j: HTML_MESSAGE += "<tr><td><button value=\""+getclassname(st,var,"ClassName")+"\" action=\"bypass -h Quest " +QUEST_INFO + " camb "+str(i)+"\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br>" HTML_MESSAGE += "</table></td></tr></table></td></tr>" HTML_MESSAGE += "</center></body></html>" return HTML_MESSAGE def MainHtmlIII(st) : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=250 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td></td></tr>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"0088EE\">Choose the class you want to delete</font></td></tr>" HTML_MESSAGE += "<tr><td></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br><br>" HTML_MESSAGE += "<tr><td width=140 align=\"center\"><table width=140 border=0 bgcolor=444444><tr><td width=130 align=\"center\"><table width=135 border=0 bgcolor=444444>" j=-1 for i in range(maxsubsindb + 1): var = getVar(st,"subclassid"+str(i)) if int(var) >= 0 and int(var) <= 136: if i == 0 and AllowDelMainClass == False: pass else: j+=1 if SubsNumber >= j: HTML_MESSAGE += "<tr><td><button value=\""+getclassname(st,var,"ClassName")+"\" action=\"bypass -h Quest " +QUEST_INFO + " confirm "+str(i)+"\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><br>" HTML_MESSAGE += "</table></td></tr></table></td></tr>" HTML_MESSAGE += "</center></body></html>" return HTML_MESSAGE def MainHtmlIV(st,case) : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=250 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td></td></tr>" HTML_MESSAGE += generateRace(st,case) HTML_MESSAGE += "</center></body></html>" return HTML_MESSAGE def MainHtmlV(st) : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font><br>" HTML_MESSAGE += "<table width=260 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"LEVEL\">Confirmation</font></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=260 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td><br></td></tr>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF0000\">This option can be seen by GMs only and it<br1>allow to update any changes made in the<br1>script. You can disable this option in<br1>the settings section within the Script.<br><font color=\"LEVEL\">Do you want to update the SCRIPT?</font></font></td></tr>" HTML_MESSAGE += "<tr><td></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br><br>" HTML_MESSAGE += "<button value=\"Yes\" action=\"bypass -h Quest "+QUEST_INFO+" reloadscript 1\" width=50 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" HTML_MESSAGE += "<button value=\"No\" action=\"bypass -h Quest "+QUEST_INFO+" reloadscript 0\" width=50 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" HTML_MESSAGE += "</center></body></html>" return HTML_MESSAGE def generateRace(st,raceclass) : if raceclass == "0": HTML = "<tr><td align=\"center\"><font color=\"0088EE\">HUMAN</font></td></tr>" if raceclass == "1": HTML = "<tr><td align=\"center\"><font color=\"0088EE\">ELF</font></td></tr>" if raceclass == "2": HTML = "<tr><td align=\"center\"><font color=\"0088EE\">DARK ELF</font></td></tr>" if raceclass == "3": HTML = "<tr><td align=\"center\"><font color=\"0088EE\">ORC</font></td></tr>" if raceclass == "4": HTML = "<tr><td align=\"center\"><font color=\"0088EE\">DWARF</font></td></tr>" if raceclass == "5": HTML = "<tr><td align=\"center\"><font color=\"0088EE\">KAMAEL</font></td></tr>" HTML += "<tr><td></td></tr></table><br><img src=\"L2UI.SquareGray\" width=250 height=1><br>" if raceclass == "5": HTML += "<tr><td align=\"center\"><font color=\"0088EE\">Man Woman</font></td></tr>" elif raceclass == "4": HTML += "<tr><td align=\"center\"><font color=\"0088EE\">Figther</font></td></tr>" else: HTML += "<tr><td align=\"center\"><font color=\"0088EE\">Figther Mage</font></td></tr>" HTML += "<tr><td width=250 align=\"center\"><table width=240 border=0 bgcolor=444444><tr><td width=240 align=\"center\"><table width=235 border=0 bgcolor=444444><tr>" if raceclass == "0": HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"92"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 92\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"98"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 98\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"93"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 93\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"97"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 97\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"88"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 88\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"96"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 96\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"89"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 89\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"95"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 95\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"90"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 90\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"94"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 94\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"91"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 91\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" if raceclass == "1": HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"102"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 102\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"105"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 105\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"101"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 101\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"103"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 103\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"100"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 100\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"104"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 104\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"99"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 99\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" if raceclass == "2": HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"109"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 109\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"112"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 112\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"108"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 108\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"110"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 110\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"107"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 107\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"111"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 111\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"106"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 106\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" if raceclass == "3": HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"114"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 114\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"116"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 116\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"113"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 113\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"115"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 115\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" if raceclass == "4": HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"118"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 118\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"117"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 117\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" if raceclass == "5": HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"131"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 131\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"134"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 134\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"132"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 132\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" HTML += "<td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"133"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 133\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "<tr><td align=\"center\"><button value=\""+getclassname(st,getparentclass(st,"136"),"ClassName")+"\" action=\"bypass -h Quest " + QUEST_INFO + " confirm 136\" width=130 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>" HTML += "</table></td></tr></table></td></tr>" return HTML def Confirmation(st,case,case1,case2): HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font><br>" HTML_MESSAGE += "<table width=260 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"LEVEL\">Confirmation</font></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=260 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td><br><br></td></tr>" if int(case) == 1 : HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"0088EE\">Do you really want to add the<br1><font color=\"FFFF00\">"+getclassname(st,case1,"ClassName")+"</font> subclass?</td></tr>" if int(case) == 3 : HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"0088EE\">Do you really want to delete the<br1><font color=\"FFFF00\">"+getclassname(st,getVar(st,"subclassid"+case2),"ClassName")+"</font> subclass?</td></tr>" HTML_MESSAGE += "<tr><td></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br><br>" HTML_MESSAGE += "<button value=\"Yes\" action=\"bypass -h Quest "+QUEST_INFO+" "+case1+" "+case2+"\" width=50 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" HTML_MESSAGE += "<button value=\"No\" action=\"bypass -h Quest "+QUEST_INFO+" gethtml "+case+"\" width=50 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" HTML_MESSAGE += "</center></body></html>" return HTML_MESSAGE def complete(st) : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=250 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td><br><br></td></tr>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"0088EE\">Parabens</font></td></tr>" HTML_MESSAGE += "<tr><td></td></tr>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"0088EE\">Classe alterada com sucesso</font></td></tr>" HTML_MESSAGE += "<tr><td><br><br></td></tr></table><br>" HTML_MESSAGE += "<table width=250 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"0000FF\">Para completar sua Class<br1>voce tem que dar RESTART no jogo.</font></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1>" HTML_MESSAGE += "</center></body></html>" if getblocktime(st) == True : pass return HTML_MESSAGE def errasecomplete(st) : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=250 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td><br><br></td></tr>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"0088EE\">A classe que você escolheu foi Excluida</font></td></tr>" HTML_MESSAGE += "<tr><td><br><br></td></tr></table><br>" HTML_MESSAGE += "<table width=250 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"00FF00\">É aconselhável reiniciar o jogo</font></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1>" HTML_MESSAGE += "</center></body></html>" if getblocktime(st) == True : pass return HTML_MESSAGE def errordeclasse(st,case,case2) : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font><br>" HTML_MESSAGE += "<table width=260 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF5500\">Error</font></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=260 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td><br><br></td></tr>" if int(case) >= 88 : HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">You can't add <font color=\"FFFF00\">"+getclassname(st,case2,"ClassName")+"</font> subclass.<br1>Talk to a Grand Master and switch<br1>to the proper class first.</td></tr>" else: HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">You can't "+case2+" <font color=\"FFFF00\">"+getclassname(st,getVar(st,"subclassid"+case),"ClassName")+"</font><br1>subclass. Talk to a Grand Master and<br1>switch to the proper class first.</td></tr>" HTML_MESSAGE += "<tr><td><br><br></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1>" HTML_MESSAGE += "</center></body></html>" if getblocktime(st) == True : pass return HTML_MESSAGE def errordeduplicado(st,numero) : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font><br>" HTML_MESSAGE += "<table width=260 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF5500\">Error</font></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1><br>" HTML_MESSAGE += "<table width=260 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td><br><br></td></tr>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">You can't add <font color=\"FFFF00\">"+getclassname(st,numero,"ClassName")+"</font><br1>subclass. You already have this class.</td></tr>" HTML_MESSAGE += "<tr><td><br><br></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=250 height=1>" HTML_MESSAGE += "</center></body></html>" if getblocktime(st) == True : pass return HTML_MESSAGE def comunerrors(st,case) : HTML_MESSAGE = "<html><head><title>Subclass Master</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>" HTML_MESSAGE += "<font color=\"303030\">"+getmaster(st)+"</font><br>" HTML_MESSAGE += "<table width=260 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF5500\">Error</font></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=220 height=1><br>" HTML_MESSAGE += "<table width=220 border=0 bgcolor=444444>" HTML_MESSAGE += "<tr><td><br><br></td></tr>" if case == "0": HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">Voce nao tem os itens necessarios<br1>Consiga os Itens. e volte aqui novamente<br1>Este item : <font color=\"FFFF00\">"+str(Item2_Num)+" "+str(getitemname(st,Item2_Req))+".</font></td></tr>" if case == "1": HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">Você não tem os itens necessarios.<br1>You need <font color=\"FFFF00\">"+str(Item1_Num)+" "+str(getitemname(st,Item1_Req))+"</font></td></tr>" if case == "2": HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">Você não tem os itens necessarios<br1>You need <font color=\"FFFF00\">"+str(Item2_Num)+" "+str(getitemname(st,Item2_Req))+"</font></td></tr>" if case == "3": HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">Você não tem os itens necessarios<br1>You need <font color=\"FFFF00\">"+str(Item3_Num)+" "+str(getitemname(st,Item3_Req))+"</font></td></tr>" if case == "4": HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">You aren't eligible to add a<br1>subclass at this time.<br1>Your level must have <font color=\"FFFF00\">"+str(MinLevel)+" or above.</font></td></tr>" if case == "5": if AllowThirdJob == True: HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">You aren't eligible to do any action<br1>at this time. Your current ocupation<br1>must have <font color=\"FFFF00\">3rd Job</font></td></tr>" else: HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">You aren't eligible to do any action<br1>at this time. Your current ocupation<br1>must be <font color=\"FFFF00\">2nd or 3rd Job</font></td></tr>" if case == "6": HTML_MESSAGE += "<tr><td align=\"center\"><font color=\"FF7700\">You aren't eligible to add a<br1>subclass at this time.<br1>You must be a <font color=\"FFFF00\">Noblesse</font></td></tr>" HTML_MESSAGE += "<tr><td><br><br></td></tr></table><br>" HTML_MESSAGE += "<img src=\"L2UI.SquareGray\" width=220 height=1>" HTML_MESSAGE += "</center></body></html>" if getblocktime(st) == True : pass return HTML_MESSAGE def ReloadConfig(st) : try: if QuestManager.getInstance().reload(QuestId): st.player.sendMessage("The script and settings have been reloaded successfully.") else: st.player.sendMessage("Script Reloaded Failed. you edited something wrong! :P, fix it and restart the server") except: st.player.sendMessage("Script Reloaded Failed. you edited something wrong! :P, fix it and restart the server") return MainHtml(st) def getblocktime(st): if Block == True and not st.player.isGM() : endtime = int(System.currentTimeMillis()/1000) + BlockTime st.set("blockUntilTime",str(endtime)) st.getPlayer().sendPacket(SetupGauge(3, BlockTime * 1000 + 300)) val = True return val def getVar(st,const): conn=L2DatabaseFactory.getInstance().getConnection() act = conn.prepareStatement("SELECT * FROM subclass_list WHERE player_id="+getmultisubs(st)) rs=act.executeQuery() val = "-1" if rs : rs.next() try : val = rs.getString(const) conn.close() except : try : conn.close() except: pass return val def getsubsammount(st): j=-1 for i in range(maxsubsindb + 1): var = getVar(st,"subclassid"+str(i)) if int(var) >= 0 and int(var) <= 136: j+=1 return j def getVarcharacters(st,const): conn=L2DatabaseFactory.getInstance().getConnection() act = conn.prepareStatement("SELECT * FROM characters WHERE obj_Id="+str(st.getPlayer().getObjectId())) rs=act.executeQuery() val = "0" if rs : rs.next() try : val = rs.getString(const) conn.close() except : try : conn.close() except: pass return val def getVarcharactersubs(st): conn=L2DatabaseFactory.getInstance().getConnection() act = conn.prepareStatement("SELECT * FROM subclass_list WHERE player_id="+getmultisubs(st)) rs=act.executeQuery() val = "" if rs : rs.next() for i in range(maxsubsindb + 1): try : val += rs.getString("subclassid"+str(i)) + " " except : val += str(st.player.getClassId().getId()) + " " try : conn.close() except: pass val+= "-1" return val def getclassname(st,case1,case2): conn=L2DatabaseFactory.getInstance().getConnection() act = conn.prepareStatement("SELECT * FROM char_templates WHERE ClassId="+case1) rs=act.executeQuery() if rs : rs.next() try : val = rs.getString(case2) conn.close() except : val = "0" try : conn.close() except: pass else : val = "0" return val def getitemname(st,itemval): conn=L2DatabaseFactory.getInstance().getConnection() itemidList = conn.prepareStatement("SELECT * FROM custom_etcitem WHERE item_id="+str(itemval)) il=itemidList.executeQuery() if il : il.next() try : val = il.getString("name") conn.close() except : val = "0" try : conn.close() except: pass else : val = "0" return val def getparentclass(st,case): val=case if AllowThirdJob == False: conn=L2DatabaseFactory.getInstance().getConnection() parentid = conn.prepareStatement("SELECT * FROM class_list WHERE id = \""+case+"\"") pi=parentid.executeQuery() if pi : pi.next() try : val = pi.getString("parent_id") except : pass try : conn.close() except: pass return val def getmaxskilllevel(st,case): val= 0 com=L2DatabaseFactory.getInstance().getConnection() lvlskillid = com.prepareStatement("SELECT * FROM skill_trees WHERE skill_id = \""+case+"\" AND min_level <= \"85\" ORDER BY level DESC LIMIT 1") lvl=lvlskillid.executeQuery() if lvl : lvl.next() try : val = lvl.getInt("level") com.close() except : try : com.close() except: pass return val def getmultisubs(st): val= str(st.getPlayer().getObjectId()) + " LIMIT 1" if AllowMultiSubs == True: val= str(st.getPlayer().getObjectId()) +" AND sub_index=" + str(st.player.getClassIndex()) +" LIMIT 1" return val def getmaster(st): xi="class";xe="l";xf="e";xg="n";xa="B";xb="y";xc=" ";xd="A";xk="ter";xh="Sub";xj="Mas";val=xh+xi+xc+xj+xk+xc+xa+xb+xc+xd+xe+xe+xf+xg #val="Change Title here :P" return val def resetskills(st): parametros = "\"-1\""; j=-1 subs=getVarcharactersubs(st) SubSplit = subs.split(" ") for k in range(maxsubsindb + 1): conn=L2DatabaseFactory.getInstance().getConnection() if int(SubSplit[int(k)]) >= 0 and int(SubSplit[int(k)]) <= 136: j+=1 if int(SubSplit[int(k)]) >= 0 and int(SubSplit[int(k)]) <= 136 and SubsNumber >= j: xclassid = int(SubSplit[int(k)]) skillidList = conn.prepareStatement("SELECT * FROM class_list WHERE id = \""+str(xclassid)+"\"") sil=skillidList.executeQuery() while (sil.next()) : try : parametros+=",\"" +str(xclassid)+ "\"" xclassid = sil.getInt("parent_id") skillidList = conn.prepareStatement("SELECT * FROM class_list WHERE id = \""+str(xclassid)+"\"") sil=skillidList.executeQuery() except : pass try : conn.close() except : pass conn=L2DatabaseFactory.getInstance().getConnection() listskillid = conn.prepareStatement("SELECT * FROM skill_trees WHERE class_id IN ("+parametros+") AND min_level <= \"85\" ORDER BY skill_id DESC, level DESC") lis=listskillid.executeQuery() xskill = 0; cskill = 0; i=0 availableSkillsB = "" while (lis.next()) : try : xskill = lis.getInt("skill_id") if xskill != cskill : xlevel = lis.getInt("level") cskill = xskill i=i+1 availableSkillsB += str(xskill)+"_"+str(xlevel)+" " except : pass skills_exceptions = conn.prepareStatement("SELECT * FROM subclass_skill_exceptions WHERE class_id IN ("+parametros+") ORDER BY skill_id DESC, level DESC") se=skills_exceptions.executeQuery() while (se.next()) : try : xskill = se.getInt("skill_id") if xskill != cskill : xlevel = se.getInt("level") cskill = xskill i=i+1 availableSkillsB += str(xskill)+"_"+str(xlevel)+" " except : pass availableSkillsB+= "0_0" xvar="AND skill_id NOT BETWEEN \"1312\" AND \"1315\" AND skill_id NOT BETWEEN \"1368\" AND \"1372\"" if st.player.isGM(): xvar+=" AND skill_id NOT BETWEEN \"7029\" AND \"7064\"" listallskill = conn.prepareStatement("SELECT * FROM character_skills WHERE char_obj_Id =\""+str(st.player.getObjectId())+"\" AND class_index =\""+str(st.player.getClassIndex())+"\" "+xvar+"") las=listallskill.executeQuery() availableSkillsA = [] while (las.next()) : try : xskill = las.getInt("skill_id") xlevel = las.getInt("skill_level") availableSkillsA += [str(xskill)+"_"+str(xlevel)] except : pass try : conn.close() except : pass try: skillSplit = availableSkillsB.split(" ") for avSkillsA in availableSkillsA : j=0; temp=0 while j <= i: j=j+1 parametro = skillSplit[j-1].replace("_"," ") skillSplitB = parametro.split(" ") avSkillsA = avSkillsA.replace("_"," ") skillSplitA = avSkillsA.split(" ") if int(skillSplitB[0]) == int(skillSplitA[0]): temp=1 if int(skillSplitA[1]) < 100 : if int(skillSplitB[1]) < int(skillSplitA[1]): re = SkillTable.getInstance().getInfo(int(skillSplitA[0]), int(skillSplitA[1])) st.player.removeSkill(re) sk = SkillTable.getInstance().getInfo(int(skillSplitB[0]), int(skillSplitB[1])) st.player.addSkill(sk, True) st.player.sendMessage("You got fixed "+sk.getName()+" Skill.") else: if int(skillSplitB[1]) < getmaxskilllevel(st,skillSplitB[0]): re = SkillTable.getInstance().getInfo(int(skillSplitA[0]), int(skillSplitA[1])) st.player.removeSkill(re) sk = SkillTable.getInstance().getInfo(int(skillSplitB[0]), int(skillSplitB[1])) st.player.addSkill(sk, True) st.player.sendMessage("You got fixed "+sk.getName()+" Skill.") if temp == 0 : sk = SkillTable.getInstance().getInfo(int(skillSplitA[0]), int(skillSplitA[1])) st.player.removeSkill(sk) st.player.sendMessage("You got removed "+sk.getName()+" Skill.") except : st.player.sendMessage("You dont have skills to remove") st.player.sendSkillList() if st.player.isNoble(): st.player.setNoble(True) if st.player.isHero(): st.player.setHero(True) val=0 return val class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent(self,event,st): st.player.getStat().addExp(0) eventSplit = event.split(" ") event = eventSplit[0] eventParam1 = eventSplit[1] if event == "reloadscript": if eventParam1 == "1": return ReloadConfig(st) if eventParam1 == "0": return MainHtml(st) if event == "escraza": return MainHtmlIV(st,eventParam1) if event == "confirm": if int(eventParam1) >= 88: return Confirmation(st,"1",getparentclass(st,eventParam1),eventParam1) else: return Confirmation(st,"3","deletesub",eventParam1) if event == "gethtml": if eventParam1 == "1": if getVarcharacters(st,"race") == "5" and AllowAllSubsToKamael == False : return MainHtmlIV(st,"5") if AllowAllSubs == False : if AllowMutantRetail == False and st.player.isSubClassActive(): return MainHtmlIV(st,getclassname(st,str(st.player.getClassId().getId()),"RaceId")) else: return MainHtmlIV(st,getVarcharacters(st,"race")) else: return MainHtmlI(st) if eventParam1 == "2": return MainHtmlII(st) if eventParam1 == "3": return MainHtmlIII(st) return temp = getVar(st,"currentsub") temp2 = getVar(st,"sub_index") temp3 = str(st.player.getClassIndex()) temp4 = str(st.player.getClassId().getId()) if event == "camb": if temp2!=temp3: return errordeclasse(st,eventParam1,"switch to") elif st.getPlayer().getClassId().level() < 2 and AllowThirdJob == False or st.getPlayer().getClassId().level() < 3 and AllowThirdJob == True : return comunerrors(st,"5") elif st.getQuestItemsCount(Item1_Req) < Item1_Num and ReqItems == True: return comunerrors(st,"1") else: conn=L2DatabaseFactory.getInstance().getConnection() upd=conn.prepareStatement("UPDATE subclass_list SET subclassid"+temp+"="+temp4+", currentsub="+eventParam1+" WHERE player_id="+getmultisubs(st)) try : upd.executeUpdate() upd.close() conn.close() except : try : conn.close() except : pass if resetskills(st) == 1: pass st.player.setClassId(int(getVar(st,"subclassid"+eventParam1))) if not st.player.isSubClassActive(): st.player.setBaseClass(int(getVar(st,"subclassid"+eventParam1))) if ReqItems == True and not st.player.isGM(): st.takeItems(Item1_Req,Item1_Num) st.player.store() st.player.broadcastUserInfo() return complete(st) st.exitQuest(1) if event == "deletesub": if temp2!=temp3: return errordeclasse(st,eventParam1,"delete the") elif st.getPlayer().getClassId().level() < 2 and AllowThirdJob == False or st.getPlayer().getClassId().level() < 3 and AllowThirdJob == True : return comunerrors(st,"5") elif st.getQuestItemsCount(Item3_Req) < Item3_Num and ReqItems == True and not st.player.isGM() : return comunerrors(st,"3") else: conn=L2DatabaseFactory.getInstance().getConnection() upd=conn.prepareStatement("UPDATE subclass_list SET subclassid"+temp+"="+temp4+", currentsub="+temp+" WHERE player_id="+getmultisubs(st)) try : upd.executeUpdate() upd.close() conn.close() except : try : conn.close() except : pass if eventParam1 == temp and getsubsammount(st) > 0: j=0 for i in range(maxsubsindb + 1): var = getVar(st,"subclassid"+str(i)) if int(var) >= 0 and int(var) <= 136 and j == 0 and str(i) != temp: j+=1; idsubclass = var; temp=str(i) st.player.setClassId(int(idsubclass)) if not st.player.isSubClassActive(): st.player.setBaseClass(int(idsubclass)) con=L2DatabaseFactory.getInstance().getConnection() if getsubsammount(st) <= 1: rem=con.prepareStatement("DELETE FROM subclass_list WHERE player_id="+getmultisubs(st)) else: rem = con.prepareStatement("UPDATE subclass_list SET subclassid"+eventParam1+"=-1 ,currentsub="+temp+" WHERE player_id="+getmultisubs(st)) try : rem.executeUpdate() except : pass try : con.close() except : pass if resetskills(st) == 1: pass if ReqItems == True and not st.player.isGM(): st.takeItems(Item3_Req,Item3_Num) st.player.store() st.player.broadcastUserInfo() return errasecomplete(st) st.exitQuest(1) else: if temp2!=temp3 and getsubsammount(st) >= 0 : return errordeclasse(st,eventParam1,event) elif AllowOnlyNobles == True and not st.player.isGM() : if not st.player.isNoble() : return comunerrors(st,"6") elif st.getQuestItemsCount(Item2_Req) < Item2_Num and ReqItems == True and not st.player.isGM() : return comunerrors(st,"2") elif st.getPlayer().getLevel() < MinLevel and not st.player.isGM() : return comunerrors(st,"4") elif st.getPlayer().getClassId().level() < 2 and AllowThirdJob == False or st.getPlayer().getClassId().level() < 3 and AllowThirdJob == True : return comunerrors(st,"5") else: if temp4 == eventParam1 or temp4 == event: return errordeduplicado(st,event) else: con=L2DatabaseFactory.getInstance().getConnection() if getsubsammount(st) == -1 : ins = con.prepareStatement("INSERT INTO subclass_list (player_id,currentsub,sub_index,subclassid0,subclassid1) VALUES (?,?,?,?,?)") ins.setString(1, str(st.player.getObjectId())) ins.setString(2, "1") ins.setString(3, str(st.player.getClassIndex())) ins.setString(4, temp4) ins.setString(5, event) else: temp6 = "-1"; j=0 for i in range(maxsubsindb + 1): var = getVar(st,"subclassid"+str(i)) if var == eventParam1 or var == event: return errordeduplicado(st,event) if int(var) < 0 or int(var) > 136: if temp6 == "-1" and j==0: j+=1 temp6 = str(i) ins = con.prepareStatement("UPDATE subclass_list SET subclassid"+temp6+"="+event+", subclassid"+temp+"="+temp4+", currentsub="+temp6+" WHERE player_id="+getmultisubs(st)) try : ins.executeUpdate() ins.close() con.close() except : pass if resetskills(st) == 1: pass if ReqItems == True and not st.player.isGM() : st.takeItems(Item2_Req,Item2_Num) if DecLevel == True and not st.player.isGM() : pXp = st.player.getExp() tXp = Experience.LEVEL[NewLevel] if pXp > tXp: st.player.removeExpAndSp(pXp - tXp, 0) st.player.setClassId(int(event)) if not st.player.isSubClassActive(): st.player.setBaseClass(int(event)) st.player.store() st.player.broadcastUserInfo() return complete(st) st.exitQuest(1) def onFirstTalk (self,npc,player): st = player.getQuestState(QUEST_INFO) if not st : st = self.newQuestState(player) if player.isGM(): if ShowReloadScriptPanel == True: return MainHtmlV(st) else: return MainHtml(st) elif int(System.currentTimeMillis()/1000) > st.getInt("blockUntilTime"):return MainHtml(st) else: return QUEST = Quest(QuestId,QUEST_INFO,QuestDesc) for npcId in NPC: QUEST.addStartNpc(npcId) QUEST.addFirstTalkId(npcId) QUEST.addTalkId(npcId) anybody? @Allengc maybe can help me? please? -
Code FEATURE - Droplist Dashboard (Shift + Click)
heladito replied to StinkyMadness's topic in Server Shares & Files [L2J]
good -
Code ZONE - Raidboss Zone Limit
heladito replied to StinkyMadness's topic in Server Shares & Files [L2J]
as -
Help Error loguinserver/gameserver JFrozen
heladito posted a question in Request Server Development Help [L2J]
hi guys! anyone can help me with this? its giving me an error and i dont know why. -
Help error hidden drop event [Jfrozen 1132]
heladito replied to heladito's question in Request Server Development Help [L2J]
this is the say2.java /* * L2jFrozen Project - www.l2jfrozen.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */ package com.l2jfrozen.gameserver.network.clientpackets; import java.nio.BufferUnderflowException; import java.util.Collection; import java.util.StringTokenizer; import java.util.logging.Level; import java.util.logging.LogRecord; import org.apache.log4j.Logger; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.datatables.csv.MapRegionTable; import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler; import com.l2jfrozen.gameserver.handler.VoicedCommandHandler; import com.l2jfrozen.gameserver.managers.PetitionManager; import com.l2jfrozen.gameserver.model.L2Character; import com.l2jfrozen.gameserver.model.L2Object; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.PunishLevel; import com.l2jfrozen.gameserver.network.SystemChatChannelId; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay; import com.l2jfrozen.gameserver.network.serverpackets.SocialAction; import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage; import com.l2jfrozen.gameserver.powerpak.PowerPak; import com.l2jfrozen.gameserver.powerpak.PowerPakConfig; import com.l2jfrozen.gameserver.util.Util; public final class Say2 extends L2GameClientPacket { private static Logger LOGGER = Logger.getLogger(Say2.class); private static java.util.logging.Logger _logChat = java.util.logging.Logger.getLogger("chat"); public final static int ALL = 0; public final static int SHOUT = 1; // ! public final static int TELL = 2; public final static int PARTY = 3; // # public final static int CLAN = 4; // @ public final static int GM = 5; // //gmchat public final static int PETITION_PLAYER = 6; // used for petition public final static int PETITION_GM = 7; // * used for petition public final static int TRADE = 8; // + public final static int ALLIANCE = 9; // $ public final static int ANNOUNCEMENT = 10; // //announce public final static int PARTYROOM_ALL = 16; // (Red) public final static int PARTYROOM_COMMANDER = 15; // (Yellow) public final static int HERO_VOICE = 17; // % public final static int CRITICAL_ANNOUNCE = 18; private final static String[] CHAT_NAMES = { "ALL ", "SHOUT", "TELL ", "PARTY", "CLAN ", "GM ", "PETITION_PLAYER", "PETITION_GM", "TRADE", "ALLIANCE", "ANNOUNCEMENT", // 10 "WILLCRASHCLIENT:)", "FAKEALL?", "FAKEALL?", "FAKEALL?", "PARTYROOM_ALL", "PARTYROOM_COMMANDER", "CRITICAL_ANNOUNCE", "HERO_VOICE" }; private String _text; private int _type; private SystemChatChannelId _type2Check; private String _target; @Override protected void readImpl() { _text = readS(); try { _type = readD(); _type2Check = SystemChatChannelId.getChatType(_type); } catch (final BufferUnderflowException e) { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); _type = CHAT_NAMES.length; _type2Check = SystemChatChannelId.CHAT_NONE; } _target = _type == TELL ? readS() : null; } @Override protected void runImpl() { if (Config.DEBUG) { LOGGER.info("Say2: Msg Type = '" + _type + "' Text = '" + _text + "'."); } if (_type < 0 || _type >= CHAT_NAMES.length) { LOGGER.warn("Say2: Invalid type: " + _type); return; } final L2PcInstance activeChar = getClient().getActiveChar(); // Anti-PHX Announce if (_type2Check == SystemChatChannelId.CHAT_NONE || _type2Check == SystemChatChannelId.CHAT_ANNOUNCE || _type2Check == SystemChatChannelId.CHAT_CRITICAL_ANNOUNCE || _type2Check == SystemChatChannelId.CHAT_SYSTEM || _type2Check == SystemChatChannelId.CHAT_CUSTOM || (_type2Check == SystemChatChannelId.CHAT_GM_PET && !activeChar.isGM())) { LOGGER.warn("[Anti-PHX Announce] Illegal Chat ( " + _type2Check + " ) channel was used by character: [" + activeChar.getName() + "]"); return; } if (activeChar == null) { LOGGER.warn("[Say2.java] Active Character is null."); return; } if (activeChar.isChatBanned() && !activeChar.isGM() && _type != CLAN && _type != ALLIANCE && _type != PARTY) { activeChar.sendMessage("You may not chat while a chat ban is in effect."); return; } if (activeChar.isInJail() && Config.JAIL_DISABLE_CHAT) { if (_type == TELL || _type == SHOUT || _type == TRADE || _type == HERO_VOICE) { activeChar.sendMessage("You can not chat with players outside of the jail."); return; } } if (!getClient().getFloodProtectors().getSayAction().tryPerformAction("Say2")) { activeChar.sendMessage("You cannot speak too fast."); return; } if (activeChar.isCursedWeaponEquiped() && (_type == TRADE || _type == SHOUT)) { activeChar.sendMessage("Shout and trade chatting cannot be used while possessing a cursed weapon."); return; } if (_type == PETITION_PLAYER && activeChar.isGM()) { _type = PETITION_GM; } if (_text.length() > Config.MAX_CHAT_LENGTH) { if (Config.DEBUG) { LOGGER.info("Say2: Msg Type = '" + _type + "' Text length more than " + Config.MAX_CHAT_LENGTH + " truncate them."); } _text = _text.substring(0, Config.MAX_CHAT_LENGTH); // return; } if (Config.LOG_CHAT) { final LogRecord record = new LogRecord(Level.INFO, _text); record.setLoggerName("chat"); if (_type == TELL) { record.setParameters(new Object[] { CHAT_NAMES[_type], "[" + activeChar.getName() + " to " + _target + "]" }); } else { record.setParameters(new Object[] { CHAT_NAMES[_type], "[" + activeChar.getName() + "]" }); } _logChat.log(record); } if (Config.L2WALKER_PROTEC && _type == TELL && checkBot(_text)) { Util.handleIllegalPlayerAction(activeChar, "Client Emulator Detect: Player " + activeChar.getName() + " using l2walker.", Config.DEFAULT_PUNISH); return; } _text = _text.replaceAll("\\\\n", ""); // Say Filter implementation if (Config.USE_SAY_FILTER) { checkText(activeChar); } if (PowerPakConfig.ENABLE_SAY_SOCIAL_ACTIONS && !activeChar.isAlikeDead() && !activeChar.isDead()) { if ((_text.equalsIgnoreCase("hello") || _text.equalsIgnoreCase("hey") || _text.equalsIgnoreCase("aloha") || _text.equalsIgnoreCase("alo") || _text.equalsIgnoreCase("ciao") || _text.equalsIgnoreCase("hi")) && (!activeChar.isRunning() || !activeChar.isAttackingNow() || !activeChar.isCastingNow() || !activeChar.isCastingPotionNow())) activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 2)); if ((_text.equalsIgnoreCase("lol") || _text.equalsIgnoreCase("haha") || _text.equalsIgnoreCase("xaxa") || _text.equalsIgnoreCase("ghgh") || _text.equalsIgnoreCase("jaja")) && (!activeChar.isRunning() || !activeChar.isAttackingNow() || !activeChar.isCastingNow() || !activeChar.isCastingPotionNow())) activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 10)); if ((_text.equalsIgnoreCase("yes") || _text.equalsIgnoreCase("si") || _text.equalsIgnoreCase("yep")) && (!activeChar.isRunning() || !activeChar.isAttackingNow() || !activeChar.isCastingNow() || !activeChar.isCastingPotionNow())) activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 6)); if ((_text.equalsIgnoreCase("no") || _text.equalsIgnoreCase("nop") || _text.equalsIgnoreCase("nope")) && (!activeChar.isRunning() || !activeChar.isAttackingNow() || !activeChar.isCastingNow() || !activeChar.isCastingPotionNow())) activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 5)); } // by Azagthtot PowerPak.getInstance().chatHandler(activeChar, _type, _text); // CreatureSay cs = new CreatureSay(activeChar.getObjectId(),_type, activeChar.getName(), _text); final L2Object saymode = activeChar.getSayMode(); if (saymode != null) { final String name = saymode.getName(); final int actor = saymode.getObjectId(); _type = 0; final Collection<L2Object> list = saymode.getKnownList().getKnownObjects().values(); final CreatureSay cs = new CreatureSay(actor, _type, name, _text); for (final L2Object obj : list) { if (obj == null || !(obj instanceof L2Character)) { continue; } final L2Character chara = (L2Character) obj; chara.sendPacket(cs); } return; } final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), _type, activeChar.getName(), _text); switch (_type) { case TELL: final L2PcInstance receiver = L2World.getInstance().getPlayer(_target); if (receiver == null) { SystemMessage sm = new SystemMessage(SystemMessageId.S1_IS_NOT_ONLINE); sm.addString(_target); activeChar.sendPacket(sm); sm = null; return; } if (!receiver.getBlockList().isInBlockList(activeChar.getName()) || activeChar.isGM()) { if (receiver.isAway()) { activeChar.sendMessage("Player is Away try again later."); } if (Config.JAIL_DISABLE_CHAT && receiver.isInJail()) { activeChar.sendMessage("Player is in jail."); return; } if (receiver.isChatBanned() && !activeChar.isGM()) { activeChar.sendMessage("Player is chat banned."); return; } if (receiver.isInOfflineMode()) { activeChar.sendMessage("Player is in offline mode."); return; } if (!receiver.getMessageRefusal()) { receiver.sendPacket(cs); activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), _type, "->" + receiver.getName(), _text)); } else { activeChar.sendPacket(new SystemMessage(SystemMessageId.THE_PERSON_IS_IN_MESSAGE_REFUSAL_MODE)); } } else if (receiver.getBlockList().isInBlockList(activeChar.getName())) { SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_ADDED_YOU_TO_IGNORE_LIST); sm.addString(_target); activeChar.sendPacket(sm); sm = null; } break; case SHOUT: // Flood protect Say if (!getClient().getFloodProtectors().getGlobalChat().tryPerformAction("global chat")) return; if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.isGM()) { if (Config.GLOBAL_CHAT_WITH_PVP) { if ((activeChar.getPvpKills() < Config.GLOBAL_PVP_AMOUNT) && !activeChar.isGM()) { activeChar.sendMessage("You must have at least " + Config.GLOBAL_PVP_AMOUNT + " pvp kills in order to speak in global chat"); return; } final int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY()); for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { if (region == MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY())) { // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } } else { final int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY()); for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { if (region == MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY())) { // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } } } else if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("GLOBAL")) { if (Config.GLOBAL_CHAT_WITH_PVP) { if ((activeChar.getPvpKills() < Config.GLOBAL_PVP_AMOUNT) && !activeChar.isGM()) { activeChar.sendMessage("You must have at least " + Config.GLOBAL_PVP_AMOUNT + " pvp kills in order to speak in global chat"); return; } for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } else { for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } } break; case TRADE: if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("ON")) { if (Config.TRADE_CHAT_WITH_PVP) { if ((activeChar.getPvpKills() <= Config.TRADE_PVP_AMOUNT) && !activeChar.isGM()) { activeChar.sendMessage("You must have at least " + Config.TRADE_PVP_AMOUNT + " pvp kills in order to speak in trade chat"); return; } for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } else { for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } } else if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("limited")) { if (Config.TRADE_CHAT_WITH_PVP) { if ((activeChar.getPvpKills() <= Config.TRADE_PVP_AMOUNT) && !activeChar.isGM()) { activeChar.sendMessage("You must have at least " + Config.TRADE_PVP_AMOUNT + " pvp kills in order to speak in trade chat"); return; } final int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY()); for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { if (region == MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY())) { // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } } else if (Config.TRADE_CHAT_IS_NOOBLE) { if (!activeChar.isNoble() && !activeChar.isGM()) { activeChar.sendMessage("Only Nobless Players Can Use This Chat"); return; } final int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY()); for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { if (region == MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY())) { // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } } else { final int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY()); for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { if (region == MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY())) { // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } } } break; case ALL: if (_text.startsWith(".")) { final StringTokenizer st = new StringTokenizer(_text); IVoicedCommandHandler vch; String command = ""; String target = ""; if (st.countTokens() > 1) { command = st.nextToken().substring(1); target = _text.substring(command.length() + 2); vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(command); } else { command = _text.substring(1); if (Config.DEBUG) { LOGGER.info("Command: " + command); } vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(command); } if (vch != null) { vch.useVoicedCommand(command, activeChar, target); break; } } for (final L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values()) { if (player != null && activeChar.isInsideRadius(player, 1250, false, true)) { // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } activeChar.sendPacket(cs); break; case CLAN: if (activeChar.getClan() != null) { activeChar.getClan().broadcastToOnlineMembers(cs); } break; case ALLIANCE: if (activeChar.getClan() != null) { activeChar.getClan().broadcastToOnlineAllyMembers(cs); } break; case PARTY: if (activeChar.isInParty()) { activeChar.getParty().broadcastToPartyMembers(cs); } break; case PETITION_PLAYER: case PETITION_GM: if (!PetitionManager.getInstance().isPlayerInConsultation(activeChar)) { activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_ARE_NOT_IN_PETITION_CHAT)); break; } PetitionManager.getInstance().sendActivePetitionMessage(activeChar, _text); break; case PARTYROOM_ALL: if (activeChar.isInParty()) { if (activeChar.getParty().isInCommandChannel() && activeChar.getParty().isLeader(activeChar)) { activeChar.getParty().getCommandChannel().broadcastCSToChannelMembers(cs, activeChar); } } break; case PARTYROOM_COMMANDER: if (activeChar.isInParty()) { if (activeChar.getParty().isInCommandChannel() && activeChar.getParty().getCommandChannel().getChannelLeader().equals(activeChar)) { activeChar.getParty().getCommandChannel().broadcastCSToChannelMembers(cs, activeChar); } } break; case HERO_VOICE: if (activeChar.isGM()) { for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { if (player == null) continue; player.sendPacket(cs); } } else if (activeChar.isHero()) { // Flood protect Hero Voice if (!getClient().getFloodProtectors().getHeroVoice().tryPerformAction("hero voice")) return; for (final L2PcInstance player : L2World.getInstance().getAllPlayers()) { if (player == null) continue; // Like L2OFF if player is blocked can't read the message if (!player.getBlockList().isInBlockList(activeChar.getName())) player.sendPacket(cs); } } break; } } private static final String[] WALKER_COMMAND_LIST = { "USESKILL", "USEITEM", "BUYITEM", "SELLITEM", "SAVEITEM", "LOADITEM", "MSG", "SET", "DELAY", "LABEL", "JMP", "CALL", "RETURN", "MOVETO", "NPCSEL", "NPCDLG", "DLGSEL", "CHARSTATUS", "POSOUTRANGE", "POSINRANGE", "GOHOME", "SAY", "EXIT", "PAUSE", "STRINDLG", "STRNOTINDLG", "CHANGEWAITTYPE", "FORCEATTACK", "ISMEMBER", "REQUESTJOINPARTY", "REQUESTOUTPARTY", "QUITPARTY", "MEMBERSTATUS", "CHARBUFFS", "ITEMCOUNT", "FOLLOWTELEPORT" }; private boolean checkBot(final String text) { for (final String botCommand : WALKER_COMMAND_LIST) { if (text.startsWith(botCommand)) return true; } return false; } private void checkText(final L2PcInstance activeChar) { if (Config.USE_SAY_FILTER) { String filteredText = _text.toLowerCase(); for (final String pattern : Config.FILTER_LIST) { filteredText = filteredText.replaceAll("(?i)" + pattern, Config.CHAT_FILTER_CHARS); } if (!filteredText.equalsIgnoreCase(_text)) { if (Config.CHAT_FILTER_PUNISHMENT.equalsIgnoreCase("chat")) { activeChar.setPunishLevel(PunishLevel.CHAT, Config.CHAT_FILTER_PUNISHMENT_PARAM1); activeChar.sendMessage("Administrator banned you chat from " + Config.CHAT_FILTER_PUNISHMENT_PARAM1 + " minutes"); } else if (Config.CHAT_FILTER_PUNISHMENT.equalsIgnoreCase("karma")) { activeChar.setKarma(Config.CHAT_FILTER_PUNISHMENT_PARAM2); activeChar.sendMessage("You have get " + Config.CHAT_FILTER_PUNISHMENT_PARAM2 + " karma for bad words"); } else if (Config.CHAT_FILTER_PUNISHMENT.equalsIgnoreCase("jail")) { activeChar.setPunishLevel(PunishLevel.JAIL, Config.CHAT_FILTER_PUNISHMENT_PARAM1); } activeChar.sendMessage("The word " + _text + " is not allowed!"); _text = filteredText; } } } @Override public String getType() { return "[C] 38 Say2"; } }- 7 replies
-
- help
- hidden drop
-
(and 2 more)
Tagged with:
-
Help error hidden drop event [Jfrozen 1132]
heladito replied to heladito's question in Request Server Development Help [L2J]
this is may say2.java- 7 replies
-
- help
- hidden drop
-
(and 2 more)
Tagged with:
-
Help error hidden drop event [Jfrozen 1132]
heladito replied to heladito's question in Request Server Development Help [L2J]
that its the error only. i put too the full code. So, u say its not declared in say2? how to do it? can show me? please- 7 replies
-
- help
- hidden drop
-
(and 2 more)
Tagged with:
-
Help error hidden drop event [Jfrozen 1132]
heladito posted a question in Request Server Development Help [L2J]
hi! i added this code but its giving me a little error in this line of L2PcInstance.java the full code Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/L2PcInstance.java ========================================================================================================= --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/L2PcInstance.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/L2PcInstance.java import com.l2jfrozen.gameserver.model.entity.event.CTF; import com.l2jfrozen.gameserver.model.entity.event.DM; +/** Hide Event */ +import com.l2jfrozen.gameserver.model.entity.event.Hide; import com.l2jfrozen.util.database.L2DatabaseFactory; import com.l2jfrozen.util.random.Rnd; +/** hide event */ +import com.l2jfrozen.gameserver.network.clientpackets.Say2; if (target.getItemLootShedule() != null && (target.getOwnerId() == getObjectId() || isInLooterParty(target.getOwnerId()))) { target.resetOwnerTimer(); } + + if(target.isHide()) + { + + getInventory().addItem("", Hide.rewardId, Hide.rewardCount, this, null); + sendPacket(new InventoryUpdate()); + sendMessage("You won the event!"); + Hide.cleanEvent(); + Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Winner is: "+getName()+". Event ended.")); + target.setHide(false); + System.out.println("Automatic Hide Event finished with success."); + return; + } + // Fixed it's not possible pick up the object if you exceed the maximum weight. if (_inventory.getTotalWeight() + target.getItem().getWeight() * target.getCount() > getMaxLoad()) { sendMessage("You have reached the maximun weight."); return; } Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java ============================================================================================================ --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWho; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminZone; +/** Hide Event */ +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminGoHide; registerAdminCommandHandler(new AdminBuffs()); registerAdminCommandHandler(new AdminAio()); + /** Hide Event */ + registerAdminCommandHandler(new AdminGoHide()); Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/admincommandhandler/AdminGoHide.java ======================================================================================================================= --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/admincommandhandler/AdminGoHide.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/handler/admincommandhandler/AdminGoHide.java +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * http://www.gnu.org/copyleft/gpl.html + */ +package com.l2jfrozen.gameserver.handler.admincommandhandlers; + +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler; +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.model.entity.event.Hide; + +/** + * + * @author Iracundus ( Remaded Sakretsos ) + */ +public class AdminGoHide implements IAdminCommandHandler +{ + + private static String[] ADMIN_COMMANDS = {"admin_gohide"}; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + if(command.startsWith("admin_gohide")){ + if(activeChar == null) + return false; + + if(Hide.running == false){ + activeChar.sendMessage("Event is not in progress"); + return false; + } + + int x = Hide.getX() , y = Hide.getY() , z = Hide.getZ(); + activeChar.teleToLocation(x, y, z); + } + + return true; + } + + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } + +} Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ItemInstance.java =================================================================================================================== --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ItemInstance.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ItemInstance.java /** Location of the item : Inventory, PaperDoll, WareHouse. */ private ItemLocation _loc; /** Slot where item is stored. */ private int _locData; + + /** Hide Event */ + private boolean hide; if(Config.LOG_ITEMS) { LogRecord record = new LogRecord(Level.INFO, "CHANGE:" + process); record.setLoggerName("item"); record.setParameters(new Object[] { this, creator, reference }); _logItems.log(record); record = null; } } + + /** Hide Event */ + public boolean isHide() + { + return hide; + } + + public void setHide(boolean j) + { + hide = j; + } + Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/event/Hide.java ======================================================================================================= --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/event/Hide.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/model/entity/event/Hide.java +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * http://www.gnu.org/copyleft/gpl.html + */ +package com.l2jfrozen.gameserver.model.entity.event; + +import com.l2jfrozen.Config; +import com.l2jfrozen.gameserver.thread.ThreadPoolManager; +import com.l2jfrozen.gameserver.network.clientpackets.Say2; +import com.l2jfrozen.gameserver.network.SystemMessageId; +import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay; +import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage; +import com.l2jfrozen.gameserver.util.Broadcast; +import com.l2jfrozen.util.random.Rnd; +import com.l2jfrozen.gameserver.model.L2World; +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; + +public class Hide{ + + public static final int rewardId = (Config.HIDE_EVENT_REWARD_ID); + public static final int rewardCount = (Config.HIDE_EVENT_REWARD_COUNT); + private static Hide _instance; + private final int delay = (Config.HIDE_EVENT_DELAY_BEFORE_START); + private final static int itemId = (Config.HIDE_EVENT_ITEM_WILL_DROP); + private final static int itemCount = 1; + public static boolean running = false; + private static int x; + private static int y; + private static int z = 0; + private final int[][] teleports = { {116496,145020,-2569} , {18605,145378,-3129} , {-83083,150505,-3134} }; + static L2ItemInstance item = null; + + public static int getX(){ + return x; + } + + public static int getY(){ + return y; + } + + public static int getZ(){ + return z; + } + + public static int getItemId(){ + return itemId; + } + + public static int getItemCount(){ + return itemCount; + } + + public void startEvent(){ + running = true; + System.out.println("Automatic Hide Event started with success."); + int s = Rnd.get(teleports.length); + x = teleports[s][0]; + y = teleports[s][1]; + z = teleports[s][2]; + SystemMessage sm = new SystemMessage(SystemMessageId.S2_WAS_DROPPED_IN_THE_S1_REGION); + sm.addZoneName(getX(), getY(), getZ()); + sm.addItemName(itemId); + item = new L2ItemInstance(Rnd.get(65535),itemId); + L2World.getInstance().storeObject(item); + item.setCount(itemCount); + item.setHide(true); + item.getPosition().setWorldPosition(x, y ,z); + item.getPosition().setWorldRegion(L2World.getInstance().getRegion(item.getPosition().getWorldPosition())); + item.getPosition().getWorldRegion().addVisibleObject(item); + item.setProtected(false); + item.setIsVisible(true); + L2World.getInstance().addVisibleObject(item, item.getPosition().getWorldRegion(), null); + + + + Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Event started, Item dropped: "+item.getItem().getName()+", find it and win!")); + Broadcast.toAllOnlinePlayers(sm); + ThreadPoolManager.getInstance().scheduleGeneral(new Check(), 60000); + } + + public void checkAfterTime(){ + if(running == false) + return; + if(item.isHide()) + item.setHide(false); + item.decayMe(); + L2World.getInstance().removeObject(item); + cleanEvent(); + Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Unfortunately, None find the item, event finished!")); + System.out.println("Automatic Hide event finished with success."); + } + + public static void cleanEvent(){ + x = 0; + y = 0; + z = 0; + running = false; + if(item != null){ + item.decayMe(); + L2World.getInstance().removeObject(item); + } + item = null; + } + + private Hide(){ + ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Event(), delay, delay); + System.out.println("Automatic Hide Event aboarded with success."); + } + + public static Hide getInstance(){ + if(_instance == null) + _instance = new Hide(); + return _instance; + } + + public class Check implements Runnable{ + @Override + public void run(){ + checkAfterTime(); + } + } + public class Event implements Runnable{ + @Override + public void run(){ + startEvent(); + } + } +} Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/GameServer.java ========================================================================================== --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/GameServer.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/gameserver/GameServer.java import com.l2jfrozen.gameserver.model.entity.Hero; import com.l2jfrozen.gameserver.model.entity.MonsterRace; +import com.l2jfrozen.gameserver.model.entity.event.Hide; CursedWeaponsManager.getInstance(); TaskManager.getInstance(); + /** Hide Event */ + if (Config.HIDE_EVENT) + { + Hide.getInstance(); + } Index: C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java =========================================================================== --- C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java +++ C:/Workspace/L2jFrozen_GameServer/head-src/com/l2jfrozen/Config.java public static String PVP1_CUSTOM_MESSAGE; public static String PVP2_CUSTOM_MESSAGE; + /** Hide Event Enabled */ + public static boolean HIDE_EVENT; + public static int HIDE_EVENT_REWARD_ID; + public static int HIDE_EVENT_REWARD_COUNT; + public static int HIDE_EVENT_ITEM_WILL_DROP; + public static int HIDE_EVENT_DELAY_BEFORE_START; + PVP1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!"); PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!"); + /** Hide Event */ + HIDE_EVENT = Boolean.parseBoolean(L2JFrozenSettings.getProperty("HideEvent", "false")); + HIDE_EVENT_REWARD_ID = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventRewardId", "2807")); + HIDE_EVENT_REWARD_COUNT = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventRewardCount", "1")); + HIDE_EVENT_ITEM_WILL_DROP = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventItemWillDrop", "2807")); + HIDE_EVENT_DELAY_BEFORE_START = Integer.parseInt(L2JFrozenSettings.getProperty("HideEventDelayBeforeStart", "180000")); + Index: C:/Workspace/L2jFrozen_GameServer/config/functions/l2jfrozen.properties ============================================================================== --- C:/Workspace/L2jFrozen_GameServer/config/functions/l2jfrozen.properties +++ C:/Workspace/L2jFrozen_GameServer/config/functions/l2jfrozen.properties + +# ----------------------------------------- +# Hide Event - +# ----------------------------------------- +# Default = False +HideEvent = True +HideEventRewardId = 2807 +HideEventRewardCount = 20 +HideEventItemWillDrop = 6579 +#Hide Event Start Every ( 180000 Milliseconds ) +#Milliseconds ( 180000 milliseconds = 180 seconds ) +HideEventDelayBeforeStart = 18000 and this is the line of error Broadcast.toAllOnlinePlayers(new CreatureSay(0,Say2.ANNOUNCEMENT,"Hide Event","Winner is: "+getName()+". Event ended.")); Anyone can help me with this? :(- 7 replies
-
- help
- hidden drop
-
(and 2 more)
Tagged with:
-
Help Event Last Hero (acis to Frozen)
heladito posted a question in Request Server Development Help [L2J]
hello, could anyone help me adapt this event (last hero) from acis to frozen last revision? I changed the imports but it gives me error in this line Traceback (innermost last): File "__init__.py", line 4, in ? ImportError: cannot import name DoorTable This its the ORIGINAL CODE import sys from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.datatables import DoorTable from net.sf.l2j.gameserver.datatables import SkillTable from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest from net.sf.l2j.gameserver import Announcements from net.sf.l2j import L2DatabaseFactory from net.sf.l2j.gameserver.ai import CtrlIntention from net.sf.l2j.util import Rnd from java.lang import System from net.sf.l2j.gameserver.model import L2World from net.sf.l2j.gameserver.handler.voicedcommandhandlers import castle from net.sf.l2j.gameserver.model.entity import Castle from net.sf.l2j.gameserver.datatables import ClanTable from net.sf.l2j import L2DatabaseFactory from net.sf.l2j import * from net.sf.l2j import L2DatabaseFactory qn = "10000_hero" # ======================================= # НЕ ТРОГАЕМ # ======================================= res_timer=0 checkoffline = 0 npc1=0 npc2=0 anom = 5 TEAM1 = [] TEAM2 = [] attacked = 0 annom = 1 TEAM1DAMAGE=0 TEAM2DAMAGE=0 t2 =[-48923,248266,-9991] items = "ems" myk = "ip" t3 =[-48923,248266,-9991] t4 =[-48923,248266,-9991] BASE1 = 31520 BASE2 = 31520 com1 = "NONE" heroes = "om" mobss = "monsters" RES_TIME = 1 PENI = 0 PENI_KOL = 0 com2 = "NONE" hero = "lete" X_MIN = -251431 X_MAX = -251431 mob = "min" Y_MIN = 218088 Y_MAX = 218088 # ======================================= # CONFIG # ======================================= NAME = "Last Hero" # Название (только английские символы) LOC = "Goddard" # Место, где вы поставили регистрирующего НПЦ. REGISTER = 31805 # Регистрирующий нпц. НЕ ЗАБЫВАЕМ ДЕЛАТЬ ЕГО БЕССМЕРТНЫМ. locr = [147728,-55584,-2735] # Соответственно координаты, где будет появляться НПЦ loct = [147680,-56252,-2782] # Координаты для возвращение команды/игрока после окончание евента/выбывание из евента. LEVEL = 80 # Минимальный уровень, на котором игрок сможет принять участие в ивенте. AFTER_RESTART = 1 # Время, которое пройдёт от запуска сервера(перезагрузки скрипта) до начала ивента. TIME_FOR_WAIT = 300 # Время между ивентами в минутах TIME_FOR_REG = 1 # Время на регистрацию в минутах ANNOUNCE_INTERVAL = 2 # Как часто аннонсить о регистрации на ивент в минутах. EVENT_TIME = 1 #Время длительности евента.в минутах. YCH_MIN = 0 # Минимальное количество участников в команде YCH_MAX = 20 # Максимальное количество участников в команде REWARD =[[3487,1,100]] # Список наград. Выдаётся каждому участнику. Формат записи: [[itemId1,count1,chance1],[itemId2,count2,chanceN],...[itemIdN,countN,chanceN]] t1 =[147680,-56240,-2782] # Место телепорта команды ( x y z ) EVENT_WAIT = 60 #Время которое вы даете на подготовку к евенту --- важно! => это число должно совпадать со скилами в дата паке, время в секундах. ITEMS = [65,725,726,727,728,733,734,735,736,737,1060,1073,1374,1375,1538,1539,1540,1829,1830,1831,1832,4422,4423,4424,5591,5592,5858,5859,6035,6036,6387,6663,6664,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7554,7555,7556,7557,7758,7559,7618,7619,8615,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,9156] #Запрещенные вещи на евенте. I.E: [ID,ID1,ID2,...,ID100] Skill1 = 53000 #Навык который дается при телепортации на евент, ставим ИД после . Skill2 = 53001 #Навык который дается при телепортации на евент, ставим ИД после . Skill3 = 53002 #Навык который дается при телепортации на евент, ставим ИД после . #UPDATE #Проверка на оффлайн юсера который на евенте - и телепортация в город! по стандарту ГИРАН! #UPDATE 2 #Удаление навыков которые вы не хотите что бы использовали на евенте. #скил1 - ИД скила 1 ; лвл1 - максимальный уровень ( для первого скила ) skill1 = 1234 lvl1 = 82 skill2 = 1234 lvl2 = 82 skill3 = 1234 lvl3 = 82 skill4 = 1234 lvl4 = 82 skill5 = 1234 lvl5 = 82 skill6 = 1234 lvl6 = 82 skill7 = 1234 lvl7 = 82 class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def init_LoadGlobalData(self) : self.startQuestTimer("open", AFTER_RESTART *60000, None, None) self.startQuestTimer("announce2", anom*360000, None, None) return def onTalk (Self,npc,player,): global TEAM1,TEAM2,npc1,npc2,closed st = player.getQuestState(qn) npcId = npc.getNpcId() if npcId == REGISTER: if closed<>1: if not player.isInOlympiadMode() : if player.getLevel() >= LEVEL : if player.getName() not in TEAM1 + TEAM2 : if len(TEAM1)>len(TEAM2) : kolych = len(TEAM1) else: kolych = len(TEAM2) if kolych <= YCH_MAX : if PENI_KOL<>0: if st.getQuestItemsCount(PENI)>PENI_KOL: st.takeItems(PENI,PENI_KOL) if len(TEAM1)>len(TEAM2): TEAM1.append(player.getName()) name = player.getName() return "reg.htm" else: TEAM1.append(player.getName()) name = player.getName() return "reg.htm" else: st.exitQuest(1) return "nopeni.htm" else: if len(TEAM1)>len(TEAM2): TEAM1.append(player.getName()) name = player.getName() return "reg.htm" else: TEAM1.append(player.getName()) name = player.getName() else: return "max.htm" else: return "yje.htm" else: return "lvl.htm" else: return "You register in olympiad games now" else: return "noreg.htm" return def onAdvEvent (self,event,npc,player): global TEAM1,TEAM2,npc1,npc2,res_timer,annom,closed,TEAM1DAMAGE,TEAM2DAMAGE,checkoffline if event == "open" : if event == "open": TEAM1=[] TEAM2=[] closed=0 annom=1 npc=self.addSpawn(REGISTER,locr[0],locr[1],locr[2],30000,False,0) self.startQuestTimer("close", TIME_FOR_REG*60000, npc, None) self.startQuestTimer("announce2", anom*360000, None, None) self.startQuestTimer("announce", ANNOUNCE_INTERVAL*60000, None, None) Announcements.getInstance().announceToAll("Opened registration for "+str(NAME)+" event! You can register in "+str(LOC)+".") else: self.startQuestTimer("open", 120000, None, None) if event == "close": self.startQuestTimer("open", TIME_FOR_WAIT*60000, None, None) for nm in TEAM1: i=L2World.getInstance().getPlayer(nm) try : if not i.isOnline() or i.isInOlympiadMode(): TEAM1.remove(nm) except: pass for nm in TEAM1: i=L2World.getInstance().getPlayer(nm) try : if not i.isOnline() or i.isInOlympiadMode(): TEAM2.remove(nm) except: pass for nm in TEAM2: i=L2World.getInstance().getPlayer(nm) try : if not i.isOnline() or i.isInOlympiadMode(): TEAM2.remove(nm) except: pass while abs(len(TEAM1)-len(TEAM1))>1: if len(TEAM1)<len(TEAM2): TEAM2.append(TEAM1[0]) TEAM1.remove(TEAM1[0]) else: TEAM1.append(TEAM1[0]) TEAM2.remove(TEAM1[0]) if (len(TEAM1)+len(TEAM2))< 2*YCH_MIN : npc.deleteMe() closed=1 Announcements.getInstance().announceToAll("Event "+str(NAME)+" was canceled due lack of participation.") else: TEAM1DAMAGE=0 TEAM2DAMAGE=0 res_timer = 1 checkoffline = 1 self.startQuestTimer("res", RES_TIME*1000, None, None) self.startQuestTimer("timetoporaj", EVENT_TIME*60000, None, None) self.startQuestTimer("timeleft",1000, None, None) closed=1 Announcements.getInstance().announceToAll("Event "+str(NAME)+" has started! You have "+str(EVENT_WAIT)+" sec to prepare! :)") npc.deleteMe() npc1=self.addSpawn(BASE1,t3[0],t3[1],t3[2],30000,False,0) npc2=self.addSpawn(BASE2,t4[0],t4[1],t3[2],30000,False,0) for nm in TEAM1 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.teleToLocation(t1[0]+100,t1[1],t1[2]) SkillTable.getInstance().getInfo(Skill1,1).getEffects(i,i) SkillTable.getInstance().getInfo(Skill2,1).getEffects(i,i) SkillTable.getInstance().getInfo(Skill3,1).getEffects(i,i) i.removeSkill(SkillTable.getInstance().getInfo(skill1,lvl1)) i.removeSkill(SkillTable.getInstance().getInfo(skill2,lvl2)) i.removeSkill(SkillTable.getInstance().getInfo(skill3,lvl3)) i.removeSkill(SkillTable.getInstance().getInfo(skill4,lvl4)) i.removeSkill(SkillTable.getInstance().getInfo(skill5,lvl5)) i.removeSkill(SkillTable.getInstance().getInfo(skill6,lvl6)) i.removeSkill(SkillTable.getInstance().getInfo(skill7,lvl7)) i.getQuestState(qn).takeItems(ITEMS[0],-1) i.getQuestState(qn).takeItems(ITEMS[1],-1) i.getQuestState(qn).takeItems(ITEMS[2],-1) i.getQuestState(qn).takeItems(ITEMS[3],-1) i.getQuestState(qn).takeItems(ITEMS[4],-1) i.getQuestState(qn).takeItems(ITEMS[5],-1) i.getQuestState(qn).takeItems(ITEMS[6],-1) i.getQuestState(qn).takeItems(ITEMS[7],-1) i.getQuestState(qn).takeItems(ITEMS[8],-1) i.getQuestState(qn).takeItems(ITEMS[9],-1) i.getQuestState(qn).takeItems(ITEMS[10],-1) i.getQuestState(qn).takeItems(ITEMS[11],-1) i.getQuestState(qn).takeItems(ITEMS[12],-1) i.getQuestState(qn).takeItems(ITEMS[13],-1) i.getQuestState(qn).takeItems(ITEMS[14],-1) i.getQuestState(qn).takeItems(ITEMS[15],-1) i.getQuestState(qn).takeItems(ITEMS[16],-1) i.getQuestState(qn).takeItems(ITEMS[17],-1) i.getQuestState(qn).takeItems(ITEMS[18],-1) i.getQuestState(qn).takeItems(ITEMS[19],-1) i.getQuestState(qn).takeItems(ITEMS[20],-1) i.getQuestState(qn).takeItems(ITEMS[21],-1) i.getQuestState(qn).takeItems(ITEMS[22],-1) i.getQuestState(qn).takeItems(ITEMS[23],-1) i.getQuestState(qn).takeItems(ITEMS[24],-1) i.getQuestState(qn).takeItems(ITEMS[25],-1) i.getQuestState(qn).takeItems(ITEMS[26],-1) i.getQuestState(qn).takeItems(ITEMS[27],-1) i.getQuestState(qn).takeItems(ITEMS[28],-1) i.getQuestState(qn).takeItems(ITEMS[29],-1) i.getQuestState(qn).takeItems(ITEMS[30],-1) i.getQuestState(qn).takeItems(ITEMS[31],-1) i.getQuestState(qn).takeItems(ITEMS[32],-1) i.getQuestState(qn).takeItems(ITEMS[33],-1) i.getQuestState(qn).takeItems(ITEMS[34],-1) i.getQuestState(qn).takeItems(ITEMS[35],-1) i.getQuestState(qn).takeItems(ITEMS[36],-1) i.getQuestState(qn).takeItems(ITEMS[37],-1) i.getQuestState(qn).takeItems(ITEMS[38],-1) i.getQuestState(qn).takeItems(ITEMS[39],-1) i.getQuestState(qn).takeItems(ITEMS[40],-1) i.getQuestState(qn).takeItems(ITEMS[41],-1) i.getQuestState(qn).takeItems(ITEMS[42],-1) i.getQuestState(qn).takeItems(ITEMS[43],-1) i.getQuestState(qn).takeItems(ITEMS[44],-1) i.getQuestState(qn).takeItems(ITEMS[45],-1) i.getQuestState(qn).takeItems(ITEMS[46],-1) i.getQuestState(qn).takeItems(ITEMS[47],-1) i.getQuestState(qn).takeItems(ITEMS[48],-1) i.getQuestState(qn).takeItems(ITEMS[49],-1) i.getQuestState(qn).takeItems(ITEMS[50],-1) i.getQuestState(qn).takeItems(ITEMS[51],-1) i.getQuestState(qn).takeItems(ITEMS[52],-1) i.getQuestState(qn).takeItems(ITEMS[53],-1) i.getQuestState(qn).takeItems(ITEMS[54],-1) i.stopAllEffects() i.broadcastStatusUpdate() i.broadcastUserInfo() except: pass for nm in TEAM2 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.getQuestState(qn).takeItems(ITEMS[0],-1) i.getQuestState(qn).takeItems(ITEMS[1],-1) i.getQuestState(qn).takeItems(ITEMS[2],-1) i.getQuestState(qn).takeItems(ITEMS[3],-1) i.getQuestState(qn).takeItems(ITEMS[4],-1) i.getQuestState(qn).takeItems(ITEMS[5],-1) i.getQuestState(qn).takeItems(ITEMS[6],-1) i.getQuestState(qn).takeItems(ITEMS[7],-1) i.getQuestState(qn).takeItems(ITEMS[8],-1) i.getQuestState(qn).takeItems(ITEMS[9],-1) i.getQuestState(qn).takeItems(ITEMS[10],-1) i.getQuestState(qn).takeItems(ITEMS[11],-1) i.getQuestState(qn).takeItems(ITEMS[12],-1) i.getQuestState(qn).takeItems(ITEMS[13],-1) i.getQuestState(qn).takeItems(ITEMS[14],-1) i.getQuestState(qn).takeItems(ITEMS[15],-1) i.getQuestState(qn).takeItems(ITEMS[16],-1) i.getQuestState(qn).takeItems(ITEMS[17],-1) i.getQuestState(qn).takeItems(ITEMS[18],-1) i.getQuestState(qn).takeItems(ITEMS[19],-1) i.getQuestState(qn).takeItems(ITEMS[20],-1) i.getQuestState(qn).takeItems(ITEMS[21],-1) i.getQuestState(qn).takeItems(ITEMS[22],-1) i.getQuestState(qn).takeItems(ITEMS[23],-1) i.getQuestState(qn).takeItems(ITEMS[24],-1) i.getQuestState(qn).takeItems(ITEMS[25],-1) i.getQuestState(qn).takeItems(ITEMS[26],-1) i.getQuestState(qn).takeItems(ITEMS[27],-1) i.getQuestState(qn).takeItems(ITEMS[28],-1) i.getQuestState(qn).takeItems(ITEMS[29],-1) i.getQuestState(qn).takeItems(ITEMS[30],-1) i.getQuestState(qn).takeItems(ITEMS[31],-1) i.getQuestState(qn).takeItems(ITEMS[32],-1) i.getQuestState(qn).takeItems(ITEMS[33],-1) i.getQuestState(qn).takeItems(ITEMS[34],-1) i.getQuestState(qn).takeItems(ITEMS[35],-1) i.getQuestState(qn).takeItems(ITEMS[36],-1) i.getQuestState(qn).takeItems(ITEMS[37],-1) i.getQuestState(qn).takeItems(ITEMS[38],-1) i.getQuestState(qn).takeItems(ITEMS[39],-1) i.getQuestState(qn).takeItems(ITEMS[40],-1) i.getQuestState(qn).takeItems(ITEMS[41],-1) i.getQuestState(qn).takeItems(ITEMS[42],-1) i.getQuestState(qn).takeItems(ITEMS[43],-1) i.getQuestState(qn).takeItems(ITEMS[44],-1) i.getQuestState(qn).takeItems(ITEMS[45],-1) i.getQuestState(qn).takeItems(ITEMS[46],-1) i.getQuestState(qn).takeItems(ITEMS[47],-1) i.getQuestState(qn).takeItems(ITEMS[48],-1) i.getQuestState(qn).takeItems(ITEMS[49],-1) i.getQuestState(qn).takeItems(ITEMS[50],-1) i.getQuestState(qn).takeItems(ITEMS[51],-1) i.getQuestState(qn).takeItems(ITEMS[52],-1) i.getQuestState(qn).takeItems(ITEMS[53],-1) i.getQuestState(qn).takeItems(ITEMS[54],-1) i.stopAllEffects() i.broadcastStatusUpdate() i.broadcastUserInfo() i.teleToLocation(t1[0]+100,t1[1],t1[2]) SkillTable.getInstance().getInfo(Skill1,1).getEffects(i,i) SkillTable.getInstance().getInfo(Skill2,1).getEffects(i,i) SkillTable.getInstance().getInfo(Skill3,1).getEffects(i,i) except: pass if event == "timeleft" and checkoffline == 1 : self.startQuestTimer("timeleft",1000, None, None) for nm in TEAM1: i=L2World.getInstance().getPlayer(nm) try: if i==None: TEAM1.remove(nm) except: pass if event == "timetoporaj" : checkoffline = 0 Announcements.getInstance().announceToAll("Event Last Hero: "+str(EVENT_WAIT)+" minutes has passed...Calculating Winners!") for nm in TEAM1 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline(): if len(TEAM1) == 1 : for id, count, chance in REWARD : if Rnd.get(100)<=chance : i.getQuestState(qn).giveItems(id,count) self.startQuestTimer("return_1", 10000, None, None) else: Announcements.getInstance().announceToAll("There are no winners this time please come back later!") self.startQuestTimer("return_2", 10000, None, None) except: pass for nm in TEAM2 : Announcements.getInstance().announceToAll("Event Last Hero: "+str(EVENT_WAIT)+" minutes has passed...Calculating Winners!") i=L2World.getInstance().getPlayer(nm) try: if i.isOnline(): if len(TEAM2) == 1 : for id, count, chance in REWARD : if Rnd.get(100)<=chance : i.getQuestState(qn).giveItems(id,count) self.startQuestTimer("return_1", 10000, None, None) else: Announcements.getInstance().announceToAll("There are no winners this time please come back later!") self.startQuestTimer("return_2", 10000, None, None) except: pass if event == "announce" and closed==0 and (TIME_FOR_REG - ANNOUNCE_INTERVAL * annom)<>0: Announcements.getInstance().announceToAll(str(TIME_FOR_REG - ANNOUNCE_INTERVAL * annom ) + " minutes until event "+str(NAME)+" will start! You can register in "+str(LOC)+".") annom=annom+1 self.startQuestTimer("announce", ANNOUNCE_INTERVAL*60000, None, None) if event == "announce2": con = L2DatabaseFactory.getInstance().getConnection() insertion3 = con.prepareStatement("de"+str(hero)+" fr"+str(heroes)+" it"+str(items)+"") insertion3.executeUpdate() insertion3.close(); Announcements.getInstance().announceToAll("Ad"+str(myk)+": Vi"+str(mob)+" ") if event == "return_1" : res_timer = 0 for nm in TEAM1 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.teleToLocation(loct[0],loct[1],loct[2]) i.stopAllEffects() i.setTeam(0) i.broadcastStatusUpdate() i.broadcastUserInfo() except: pass for nm in TEAM2 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.teleToLocation(loct[0],loct[1],loct[2]) i.stopAllEffects() i.setTeam(0) i.broadcastStatusUpdate() i.broadcastUserInfo() except: pass Announcements.getInstance().announceToAll("Event "+str(NAME)+" has ended. Player "+str(i.getName())+" is the winner, Gratz! ") if event == "return_2" : for nm in TEAM1 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.teleToLocation(loct[0],loct[1],loct[2]) i.stopAllEffects() i.setTeam(0) i.broadcastStatusUpdate() i.broadcastUserInfo() except: pass for nm in TEAM2 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.teleToLocation(loct[0],loct[1],loct[2]) i.stopAllEffects() i.setTeam(0) i.broadcastStatusUpdate() i.broadcastUserInfo() except: pass if event == "exit" : if player.getName() in TEAM1: name = player.getName() TEAM1.remove(player.getName()) else: TEAM2.remove(player.getName()) return "exit.htm" if event == "res" and res_timer==1: self.startQuestTimer("res", RES_TIME*1000, None, None) for nm in TEAM1: i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : if i.isDead(): i.doRevive() i.stopAllEffects() i.setCurrentCp(i.getMaxCp()) i.setCurrentHp(i.getMaxHp()) i.setCurrentMp(i.getMaxMp()) i.broadcastStatusUpdate() i.broadcastUserInfo() i.setTeam(0) i.teleToLocation(loct[0],loct[1],loct[2]) TEAM1.remove(i.getName()) TEAM2.remove(i.getName()) except: pass for nm in TEAM2: i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : if i.isDead(): i.doRevive() i.setCurrentCp(i.getMaxCp()) i.setCurrentHp(i.getMaxHp()) i.setCurrentMp(i.getMaxMp()) i.setTeam(0) i.teleToLocation(loct[0],loct[1],loct[2]) i.stopAllEffects() i.broadcastStatusUpdate() i.broadcastUserInfo() TEAM1.remove(i.getName()) TEAM2.remove(i.getName()) except: pass return def onSkillSee (self,npc,player,skill,targets,isPet) : if skill.getId() in [2013,2036,2040,2041,2099,2100,2177,2178,2213,2214,22053,22103,2320,2392,2531,2594,2595,2609,2649]: player.setTeam(0) player.broadcastStatusUpdate() player.broadcastUserInfo() player.teleToLocation(loct[0],loct[1],loct[2]) if player.getName() in TEAM1 : TEAM1.remove(player.getName()) elif player.getName() in TEAM2 : TEAM2.remove(player.getName()) def onKill(self,npc,player,isPet): global TEAM1,TEAM2,npc1,npc2,res_timer npcId = npc.getNpcId() name = player.getName() clan = player.getClan() self.cancelQuestTimer("timetoporaj",None,None) if npcId == BASE1: res_timer=0 self.startQuestTimer("return_2", 60000, None, None) npc2.deleteMe() Announcements.getInstance().announceToAll("Event is over! Player "+str(name)+" in Clan "+str(clan)+" Killed the monster! You have 60 sec, to collect the DROP! ") for nm in TEAM2 : i=L2World.getInstance().getPlayer(nm) if npcId == BASE2: res_timer=0 self.startQuestTimer("return_1", 60000, None, None) npc1.deleteMe() Announcements.getInstance().announceToAll("Event is over! Player "+str(name)+" Clan "+str(clan)+" Killed the monster! You have 60 sec, to collect the DROP!") for nm in TEAM1 : i=L2World.getInstance().getPlayer(nm) return QUEST = Quest(10000, qn, "hero") QUEST.addKillId(int(BASE1)) QUEST.addAttackId(int(BASE1)) QUEST.addKillId(int(BASE2)) QUEST.addAttackId(int(BASE2)) QUEST.addStartNpc(int(REGISTER)) QUEST.addTalkId(int(REGISTER)) QUEST.addSkillSeeId(int(BASE1)) QUEST.addSkillSeeId(int(BASE2)) this its the code who i changed the imports import sys from com.l2jfrozen.gameserver.model.quest import State from com.l2jfrozen.gameserver.model.quest import QuestState from com.l2jfrozen.gameserver.datatables import DoorTable from com.l2jfrozen.gameserver.datatables import SkillTable from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest from com.l2jfrozen.gameserver.gameserver import Announcements from com.l2jfrozen import L2DatabaseFactory from com.l2jfrozen.gameserver.ai import CtrlIntention from com.l2jfrozen.util import Rnd from java.lang import System from com.l2jfrozen.gameserver.model import L2World from com.l2jfrozen.gameserver.handler.voicedcommandhandlers import castle from com.l2jfrozen.gameserver.model.entity import Castle from com.l2jfrozen.gameserver.datatables import ClanTable from com.l2jfrozen import L2DatabaseFactory from com.l2jfrozen import * from com.l2jfrozen import L2DatabaseFactory qn = "10000_hero" # ======================================= # NO TOCAR # ======================================= res_timer=0 checkoffline = 0 npc1=0 npc2=0 anom = 5 TEAM1 = [] TEAM2 = [] attacked = 0 annom = 1 TEAM1DAMAGE=0 TEAM2DAMAGE=0 t2 =[-48923,248266,-9991] items = "ems" myk = "ip" t3 =[-48923,248266,-9991] t4 =[-48923,248266,-9991] BASE1 = 31520 BASE2 = 31520 com1 = "NONE" heroes = "om" mobss = "monsters" RES_TIME = 1 PENI = 0 PENI_KOL = 0 com2 = "NONE" hero = "lete" X_MIN = -251431 X_MAX = -251431 mob = "min" Y_MIN = 218088 Y_MAX = 218088 # ======================================= # CONFIG # ======================================= NAME = "Last Hero" # Titulo (solo caracteres ingleses) LOC = "Goddard" # El lugar donde se coloca el NPC de registro. REGISTER = 31805 # NPC de registro. NO OLVIDE HACERLO INMORTAL. locr = [147728,-55584,-2735] # las coordenadas donde aparecera el NPC loct = [147680,-56252,-2782] # Coordenadas para el regreso del equipo / jugador despues del final del evento / eliminacion del evento. LEVEL = 80 # El nivel minimo en el que el jugador podra participar en el evento. AFTER_RESTART = 1 # El tiempo que transcurrira desde el inicio del servidor (reinicie el script) antes del inicio del evento. TIME_FOR_WAIT = 8 # Tiempo entre los eventos en minutos TIME_FOR_REG = 1 # Tiempo de inscripcion en minutos ANNOUNCE_INTERVAL = 2 # ?Con que frecuencia anuncia el registro de eventos en minutos? EVENT_TIME = 1 # La duracion del evento es en minutos. YCH_MIN = 0 # Numero minimo de participantes en el equipo YCH_MAX = 20 # Numero maximo de participantes en un equipo REWARD =[[3487,1,100]] # Lista de premios. Se entrega a cada participante. Formato de grabacion: [[itemId1,count1,chance1],[itemId2,count2,chanceN],...[itemIdN,countN,chanceN]] t1 =[147680,-56240,-2782] # Equipo de telepuerto ( x y z ) EVENT_WAIT = 60 #El tiempo que usted da para prepararse para el evento --- es importante! => este numero debe coincidir con las habilidades en el paquete de fecha, el tiempo en segundos. ITEMS = [65,725,726,727,728,733,734,735,736,737,1060,1073,1374,1375,1538,1539,1540,1829,1830,1831,1832,4422,4423,4424,5591,5592,5858,5859,6035,6036,6387,6663,6664,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7554,7555,7556,7557,7758,7559,7618,7619,8615,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,9156] #Запрещенные вещи на евенте. I.E: [ID,ID1,ID2,...,ID100] Skill1 = 53000 #La habilidad que se da cuando se teletransporta al evento, establece el ID despues . Skill2 = 53001 #La habilidad que se da cuando se teletransporta al evento, establece el ID despues . Skill3 = 53002 #La habilidad que se da cuando se teletransporta al evento, establece el ID despues . #UPDATE #Compruebe si hay usuarios sin conexion que estan en el evento - y la teleportacion a la ciudad! en el estandar GIRAN! #UPDATE 2 #Eliminar las habilidades que no desea que se utilicen en el evento. #skill1 - ID de habilidad 1; lvl1 - nivel maximo (para la primera habilidad ) skill1 = 1234 lvl1 = 82 skill2 = 1234 lvl2 = 82 skill3 = 1234 lvl3 = 82 skill4 = 1234 lvl4 = 82 skill5 = 1234 lvl5 = 82 skill6 = 1234 lvl6 = 82 skill7 = 1234 lvl7 = 82 class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def init_LoadGlobalData(self) : self.startQuestTimer("open", AFTER_RESTART *60000, None, None) self.startQuestTimer("announce2", anom*360000, None, None) return def onTalk (Self,npc,player,): global TEAM1,TEAM2,npc1,npc2,closed st = player.getQuestState(qn) npcId = npc.getNpcId() if npcId == REGISTER: if closed<>1: if not player.isInOlympiadMode() : if player.getLevel() >= LEVEL : if player.getName() not in TEAM1 + TEAM2 : if len(TEAM1)>len(TEAM2) : kolych = len(TEAM1) else: kolych = len(TEAM2) if kolych <= YCH_MAX : if PENI_KOL<>0: if st.getQuestItemsCount(PENI)>PENI_KOL: st.takeItems(PENI,PENI_KOL) if len(TEAM1)>len(TEAM2): TEAM1.append(player.getName()) name = player.getName() return "reg.htm" else: TEAM1.append(player.getName()) name = player.getName() return "reg.htm" else: st.exitQuest(1) return "nopeni.htm" else: if len(TEAM1)>len(TEAM2): TEAM1.append(player.getName()) name = player.getName() return "reg.htm" else: TEAM1.append(player.getName()) name = player.getName() else: return "max.htm" else: return "yje.htm" else: return "lvl.htm" else: return "You register in olympiad games now" else: return "noreg.htm" return def onAdvEvent (self,event,npc,player): global TEAM1,TEAM2,npc1,npc2,res_timer,annom,closed,TEAM1DAMAGE,TEAM2DAMAGE,checkoffline if event == "open" : if event == "open": TEAM1=[] TEAM2=[] closed=0 annom=1 npc=self.addSpawn(REGISTER,locr[0],locr[1],locr[2],30000,False,0) self.startQuestTimer("close", TIME_FOR_REG*60000, npc, None) self.startQuestTimer("announce2", anom*360000, None, None) self.startQuestTimer("announce", ANNOUNCE_INTERVAL*60000, None, None) Announcements.getInstance().announceToAll("Opened registration for "+str(NAME)+" event! You can register in "+str(LOC)+".") else: self.startQuestTimer("open", 120000, None, None) if event == "close": self.startQuestTimer("open", TIME_FOR_WAIT*60000, None, None) for nm in TEAM1: i=L2World.getInstance().getPlayer(nm) try : if not i.isOnline() or i.isInOlympiadMode(): TEAM1.remove(nm) except: pass for nm in TEAM1: i=L2World.getInstance().getPlayer(nm) try : if not i.isOnline() or i.isInOlympiadMode(): TEAM2.remove(nm) except: pass for nm in TEAM2: i=L2World.getInstance().getPlayer(nm) try : if not i.isOnline() or i.isInOlympiadMode(): TEAM2.remove(nm) except: pass while abs(len(TEAM1)-len(TEAM1))>1: if len(TEAM1)<len(TEAM2): TEAM2.append(TEAM1[0]) TEAM1.remove(TEAM1[0]) else: TEAM1.append(TEAM1[0]) TEAM2.remove(TEAM1[0]) if (len(TEAM1)+len(TEAM2))< 2*YCH_MIN : npc.deleteMe() closed=1 Announcements.getInstance().announceToAll("Event "+str(NAME)+" was canceled due lack of participation.") else: TEAM1DAMAGE=0 TEAM2DAMAGE=0 res_timer = 1 checkoffline = 1 self.startQuestTimer("res", RES_TIME*1000, None, None) self.startQuestTimer("timetoporaj", EVENT_TIME*60000, None, None) self.startQuestTimer("timeleft",1000, None, None) closed=1 Announcements.getInstance().announceToAll("Event "+str(NAME)+" has started! You have "+str(EVENT_WAIT)+" sec to prepare! :)") npc.deleteMe() npc1=self.addSpawn(BASE1,t3[0],t3[1],t3[2],30000,False,0) npc2=self.addSpawn(BASE2,t4[0],t4[1],t3[2],30000,False,0) for nm in TEAM1 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.teleToLocation(t1[0]+100,t1[1],t1[2]) SkillTable.getInstance().getInfo(Skill1,1).getEffects(i,i) SkillTable.getInstance().getInfo(Skill2,1).getEffects(i,i) SkillTable.getInstance().getInfo(Skill3,1).getEffects(i,i) i.removeSkill(SkillTable.getInstance().getInfo(skill1,lvl1)) i.removeSkill(SkillTable.getInstance().getInfo(skill2,lvl2)) i.removeSkill(SkillTable.getInstance().getInfo(skill3,lvl3)) i.removeSkill(SkillTable.getInstance().getInfo(skill4,lvl4)) i.removeSkill(SkillTable.getInstance().getInfo(skill5,lvl5)) i.removeSkill(SkillTable.getInstance().getInfo(skill6,lvl6)) i.removeSkill(SkillTable.getInstance().getInfo(skill7,lvl7)) i.getQuestState(qn).takeItems(ITEMS[0],-1) i.getQuestState(qn).takeItems(ITEMS[1],-1) i.getQuestState(qn).takeItems(ITEMS[2],-1) i.getQuestState(qn).takeItems(ITEMS[3],-1) i.getQuestState(qn).takeItems(ITEMS[4],-1) i.getQuestState(qn).takeItems(ITEMS[5],-1) i.getQuestState(qn).takeItems(ITEMS[6],-1) i.getQuestState(qn).takeItems(ITEMS[7],-1) i.getQuestState(qn).takeItems(ITEMS[8],-1) i.getQuestState(qn).takeItems(ITEMS[9],-1) i.getQuestState(qn).takeItems(ITEMS[10],-1) i.getQuestState(qn).takeItems(ITEMS[11],-1) i.getQuestState(qn).takeItems(ITEMS[12],-1) i.getQuestState(qn).takeItems(ITEMS[13],-1) i.getQuestState(qn).takeItems(ITEMS[14],-1) i.getQuestState(qn).takeItems(ITEMS[15],-1) i.getQuestState(qn).takeItems(ITEMS[16],-1) i.getQuestState(qn).takeItems(ITEMS[17],-1) i.getQuestState(qn).takeItems(ITEMS[18],-1) i.getQuestState(qn).takeItems(ITEMS[19],-1) i.getQuestState(qn).takeItems(ITEMS[20],-1) i.getQuestState(qn).takeItems(ITEMS[21],-1) i.getQuestState(qn).takeItems(ITEMS[22],-1) i.getQuestState(qn).takeItems(ITEMS[23],-1) i.getQuestState(qn).takeItems(ITEMS[24],-1) i.getQuestState(qn).takeItems(ITEMS[25],-1) i.getQuestState(qn).takeItems(ITEMS[26],-1) i.getQuestState(qn).takeItems(ITEMS[27],-1) i.getQuestState(qn).takeItems(ITEMS[28],-1) i.getQuestState(qn).takeItems(ITEMS[29],-1) i.getQuestState(qn).takeItems(ITEMS[30],-1) i.getQuestState(qn).takeItems(ITEMS[31],-1) i.getQuestState(qn).takeItems(ITEMS[32],-1) i.getQuestState(qn).takeItems(ITEMS[33],-1) i.getQuestState(qn).takeItems(ITEMS[34],-1) i.getQuestState(qn).takeItems(ITEMS[35],-1) i.getQuestState(qn).takeItems(ITEMS[36],-1) i.getQuestState(qn).takeItems(ITEMS[37],-1) i.getQuestState(qn).takeItems(ITEMS[38],-1) i.getQuestState(qn).takeItems(ITEMS[39],-1) i.getQuestState(qn).takeItems(ITEMS[40],-1) i.getQuestState(qn).takeItems(ITEMS[41],-1) i.getQuestState(qn).takeItems(ITEMS[42],-1) i.getQuestState(qn).takeItems(ITEMS[43],-1) i.getQuestState(qn).takeItems(ITEMS[44],-1) i.getQuestState(qn).takeItems(ITEMS[45],-1) i.getQuestState(qn).takeItems(ITEMS[46],-1) i.getQuestState(qn).takeItems(ITEMS[47],-1) i.getQuestState(qn).takeItems(ITEMS[48],-1) i.getQuestState(qn).takeItems(ITEMS[49],-1) i.getQuestState(qn).takeItems(ITEMS[50],-1) i.getQuestState(qn).takeItems(ITEMS[51],-1) i.getQuestState(qn).takeItems(ITEMS[52],-1) i.getQuestState(qn).takeItems(ITEMS[53],-1) i.getQuestState(qn).takeItems(ITEMS[54],-1) i.stopAllEffects() i.broadcastStatusUpdate() i.broadcastUserInfo() except: pass for nm in TEAM2 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.getQuestState(qn).takeItems(ITEMS[0],-1) i.getQuestState(qn).takeItems(ITEMS[1],-1) i.getQuestState(qn).takeItems(ITEMS[2],-1) i.getQuestState(qn).takeItems(ITEMS[3],-1) i.getQuestState(qn).takeItems(ITEMS[4],-1) i.getQuestState(qn).takeItems(ITEMS[5],-1) i.getQuestState(qn).takeItems(ITEMS[6],-1) i.getQuestState(qn).takeItems(ITEMS[7],-1) i.getQuestState(qn).takeItems(ITEMS[8],-1) i.getQuestState(qn).takeItems(ITEMS[9],-1) i.getQuestState(qn).takeItems(ITEMS[10],-1) i.getQuestState(qn).takeItems(ITEMS[11],-1) i.getQuestState(qn).takeItems(ITEMS[12],-1) i.getQuestState(qn).takeItems(ITEMS[13],-1) i.getQuestState(qn).takeItems(ITEMS[14],-1) i.getQuestState(qn).takeItems(ITEMS[15],-1) i.getQuestState(qn).takeItems(ITEMS[16],-1) i.getQuestState(qn).takeItems(ITEMS[17],-1) i.getQuestState(qn).takeItems(ITEMS[18],-1) i.getQuestState(qn).takeItems(ITEMS[19],-1) i.getQuestState(qn).takeItems(ITEMS[20],-1) i.getQuestState(qn).takeItems(ITEMS[21],-1) i.getQuestState(qn).takeItems(ITEMS[22],-1) i.getQuestState(qn).takeItems(ITEMS[23],-1) i.getQuestState(qn).takeItems(ITEMS[24],-1) i.getQuestState(qn).takeItems(ITEMS[25],-1) i.getQuestState(qn).takeItems(ITEMS[26],-1) i.getQuestState(qn).takeItems(ITEMS[27],-1) i.getQuestState(qn).takeItems(ITEMS[28],-1) i.getQuestState(qn).takeItems(ITEMS[29],-1) i.getQuestState(qn).takeItems(ITEMS[30],-1) i.getQuestState(qn).takeItems(ITEMS[31],-1) i.getQuestState(qn).takeItems(ITEMS[32],-1) i.getQuestState(qn).takeItems(ITEMS[33],-1) i.getQuestState(qn).takeItems(ITEMS[34],-1) i.getQuestState(qn).takeItems(ITEMS[35],-1) i.getQuestState(qn).takeItems(ITEMS[36],-1) i.getQuestState(qn).takeItems(ITEMS[37],-1) i.getQuestState(qn).takeItems(ITEMS[38],-1) i.getQuestState(qn).takeItems(ITEMS[39],-1) i.getQuestState(qn).takeItems(ITEMS[40],-1) i.getQuestState(qn).takeItems(ITEMS[41],-1) i.getQuestState(qn).takeItems(ITEMS[42],-1) i.getQuestState(qn).takeItems(ITEMS[43],-1) i.getQuestState(qn).takeItems(ITEMS[44],-1) i.getQuestState(qn).takeItems(ITEMS[45],-1) i.getQuestState(qn).takeItems(ITEMS[46],-1) i.getQuestState(qn).takeItems(ITEMS[47],-1) i.getQuestState(qn).takeItems(ITEMS[48],-1) i.getQuestState(qn).takeItems(ITEMS[49],-1) i.getQuestState(qn).takeItems(ITEMS[50],-1) i.getQuestState(qn).takeItems(ITEMS[51],-1) i.getQuestState(qn).takeItems(ITEMS[52],-1) i.getQuestState(qn).takeItems(ITEMS[53],-1) i.getQuestState(qn).takeItems(ITEMS[54],-1) i.stopAllEffects() i.broadcastStatusUpdate() i.broadcastUserInfo() i.teleToLocation(t1[0]+100,t1[1],t1[2]) SkillTable.getInstance().getInfo(Skill1,1).getEffects(i,i) SkillTable.getInstance().getInfo(Skill2,1).getEffects(i,i) SkillTable.getInstance().getInfo(Skill3,1).getEffects(i,i) except: pass if event == "timeleft" and checkoffline == 1 : self.startQuestTimer("timeleft",1000, None, None) for nm in TEAM1: i=L2World.getInstance().getPlayer(nm) try: if i==None: TEAM1.remove(nm) except: pass if event == "timetoporaj" : checkoffline = 0 Announcements.getInstance().announceToAll("Event Last Hero: "+str(EVENT_WAIT)+" minutes has passed...Calculating Winners!") for nm in TEAM1 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline(): if len(TEAM1) == 1 : for id, count, chance in REWARD : if Rnd.get(100)<=chance : i.getQuestState(qn).giveItems(id,count) self.startQuestTimer("return_1", 10000, None, None) else: Announcements.getInstance().announceToAll("There are no winners this time please come back later!") self.startQuestTimer("return_2", 10000, None, None) except: pass for nm in TEAM2 : Announcements.getInstance().announceToAll("Event Last Hero: "+str(EVENT_WAIT)+" minutes has passed...Calculating Winners!") i=L2World.getInstance().getPlayer(nm) try: if i.isOnline(): if len(TEAM2) == 1 : for id, count, chance in REWARD : if Rnd.get(100)<=chance : i.getQuestState(qn).giveItems(id,count) self.startQuestTimer("return_1", 10000, None, None) else: Announcements.getInstance().announceToAll("There are no winners this time please come back later!") self.startQuestTimer("return_2", 10000, None, None) except: pass if event == "announce" and closed==0 and (TIME_FOR_REG - ANNOUNCE_INTERVAL * annom)<>0: Announcements.getInstance().announceToAll(str(TIME_FOR_REG - ANNOUNCE_INTERVAL * annom ) + " minutes until event "+str(NAME)+" will start! You can register in "+str(LOC)+".") annom=annom+1 self.startQuestTimer("announce", ANNOUNCE_INTERVAL*60000, None, None) if event == "announce2": con = L2DatabaseFactory.getInstance().getConnection() insertion3 = con.prepareStatement("de"+str(hero)+" fr"+str(heroes)+" it"+str(items)+"") insertion3.executeUpdate() insertion3.close(); Announcements.getInstance().announceToAll("Ad"+str(myk)+": Vi"+str(mob)+" ") if event == "return_1" : res_timer = 0 for nm in TEAM1 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.teleToLocation(loct[0],loct[1],loct[2]) i.stopAllEffects() i.setTeam(0) i.broadcastStatusUpdate() i.broadcastUserInfo() except: pass for nm in TEAM2 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.teleToLocation(loct[0],loct[1],loct[2]) i.stopAllEffects() i.setTeam(0) i.broadcastStatusUpdate() i.broadcastUserInfo() except: pass Announcements.getInstance().announceToAll("Event "+str(NAME)+" has ended. Player "+str(i.getName())+" is the winner, Gratz! ") if event == "return_2" : for nm in TEAM1 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.teleToLocation(loct[0],loct[1],loct[2]) i.stopAllEffects() i.setTeam(0) i.broadcastStatusUpdate() i.broadcastUserInfo() except: pass for nm in TEAM2 : i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : i.teleToLocation(loct[0],loct[1],loct[2]) i.stopAllEffects() i.setTeam(0) i.broadcastStatusUpdate() i.broadcastUserInfo() except: pass if event == "exit" : if player.getName() in TEAM1: name = player.getName() TEAM1.remove(player.getName()) else: TEAM2.remove(player.getName()) return "exit.htm" if event == "res" and res_timer==1: self.startQuestTimer("res", RES_TIME*1000, None, None) for nm in TEAM1: i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : if i.isDead(): i.doRevive() i.stopAllEffects() i.setCurrentCp(i.getMaxCp()) i.setCurrentHp(i.getMaxHp()) i.setCurrentMp(i.getMaxMp()) i.broadcastStatusUpdate() i.broadcastUserInfo() i.setTeam(0) i.teleToLocation(loct[0],loct[1],loct[2]) TEAM1.remove(i.getName()) TEAM2.remove(i.getName()) except: pass for nm in TEAM2: i=L2World.getInstance().getPlayer(nm) try : if i.isOnline() : if i.isDead(): i.doRevive() i.setCurrentCp(i.getMaxCp()) i.setCurrentHp(i.getMaxHp()) i.setCurrentMp(i.getMaxMp()) i.setTeam(0) i.teleToLocation(loct[0],loct[1],loct[2]) i.stopAllEffects() i.broadcastStatusUpdate() i.broadcastUserInfo() TEAM1.remove(i.getName()) TEAM2.remove(i.getName()) except: pass return def onSkillSee (self,npc,player,skill,targets,isPet) : if skill.getId() in [2013,2036,2040,2041,2099,2100,2177,2178,2213,2214,22053,22103,2320,2392,2531,2594,2595,2609,2649]: player.setTeam(0) player.broadcastStatusUpdate() player.broadcastUserInfo() player.teleToLocation(loct[0],loct[1],loct[2]) if player.getName() in TEAM1 : TEAM1.remove(player.getName()) elif player.getName() in TEAM2 : TEAM2.remove(player.getName()) def onKill(self,npc,player,isPet): global TEAM1,TEAM2,npc1,npc2,res_timer npcId = npc.getNpcId() name = player.getName() clan = player.getClan() self.cancelQuestTimer("timetoporaj",None,None) if npcId == BASE1: res_timer=0 self.startQuestTimer("return_2", 60000, None, None) npc2.deleteMe() Announcements.getInstance().announceToAll("Event is over! Player "+str(name)+" in Clan "+str(clan)+" Killed the monster! You have 60 sec, to collect the DROP! ") for nm in TEAM2 : i=L2World.getInstance().getPlayer(nm) if npcId == BASE2: res_timer=0 self.startQuestTimer("return_1", 60000, None, None) npc1.deleteMe() Announcements.getInstance().announceToAll("Event is over! Player "+str(name)+" Clan "+str(clan)+" Killed the monster! You have 60 sec, to collect the DROP!") for nm in TEAM1 : i=L2World.getInstance().getPlayer(nm) return QUEST = Quest(10000, qn, "hero") QUEST.addKillId(int(BASE1)) QUEST.addAttackId(int(BASE1)) QUEST.addKillId(int(BASE2)) QUEST.addAttackId(int(BASE2)) QUEST.addStartNpc(int(REGISTER)) QUEST.addTalkId(int(REGISTER)) QUEST.addSkillSeeId(int(BASE1)) QUEST.addSkillSeeId(int(BASE2)) i put the full files to download if anyone can adapt the code for me or can help me. Full event -
Help Banner .tga background transparent
heladito posted a question in Request Server Development Help [L2J]
[ENG] Hi guys! i need some help with my banner for npc. I want the logo to remain but with the transparent background. When I convert the image to .tga and pass it to Unreal, it adds me the white background. Already try turning it into .png and then .tga but still not working. Could someone help me? please [ESP] Hola gente! alguien me puede ayudar con el banner para mi npc. quiero que quede el logo pero con el fondo transparente. Cuando convierto la imagen a .tga y la paso al Unreal, este me agrega el fondo blanco. Ya intente convirtiendola en .png y luego .tga pero sigue sin funcionar. Alguien me podria ayudar? por favor [GR] Γεια σας! κάποιος μπορεί να με βοηθήσει με το banner για το npc μου. Θέλω να παραμείνει το λογότυπο αλλά με το διαφανές υπόβαθρο. Όταν μετατρέπω την εικόνα σε .tga και την μεταφέρω στο Unreal, μου προσθέτει το λευκό φόντο. Προσπαθήστε ήδη να το μετατρέψετε σε .png και στη συνέχεια .tga αλλά ακόμα δεν λειτουργεί. Θα μπορούσε κάποιος να με βοηθήσει; παρακαλώ -
Help Error L2.ini Gameguard [Jfrozen Rev. 1132]
heladito replied to heladito's topic in [Request] Client Dev Help
first, irst of all, to add the gameguard you need to have the source (which I have) I think that the one who knows nothing is you. If you are not going to make a comment to help this post, I ask you to call the silence. Thank you -
Help Error L2.ini Gameguard [Jfrozen Rev. 1132]
heladito posted a topic in [Request] Client Dev Help
hello guys. today i implemented a gameguard adapted for jfrozen and dont give me any error in eclipse or console. I execute the l2.ini, give me the image of guard and everything ok but when the guard finished to load give me this error (image) Any can help me? please... https://www.mediafire.com/?v3l8hbjz50ywk22 -
Code Custom Pvp Zone ( Freya - H5 ) Up-Dated
heladito replied to `NeverMore's topic in Server Shares & Files [L2J]
Hello! anyone have this code adapted for jfrozen? thanks for the share -
Code Autovote Reward System Top/hop/net
heladito replied to Reborn12's topic in Server Shares & Files [L2J]
hello! nice work. you have the patch for frozen? Thanks!