PC Cafe system.

This commit is contained in:
MobiusDev 2016-06-19 09:53:20 +00:00
parent 4f15b682b7
commit 4ba1009e12
23 changed files with 1000 additions and 21 deletions

View File

@ -53,7 +53,8 @@ CREATE TABLE IF NOT EXISTS `characters` (
`vitality_points` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, `vitality_points` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0,
`createDate` date NOT NULL DEFAULT '0000-00-00', `createDate` date NOT NULL DEFAULT '0000-00-00',
`language` VARCHAR(2) DEFAULT NULL, `language` VARCHAR(2) DEFAULT NULL,
`faction` TINYINT UNSIGNED NOT NULL DEFAULT 0, `faction` TINYINT UNSIGNED NOT NULL DEFAULT '0',
`pccafe_points` int(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`charId`), PRIMARY KEY (`charId`),
KEY `account_name` (`account_name`), KEY `account_name` (`account_name`),
KEY `char_name` (`char_name`), KEY `char_name` (`char_name`),

View File

@ -426,7 +426,7 @@
<!-- ADMIN PLEDGE --> <!-- ADMIN PLEDGE -->
<admin command="admin_pledge" accessLevel="100" /> <admin command="admin_pledge" accessLevel="100" />
<!-- ADMIN POLYMORPH --> <!-- ADMIN POLYMORPH -->
<admin command="admin_polymorph" accessLevel="100" /> <admin command="admin_polymorph" accessLevel="100" />
<admin command="admin_unpolymorph" accessLevel="100" /> <admin command="admin_unpolymorph" accessLevel="100" />
@ -434,6 +434,9 @@
<admin command="admin_untransform" accessLevel="100" /> <admin command="admin_untransform" accessLevel="100" />
<admin command="admin_transform_menu" accessLevel="100" /> <admin command="admin_transform_menu" accessLevel="100" />
<!-- ADMIN PC CAFE POINTS -->
<admin command="admin_pccafepoints" accessLevel="100" />
<!-- ADMIN PRIME POINTS --> <!-- ADMIN PRIME POINTS -->
<admin command="admin_primepoints" accessLevel="100" /> <admin command="admin_primepoints" accessLevel="100" />

View File

@ -506,6 +506,50 @@ PremiumRateDropChanceByItemId = 57,2;6656,1;6657,1;6658,1;6659,1;6660,1;6661,1;6
PremiumRateDropAmountByItemId = 57,2;6656,1;6657,1;6658,1;6659,1;6660,1;6661,1;6662,1;8191,1;10170,1;10314,1 PremiumRateDropAmountByItemId = 57,2;6656,1;6657,1;6658,1;6659,1;6660,1;6661,1;6662,1;8191,1;10170,1;10314,1
# ---------------------------------------------------------------------------
# PC Cafe (PC Bang) System
# ---------------------------------------------------------------------------
# PC CAFE POINTS ID = -100
# PC Cafe Enabled.
PcCafeEnabled = False
# Allow only players with a Premium account.
PcCafeOnlyPremium = False
# Max points that player may have.
# Limited by int limit.
MaxPcCafePoints = 200000
# PC Bang point rate.
# Acquisition formula equals (exp * 0.0001 * AcquisitionPointsRate)
# e.g. with 1.0 it's 10000 exp = 1 PC Bang point
# 2.0 - 10000 exp = 2 PC Bang points
# 0.5 - 5000 exp = 1 PC Bang point
AcquisitionPointsRate = 1.0
# Use random points rewarding.
# If enabled points will be random from points/2 to points.
AcquisitionPointsRandom = False
# Creates a chance to aquire double points.
DoublingAcquisitionPoints = True
# Double points chance.
# Used when DoublingAcquisitionPoints is enabled.
# Default 1 (%)
DoublingAcquisitionPointsChance = 1
# Reward low exp kills
# Acquire points if player gains exp and aquire formula equals 0.
RewardLowExpKills = True
# Chance for low exp kills
# Used when RewardLowExpKills is enabled.
# Default 50 (%)
RewardLowExpKillsChance = 50
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Sell Buffs configuration # Sell Buffs configuration
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -44,8 +44,8 @@ Characters Related:<br1>
<td><button value="Effects" action="bypass -h admin_admin3" width=82 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="Effects" action="bypass -h admin_admin3" width=82 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr> </tr>
<tr> <tr>
<td></td> <td><button value="PC Points" action="bypass -h admin_pccafepoints" width=82 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td></td> <td><button value="NCoins" action="bypass -h admin_primepoints" width=82 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Premium" action="bypass -h admin_premium_menu" width=82 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="Premium" action="bypass -h admin_premium_menu" width=82 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr> </tr>
</table> </table>

View File

@ -28,6 +28,7 @@
<td><button value="goSpawn" action="bypass -h admin_list_spawns $qbox 1" width=65 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="goSpawn" action="bypass -h admin_list_spawns $qbox 1" width=65 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr><tr> </tr><tr>
<td><button value="Scan" action="bypass -h admin_scan $qbox" width=65 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="Scan" action="bypass -h admin_scan $qbox" width=65 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="PC Points" action="bypass -h admin_pccafepoints" width=65 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="NCoins" action="bypass -h admin_primepoints" width=65 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="NCoins" action="bypass -h admin_primepoints" width=65 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr> </tr>
</table> </table>

View File

@ -0,0 +1,60 @@
<html><title>Admin PC Points Manager</title><body>
<center>
<table width=270 align=center>
<tr>
<td width=45><button value="Main" action="bypass admin_admin" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td width=180><center>Admin PC Points Manager</center></td>
<td width=45><button value="Back" action="bypass -h admin_admin6" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
</table>
<br>
<font color="LEVEL">Target info</font><br1>
<table width="270" align=center border="0" bgcolor="444444">
<tr>
<td>Player Name:</td>
<td><font color="00FF00">%targetName%<font></td>
</tr>
<tr>
<td>Player Points:</td>
<td><font color="00FF00">%points%<font></td>
</tr>
</table>
<br>
<font color="LEVEL">Target Operations</font><br1>
<table width=256 align=center border=0 bgcolor="444444">
<tr>
<td width=128 align=center>Operation</td>
<td width=128 align=center><combobox width=120 height=17 var=ebox list=increase;decrease;set></td>
</tr>
<tr>
<td width=128 align=center>Value</td>
<td width=128 align=center><edit var="val" width=120 type="number"></td>
</tr>
</table>
<table width="270" align=center border="0" bgcolor="444444">
<tr>
<td><center><br><button value="Confirm" action="bypass -h admin_pccafepoints $ebox $val" width=80 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center></td>
</tr>
</table>
<br>
<font color="LEVEL">Reward More players</font><br1>
<table width=256 align=center border=0 bgcolor="444444">
<tr>
<td width=128 align=center>Range</td>
<td width=128 align=center><edit var="range" width=120 type="number"></td>
</tr>
<tr>
<td width=128 align=center>Value</td>
<td width=128 align=center><edit var="val2" width=120 type="number"></td>
</tr>
</table>
<table width="257" align=center border="0" bgcolor="444444">
<tr>
<td><center><br><button value="Confirm" action="bypass -h admin_pccafepoints rewardOnline $val2 $range" width=80 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center></td>
</tr>
<tr>
<td><center>Note: If you leave 'Range' empty or set 0,<br1>it will reward all online players.</center></td>
</tr>
</table>
</center>
</body></html>

10
trunk/dist/game/data/html/pccafe.htm vendored Normal file
View File

@ -0,0 +1,10 @@
<html><title>Player Commendation System</title><body>Player Commendation Points:<br>
You can use PC points to buy items.<br>
It is possible to buy several <font color="LEVEL">General Items</font>, like hair accessories or even time-limited <font color="LEVEL">Commendation Weapons</font>.<br>
Take a look on the current rewards.<br>
<br>
<font color="LEVEL">
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h pccafe_buy 900001">Buy General Items</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h pccafe_buy 900002">Buy Commendation Weapons</Button>
</font>
</body></html>

View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
<item>
<!-- Pc Bang Point -->
<ingredient count="600" id="-100" />
<!-- Firework -->
<production count="1" id="6406" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="1200" id="-100" />
<production count="1" id="6407" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="96000" id="-100" />
<production count="1" id="7842" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="96000" id="-100" />
<production count="1" id="7844" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="144000" id="-100" />
<production count="1" id="8557" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="144000" id="-100" />
<production count="1" id="8910" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9184" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9185" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9187" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9188" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9190" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9191" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9192" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9194" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9195" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9197" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9198" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9199" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9201" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9202" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="12000" id="-100" />
<production count="1" id="9204" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="192000" id="-100" />
<production count="1" id="12779" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="192000" id="-100" />
<production count="1" id="12780" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="3500" id="-100" />
<production count="1" id="15356" />
</item>
<item>
<!-- Pc Bang Point -->
<ingredient count="3000" id="-100" />
<production count="1" id="15357" />
</item>
</list>

View File

@ -0,0 +1,316 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
<!-- PC - Apocalypse Weapons -->
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34509" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34510" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34511" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34512" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34513" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34514" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34515" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34516" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34517" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34518" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34519" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34520" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34521" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34522" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34523" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34524" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34525" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34526" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34527" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34528" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34529" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34530" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34531" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34532" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34533" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34534" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34535" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34536" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34537" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34538" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34539" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34540" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34541" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34542" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34543" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34544" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34545" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34546" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34547" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34548" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34549" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34550" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34551" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34552" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34553" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34554" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34555" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34556" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34557" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34558" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34559" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34560" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34561" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34562" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34563" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34564" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34565" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34566" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34567" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34568" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34569" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34570" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34571" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34572" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34573" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34574" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34719" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34720" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34721" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34722" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34723" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34724" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34725" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34726" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34727" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34728" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34729" />
</item>
<item>
<ingredient count="20000" id="-100" />
<production count="1" id="34730" />
</item>
</list>

View File

@ -99,6 +99,7 @@ import handlers.admincommandhandlers.AdminMessages;
import handlers.admincommandhandlers.AdminMobGroup; import handlers.admincommandhandlers.AdminMobGroup;
import handlers.admincommandhandlers.AdminMonsterRace; import handlers.admincommandhandlers.AdminMonsterRace;
import handlers.admincommandhandlers.AdminOlympiad; import handlers.admincommandhandlers.AdminOlympiad;
import handlers.admincommandhandlers.AdminPcCafePoints;
import handlers.admincommandhandlers.AdminPForge; import handlers.admincommandhandlers.AdminPForge;
import handlers.admincommandhandlers.AdminPathNode; import handlers.admincommandhandlers.AdminPathNode;
import handlers.admincommandhandlers.AdminPcCondOverride; import handlers.admincommandhandlers.AdminPcCondOverride;
@ -375,6 +376,7 @@ public class MasterHandler
AdminMonsterRace.class, AdminMonsterRace.class,
AdminOlympiad.class, AdminOlympiad.class,
AdminPathNode.class, AdminPathNode.class,
AdminPcCafePoints.class,
AdminPetition.class, AdminPetition.class,
AdminPForge.class, AdminPForge.class,
AdminPledge.class, AdminPledge.class,

View File

@ -0,0 +1,205 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.admincommandhandlers;
import java.util.Collection;
import java.util.StringTokenizer;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.ExPCCafePointInfo;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.Util;
/**
* Admin PC Points manage admin commands.
*/
public final class AdminPcCafePoints implements IAdminCommandHandler
{
private static final String[] ADMIN_COMMANDS =
{
"admin_pccafepoints",
};
@Override
public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
final StringTokenizer st = new StringTokenizer(command, " ");
final String actualCommand = st.nextToken();
if (actualCommand.equals("admin_pccafepoints"))
{
if (st.hasMoreTokens())
{
final String action = st.nextToken();
final L2PcInstance target = getTarget(activeChar);
if ((target == null) || !st.hasMoreTokens())
{
return false;
}
int value = 0;
try
{
value = Integer.parseInt(st.nextToken());
}
catch (Exception e)
{
showMenuHtml(activeChar);
activeChar.sendMessage("Invalid Value!");
return false;
}
switch (action)
{
case "set":
{
if (value > Config.PC_CAFE_MAX_POINTS)
{
showMenuHtml(activeChar);
activeChar.sendMessage("You cannot set more than " + Config.PC_CAFE_MAX_POINTS + " PC points!");
return false;
}
if (value < 0)
{
value = 0;
}
target.setPcCafePoints(value);
target.sendMessage("Admin set your PC Cafe point(s) to " + value + "!");
activeChar.sendMessage("You set " + value + " PC Cafe point(s) to player " + target.getName());
target.sendPacket(new ExPCCafePointInfo(value, value, 1));
break;
}
case "increase":
{
if (target.getPcCafePoints() == Config.PC_CAFE_MAX_POINTS)
{
showMenuHtml(activeChar);
activeChar.sendMessage(target.getName() + " already have max count of PC points!");
return false;
}
int pcCafeCount = Math.min(target.getPcCafePoints() + value, Config.PC_CAFE_MAX_POINTS);
if (pcCafeCount < 0)
{
pcCafeCount = Config.PC_CAFE_MAX_POINTS;
}
target.setPcCafePoints(pcCafeCount);
target.sendMessage("Admin increased your PC Cafe point(s) by " + value + "!");
activeChar.sendMessage("You increased PC Cafe point(s) of " + target.getName() + " by " + value);
target.sendPacket(new ExPCCafePointInfo(pcCafeCount, value, 1));
break;
}
case "decrease":
{
if (target.getPcCafePoints() == 0)
{
showMenuHtml(activeChar);
activeChar.sendMessage(target.getName() + " already have min count of PC points!");
return false;
}
final int pcCafeCount = Math.max(target.getPcCafePoints() - value, 0);
target.setPcCafePoints(pcCafeCount);
target.sendMessage("Admin decreased your PC Cafe point(s) by " + value + "!");
activeChar.sendMessage("You decreased PC Cafe point(s) of " + target.getName() + " by " + value);
target.sendPacket(new ExPCCafePointInfo(pcCafeCount, value, 1));
break;
}
case "rewardOnline":
{
int range = 0;
try
{
range = Integer.parseInt(st.nextToken());
}
catch (Exception e)
{
}
if (range <= 0)
{
final int count = increaseForAll(L2World.getInstance().getPlayers(), value);
activeChar.sendMessage("You increased PC Cafe point(s) of all online players (" + count + ") by " + value + ".");
}
else if (range > 0)
{
final int count = increaseForAll(L2World.getInstance().getVisibleObjects(activeChar, L2PcInstance.class, range), value);
activeChar.sendMessage("You increased PC Cafe point(s) of all players (" + count + ") in range " + range + " by " + value + ".");
}
break;
}
}
}
showMenuHtml(activeChar);
}
return true;
}
private int increaseForAll(Collection<L2PcInstance> playerList, int value)
{
int counter = 0;
for (L2PcInstance temp : playerList)
{
if ((temp != null) && (temp.isOnlineInt() == 1))
{
if (temp.getPcCafePoints() == Integer.MAX_VALUE)
{
continue;
}
int pcCafeCount = Math.min(temp.getPcCafePoints() + value, Integer.MAX_VALUE);
if (pcCafeCount < 0)
{
pcCafeCount = Integer.MAX_VALUE;
}
temp.setPcCafePoints(pcCafeCount);
temp.sendMessage("Admin increased your PC Cafe point(s) by " + value + "!");
temp.sendPacket(new ExPCCafePointInfo(pcCafeCount, value, 1));
counter++;
}
}
return counter;
}
private L2PcInstance getTarget(L2PcInstance activeChar)
{
return ((activeChar.getTarget() != null) && (activeChar.getTarget().getActingPlayer() != null)) ? activeChar.getTarget().getActingPlayer() : activeChar;
}
private void showMenuHtml(L2PcInstance activeChar)
{
final NpcHtmlMessage html = new NpcHtmlMessage(0, 1);
final L2PcInstance target = getTarget(activeChar);
final int points = target.getPcCafePoints();
html.setHtml(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/admin/pccafe.htm"));
html.replace("%points%", Util.formatAdena(points));
html.replace("%targetName%", target.getName());
activeChar.sendPacket(html);
}
@Override
public String[] getAdminCommandList()
{
return ADMIN_COMMANDS;
}
}

View File

@ -701,6 +701,15 @@ public final class Config
public static float PREMIUM_RATE_SPOIL_AMOUNT; public static float PREMIUM_RATE_SPOIL_AMOUNT;
public static Map<Integer, Float> PREMIUM_RATE_DROP_CHANCE_BY_ID; public static Map<Integer, Float> PREMIUM_RATE_DROP_CHANCE_BY_ID;
public static Map<Integer, Float> PREMIUM_RATE_DROP_AMOUNT_BY_ID; public static Map<Integer, Float> PREMIUM_RATE_DROP_AMOUNT_BY_ID;
public static boolean PC_CAFE_ENABLED;
public static boolean PC_CAFE_ONLY_PREMIUM;
public static int PC_CAFE_MAX_POINTS;
public static boolean PC_CAFE_ENABLE_DOUBLE_POINTS;
public static int PC_CAFE_DOUBLE_POINTS_CHANCE;
public static double PC_CAFE_POINT_RATE;
public static boolean PC_CAFE_RANDOM_POINT;
public static boolean PC_CAFE_REWARD_LOW_EXP_KILLS;
public static int PC_CAFE_LOW_EXP_KILLS_CHANCE;
public static boolean SELLBUFF_ENABLED; public static boolean SELLBUFF_ENABLED;
public static int SELLBUFF_MP_MULTIPLER; public static int SELLBUFF_MP_MULTIPLER;
public static int SELLBUFF_PAYMENT_ID; public static int SELLBUFF_PAYMENT_ID;
@ -2221,6 +2230,36 @@ public final class Config
} }
} }
PC_CAFE_ENABLED = CustomSettings.getBoolean("PcCafeEnabled", false);
PC_CAFE_ONLY_PREMIUM = CustomSettings.getBoolean("PcCafeOnlyPremium", false);
PC_CAFE_MAX_POINTS = CustomSettings.getInt("MaxPcCafePoints", 200000);
if (PC_CAFE_MAX_POINTS < 0)
{
PC_CAFE_MAX_POINTS = 0;
}
PC_CAFE_ENABLE_DOUBLE_POINTS = CustomSettings.getBoolean("DoublingAcquisitionPoints", false);
PC_CAFE_DOUBLE_POINTS_CHANCE = CustomSettings.getInt("DoublingAcquisitionPointsChance", 1);
if ((PC_CAFE_DOUBLE_POINTS_CHANCE < 0) || (PC_CAFE_DOUBLE_POINTS_CHANCE > 100))
{
PC_CAFE_DOUBLE_POINTS_CHANCE = 1;
}
PC_CAFE_POINT_RATE = CustomSettings.getDouble("AcquisitionPointsRate", 1.0);
PC_CAFE_RANDOM_POINT = CustomSettings.getBoolean("AcquisitionPointsRandom", false);
if (PC_CAFE_POINT_RATE < 0)
{
PC_CAFE_POINT_RATE = 1;
}
PC_CAFE_REWARD_LOW_EXP_KILLS = CustomSettings.getBoolean("RewardLowExpKills", true);
PC_CAFE_LOW_EXP_KILLS_CHANCE = CustomSettings.getInt("RewardLowExpKillsChance", 50);
if (PC_CAFE_LOW_EXP_KILLS_CHANCE < 0)
{
PC_CAFE_LOW_EXP_KILLS_CHANCE = 0;
}
if (PC_CAFE_LOW_EXP_KILLS_CHANCE > 100)
{
PC_CAFE_LOW_EXP_KILLS_CHANCE = 100;
}
SELLBUFF_ENABLED = CustomSettings.getBoolean("SellBuffEnable", false); SELLBUFF_ENABLED = CustomSettings.getBoolean("SellBuffEnable", false);
SELLBUFF_MP_MULTIPLER = CustomSettings.getInt("MpCostMultipler", 1); SELLBUFF_MP_MULTIPLER = CustomSettings.getInt("MpCostMultipler", 1);
SELLBUFF_PAYMENT_ID = CustomSettings.getInt("PaymentID", 57); SELLBUFF_PAYMENT_ID = CustomSettings.getInt("PaymentID", 57);

