Jump to content

Recommended Posts

Posted

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

Posted

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>
Posted

 

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

Posted

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

Posted (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 by skoupas
Posted

 

{

_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;
}
}
 
  • 1 month later...
  • 3 months later...
  • 9 months later...
Posted (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 by FastCow
  • 2 weeks later...
  • 2 months later...
Posted (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 by osvaldotl2015

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • Lol another crappy server if you wanna x5000 rates go play l2java or damage, at least not gonna die in few months when server rent and cheap meth will fade out lol
    • Why the shitty interface then?
    • Wtf you even selling no clue at all, stop use this crappy AI 
    • We are a small team of developers from this community who used to play on the Interlude version of L2Pride, almost 20 years ago. There have been many attempts over the years to replicate this server, specifically the very first version of it that came on Interlude(C6) and all of them were met with failure. We decided to take it upon ourselves again since we remember every little detail that made this server unique and also were fortunate enough to get our hands in some of the old code that made the server unique. Some features about the server: ⚔️ Original Castle Reward System 🏹 Classic L2Pride Class Balance & Hunter's Village S-Grade PvP 🎯 12 Subclasses • Automatic TVT / CTF / DM / VIP Events 🔄 Fully Functional Rebirth System 🏆 PvP Rewards every 1,000 PvP Points 👑 Fully Working Olympiad ☠️ Cursed Weapons with Void Burst & Void Flow 💰 Beleth's Bronze, Silver & Gold Currency System since Adena is too easy to get ⭐ Safe Enchant +6 • Max Enchant +25 📍 Start: Cave of Trials • ⚔️ Leveling: Varka Silenos 🏛️ Farm Instances: Cave of Trials & Cemetery 🤖 Optional Autofarm & Healbot • 🚀 Teleport Stone The server is strictly focusing around PvP while minimizing PvE to the minimum, all classes have been balanced and tweaked for PvP, even dumb classes like Prophets and Bladedancers are now useful and fun to play PvP with. Posting this since there has been a lot of interest and approval from this subreddit, you can stay tuned and up to date about the opening here: https://discord.com/invite/2Knae6mmTx This is also our website made after the classic version of the game: https://www.l2belle.org/ (you can find more info and guides here) Since this is a server focused heavily on PvP we are expecting a lot of clans and people to join and make this a joyful ride. See you soon
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..