Olá Convidado,
A sua idade é de 0 anos e registou-se em Qua Dez 31, 1969, desde esta data, já postou 0 mensagens. A sua última visita foi Qua Dez 31, 1969.

Participe do fórum, é rápido e fácil

Olá Convidado,
A sua idade é de 0 anos e registou-se em Qua Dez 31, 1969, desde esta data, já postou 0 mensagens. A sua última visita foi Qua Dez 31, 1969.

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.


    [TODAS VERSÕES] Espião de inventários (Ferramenta para staffs) para seu private server!

    ~Victor~
    ~Victor~
    Coordenador
    Coordenador


    Advertencias : Normal
    Mensagens Mensagens : 22
    Mesos Mesos : 43950
    Data de inscrição : 06/05/2012
    Idade Idade : 26

    Pedra [TODAS VERSÕES] Espião de inventários (Ferramenta para staffs) para seu private server!

    Mensagem por ~Victor~ Dom maio 06, 2012 4:19 pm

    Espião de inventários:

    Descrição:
    Com isso você pode ver quais itens e qual quantidade tal player têm, e além de ver, você também pode remover qualquer item! (Útil para remover itens dupados dos players)


    Screenshots:
    [Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

    Agora a parte difícil:

    Ja no NetBeans, va até MapleCharacter.java e coloque as seguintes funções:

    Código:
        public MapleCharacter getPlayer() {
            return c.getPlayer();
        } 

    Código:
        public MapleCharacter getCharByName(String name) {
            try {
                return c.getChannelServer().getPlayerStorage().getCharacterByName(name);
            } catch (Exception e) {
                return null;
            }
        }

    Código:
        public int getEquipId(byte slot) {
            MapleInventory equip = getInventory(MapleInventoryType.EQUIP);
            Equip eu = (Equip) equip.getItem(slot);
            return equip.getItem(slot).getItemId();
        }

        public int getUseId(byte slot) {
            MapleInventory use = getInventory(MapleInventoryType.USE);
            return use.getItem(slot).getItemId();
        }

        public int getSetupId(byte slot) {
            MapleInventory setup = getInventory(MapleInventoryType.SETUP);
            return setup.getItem(slot).getItemId();
        }

        public int getCashId(byte slot) {
            MapleInventory cash = getInventory(MapleInventoryType.CASH);
            return cash.getItem(slot).getItemId();
        }

        public int getETCId(byte slot) {
            MapleInventory etc = getInventory(MapleInventoryType.ETC);
            return etc.getItem(slot).getItemId();
        } 


    Código:
            public void deleteAll(int id) {
            MapleInventoryManipulator.removeAllById(getClient(), id, true);
        } 

    Código:
        public int getItemQuantity(int itemid, boolean checkEquipped) {
            MapleInventoryType type = MapleItemInformationProvider.getInstance().getInventoryType(itemid);
            MapleInventory iv = inventory[type.ordinal()];
            int possesed = iv.countById(itemid);
            if (checkEquipped) {
                possesed += inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid);
            }
            return possesed;
        } 


    Agora, va até NPCConversationManager.java e coloque essa função:

    Código:
     public String EquipList(MapleClient c) {
            StringBuilder str = new StringBuilder();
            MapleInventory equip = c.getPlayer().getInventory(MapleInventoryType.EQUIP);
            List<String> stra = new LinkedList<String>();
            for (IItem item : equip.list()) {
                stra.add("#L" + item.getPosition() + "##v" + item.getItemId() + "##l");
            }
            for (String strb : stra) {
                str.append(strb);
            }
            return str.toString();
        }

        public String UseList(MapleClient c) {
            StringBuilder str = new StringBuilder();
            MapleInventory use = c.getPlayer().getInventory(MapleInventoryType.USE);
            List<String> stra = new LinkedList<String>();
            for (IItem item : use.list()) {
                stra.add("#L" + item.getPosition() + "##v" + item.getItemId() + "##l");
            }
            for (String strb : stra) {
                str.append(strb);
            }
            return str.toString();
        }

        public String CashList(MapleClient c) {
            StringBuilder str = new StringBuilder();
            MapleInventory cash = c.getPlayer().getInventory(MapleInventoryType.CASH);
            List<String> stra = new LinkedList<String>();
            for (IItem item : cash.list()) {
                stra.add("#L" + item.getPosition() + "##v" + item.getItemId() + "##l");
            }
            for (String strb : stra) {
                str.append(strb);
            }


    E por final, o SCRIPT DO NPC:




    Código:
    var name;
    var status = 0;
    var thing = 0;
    var slot;
    var p = null;

    function start() {
        status = -1;
        action(1, 0, 0);
    }

    function action(mode, type, selection) {
        if (mode == -1) {
            cm.dispose();
        } else {
            if (mode == 2 && status == 0) {
                cm.dispose();
                return;
            }
            if (mode == 1)
                status++;
            else
                status--;
            if (status == 0) {
                if (cm.haveItem(4030002, 0)) {
                    cm.sendGetText("#eOi #h #! Eu posso checar um inventario de algum player para voce. \r\n\r\n#rDigite o nome do player");
                } else {
                    cm.sendOk("#e VOCE NAO EH GM -.-");
                    cm.dispose();
                }
            } else if (status == 1) {
                name = cm.getText();
                p = cm.getCharByName(name);
                if (p != null) {
                    cm.sendSimple("#eEscolha um inventario#b\r\n#L0#Equip#l\r\n#L1#Use#l\r\n#L2#Set-up#l\r\n#L3#ETC#l\r\n#L4#Cash#l");
                } else {
                    cm.sendOk("#e#rO player esta off ou nao esta no mesmo canal que voce.");
                }
            } else if (status == 2) {
                string = "#eClique em um item para remover #todos#k dele.\r\n#n";
                thing = selection;
                if (selection == 0) {               
                    cm.sendSimple(string+cm.EquipList(p.getClient()));
                } else if (selection == 1) {
                    cm.sendSimple(string+cm.UseList(p.getClient()));
                } else if (selection == 2) {
                    cm.sendSimple(string+cm.SetupList(p.getClient()));
                } else if (selection == 3) {
                    cm.sendSimple(string+cm.ETCList(p.getClient()));
                } else if (selection == 4) {
                    cm.sendSimple(string+cm.CashList(p.getClient()));
                }
            } else if (status == 3) {
                slot = selection;
                send = "#eThe user has#r ";
                send2 = "#k of the item #i";
                if (thing == 0) {
                    send += p.getItemQuantity(p.getEquipId(selection), true);
                    send2 += p.getEquipId(selection);
                } else if (thing  == 1) {
                    send += p.getItemQuantity(p.getUseId(selection), true);
                    send2 += p.getUseId(selection);
                } else if (thing == 2) {
                    send += p.getItemQuantity(p.getSetupId(selection), true);
                    send2 += p.getSetupId(selection);
                } else if (thing == 3) {
                    send += p.getItemQuantity(p.getETCId(selection), true);
                    send2 += p.getETCId(selection);
                } else if (thing == 4) {
                    send += p.getItemQuantity(p.getCashId(selection), true);
                    send2 += p.getCashId(selection);
                }
                var send3 = send + send2 + "# tem certeza que quer deletar #rtodos#k desse item?";
                cm.sendYesNo(send3);
            } else if (status == 4) {
                if (thing == 0) {
                    p.deleteAll(p.getEquipId(slot));
                } else if (thing == 1) {
                    p.deleteAll(p.getUseId(slot));
                } else if (thing == 2) {
                    p.deleteAll(p.getSetupId(slot));
                } else if (thing == 3) {
                    p.deleteAll(p.getETCId(slot));
                } else if (thing == 4) {
                    p.deleteAll(p.getCashId(slot));
                }
                cm.sendOk("#eDeletado com sucesso o item do player " +  name + "");
                cm.dispose();
            }
        }



    (PARA POR O SCRIPT, VA ATÉ A PASTA SCRIPTS>NPC DA SUA SOURCE E COLOQUE ESSE SCRIPT EM ALGUM NPC QUE VOCÊ NÃO ESTEJA USANDO, E POR FIM CRIE UM COMANDO QUE EXECUTE O ID DESSE NPC, OU COLOQUE ESSE NPC NA GM ROOM)







    OBS: TALVEZ a função "removeAllById" esteja sublinhado de vermelho, clique ali na lâmpadazinha do lado onde diz o número da linha de onde está esse erro, selecione a primeira opção e ele levará você a uma outra página, nesta pagina delete a função "removeAllById" que já existe e coloque essa no lugar dela:

    Código:
        public static void removeAllById(MapleClient c, int itemId, boolean checkEquipped) {
            MapleInventoryType type = MapleItemInformationProvider.getInstance().getInventoryType(itemId);
            for (IItem item : c.getPlayer().getInventory(type).listById(itemId)) {
                if (item != null) {
                    removeFromSlot(c, type, item.getPosition(), item.getQuantity(), true, false);
                }
            }
            if (checkEquipped) {
                IItem ii = c.getPlayer().getInventory(type).findById(itemId);
                if (ii != null) {
                    c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).removeItem(ii.getPosition());
                    c.getPlayer().equipChanged();
                }
            }
        }






    ------------------------
    Créditos:
    Ferramenta: Ragezone
    Tradução do tópico e imagens: Eu

      Data/hora atual: Sáb maio 11, 2024 3:13 am