View File

@ -128,6 +128,7 @@ import com.l2jmobius.gameserver.instancemanager.MailManager;
import com.l2jmobius.gameserver.instancemanager.MapRegionManager; import com.l2jmobius.gameserver.instancemanager.MapRegionManager;
import com.l2jmobius.gameserver.instancemanager.MatchingRoomManager; import com.l2jmobius.gameserver.instancemanager.MatchingRoomManager;
import com.l2jmobius.gameserver.instancemanager.MentorManager; import com.l2jmobius.gameserver.instancemanager.MentorManager;
import com.l2jmobius.gameserver.instancemanager.PcCafePointsManager;
import com.l2jmobius.gameserver.instancemanager.PetitionManager; import com.l2jmobius.gameserver.instancemanager.PetitionManager;
import com.l2jmobius.gameserver.instancemanager.PremiumManager; import com.l2jmobius.gameserver.instancemanager.PremiumManager;
import com.l2jmobius.gameserver.instancemanager.PunishmentManager; import com.l2jmobius.gameserver.instancemanager.PunishmentManager;
@ -238,6 +239,7 @@ public class GameServer
FishingData.getInstance(); FishingData.getInstance();
HennaData.getInstance(); HennaData.getInstance();
PrimeShopData.getInstance(); PrimeShopData.getInstance();
PcCafePointsManager.getInstance();
AppearanceItemData.getInstance(); AppearanceItemData.getInstance();
AlchemyData.getInstance(); AlchemyData.getInstance();
CommissionManager.getInstance(); CommissionManager.getInstance();

