Ir para conteúdo
  • Cadastre-se
  • 0

(Adaptar Script) AugmentShop


arthursergiop

Pergunta

Alguém sabe/pode/consegue adaptar esse Script de AugmentShop da DreamV1 para a Frozen?

No próprio post tem um camarada que tentou/fez mas tentei usar o script dele e não funciona. Alguém com um tempinho que se disponibilize? Desde já agradeço!

Editado por arthursergiop
Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts recomendados

  • 0
17 minutos atrás, arthursergiop disse:

Alguém sabe/pode/consegue adaptar esse Script de AugmentShop da DreamV1 para a Frozen?

No próprio post tem um camarada que tentou/fez mas tentei usar o script dele e não funciona. Alguém com um tempinho que se disponibilize? Desde já agradeço!

já tento trocar os imports? mas creio q essa class esta escrita em java e nao em python

import com.src.gameserver.model.actor.instance.L2ItemInstance;
import com.src.gameserver.model.actor.instance.L2PcInstance;
import com.src.gameserver.model.actor.L2Npc;
import com.src.gameserver.model.quest.Quest;
import com.src.gameserver.model.quest.QuestState;
import com.src.util.database.L2DatabaseFactory;
import com.src.gameserver.model.itemcontainer.Inventory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import org.apache.commons.logging.Log;

Link para o comentário
Compartilhar em outros sites


  • 0

tenta assim

Spoiler

package custom.AugmentShop;

import java.sql.Connection;
import java.sql.PreparedStatement;

import com.l2jfrozen.gameserver.model.Inventory;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.quest.Quest;
import com.l2jfrozen.gameserver.model.quest.QuestState;
import com.l2jfrozen.util.database.L2DatabaseFactory;

/**
 * 
 * @author adapted by Samar 2011 RUSSIA
 * 
 */
public class AugmentShop extends Quest
{
    private final static int ITEM_ID = 57;
    private final static int ITEM_COUNT = 1000000;
    private final static String qn = "AugmentShop";
    private final static int NPC = 666667;
    
    public AugmentShop(int questId, String name, String descr) 
    {
        super(questId, name, descr);

        addStartNpc(NPC);
        addTalkId(NPC);
    }
    
    @Override
    public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
    {
        String htmltext = "";
        
        if (event.equalsIgnoreCase("active1"))
        {
            htmltext = "active1.htm";
        }
        
        else if (event.equalsIgnoreCase("active2"))
        {
            htmltext = "active2.htm";
        }
        
        else if (event.equalsIgnoreCase("passive1"))
        {
            htmltext = "passive1.htm";
        }
        
        else if (event.equalsIgnoreCase("passive2"))
        {
            htmltext = "passive2.htm";
        }
        
        else if (event.equalsIgnoreCase("main"))
        {
            htmltext = "main.htm";
        }
        
        else
        {
            
            updateAugment(player, Integer.parseInt(event.substring(0,5)), Integer.parseInt(event.substring(6,10)), Integer.parseInt(event.substring(11,13)));
        }

        
        return htmltext;
    }

    @Override
    public String onTalk(L2NpcInstance npc, L2PcInstance player)
    {
        String htmltext = "";
        QuestState qs = player.getQuestState(qn);
        if (qs == null)
            qs = newQuestState(player);
        htmltext = "main.htm";
        return htmltext;
    }
    
    public static void main(String[] args)
    {
        new AugmentShop(-1, qn, "AugmentShop");
    }
    
    
    @SuppressWarnings("null")
    private static void updateAugment(L2PcInstance player, int attributes, int skill, int level)
    {
        L2ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
        if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) == null)
            
        {
            player.sendMessage("You have to equip a weapon.");
            return;
        }
            
        if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND).isAugmented())
        {
            player.sendMessage("The weapon is already augmented.");
            return;
        }
        
        if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) < ITEM_COUNT)
        {
            player.sendMessage("You dont have enough item.");
            return;
        }
            
        Connection con = null;
        try
        {
            player.destroyItemByItemId("Consume", ITEM_ID, ITEM_COUNT, player, true);
            con = L2DatabaseFactory.getInstance().getConnection();
            PreparedStatement statement = con.prepareStatement("REPLACE INTO augmentations VALUES(?,?,?,?)");
            statement.setInt(1, item.getObjectId());

                statement.setInt(2, attributes*65536+1);
                statement.setInt(3, skill);
                statement.setInt(4, level);
            
            statement.executeUpdate();
            player.sendMessage("Succesfully augmented. You have to relog now.");
            statement.close();
            
        }
        catch (Exception e)
        {
            LOGGER.info("Could not augment item: "+item.getObjectId()+" ", e);
        }
        finally
        {
        try
        {
        
            /*L2DatabaseFactory.close(con);*/
            con.close();
            }
            catch (Exception e)
            {
            }
        }
    }
    
    
}

 

ai todo codigo

Editado por Sarada
Link para o comentário
Compartilhar em outros sites

  • 0

Caso não de na primeira opção, tente assim

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

creio que não precisa registar em scripts.cfg, porque ele ta registrado como quest igual ao modo do baium, só seguir pastebin,

é no eclipse que é pra adicionar isso gente!

Editado por Sarada
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...
  • 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.