Jump to content

ČυяŞŀŅğ

Members
  • Posts

    383
  • Credits

  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    100%

Everything posted by ČυяŞŀŅğ

  1. not working , nery i have same problem , if you ban one , then noone can join again !
  2. Can you be more detailed? Like Show me the working code for it ? :P The most simple i want ! im not So advanced :S
  3. Well , after compile , tryed to run the server and i got this error Error: Could not find or load main class com.l2jserver.gameserver.GameServer It has to do something with libs , or l2jserver.jar , I build no errors at all If i put back mybackup l2jserver.jar server working fine So its Sure workspace is the problem , means damaged source , or eclipse settings I tryed with clean eclipse , I tryed to Run and old backup of workspace.. On eclipse strange errors and warning appear .. like 1100 warning lol or things does not exist.. its Like eclipse even if deleted , somehow still taking the Bad data .. I removed .metadata also , I tryed to reinstall subeclipse , nothing at all.. I check lib's and panths seems fine.. I dont know what else to do.. Anyone can help me? I can provide images or what ever you want , just i want this fixed ! EDIT : I FIXED the problem with janis help (open l2jserver.jar and Delete META.INF ) but everytime i want to make new jar , i have to do this.. clean from old stucked META shits.. any idea how this could be fixed?
  4. `iAndre I cant , if you can , i can pay you for it. Karasu I dont Think So , probably Like i said You was on my server's , and yes Im making New server , L2Eos :)
  5. I think You Know me because of My pack I'm selling , or You was a Player on l2 New world? Maybe L2maxter? Or Part of my new Project L2Eos?:D
  6. I'm LF one guy to make for me custom Armor and weapons set , this can be also shared armors like http://www.maxcheaters.com/topic/162579-r99-weapons-and-armors-freya-god/ And weapons like http://www.maxcheaters.com/topic/162663-antharas-valakas-lindvior-weapons-freya-god/ I want Those files to be working perfect For L2j FREYA Add me on Skype : cursingqq Only serious Client developers.. kids will be ignored You have to show me if they works , test server etc etc , So dont try to scam me.. it won't work anyway..
  7. So here I have one OFFLINE petition.. how does it works? if there is no gms on the list or online , the petition msg will be send into email of the choosen char. I made it working for my rev , and fixed few bugs. I have only 2 small problems now.. I want to add Config on this system , to send the mail in more than 1 char.. Is this possible? and if Yes what type of Config will do the proper work? public static String ? And my other problem is , If you register on /gmlist ( list on by admin panel ) After you cant be removed from list xD LIST OFF from admin panel not working after my edits to make it work with offline and mail :D If gm restart , remove by list is working automatic like it should private static String _MAIL_PETITION_RECEIPT = "TESTTEST"; /* * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. */ package com.l2jserver.gameserver.network.clientpackets; import com.l2jserver.Config; import com.l2jserver.gameserver.GmListTable; import com.l2jserver.gameserver.instancemanager.PetitionManager; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.CreatureSay; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.datatables.CharNameTable; import com.l2jserver.gameserver.idfactory.IdFactory; import com.l2jserver.gameserver.instancemanager.MailManager; import com.l2jserver.gameserver.model.entity.Message; /** * <p>Format: (c) Sd * <ul> * <li>S: content</li> * <li>d: type</li> * </ul></p> * @author -Wooden-, TempyIncursion * */ public final class RequestPetition extends L2GameClientPacket { private static final String _C__7F_RequestPetition = "[C] 7F RequestPetition"; //private static Logger _log = Logger.getLogger(RequestPetition.class.getName()); private String _content; private int _type; // 1 = on : 0 = off; /* * SL2 ADDON: v0.3349 -- true=if no GM online, petition will be sent to specified character as mail * (for him to be able to read it next logon...) */ private static boolean _SEND_MAIL_IF_NO_GM_FOR_PETITION = Config.OFFLINE_PETITION_ENABLE; private static boolean _SEND_MAIL_ONLY_WHEN_NO_GM_ONLINE = false; //-- false=will send mail even when GM is on, just not on GM LIST (available for petitioning) private static String _MAIL_PETITION_RECEIPT = "TESTTEST"; private static int _MAIL_PETITION_RECEIPT_ID = CharNameTable.getInstance().getIdByName(_MAIL_PETITION_RECEIPT); @Override protected void readImpl() { _content = readS(); _type = readD(); } @Override protected void runImpl() { L2PcInstance activeChar = getClient().getActiveChar(); if (activeChar == null) return; if (!GmListTable.getInstance().isGmOnline(false)) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NO_GM_PROVIDING_SERVICE_NOW)); if (!_SEND_MAIL_IF_NO_GM_FOR_PETITION && _MAIL_PETITION_RECEIPT_ID < 1) return; } if (!PetitionManager.getInstance().isPetitioningAllowed()) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.GAME_CLIENT_UNABLE_TO_CONNECT_TO_PETITION_SERVER)); return; } if (PetitionManager.getInstance().isPlayerPetitionPending(activeChar)) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_ONE_ACTIVE_PETITION_AT_TIME)); return; } if (PetitionManager.getInstance().getPendingPetitionCount() == Config.MAX_PETITIONS_PENDING) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PETITION_SYSTEM_CURRENT_UNAVAILABLE)); return; } int totalPetitions = PetitionManager.getInstance().getPlayerTotalPetitionCount(activeChar) + 1; if (totalPetitions > Config.MAX_PETITIONS_PER_PLAYER) { SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.WE_HAVE_RECEIVED_S1_PETITIONS_TODAY); sm.addNumber(totalPetitions); activeChar.sendPacket(sm); sm = null; return; } if (_content.length() > 255) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PETITION_MAX_CHARS_255)); return; } if (!GmListTable.getInstance().isGmOnline(false)) { // activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NO_GM_PROVIDING_SERVICE_NOW)); activeChar.sendPacket(new CreatureSay(1, Say2.PARTY, "Petition", "There are no GM's Online or on Gmlist!")); activeChar.sendPacket(new CreatureSay(1, Say2.PARTY, "Petition", "Initializing OFFLINE Pettition System!")); if (!_SEND_MAIL_IF_NO_GM_FOR_PETITION || (_SEND_MAIL_IF_NO_GM_FOR_PETITION && _MAIL_PETITION_RECEIPT_ID < 1)) return; else { activeChar.sendMessage("=> YOUR PETITION MESSAGE WILL BE SENT TO ADMIN BY E-MAIL INSTEAD <="); activeChar.sendMessage("Wait patiently for an answer, and always remember to describe petition/problem/question/matter of petition."); //SEND SYSTEM MAIL (WITH PETITION MSG) TO DEFINED ADMIN/GM ACCOUNT if (_SEND_MAIL_ONLY_WHEN_NO_GM_ONLINE && GmListTable.getInstance().isGmOnline(true)) { activeChar.sendMessage("ERROR: You are not allowed to send offline petition."); return; } int petitionId = IdFactory.getInstance().getNextId(); Message petitionMsg = new Message(activeChar.getObjectId(), _MAIL_PETITION_RECEIPT_ID, false, "[P: " + PetitionManager.getPetitionTypeString(_type) + "] " + petitionId, _content, 0); activeChar.sendMessage("OFFLINE PETITION: Your petition is now going to be send with unique Petition ID: " + petitionId); MailManager.getInstance().sendMessage(petitionMsg); return; } } int petitionId = PetitionManager.getInstance().submitPetition(activeChar, _content, _type); SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.PETITION_ACCEPTED_RECENT_NO_S1); sm.addNumber(petitionId); activeChar.sendPacket(sm); sm = SystemMessage.getSystemMessage(SystemMessageId.SUBMITTED_YOU_S1_TH_PETITION_S2_LEFT); sm.addNumber(totalPetitions); sm.addNumber(Config.MAX_PETITIONS_PER_PLAYER - totalPetitions); activeChar.sendPacket(sm); sm = SystemMessage.getSystemMessage(SystemMessageId.S1_PETITION_ON_WAITING_LIST); sm.addNumber(PetitionManager.getInstance().getPendingPetitionCount()); activeChar.sendPacket(sm); sm = null; } /* (non-Javadoc) * @see com.l2jserver.gameserver.clientpackets.ClientBasePacket#getType() */ @Override public String getType() { return _C__7F_RequestPetition; } } I tryed This about configs public static List<Integer> GM_NAMES_OFFLINE_PETITION = new ArrayList<Integer>(); String[] propertySplit2 = L2JModSettings.getProperty("GmNamesForOfflinePetition", "name").split(","); for(String gmnames: propertySplit2) { try { GM_NAMES_OFFLINE_PETITION.add(Integer.parseInt(gmnames)); } catch (NumberFormatException nfe) { if (propertySplit2.length > 0) _log.warning("Error in load config."); } } and on take config private static List<Integer> _MAIL_PETITION_RECEIPT = Config.GM_NAMES_OFFLINE_PETITION; But i have error on private static int _MAIL_PETITION_RECEIPT_ID = CharNameTable.getInstance().getIdByName(_MAIL_PETITION_RECEIPT); The method getIdByName(String) in the type CharNameTable is not applicable for the arguments (List<Integer>) any idea? :/
  8. bump ! On the group page you can see the progress of this project ! https://www.facebook.com/groups/668617159828013/
  9. i think its like this right now ! but again its not problem? I have added to many requests there :/ I want like this https://imageshack.com/i/0uouznp I think is the best idea like on my npc :D
  10. Fixed, It was on wrong html -_- Like this is working.. Thank you very much ! One question , i want to make Community board , refresh every X time. example from my respawn info npc private void sendRaidBosses(L2PcInstance player, int bosslevel) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Grand Boss Info</title><body><br><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><table width=260>"); for (Raidboss rb : RAID_BOSSES) { String name = rb.getName(); if(name.equals("Freya") || name.equals("Beleth")) continue; int level = rb.getLevel(); int min = bosslevel; int max = min + 10; if (level >= min && level <= max) { long delay = rb.getRespawn(); long currentTime = System.currentTimeMillis(); if (delay <= currentTime) tb.append("<tr><td><font color=\"00C3FF\">" + name + " (" + level + ")</color>:<br></td><td><font color=\"32C332\">Alive</color></td></tr>"); else { tb.append("<tr><td><font color=\"00C3FF\">" + name + "</color>:<br></td><td><font color=\"FF0000\">Respawn at :"+sdf.format(new Date(delay))+"</color></td></tr>"); } } } Something like this for cb , to refresh every X time , and also to shows somewere when updated , and when the next update will be. I guess this should happen on TopBBSmanager , but how? :/
  11. on topbbsmanger.java if (fileName.equals("data/html/CommunityBoard/56.htm")); { // Raid Status raidBosses(); content = content.replaceAll("%antharas%", bossStatus(29019)); content = content.replaceAll("%valakas%", bossStatus(29028)); content = content.replaceAll("%baium%", bossStatus(29020)); content = content.replaceAll("%antqueen%", bossStatus(29001)); content = content.replaceAll("%core%", bossStatus(29006)); content = content.replaceAll("%zaken%", bossStatus(29022)); content = content.replaceAll("%frintezza%", bossStatus(29045)); content = content.replaceAll("%orfen%", bossStatus(29014)); content = content.replaceAll("%freya%", bossStatus(29178)); content = content.replaceAll("%beleth%", bossStatus(29118)); } and the way im taking the respawn infi is this /** * @param bossId * @return */ private static String bossStatus(int bossId) { long delay=0; if(bossId==29178) { delay=bosses.get("Freya"); if(delay<=System.currentTimeMillis()) return "<font color=\"9CC300\">Alive!</font>"; else return "<font color=\"ff0000\">Dead!</font>"; } else if(bossId==29118) { delay=bosses.get("Beleth"); if(delay<=System.currentTimeMillis()) return "<font color=\"9CC300\">Alive!</font>"; else return "<font color=\"ff0000\">Dead!</font>"; } delay = GrandBossManager.getInstance().getStatsSet(bossId).getLong("respawn_time"); if (delay <= System.currentTimeMillis()) { return "<td><tr><font color=\"9CC300\">Alive!</font></td></tr>"; } else { return "<font color=\"ff0000\">Dead!</font>"; } } For normal grandbosses is working fine, but since im using costum beleth and Freya with no AI since i dont have it .. The cb is not working.. I use %freya% on 56.htm and not replacing the respawn status of those 2 rbs.. :/ On database l2npc those 2 bosses are L2RaidBoss and Also there is no more than one "Beleth or Freya npc as name.. any idea? :/
  12. Yeap :D but why ? On gameserver.java is fine :/
  13. Yeap , this is what i wanted to do .. to make sure that Log.java loaded , but i dont see any msg on GS.. so i guess the system never start together with the server!
  14. ive added this line System.out.println("log : Enabled 1st stage"); Like this public Log() { System.out.println("log : Enabled 1st stage"); Logger.loadConfigs(); if(Logger.enabled) { checkemail = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new LogController(),/* 5 * 60000*/60000, /*5 * 60000*/60000);// Test 1 minute, live +-5 minutes } } On Log.java and and Rest like you did on your code ^^ include The gameserver.java part with import.. xD Like on your code you shared ^^
  15. No idea why , but seems i cant make it Start , or its not working.. but ive added one "check" to make sure its running , and no msg at all XD Ive checked on gameserver.java , log.getinstance and import Is there.. ANY other idea? maybe the whole code is the problem? Im using Freya l2j And also Ive added javax.mail.jar on libs and on build.xml 9 Ive found it on Java https://java.net/projects/javamail/pages/Home public Log() { System.out.println("log : Enabled 1st stage"); Logger.loadConfigs(); if(Logger.enabled) { checkemail = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new LogController(),/* 5 * 60000*/60000, /*5 * 60000*/60000);// Test 1 minute, live +-5 minutes } } code by ^Wyatt Index: dist/game/config/MailController.properties =================================================================== --- dist/game/config/MailController.properties (revision 0) +++ dist/game/config/MailController.properties (revision 0) @@ -0,0 +1,43 @@ +# ----------------------------------------------------------------------------------------------------------- +# MailController +# Developed by Mhoska & Wyatt +# ----------------------------------------------------------------------------------------------------------- +# This tool it's used to land admin commands via e-mail +# ----------------------------------------------------------------------------------------------------------- +# Available commands Information Target Status +# ----------------------------------------------------------------------------------------------------------- +# Restart 120 Restart Time - +# Shutdown 120 Shutdown Time - +# Kick Wyatt Kick PlayerName - +# Ban_Char Wyatt Ban_Char PlayerName Both +# Ban_Acc L2jHidden Ban_Acc PlayerName Both +# Unban_Char Wyatt Unban_Char PlayerName - +# Unban_Acc L2jHidden Unban_Acc PlayerName - +# Jail Wyatt 60 Jail PlayerName Time Both +# UnJail Wyatt UnJail PlayerName Both +# Announce blablabla Announce Text Text... - +# Repair Wyatt Repair PlayerName Must be Offline +# GiveItem Wyatt 57 10 GiveItem PlayerName ItemId ItemCount Must be Online +# GiveItemAll 57 10 GiveItemAll ItemId ItemCount Must be Online +# GetOnlineCount (Gives you a feedback of online players) - +# ----------------------------------------------------------------------------------------------------------- +# Configs +# Note: Recommended to se a new e-mail that will only be used for this script. +# ----------------------------------------------------------------------------------------------------------- +# Enable/Disable the system. +Enabled = True + +# Here you must especify your GMAIL e-mail. +Email = 123456@gmail.com + +# Here you must especify your GMAIL e-mail password. +EmailPassword = 123456 + +# IMPORTANT: Here you must especify your personal password that you'll have to put as Subject +# in every e-mail that you send. +SystemPassword = DumbHoe + +# Here you must especify your personal e-mail that will get a feedback after some commands use. +# Just to get the feedback, you can use commands no matter which email you use. +EmailSender = 654321@gmail.com Index: java/com/l2jserver/gameserver/model/email/Logger.java =================================================================== --- java/com/l2jserver/gameserver/model/email/Logger.java (revision 0) +++ java/com/l2jserver/gameserver/model/email/Logger.java (revision 0) @@ -0,0 +1,118 @@ +/* + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. + */ +package com.l2jserver.gameserver.model.email; + +import java.io.*; +import java.util.*; +import javax.mail.*; +import javax.mail.Flags.Flag; +import javax.mail.search.AndTerm; +import javax.mail.search.FlagTerm; +import javax.mail.search.SearchTerm; +import javax.mail.search.SubjectTerm; +import com.sun.mail.imap.IMAPFolder; + +/** + * + * @author Mhoska + * @rework Wyatt + * + */ + +public class Logger +{ + public static String emailpass = ""; + public static String email = ""; + public static String pass = ""; + public static String content = ""; + public static String to = ""; + public static boolean enabled = false; + + public static void main(String[] args) throws MessagingException, IOException + { + IMAPFolder folder = null; + Store store = null; + @SuppressWarnings("unused") + String subject = null; + @SuppressWarnings("unused") + Flag flag = null; + @SuppressWarnings("unused") + String nonsense = "restart"; + + try + { + content = ""; + Properties props = System.getProperties(); + props.setProperty("mail.store.protocol", "imaps"); + Session session = Session.getDefaultInstance(props, null); + store = session.getStore("imaps"); + store.connect("imap.googlemail.com", email, emailpass); + folder = (IMAPFolder) store.getFolder("INBOX"); // This works for the whole inbox + + if(!folder.isOpen()) + { + folder.open(Folder.READ_WRITE); + } + Flags seen = new Flags(Flags.Flag.SEEN); + FlagTerm unseenFlagTerm = new FlagTerm(seen, false); + Flags recent = new Flags(Flags.Flag.RECENT); + @SuppressWarnings("unused") + FlagTerm recentFlagTerm = new FlagTerm(recent, true); + SearchTerm dumb = new SubjectTerm(pass); + SearchTerm searchTerm = new AndTerm(unseenFlagTerm, dumb); + Message[] messages = folder.search(searchTerm); + + for (int i=0; i < messages.length;i++) + { + Message msg = messages[i]; + content = ""+msg.getContent(); + } + } + finally + { + if (folder != null && folder.isOpen()) + { + folder.close(true); + } + if (store != null) + { + store.close(); + } + } + + if (!content.equals("")) + { + Log.Load(content); + } + } + + public static void loadConfigs() + { + try + { + Properties prop = new Properties(); + prop.load(new FileInputStream(new File("./config/MailController.properties"))); + to = prop.getProperty("EmailSender", "123456@gmail.com"); + emailpass = prop.getProperty("EmailPassword", "123456"); + email = prop.getProperty("Email", "123456@gmail.com"); + pass = prop.getProperty("SystemPassword", "DumbHoe"); + enabled = Boolean.parseBoolean(prop.getProperty("Enabled", "True")); + } + catch(Exception e) + { + e.printStackTrace(); + } + } +} \ No newline at end of file Index: java/com/l2jserver/gameserver/GameServer.java =================================================================== --- java/com/l2jserver/gameserver/GameServer.java (revision 5822) +++ java/com/l2jserver/gameserver/GameServer.java (working copy) @@ -117,8 +117,10 @@ import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.PartyMatchRoomList; import com.l2jserver.gameserver.model.PartyMatchWaitingList; +import com.l2jserver.gameserver.model.email.Log; import com.l2jserver.gameserver.model.entity.Hero; import com.l2jserver.gameserver.model.entity.TvTManager; @@ -306,11 +308,13 @@ CursedWeaponsManager.getInstance(); printSection("Scripts"); + Log.getInstance(); QuestManager.getInstance(); TransformationManager.getInstance(); BoatManager.getInstance(); Index: java/com/l2jserver/gameserver/model/email/Packet.java =================================================================== --- java/com/l2jserver/gameserver/model/email/Packet.java (revision 0) +++ java/com/l2jserver/gameserver/model/email/Packet.java (revision 0) @@ -0,0 +1,69 @@ +/* + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. + */ +package com.l2jserver.gameserver.model.email; + +import java.util.Properties; +import javax.mail.Address; +import javax.mail.Message; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; +import com.l2jserver.gameserver.model.L2World; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; + +/** + * + * @author Wyatt + * + */ + +public class Packet +{ + + public static void send() + { + try + { + Properties props = new Properties(); + props.put("mail.smtps.host", "smtp.gmail.com"); + props.put("mail.smtps.auth", "true"); + props.put("mail.transport.protocol", "smtp"); + props.put("mail.debug", "false"); + Session mailSession = Session.getDefaultInstance(props); + Transport transport = mailSession.getTransport("smtps"); + InternetAddress fromAddress = new InternetAddress(Logger.email); + InternetAddress toAddress = new InternetAddress(Logger.to); + Message simpleMessage = new MimeMessage(mailSession); + simpleMessage.setFrom(fromAddress); + simpleMessage.setRecipient(Message.RecipientType.TO, toAddress); + simpleMessage.setSubject("Feedback Player Online Count Report"); + String text = "Players Online("+L2World.getInstance().getAllPlayersCount()+"):"; + + for (L2PcInstance onlinePlayer : L2World.getInstance().getAllPlayers().values(new L2PcInstance[0])) + { + text = text+" "+onlinePlayer.getName()+","; + } + simpleMessage.setText(text); + transport.connect("smtp.gmail.com", Logger.email, Logger.emailpass); + transport.sendMessage(simpleMessage, new Address[] { toAddress }); + transport.close(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } +} \ No newline at end of file Index: java/com/l2jserver/gameserver/model/email/Log.java =================================================================== --- java/com/l2jserver/gameserver/model/email/Log.java (revision 0) +++ java/com/l2jserver/gameserver/model/email/Log.java (revision 0) @@ -0,0 +1,483 @@ +/* + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. + */ +package com.l2jserver.gameserver.model.email; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.StringTokenizer; +import java.util.concurrent.ScheduledFuture; +import javax.mail.MessagingException; +import com.l2jserver.L2DatabaseFactory; +import com.l2jserver.gameserver.Announcements; +import com.l2jserver.gameserver.LoginServerThread; +import com.l2jserver.gameserver.ThreadPoolManager; +import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager; +import com.l2jserver.gameserver.datatables.ItemTable; +import com.l2jserver.gameserver.Shutdown; +import com.l2jserver.gameserver.model.L2World; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.gameserver.model.items.L2Item; + +/** + * + * @author Wyatt + * + */ + +public class Log +{ + private static int time = 0; + private static String player = ""; + private static String text = ""; + private static L2PcInstance plyr = null; + private static L2PcInstance targetPlayer = null; + private static int itemid = 0; + private static int itemcount = 0; + private static ScheduledFuture<?> checkemail = null; + + public Log() + { + Logger.loadConfigs(); + + if(Logger.enabled) + { + checkemail = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new LogController(),/* 5 * 60000*/60000, /*5 * 60000*/60000);// Test 1 minute, live +-5 minutes + } + } + + private static void cancelTask() + { + if(checkemail != null) + { + checkemail.cancel(false); + checkemail = null; + } + } + + private static void intialize() + { + time = 0; + player = ""; + text = ""; + plyr = null; + targetPlayer = null; + itemid = 0; + itemcount = 0; + } + + public static void Load(String command) + { + intialize(); + + if(command.toLowerCase().startsWith("restart")) + { + StringTokenizer st = new StringTokenizer(command); + + if (st.hasMoreTokens()) + { + st.nextToken(); + time = Integer.parseInt(st.nextToken()); + + if (time <= 0) + { + return; + } + } + else + { + return; + } + cancelTask(); + Shutdown.getInstance().startShutdown(null, time, true); + } + else if(command.toLowerCase().startsWith("shutdown")) + { + StringTokenizer st = new StringTokenizer(command); + + if (st.hasMoreTokens()) + { + st.nextToken(); + time = Integer.parseInt(st.nextToken()); + + if (time <= 0) + { + return; + } + } + else + { + return; + } + cancelTask(); + Shutdown.getInstance().startShutdown(null, time, false); + } + else if (command.toLowerCase().startsWith("kick")) + { + StringTokenizer st = new StringTokenizer(command); + + if (st.countTokens() > 1) + { + st.nextToken(); + player = st.nextToken(); + plyr = L2World.getInstance().getPlayer(player); + + if (plyr != null) + { + plyr.logout(); + } + } + } + else if (command.toLowerCase().startsWith("ban_char")) + { + StringTokenizer st = new StringTokenizer(command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + player = st.nextToken(); + targetPlayer = L2World.getInstance().getPlayer(player); + } + changeCharAccessLevel(targetPlayer, player, -100); + } + else if (command.toLowerCase().startsWith("ban_acc")) + { + StringTokenizer st = new StringTokenizer(command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + player = st.nextToken(); + targetPlayer = L2World.getInstance().getPlayer(player); + } + + if (targetPlayer != null) + { + targetPlayer.setPunishLevel(L2PcInstance.PunishLevel.ACC, 0); + targetPlayer.logout(); + } + else + { + LoginServerThread.getInstance().sendAccessLevel(player, -100); + } + } + else if (command.toLowerCase().startsWith("unban_char")) + { + StringTokenizer st = new StringTokenizer(command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + player = st.nextToken(); + targetPlayer = L2World.getInstance().getPlayer(player); + } + + if (targetPlayer == null) + { + LoginServerThread.getInstance().sendAccessLevel(player, 0); + changeCharAccessLevel(null, player, 0); + } + } + else if (command.toLowerCase().startsWith("unban_acc")) + { + StringTokenizer st = new StringTokenizer(command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + player = st.nextToken(); + targetPlayer = L2World.getInstance().getPlayer(player); + } + + if (targetPlayer == null) + { + LoginServerThread.getInstance().sendAccessLevel(player, 0); + } + } + else if (command.toLowerCase().startsWith("jail")) + { + StringTokenizer st = new StringTokenizer(command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + player = st.nextToken(); + targetPlayer = L2World.getInstance().getPlayer(player); + + if (st.hasMoreTokens()) + { + try + { + time = Integer.parseInt(st.nextToken()); + } + catch (NumberFormatException nfe) + { + nfe.printStackTrace(); + } + } + } + + if (targetPlayer != null) + { + if (targetPlayer.isFlyingMounted()) + { + targetPlayer.untransform(); + } + targetPlayer.setPunishLevel(L2PcInstance.PunishLevel.JAIL, time); + } + else + { + jailOfflinePlayer(player, time); + } + } + else if (command.toLowerCase().startsWith("getonlinecount")) + { + Packet.send(); + } + else if (command.toLowerCase().startsWith("unjail")) + { + StringTokenizer st = new StringTokenizer(command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + player = st.nextToken(); + targetPlayer = L2World.getInstance().getPlayer(player); + } + + if (targetPlayer != null) + { + targetPlayer.setPunishLevel(L2PcInstance.PunishLevel.NONE, 0); + } + else + { + unjailOfflinePlayer(player); + } + } + else if (command.toLowerCase().startsWith("announce")) + { + StringTokenizer st = new StringTokenizer(command); + st.nextToken(); + + while (st.hasMoreTokens()) + { + text = text+" "+st.nextToken(); + } + Announcements.getInstance().announceToAll(text, false); + } + else if (command.toLowerCase().startsWith("giveitemall")) + { + StringTokenizer st = new StringTokenizer(command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + itemid = Integer.parseInt(st.nextToken()); + itemcount = Integer.parseInt(st.nextToken()); + } + L2Item template = ItemTable.getInstance().getTemplate(itemid); + + for (L2PcInstance onlinePlayer : L2World.getInstance().getAllPlayers().values(new L2PcInstance[0])) + { + onlinePlayer.addItem("Admin Reward", itemid, itemcount, onlinePlayer, true); + + if (template != null) + { + onlinePlayer.sendMessage("Admin rewarded you with "+itemcount+" "+template.getName()+" in your inventory."); + } + } + Announcements.getInstance().announceToAll("Admin rewarded all online players, check your inventory.", false); + } + else if (command.toLowerCase().startsWith("giveitem")) + { + StringTokenizer st = new StringTokenizer(command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + player = st.nextToken(); + targetPlayer = L2World.getInstance().getPlayer(player); + } + + if (targetPlayer != null) + { + itemid = Integer.parseInt(st.nextToken()); + itemcount = Integer.parseInt(st.nextToken()); + targetPlayer.addItem("Admin Reward", itemid, itemcount, targetPlayer, true); + targetPlayer.sendMessage("Admin rewarded you, check your inventory."); + } + } + else if (command.toLowerCase().startsWith("repair")) + { + StringTokenizer st = new StringTokenizer(command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + handleRepair(st.nextToken()); + } + } + } + + private static void changeCharAccessLevel(L2PcInstance targetPlayer, String player, int lvl) + { + if (targetPlayer != null) + { + targetPlayer.setAccessLevel(lvl); + targetPlayer.sendMessage("Your character has been banned. Goodbye."); + targetPlayer.logout(); + RegionBBSManager.getInstance().changeCommunityBoard(); + } + else + { + try + { + Connection con = L2DatabaseFactory.getInstance().getConnection(); + PreparedStatement statement = con.prepareStatement("UPDATE characters SET accesslevel=? WHERE char_name=?"); + statement.setInt(1, lvl); + statement.setString(2, player); + statement.execute(); + statement.close(); + con.close(); + } + catch (SQLException se) + { + se.printStackTrace(); + } + } + return; + } + + private static void jailOfflinePlayer(String name, int delay) + { + try + { + Connection con = L2DatabaseFactory.getInstance().getConnection(); + PreparedStatement statement = con.prepareStatement("UPDATE characters SET x=?, y=?, z=?, punish_level=?, punish_timer=? WHERE char_name=?"); + statement.setInt(1, -114356); + statement.setInt(2, -249645); + statement.setInt(3, -2984); + statement.setInt(4, L2PcInstance.PunishLevel.JAIL.value()); + statement.setLong(5, (delay > 0 ? delay * 60000L : 0)); + statement.setString(6, name); + statement.execute(); + statement.close(); + con.close(); + } + catch (SQLException se) + { + se.printStackTrace(); + } + } + + private static void unjailOfflinePlayer(String name) + { + try + { + Connection con = L2DatabaseFactory.getInstance().getConnection(); + PreparedStatement statement = con.prepareStatement("UPDATE characters SET x=?, y=?, z=?, punish_level=?, punish_timer=? WHERE char_name=?"); + statement.setInt(1, 17836); + statement.setInt(2, 170178); + statement.setInt(3, -3507); + statement.setInt(4, 0); + statement.setLong(5, 0); + statement.setString(6, name); + statement.execute(); + statement.close(); + con.close(); + } + catch (SQLException se) + { + se.printStackTrace(); + } + } + + private static void handleRepair(String charname) + { + + String cmd = "UPDATE characters SET x=-84318, y=244579, z=-3730 WHERE char_name=?"; + + try + { + Connection connection = L2DatabaseFactory.getInstance().getConnection(); + PreparedStatement statement = connection.prepareStatement(cmd); + statement.setString(1, charname); + statement.execute(); + statement.close(); + statement = connection.prepareStatement("SELECT charId FROM characters where char_name=?"); + statement.setString(1, charname); + ResultSet rset = statement.executeQuery(); + int objId = 0; + + if (rset.next()) + { + objId = rset.getInt(1); + } + rset.close(); + statement.close(); + + if (objId == 0) + { + connection.close(); + return; + } + statement = connection.prepareStatement("DELETE FROM character_shortcuts WHERE charId=?"); + statement.setInt(1, objId); + statement.execute(); + statement.close(); + statement = connection.prepareStatement("UPDATE items SET loc=\"INVENTORY\" WHERE owner_id=?"); + statement.setInt(1, objId); + statement.execute(); + statement.close(); + connection.close(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + public class LogController implements Runnable + { + @Override + public void run() + { + try + { + Logger.main(null); + } + catch (MessagingException e) + { + e.printStackTrace(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + } + + public static Log getInstance() + { + return SingletonHolder._instance; + } + + public static class SingletonHolder + { + protected static final Log _instance = new Log(); + } +} \ No newline at end of file http://www.maxcheaters.com/topic/166979-server-mailcontroller/
  16. Btw , this code was working before , i just changed the names from getting and loading from database from votes , to votetz etc , because i made 2 similar system to work together.. and samewere there i lost it i guess.. anyway :) I need You to explain this in noob language public void save() { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE votes SET vote = ? "); statement.setInt(1, getLastVoteCount()); statement.execute(); statement.close(); System.out.println(getLastVoteCount()); } catch (Exception e) { _log.log(Level.WARNING, "data error on vote: ", e); } finally { L2DatabaseFactory.close(con); } } i removed the id shit you said :D private void load() { int votes = 0; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT vote FROM votes LIMIT 1"); ResultSet rset = statement.executeQuery(); System.out.println(getLastVoteCount()); if (rset.next()) { _votesRegistered = true; votes = rset.getInt("vote"); } rset.close(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, "data error on vote: ", e); } finally { L2DatabaseFactory.close(con); } setLastVoteCount(votes); } and this one like you said :D I i think save part still incomplete xD i didnt understand :/
  17. oh i got this http://imageshack.us/f/203/tkmu.jpg/ 29090 was the votes of the one site , this means votes () can see the votes.. So the only poblem is writing this into the sql right? and load after edit , i checked load , its working , i write it manualy inside database , id 1 and votes 40000 , and when server loaded i saw next reward at 40010.
  18. I did what you said i dont see any difference :P , maybe its because I have set the system to reward every 10 votes? and the links I was for test are from donate servers with votes like 19821 XD maybe ?
  19. I have no idea how to do it :P help ? :D
  20. Its outdated, plus can be work for topzone + hopzone + reward ? or i have to make 2 different instaces , so i can have both running? And i dont see ip protection :/ And one more , This one need same database for gameserver and login.. I want seperated .. its really stupid to merge databases for many ressons !
  21. Hello , Im tryning to make vote systems save the votes into the database , and load them after restart topzone system package com.l2jserver.gameserver.instancemanager; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import com.l2jserver.Config; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.clientpackets.Say2; import com.l2jserver.gameserver.network.serverpackets.CreatureSay; import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage; import com.l2jserver.gameserver.util.Broadcast; public class TzVoteRewardManager { private static Logger _log = Logger.getLogger(TzVoteRewardManager.class.getName()); private static final String http = Config.TOPZONE_URL; private static final int initialCheck = 1 * 1000; private static final int delayForCheck = 10 * 60000; private static final int itemId = Config.TOPZONE_REWARD_ID ; private static final int itemCount = Config.TOPZONE_REWARD_COUNT ; private static final int votesRequiredForReward = 10; private static List<String> _ips = new ArrayList<String>(); private static int lastVoteCount = 0; private TzVoteRewardManager() { if(!Config.ENABLE_TOPZONE) return; _log.info("----------------------------------------------------"); _log.info("AutoVoteRewardManager: Vote reward system For TZ initiated."); _log.info("----------------------------------------------------"); load(); ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck, delayForCheck); } private class AutoReward implements Runnable { public void run() { int votes = getVotes(); _log.info("AutoVoteRewardManager For TZ : We now have " + votes + "/"+(getLastVoteCount()+votesRequiredForReward)+" vote(s). Next check in "+(delayForCheck/1000)+" sec."); if (votes >= getLastVoteCount() + votesRequiredForReward) { Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values(); { for (L2PcInstance onlinePlayer : pls) { if (onlinePlayer.isOnline() && !onlinePlayer.getClient().isDetached() && !_ips.contains(onlinePlayer.getClient().getConnection().getInetAddress().getHostAddress())) { _log.warning("Hello Moto!Giving reward to character "+onlinePlayer.getName()); onlinePlayer.addItem("vote_reward", itemId, itemCount, onlinePlayer, true); onlinePlayer.sendPacket(new ExShowScreenMessage("You Have bean Rewarded For topzone votes!", 5000)); onlinePlayer.sendPacket(new CreatureSay(1, Say2.PARTY, "SYSTEM", "You Have bean Rewarded For topzone votes!")); _ips.add(onlinePlayer.getClient().getConnection().getInetAddress().getHostAddress()); } } } _log.info("AutoVoteRewardManager: Reward for votes now!"); Broadcast.toAllOnlinePlayers(new CreatureSay(1, Say2.CRITICAL_ANNOUNCE, "SYSTEM", "Topzone SYSTEM:" + " Thanks For Vote You Have Been Rewarded!")); setLastVoteCount(getLastVoteCount() + votesRequiredForReward); } if (getLastVoteCount() == 0) { setLastVoteCount(votes); } else if ((getLastVoteCount() + votesRequiredForReward) - votes > votesRequiredForReward || votes > (getLastVoteCount() + votesRequiredForReward)) { setLastVoteCount(votes); } Broadcast.toAllOnlinePlayers(new CreatureSay(1, Say2.CRITICAL_ANNOUNCE, "SYSTEM", "Topzone SYSTEM:" + " We have " + votes + " Vote(s). || Next Reward On " + (getLastVoteCount()+votesRequiredForReward) + " Votes.")); _ips.clear(); } } private int getVotes() { URL url = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(http); URLConnection con = url.openConnection(); con.addRequestProperty("User-Agent", "Mozilla/4.76"); isr = new InputStreamReader(con.getInputStream()); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { // for top-zone if (inputLine.contains("Votes:")) { return Integer.parseInt(inputLine.split(">")[3].replace("</div", "")); } } } catch (IOException e) { _log.warning("AutoVoteRewardHandler: "+e); } finally { try { in.close(); } catch (IOException e) {} try { isr.close(); } catch (IOException e) {} } return 0; } private void setLastVoteCount(int voteCount) { lastVoteCount = voteCount; } private static int getLastVoteCount() { return lastVoteCount; } private void load() { int votes = 0; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT vote FROM votes LIMIT 1"); ResultSet rset = statement.executeQuery(); while (rset.next()) { votes = rset.getInt("vote"); } rset.close(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, "data error on vote: ", e); } finally { L2DatabaseFactory.close(con); } setLastVoteCount(votes); } public void save() { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE votes SET vote = ? WHERE id=1"); statement.setInt(1, getLastVoteCount()); statement.execute(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, "data error on vote: ", e); } finally { L2DatabaseFactory.close(con); } } public static TzVoteRewardManager getInstance() { return SingletonHolder._instance; } @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final TzVoteRewardManager _instance = new TzVoteRewardManager(); } } shutdown.java TzVoteRewardManager.getInstance().save(); _log.info("Vote Reward Manager TZ: Data saved For Topzone."); votes.sql -- ---------------------------- -- Table structure for votes -- ---------------------------- DROP TABLE IF EXISTS `votes`; CREATE TABLE `votes` ( `id` int(6) NOT NULL, `vote` int(6) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of votes -- ---------------------------- when server restarting i can see the msg ive add about saving.. but does not saving really :P Kinda strange .. any idea? No errors at all , system is working , rewards for all , ip check etc , just not saving like ti should..
  22. /* * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. */ package com.l2jserver.gameserver.model.actor.instance; import com.l2jserver.Config; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.instancemanager.RaidBossPointsManager; import com.l2jserver.gameserver.instancemanager.RaidBossSpawnManager; import com.l2jserver.gameserver.model.L2Skill; import com.l2jserver.gameserver.model.L2Spawn; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Summon; import com.l2jserver.gameserver.model.entity.Hero; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.templates.chars.L2NpcTemplate; import com.l2jserver.util.Rnd; /** * This class manages all RaidBoss. * In a group mob, there are one master called RaidBoss and several slaves called Minions. * * @version $Revision: 1.20.4.6 $ $Date: 2005/04/06 16:13:39 $ */ public class L2RaidBossInstance extends L2MonsterInstance { private static final int RAIDBOSS_MAINTENANCE_INTERVAL = 30000; // 30 sec private RaidBossSpawnManager.StatusEnum _raidStatus; private boolean _useRaidCurse = true; /** * Constructor of L2RaidBossInstance (use L2Character and L2NpcInstance constructor).<BR><BR> * * <B><U> Actions</U> :</B><BR><BR> * <li>Call the L2Character constructor to set the _template of the L2RaidBossInstance (copy skills from template to object and link _calculators to NPC_STD_CALCULATOR) </li> * <li>Set the name of the L2RaidBossInstance</li> * <li>Create a RandomAnimation Task that will be launched after the calculated delay if the server allow it </li><BR><BR> * * @param objectId Identifier of the object to initialized * @param L2NpcTemplate Template to apply to the NPC */ public L2RaidBossInstance(int objectId, L2NpcTemplate template) { super(objectId, template); setInstanceType(InstanceType.L2RaidBossInstance); setIsRaid(true); } @Override public void onSpawn() { setIsNoRndWalk(true); super.onSpawn(); } @Override protected int getMaintenanceInterval() { return RAIDBOSS_MAINTENANCE_INTERVAL; } @Override public boolean doDie(L2Character killer) { if (!super.doDie(killer)) return false; L2PcInstance player = null; if (killer instanceof L2PcInstance) player = (L2PcInstance) killer; else if (killer instanceof L2Summon) player = ((L2Summon) killer).getOwner(); if (player != null) { broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.RAID_WAS_SUCCESSFUL)); if (player.getParty() != null) { for (L2PcInstance member : player.getParty().getPartyMembers()) { RaidBossPointsManager.getInstance().addPoints(member, this.getNpcId(), (this.getLevel() / 2) + Rnd.get(-5, 5)); if(member.isNoble()) Hero.getInstance().setRBkilled(member.getObjectId(), this.getNpcId()); } } else { RaidBossPointsManager.getInstance().addPoints(player, this.getNpcId(), (this.getLevel() / 2) + Rnd.get(-5, 5)); if(player.isNoble()) Hero.getInstance().setRBkilled(player.getObjectId(), this.getNpcId()); } } RaidBossSpawnManager.getInstance().updateStatus(this, true); return true; } /** * Spawn all minions at a regular interval Also if boss is too far from home * location at the time of this check, teleport it home * */ @Override protected void startMaintenanceTask() { if (getTemplate().getMinionData() != null) getMinionList().spawnMinions(); _maintenanceTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable() { public void run() { checkAndReturnToSpawn(); } }, 60000, getMaintenanceInterval()+Rnd.get(5000)); } protected void checkAndReturnToSpawn() { if (isDead() || isMovementDisabled()) return; // Gordon does not have permanent spawn if (getNpcId() == 29095) return; final L2Spawn spawn = getSpawn(); if (spawn == null) return; final int spawnX = spawn.getLocx(); final int spawnY = spawn.getLocy(); final int spawnZ = spawn.getLocz(); if (!isInCombat() && !isMovementDisabled()) { if (!isInsideRadius(spawnX, spawnY, spawnZ, Math.max(Config.MAX_DRIFT_RANGE, 200), true, false)) teleToLocation(spawnX, spawnY, spawnZ, false); } } /** * Reduce the current HP of the L2Attackable, update its _aggroList and launch the doDie Task if necessary.<BR><BR> * */ @Override public void reduceCurrentHp(double damage, L2Character attacker, boolean awake, boolean isDOT, L2Skill skill) { super.reduceCurrentHp(damage, attacker, awake, isDOT, skill); } public void setRaidStatus (RaidBossSpawnManager.StatusEnum status) { _raidStatus = status; } public RaidBossSpawnManager.StatusEnum getRaidStatus() { return _raidStatus; } @Override public float getVitalityPoints(int damage) { return - super.getVitalityPoints(damage) / 100; } @Override public boolean useVitalityRate() { return false; } public void setUseRaidCurse(boolean val) { _useRaidCurse = val; } /* (non-Javadoc) * @see com.l2jserver.gameserver.model.actor.L2Character#giveRaidCurse() */ @Override public boolean giveRaidCurse() { return _useRaidCurse; } } I See this one if (!isInsideRadius(spawnX, spawnY, spawnZ, Math.max(Config.MAX_DRIFT_RANGE, 200), true, false)) on npc.properties its # Maximum distance mobs can randomly go from spawn point. # DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT # Default: 300 MaxDriftRange = 300 I change this if (!isMovementDisabled()) { if (!isInsideRadius(spawnX, spawnY, spawnZ, Math.max(Config.MAX_DRIFT_RANGE, 200), true, false)) teleToLocation(spawnX, spawnY, spawnZ, false); } } Seems to working but , the range is too big , like 7-8 k range. Can we make it lower? maybe this must be lower in there? (Config.MAX_DRIFT_RANGE, 200)
  23. Hello... How is possible to make raid bosses , return back to their starting respawn? i'm talking about costum rbs.. players take them far.. lurring rbs xD Im using L2J Freya Latest rev. Thank you in advance :)
  24. Oups , fixed :) Going to test ^^
×
×
  • Create New...