Jump to content

Recommended Posts

Posted

Casino Manager:

 

1.) Go to: head-src/com/l2jfrozen/gameserver/model/actor/instance

2.) Create new .Java file

3.) Name it: L2CasinoInstance

4.) Paste This Inside:

 

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 am-beep-t = 0;
if (command.startsWith("play1"))
{
StringTokenizer st = new StringTokenizer(command);
try
{
st.nextToken();
am-beep-t = Integer.parseInt(st.nextToken());
}
catch (NoSuchElementException nse)
{
}
Casino1(player, am-beep-t);
}
}

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 InStadia 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 am-beep-t)
{
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, am-beep-t);
player.setSkillCast(ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer));
}

static class Casino1 implements Runnable {
private L2PcInstance _player;
private int _am-beep-t;

Casino1(L2PcInstance player, int am-beep-t) {
this._am-beep-t = am-beep-t;
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(11001, 0) >= this._am-beep-t)
{
if (chance == 0)
{
L2CasinoInstance.displayCongrats(this._player);

this._player.addItem("Gift", 11001, this._am-beep-t, this._player, true);
this._player.broadcastUserInfo();
}

if (chance == 1)
{
L2CasinoInstance.displayCongrats2(this._player);

this._player.destroyItemByItemId("Consume", 11001, this._am-beep-t, this._player, true);
this._player.broadcastUserInfo();
}

if (chance == 2)
{
L2CasinoInstance.displayCongrats2(this._player);

this._player.destroyItemByItemId("Consume", 11001, this._am-beep-t, this._player, true);
this._player.broadcastUserInfo();
}
}
else
{
this._player.sendMessage("You do not have enough Vote Items!");
}
}
}
}

5.) Find Every 11001...(this is the item players will use to play in Casino!

6.) Change ALL 11001 with the ID of the Item you want!

e.g.: 57 = adena

7.) Save it.

8.) Go to Database and Find "Npc"  or  "Custom_npc" table...

9.) Make or Add a NEW NPC...make it as you wish...but in "Type" put:  L2Casino

 

 

 

Password Changer

 

1.) Go to: head-src/com/l2jfrozen/gameserver/model/actor/instance

2.) Create new .Java file

3.) Name it: L2PasswordChangerInstance

4.) Paste This Inside:

