Ver um Único Post
Antigo 28-06-2010, 02:21 PM   #25 (permalink)
lucas37
Membro - Major
 
Avatar de lucas37
 
Registrado em: May 2009
Posts: 159
Agradeceu: 65
Agradecido 79 Vezes em 50 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Estado:
Nome Real: Jeffersonn Lucas ( Sephir0s )

Inventório de lucas37

Padrão

@Dazzel
cancel ta dando pra jogar no proprio target =p

esse codigo e para todas as armações do phx

Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
Codigo MOD PHXimport net.sf.l2j.Config; import net.sf.l2j.gameserver.Shutdown; import net.sf.l2j.gameserver.model.*; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.network.L2GameClient; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.serverpackets.*; import net.sf.l2j.gameserver.templates.L2EtcItemType; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import net.sf.l2j.gameserver.util.IllegalPlayerAction; import net.sf.l2j.gameserver.util.Util; // Referenced classes of package net.sf.l2j.gameserver.clientpackets: // L2GameClientPacket public class SendWareHouseDepositList extends L2GameClientPacket { public SendWareHouseDepositList() { } protected void readImpl() { _count = readD(); if(_count < 0 || _count * 8 > _buf.remaining() || _count > Config.MAX_ITEM_IN_PACKET) _count = 0; _items = new int[_count * 2]; for(int i = 0; i < _count; i++) { int objectId = readD(); _items[i * 2 + 0] = objectId; long cnt = readD(); if(cnt > 0x7fffffffL || cnt < 0L) { _count = 0; _items = null; return; } _items[i * 2 + 1] = (int)cnt; } } protected void runImpl() { L2PcInstance player = ((L2GameClient)getClient()).getActiveChar(); if(player == null) return; ItemContainer warehouse = player.getActiveWarehouse(); if(warehouse == null) return; net.sf.l2j.gameserver.model.actor.instance.L2FolkInstance manager = player.getLastFolkNPC(); if(Config.SAFE_REBOOT && Config.SAFE_REBOOT_DISABLE_TRANSACTION && Shutdown.getCounterInstance() != null && Shutdown.getCounterInstance().getCountdown() <= Config.SAFE_REBOOT_TIME) { player.sendMessage("Transactions are not allowed during restart/shutdown."); sendPacket(new ActionFailed()); return; } if((manager == null || !player.isInsideRadius(manager, 150, false, false)) && !player.isGM()) return; if((warehouse instanceof ClanWarehouse) && Config.GM_DISABLE_TRANSACTION && player.getAccessLevel() >= Config.GM_TRANSACTION_MIN && player.getAccessLevel() <= Config.GM_TRANSACTION_MAX) { player.sendMessage("Transactions are disabled for your access level."); sendPacket(new ActionFailed()); return; } // If no or wrong channel is used - return if (_type == SystemChatChannelId.Chat_None || _type == SystemChatChannelId.Chat_Announce || _type == SystemChatChannelId.Chat_Critical_Announce || _type == SystemChatChannelId.Chat_System || _type == SystemChatChannelId.Chat_Custom || (_type == SystemChatChannelId.Chat_GM_Pet && !activeChar.isGM())) { _log.warn("[Anti-Phx] Illegal chat channel was used."); return; } if (activeChar == null) { _log.warn("[Say2.java] Active Character is null."); return; } @Override protected void runImpl() { L2PcInstance activeChar = getClient().getActiveChar(); } if (player.getActiveEnchantItem() != null) { Util.handleIllegalPlayerAction(player,"Mofo "+player.getName()+" tried to use phx and got BANED! Peace :-h", IllegalPlayerAction.PUNISH_KICKBAN); return; } // Alt game - Karma punishment if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE && player.getKarma() > 0) return; int fee = _count * 30; int currentAdena = player.getAdena(); int slots = 0; for(int i = 0; i < _count; i++) { int objectId = _items[i * 2 + 0]; int count = _items[i * 2 + 1]; L2ItemInstance item = player.checkItemManipulation(objectId, count, "deposit"); if(item == null) { _log.warn((new StringBuilder()).append("Error depositing a warehouse object for char ").append(player.getName()).append(" (validity check)").toString()); _items[i * 2 + 0] = 0; _items[i * 2 + 1] = 0; continue; } if(Config.ALT_STRICT_HERO_SYSTEM && item.isHeroitem()) continue; if((warehouse instanceof ClanWarehouse) && !item.isTradeable() || item.getItemType() == L2EtcItemType.QUEST) return; if(item.getItemId() == 57) currentAdena -= count; if(!item.isStackable()) { slots += count; continue; } if(warehouse.getItemByItemId(item.getItemId()) == null) slots++; } if(!warehouse.validateCapacity(slots)) { sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED)); return; } if(currentAdena < fee || !player.reduceAdena("Warehouse", fee, player.getLastFolkNPC(), false)) { sendPacket(new SystemMessage(SystemMessageId.YOU_NOT_ENOUGH_ADENA)); return; } InventoryUpdate playerIU = Config.FORCE_INVENTORY_UPDATE ? null : new InventoryUpdate(); for(int i = 0; i < _count; i++) { int objectId = _items[i * 2 + 0]; int count = _items[i * 2 + 1]; if(objectId == 0 && count == 0) continue; L2ItemInstance oldItem = player.getInventory().getItemByObjectId(objectId); if(oldItem == null) { _log.warn((new StringBuilder()).append("Error depositing a warehouse object for char ").append(player.getName()).append(" (olditem == null)").toString()); continue; } if(Config.ALT_STRICT_HERO_SYSTEM && oldItem.isHeroitem()) continue; L2ItemInstance newItem = player.getInventory().transferItem((warehouse instanceof ClanWarehouse) ? "ClanWarehouse" : "Warehouse", objectId, count, warehouse, player, player.getLastFolkNPC()); if(newItem == null) { _log.warn((new StringBuilder()).append("Error depositing a warehouse object for char ").append(player.getName()).append(" (newitem == null)").toString()); continue; } if(playerIU == null) continue; if(oldItem.getCount() > 0 && oldItem != newItem) playerIU.addModifiedItem(oldItem); else playerIU.addRemovedItem(oldItem); } if(playerIU != null) player.sendPacket(playerIU); else player.sendPacket(new ItemList(player, false)); StatusUpdate su = new StatusUpdate(player.getObjectId()); su.addAttribute(14, player.getCurrentLoad()); player.sendPacket(su); } public String getType() { return "[C] 31 SendWareHouseDepositList"; } private static final String _C__31_SENDWAREHOUSEDEPOSITLIST = "[C] 31 SendWareHouseDepositList"; private static final Log _log = LogFactory.getLog(net/sf/l2j/gameserver/clientpackets/SendWareHouseDepositList.getName()); private int _count; private int _items[]; }
Postado por Daniel2 em outro forum