View File

@ -40,6 +40,7 @@ import com.l2jmobius.gameserver.model.multisell.Ingredient;
import com.l2jmobius.gameserver.model.multisell.ListContainer; import com.l2jmobius.gameserver.model.multisell.ListContainer;
import com.l2jmobius.gameserver.model.multisell.PreparedListContainer; import com.l2jmobius.gameserver.model.multisell.PreparedListContainer;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.ExPCCafePointInfo;
import com.l2jmobius.gameserver.network.serverpackets.MultiSellList; import com.l2jmobius.gameserver.network.serverpackets.MultiSellList;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo; import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
@ -53,7 +54,7 @@ public final class MultisellData implements IGameXmlReader
public static final int PAGE_SIZE = 40; public static final int PAGE_SIZE = 40;
// Special IDs. // Special IDs.
public static final int PC_BANG_POINTS = -100; public static final int PC_CAFE_POINTS = -100;
public static final int CLAN_REPUTATION = -200; public static final int CLAN_REPUTATION = -200;
public static final int FAME = -300; public static final int FAME = -300;
public static final int FIELD_CYCLE_POINTS = -400; public static final int FIELD_CYCLE_POINTS = -400;
@ -282,6 +283,15 @@ public final class MultisellData implements IGameXmlReader
{ {
switch (id) switch (id)
{ {
case PC_CAFE_POINTS:
{
if (player.getPcCafePoints() >= amount)
{
return true;
}
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_ARE_SHORT_OF_PC_POINTS));
break;
}
case CLAN_REPUTATION: case CLAN_REPUTATION:
{ {
if (player.getClan() == null) if (player.getClan() == null)
@ -289,12 +299,12 @@ public final class MultisellData implements IGameXmlReader
player.sendPacket(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER_AND_CANNOT_PERFORM_THIS_ACTION); player.sendPacket(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER_AND_CANNOT_PERFORM_THIS_ACTION);
return false; return false;
} }
else if (!player.isClanLeader()) if (!player.isClanLeader())
{ {
player.sendPacket(SystemMessageId.ONLY_THE_CLAN_LEADER_IS_ENABLED); player.sendPacket(SystemMessageId.ONLY_THE_CLAN_LEADER_IS_ENABLED);
return false; return false;
} }
else if (player.getClan().getReputationScore() < amount) if (player.getClan().getReputationScore() < amount)
{ {
player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW); player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW);
return false; return false;
@ -327,6 +337,16 @@ public final class MultisellData implements IGameXmlReader
{ {
switch (id) switch (id)
{ {
case PC_CAFE_POINTS:
{
final int cost = player.getPcCafePoints() - (int) amount;
player.setPcCafePoints(cost);
final SystemMessage smsgpc = SystemMessage.getSystemMessage(SystemMessageId.YOU_ARE_USING_S1_POINT);
smsgpc.addLong((int) amount);
player.sendPacket(smsgpc);
player.sendPacket(new ExPCCafePointInfo(player.getPcCafePoints(), (int) amount, 1));
return true;
}
case CLAN_REPUTATION: case CLAN_REPUTATION:
{ {
player.getClan().takeReputationScore((int) amount, true); player.getClan().takeReputationScore((int) amount, true);
@ -410,7 +430,7 @@ public final class MultisellData implements IGameXmlReader
{ {
switch (ing.getItemId()) switch (ing.getItemId())
{ {
case PC_BANG_POINTS: case PC_CAFE_POINTS:
case CLAN_REPUTATION: case CLAN_REPUTATION:
case FAME: case FAME:
case RAIDBOSS_POINTS: case RAIDBOSS_POINTS:

View File

@ -0,0 +1,99 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.l2jmobius.gameserver.instancemanager;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.ExPCCafePointInfo;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
public final class PcCafePointsManager
{
public void givePcCafePoint(L2PcInstance player, long exp)
{
if (!Config.PC_CAFE_ENABLED || player.isInsideZone(ZoneId.PEACE) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE) || (player.isOnlineInt() == 0) || player.isJailed())
{
return;
}
// PC-points only premium accounts
if (Config.PC_CAFE_ONLY_PREMIUM && !player.hasPremiumStatus())
{
return;
}
if (player.getPcCafePoints() >= Config.PC_CAFE_MAX_POINTS)
{
final SystemMessage message = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_THE_MAXIMUM_NUMBER_OF_PC_POINTS);
player.sendPacket(message);
return;
}
int points = (int) (exp * 0.0001 * Config.PC_CAFE_POINT_RATE);
if (Config.PC_CAFE_RANDOM_POINT)
{
points = Rnd.get(points / 2, points);
}
if ((points == 0) && (exp > 0) && Config.PC_CAFE_REWARD_LOW_EXP_KILLS && (Rnd.get(100) < Config.PC_CAFE_LOW_EXP_KILLS_CHANCE))
{
points = 1; // minimum points
}
if (points <= 0)
{
return;
}
SystemMessage message = null;
if (Config.PC_CAFE_ENABLE_DOUBLE_POINTS && (Rnd.get(100) < Config.PC_CAFE_DOUBLE_POINTS_CHANCE))
{
points *= 2;
message = SystemMessage.getSystemMessage(SystemMessageId.DOUBLE_POINTS_YOU_EARNED_S1_PC_POINT_S);
}
else
{
message = SystemMessage.getSystemMessage(SystemMessageId.YOU_EARNED_S1_PC_POINT_S);
}
if ((player.getPcCafePoints() + points) > Config.PC_CAFE_MAX_POINTS)
{
points = Config.PC_CAFE_MAX_POINTS - player.getPcCafePoints();
}
message.addLong(points);
player.sendPacket(message);
player.setPcCafePoints(player.getPcCafePoints() + points);
player.sendPacket(new ExPCCafePointInfo(player.getPcCafePoints(), points, 1));
}
/**
* Gets the single instance of {@code PcCafePointsManager}.
* @return single instance of {@code PcCafePointsManager}
*/
public static PcCafePointsManager getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder
{
protected static final PcCafePointsManager _instance = new PcCafePointsManager();
}
}

View File

@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.datatables.ItemTable; import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.enums.PartyDistributionType; import com.l2jmobius.gameserver.enums.PartyDistributionType;
import com.l2jmobius.gameserver.instancemanager.DuelManager; import com.l2jmobius.gameserver.instancemanager.DuelManager;
import com.l2jmobius.gameserver.instancemanager.PcCafePointsManager;
import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Summon; import com.l2jmobius.gameserver.model.actor.L2Summon;
@ -881,6 +882,7 @@ public class L2Party extends AbstractPlayerGroup
clan.addHuntingPoints(member, target, finalExp); clan.addHuntingPoints(member, target, finalExp);
} }
member.updateVitalityPoints(target.getVitalityPoints(member.getLevel(), addexp, target.isRaid()), true, false); member.updateVitalityPoints(target.getVitalityPoints(member.getLevel(), addexp, target.isRaid()), true, false);
PcCafePointsManager.getInstance().givePcCafePoint(member, addexp);
} }
} }
else else

View File

@ -48,6 +48,7 @@ import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.InstanceType; import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.enums.Team; import com.l2jmobius.gameserver.enums.Team;
import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager; import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import com.l2jmobius.gameserver.instancemanager.PcCafePointsManager;
import com.l2jmobius.gameserver.instancemanager.WalkingManager; import com.l2jmobius.gameserver.instancemanager.WalkingManager;
import com.l2jmobius.gameserver.model.AggroInfo; import com.l2jmobius.gameserver.model.AggroInfo;
import com.l2jmobius.gameserver.model.DamageDoneInfo; import com.l2jmobius.gameserver.model.DamageDoneInfo;
@ -508,8 +509,8 @@ public class L2Attackable extends L2Npc
} }
clan.addHuntingPoints(attacker, this, finalExp); clan.addHuntingPoints(attacker, this, finalExp);
} }
attacker.updateVitalityPoints(getVitalityPoints(attacker.getLevel(), addexp, isRaid()), true, false); attacker.updateVitalityPoints(getVitalityPoints(attacker.getLevel(), addexp, isRaid()), true, false);
PcCafePointsManager.getInstance().givePcCafePoint(attacker, addexp);
} }
} }
} }

