Ir para conteúdo
  • Cadastre-se
  • 0

Mod Dual Aiox, Npc aiox Sell Script


olhaelaa

Pergunta

Gente eu peguei no fórum um scripter que você adiciona no java e quando se usa o comando: //setaio nick dias, a dual vai junto, até ai tudo certo. Mas a dual não desaparece junto com com os buffs no mesmo tempo e quero adicionar ao npc de venda de aio, tem algo de errado no script? E aquele número 1 la embaixo em _player.getWarehouse().destroyItemByItemId("", Config.AIO_DUAL_ID, 1, _player, null); , ele tem que trocar pelo id da dual? E os 9999 eu estou colocando o id que quero para minha dual, podem me apontar o erro da dual não sumir também, junto com os buff's? Esta faltando algo?Preciso configurar algo no npc?E o erro da dual não sumir o que é?

 

Mod dual Aiox:

Arquivo : COM.L2JFROZEN.CONFIG.JAVA

 

pesquise por :

 

ANNOUNCE_CASTLE_LORDS;

 

adicione isso:

 

public static boolean ENABLE_AIO_DUAL;

public static int AIO_DUAL_ID;

 

Pesquise por :

ANNOUNCE_CASTLE_LORDS = Boolean

 

Adicione isso:

 

ENABLE_AIO_DUAL = Boolean.parseBoolean(otherSettings.getProperty("AllowAIODual", "True"));

AIO_DUAL_ID = Integer.parseInt(otherSettings.getProperty("DualAio", "9999"));

 

ARQUIVO : COM.L2JFROZEN.GAMESERVER.HANDLER.ADMINCOMMANDHANDLERS.ADMINAIO

 

pesquise por :

 

 

_player.getStat().addExp(_player.getStat().getExpForLevel(81));

 

Adicione isso abaixo :

 

if(Config.ENABLE_AIO_DUAL && _player.isAio())

_player.getInventory().addItem("", Config.AIO_DUAL_ID, 1, _player, null);

 

Pesquise por :

 

_player.sendMessage("Now You are not an Aio..")

Adicione abaixo :

 

 

if(Config.ENABLE_AIO_DUAL && _player.isAio() == false)

_player.getInventory().destroyItemByItemId("", Config.AIO_DUAL_ID, 1, _player, null);

_player.getWarehouse().destroyItemByItemId("", Config.AIO_DUAL_ID, 1, _player, null);

 

ARQUIVO : CONFIG/HEAD/OTHER.PROPERTIES

 

# ID Dual Aio

AllowAIODual = True

DualAio = 9999

 

 

Npc Seller Aiox:

Index: config/head/other.properties

===================================================================

--- config/head/other.properties (revision 0)

+++ config/head/other.properties (revision 0)

@@ -225,5 +225,8 @@

# Aio Buffers can speak to Class Master?

AllowAioUseClassMaster = false

 

+AioItemId = 3470

+AioItemCount = 30

+

# Announce castle lords on enter game. default = false

AnnounceCastleLords = False

\ No newline at end of file

Index: head-src/com/l2jfrozen/Config.java

===================================================================

--- head-src/com/l2jfrozen/Config.java (revision 0)

+++ head-src/com/l2jfrozen/Config.java (revision 0)

@@ -560,6 +775,8 @@

public static int AIO_TCOLOR;

public static boolean ALLOW_AIO_USE_GK;

public static boolean ALLOW_AIO_USE_CM;

+ public static int AIO_ITEM_ID;

+ public static int AIO_ITEM_CNT;

public static boolean ANNOUNCE_CASTLE_LORDS;

 

/** Configuration to allow custom items to be given on character creation */

@@ -656,6 +873,8 @@

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"));

+ AIO_ITEM_ID = Integer.parseInt(otherSettings.getProperty("AioItemId", "3470"));

+ AIO_ITEM_CNT = Integer.parseInt(otherSettings.getProperty("AioItemCount", "50"));

ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(otherSettings.getProperty("AnnounceCastleLords", "False"));

if(ENABLE_AIO_SYSTEM) //create map if system is enabled

