Secret Experience

Secret Experience (https://secretexperience.net/)
-   [Lineage] Java Mods (https://secretexperience.net/lineage-java-mods/)
-   -   [L2JServer] [Share]L2PVPMerchant (https://secretexperience.net/lineage-java-mods/21804-share-l2pvpmerchant.html)

Guma 27-05-2010 04:53 AM

[Share]L2PVPMerchant
 
Como fazer

adicione manualmente..
Temos que fazer NPC,
Vá ao banco de dados, tabela Npc selecionar e adicionar uma nova linha
Você pode copiar linha de um outro npc,
mas tera q mudar a classe na coluna pra 'L2PVPMerchant'
Crie uma pasta em html / dados com o nome PVPMerchant
Criar um arquivo HTML
Você está feito e você pode colocar arquivos multisell

Código:

Index: C:/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PVPMerchantInstance.java
===================================================================
/*
 * 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 net.sf.l2j.gameserver.model.actor.instance;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.model.L2Multisell;
import net.sf.l2j.gameserver.templates.L2NpcTemplate;

/**
* Author xAddytzu
*/

public class L2PVPMerchantInstance extends L2FolkInstance
{
        public L2PVPMerchantInstance(int objectId, L2NpcTemplate template)
        {
                super(objectId, template);
        }
        @Override
        public String getHtmlPath(int npcId, int val)
        {
                String pom = "";

                if (val == 0) pom = "" + npcId;
                else pom = npcId + "-" + val;

                return "data/html/PVPMerchant/" + pom + ".htm";
        }
        @Override
        public void onBypassFeedback(L2PcInstance player, String command)
        {
                StringTokenizer st = new StringTokenizer(command, " ");
                String actualCommand = st.nextToken();

                if (actualCommand.equalsIgnoreCase("Exc_Multisell"))
                {
                L2Multisell.getInstance().SeparateAndSend(Integer.parseInt(command.substring(9).trim()), player, true, getCastle().getTaxRate());
                }
                else if (actualCommand.equalsIgnoreCase("Multisell"))
                {
                        L2Multisell.getInstance().SeparateAndSend(Integer.parseInt(command.substring(9).trim()), player, false, getCastle().getTaxRate());
                }
                else
                {
                        super.onBypassFeedback(player, command);
                }
        }
}

Index: C:/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
===================================================================

                        else if (!Config.ALT_GAME_KARMA_PLAYER_CAN_SHOP && this instanceof L2FishermanInstance)
                        {
                                if (showPkDenyChatWindow(player, "fisherman"))
                                        return;
                        }
                        // Custom staff
+                        else if (player.getPvpKills() >= Config.PVP_MIN)
+                        { 
+                                if (this instanceof L2PVPMerchantInstance)
+                                {
+                                        if (showPkDenyChatWindow(player, "PVPMerchant"))
+                                                return;
+                                }
+                        }

Index: C:/workspace/L2_GameServer_t1/java/net/sf/l2j/Config.java
===================================================================
+        //Custom stuff
+    public static int PVP_MIN;
@@
+        PVP_MIN = Integer.parseInt(otherSettings.getProperty("PVPMerchant", "100"));
        }
        catch (Exception e)
        {

Index: C:/L2_GameServer/java/config/other.properties
===================================================================
+
+#------------------------------------------
+# If you have >= 100 points
+# You can buy usefull items
+#------------------------------------------
+PVPMerchant = 100

qual quer duvida so falar.

Credito : xAddytzu

vicfelipe 27-05-2010 06:27 AM

Ótimo mod!
Lembrando também que a partir desta diff é possível criar também outros tipo de ingrediente não só pvp, mas também pk, onlinetime, rec, raidpoints e por ai vai.
Basta trocar:
Citação:

player.getPvpKills() >= Config.PVP_MIN
Pela instance no qual seja ingrediente básico para a compra do item, para encontrar a instance só procurar no L2PcInstance. E inserir uma nova config no Config.java

kinpcc 27-05-2010 03:26 PM

Desculpe pode explicar como funciona esse mod?

Tipo ele serve pra trocar os pvp nos npc por itens?

Inspector 27-05-2010 03:40 PM

@kinpcc
isso e como foi citado pode ser adaptado para trocar outras coisas como pk tempo online tambem

B1Z4R0 27-05-2010 04:10 PM

@VicFelipe
caso se quiser colocar pra trocar tempoonline Como ficaria nessa parte ae
player.getPvpKills() >= Config.PVP_MIN

Inspector 27-05-2010 04:40 PM

@B1Z4R0
sim como citado no quote dele pasta alterar essa linha para a config desejada

vicfelipe 27-05-2010 05:33 PM

@Bizarro,

Exemplo, para comprar o item por PK

Citação:

player.getPkKills() >= Config.PK_MIN
No Config.java

Citação:

+ PK_MIN = Integer.parseInt(otherSettings.getProperty("PVPMer chant", "100"));
Por Recomends

Citação:

player.getRecomHave() >= Config.REC_MIN
No Config.java

Citação:

+ REC_MIN = Integer.parseInt(otherSettings.getProperty("PVPMer chant", "100"));
E assim por diante, as instances podem ser encontradas no L2PCInstance e podem ser inseridas no arquivo para criar vários tipo de Shop, não somente por PvP.
No caso, se for por tempo online e seu pack tiver a instance "getonlinetime" faça como nos exemplos acima.

fabioanesio 28-05-2010 04:32 PM

Massa isso, poderia me fala se fuciona no L2emu isso ?
E como posso fazer o NPC ?
Sou meio ruim nessa parte
rsrs :P

Guma 28-05-2010 04:58 PM

o npc é so voce cria uma sql so q em type tem q por L2PVPMerchant

e cria uma pasta L2PVPMerchant dentro da pasta html do gameserver.

fabioanesio 28-05-2010 05:03 PM

Ate ai blz.

Nessa pasta coloca oq ?
Os arquivos do npc...

E esse arquivo em cima coloca nessa pasta ?
:google_dk:


Horários baseados na GMT -3. Agora são 05:34 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0