/* 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.l2jfrozen.gameserver.model.actor.instance;

import com.l2jfrozen.crypt.Base64;
import com.l2jfrozen.gameserver.ai.CtrlIntention;
import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
import com.l2jfrozen.gameserver.network.serverpackets.LeaveWorld;
import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
import com.l2jfrozen.util.database.L2DatabaseFactory;

import java.security.MessageDigest;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.StringTokenizer;
import javolution.text.TextBuilder;

public class L2PasswordChangerInstance extends L2FolkInstance
{
public L2PasswordChangerInstance(int objectId, L2NpcTemplate template)
{
super(objectId, template);
}

public void onBypassFeedback(L2PcInstance player, String command)
{
if (command.startsWith("change_password"))
{
StringTokenizer st = new StringTokenizer(command);
st.nextToken();
String currPass = null;
String newPass = null;
String repeatNewPass = null;
try
{
if (st.hasMoreTokens())
{
currPass = st.nextToken();
newPass = st.nextToken();
repeatNewPass = st.nextToken();
}
else
{
player.sendMessage("Please fill in all the blanks before requesting for a password change.");
return;
}
changePassword(currPass, newPass, repeatNewPass, player);
}
catch (StringIndexOutOfBoundsException e)
{
}
}
}

public void onAction(L2PcInstance player)
{
if (!canTarget(player)) {
return;
}

if (this != player.getTarget())
{
player.setTarget(this);

player.sendPacket(new MyTargetSelected(getObjectId(), 0));

player.sendPacket(new ValidateLocation(this));
}
else if (!canInteract(player))
{
player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
}
else
{
showHtmlWindow(player);
}

player.sendPacket(new ActionFailed());
}

private void showHtmlWindow(L2PcInstance activeChar)
{
NpcHtmlMessage nhm = new NpcHtmlMessage(5);
TextBuilder replyMSG = new TextBuilder("");

replyMSG.append("<html><title>L2 InStadia Account Manager</title>");
replyMSG.append("<body><center>");
replyMSG.append("To change your password:<br1> First fill in your current password and then your new!</font><br>");
replyMSG.append("Current Password: <edit var=\"cur\" width=100 height=15><br>");
replyMSG.append("New Password: <edit var=\"new\" width=100 height=15><br>");
replyMSG.append("Repeat New Password: <edit var=\"repeatnew\" width=100 height=15><br><br>");
replyMSG.append("<button value=\"Change Password\" action=\"bypass -h npc_" + getObjectId() + "_change_password $cur $new $repeatnew\" width=204 height=20 back=\"sek.cbui75\" fore=\"sek.cbui75\">");
replyMSG.append("</center></body></html>");

nhm.setHtml(replyMSG.toString());
activeChar.sendPacket(nhm);

activeChar.sendPacket(new ActionFailed());
}

public static boolean changePassword(String currPass, String newPass, String repeatNewPass, L2PcInstance activeChar)
{
if (newPass.length() < 5)
{
activeChar.sendMessage("The new password is too short!");
return false;
}
if (newPass.length() > 20)
{
activeChar.sendMessage("The new password is too long!");
return false;
}
if (!newPass.equals(repeatNewPass))
{
activeChar.sendMessage("Repeated password doesn't match the new password.");
return false;
}

Connection con = null;
String password = null;
try
{
MessageDigest md = MessageDigest.getInstance("SHA");
byte[] raw = currPass.getBytes("UTF-8");
raw = md.digest(raw);
String currPassEncoded = Base64.encodeBytes(raw);

con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement("SELECT password FROM accounts WHERE login=?");
statement.setString(1, activeChar.getAccountName());
ResultSet rset = statement.executeQuery();
while (rset.next())
{
password = rset.getString("password");
}
rset.close();
statement.close();
byte[] password2 =
null;
if (currPassEncoded.equals(password))
{
password2 = newPass.getBytes("UTF-8");
password2 = md.digest(password2);

PreparedStatement statement2 = con.prepareStatement("UPDATE accounts SET password=? WHERE login=?");
statement2.setString(1, Base64.encodeBytes(password2));
statement2.setString(2, activeChar.getAccountName());
statement2.executeUpdate();
statement2.close();

activeChar.sendMessage("Congratulations! Your password has been changed succesfully. You will now be disconnected for security reasons. Please login again!");
try
{
Thread.sleep(3000L);
}
catch (Exception e)
{
}

activeChar.deleteMe();

activeChar.sendPacket(new LeaveWorld());
}
else
{
activeChar.sendMessage("The current password you've inserted is incorrect! Please try again!");

return password2 != null;
}
}
catch (Exception e)
{
_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;
}
}

5.) Save it, Compile.

6.) Go to Database and Find "Npc"  or  "Custom_npc" table...

7.) Make or Add a NEW NPC...make it as you wish...but in "Type" put:  L2PasswordChanger

 

8.) Finaly if you know how to Log in Lineage II Interlude Client....just log in and play!

 

Navicat:

INSERT INTO `custom_npc` VALUES ('99000', '35435', 'Password Changer', '1', 'Server-name', '1', null, '8.00', '37.00', '80', 'female', 'L2PasswordChanger', '40', '1000', '1000', '10.00', '10.00', '40', '43', '30', '21', '20', '10', '10', '10', '1000', '1000', '1000', '1000', '100', '0', '0', '0', '0', '0', '55', '120', '0', '0', '0', '0', 'LAST_HIT');
INSERT INTO `custom_npc` VALUES ('50022', '30993', 'Casino Manager', '1', 'Server-name', '1', null, '8.00', '17.00', '70', 'male', 'L2Casino', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '55', '120', '0', '0', '0', '0', 'LAST_HIT');

 

 

P.s. i don't know if has again become share if again I apologize

 

Credits To  L2Shax's developer

Posted

Why? Some people aren't in L2jFrozen's Forum.

The only thing that he have to do, is to give credits to =Dev=Impact.

 

Since when was he capable of doing anything other then throwing random words into a sentence? It's not even his creation, just a reshare and maybe a 1 line difference that made it 'his'.

Posted

Since when was he capable of doing anything other then throwing random words into a sentence? It's not even his creation, just a reshare and maybe a 1 line difference that made it 'his'.

Sorry then.
Guest Elfocrash
Posted

Why? Some people aren't in L2jFrozen's Forum.

The only thing that he have to do, is to give credits to =Dev=Impact.

the author is L2Shax's developer

Posted

It's reworked for L2jFrozen.

:O and what he changed the imports? WTF it's an instance it can work on any interlude project.

Still the code's author is Fakoykas aka Versus

Posted

It's reworked for L2jFrozen.

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.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • sql procedure missed and wrong...fixed it...ZOUMHS 
    • Hello Dexters! https://lineage2dex.com    This is pre-announcing of NEW season server, so we want to share some key points of it. Full details with road map, patch notes we will announce a bit latter Opening September 27 at 19:00 (UTC +3) Open Beta Test from September 23 What’s New This Season?, This is just a short preview of the most exciting changes and updates. A patch note with balance change will be posted later in this thread – one topic with all patchnotes history from 2022 year EXP/SP x25 - Over the past few seasons, our servers were drifting closer to a mid-rate style. And hard to call it now pure PVP server. That’s why we’ve reduced EXP/SP rates from x50 to x25 – making progression smoother, more balanced, and more in line with the mid-rate identity., Improved Olympiad matchmaking – opponents will be matched by strength, making feeding much harder., K/D stats for CC – track your real impact!, New In-Game Shop Interface - no more running to NPCs for supplies – buy everything directly from the interface. NPC Astarte will now only handle services like WH, sales, LS insertion, etc., Balance Adjustments - small but important tweaks for a smoother PvP experience (details in patch notes)., Replica Instance System Reworked - upgrading replicas now requires not only fragments but also real jewellery from B to S grades. You can choose from 3 instance types: PvP Instance – biggest rewards (everyone spawns together for mass PvP)., CC Instance – private instance for your CC., Party Instance – private instance for your party., , Dino Island Returns - back by popular demand: Dark Zone (PvP) and Light Zone (PvE)., Newbie Pass Questline - available at character creation – helps you get familiar with the server and make start progression faster., Clan members taxation system, Full announce - read on forum, https://forum.lineage2dex.com/threads/16723/ (edited)   We’re excited to show you how the Newbie Path will look on the Seasonal Server and share a few details about it. The Newbie Path is designed to help new players on Dex adapt more easily on project. While it won’t reveal the full content of the game, it will greatly assist during the early stages of your journey. But it’s not just for newcomers! Even veteran players will find it useful — completing Newbie Path steps will grant you small progression boosts and extra rewards(exp boosts, some gear, potions etc). Definitely worth using! You’ll be able to test the full Newbie Path system yourself during the Open Beta, launching on September 23rd!
    • 📢 [OFFICIAL ANNOUNCEMENT] 🔥 Lineage 2 Interlude x10 Craft-PvP 🔥 🎮 Grand Opening — September 19 @ 19:00 [UTC +2] 🧪 Open Beta — September 15 @ 19:00 [UTC +2]    🌐 Full server description - https://lineage2.ms/en/wiki 💥 Why Interlude x10 Craft-PvP? ✅ GM Shop up to B-Grade + Full Buffs — get straight to action, no pointless grinding. ✅ Unique Geodata & Geopathfinding Engine — smooth, tactical, and truly next-gen. ✅ Two Client Options — play in Classic or Interlude style. ✅ No Pay-to-Win — donations don’t break the balance. ✅ 1+1 Mode Enabled — max 2 windows, only 1 active = no box armies. ✅ Bot-Free Zone — advanced protection + non-intrusive popup captchas. ✅ No GM Interference — fair, competitive PvP environment. ✅ No Wipes — your progress is safe. ✅ Truly International — global reach, not just CIS players. 🛡 2nd Season. Stronger, Smarter, Updated. 🎯 Pure Craft-PvP. 🌍 Real Competition. 📅 Mark your calendars. Tell your clan. Invite your friends. Let’s make this season legendary. 💪 https://discord.gg/lineage2ms
    • As far as I know, L2Gold stated (unofficially) that closed for legal reasons. Although, my estimation is that it had reached such low popularity (believe me I know, I played till the last day), so they closed it because of that. As for "other" copies or w/e. I believe that everyone has the right to do what they think is best.  I have to say, I find your claims a bit exaggerating. Many servers have done a good job at recreating such a server. There are actually leaked files of C4 L2Gold (L2OFF) so many owners started working from there (L2Gold.cc (old Avellan), L2Gold.in, L2Gold.co etc.) There are other owners that took the idea 1 step further, adapting L2Gold in higher Chronicles and started working on a brand-new style with old features along. @Trance @Brado @To4kA (those are some of the owners that I can think of right now). I think you should re-think your opinions and don't judge them all together. Many of the servers you've mentioned has actually done a decent job and tried to take the brand, one step further. The argument here is that everyone should do what they want. Community will judge if it's good or bad.
  • Topics

×
×
  • 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