Jump to content

Leon29

Members
  • Posts

    42
  • Credits

  • Joined

  • Last visited

    Never
  • Feedback

    0%

Everything posted by Leon29

  1. up .. :'( edit: fixed :D an mod can lock the topic.
  2. hmmm it worked ( i changed the time to 18:56 ) and i've got 236000ms that means 4mins(3.9) but why it never select an event king ?
  3. Why this code is not workin` /* 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.l2jserver.gameserver.model.entity; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Calendar; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.Announcements; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; public class EventTask { public static void getInstance() { ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { public void run() { String currentEventKing = null, newEventKing = null; int topEventKills = 0; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement stm = con.prepareStatement("SELECT char_name FROM characters WHERE EventKing=? AND accesslevel=?"); stm.setInt(1, 1); stm.setInt(2, 1); ResultSet rSet = stm.executeQuery(); if (rSet.next()) { currentEventKing = rSet.getString("char_name"); } rSet.close(); stm.close(); if (currentEventKing != null) { boolean cont = false; L2PcInstance cEventKing = L2World.getInstance().getPlayer(currentEventKing); if (cEventKing == null || cEventKing.isOnline() == 0) { cont = true; } else { cEventKing.setEventKing(false); cEventKing.broadcastUserInfo(); } if (cont) { stm = con.prepareStatement("UPDATE characters SET EventKing=? WHERE char_name=?"); stm.setInt(1, 0); stm.setString(2, currentEventKing); stm.execute(); stm.close(); } } stm = con.prepareStatement("SELECT eventkills,char_name FROM characters WHERE accesslevel=? ORDER BY eventkills DESC LIMIT 1"); stm.setInt(1, 0); rSet = stm.executeQuery(); if (rSet.next()) { newEventKing = rSet.getString("char_name"); topEventKills = rSet.getInt("eventkills"); } rSet.close(); stm.close(); boolean cont = false; L2PcInstance nEventKing = L2World.getInstance().getPlayer(newEventKing); if (nEventKing == null || nEventKing.isOnline() == 0) { cont = true; } else { nEventKing.setEventKing(true); nEventKing.broadcastUserInfo(); } if (cont) { stm = con.prepareStatement("UPDATE characters SET EventKing=? WHERE char_name=?"); stm.setInt(1, 1); stm.setString(2, newEventKing); stm.execute(); stm.close(); } stm = con.prepareStatement("UPDATE characters SET eventkills=?"); stm.setInt(1, 0); stm.execute(); stm.close(); Announcements.getInstance().announceToAll("New event king: "+newEventKing); } catch (Exception e) { } finally { try { con.close(); } catch (Exception e) { } } } } , getValidationTime()); } private static long getValidationTime() { Calendar cld = Calendar.getInstance(); cld.set(Calendar.HOUR_OF_DAY, 19); cld.set(Calendar.MINUTE, 0); cld.set(Calendar.SECOND, 0); long time = cld.getTimeInMillis(); if (System.currentTimeMillis()-time <= 0) { return time; } return 0; } } i used this System.out.println("[DEBUG-EVENT] Time left: "+getValidationTime()); before ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() and it worked ( i've got it in console like [DEBUG-EVENT] Time left: 13859604932849 i don't know why the fuck i got this time :|)
  4. :) i want it for epilogue ... i tried to take it from freya but without success :'( i need a patch ..
  5. Can someone give me a link with conqurable halls ? the link from http://maxcheaters.com/forum/index.php?topic=177787.0 don't work :(
  6. i found SiegeManager.java in gameserver.instancemanager but i can't see anything useful :-? /* * 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.instancemanager; import gnu.trove.TIntObjectHashMap; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.List; import java.util.Properties; import java.util.StringTokenizer; import java.util.logging.Level; import java.util.logging.Logger; import javolution.util.FastList; import com.l2jserver.Config; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.model.L2Clan; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2Skill; import com.l2jserver.gameserver.model.Location; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.Castle; import com.l2jserver.gameserver.model.entity.Siege; public class SiegeManager { private static final Logger _log = Logger.getLogger(SiegeManager.class.getName()); public static final SiegeManager getInstance() { return SingletonHolder._instance; } // ========================================================= // Data Field private int _attackerMaxClans = 500; // Max number of clans private int _attackerRespawnDelay = 0; // Time in ms. Changeable in siege.config private int _defenderMaxClans = 500; // Max number of clans // Siege settings private TIntObjectHashMap<FastList<SiegeSpawn>> _artefactSpawnList; private TIntObjectHashMap<FastList<SiegeSpawn>> _controlTowerSpawnList; private TIntObjectHashMap<FastList<SiegeSpawn>> _flameTowerSpawnList; private int _flagMaxCount = 1; // Changeable in siege.config private int _siegeClanMinLevel = 5; // Changeable in siege.config private int _siegeLength = 120; // Time in minute. Changeable in siege.config private int _bloodAllianceReward = 0; // Number of Blood Alliance items reward for successful castle defending // ========================================================= // Constructor private SiegeManager() { _log.info("Initializing SiegeManager"); load(); } // ========================================================= // Method - Public public final void addSiegeSkills(L2PcInstance character) { for (L2Skill sk : SkillTable.getInstance().getSiegeSkills(character.isNoble(), character.getClan().getHasCastle() > 0)) { character.addSkill(sk, false); } } /** * Return true if character summon<BR><BR> * @param activeChar The L2Character of the character can summon */ public final boolean checkIfOkToSummon(L2Character activeChar, boolean isCheckOnly) { if (!(activeChar instanceof L2PcInstance)) return false; String text = ""; L2PcInstance player = (L2PcInstance) activeChar; Castle castle = CastleManager.getInstance().getCastle(player); if (castle == null || castle.getCastleId() <= 0) text = "You must be on castle ground to summon this"; else if (!castle.getSiege().getIsInProgress()) text = "You can only summon this during a siege."; else if (player.getClanId() != 0 && castle.getSiege().getAttackerClan(player.getClanId()) == null) text = "You can only summon this as a registered attacker."; else return true; if (!isCheckOnly) player.sendMessage(text); return false; } /** * Return true if the clan is registered or owner of a castle<BR><BR> * @param clan The L2Clan of the player */ public final boolean checkIsRegistered(L2Clan clan, int castleid) { if (clan == null) return false; if (clan.getHasCastle() > 0) return true; Connection con = null; boolean register = false; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT clan_id FROM siege_clans where clan_id=? and castle_id=?"); statement.setInt(1, clan.getClanId()); statement.setInt(2, castleid); ResultSet rs = statement.executeQuery(); while (rs.next()) { register = true; break; } rs.close(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, "Exception: checkIsRegistered(): " + e.getMessage() ,e); } finally { L2DatabaseFactory.close(con); } return register; } public final void removeSiegeSkills(L2PcInstance character) { for (L2Skill sk : SkillTable.getInstance().getSiegeSkills(character.isNoble(), character.getClan().getHasCastle() > 0)) { character.removeSkill(sk); } } // ========================================================= // Method - Private private final void load() { InputStream is = null; try { is = new FileInputStream(new File(Config.SIEGE_CONFIGURATION_FILE)); Properties siegeSettings = new Properties(); siegeSettings.load(is); // Siege setting _attackerMaxClans = Integer.decode(siegeSettings.getProperty("AttackerMaxClans", "500")); _attackerRespawnDelay = Integer.decode(siegeSettings.getProperty("AttackerRespawn", "0")); _defenderMaxClans = Integer.decode(siegeSettings.getProperty("DefenderMaxClans", "500")); _flagMaxCount = Integer.decode(siegeSettings.getProperty("MaxFlags", "1")); _siegeClanMinLevel = Integer.decode(siegeSettings.getProperty("SiegeClanMinLevel", "5")); _siegeLength = Integer.decode(siegeSettings.getProperty("SiegeLength", "120")); _bloodAllianceReward = Integer.decode(siegeSettings.getProperty("BloodAllianceReward", "0")); // Siege spawns settings _controlTowerSpawnList = new TIntObjectHashMap<FastList<SiegeSpawn>>(); _artefactSpawnList = new TIntObjectHashMap<FastList<SiegeSpawn>>(); _flameTowerSpawnList = new TIntObjectHashMap<FastList<SiegeSpawn>>(); for (Castle castle : CastleManager.getInstance().getCastles()) { FastList<SiegeSpawn> _controlTowersSpawns = new FastList<SiegeSpawn>(); for (int i = 1; i < 0xFF; i++) { String _spawnParams = siegeSettings.getProperty(castle.getName() + "ControlTower" + i, ""); if (_spawnParams.isEmpty()) break; StringTokenizer st = new StringTokenizer(_spawnParams.trim(), ","); try { int x = Integer.parseInt(st.nextToken()); int y = Integer.parseInt(st.nextToken()); int z = Integer.parseInt(st.nextToken()); int npc_id = Integer.parseInt(st.nextToken()); int hp = Integer.parseInt(st.nextToken()); _controlTowersSpawns.add(new SiegeSpawn(castle.getCastleId(), x, y, z, 0, npc_id, hp)); } catch (Exception e) { _log.warning("Error while loading control tower(s) for " + castle.getName() + " castle."); } } FastList<SiegeSpawn> _flameTowersSpawns = new FastList<SiegeSpawn>(); for (int i = 1; i < 0xFF; i++) { String _spawnParams = siegeSettings.getProperty(castle.getName() + "FlameTower" + i, ""); if (_spawnParams.isEmpty()) break; StringTokenizer st = new StringTokenizer(_spawnParams.trim(), ","); try { int x = Integer.parseInt(st.nextToken()); int y = Integer.parseInt(st.nextToken()); int z = Integer.parseInt(st.nextToken()); int npc_id = Integer.parseInt(st.nextToken()); int hp = Integer.parseInt(st.nextToken()); _flameTowersSpawns.add(new SiegeSpawn(castle.getCastleId(), x, y, z, 0, npc_id, hp)); } catch (Exception e) { _log.warning("Error while loading artefact(s) for " + castle.getName() + " castle."); } } FastList<SiegeSpawn> _artefactSpawns = new FastList<SiegeSpawn>(); for (int i = 1; i < 0xFF; i++) { String _spawnParams = siegeSettings.getProperty(castle.getName() + "Artefact" + i, ""); if (_spawnParams.isEmpty()) break; StringTokenizer st = new StringTokenizer(_spawnParams.trim(), ","); try { int x = Integer.parseInt(st.nextToken()); int y = Integer.parseInt(st.nextToken()); int z = Integer.parseInt(st.nextToken()); int heading = Integer.parseInt(st.nextToken()); int npc_id = Integer.parseInt(st.nextToken()); _artefactSpawns.add(new SiegeSpawn(castle.getCastleId(), x, y, z, heading, npc_id)); } catch (Exception e) { _log.warning("Error while loading artefact(s) for " + castle.getName() + " castle."); } } _controlTowerSpawnList.put(castle.getCastleId(), _controlTowersSpawns); _artefactSpawnList.put(castle.getCastleId(), _artefactSpawns); _flameTowerSpawnList.put(castle.getCastleId(), _flameTowersSpawns); } } catch (Exception e) { //_initialized = false; _log.log(Level.WARNING, "Error while loading siege data: " + e.getMessage(), e); } finally { try { is.close(); } catch (Exception e) { } } } // ========================================================= // Property - Public public final FastList<SiegeSpawn> getArtefactSpawnList(int _castleId) { return _artefactSpawnList.get(_castleId); } public final FastList<SiegeSpawn> getControlTowerSpawnList(int _castleId) { return _controlTowerSpawnList.get(_castleId); } public final FastList<SiegeSpawn> getFlameTowerSpawnList(int _castleId) { return _flameTowerSpawnList.get(_castleId); } public final int getAttackerMaxClans() { return _attackerMaxClans; } public final int getAttackerRespawnDelay() { return _attackerRespawnDelay; } public final int getDefenderMaxClans() { return _defenderMaxClans; } public final int getFlagMaxCount() { return _flagMaxCount; } public final Siege getSiege(L2Object activeObject) { return getSiege(activeObject.getX(), activeObject.getY(), activeObject.getZ()); } public final Siege getSiege(int x, int y, int z) { for (Castle castle : CastleManager.getInstance().getCastles()) if (castle.getSiege().checkIfInZone(x, y, z)) return castle.getSiege(); return null; } public final int getSiegeClanMinLevel() { return _siegeClanMinLevel; } public final int getSiegeLength() { return _siegeLength; } public final int getBloodAllianceReward() { return _bloodAllianceReward; } public final List<Siege> getSieges() { FastList<Siege> sieges = new FastList<Siege>(); for (Castle castle : CastleManager.getInstance().getCastles()) sieges.add(castle.getSiege()); return sieges; } public class SiegeSpawn { Location _location; private int _npcId; private int _heading; private int _castleId; private int _hp; public SiegeSpawn(int castle_id, int x, int y, int z, int heading, int npc_id) { _castleId = castle_id; _location = new Location(x, y, z, heading); _heading = heading; _npcId = npc_id; } public SiegeSpawn(int castle_id, int x, int y, int z, int heading, int npc_id, int hp) { _castleId = castle_id; _location = new Location(x, y, z, heading); _heading = heading; _npcId = npc_id; _hp = hp; } public int getCastleId() { return _castleId; } public int getNpcId() { return _npcId; } public int getHeading() { return _heading; } public int getHp() { return _hp; } public Location getLocation() { return _location; } } @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final SiegeManager _instance = new SiegeManager(); } } edit: and in siege.java i found /** Display list of registered clans */ public void listRegisterClan(L2PcInstance player) { player.sendPacket(new SiegeInfo(getCastle())); } /** * Register clan as attacker<BR><BR> * @param player The L2PcInstance of the player trying to register */ public void registerAttacker(L2PcInstance player) { registerAttacker(player, false); } public void registerAttacker(L2PcInstance player, boolean force) { if (player.getClan() == null) return; int allyId = 0; if (getCastle().getOwnerId() != 0) allyId = ClanTable.getInstance().getClan(getCastle().getOwnerId()).getAllyId(); if (allyId != 0) { if (player.getClan().getAllyId() == allyId && !force) { player.sendPacket(new SystemMessage(SystemMessageId.CANNOT_ATTACK_ALLIANCE_CASTLE)); return; } } if (force || checkIfCanRegister(player, ATTACKER)) saveSiegeClan(player.getClan(), ATTACKER, false); // Save to database } /** * Register clan as defender<BR><BR> * @param player The L2PcInstance of the player trying to register */ public void registerDefender(L2PcInstance player) { registerDefender(player, false); }
  7. did you added antibot.java and captcha.java in data/scripts/handlers/voicedcommandhandlers ? :)
  8. 1. remove == 1 so it will be target.IsOnline() 2. template1.isType("L2Hitman")
  9. how can i make an siege manager npc i mean is there any bypass ? I want to add all castles in one npc ..
  10. make it yourself if you don't like this one :)
  11. i added it to l2j epilogue without any problem :) ( only one small warning but i fixed it ), try to add it manually if is not working..
  12. hmm shouldn't he look at line at ai.individual.QueenAnt.onKill(QueenAnt.java:312) ?
  13. off : maluku wtf is this name :)) on: good luck :) edit: and wtf is "In tow whe have new songs" ?
  14. http://www.4shared.com/zip/hVmKn_XM/Goddess_of_Destruction_Armors_.html one google search ...
  15. wow OP donators =] another fail server ::)
  16. nice but you posted it in a wrong section... you should post it here: http://maxcheaters.com/forum/index.php?board=138.0
  17. click "Manage Buffs" then enable the buff you added on db :)
  18. add it to your system in system/itemname-e.dat system/etcitemgrp.dat
  19. and don't forget to add the item to your system :D
  20. in skills folder: <skill id="SKILL-ID" levels="1" name="BOX NAME"> <table name="#extractableItems"> ITEM-ID,ITEM-AMOUNT,ITEM-RATE; </table> <set name="isMagic" val="2" /> <!-- Static Skill --> <set name="capsuled_items_skill" val="#extractableItems" /> <set name="itemConsumeCount" val="1" /> <set name="operateType" val="A1" /> <set name="target" val="TARGET_SELF" /> </skill> in items folder: <item id="ITEM-ID" type="EtcItem" name="Box Name"> <set name="icon" val="icon.etc_box_of_adventure_1_i00" /> <set name="default_action" val="capsule" /> <set name="immediate_effect" val="1" /> <set name="material" val="paper" /> <set name="is_stackable" val="true" /> <set name="handler" val="ItemSkills" /> <set name="item_skill" val="YOUR BOX SKILL ID" /> </item> it should work :D
×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock