N1nj4Styl3 Posted December 15, 2014 Posted December 15, 2014 SORRY FOR DUBBLE POST Casino Manager have BUG If you BET -10 ( when you "lose" you take +10 ) If you BET -10 ( when you "win" you do not take something or lose something ) Make it so it won't accept numbers < 0 Something like that: If bet.amount <= 0 Then >throw message >return end Not something really hard for people who code in Java Quote
Devlin Posted December 15, 2014 Posted December 15, 2014 Make it so it won't accept numbers < 0 Something like that: If bet.amount <= 0 Then >throw message >return end Not something really hard for people who code in Java It's all about HTM. Just add to the box type "numbers". So, the player won't be allowed to type + - = or whatever. <edit var="count" width=120 height=15 type=number> Quote
StinkyMadness Posted December 18, 2014 Posted December 18, 2014 It's all about HTM. Just add to the box type "numbers". So, the player won't be allowed to type + - = or whatever. <edit var="count" width=120 height=15 type=number> I just report that for People know.... i made mine with button's :D Quote
jolter Posted December 23, 2014 Posted December 23, 2014 So what facking idiot reworked?Code it's the same oh let me guess they change imports and thats called "rework" Act like an idiot once again and you want a succed server i don't except smart people there the place are full of wannabe developers. and any one have promision from ncsoft ? haha dont be radiculus its maxcheaters forum for ppl which dont care about any autor rights.wakeup Quote
skoupas Posted December 25, 2014 Posted December 25, 2014 (edited) { _log.warning("could not update the password of account: " + activeChar.getAccountName()); } finally { try { if (con != null) con.close(); } catch (SQLException e) { _log.warning("Failed to close database connection!"); } } return true; } } My Error: ... String password = null; Object _log; try { ... Edited December 25, 2014 by skoupas Quote
StinkyMadness Posted December 27, 2014 Posted December 27, 2014 { _log.warning("could not update the password of account: " + activeChar.getAccountName()); } finally { try { if (con != null) con.close(); } catch (SQLException e) { _log.warning("Failed to close database connection!"); } } return true; } } My Error: ... String password = null; Object _log; try { ... Change it to { LOGGER.warn("could not update the password of account: " + activeChar.getAccountName()); } finally { try { if (con != null) con.close(); } catch (SQLException e) { LOGGER.warn("Failed to close database connection!"); } } return true; } } Quote
berke akyol Posted February 10, 2015 Posted February 10, 2015 If anyone knows how to use eclipse opens you contact me skype : berkeakyol ty waiting Quote
s0k1n Posted May 15, 2015 Posted May 15, 2015 (edited) OK i fixed it ! Thanks its work! :D (with change's) Edited May 18, 2015 by s0k1n Quote
CTGavesT Posted February 18, 2016 Posted February 18, 2016 (edited) Casino Manager Work Fine /* * 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.l2jfrozen.gameserver.model.actor.instance; import com.l2jfrozen.gameserver.ai.CtrlIntention; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.SetupGauge; import com.l2jfrozen.gameserver.network.serverpackets.SocialAction; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; import com.l2jfrozen.util.random.Rnd; import java.util.NoSuchElementException; import java.util.StringTokenizer; import javolution.text.TextBuilder; public class L2CasinoInstance extends L2NpcInstance { public L2CasinoInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } public void onBypassFeedback(L2PcInstance player, String command) { int ammount = 0; if (command.startsWith("play1")) { StringTokenizer st = new StringTokenizer(command); try { st.nextToken(); ammount = Integer.parseInt(st.nextToken()); } catch (NoSuchElementException nse) { } Casino1(player, ammount); } } public static void displayCongrats(L2PcInstance player) { player.broadcastPacket(new SocialAction(player.getObjectId(), 3)); player.sendMessage("Congratulations You Won!"); } public static void displayCongrats2(L2PcInstance player) { player.sendMessage("You lost!"); } public void showChatWindow(L2PcInstance player, int val) { NpcHtmlMessage msg = new NpcHtmlMessage(getObjectId()); msg.setHtml(casinoWindow(player)); msg.replace("%objectId%", String.valueOf(getObjectId())); player.sendPacket(msg); } private String casinoWindow(L2PcInstance player) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>L2 Server Name Casino Manager</title><body>"); tb.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=295 height=32><br><br>"); tb.append("<font color=\"3b8d8d\">Chance to win : 50%</font><br>"); tb.append("<img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\"><br>"); tb.append("<tr><td><font color=\"e0d6b9\">Double or Nothing </font></td></tr><br>"); tb.append("<img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\"></center><br>"); tb.append("<center>"); tb.append("<font color=\"e0d6b9\">Place your bet: Vote Items!</font>"); tb.append("</center>"); tb.append("<center><img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\"></center><br>"); tb.append("<br>"); tb.append("<center>"); tb.append("<tr>"); tb.append("<td align=center><edit var=\"qbox\" width=120 height=15><br></td> <td align=right></td>"); tb.append("<td align=center><button value=\"Bet\" action=\"bypass -h npc_%objectId%_play1 $qbox\" width=204 height=20 back=\"sek.cbui75\" fore=\"sek.cbui75\"></td>"); tb.append("</tr>"); tb.append("</center>"); tb.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=295 height=32><br></center>"); tb.append("</body></html>"); return tb.toString(); } public static void Casino1(L2PcInstance player, int ammount) { int unstuckTimer = 100; player.setTarget(player); player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); player.disableAllSkills(); SetupGauge sg = new SetupGauge(0, unstuckTimer); player.sendPacket(sg); Casino1 ef = new Casino1(player, ammount); player.setSkillCast(ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer)); } static class Casino1 implements Runnable { private L2PcInstance _player; private int _ammount; Casino1(L2PcInstance player, int ammount) { this._ammount = ammount; this._player = player; } public void run() { if (this._player.isDead()) { return; } this._player.setIsIn7sDungeon(false); this._player.enableAllSkills(); int chance = Rnd.get(3); if (this._player.getInventory().getInventoryItemCount(7264, 1) >= this._ammount) { if (chance == 0) { L2CasinoInstance.displayCongrats(this._player); this._player.addItem("Gift", 7264, this._ammount, this._player, true); this._player.broadcastUserInfo(); } if (chance == 1) { L2CasinoInstance.displayCongrats2(this._player); this._player.destroyItemByItemId("Consume", 7264, this._ammount, this._player, true); this._player.broadcastUserInfo(); } if (chance == 2) { L2CasinoInstance.displayCongrats2(this._player); this._player.destroyItemByItemId("Consume", 7264, this._ammount, this._player, true); this._player.broadcastUserInfo(); } } else { this._player.sendMessage("You do not have enough Vote Items!"); } } } } Edited February 18, 2016 by FastCow Quote
CTGavesT Posted February 18, 2016 Posted February 18, 2016 (edited) I know is Ugly code for L2 Edited February 23, 2016 by FastCow Quote
SweeTs Posted February 18, 2016 Posted February 18, 2016 Still the code is so ugly. Can be reduced by a lot. There is a lot of useless code. Anyway :p Quote
osvaldotl2015 Posted May 17, 2016 Posted May 17, 2016 (edited) This fix is to select an item for L2CasinoInstance comfortable in my case is the last rev l2jfrozen dp have 2 int 1= int am-beep-t = 0; 2= private int _am-beep-t; fix Rename ints 1= int ambeept = 0 2= private int ambeept1; and change name to alls values Now other Fix Add the import in L2CasinoInstance + import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.ai.CtrlIntention; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; then if (this._player.getInventory().getInventoryItemCount(11001, 0) >= this.ammount ) this._player.destroyItemByItemId("Consume", 11001, this.ammount, this._player, true); this._player.destroyItemByItemId("Consume", 11001, this.ammount, this._player, true); 11001 to (config.CASINO_ITEM) go to ============================================================================================================================ Config.java ============================================================================================================================ + //========================================================================================================= + public static int CASINO_ITEM; + //========================================================================================================= + //==================================================================================================================== + CASINO_ITEM = Integer.parseInt(L2JFrozenSettings.getProperty("CasinoItem", "360")); + //==================================================================================================================== go to dp ============================================================================================================================ gameserver\config\functions ============================================================================================================================ add this to end of the file l2jfrozen.properties #================================================================================================================== # CASINO # #================================================================================================================== # Casino Item need for Partticipate In Casino Manager # default = 57 CasinoItem = 57 /no new line Regards 8) Edited May 17, 2016 by osvaldotl2015 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.