Jump to content

johnn

Membro
  • Content Count

    129
  • Joined

  • Last visited

Community Reputation

7 Normal

1 Follower

About johnn

  • Rank
    Muito Noob

Profile Information

  • Gênero:
    Masculino

Contact Methods

  • Skype:
    John.kelvy

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. johnn

    Comando GMShoop

    protected void runImpl() { final L2PcInstance player = getClient().getActiveChar(); if (player == null) return; if (!getClient().getFloodProtectors().getTransaction().tryPerformAction("buy")) { player.sendMessage("You buying too fast."); return; } // Alt game - Karma punishment if (!Config.ALT_GAME_KARMA_PLAYER_CAN_SHOP && player.getKarma() > 0) return; final L2Object target = player.getTarget(); if (!player.isGM() && (target == null // No target (ie GM Shop) || !(target instanceof L2MerchantInstance || target instanceof L2FishermanInstance || target instanceof L2MercManagerInstance || target instanceof L2ClanHallManagerInstance || target instanceof L2CastleChamberlainInstance) // Target not a merchant, fisherman or mercmanager || !player.isInsideRadius(target, L2NpcInstance.INTERACTION_DISTANCE, false, false) // Distance is too far )) return; boolean ok = true; String htmlFolder = ""; if (target != null) { if (target instanceof L2MerchantInstance) { htmlFolder = "merchant"; } else if (target instanceof L2FishermanInstance) { htmlFolder = "fisherman"; } else if (target instanceof L2MercManagerInstance) { ok = true; } else if (target instanceof L2ClanHallManagerInstance) { ok = true; } else if (target instanceof L2CastleChamberlainInstance) { ok = true; } else { ok = false; } } else { ok = false; } L2NpcInstance merchant = null; if (ok) { merchant = (L2NpcInstance) target; } else if (!ok && !player.isGM()) { player.sendMessage("Invalid Target: Seller must be targetted"); return; } L2TradeList list = null; if (merchant != null) { final List<L2TradeList> lists = TradeController.getInstance().getBuyListByNpcId(merchant.getNpcId()); if (!player.isGM()) { if (lists == null) { Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " sent a false BuyList list_id.", Config.DEFAULT_PUNISH); return; } for (final L2TradeList tradeList : lists) { if (tradeList.getListId() == _listId) { list = tradeList; } } } else { list = TradeController.getInstance().getBuyList(_listId); } } else { list = TradeController.getInstance().getBuyList(_listId); } if (list == null) { Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " sent a false BuyList list_id.", Config.DEFAULT_PUNISH); return; } _listId = list.getListId(); if (_listId > 1000000) // lease { if (merchant != null && merchant.getTemplate().npcId != _listId - 1000000) { sendPacket(ActionFailed.STATIC_PACKET); return; } } if (_count < 1) { sendPacket(ActionFailed.STATIC_PACKET); return; } double taxRate = 0; if (merchant != null && merchant.getIsInTown()) { taxRate = merchant.getCastle().getTaxRate(); } long subTotal = 0; int tax = 0; // Check for buylist validity and calculates summary values long slots = 0; long weight = 0; for (int i = 0; i < _count; i++) { final int itemId = _items[i * 2 + 0]; final int count = _items[i * 2 + 1]; int price = -1; if (!list.containsItemId(itemId)) { Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " sent a false BuyList list_id.", Config.DEFAULT_PUNISH); return; } final L2Item template = ItemTable.getInstance().getTemplate(itemId); if (template == null) { continue; } // Check count if (count > Integer.MAX_VALUE || !template.isStackable() && count > 1) { // Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " tried to purchase invalid quantity of items at the same time.", Config.DEFAULT_PUNISH); SystemMessage sm = new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED); sendPacket(sm); sm = null; return; } if (_listId < 1000000) { // list = TradeController.getInstance().getBuyList(_listId); price = list.getPriceForItemId(itemId); if (itemId >= 3960 && itemId <= 4026) { price *= Config.RATE_SIEGE_GUARDS_PRICE; } } /* * TODO: Disabled until Leaseholders are rewritten ;-) } else { L2ItemInstance li = merchant.findLeaseItem(itemId, 0); if (li == null || li.getCount() < cnt) { cnt = li.getCount(); if (cnt <= 0) { items.remove(i); continue; } items.get(i).setCount((int)cnt); } price = * li.getPriceToSell(); // lease holder sells the item weight = li.getItem().getWeight(); } */ if (price < 0) { LOGGER.warn("ERROR, no price found .. wrong buylist ??"); sendPacket(ActionFailed.STATIC_PACKET); return; } if (price == 0 && !player.isGM() && Config.ONLY_GM_ITEMS_FREE) { player.sendMessage("Ohh Cheat dont work? You have a problem now!"); Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " tried buy item for 0 adena.", Config.DEFAULT_PUNISH); return; } subTotal += (long) count * price; // Before tax tax = (int) (subTotal * taxRate); // Check subTotal + tax if (subTotal + tax > Integer.MAX_VALUE) { // Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " tried to purchase over " + Integer.MAX_VALUE + " adena worth of goods.", Config.DEFAULT_PUNISH); SystemMessage sm = new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED); sendPacket(sm); sm = null; return; } weight += (long) count * template.getWeight(); if (!template.isStackable()) { slots += count; } else if (player.getInventory().getItemByItemId(itemId) == null) { slots++; } } if (weight > Integer.MAX_VALUE || weight < 0 || !player.getInventory().validateWeight((int) weight)) { sendPacket(new SystemMessage(SystemMessageId.WEIGHT_LIMIT_EXCEEDED)); return; } if (slots > Integer.MAX_VALUE || slots < 0 || !player.getInventory().validateCapacity((int) slots)) { sendPacket(new SystemMessage(SystemMessageId.SLOTS_FULL)); return; } // Charge buyer and add tax to castle treasury if not owned by npc clan if (subTotal < 0 || !player.reduceAdena("Buy", (int) (subTotal + tax), player.getLastFolkNPC(), false)) { sendPacket(new SystemMessage(SystemMessageId.YOU_NOT_ENOUGH_ADENA)); return; } if (merchant != null && merchant.getIsInTown() && merchant.getCastle().getOwnerId() > 0) { merchant.getCastle().addToTreasury(tax); } // Proceed the purchase for (int i = 0; i < _count; i++) { final int itemId = _items[i * 2 + 0]; int count = _items[i * 2 + 1]; if (count < 0) { count = 0; } if (!list.containsItemId(itemId)) { Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " sent a false BuyList list_id.", Config.DEFAULT_PUNISH); return; } if (list.countDecrease(itemId)) { if (!list.decreaseCount(itemId, count)) { SystemMessage sm = new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED); sendPacket(sm); sm = null; return; } } // Add item to Inventory and adjust update packet player.getInventory().addItem("Buy", itemId, count, player, merchant); /* * TODO: Disabled until Leaseholders are rewritten ;-) // Update Leaseholder list if (_listId >= 1000000) { L2ItemInstance li = merchant.findLeaseItem(item.getItemId(), 0); if (li == null) continue; if (li.getCount() < item.getCount()) item.setCount(li.getCount()); * li.setCount(li.getCount() - item.getCount()); li.updateDatabase(); price = item.getCount() + li.getPriceToSell(); L2ItemInstance la = merchant.getLeaseAdena(); la.setCount(la.getCount() + price); la.updateDatabase(); player.getInventory().addItem(item); item.updateDatabase(); } */ } if (merchant != null) { final String html = HtmCache.getInstance().getHtm("data/html/" + htmlFolder + "/" + merchant.getNpcId() + "-bought.htm"); if (html != null) { final NpcHtmlMessage boughtMsg = new NpcHtmlMessage(merchant.getObjectId()); boughtMsg.setHtml(html.replaceAll("%objectId%", String.valueOf(merchant.getObjectId()))); player.sendPacket(boughtMsg); } } final StatusUpdate su = new StatusUpdate(player.getObjectId()); su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad()); player.sendPacket(su); player.sendPacket(new ItemList(player, true)); } @Override public String getType() { return "[C] 1F RequestBuyItem"; } } Essa e classe toda la em requestbuyitem.java
  2. johnn

    Comando GMShoop

    Ja retirei do if em diante e nada..
  3. johnn

    Comando GMShoop

    Boa noite estou criando Community Board com opção para comprar items, ate agora tive sucesso porem tem um restrição na l2jfrozen que não me permite comprar se não estiver no target de algum INPC alguém poderia me ajudar ? ja deletei tudo relacionado, ja alterei fiz muitas coisas mas nada! alguém saberia como fazer funcionar para comprar no community e no comando .gmshop sem precisar de target de npc? CODIGO QUE ACHEI EM REQUESTBUYITEM.JAVA: final L2Object target = player.getTarget(); if (!player.isGM() && (target == null // No target (ie GM Shop) || !(target instanceof L2MerchantInstance || target instanceof L2FishermanInstance || target instanceof L2MercManagerInstance || target instanceof L2ClanHallManagerInstance || target instanceof L2CastleChamberlainInstance) // Target not a merchant, fisherman or mercmanager || !player.isInsideRadius(target, L2NpcInstance.INTERACTION_DISTANCE, false, false) // Distance is too far )) return;
  4. Adaptei para l2jfrozen caso alguém ainda queira e só trocar o código do L2Bufferinstance.java por esse código abaixo: /* * 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. * * http://www.gnu.org/copyleft/gpl.html */ package com.l2jfrozen.gameserver.model.actor.instance; import java.util.StringTokenizer; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.ai.CtrlIntention; import com.l2jfrozen.gameserver.datatables.SkillTable; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser; import com.l2jfrozen.gameserver.network.serverpackets.MoveToPawn; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.SocialAction; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; import com.l2jfrozen.util.random.Rnd; /** * @author KDerD64 */ public final class L2BufferInstance extends L2NpcInstance { public L2BufferInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { StringTokenizer st = new StringTokenizer(command, " "); String actualCommand = st.nextToken(); int buffid = 0; int bufflevel = 1; String nextWindow = null; if (st.countTokens() == 3) { buffid = Integer.valueOf(st.nextToken()); bufflevel = Integer.valueOf(st.nextToken()); nextWindow = st.nextToken(); } else if (st.countTokens() == 1) buffid = Integer.valueOf(st.nextToken()); if (actualCommand.equalsIgnoreCase("getbuff")) { if (buffid != 0) { MagicSkillUser mgc = new MagicSkillUser(this, player, buffid, bufflevel, -1, 0); SkillTable.getInstance().getInfo(buffid, bufflevel).getEffects(this, player); showMessageWindow(player); player.broadcastPacket(mgc); showChatWindow(player, nextWindow); } } else if (actualCommand.equalsIgnoreCase("restore")) { player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp()); player.setCurrentCp(player.getMaxCp()); showMessageWindow(player); } else if (actualCommand.equalsIgnoreCase("cancel")) { player.stopAllEffects(); showMessageWindow(player); } else super.onBypassFeedback(player, command); } @Override public void onAction(L2PcInstance player) { if (this != player.getTarget()) { player.setTarget(this); player.sendPacket(new MyTargetSelected(getObjectId(), player.getLevel() - getLevel())); player.sendPacket(new ValidateLocation(this)); } else if (isInsideRadius(player, INTERACTION_DISTANCE, false, false)) { SocialAction sa = new SocialAction(this.getObjectId(), (int) Rnd.get()); broadcastPacket(sa); player.sendPacket(new MoveToPawn(player, this, 150)); showMessageWindow(player); player.sendPacket(ActionFailed.STATIC_PACKET); } else { player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this); player.sendPacket(ActionFailed.STATIC_PACKET); } } private void showMessageWindow(L2PcInstance player) { String filename = "data/html/buffer/" + getNpcId() + ".htm"; filename = getHtmlPath(getNpcId(), 0); NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(filename); html.replace("%objectId%", String.valueOf(getObjectId())); html.replace("%npcname%", getName()); html.replace("%servername%", String.valueOf(Config.ALT_Server_Name)); player.sendPacket(html); } @Override public String getHtmlPath(int npcId, int val) { String pom = ""; if (val == 0) pom = "" + npcId; else pom = npcId + "-" + val; return "data/html/buffer/" + pom + ".htm"; } }
  5. SEI QUE O TÓPICO E ANTIGO MAIS AINDA AS DUVIDAS SURGEM E NO MEU CASO DESCOBRIR COMO RESOLVER E ESTAREI INFORMANDO AQUI VEJA:
  6. Estou com o seguinte erro alguém poderia me ajudar? desde ja agradeço: Podem fechar o topico RESOLVIDO faltava o import nos arquivos java.
  7. johnn

    Erro no Gameserver

    Ola estou tendo este erro no game server estou desconfiado que possa ser hacker, não tenho certeza alguns player já reclamarão comigo sobre esse mesmo player e no game server apareceu o nome dele juntamente com um error a seguir alguém pode me dizer o q significa o error e como proceder se for algo corrigível.. NOME DO PLAYER ( SAMURAI )
  8. johnn

    Enchant skill

    Ola pessoal meu servidor quando a class acher vai enchantar as skill nao aparece Ultimate evasion alguem sabe me dizer por que?
  9. johnn

    ERROR GAME SERVER!

    Ola peciso de ajuda para resolver esse problema: WARN 2016-01-25 11:50:53,851 Error could not store char skills: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolat Duplicate entry '268483199-28000-0' for key 'PRIMARY' a skill que ta causando esse error: <?xml version='1.0' encoding='utf-8'?> <list> <skill id="28000" levels="1" name="Decline Weapon Bow"> <set name="target" val="TARGET_SELF"/> <set name="skillType" val="BUFF"/> <set name="operateType" val="OP_PASSIVE"/> <for> <mul order="0x40" stat="rCrit" val="0.1"> <using kind="Bow"/> </mul> <mul order="0x40" stat="pAtk" val="0.1"> <using kind="Bow"/> </mul> <mul order="0x40" stat="pAtkSpd" val="0.4"> <using kind="Bow"/> </mul> </for> </skill> </list>
  10. Ola, gostaria da ajuda de vocês pois quando alguém em meu servidor entra e pegas as jobs de 1ª, 2ª e 3ª, class trava muito, quando vai pegar a 2ª job tipo trava uns 2 a 3 mim e também acontece o mesmo quando vai fazer sub class ou quando vai trocar a sub class. o que poderia ser? utilizo uma revisao privada ( nao posso citar nome ) me parece que ela e baseada na l2jfrozen e não existe tabela skill_learn e tudo .XML skill_trees skil_learn
  11. johnn

    Query

    Ola alguem aqui do forum poderia me ajudar, fazendo uma query que add drope em todos os raid de uma vez?
  12. ALguem pode me ajudar como faço para obter os cod dos site de votos? não to achando no panel :/ sou novo nisso de vote system
  13. Estou usando o npc original
  14. Ola, estou tendo problemas em meu servidor onde alguns player nao consegue colocar dyas alguem poderia me ajduar a solucionar este problema.? Deixa me explicar melhor alguns conseguem outros não simplesmente o symbol maker se aperta em draw e de repente volta no html inicial.
×
×
  • Create New...