Ir para conteúdo
  • Cadastre-se
  • 0

Mod tempo_online trocar_tempo


gleyce123

Pergunta

Alguem saberia por

 

quantidade de item nesse mod ?

 

 

 

Index: Config.java
===================================================================
--- Config.java (revisão 1118)
+++ Config.java (cópia de trabalho)
@@ -2169,6 +2201,10 @@
public static String PM_TEXT1;
public static String PM_TEXT2;
public static boolean NEW_PLAYER_EFFECT;
+ public static boolean CUSTON_ONLINETIME;
+ public static int ID_REWARD;
+ public static int MIN_PVP;
+

// ============================================================
public static void loadFrozenConfig()
@@ -2181,7 +2217,10 @@
final InputStream is = new FileInputStream(new File(Frozen));
frozenSettings.load(is);
is.close();
-
+
+ CUSTON_ONLINETIME = Boolean.parseBoolean(frozenSettings.getProperty("OnlineReward", "true"));
+ ID_REWARD = Integer.parseInt(frozenSettings.getProperty("IdReward", "57"));
+ MIN_PVP = Integer.parseInt(frozenSettings.getProperty("MinPvp", "200"));
GM_TRADE_RESTRICTED_ITEMS = Boolean.parseBoolean(frozenSettings.getProperty("GMTradeRestrictedItems", "False"));
GM_RESTART_FIGHTING = Boolean.parseBoolean(frozenSettings.getProperty("GMRestartFighting", "False"));
PM_MESSAGE_ON_START = Boolean.parseBoolean(frozenSettings.getProperty("PMWelcomeShow", "False"));
Index: gameserver/handler/VoicedCommandHandler.java
===================================================================
--- gameserver/handler/VoicedCommandHandler.java (revisão 1118)
+++ gameserver/handler/VoicedCommandHandler.java (cópia de trabalho)
@@ -36,11 +34,14 @@
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.OfflineShop;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Online;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.StatsCmd;
+import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.TimeCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.TvTCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.VersionCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Voting;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Wedding;
@@ -68,6 +69,7 @@
_datatable = new FastMap<>();

registerVoicedCommandHandler
(new Voting());
+ registerVoicedCommandHandler(new TimeCmd());

if (Config.BANKING_SYSTEM_ENABLED)
{
Index: gameserver/handler/voicedcommandhandlers/TimeCmd.java
===================================================================
--- gameserver/handler/voicedcommandhandlers/TimeCmd.java (revisão 0)
+++ gameserver/handler/voicedcommandhandlers/TimeCmd.java (cópia de trabalho)
@@ -0,0 +1,92 @@
+/*
+ * 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 <

O conteúdo está oculto, favor efetuar login ou se cadastrar!

+ */
+package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
+
+import java.math.BigDecimal;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate;
+
+/**
+ * @author Admin
+ */

+public class TimeCmd implements IVoicedCommandHandler
+{
+ private static String[] VOICED_COMMANDS =
+ {
+ "trocar_tempo",
+ "tempo_online"
+ };
+
+ @Override
+ public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+ {
+ int _calcule = (int) arredondaValor(1, activeChar.getOnlineTime() / 3600);
+
+ if (command.startsWith("trocar_tempo"))
+ {
+ if ((_calcule >= 1) && (activeChar.getPvpKills() >= Config.MIN_PVP))
+ {
+ InventoryUpdate iu = new InventoryUpdate();
+ activeChar.addItem("Squash Coins", Config.ID_REWARD, _calcule, activeChar, true);
+ activeChar.sendPacket(iu);
+ activeChar.setOnlineTime(0);
+ }
+ else
+ {
+ if (activeChar.getPvpKills() < Config.MIN_PVP)
+ {
+ activeChar.sendMessage("Sao necessarios " + Config.MIN_PVP + " pvp's para proceder a troca.Voce tem apenas" + activeChar.getPvpKills() + " PVP'S");
+ }
+ if (_calcule < 1)
+ {
+ activeChar.sendMessage("Voce nao tem 1 hora online atualmente.");
+ }
+ }
+ }
+ else if (command.startsWith("tempo_online"))
+ {
+ if (_calcule >= 1)
+ {
+ activeChar.sendMessage("Voce tem atualmente " + _calcule + " horas online.");
+ }
+ else if (_calcule < 1)
+ {
+ activeChar.sendMessage("Voce tem atualmente " + activeChar.getOnlineTime() / 60 + " minutos online.");
+
+ }
+ }
+ return false;
+ }
+
+ public static double arredondaValor(int casasDecimais, double valor)
+ {
+ BigDecimal decimal = new BigDecimal(valor);
+ return decimal.setScale(casasDecimais, 3).doubleValue();
+ }
+
+ public boolean useVoicedCommand(String command, String all, L2PcInstance activeChar, String text)
+ {
+ return false;
+ }
+
+ @Override
+ public String[] getVoicedCommandList()
+ {
+ return VOICED_COMMANDS;
+ }
+}
\ No newline at end of file

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts recomendados

  • 0

 

procure essa linha:

activeChar.addItem("Squash Coins", Config.ID_REWARD, _calcule, activeChar, true);

Substitua por essa:

activeChar.addItem("Squash Coins", Config.ID_REWARD, Config.ID_REWARD_COUNT, _calcule, activeChar, true);

adicione isso em config.java:

public static int ID_REWARD_COUNT;

depois isso tambem:

ID_REWARD_COUNT = Integer.parseInt(frozenSettings.getProperty("IdRewardCount", "1"));

 

me diga se deu certo..

Editado por Onã

Lineage 2 Lords

Link para o comentário
Compartilhar em outros sites


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.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  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.

Processando...



×
×
  • Criar Novo...

Important Information

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.