Esse é um MOD que teleporta o Player para uma area de Drop
Aonde esta 3470 é o ID do Gold Bar que sera cobrado e 1 é a quantidade cobrada
e placex = 81304; e para onde sera teleportador
placey = 14589;
placez = -3469;

Crie 1 novo Arquivo chamado Farm.java em java/net/sf/l2j/gameserver/handler/voicedcommandhandlers


Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
Codigo MOD Zona Farm+package net.sf.l2j.gameserver.handler.voicedcommandhandlers; + +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + +/** + * + *@author TheKon + * + */ +public class Farm implements IVoicedCommandHandler +{ + private static final String[] VOICED_COMMANDS = { "farm" }; + + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) + { + + if (command.equalsIgnoreCase("farm")) + { + if(activeChar.isInJail()) + { + activeChar.sendMessage("Sorry,you are in Jail!"); + return false; + } + else if(activeChar.isInOlympiadMode()) + { + activeChar.sendMessage("Sorry,you are in the Olympiad now."); + return false; + } + + else if(activeChar.atEvent) + { + activeChar.sendMessage("Sorry,you are in an event."); + return false; + } + else if (activeChar.isInDuel()) + { + activeChar.sendMessage("Sorry,you are in a duel!"); + return false; + } + else if (activeChar.inObserverMode()) + { + activeChar.sendMessage("Sorry,you are in the observation."); + } + else if (activeChar.isFestivalParticipant()) + { + activeChar.sendMessage("Sorry,you are in a festival."); + return false; + } + if(activeChar.getInventory().getItemByItemId(3470) == null) + { + activeChar.sendMessage("Voce precisa ter Gold Bar para se teleportar."); + return false; + } + int placex; + int placey; + int placez; + + placex = 81304; + placey = 14589; + placez = -3469; + + activeChar.teleToLocation(placex, placey, placez); + activeChar.sendMessage("Voce foi teleportado para Area de Farm!"); + activeChar.getInventory().destroyItemByItemId("Gold Bat", 3470, 1, activeChar, activeChar.getTarget()); + activeChar.sendMessage("Uma quantidade de Gold Bar sua foi usada"); + } + return true; + } + public String[] getVoicedCommandList() + { + return VOICED_COMMANDS; + } + +} Depois adicione em java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java CODE if (Config.SYSTEM_FARM) registerVoicedCommandHandler(new Farm());

Fonte Base: TheEnd
Modificação: TheKon

Espero que gostem

lucas37 está offline   Responder com Citação
O seguinte membro ao lado disse Obrigado(a) a : lucas37 por gostar deste Post :
DS-Dazzel (28-06-2010)