Jump to content
  • 0

[Request] Pcpoint System


Question

7 answers to this question

Recommended Posts

  • 0
Posted

Ow.. yeah

About this..

see my post in L2J Sever Forum.

thx

 

I dont have forum accoun there, so I dont have acces, post it here.

  • 0
Posted

Sorry Matim

So.. when I tested the system on the old server Red Line there could use buffs, and special items starting at points accrued when mobs ditched...

 

On this code, I found a source in

 

See:

Index: java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java (revision 3695)
+++ java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java (working copy)
@@ -32,6 +32,7 @@
import net.sf.l2j.gameserver.model.itemcontainer.PcInventory;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.ExBrExtraUserInfo;
+import net.sf.l2j.gameserver.network.serverpackets.ExPCCafePointInfo; // add - PCCafePoint
import net.sf.l2j.gameserver.network.serverpackets.ItemList;
import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
@@ -241,6 +242,17 @@
}
break;
}
+ // add start - PCCafePoint
+ case 14559:
+ {
+ if (player.getPCCafePoint() < e.getItemCount() * _amount)
+ {
+ player.sendPacket(new SystemMessage(SystemMessageId.SHORT_OF_ACCUMULATED_POINTS));
+ return;
+ }
+ break;
+ }
+ // add end
default:
{
// if this is not a list that maintains enchantment, check the count of all items that have the given id.
@@ -284,6 +296,18 @@
player.sendPacket(new ExBrExtraUserInfo(player));
break;
}
+ // add start - PCCafePoint
+ case 14559:
+ {
+ int costPoint = (int)(e.getItemCount() * _amount);
+ int leftPoint = player.getPCCafePoint() - costPoint;
+ player.setPCCafePoint(leftPoint);
+ player.sendPacket(new SystemMessage(SystemMessageId.USING_S1_PCPOINT).addItemNumber(costPoint));
+ costPoint *= -1;
+ player.sendPacket(new ExPCCafePointInfo(player.getPCCafePoint(), costPoint, 2, 10000, 4));
+ break;
+ }
+ // add end
default:
{

Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 3695)
+++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)
@@ -439,6 +439,8 @@
TvTEvent.onLogin(activeChar);

L2ClassMasterInstance.showQuestionMark(activeChar);
+
+ activeChar.startPCCafePointTask(); // add - PCCafePoint
}