View File

@ -364,7 +364,7 @@ public final class L2PcInstance extends L2Playable
// Character Character SQL String Definitions: // 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,reputation,fame,raidbossPoints,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,online,clan_privs,wantspeace,base_class,nobless,power_grade,vitality_points,createDate) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; 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,reputation,fame,raidbossPoints,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,online,clan_privs,wantspeace,base_class,nobless,power_grade,vitality_points,createDate) 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=?,reputation=?,fame=?,raidbossPoints=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,online=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,bookmarkslot=?,vitality_points=?,language=?,faction=? WHERE charId=?"; 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=?,reputation=?,fame=?,raidbossPoints=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,online=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,bookmarkslot=?,vitality_points=?,language=?,faction=?,pccafe_points=? WHERE charId=?";
private static final String UPDATE_CHARACTER_ACCESS = "UPDATE characters SET accesslevel = ? WHERE charId = ?"; private static final String UPDATE_CHARACTER_ACCESS = "UPDATE characters SET accesslevel = ? WHERE charId = ?";
private static final String RESTORE_CHARACTER = "SELECT * FROM characters WHERE charId=?"; private static final String RESTORE_CHARACTER = "SELECT * FROM characters WHERE charId=?";
@ -405,6 +405,8 @@ public final class L2PcInstance extends L2Playable
public static final int REQUEST_TIMEOUT = 15; public static final int REQUEST_TIMEOUT = 15;
private int _pcCafePoints = 0;
private L2GameClient _client; private L2GameClient _client;
private final String _accountName; private final String _accountName;
@ -6555,6 +6557,8 @@ public final class L2PcInstance extends L2Playable
player.setClanCreateExpiryTime(0); player.setClanCreateExpiryTime(0);
} }
player.setPcCafePoints(rset.getInt("pccafe_points"));
final int clanId = rset.getInt("clanid"); final int clanId = rset.getInt("clanid");
player.setPowerGrade(rset.getInt("power_grade")); player.setPowerGrade(rset.getInt("power_grade"));
player.getStat().setVitalityPoints(rset.getInt("vitality_points")); player.getStat().setVitalityPoints(rset.getInt("vitality_points"));
@ -7139,8 +7143,8 @@ public final class L2PcInstance extends L2Playable
factionId = 2; factionId = 2;
} }
statement.setInt(47, factionId); statement.setInt(47, factionId);
statement.setInt(48, getPcCafePoints());
statement.setInt(48, getObjectId()); statement.setInt(49, getObjectId());
statement.execute(); statement.execute();
} }
@ -12537,6 +12541,16 @@ public final class L2PcInstance extends L2Playable
_offlineShopStart = time; _offlineShopStart = time;
} }
public int getPcCafePoints()
{
return _pcCafePoints;
}
public void setPcCafePoints(int count)
{
_pcCafePoints = count < 200000 ? count : 200000;
}
/** /**
* Check all player skills for skill level. If player level is lower than skill learn level - 9, skill level is decreased to next possible level. * Check all player skills for skill level. If player level is lower than skill learn level - 9, skill level is decreased to next possible level.
*/ */
@ -13868,4 +13882,5 @@ public final class L2PcInstance extends L2Playable
addStatusUpdateValue(StatusUpdateType.MAX_CP); addStatusUpdateValue(StatusUpdateType.MAX_CP);
addStatusUpdateValue(StatusUpdateType.CUR_CP); addStatusUpdateValue(StatusUpdateType.CUR_CP);
} }
} }

