Jump to content

B1ggBoss

Legendary Member
  • Posts

    494
  • Credits

  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Everything posted by B1ggBoss

  1. You want that each time that a player logs in the server, all players feels an earthquake?
  2. i still dont understand why you use "string" + "string" + etc... Also, you dont need to specify the table name before the column to call
  3. obviously, the amount that the mob drops is a number between the min (1000000) and the max (1500000), not one of those and not always the same, thats why you get 1200000-1250000
  4. the adena rate is the amount to be droped, not the chance chance is always: 1000000 = 100%. What you have to mod is the min and max to be dropped, you can get the number you have to put by: Adena i want to drop / Adena Rate
  5. You should edit this <table name="#power"> 96 99 102 105 108 </table> Each number is the power that the skill has in each level lvl 1 > power 96 lvl 2 > power 99 lvl 3 > power 102 etc... Take care that, those numbers are not the final values that skill has, are used as parameters to caluclate the damage in the class Formulas.java So, you'll need to make some test to adjust it :)
  6. use PreparedStatement statement = con.prepareStatement("SELECT charId, char_name FROM characters WHERE account_name = ?"); statement.setString(1, "The_Account_name_goes_here"); Your error is caused because you dont let spaces anywhere, and the mysql engine cannot distinct between commands, columns and parameters
  7. It will dissapear, there wont be any icon in the inventory. Of course, you should do it while server is offline
  8. this is a test i made after see that the voiced commands in interlude alredy support parameters for them. Screen: Code: Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Test.java =================================================================== --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Test.java (revision 0) +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Test.java (revision 0) @@ -0,0 +1,50 @@ +/* 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 net.sf.l2j.gameserver.handler.voicedcommandhandlers; + +import net.sf.l2j.gameserver.clientpackets.Say2; +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.serverpackets.CreatureSay; + +/** + * + * @author BiggBoss + */ +public class Test implements IVoicedCommandHandler +{ + private static final String[] COMMAND = {"test"}; + + /** + * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList() + */ + public String[] getVoicedCommandList() + { + return COMMAND; + } + + /** + * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String) + */ + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) + { + final CreatureSay say = new CreatureSay(activeChar.getObjectId(), Say2.SHOUT, activeChar.getName(), target); + activeChar.broadcastPacket(say); + return false; + } +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- java/net/sf/l2j/gameserver/GameServer.java (revision 4462) +++ java/net/sf/l2j/gameserver/GameServer.java (working copy) @@ -196,6 +196,7 @@ import net.sf.l2j.gameserver.handler.usercommandhandlers.OlympiadStat; import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo; import net.sf.l2j.gameserver.handler.usercommandhandlers.Time; +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Test; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats; import net.sf.l2j.gameserver.idfactory.IdFactory; @@ -589,6 +590,7 @@ _voicedCommandHandler = VoicedCommandHandler.getInstance(); _voicedCommandHandler.registerVoicedCommandHandler(new stats()); + _voicedCommandHandler.registerVoicedCommandHandler(new Test()); if(Config.L2JMOD_ALLOW_WEDDING) _voicedCommandHandler.registerVoicedCommandHandler(new Wedding());
  9. here. I made it to show you how its done. As you can see, its inside a method called onAdvEvent, a method that can be inherited from Quest class that is in charge of parse the quest htmls bypasses
  10. you cannot edit "mmocore.jar". Its a compiled class library and cannot be edited. You have to download the source ( http://svn.l2jserver.com/trunk/MMOCore/ ), edit and then compile
  11. - Gatekeeper -> its just like a normal gk, nothing special to see - Subclass Manager -> its the same as in the npc temples - Boss respawn info -> i forgot it, but its close to that one posted in the forum - Olympiad Manager -> its the same as in the olympiad npc - Pvp & Pk Top -> i forgot it :P and just accept paypal
  12. 1) You have to modify the parse method. Right now, the voiced handler is getting as: handlerMap.get(command); etc if you write .sendMessage bla bla bla, obviously, the command wont equals to the voiced handler name you should change to String start = command.split(" "); if(start.lenght < 2) return null; handlerMap.get(start[0]); Then, in the voiced handler, forget about String target, just use command.split(" ");
  13. for a quest script... public String onAdvEvent(L2Npc npc, L2PcInstance player, String event) { String html = event; if(event.startsWith("buyskill") { String[] split = event.split("_"); if(split.lenght < 3) { //Handle a warning or something... html = "error.htm"; } else { int id = 0, lvl = 0; try { id = Integer.parseInt(split[1]); lvl = Integer.parseInt(split[2]); } catch(NumberFormatException nfe) { //Handle it } if(id > 0 && lvl > 0) { final L2Skill sk = SkillTable.getInstance().getInfo(id, lvl); if(sk == null) html = "noexist.htm"; else if(....) { //Check if the skill exsist into the allowed skills to buy //otherwise, player could buy any skill by modding the packet } else { if(player.destroyItemByItemId("SkillBuy", YOUR_ITEM_ID, YOUR_ITEM_AMOUNT, npc, true)) { player.addSkill(sk, true); //true = save to database player.sendSkillList(); html = "buysuccess.htm"; } else html = "notenoughitems.htm"; } } } } return html; }
  14. to apply and run this code you have to create a new table in database called custom_hero (with 1 column called objectId (INT, 10)) Those object ids from players who you add there will be permanent heros
  15. Index: java/com/l2jserver/gameserver/GameServer.java =================================================================== --- java/com/l2jserver/gameserver/GameServer.java (revision 4492) +++ java/com/l2jserver/gameserver/GameServer.java (working copy) @@ -41,6 +41,7 @@ import com.l2jserver.gameserver.datatables.CharNameTable; import com.l2jserver.gameserver.datatables.CharTemplateTable; import com.l2jserver.gameserver.datatables.ClanTable; +import com.l2jserver.gameserver.datatables.CustomHeroTable; import com.l2jserver.gameserver.datatables.DoorTable; import com.l2jserver.gameserver.datatables.EnchantGroupsTable; import com.l2jserver.gameserver.datatables.EnchantHPBonusData; @@ -405,6 +406,7 @@ TvTManager.getInstance(); KnownListUpdateTaskManager.getInstance(); + CustomHeroTable.getInstance(); if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS) OfflineTradersTable.restoreOfflineTraders(); Index: java/com/l2jserver/gameserver/Shutdown.java =================================================================== --- java/com/l2jserver/gameserver/Shutdown.java (revision 4492) +++ java/com/l2jserver/gameserver/Shutdown.java (working copy) @@ -21,6 +21,7 @@ import com.l2jserver.Config; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.datatables.ClanTable; +import com.l2jserver.gameserver.datatables.CustomHeroTable; import com.l2jserver.gameserver.datatables.OfflineTradersTable; import com.l2jserver.gameserver.instancemanager.CastleManorManager; import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager; @@ -539,6 +540,8 @@ ClanTable.getInstance().storeClanScore(); _log.info("Clan System: Data saved!!"); + CustomHeroTable.getInstance().saveHeros(); + // Save Cursed Weapons data before closing. CursedWeaponsManager.getInstance().saveData(); Index: java/com/l2jserver/gameserver/datatables/CustomHeroTable.java =================================================================== --- java/com/l2jserver/gameserver/datatables/CustomHeroTable.java (revision 0) +++ java/com/l2jserver/gameserver/datatables/CustomHeroTable.java (revision 0) @@ -0,0 +1,127 @@ +package com.l2jserver.gameserver.datatables; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashSet; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.l2jserver.L2DatabaseFactory; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; + +public class CustomHeroTable +{ + private static final class SingletonHolder + { + private static final CustomHeroTable INSTANCE = new CustomHeroTable(); + } + + private static final Logger _log = Logger.getLogger(CustomHeroTable.class.getName()); + + private static final String SQL_LOAD_HERO = "SELECT objecId FROM custom_hero"; + private static final String SQL_DEL_HERO = "DELETE FROM custom_hero"; + private static final String SQL_SAVE_HERO = "INSERT INTO custom_hero VALUES ( ? )"; + + private Set<Integer> _heros; + + private CustomHeroTable() + { + _heros = new HashSet<Integer>(); + loadHeros(); + } + + private final void loadHeros() + { + Connection con = null; + try + { + con = L2DatabaseFactory.getInstance().getConnection(); + PreparedStatement st = con.prepareStatement(SQL_LOAD_HERO); + ResultSet rset = st.executeQuery(); + while(rset.next()) + { + final int objId = rset.getInt("objectId"); + if(!addHero(objId)) + _log.warning(">>> CustomHeroTable.loadHeros(): Duplicated object id in custom_hero table!"); + } + _log.config("CustomHeroTable: Loaded "+_heros.size()+" custom Heroes!"); + } + catch(SQLException e) + { + _log.log(Level.SEVERE, "CustomHeroTable.loadHeros()", e); + } + finally + { + L2DatabaseFactory.close(con); + } + } + + public final void saveHeros() + { + Connection con = null; + try + { + con = L2DatabaseFactory.getInstance().getConnection(); + + PreparedStatement st = con.prepareStatement(SQL_DEL_HERO); + st.execute(); + st.close(); + + for(int hero : _heros) + { + PreparedStatement heroSt = con.prepareStatement(SQL_SAVE_HERO); + heroSt.setInt(1, hero); + heroSt.execute(); + heroSt.close(); + } + _log.config("CustomHeroTable: Suscessfully saved "+_heros.size()+" custom Heroes to database!"); + } + catch(SQLException e) + { + _log.log(Level.SEVERE, "CustomHeroTable.saveHeros()", e); + } + finally + { + L2DatabaseFactory.close(con); + } + } + + public void onEnter(L2PcInstance plr) + { + if(_heros.contains(plr.getObjectId())) + plr.setHero(true); + } + + /* + * Following methods may be used for admin commands + * or the way to become custom hero for example + */ + + public boolean addHero(L2PcInstance plr) + { + return addHero(plr.getObjectId()); + } + + public boolean addHero(int objectId) + { + return _heros.add(objectId); + } + + public boolean removeHero(L2PcInstance plr) + { + return removeHero(plr.getObjectId()); + } + + public boolean removeHero(int objectId) + { + return _heros.remove(objectId); + } + + public static CustomHeroTable getInstance() + { + return SingletonHolder.INSTANCE; + } +} Index: java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java =================================================================== --- java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (revision 4492) +++ java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (working copy) @@ -27,6 +27,7 @@ import com.l2jserver.gameserver.cache.HtmCache; import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager; import com.l2jserver.gameserver.datatables.AdminCommandAccessRights; +import com.l2jserver.gameserver.datatables.CustomHeroTable; import com.l2jserver.gameserver.datatables.GMSkillTable; import com.l2jserver.gameserver.datatables.MapRegionTable; import com.l2jserver.gameserver.datatables.SkillTable; @@ -188,6 +189,8 @@ if (activeChar.getCurrentHp() < 0.5) activeChar.setIsDead(true); + CustomHeroTable.getInstance().onEnter(activeChar); + boolean showClanNotice = false; // Clan related checks are here l2jserver, freya last revision
  16. http://www.maxcheaters.com/forum/index.php?topic=197096.0 to [Request] Client Mods Help
  17. 10001 skill has "isPotion" val="true" (obvisouly, it means its a potion skill) The condition you are telling us to erase is exactly the restriction for all items except potions, so i recommend you to test your "suggestions" before advice other ppl about wrong statements
  18. network/clientpackets/UseItem.java // No UseItem is allowed while the player is in special conditions if (activeChar.isStunned() || activeChar.isSleeping() || activeChar.isParalyzed() || activeChar.isAlikeDead() || activeChar.isAfraid() || activeChar.isCastingNow()) { return; self-explanatory i guess
  19. rename L2jFrozen_GameServer_tests to L2jFronzen_GameServer
  20. why do you ask for help if you dont even read the answer we provide you? In the second post i told you to add them into raidboss_spawnlist table, where you have to put the respawn time and the min and max delay
×
×
  • Create New...