/**
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 3695)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -163,6 +163,7 @@
import net.sf.l2j.gameserver.network.serverpackets.ExGetOnAirShip;
import net.sf.l2j.gameserver.network.serverpackets.ExOlympiadMode;
import net.sf.l2j.gameserver.network.serverpackets.ExOlympiadUserInfo;
+import net.sf.l2j.gameserver.network.serverpackets.ExPCCafePointInfo; // add - PCCafePoint
import net.sf.l2j.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
import net.sf.l2j.gameserver.network.serverpackets.ExSetCompassZoneCode;
import net.sf.l2j.gameserver.network.serverpackets.ExSpawnEmitter;
@@ -253,9 +254,9 @@
private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE charId=? AND class_index=?";

// Character Character SQL String Definitions:
- private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,

fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,

base_class,newbie,nobless,power_grade,last_recom_date)

values ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
- private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,

exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,

deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,

punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,

apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,

death_penalty_level=?,bookmarkslot=?,vitality_points=? WHERE charId=?";
- private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points FROM characters WHERE charId=?";
+ private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,

fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,

base_class,newbie,nobless,power_grade,last_recom_date,pc_point) 

values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; // edit - PCCafePoint
+ private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,

exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,

deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,

punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,

apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,

death_penalty_level=?,bookmarkslot=?,vitality_points=?,pc_point=? WHERE charId=?"; // edit - PCCafePoint
+ private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,pc_point FROM characters WHERE charId=?"; // edit - PCCafePoint

// Character Teleport Bookmark:
private static final String INSERT_TP_BOOKMARK = "INSERT INTO character_tpbookmark (charId,Id,x,y,z,icon,tag,name) values (?,?,?,?,?,?,?,?)";
@@ -6004,6 +6005,7 @@
stopChargeTask();
stopFameTask();
stopVitalityTask();
+ stopPCCafePointTask(); // add - PCCafePoint
}

/**
@@ -7065,6 +7067,7 @@
statement.setInt(34, isNoble() ? 1 :0);
statement.setLong(35, 0);
statement.setLong(36,System.currentTimeMillis());
+ statement.setInt(37, getPCCafePoint()); // add - PCCafePoint

statement.executeUpdate();
statement.close();
@@ -7249,6 +7252,8 @@
// Set Teleport Bookmark Slot
player.setBookMarkSlot(rset.getInt("BookmarkSlot"));

+ player.setPCCafePoint(rset.getInt("pc_point")); // add - PCCafePoint
+ 
// Retrieve the name and ID of the other characters assigned to this account.
PreparedStatement stmt = con.prepareStatement("SELECT charId, char_name FROM characters WHERE account_name=? AND charId<>?");
stmt.setString(1, player._accountName);
@@ -7581,7 +7586,8 @@
statement.setLong(51, getDeathPenaltyBuffLevel());
statement.setInt(52, getBookMarkSlot());
statement.setInt(53, getVitalityPoints());
- statement.setInt(54, getObjectId());
+ statement.setInt(54, getPCCafePoint()); // add - PCCafePoint
+ statement.setInt(55, getObjectId());

statement.execute();
statement.close();
@@ -13976,4 +13982,57 @@
break;
}
}
+
+ private int _PCCafePoint = 20000;
+ protected Future<?> _PCCafePontTask = null;
+
+ public int getPCCafePoint()
+ {
+ return _PCCafePoint;
+ }
+
+ public void setPCCafePoint(int point)
+ {
+ _PCCafePoint = point;
+ }
+
+ public void startPCCafePointTask()
+ {
+ if (_PCCafePontTask == null)
+ _PCCafePontTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new PCCafePontTask(this), 1800000, 1800000);
+ sendPacket(new ExPCCafePointInfo(getPCCafePoint(), 1, 1, 10000, 0));
+ }
+
+ private void stopPCCafePointTask()
+ {
+ if (_PCCafePontTask != null)
+ {
+ _PCCafePontTask.cancel(false);
+ _PCCafePontTask = null;
+ }
+ }
+
+ class PCCafePontTask implements Runnable
+ {
+ private final L2PcInstance _player;
+ protected PCCafePontTask(L2PcInstance player)
+ {
+ _player = player;
+ }
+ public void run()
+ {
+ if (Rnd.get(100) > 90)
+ {
+ setPCCafePoint(getPCCafePoint() + 200);
+ _player.sendPacket(new SystemMessage(SystemMessageId.ACQUIRED_S1_PCPOINT_DOUBLE).addItemNumber(200));
+ _player.sendPacket(new ExPCCafePointInfo(getPCCafePoint(), 200, 1, 10000, 0));
+ }
+ else
+ {
+ setPCCafePoint(getPCCafePoint() + 100);
+ _player.sendPacket(new SystemMessage(SystemMessageId.ACQUIRED_S1_PCPOINT).addItemNumber(100));
+ _player.sendPacket(new ExPCCafePointInfo(getPCCafePoint(), 100, 1, 10000, 0));
+ }
+ }
+ }
}



2. Add data-side handlers



TARGET : handlers.MasterHandler.java

.

.
private static void loadItemHandlers()
{
+ ItemHandler.getInstance().registerItemHandler(new PCCafePoint()); // add - PCCafePoint

ItemHandler.getInstance().registerItemHandler(new ScrollOfResurrection());



ADD : handlers.itemhandlers.PCCafePoint.java



/*
* 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 handlers.itemhandlers;


/**
*
* @author digiri99 < L2Dot Corea Team>
* http://www.l2jtw..../trac/L2AE
*/

