Ir para conteúdo
  • Cadastre-se
  • 0

VIP Item


LnD Rick

Pergunta

Bom, eu gostaria muito de adicionar um item que quando click 2 vezes o char vira VIP no meu servidor que estou compilando, eu uso L2jFrozen e achei esse aqui http://www.l2jbrasil.com/index.php?/topic/54971-aio-e-vip-itens/ mas nao consigo altera-lo para o frozen, sera que alguem tem ele feito ou poderia fazer para mim??

 

Agradeço desde jah, vlws

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts recomendados

  • 0

 

### Eclipse Workspace Patch 1.0

#P L2jFrozen_GameServer_Beta
Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/VipItem.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/VipItem.java (revision 0)
+++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/VipItem.java (revision 0)
@@ -0,0 +1,66 @@
+/*
+ * 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.itemhandlers;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.handler.IItemHandler;
+import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * @author Paulinho Souza
+ * @author KhayrusS
+ **/
+
+public class VipItem implements IItemHandler
+{
+ private static final int ITEM_IDS[] = { Config.VIP_ITEM };
+
+ @Override
+ public synchronized void useItem(L2PlayableInstance playable,
+ L2ItemInstance item) {
+ if(!(playable instanceof L2PcInstance))
+ return;
+
+ L2PcInstance player = (L2PcInstance)playable;
+
+ if (player.isInOlympiadMode())
+ player.sendMessage("Voce nao pode usar este item em olympiadas.");
+
+ else if (player.isVip()) {
+ player.sendMessage("Voce ainda esta no periodo de VIP, espere ele terminar para poder usar denovo.");
+ return;
+ }
+
+ else
+ {
+ if(playable.destroyItem("Consume", item.getObjectId(), 1, null,
+ false)) {
+ player.setVip(true);
+ player.setEndTime("vip", Config.VIP_DIAS);
+ player.sendMessage("Voce se tornou um Vip, voce tera, privilegios de acessar Npcs Vips, Seu Vip Durarar " + Config.VIP_DIAS + " Dias");
+
+ player.broadcastUserInfo();
+ }
+ }
+ }
+
+ @Override
+ public int[] getItemIds()
+ {
+ return ITEM_IDS;
+ }
+}
Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/AioItem.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/AioItem.java (revision 0)
+++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/AioItem.java (revision 0)
@@ -0,0 +1,73 @@
+/*
+ * 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.itemhandlers;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.handler.IItemHandler;
+import com.l2jfrozen.gameserver.model.L2Character;
+import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * @author Paulinho Souza
+ * @author KhayrusS
+ **/
+public class AioItem implements IItemHandler
+{
+ private static final int ITEM_IDS[] = { Config.AIO_ITEM };
+ @Override
+ public synchronized void useItem(L2PlayableInstance playable,
+ L2ItemInstance item) {
+ if(!(playable instanceof L2PcInstance))
+ return;
+
+ L2PcInstance player = (L2PcInstance)playable;
+ if (!player.isInsideZone(L2Character.ZONE_PEACE)){
+ player.sendMessage("Voce so pode usar este item em zona de paz.");
+ return;
+ }
+
+ else if (player.isInOlympiadMode()) {
+ player.sendMessage("Voce nao pode usar este item em olympiadas.");
+ return;
+ }
+
+ else if (player.isAio()) {
+ player.sendMessage("Voce ainda esta no periodo de AIO, espere ele terminar para poder usar denovo.");
+ return;
+ }
+
+ else {
+ if(player.destroyItem("Consume", item.getObjectId(), 1, null,
+ false)) {
+ player.setAio(true);
+ int daysleft = player.getAioEndTime() <= 0 ? 0 :(int)
+ ((player.getAioEndTime()-System.currentTimeMillis())/86400000);
+ player.setEndTime("aio", daysleft + Config.AIO_DIAS);
+ player.getStat().addExp(player.getStat().getExpForLevel(81));
+ player.rewardAioSkills();
+ player.sendSkillList();
+ player.sendMessage("Voce se tornou um Aiox voce tera todas as skills de um buffer, Seu Aio tera a duracao de " + Config.AIO_DIAS + " Dias");
+ player.broadcastUserInfo();
+ }
+ }
+ }
+
+ @Override
+ public int[] getItemIds() {
+ return ITEM_IDS;
+ }
+}
Index: head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java (revision 948)
+++ head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java (working copy)
@@ -65,6 +65,8 @@
import com.l2jfrozen.gameserver.handler.itemhandlers.SpecialXMas;
import com.l2jfrozen.gameserver.handler.itemhandlers.SpiritShot;
import com.l2jfrozen.gameserver.handler.itemhandlers.SummonItems;
+import com.l2jfrozen.gameserver.handler.itemhandlers.AioItem;
+import com.l2jfrozen.gameserver.handler.itemhandlers.VipItem;
/**
* This class manages handlers of items
@@ -151,6 +153,8 @@
registerItemHandler(new MOSKey());
registerItemHandler(new BreakingArrow());
registerItemHandler(new ChristmasTree());
+ registerItemHandler(new AioItem());
+ registerItemHandler(new VipItem());
registerItemHandler(new Crystals());
_log.config("ItemHandler: Loaded " + _datatable.size() + " handlers.");
}
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java (revision 948)
+++ head-src/com/l2jfrozen/Config.java (working copy)
@@ -616,6 +616,11 @@
public static int FS_PARTY_MEMBER_COUNT;
public static boolean ALLOW_QUAKE_SYSTEM;
public static boolean ENABLE_ANTI_PVP_FARM_MSG;
+ public static int AIO_ITEM;
+ public static int AIO_DIAS;
+ public static int VIP_ITEM;
+ public static int VIP_DIAS;
+
//============================================================
@@ -668,6 +673,10 @@
AIO_TCOLOR = Integer.decode("0x" + otherSettings.getProperty("AioTitleColor", "88AA88"));
ALLOW_AIO_USE_GK = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseGk", "False"));
ALLOW_AIO_USE_CM = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseClassMaster", "False"));
+ VIP_ITEM = Integer.parseInt(otherSettings.getProperty("VipItem", "4356"));
+ VIP_DIAS = Integer.parseInt(otherSettings.getProperty("VipDias", "30"));
+ AIO_ITEM = Integer.parseInt(otherSettings.getProperty("AioItem", "4356"));
+ AIO_DIAS = Integer.parseInt(otherSettings.getProperty("AioDias", "30"));
ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(otherSettings.getProperty("AnnounceCastleLords", "False"));
if(ENABLE_AIO_SYSTEM) //create map if system is enabled
{
Index: config/head/other.properties
===================================================================
--- config/head/other.properties (revision 948)
+++ config/head/other.properties (working copy)
@@ -225,5 +225,17 @@
# Aio Buffers can speak to Class Master?
AllowAioUseClassMaster = false
+# ID of the item that you put the player angry turn AIO!
+AioItem = 4357
+
+# Number of days that the player ficarar AIO!
+AioDias = 30
+
+# ID of the item that you put anger to become VIP player!
+VipItem = 4356
+
+# Number of days that the player ficarar VIP!
+VipDias = 30
+
# Announce castle lords on enter game. default = false
AnnounceCastleLords = False
\ No newline at end of file

Creditos: Zeus

No meu funcionou perfeitamente!

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.