janiko
Members-
Posts
205 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by janiko
-
Fixed thanks :)
-
Can anyone tell me whats problem? compile: [javac] gameserver\communitybbs\Manager\BuffBBSManager.java:1: error: illegal character: \187 [javac] package l2j.server.gameserver.communitybbs.Manager; [javac] ^ [javac] gameserver\communitybbs\Manager\BuffBBSManager.java:1: error: illegal character: \191 [javac] package l2.brick.gameserver.communitybbs.Manager; [javac] ^ [javac] 2 errors package l2j.server.gameserver.communitybbs.Manager; import java.util.StringTokenizer; import java.util.logging.Logger; import java.util.Map; import java.util.Map.Entry; import javolution.text.TextBuilder; import l2j.server.gameserver.cache.HtmCache; import l2j.server.gameserver.datatables.BuffBBSTable; import l2j.server.gameserver.datatables.BuffBBSTable.BBSGroupBuffStat; import l2j.server.gameserver.datatables.SkillTable; import l2j.server.gameserver.model.L2Skill; import l2j.server.gameserver.model.actor.L2Character; import l2j.server.gameserver.model.actor.instance.L2PcInstance; import l2j.server.gameserver.util.Util; public class BuffBBSManager extends BaseBBSManager { private static BuffBBSManager _instance = new BuffBBSManager(); private static Logger _log = Logger.getLogger(BuffBBSManager.class.getName()); public static BuffBBSManager getInstance() { if (_instance == null) _instance = new BuffBBSManager(); return _instance; } public void parsecmd(String command, L2PcInstance activeChar) { TextBuilder html = new TextBuilder(""); int bufPet = 0; int idGroup = 0; String name = ""; html.clear(); html.append("<center>"); html.append("<table>"); html.append("<tr>"); for (Map.Entry entry : BuffBBSTable.getInstance().getBBSGroups().entrySet()) { idGroup = ((Integer)entry.getKey()).intValue(); name = ((BuffBBSTable.BBSGroupBuffStat)entry.getValue()).getName(); html.append("<td>"); html.append("<button value=\"" + name + "\" action=\"bypass -h _bbs_buff;" + idGroup + "\" width=90 height=25 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">"); html.append("</td>"); } html.append("</tr>"); html.append("</table>"); html.append("</center><br><br>"); String buffer_top = html.toString(); html.clear(); html.append("<center>"); html.append("<table>"); html.append("<tr>"); html.append("<td>"); html.append("<button value=\"Save Buff\" action=\"bypass -h _bbs_buff_save\" width=200 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">"); html.append("</td>"); html.append("<td>"); html.append("<button value=\"Saved Buff\" action=\"bypass -h _bbs_buff_load\" width=200 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">"); html.append("</td>"); html.append("</tr>"); html.append("</table>"); html.append("</center>"); String buffer_bottom = html.toString(); if ((activeChar.getPet() != null) && (activeChar.getTarget() == activeChar.getPet())) bufPet = 1; if (command.startsWith("_bbs_buff;")) { StringTokenizer st = new StringTokenizer(command, ";"); st.nextToken(); int idGrp = Integer.parseInt(st.nextToken()); if (idGrp == 0) { idGrp = 1; } int idSkill = 0; int lvlSkill = 0; int column = 0; String StringSkill = ""; String skillIcon = ""; String skillName = ""; html.clear(); html.append("<center>The cost of the buff in the group: <font color=F2C202>" + Util.formatAdena(BuffBBSTable.getInstance().getPriceGroup(idGrp)) + " Adena</font>.</center><br>"); html.append("<table width=600>"); html.append("<tr>"); for (Map.Entry entry : BuffBBSTable.getInstance().getBBSBuffsForGoup(idGrp).entrySet()) { column++; idSkill = ((Integer)entry.getKey()).intValue(); lvlSkill = ((Integer)entry.getValue()).intValue(); StringSkill = Integer.toString(idSkill); switch (StringSkill.length()) { case 1: skillIcon = "icon.skill000" + idSkill; break; case 2: skillIcon = "icon.skill00" + idSkill; break; case 3: skillIcon = "icon.skill0" + idSkill; break; case 4: skillIcon = "icon.skill" + idSkill; } if ((idSkill == 4699) || (idSkill == 4700)) { skillIcon = "icon.skill1331"; } if ((idSkill == 4702) || (idSkill == 4703)) { skillIcon = "icon.skill1332"; } L2Skill skillBuff = SkillTable.getInstance().getInfo(idSkill, 1); if (skillBuff == null) { _log.warning("BuffBBSManager: skill id: " + idSkill + " not found"); continue; } skillName = skillBuff.getName(); html.append("<td width=150>"); html.append("<center><img src=\"" + skillIcon + "\" width=32 height=32 align=center></center><br><center><a action=\"bypass -h _bbs_buff_skill;" + idGrp + ";" + idSkill + ";" + lvlSkill + "\">" + skillName + "</a></center>"); html.append("</td>"); if (column == 4) { html.append("</tr>"); html.append("<tr>"); column = 0; } } html.append("</tr>"); html.append("</table>"); String buffer_body = html.toString(); String content = HtmCache.getInstance().getHtmForce(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/buffer.htm"); content = content.replace("%buffer_top%", buffer_top); content = content.replace("%buffer_bottom%", buffer_bottom); content = content.replace("%buffer_body%", buffer_body); separateAndSend(content, activeChar); } else if (command.startsWith("_bbs_buff_skill;")) { StringTokenizer st = new StringTokenizer(command, ";"); st.nextToken(); int sGrp = Integer.parseInt(st.nextToken()); int sId = Integer.parseInt(st.nextToken()); int sLvl = Integer.parseInt(st.nextToken()); int price = BuffBBSTable.getInstance().getPriceGroup(sGrp); if (!activeChar.destroyItemByItemId("BuffBBS", 57, price, activeChar, true)) { return; } L2Character target = (L2Character)activeChar.getTarget(); if (bufPet != 0) { L2Skill skill = SkillTable.getInstance().getInfo(sId, sLvl); skill.getEffects(target, target); } else { L2Skill skill = SkillTable.getInstance().getInfo(sId, sLvl); skill.getEffects(activeChar, activeChar); } } else if (command.startsWith("_bbs_buff_save")) { activeChar.updateBBSBuff(bufPet); activeChar.sendMessage("Buffs saved."); } else if (command.startsWith("_bbs_buff_load")) { int priceRebuff = activeChar.calcBBSBuff(bufPet); if ((priceRebuff > 0) && (activeChar.destroyItemByItemId("BuffBBS", 57, priceRebuff, activeChar, true))) activeChar.cactBBSBuff(bufPet); } } public void parsewrite(String s, String s1, String s2, String s3, String s4, L2PcInstance l2pcinstance) { } }
-
Looking For Community Board witch has gm shop and Scheme buffer.
-
Can anyone tell me which engine is this web and how to get this web? someone tolde me its l2j web can anyone explain ?
-
[javac] gameserver\model\actor\instance\L2PcInstance.java:16434: error: cannot find symbol [javac] int skillId = entry.intValue(); [javac] ^ [javac] symbol: method intValue() [javac] location: variable entry of type Object [javac] D:\Brick-Server\L2Brick_Server\java\l2\brick\gameserver\model\actor\instance\L2PcInstance.java:16435: error: cannot find symbol [javac] int skillLvl = ceffects.get(entry).intValue(); [javac] ^
-
Changed but have error [javac] required: Entry [javac] found: Object [javac] gameserver\model\actor\instance\L2PcInstance.java:16434: error: cannot find symbol [javac] int skillId = ((Integer)entry.getKey()).intValue(); [javac] ^ [javac] symbol: variable key [javac] location: class L2PcInstance [javac] gameserver\model\actor\instance\L2PcInstance.java:16435: error: cannot find symbol [javac] int skillLvl = ((Integer)entry.getValue()).intValue(); [javac] ^
-
thanks but can you advise what need changes here? THanks for help. Now i have error ________________________ [javac] symbol: variable ceffects [javac] location: class L2PcInstance [javac] gameserver\model\actor\instance\L2PcInstance.java:16432: error: cannot find symbol [javac] for (Object entry : ceffects.keySet()) ___________________________________________ Can you help to transffer this script? ___________________________________________ public int calcBBSBuff(int forPet) { Map ceffects = new FastMap(); L2Character character; if (forPet == 0) { ceffects.putAll(this._bbsBuff); } else { character = getPet(); ceffects.putAll(this._bbsPetBuff); } if ((character == null) || (ceffects.isEmpty())) { return 0; } int result = 0; for (Object entry : ceffects.keySet()) { int skillId = ((Integer)entry.getKey()).intValue(); int skillLvl = ((Integer)entry.getValue()).intValue(); int bbsGroup = BuffBBSTable.getInstance().getBBSGroupFotBuf(skillId, skillLvl); if (bbsGroup == 0) continue; int priceGroup = BuffBBSTable.getInstance().getPriceGroup(bbsGroup); if (priceGroup < 0) continue; result += priceGroup; } return result; }
-
Can anyone help me to fix this error?? [javac] gameserver\model\actor\instance\L2PcInstance.java:16315: error: cannot find symbol [javac] for (Map.Entry entry : this.ceffects.entrySet()) [javac] ^ [javac] symbol: variable ceffects [javac] gameserver\model\actor\instance\L2PcInstance.java:16362: error: incompatible types [javac] for (Map.Entry entry : ceffects.entrySet()) [javac] ^ [javac] required: Entry [javac] found: Object [javac] gameserver\model\actor\instance\L2PcInstance.java:16376: error: incompatible types [javac] for (Map.Entry entry : ceffects.entrySet()) [javac] ^ [javac] required: Entry [javac] found: Object [javac] gameserver\model\actor\instance\L2PcInstance.java:16405: error: incompatible types [javac] for (Map.Entry entry : ceffects.entrySet()) [javac] ^ public void restoreBBSBuf(int forPet) { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT * FROM character_bbs_buff_save WHERE charId=? AND for_pet=?"); statement.setInt(1, getObjectId()); statement.setInt(2, forPet); ResultSet rset = statement.executeQuery(); while (rset.next()) { int idSkill = rset.getInt("skill_id"); int lvlSkill = rset.getInt("skill_level"); if (forPet == 0) this._bbsBuff.put(Integer.valueOf(idSkill), Integer.valueOf(lvlSkill)); else this._bbsPetBuff.put(Integer.valueOf(idSkill), Integer.valueOf(lvlSkill)); } rset.close(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, new StringBuilder().append("Could not restore ").append(this).append(" BBS buff data: ").append(e.getMessage()).toString(), e); } finally { L2DatabaseFactory.close(con); } } public void storeBBSBuff(int forPet) { Map ceffects = new FastMap(); if (forPet == 0) ceffects.putAll(this._bbsBuff); else { ceffects.putAll(this._bbsPetBuff); } Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("DELETE FROM character_bbs_buff_save WHERE charId=? AND for_pet=?"); statement.setInt(1, getObjectId()); statement.setInt(2, forPet); statement.execute(); statement.close(); //all i dont know what for now, try continue for (Map.Entry entry : this.ceffects.entrySet()) { statement = con.prepareStatement("INSERT INTO character_bbs_buff_save (charId,skill_id,skill_level,for_pet) VALUES (?,?,?,?)"); statement.setInt(1, getObjectId()); statement.setInt(2, ((Integer)entry.getKey()).intValue()); statement.setInt(3, ((Integer)entry.getValue()).intValue()); statement.setInt(4, forPet); statement.execute(); statement.close(); } } catch (Exception e) { PreparedStatement statement; _log.log(Level.WARNING, "Could not store char effect data: ", e); } finally { L2DatabaseFactory.close(con); } } public void updateBBSBuff(int forPet) { Map ceffects = new FastMap(); L2Character character; if (forPet == 0) character = this; else { character = getPet(); } if (character == null) return; for (L2Effect cureffect : character.getAllEffects()) { int idSklll = cureffect.getId(); int lvlSklll = cureffect.getLevel(); if (BuffBBSTable.getInstance().isBBSSaveBuf(idSklll, lvlSklll)) ceffects.put(Integer.valueOf(idSklll), Integer.valueOf(lvlSklll)); } if (ceffects.isEmpty()) return; if (forPet == 0) { boolean saveBuff = false; if (ceffects.size() != this._bbsBuff.size()) saveBuff = true; for (Map.Entry entry : ceffects.entrySet()) if (!_bbsBuff.containsKey(entry.getKey())) saveBuff = true; if (!saveBuff) { return; } _bbsBuff.clear(); _bbsBuff.putAll(ceffects); } else { boolean saveBuff = false; if (ceffects.size() != this._bbsBuff.size()) saveBuff = true; for (Map.Entry entry : ceffects.entrySet()) if (!this._bbsBuff.containsKey(entry.getKey())) saveBuff = true; if (!saveBuff) { return; } this._bbsPetBuff.clear(); this._bbsPetBuff.putAll(ceffects); } storeBBSBuff(forPet); } public void cactBBSBuff(int forPet) { Map ceffects = new FastMap(); L2Character character; if (forPet == 0) { ceffects.putAll(this._bbsBuff); } else { character = getPet(); ceffects.putAll(this._bbsPetBuff); } if ((character == null) || (ceffects.isEmpty())) { return; } for (Map.Entry entry : ceffects.entrySet()) { L2Skill skill = SkillTable.getInstance().getInfo(((Integer)entry.getKey()).intValue(), ((Integer)entry.getValue()).intValue()); if (skill == null) continue; skill.getEffects(character, character); } } public int calcBBSBuff(int forPet) { Map ceffects = new FastMap(); L2Character character; if (forPet == 0) // pet in invetory { ceffects.putAll(this._bbsBuff); } else { character = getPet(); ceffects.putAll(this._bbsPetBuff); } if ((character == null) || (ceffects.isEmpty())) { return 0; } int result = 0; for (Map.Entry entry : ceffects.entrySet()) { int skillId = ((Integer)entry.getKey()).intValue(); int skillLvl = ((Integer)entry.getValue()).intValue(); int bbsGroup = BuffBBSTable.getInstance().getBBSGroupFotBuf(skillId, skillLvl); if (bbsGroup == 0) continue; int priceGroup = BuffBBSTable.getInstance().getPriceGroup(bbsGroup); if (priceGroup < 0) continue; result += priceGroup; } return result; }
-
[Share] L2Brick High Five project [Updated]
janiko replied to Street's topic in Server Development Discussion [L2J]
:) :) -
HI every body, I need scheme buffer for H5 Please if anybody has rin4a fixed for h5 please give or any h5 buffer thanks for help every body :)
-
[Share] L2Brick High Five project [Updated]
janiko replied to Street's topic in Server Development Discussion [L2J]
Lindvior was custom addon by NCSOFT and than they deleted it because it was unusefull :) -
I have problem to Mammon Spawn, when you talk to iason to spawn mammon its not spawning this is my spawn script and not works if someone can help me to fix else if (event.equalsIgnoreCase("30969-06.htm")) { if (mammonst == 0) { mammonst = 1; L2Npc mammon = addSpawn(MAMMON, 109742, 219978, -3520, 0, false, 120000, true); mammon.broadcastPacket(new NpcSay(mammon.getObjectId(), 0, mammon.getNpcId(), "Who dares summon the Merchant of Mammon?")); st.startQuestTimer("despawn", 120000, mammon); } else return "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>"; } thanks a lot
-
i have a problem and i need help thats all !!! my error is here and if i can to fix it i dont post anything here ;) public void handleBypass(L2PcInstance activeChar, String command) { if(!CustomConfig.AIOITEM_ENABLEME) return; if(!checkPlayerConditions(activeChar)) return; activeChar.setTarget(activeChar); String[] SubCmd = command.split("_"); IAIOItemHandler handler = AIOItemHandler.getInstance().getAIOHandler(SubCmd[1]); if(handler != null) handler.onBypassUse(activeChar, SubCmd[2]); }
-
How To Modife This Script to not use symbol _? in this way it's not working public void handleBypass(L2PcInstance activeChar, String command) { if(!CustomConfig.AIOITEM_ENABLEME) return; if(!checkPlayerConditions(activeChar)) return; activeChar.setTarget(activeChar); String[] SubCmd = command.split("_"); IAIOItemHandler handler = AIOItemHandler.getInstance().getAIOHandler(SubCmd[1]); if(handler != null) handler.onBypassUse(activeChar, SubCmd[2]); } Thanks for Help Every Body
-
Scheme Aio Buffer Error [HELP ΠΑΡΑΚΑΛΟΥΜΕ]
janiko posted a question in Request Server Development Help [Greek]
ScheThis είναι σενάριο forCan κάποιος να με βοηθήσει? Can Someone Help me? [glow=red,2,300]Θα χρησιμοποιηθεί _ και μου δίνει αυτό το λάθος και όταν το πεδίο είναι κενό μου δίνει ίδια.[/glow] [glow=red,2,300]I used _ and gives me this error and when the field is empty it gives me same.[/glow] com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer runImpl WARNING: [Character: Staff[268483852] - Account: katalonia - IP: 188.169.148.222] sent bad RequestBypassToServer: "Aioitem_scheme_createprofile [glow=red,2,300]_[/glow]" java.lang.ArrayIndexOutOfBoundsException: 1 at handlers.aioitemhandler.AIOSchemeHandler.onBypassUse(AIOSchemeHandler.java:61) at com.l2jserver.gameserver.datatables.AIOItemTable.handleBypass(AIOItemTable.java:613) at com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:273) at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62) at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:1012) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) ScheThis είναι σενάριο για Aio Scheme.java This is script for Aio Scheme.java /* * Send main's scheme page */ if(actualCmd.equalsIgnoreCase("main")) { sendSchemePageToPlayer(player); } /* * Create scheme profile */ else if(actualCmd.equalsIgnoreCase("createprofile")) { if(player.getProfileNames().size() == CustomConfig.AIOITEM_SCHEME_MAX_PROFILES) { player.sendMessage("You alredy reached the max allowed profiles per char!"); return; } String secondCmd = subCommands[1]; if(secondCmd == null || secondCmd.isEmpty()) { _log.severe("Null Scheme profile from: "+player.getName()); return; } if(player.getProfileNames().contains(secondCmd)) { player.sendMessage("The given profile alredy exist in your list!"); return; } if(!paymentDone(player, Action.CREATE_PROFILE)) { return; } player.addNewProfile(secondCmd); player.needSaveSchemes(); sendSchemePageToPlayer(player); } -
Can Someone Help me? [glow=red,2,300]I used _ and gives me this error and when the field is empty it gives me same.[/glow] com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer runImpl WARNING: [Character: Staff[268483852] - Account: katalonia - IP: 188.169.148.220] sent bad RequestBypassToServer: "Aioitem_scheme_createprofile [glow=red,2,300]_[/glow]" java.lang.ArrayIndexOutOfBoundsException: 1 at handlers.aioitemhandler.AIOSchemeHandler.onBypassUse(AIOSchemeHandler.java:61) at com.l2jserver.gameserver.datatables.AIOItemTable.handleBypass(AIOItemTable.java:613) at com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:273) at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62) at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:1012) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) This is script for Aio Scheme.java /* * Send main's scheme page */ if(actualCmd.equalsIgnoreCase("main")) { sendSchemePageToPlayer(player); } /* * Create scheme profile */ else if(actualCmd.equalsIgnoreCase("createprofile")) { if(player.getProfileNames().size() == CustomConfig.AIOITEM_SCHEME_MAX_PROFILES) { player.sendMessage("You alredy reached the max allowed profiles per char!"); return; } String secondCmd = subCommands[1]; if(secondCmd == null || secondCmd.isEmpty()) { _log.severe("Null Scheme profile from: "+player.getName()); return; } if(player.getProfileNames().contains(secondCmd)) { player.sendMessage("The given profile alredy exist in your list!"); return; } if(!paymentDone(player, Action.CREATE_PROFILE)) { return; } player.addNewProfile(secondCmd); player.needSaveSchemes(); sendSchemePageToPlayer(player); }
-
How to Open Automaticly Door In Instance?
janiko posted a question in Request Server Development Help [L2J]
Can someone help me? what should i add to script to open automaticly when character enters in instance? this is door id: 23140101 -
I have added schemeBuffer for AIO item but i have error When i type in name field nothing and press create scheme than gives me this error Jun 29, 2011 11:45:41 PM l2j.server.gameserver.network.clientpackets.RequestBypassToServer runImpl WARNING: [Character: Testuser[268483796] - Account: testuser - IP: Unknown] sent bad RequestBypassToServer: "Aioitem_scheme_createprofile" java.lang.ArrayIndexOutOfBoundsException: 1 at handlers.aioitemhandler.AIOSchemeHandler.onBypassUse(AIOSchemeHandler.java:61) at l2j.server.gameserver.datatables.AIOItemTable.handleBypass(AIOItemTable.java:608) at l2j.server.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:273) at l2j.server.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62) at l2j.server.gameserver.network.L2GameClient.run(L2GameClient.java:1012) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) When i type in name field _ and press create scheme than gives me this error Jun 29, 2011 11:45:16 PM l2j.server.gameserver.network.clientpackets.RequestBypassToServer runImpl WARNING: [Character: Testuser[268483796] - Account: testuser - IP: Unknown] sent bad RequestBypassToServer: "Aioitem_scheme_createprofile _" java.lang.ArrayIndexOutOfBoundsException: 1 at handlers.aioitemhandler.AIOSchemeHandler.onBypassUse(AIOSchemeHandler.java:61) at l2j.server.gameserver.datatables.AIOItemTable.handleBypass(AIOItemTable.java:608) at l2j.server.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:273) at l2j.server.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62) at l2j.server.gameserver.network.L2GameClient.run(L2GameClient.java:1012) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$W I have posted this prolem but no reaction ;( This is SchemeBuffer.java package handlers.aioitemhandler; import java.util.logging.Logger; import javolution.text.TextBuilder; import javolution.util.FastList; import javolution.util.FastMap; import l2j.server.CustomConfig; import l2j.server.gameserver.cache.HtmCache; import l2j.server.gameserver.datatables.AIOItemTable; import l2j.server.gameserver.handler.IAIOItemHandler; import l2j.server.gameserver.model.L2ItemInstance; import l2j.server.gameserver.model.L2Skill; import l2j.server.gameserver.model.actor.instance.L2PcInstance; import l2j.server.gameserver.network.serverpackets.NpcHtmlMessage; public class AIOSchemeHandler implements IAIOItemHandler { private static final Logger _log = Logger.getLogger(AIOSchemeHandler.class.getName()); private static final String BYPASS = "scheme"; private static enum Action { CREATE_PROFILE, GET_BUFFS } @Override public String getBypass() { return BYPASS; } @Override public void onBypassUse(L2PcInstance player, String command) { String[] subCommands = command.split(" "); String actualCmd = subCommands[0]; String secondCmd = subCommands[1]; /* * Send main's scheme page */ if(actualCmd.equalsIgnoreCase("main")) { sendSchemePageToPlayer(player); } /* * Create scheme profile */ else if(actualCmd.equalsIgnoreCase("createprofile")) { if(player.getProfileNames().size() == CustomConfig.AIOITEM_SCHEME_MAX_PROFILES) { player.sendMessage("You alredy reached the max allowed profiles per char!"); return; } if(secondCmd == null || secondCmd.isEmpty()) { _log.severe("Null Scheme Profile From :"+player.getName()); return; } if(player.getProfileNames().contains(secondCmd)) { player.sendMessage("The given profile alredy exist in your list!"); return; } if(!paymentDone(player, Action.CREATE_PROFILE)) { return; } player.addNewProfile(secondCmd); player.needSaveSchemes(); sendSchemePageToPlayer(player); } /* * Manage profile */ else if(actualCmd.equalsIgnoreCase("manage")) { String secondCmd = subCommands[1]; if(secondCmd != null) { sendManageWindow(player, secondCmd); } else { _log.severe("Player "+player.getName()+" has a empty AIOItem scheme profile!"); return; } } /* * Get buffs */ else if(actualCmd.equalsIgnoreCase("buff")) { if(!paymentDone(player, Action.GET_BUFFS)) { return; } String secondCmd = subCommands[1]; if(secondCmd == null || secondCmd.isEmpty()) { _log.severe("Null Scheme profile for player: "+player.getName()); return; } FastList<L2Skill> buffs = player.getProfileBuffs(secondCmd); if(buffs != null) { for(L2Skill sk : buffs) { sk.getEffects(player, player); } } } /* * Erase profile */ else if(actualCmd.equalsIgnoreCase("del")) { String secondCmd = subCommands[1]; if(secondCmd == null || secondCmd.isEmpty()) { _log.severe("Null scheme profile for: "+player.getName()); return; } player.deleteProfile(secondCmd); player.needSaveSchemes(); sendSchemePageToPlayer(player); } /* * Add buffs to profile page */ else if(actualCmd.equalsIgnoreCase("editadd")) { String category = subCommands[1]; String profile = subCommands[2]; if(category == null || profile == null) return; sendAddBuffWindow(category, profile, player); player.setLastAIOBufferCategory(category); } /* * Add a buff */ else if(actualCmd.equalsIgnoreCase("addbuff")) { String profile = subCommands[1]; if(profile == null) return; int buffId = 0; try { buffId = Integer.parseInt(subCommands[2]); } catch(NumberFormatException nfe) { nfe.printStackTrace(); } L2Skill buff = null; if((buff = AIOItemTable.getInstance().getBuff(buffId)) != null) { player.addNewBuff(profile, buff); player.needSaveSchemes(); sendAddBuffWindow(player.getLastCategory(), profile, player); } } /* * Delete buff window */ else if(actualCmd.equalsIgnoreCase("editdel")) { if(subCommands[1] == null) return; sendDelBuffWindow(subCommands[1], player); } /* * Delete a buff */ else if(actualCmd.equalsIgnoreCase("delbuff")) { String profile = subCommands[1]; if(profile == null) return; int buffId = 0; try { buffId = Integer.parseInt(subCommands[2]); } catch(NumberFormatException nfe) { nfe.printStackTrace(); } L2Skill deletedBuff = AIOItemTable.getInstance().getBuff(buffId); player.deleteBuff(profile, deletedBuff); player.needSaveSchemes(); sendDelBuffWindow(profile, player); } } /** * Will return true if the player made the payment for the * service, otherwise, will return false * @param player * @param action * @return boolean */ private boolean paymentDone(L2PcInstance player, Action action) { L2ItemInstance coin = null; if((coin = player.getInventory().getItemByItemId(CustomConfig.AIOITEM_SCHEME_COIN)) == null) { player.sendMessage("You dont have the required items to proceed!"); return false; } switch(action) { case CREATE_PROFILE: { if(coin.getCount() < CustomConfig.AIOITEM_SCHEME_PROFILE_PRICE) { player.sendMessage("You dont have enought "+coin.getName()+" to create a new scheme!"); return false; } else { player.destroyItemByItemId("AIOItem", coin.getItemId(), CustomConfig.AIOITEM_SCHEME_PROFILE_PRICE, player, true); return true; } } case GET_BUFFS: { if(coin.getCount() < CustomConfig.AIOITEM_SCHEME_PRICE) { player.sendMessage("You dont have enought "+coin.getName()+" to create a new scheme!"); return false; } else { player.destroyItemByItemId("AIOItem", coin.getItemId(), CustomConfig.AIOITEM_SCHEME_PRICE, player, true); return true; } } default: return false; } } /** * Will send to the player the scheme page with his info * @param player */ private void sendSchemePageToPlayer(L2PcInstance player) { String schemeMain = HtmCache.getInstance().getHtm(null, "data/html/aioitem/scheme.htm"); StringBuilder profiles = new StringBuilder(); for(String prof : player.getProfileNames()) { profiles.append("<a action=\"bypass -h Aioitem_scheme_manage "+prof+"\">"+prof+"<br1>"); } NpcHtmlMessage msg = new NpcHtmlMessage(5); msg.setHtml(schemeMain); msg.replace("%profList%", profiles.toString()); player.sendPacket(msg); } /** * Will send the profile edition page to the given player * @param player * @param profile */ private void sendManageWindow(L2PcInstance player, String profile) { String html = HtmCache.getInstance().getHtm(null, "data/html/aioitem/schememanage.htm"); if(html == null) { _log.severe("The file schememanage.htm for the AIOItem desn't exist or is corrupted!"); return; } StringBuilder categories = new StringBuilder(); for(String cat : AIOItemTable.getInstance().getBuffs().keySet()) { categories.append("<a action=\"bypass -h Aioitem_scheme_editadd "+cat+" "+profile+"\">Add "+cat+" buffs</a>"); } NpcHtmlMessage msg = new NpcHtmlMessage(5); msg.setHtml(html); msg.replace("%profile%", profile); msg.replace("%addList%", categories.toString()); player.sendPacket(msg); } /** * Will show a window with the buffs from the given category * to be added to the player schemes profile * @param category * @param profile * @param player */ private void sendAddBuffWindow(String category, String profile, L2PcInstance player) { int b = 2; FastMap<Integer, L2Skill> temp = AIOItemTable.getInstance().getBuffCategory(category).getCategoryBuffs(); TextBuilder tb = new TextBuilder(); tb.append("<html><body><center>"); tb.append("<br><font color=LEVEL>Choose what you want!</font><br>"); tb.append("<table width = 240 height 32>"); for(int i : temp.keySet()) { L2Skill sk = temp.get(i); if(player.getProfileBuffs(profile).contains(sk)) continue; if(b % 2 == 0) { tb.append("<tr>"); tb.append("<td><a action=\"bypass -h Aioitem_scheme_addbuff "+profile+" "+i+"\">"+sk.getName()+"</a></td>"); } else { tb.append("<td><a action=\"bypass -h Aioitem_scheme_addbuff "+profile+" "+i+"\">"+sk.getName()+"</a></td>"); tb.append("</tr>"); } b++; } tb.append("</table><br><a action=\"bypass -h Aioitem_scheme_main\"><font color=LEVEL>Main</font></a>"); tb.append("</center></body></html>"); NpcHtmlMessage msg = new NpcHtmlMessage(5); msg.setHtml(tb.toString()); player.sendPacket(msg); } private void sendDelBuffWindow(String profile, L2PcInstance player) { if(player.getProfileBuffs(profile) == null) return; int b = 2; TextBuilder tb = new TextBuilder(); tb.append("<html><body><center>"); tb.append("<br><font color=LEVEL>Choose what you want!</font><br>"); tb.append("<table width = 240 height 32>"); for(L2Skill sk : player.getProfileBuffs(profile)) { int id = sk.getId(); if(player.getProfileBuffs(profile).contains(sk)) continue; if(b % 2 == 0) { tb.append("<tr>"); tb.append("<td><a action=\"bypass -h Aioitem_scheme_delbuff "+profile+" "+id+"\">"+sk.getName()+"</a></td>"); } else { tb.append("<td><a action=\"bypass -h Aioitem_scheme_delbuff "+profile+" "+id+"\">"+sk.getName()+"</a></td>"); tb.append("</tr>"); } b++; } tb.append("</table><br><a action=\"bypass -h Aioitem_scheme_main\"><font color=LEVEL>Main</font></a>"); tb.append("</center></body></html>"); NpcHtmlMessage msg = new NpcHtmlMessage(5); msg.setHtml(tb.toString()); player.sendPacket(msg); } }
-
[HELP] Need SKill Fixes
janiko replied to janiko's question in Request Server Development Help [L2J]
I have fixed it own -
Helo for all..... Problem for server Freya
janiko replied to iParis's question in Request Server Development Help [L2J]
<define subnet="127.0.0.0/8" address="l2goldenage.no-ip.biz " /> may be problem is here <define subnet="127.0.0.0/8" address="127.0.0.1" /> try this one -
[HELP] Need SKill Fixes
janiko replied to janiko's question in Request Server Development Help [L2J]
Thanks for help everybody i have fixed it :) Close this topic -
Aio Scheme BUg Help to fix Please
janiko replied to janiko's question in Request Server Development Help [L2J]
They don't help me :) -
Hi everybody i have error on Aio Scheme Buff now i will explain. When i type in name field nothing and press create scheme than gives me this error Jun 29, 2011 11:45:41 PM l2.brick.gameserver.network.clientpackets.RequestBypassToServer runImpl WARNING: [Character: TESTING[268483796] - Account: katalonia - IP: 188.169.148.218] sent bad RequestBypassToServer: "Aioitem_scheme_createprofile" java.lang.ArrayIndexOutOfBoundsException: 1 at handlers.aioitemhandler.AIOSchemeHandler.onBypassUse(AIOSchemeHandler.java:61) at l2.brick.gameserver.datatables.AIOItemTable.handleBypass(AIOItemTable.java:608) at l2.brick.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:273) at l2.brick.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62) at l2.brick.gameserver.network.L2GameClient.run(L2GameClient.java:1012) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) When i type in name field _ and press create scheme than gives me this error Jun 29, 2011 11:45:16 PM l2.brick.gameserver.network.clientpackets.RequestBypassToServer runImpl WARNING: [Character: TESTING[268483796] - Account: katalonia - IP: 188.169.148.218] sent bad RequestBypassToServer: "Aioitem_scheme_createprofile _" java.lang.ArrayIndexOutOfBoundsException: 1 at handlers.aioitemhandler.AIOSchemeHandler.onBypassUse(AIOSchemeHandler.java:61) at l2.brick.gameserver.datatables.AIOItemTable.handleBypass(AIOItemTable.java:608) at l2.brick.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:273) at l2.brick.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62) at l2.brick.gameserver.network.L2GameClient.run(L2GameClient.java:1012) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) THIS IS MY AIO Buff SCHEME HANDLER package handlers.aioitemhandler; import java.util.logging.Logger; import javolution.text.TextBuilder; import javolution.util.FastList; import javolution.util.FastMap; import l2.brick.CustomConfig; import l2.brick.gameserver.cache.HtmCache; import l2.brick.gameserver.datatables.AIOItemTable; import l2.brick.gameserver.handler.IAIOItemHandler; import l2.brick.gameserver.model.L2ItemInstance; import l2.brick.gameserver.model.L2Skill; import l2.brick.gameserver.model.actor.instance.L2PcInstance; import l2.brick.gameserver.network.serverpackets.NpcHtmlMessage; public class AIOSchemeHandler implements IAIOItemHandler { private static final Logger _log = Logger.getLogger(AIOSchemeHandler.class.getName()); private static final String BYPASS = "scheme"; private static enum Action { CREATE_PROFILE, GET_BUFFS } @Override public String getBypass() { return BYPASS; } @Override public void onBypassUse(L2PcInstance player, String command) { String[] subCommands = command.split(" "); String actualCmd = subCommands[0]; /* * Send main's scheme page */ if(actualCmd.equalsIgnoreCase("main")) { sendSchemePageToPlayer(player); } /* * Create scheme profile */ else if(actualCmd.equalsIgnoreCase("createprofile")) { if(player.getProfileNames().size() == CustomConfig.AIOITEM_SCHEME_MAX_PROFILES) { player.sendMessage("You alredy reached the max allowed profiles per char!"); return; } String secondCmd = subCommands[1]; if(secondCmd == null || secondCmd.isEmpty()) { _log.severe("Null Scheme Profile From :"+player.getName()); return; } if(player.getProfileNames().contains(secondCmd)) { player.sendMessage("The given profile alredy exist in your list!"); return; } if(!paymentDone(player, Action.CREATE_PROFILE)) { return; } player.addNewProfile(secondCmd); player.needSaveSchemes(); sendSchemePageToPlayer(player); } /* * Manage profile */ else if(actualCmd.equalsIgnoreCase("manage")) { String secondCmd = subCommands[1]; if(secondCmd != null) { sendManageWindow(player, secondCmd); } else { _log.severe("Player "+player.getName()+" has a empty AIOItem scheme profile!"); return; } } /* * Get buffs */ else if(actualCmd.equalsIgnoreCase("buff")) { if(!paymentDone(player, Action.GET_BUFFS)) { return; } String secondCmd = subCommands[1]; if(secondCmd == null || secondCmd.isEmpty()) { _log.severe("Null Scheme profile for player: "+player.getName()); return; } FastList<L2Skill> buffs = player.getProfileBuffs(secondCmd); if(buffs != null) { for(L2Skill sk : buffs) { sk.getEffects(player, player); } } } /* * Erase profile */ else if(actualCmd.equalsIgnoreCase("del")) { String secondCmd = subCommands[1]; if(secondCmd == null || secondCmd.isEmpty()) { _log.severe("Null scheme profile for: "+player.getName()); return; } player.deleteProfile(secondCmd); player.needSaveSchemes(); sendSchemePageToPlayer(player); } /* * Add buffs to profile page */ else if(actualCmd.equalsIgnoreCase("editadd")) { String category = subCommands[1]; String profile = subCommands[2]; if(category == null || profile == null) return; sendAddBuffWindow(category, profile, player); player.setLastAIOBufferCategory(category); } /* * Add a buff */ else if(actualCmd.equalsIgnoreCase("addbuff")) { String profile = subCommands[1]; if(profile == null) return; int buffId = 0; try { buffId = Integer.parseInt(subCommands[2]); } catch(NumberFormatException nfe) { nfe.printStackTrace(); } L2Skill buff = null; if((buff = AIOItemTable.getInstance().getBuff(buffId)) != null) { player.addNewBuff(profile, buff); player.needSaveSchemes(); sendAddBuffWindow(player.getLastCategory(), profile, player); } } /* * Delete buff window */ else if(actualCmd.equalsIgnoreCase("editdel")) { if(subCommands[1] == null) return; sendDelBuffWindow(subCommands[1], player); } /* * Delete a buff */ else if(actualCmd.equalsIgnoreCase("delbuff")) { String profile = subCommands[1]; if(profile == null) return; int buffId = 0; try { buffId = Integer.parseInt(subCommands[2]); } catch(NumberFormatException nfe) { nfe.printStackTrace(); } L2Skill deletedBuff = AIOItemTable.getInstance().getBuff(buffId); player.deleteBuff(profile, deletedBuff); player.needSaveSchemes(); sendDelBuffWindow(profile, player); } } /** * Will return true if the player made the payment for the * service, otherwise, will return false * @param player * @param action * @return boolean */ private boolean paymentDone(L2PcInstance player, Action action) { L2ItemInstance coin = null; if((coin = player.getInventory().getItemByItemId(CustomConfig.AIOITEM_SCHEME_COIN)) == null) { player.sendMessage("You dont have the required items to proceed!"); return false; } switch(action) { case CREATE_PROFILE: { if(coin.getCount() < CustomConfig.AIOITEM_SCHEME_PROFILE_PRICE) { player.sendMessage("You dont have enought "+coin.getName()+" to create a new scheme!"); return false; } else { player.destroyItemByItemId("AIOItem", coin.getItemId(), CustomConfig.AIOITEM_SCHEME_PROFILE_PRICE, player, true); return true; } } case GET_BUFFS: { if(coin.getCount() < CustomConfig.AIOITEM_SCHEME_PRICE) { player.sendMessage("You dont have enought "+coin.getName()+" to create a new scheme!"); return false; } else { player.destroyItemByItemId("AIOItem", coin.getItemId(), CustomConfig.AIOITEM_SCHEME_PRICE, player, true); return true; } } default: return false; } } /** * Will send to the player the scheme page with his info * @param player */ private void sendSchemePageToPlayer(L2PcInstance player) { String schemeMain = HtmCache.getInstance().getHtm(null, "data/html/aioitem/scheme.htm"); StringBuilder profiles = new StringBuilder(); for(String prof : player.getProfileNames()) { profiles.append("<a action=\"bypass -h Aioitem_scheme_manage "+prof+"\">"+prof+"<br1>"); } NpcHtmlMessage msg = new NpcHtmlMessage(5); msg.setHtml(schemeMain); msg.replace("%profList%", profiles.toString()); player.sendPacket(msg); } /** * Will send the profile edition page to the given player * @param player * @param profile */ private void sendManageWindow(L2PcInstance player, String profile) { String html = HtmCache.getInstance().getHtm(null, "data/html/aioitem/schememanage.htm"); if(html == null) { _log.severe("The file schememanage.htm for the AIOItem desn't exist or is corrupted!"); return; } StringBuilder categories = new StringBuilder(); for(String cat : AIOItemTable.getInstance().getBuffs().keySet()) { categories.append("<a action=\"bypass -h Aioitem_scheme_editadd "+cat+" "+profile+"\">Add "+cat+" buffs</a>"); } NpcHtmlMessage msg = new NpcHtmlMessage(5); msg.setHtml(html); msg.replace("%profile%", profile); msg.replace("%addList%", categories.toString()); player.sendPacket(msg); } /** * Will show a window with the buffs from the given category * to be added to the player schemes profile * @param category * @param profile * @param player */ private void sendAddBuffWindow(String category, String profile, L2PcInstance player) { int b = 2; FastMap<Integer, L2Skill> temp = AIOItemTable.getInstance().getBuffCategory(category).getCategoryBuffs(); TextBuilder tb = new TextBuilder(); tb.append("<html><body><center>"); tb.append("<br><font color=LEVEL>Choose what you want!</font><br>"); tb.append("<table width = 240 height 32>"); for(int i : temp.keySet()) { L2Skill sk = temp.get(i); if(player.getProfileBuffs(profile).contains(sk)) continue; if(b % 2 == 0) { tb.append("<tr>"); tb.append("<td><a action=\"bypass -h Aioitem_scheme_addbuff "+profile+" "+i+"\">"+sk.getName()+"</a></td>"); } else { tb.append("<td><a action=\"bypass -h Aioitem_scheme_addbuff "+profile+" "+i+"\">"+sk.getName()+"</a></td>"); tb.append("</tr>"); } b++; } tb.append("</table><br><a action=\"bypass -h Aioitem_scheme_main\"><font color=LEVEL>Main</font></a>"); tb.append("</center></body></html>"); NpcHtmlMessage msg = new NpcHtmlMessage(5); msg.setHtml(tb.toString()); player.sendPacket(msg); } private void sendDelBuffWindow(String profile, L2PcInstance player) { if(player.getProfileBuffs(profile) == null) return; int b = 2; TextBuilder tb = new TextBuilder(); tb.append("<html><body><center>"); tb.append("<br><font color=LEVEL>Choose what you want!</font><br>"); tb.append("<table width = 240 height 32>"); for(L2Skill sk : player.getProfileBuffs(profile)) { int id = sk.getId(); if(player.getProfileBuffs(profile).contains(sk)) continue; if(b % 2 == 0) { tb.append("<tr>"); tb.append("<td><a action=\"bypass -h Aioitem_scheme_delbuff "+profile+" "+id+"\">"+sk.getName()+"</a></td>"); } else { tb.append("<td><a action=\"bypass -h Aioitem_scheme_delbuff "+profile+" "+id+"\">"+sk.getName()+"</a></td>"); tb.append("</tr>"); } b++; } tb.append("</table><br><a action=\"bypass -h Aioitem_scheme_main\"><font color=LEVEL>Main</font></a>"); tb.append("</center></body></html>"); NpcHtmlMessage msg = new NpcHtmlMessage(5); msg.setHtml(tb.toString()); player.sendPacket(msg); } }
-
Need Skill Fixes Please help me. I use Freya L2j Server. Bluff : CounterAttack : thanks for help :)