import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.actor.L2Playable;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.ExPCCafePointInfo;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;



public class PCCafePoint implements IItemHandler
{
public void useItem(L2Playable player, L2ItemInstance item)
{
if (!(player instanceof L2PcInstance))
return;

L2PcInstance activeChar = (L2PcInstance) player;
if (activeChar.isCastingNow())
return;

activeChar.destroyItem("PC BANG POINT ", item.getObjectId(), 1, null, false);

int leftPoint = activeChar.getPCCafePoint() + 7000;
activeChar.setPCCafePoint(leftPoint);
activeChar.sendPacket(new SystemMessage(SystemMessageId.ACQUIRED_S1_PCPOINT).addItemNumber(7000));
activeChar.sendPacket(new ExPCCafePointInfo(activeChar.getPCCafePoint(), 7000, 1, 10000, 0));
}
}



3. Add a database field, and specify the item handler



3.1 Character in the PCpoint table Add Field Points



3.1.1 In the absence of an existing character information



ALTER TABLE characters ADD `pc_point` int(11) NOT NULL;



3.1.2 If you have an existing character information



ALTER TABLE characters ADD `pc_point` int(11) DEFAULT NULL;

UPDATE characters SET pc_point = '20000';



3.2 Others in this PCpoint item table handler points to the items specified Coupon



UPDATE etcitem SET handler='PCCafePoint' where item_id='14559';




4. multisell exercise



<?xml version='1.0' encoding='utf-8'?>
<!-- vitamin item : PC point buy -->
<list>
<item id="1">
<production id="13239" count="1"/>
<ingredient id="14559" count="1000"/>
</item>
<item id="2">
<production id="13240" count="1"/>
<ingredient id="14559" count="1000"/>
</item>
<item id="3">
<production id="13241" count="1"/>
<ingredient id="14559" count="1000"/>
</item>
<item id="4">
<production id="13242" count="1"/>
<ingredient id="14559" count="1000"/>
</item>
<item id="5">
<production id="13243" count="1"/>
<ingredient id="14559" count="1000"/>
</item>
<item id="6">
<production id="13244" count="1"/>
<ingredient id="14559" count="1000"/>
</item>
<item id="7">
<production id="13245" count="1"/>
<ingredient id="14559" count="1000"/>
</item>
<item id="8">
<production id="13246" count="1"/>
<ingredient id="14559" count="1000"/>
</item>
<item id="9">
<production id="13247" count="1"/>
<ingredient id="14559" count="1000"/>
</item>
<item id="10">
<production id="13022" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="11">
<production id="14053" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="12">
<production id="14054" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="13">
<production id="14091" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="14">
<production id="14092" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="15">
<production id="13254" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="16">
<production id="14093" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="17">
<production id="14094" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="18">
<production id="14095" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="19">
<production id="13019" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="20">
<production id="13020" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="21">
<production id="13017" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="22">
<production id="13018" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="23">
<production id="14064" count="1"/>
<ingredient id="14559" count="10000"/>
</item>
<item id="24">
<production id="14063" count="1"/>
<ingredient id="14559" count="10000"/>
</item>
<item id="25">
<production id="14062" count="1"/>
<ingredient id="14559" count="10000"/>
</item>
<item id="26">
<production id="14061" count="1"/>
<ingredient id="14559" count="10000"/>
</item>
<item id="27">
<production id="13015" count="1"/>
<ingredient id="14559" count="20000"/>
</item>
<item id="28">
<production id="13016" count="1"/>
<ingredient id="14559" count="500"/>
</item>
<item id="29">
<production id="13021" count="1"/>
<ingredient id="14559" count="5000"/>
</item>
<item id="30">
<production id="14055" count="1"/>
<ingredient id="14559" count="10000"/>
</item>
<item id="31">
<production id="10649" count="1"/>
<ingredient id="14559" count="1000"/>
</item>
<item id="32">
<production id="14559" count="1"/>
<ingredient id="3554" count="2"/>
</item>
</list> 

 