{

Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2AioSellerInstance.java

===================================================================

--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2AioSellerInstance.java (revision 0)

+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2AioSellerInstance.java (revision 0)

@@ -0,0 +1,270 @@

+/* 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 2, 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, write to the Free Software

+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA

+ * 02111-1307, USA.

+ *

+ *

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

+ */

+package com.l2jfrozen.gameserver.model.actor.instance;

+

+import java.sql.Connection;

+import java.sql.PreparedStatement;

+import java.util.logging.Level;

+

+import javolution.text.TextBuilder;

+

+import com.l2jfrozen.Config;

+import com.l2jfrozen.gameserver.ai.CtrlIntention;

+import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;

+import com.l2jfrozen.gameserver.network.serverpackets.EtcStatusUpdate;

+import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected;

+import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;

+import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation;

+import com.l2jfrozen.gameserver.templates.L2NpcTemplate;

+import com.l2jfrozen.util.CloseUtil;

+import com.l2jfrozen.util.database.L2DatabaseFactory;

+/**

+ * @author Leandro Cândido

+ *

+ */

+

+public class L2AioSellerInstance extends L2FolkInstance

+{

+ public L2AioSellerInstance(int objectId, L2NpcTemplate template)

+ {

+ super(objectId, template);

+ }

+

+ public void onAction(L2PcInstance player)

+ {

+ if (!canTarget(player))

+ return;

+

+ player.setLastFolkNPC(this);

+

+ // Check if the L2PcInstance already target the L2NpcInstance

+ if (this != player.getTarget())

+ {

+ // Set the target of the L2PcInstance player

+ player.setTarget(this);

+

+ // Send a Server->Client packet MyTargetSelected to the L2PcInstance player

+ MyTargetSelected my = new MyTargetSelected(getObjectId(), 0);

+ player.sendPacket(my);

+ my = null;

+

+ // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client

+ player.sendPacket(new ValidateLocation(this));

+ }

+ else

+ {

+ // Calculate the distance between the L2PcInstance and the L2NpcInstance

+ if (!canInteract(player))

+ {

+ // Notify the L2PcInstance AI with AI_INTENTION_INTERACT

+ player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);

+ }

+ else

+ {

+ showHtmlWindow(player);

+ }

+ }

+ // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet

+ player.sendPacket(ActionFailed.STATIC_PACKET);

+ }

+

+ public void onBypassFeedback(L2PcInstance player, String command)

+ {

+ int itemId = Config.AIO_ITEM_ID;

+ int itemCount = Config.AIO_ITEM_CNT;

+

+ L2ItemInstance itemInstance = player.getInventory().getItemByItemId(itemId);

+

+ if (command.startsWith("add_aio_1"))

+ {

+ if (itemInstance == null || !itemInstance.isStackable() && player.getInventory().getInventoryItemCount(itemId, -1) < itemCount)

+ {

+ player.sendMessage("You do not have enough items!");

+ return;

+ }

+ if (itemInstance.isStackable())

+ {

+ if (!player.destroyItemByItemId("Aio Seller", itemId, itemCount, player.getTarget(), true))

+ {

+ player.sendMessage("You do not have enough items!");

+ return;

+ }

+ } else

+ for (int i = 0; i < itemCount; i++)

+ player.destroyItemByItemId("Aio Seller", itemId, 1, player.getTarget(), true);

+

+ doAio(player, 30);

+ }

+ else if (command.startsWith("add_aio_2"))

+ {

+ if (itemInstance == null || !itemInstance.isStackable() && player.getInventory().getInventoryItemCount(itemId, -1) < (itemCount * 1.67))

+ {

+ player.sendMessage("You do not have enough items!");

+ return;

+ }

+ if (itemInstance.isStackable())

+ {

+ if (!player.destroyItemByItemId("Aio Seller", itemId, (int) (itemCount * 1.67), player.getTarget(), true))

+ {

+ player.sendMessage("You do not have enough items!");

+ return;

+ }

+ }

+ else

+ for (int i = 0; i < (itemCount * 1.67); i++)

+ player.destroyItemByItemId("Aio Seller", itemId, 1, player.getTarget(), true);

+

+ doAio(player, 60);

+ }

+ else if (command.startsWith("add_aio_3"))

+ {

+ if (itemInstance == null || !itemInstance.isStackable() && player.getInventory().getInventoryItemCount(itemId, -1) < (itemCount * 2.5))

+ {

+ player.sendMessage("You do not have enough items!");

+ return;

+ }

+ if (itemInstance.isStackable())

+ {

+ if (!player.destroyItemByItemId("Aio Seller", itemId, (int) (itemCount * 2.5), player.getTarget(), true))

+ {

+ player.sendMessage("You do not have enough items!");

+ return;

+ }

+ }

+ else

+ for (int i = 0; i < (itemCount * 2.5); i++)

+ player.destroyItemByItemId("Aio Seller", itemId, 1, player.getTarget(), true);

+

+ doAio(player, 90);

+ }

+ else if (command.startsWith("remove_aio"))

+ {

+ removeAio(player);

+ }

+ showHtmlWindow(player);

+ }

+

+ private void showHtmlWindow(L2PcInstance activeChar)

+ {

+ NpcHtmlMessage nhm = new NpcHtmlMessage(5);

+ TextBuilder replyMSG = new TextBuilder("");

+

+ replyMSG.append("<html><title>Aio Seller NPC</title><body><center>");

+ replyMSG.append("<img src=L2UI_CH3.herotower_deco width=256 height=32><br>");

+ replyMSG.append("<font color=LEVEL>NPC Aio Seller</font><br>");

+ replyMSG.append("<img src=L2UI.SquareGray width=300 height=1><br>");

+ replyMSG.append("<center><button value=\"1 month\" action=\"bypass -h npc_" + getObjectId() + "_add_aio_1\" width=205 height=20 back=\"sek.cbui81\" fore=\"sek.cbui79\"></center>");

+ replyMSG.append("<center><button value=\"2 months\" action=\"bypass -h npc_" + getObjectId() + "_add_aio_2\" width=205 height=20 back=\"sek.cbui81\" fore=\"sek.cbui79\"></center>");

+ replyMSG.append("<center><button value=\"3 months\" action=\"bypass -h npc_" + getObjectId() + "_add_aio_3\" width=205 height=20 back=\"sek.cbui81\" fore=\"sek.cbui79\"></center><br>");

+ replyMSG.append("<img src=L2UI_CH3.herotower_deco width=256 height=32><br>");

+ replyMSG.append("<center><button value=\"Remove\" action=\"bypass -h npc_" + getObjectId() + "_remove_aio\" width=205 height=20 back=\"sek.cbui81\" fore=\"sek.cbui79\"></center><br>");

+ replyMSG.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>");

+ replyMSG.append("<img src=l2ui.bbs_lineage2 height=16 width=80>");

+ replyMSG.append("<font color=808080>" + Config.ALT_Server_Name + "</font>");

+ replyMSG.append("</center></body></html>");

+

+ nhm.setHtml(replyMSG.toString());

+ activeChar.sendPacket(nhm);

+

+ activeChar.sendPacket(new ActionFailed());

+ }

+

+ public void doAio(L2PcInstance player, int days)

+ {

+ if(player == null)

+ return;

+

+ player.setAio(true);

+ player.setEndTime("aio", days);

+ player.getStat().addExp(player.getStat().getExpForLevel(81));

+

+ Connection connection = null;

+ try

+ {

+ connection = L2DatabaseFactory.getInstance().getConnection(false);

+

+ PreparedStatement statement = connection.prepareStatement("UPDATE characters SET aio=1, aio_end=? WHERE obj_id=?");

+ statement.setLong(1, player.getAioEndTime());

+ statement.setInt(2, player.getObjectId());

+ statement.execute();

+ statement.close();

+ connection.close();

+

+ if(Config.ALLOW_AIO_NCOLOR && player.isAio())

+ player.getAppearance().setNameColor(Config.AIO_NCOLOR);

+

+ if(Config.ALLOW_AIO_TCOLOR && player.isAio())

+ player.getAppearance().setTitleColor(Config.AIO_TCOLOR);

+

+ player.rewardAioSkills();

+ player.broadcastUserInfo();

+ player.sendPacket(new EtcStatusUpdate(player));

+ player.sendSkillList();

+ player.sendMessage("You are now an Aio, Congratulations!");

+ player.broadcastUserInfo();

+ }

+ catch (Exception e)

+ {

+ if(Config.ENABLE_ALL_EXCEPTIONS)

+ e.printStackTrace();

+

+ _log.log(Level.WARNING,"could not set Aio stats to char:", e);

+ }

+ finally

+ {

+ CloseUtil.close(connection);

+ }

+ }

+ public void removeAio(L2PcInstance player)

+ {

+ player.setAio(false);

+ player.setAioEndTime(0);

+

+ Connection connection = null;

+ try

+ {

+ connection = L2DatabaseFactory.getInstance().getConnection(false);

+

+ PreparedStatement statement = connection.prepareStatement("UPDATE characters SET Aio=0, Aio_end=0 WHERE obj_id=?");

+ statement.setInt(1, player.getObjectId());

+ statement.execute();

+ statement.close();

+ connection.close();

+

+ player.lostAioSkills();

+ player.getAppearance().setNameColor(0xFFFFFF);

+ player.getAppearance().setTitleColor(0xFFFF77);

+ player.broadcastUserInfo();

+ player.sendPacket(new EtcStatusUpdate(player));

+ player.sendSkillList();

+ player.sendMessage("Now You are not an Aio..");

+ player.broadcastUserInfo();

+ }

+ catch (Exception e)

+ {

+ if(Config.ENABLE_ALL_EXCEPTIONS)

+ e.printStackTrace();

+

+ _log.log(Level.WARNING,"could not remove Aio stats of char:", e);

+ }

+ finally

+ {

+ CloseUtil.close(connection);

+ }

+ }

+}

\ No newline at end of file

 

 

Obrigado desde já !!!

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts recomendados

Até agora não há respostas para essa pergunta

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...
  • Registre-se

    Faça parte da maior e  mais antigas comunidades sobre Lineage2 da América Latina.





×
×
  • 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.