03-09-2011, 09:47 PM
Во фрее стандартно введена кнопка на радаре для открытия/закрытия этого окна, вывод, фрея активно использует эту пое..нь
PcCafe
|
03-09-2011, 09:47 PM
Во фрее стандартно введена кнопка на радаре для открытия/закрытия этого окна, вывод, фрея активно использует эту пое..нь
03-09-2011, 10:14 PM
Что-то я порылся по интерлюдам и нашел только то, что уже знал... выдача поинтов за exp..... укажите кто-то точно команду у которой это сделано.... или скиньте файл ******.java с этим добром
03-10-2011, 05:28 AM
KilRoy Написал:Во фрее стандартно введена кнопка на радаре для открытия/закрытия этого окна, вывод, фрея активно использует эту пое..ньвобще-то опционально выведена - по дефолту на этом месте в интерфейсе висит кнопка вкл/выкл окно Благословления Невита. L2Open GF
/*
* 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.l2open.gameserver.instancemanager; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.util.Properties; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import javolution.text.TypeFormat; import com.l2open.Config; import com.l2open.gameserver.model.actor.L2Character; import com.l2open.gameserver.model.actor.instance.L2PcInstance; import com.l2open.gameserver.network.SystemMessageId; import com.l2open.gameserver.network.serverpackets.ExPCCafePointInfo; import com.l2open.gameserver.network.serverpackets.SystemMessage; import com.l2open.util.Rnd; public class PcCafePointsManager { protected static Log _log = LogFactory.getLog(PcCafePointsManager.class); private static PcCafePointsManager _instance; public static boolean _enabled; static int _acquisitionPoints = 1; static int _doubleAcquisitionPointsChance = 1; static double _acquisitionPointsRate = 1.0; static boolean _acquisitionPointsRandom = false; static boolean _enableDoubleAcquisitionPoints = false; public static PcCafePointsManager getInstance() { if (_instance == null) _instance = new PcCafePointsManager(); return _instance; } public PcCafePointsManager() { loadConfig(); } public void givePcCafePoint(final L2PcInstance player, final long givedexp) { if (!_enabled) return; if (player.isInsideZone(L2Character.ZONE_PEACE) || player.isInsideZone(L2Character.ZONE_PVP) || player.isInsideZone(L2Character.ZONE_SIEGE) || player.isOnline() == 0 || player.isInJail()) return; int _points = (int) (givedexp * 0.0001 * _acquisitionPointsRate); if (_acquisitionPointsRandom) _points = Rnd.get(_points / 2, _points); if (_enableDoubleAcquisitionPoints && Rnd.get(100) < _doubleAcquisitionPointsChance) { _points *= 2; player.setPcBangPoints(player.getPcBangPoints() + _points); final SystemMessage sm = new SystemMessage(SystemMessageId.ACQUIRED_S1_PCPOINT_DOUBLE); sm.addNumber(_points); player.sendPacket(sm); player.sendPacket(new ExPCCafePointInfo(player.getPcBangPoints(), _points, true, true, 1)); } else { player.setPcBangPoints(player.getPcBangPoints() + _points); player.sendPacket(new ExPCCafePointInfo(player.getPcBangPoints(), _points, true, false, 1)); } } public boolean loadConfig() { try { final InputStream is = new FileInputStream(new File( Config.PCCAFE_CONFIGURATION_FILE)); final Properties pccaffeSettings = new Properties(); pccaffeSettings.load(is); is.close(); _enabled = TypeFormat.parseBoolean(pccaffeSettings.getProperty("Enabled", "false")); _acquisitionPointsRandom = TypeFormat.parseBoolean(pccaffeSettings.getProperty("AcquisitionPointsRandom", "false")); _enableDoubleAcquisitionPoints = TypeFormat.parseBoolean(pccaffeSettings.getProperty("DoublingAcquisitionPoints", "false")); _doubleAcquisitionPointsChance = Integer.decode(pccaffeSettings.getProperty("DoublingAcquisitionPointsChance", "1")); _acquisitionPointsRate = Double.parseDouble(pccaffeSettings.getProperty("AcquisitionPointsRate", "1.0")); return _enabled; } catch (final Exception e) { //_initialized = false; _log.error("Error while loading pc cafe data.", e); return false; } } } пакеты
/*
* 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.l2open.gameserver.network.serverpackets; /** * Format: ch ddcdc * * @author KenM */ public class ExPCCafePointInfo extends L2GameServerPacket { private static final String _S__FE_31_EXPCCAFEPOINTINFO = "[S] FE:32 ExPCCafePointInfo"; private final int _points; private final int _mAddPoint; private int _mPeriodType; private int _remainTime; private int _pointType = 0; public ExPCCafePointInfo() { _points = 0; _mAddPoint = 0; _remainTime = 0; _mPeriodType = 0; _pointType = 0; } public ExPCCafePointInfo(final int points, final int modify_points, final boolean mod, final boolean _double, final int hours_left) { _points = points; _mAddPoint = modify_points; _remainTime = hours_left; if (mod && _double) { _mPeriodType = 1; _pointType = 0; } else if (mod) { _mPeriodType = 1; _pointType = 1; } else { _mPeriodType = 2; _pointType = 2; } } public ExPCCafePointInfo(final int val1, final int val2, final int val3, final int val4, final int val5, final int val6) { _points = val1; _mAddPoint = val2; _mPeriodType = val3; _remainTime = val4; _remainTime = val5; _pointType = val6; } /** * @see net.sf.l2j.gameserver.BasePacket#getType() */ @Override public String getType() { return _S__FE_31_EXPCCAFEPOINTINFO; } @Override protected void writeImpl() { writeC(0xFE); writeH(0x32); writeD(_points); // num points writeD(_mAddPoint); // points inc display writeC(_mPeriodType); // period(0=don't show window,1=acquisition,2=use points) writeD(_remainTime); // period hours left writeC(_pointType); // points inc display color(0=yellow,1=cyan-blue,2=red,all other black) } }
03-10-2011, 02:41 PM
weTr1k Написал: Правильно, это стандарт, который выдает очки при убийстве мобов, причем странно то, что по 3-6к... рейты на серве 555... не пойму принципа.... Нашел вроде бы как в л2бейс интерлюда фишку за онлайн, но никак немогу ее под себя подогнать... Может кто-нибу помочь внедрить? если нужно могу немного заплатить |
« Предыдущая | Следующая »
|