I change this to Gracia Epilogue, but still dont know how to make the event work, here is the code

 

This is the only picture I have about this system..  :-\

shot00001xq0.png

 

  • 0
Posted

Post few proper informations. Revision etc.

 

but still dont know how to make the event work

 

Do you have any error? During compilation or during GS startup

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

    • [Share]korean protocol 606 new lobby collection   kr 606 new lobby assassin     kr 606 new lobby bartz       kr 606 new lobby basic       Instructions: Place the files into the 'Video' folder within your game client. (Remember to create backups of your files before replacing them.)   Supported game protocols: 110,140,152,166,196,228,235,245,272,286,306,311,338,362,388,390,393,395,413,414,415,417,418,419,422, 424,425,426,430,437,438,439,444,446,447,449,450,458,459,460,462,464,465,470,474,480,481,482,487, 493,495,502,507,509,511,513,516,520   Download link > https://drive.usercontent.google.com/download?id=1hZy-CcerRDy49gC0VWN_1jxPyHAcd0SU&export <  7zip compression; password  RED-TEAM-REVERSECODE             
    • GRAND OPENING TODAY! 30/10/2026, FRIDAY, 20:00 +3 GMT 
    • Hey everyone! Just a quick update from the WARFRONT team. After months of development, testing and plenty of changes based on player feedback, we're finally opening tomorrow, 30 October at 18:00 UTC. For anyone who hasn't heard about the project, WARFRONT is a heavily customised Interlude GvE server focused on Angels vs Demons faction PvP. The main difference is our battlefield system. Instead of fighting endlessly over random kills, factions capture Outposts, unlock the Main Outpost and eventually push into enemy territory to destroy the opposing Headquarters. We've also spent a considerable amount of time working on class balance, progression, faction balancing and giving traditionally overlooked classes a useful role in PvP. Some of the main features: Level 80 start with free B Grade equipment Rotating faction battlefields with objectives 31 rebalanced classes Daily faction siege Grand Boss faction events Chaos, TvT, CTF, Deathmatch and King of the Hill Gear Battle XP and character progression Free and Premium Battle Pass Custom faction balancing and mercenary system We had 110 participants during Closed Beta and made numerous improvements following their feedback. If you enjoy Interlude faction PvP, feel free to give us a try. Grand Opening: Friday, 30 October 2026 at 18:00 UTC Website: https://l2warfront.com/ See you tomorrow!
    • OPEN BETA STARTS ON FRIDAY, OCTOBER 30, AT 18:00 EASTERN EUROPEAN TIME - don't forget to join!
    • 🤝 Team and agency packs available: Bulk discounts across ChatGPT Plus, Claude Pro, and YouTube Premium subscriptions.     FINAL CALL: Google is Shutting This Down After October 2026! Google will NEVER bring back this window of opportunity again. Once this month ends, this massive backdoor upgrade is gone permanently!  BUY 2, GET 1 FREE IS STILL LIVE! Stock up now for yourself, your family, your business, and your friends! Think about it: Every single person you know uses a Gmail account, and everyone is running out of storage. Don't let your loved ones get trapped paying $20–$30 every single month when you can set them up with 5TB Cloud Storage + Gemini Advanced (12–18 Months) right now for only $15! Why Buy Bulk Activations Today? Instant Gift Value: Perfect lifetime-style gift for clients, family, or team members. 100% Private & Safe: Activates on personal Gmails—zero passwords or logins required. Global Access: Works worldwide with zero VPN hassles. Instant Automated Delivery: Receive your activation links in seconds 24/7! ‍ Time is running out fast—secure your extra free licenses before the October deadline hits! Order Your Bundle Now on the Website
  • 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..