View File

@ -300,7 +300,7 @@ public final class L2TeleporterInstance extends L2Npc
} }
switch (itemId) switch (itemId)
{ {
case MultisellData.PC_BANG_POINTS: case MultisellData.PC_CAFE_POINTS:
{ {
return "Player Commendation Points"; return "Player Commendation Points";
} }

View File

@ -46,6 +46,7 @@ import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.instancemanager.CastleManager; import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.FortManager; import com.l2jmobius.gameserver.instancemanager.FortManager;
import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.PcCafePointsManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager; import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Spawn; import com.l2jmobius.gameserver.model.L2Spawn;
@ -2801,6 +2802,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
public static void addExpAndSp(L2PcInstance player, long exp, int sp) public static void addExpAndSp(L2PcInstance player, long exp, int sp)
{ {
player.addExpAndSp((long) player.getStat().getValue(Stats.EXPSP_RATE, (exp * Config.RATE_QUEST_REWARD_XP)), (int) player.getStat().getValue(Stats.EXPSP_RATE, (sp * Config.RATE_QUEST_REWARD_SP))); player.addExpAndSp((long) player.getStat().getValue(Stats.EXPSP_RATE, (exp * Config.RATE_QUEST_REWARD_XP)), (int) player.getStat().getValue(Stats.EXPSP_RATE, (sp * Config.RATE_QUEST_REWARD_SP)));
PcCafePointsManager.getInstance().givePcCafePoint(player, (long) (exp * Config.RATE_QUEST_REWARD_XP));
} }
/** /**

View File

@ -70,6 +70,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ExConnectedTimeAndGettable
import com.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket; import com.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
import com.l2jmobius.gameserver.network.serverpackets.ExNoticePostArrived; import com.l2jmobius.gameserver.network.serverpackets.ExNoticePostArrived;
import com.l2jmobius.gameserver.network.serverpackets.ExNotifyPremiumItem; import com.l2jmobius.gameserver.network.serverpackets.ExNotifyPremiumItem;
import com.l2jmobius.gameserver.network.serverpackets.ExPCCafePointInfo;
import com.l2jmobius.gameserver.network.serverpackets.ExPledgeCount; import com.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
import com.l2jmobius.gameserver.network.serverpackets.ExPledgeWaitingListAlarm; import com.l2jmobius.gameserver.network.serverpackets.ExPledgeWaitingListAlarm;
import com.l2jmobius.gameserver.network.serverpackets.ExQuestItemList; import com.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
@ -423,6 +424,18 @@ public class EnterWorld implements IClientIncomingPacket
CursedWeaponsManager.getInstance().getCursedWeapon(activeChar.getCursedWeaponEquippedId()).cursedOnLogin(); CursedWeaponsManager.getInstance().getCursedWeapon(activeChar.getCursedWeaponEquippedId()).cursedOnLogin();
} }
if (Config.PC_CAFE_ENABLED)
{
if (activeChar.getPcCafePoints() > 0)
{
activeChar.sendPacket(new ExPCCafePointInfo(activeChar.getPcCafePoints(), 0, 1));
}
else
{
activeChar.sendPacket(new ExPCCafePointInfo());
}
}
activeChar.updateEffectIcons(); activeChar.updateEffectIcons();
// Expand Skill // Expand Skill

View File

@ -16,8 +16,11 @@
*/ */
package com.l2jmobius.gameserver.network.clientpackets; package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
import com.l2jmobius.commons.network.PacketReader; import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.client.L2GameClient; import com.l2jmobius.gameserver.network.client.L2GameClient;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
/** /**
* @author Mobius * @author Mobius
@ -33,12 +36,12 @@ public class ExPCCafeRequestOpenWindowWithoutNPC implements IClientIncomingPacke
@Override @Override
public void run(L2GameClient client) public void run(L2GameClient client)
{ {
// final L2PcInstance activeChar = client.getActiveChar(); final L2PcInstance activeChar = client.getActiveChar();
// if ((activeChar != null) && Config.PC_BANG_ENABLED) if ((activeChar != null) && Config.PC_CAFE_ENABLED)
// { {
// final NpcHtmlMessage html = new NpcHtmlMessage(); final NpcHtmlMessage html = new NpcHtmlMessage();
// html.setFile(activeChar.getHtmlPrefix(), "data/html/pccafe.htm"); html.setFile(activeChar.getHtmlPrefix(), "data/html/pccafe.htm");
// activeChar.sendPacket(html); activeChar.sendPacket(html);
// } }
} }
} }

View File

@ -22,6 +22,7 @@ import java.util.logging.Level;
import com.l2jmobius.Config; import com.l2jmobius.Config;
import com.l2jmobius.commons.network.PacketReader; import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.ai.CtrlIntention; import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.MultisellData;
import com.l2jmobius.gameserver.handler.BypassHandler; import com.l2jmobius.gameserver.handler.BypassHandler;
import com.l2jmobius.gameserver.handler.CommunityBoardHandler; import com.l2jmobius.gameserver.handler.CommunityBoardHandler;
import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.handler.IBypassHandler;
@ -59,7 +60,8 @@ public final class RequestBypassToServer implements IClientIncomingPacket
"_diary", "_diary",
"_olympiad?command", "_olympiad?command",
"menu_select", "menu_select",
"manor_menu_select" "manor_menu_select",
"pccafe"
}; };
// S // S
@ -252,6 +254,16 @@ public final class RequestBypassToServer implements IClientIncomingPacket
EventDispatcher.getInstance().notifyEventAsync(new OnNpcManorBypass(activeChar, lastNpc, ask, state, time), lastNpc); EventDispatcher.getInstance().notifyEventAsync(new OnNpcManorBypass(activeChar, lastNpc, ask, state, time), lastNpc);
} }
} }
else if (_command.startsWith("pccafe"))
{
final L2PcInstance player = client.getActiveChar();
if ((player == null) || !Config.PC_CAFE_ENABLED)
{
return;
}
final int multisellId = Integer.parseInt(_command.substring(10).trim());
MultisellData.getInstance().separateAndSend(multisellId, activeChar, null, false);
}
else else
{ {
final IBypassHandler handler = BypassHandler.getInstance().getHandler(_command); final IBypassHandler handler = BypassHandler.getInstance().getHandler(_command);