Jump to content
The search index is currently processing. Activity stream results may not be complete.

All Activity

This stream auto-updates     

  1. Past hour
  2. 1. Create a new java file on data/scripts/custom/PartyTeleporter/PartyTeleporter.java package custom.PartyTeleporter; import com.l2jserver.gameserver.cache.HtmCache; import com.l2jserver.gameserver.datatables.ItemTable; import com.l2jserver.gameserver.instancemanager.ZoneManager; import com.l2jserver.gameserver.model.L2Party; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.zone.L2ZoneType; import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate; import com.l2jserver.gameserver.network.serverpackets.ItemList; import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jserver.gameserver.network.serverpackets.StatusUpdate; /** * @author `Heroin * Made For Maxcheaters.com * PartyTeleporter */ public class PartyTeleporter extends Quest { private static final int npcid = 36650; // npc id //------------------------------------- //Teleport Location Coordinates X,Y,Z. //Use /loc command in game to find them. private static final int locationX = -56742; // npc id private static final int locationY = 140569; // npc id private static final int locationZ = -2625; // npc id //------------------------------------- //------------------------------------- // Select the id of your zone. // If you dont know how to find your zone id is simple. // Go to data/zones/(your zone file).xml and find your zone // E.g: <zone name="dion_monster_pvp" id="6" type="ArenaZone" shape="NPoly" minZ="-3596" maxZ="0"> /**The id of your zone is id="6" */ /**---------------------------------------------------------------------------*/ /**WARNING: If your zone does not have any id or your location is not on any zone in data/zones/ folder, you have to add one by your self*/ // required to calculate parties & players /**---------------------------------------------------------------------------*/ private static final int ZoneId = 155; //Here you have to set your zone Id //------------------------------------- private static final int MinPtMembers = 2; // Minimum Party Members Count For Enter on Zone. private static final int ItemConsumeId = 57; // Item Consume id. private static final int ItemConsumeNum = 100; // Item Consume Am.ount. private static final boolean ShowPlayersInside = true; //If you set it true, NPC will show how many players are inside area. private static final boolean ShowPartiesInside = true; //If you set it true, NPC will show how many parties are inside area. //------------------------------------- private static String htm = "data/scripts/custom/PartyTeleporter/1.htm"; //html location. private static String ItemName = ItemTable.getInstance().createDummyItem(ItemConsumeId).getItemName(); //Item name, Dont Change this public PartyTeleporter(int questId, String name, String descr) { super(questId, name, descr); addFirstTalkId(npcid); addTalkId(npcid); addStartNpc(npcid); } @Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { if (event.startsWith("partytp")) { TP(event, npc, player, event); } return ""; } @SuppressWarnings("deprecation") public int getPartiesInside(int zoneId)//Calculating parties inside party area. { int i = 0; for (L2ZoneType zone : ZoneManager.getInstance().getAllZones()) if (zone.getId() == zoneId) { for (L2Character character : zone.getCharactersInside().values()) if (character instanceof L2PcInstance && (!((L2PcInstance) character).getClient().isDetached()) && ((L2PcInstance) character).getParty() != null && ((L2PcInstance) character).getParty().isLeader((L2PcInstance) character)) i++; } return i; } @SuppressWarnings("deprecation") public int getPlayerInside(int zoneId)//Calculating players inside party area. { int i = 0; for (L2ZoneType zone : ZoneManager.getInstance().getAllZones()) if (zone.getId() == zoneId) { for (L2Character character : zone.getCharactersInside().values()) if (character instanceof L2PcInstance && (!((L2PcInstance) character).getClient().isDetached())) i++; } return i; } private boolean PartyItemsOk(L2PcInstance player) //Checks if all party members have the item in their inventory. //If pt member has not enough items, party not allowed to enter. { try { for (L2PcInstance member : player.getParty().getPartyMembers()) { if (member.getInventory().getItemByItemId(ItemConsumeId) == null) { player.sendMessage("Your party member "+member.getName()+" does not have enough items."); return false; } if (member.getInventory().getItemByItemId(ItemConsumeId).getCount() < ItemConsumeNum) { player.sendMessage("Your party member "+member.getName()+" does not have enough items."); return false; } } return true; } catch (Exception e) { player.sendMessage("Something went wrong try again."); return true; } } private void proccessTP(L2PcInstance player) // Teleporting party members to zone { for (L2PcInstance member : player.getParty().getPartyMembers()) { member.teleToLocation(locationX, locationY, locationZ);//Location X, Y ,Z } } private void TP(String event, L2Npc npc, L2PcInstance player, String command) // Teleport player & his party { try { L2Party pt = player.getParty(); if (pt == null) { player.sendMessage("You are not currently on party."); return; } if (!pt.isLeader(player)) { player.sendMessage("You are not party leader."); return; } if (pt.getMemberCount() < MinPtMembers) { player.sendMessage("You are going to need a bigger party " + "in order to enter party area."); return; } if (!PartyItemsOk(player)) { return; } else { proccessTP(player); for (L2PcInstance ppl : pt.getPartyMembers()) { if (ppl.getObjectId() != player.getObjectId())//Dont send this message to pt leader. { ppl.sendMessage("Your party leader asked to teleport on party area!");//Message only to party members } ppl.sendMessage(ItemConsumeNum+" "+ItemName+" have been dissapeared.");//Item delete from inventory message ppl.getInventory().destroyItemByItemId("Party_Teleporter", ItemConsumeId, ItemConsumeNum, ppl, true);//remove item from inventory ppl.sendPacket(new InventoryUpdate());//Update ppl.sendPacket(new ItemList(ppl, false));//Update ppl.sendPacket(new StatusUpdate(ppl));//Update } //Sends message to party leader. player.sendMessage(ItemConsumeNum*player.getParty().getMemberCount()+" "+ItemName+" dissapeard from your party."); } } catch (Exception e) { player.sendMessage("Something went wrong try again."); } } @Override public String onFirstTalk(L2Npc npc, L2PcInstance player) { final int npcId = npc.getNpcId(); if (player.getQuestState(getName()) == null) { newQuestState(player); } if (npcId == npcid) { String html = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), htm); html = html.replaceAll("%player%", player.getName());//Replaces %player% with player name on html html = html.replaceAll("%itemname%", ItemName);//Item name replace on html html = html.replaceAll("%price%", player.getParty()!=null ? ""+ItemConsumeNum*player.getParty().getMemberCount()+"": "0");//Price calculate replace html = html.replaceAll("%minmembers%", ""+MinPtMembers);//Mimum entry party members replace html = html.replaceAll("%allowed%", isAllowedEnter(player) ? "<font color=00FF00>allowed</font>" : "<font color=FF0000>not allowed</font>");//Condition checker replace on html html = html.replaceAll("%parties%", ShowPartiesInside ? "<font color=FFA500>Parties Inside: "+getPartiesInside(ZoneId)+"</font><br>": "");//Parties inside html = html.replaceAll("%players%", ShowPlayersInside ? "<font color=FFA500>Players Inside: "+getPlayerInside(ZoneId)+"</font><br>": "");//Players Inside NpcHtmlMessage npcHtml = new NpcHtmlMessage(0); npcHtml.setHtml(html); player.sendPacket(npcHtml); } return ""; } private boolean isAllowedEnter(L2PcInstance player) //Checks if player & his party is allowed to teleport. { if (player.getParty() != null) { if( player.getParty().getMemberCount() >= MinPtMembers && PartyItemsOk(player))//Party Length & Item Checker { return true; } else { return false; } } else { return false; } } public static void main(final String[] args) { new PartyTeleporter(-1, PartyTeleporter.class.getSimpleName(), "custom"); System.out.println("Party Teleporter by `Heroin has been loaded successfully!"); } } 2.Create a new htm file on data/scripts/custom/PartyTeleporter/1.htm <html> <title>%player%</title> <body><center> <img src="L2UI_CH3.herotower_deco" width=256 height=32></center><br> You have to be a party leader in order to ask from me to teleport you and your party inside party area.<br> Minimum Number Of Party Members: <font color="LEVEL">%minmembers%</font>.<br> You are currently %allowed% to enter party area with your party.<br> Party Teleport will cost you total: <font color="LEVEL">%price% %itemname%</font><br> <center> %parties% %players% <table><tr> <td><button value="Teleport Me & My Party!" action="bypass -h Quest PartyTeleporter partytp" width=180 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> </tr></table> <br><br> <center> <img src="L2UI_CH3.herotower_deco" width=256 height=32></center> </body></html> 3. Add script on scripts.cfg file: custom/PartyTeleporter/PartyTeleporter.java 4. Run this query on your database or install the NPC by yourself. INSERT INTO `npc` VALUES ('36650', '13173', 'PartyTeleporter', '1', 'MaxCheaters.com', '1', 'LineageNPC.clear_npc', '8.00', '19.00', '85', 'male', 'L2Npc', null, null, null, null, null, '40', '43', '30', '21', '20', '20', '0', '0', null, null, null, null, '230', '1', '0', '333', '0', '0', '0', '60.00000', '120.00000', '1', '1', '0', '0'); How to Modify: Check Variables on code: private static final int npcid = 36650; // npc id //------------------------------------- //Teleport Location Coordinates X,Y,Z. //Use /loc command in game to find them. private static final int locationX = -56742; // npc id private static final int locationY = 140569; // npc id private static final int locationZ = -2625; // npc id //------------------------------------- //------------------------------------- // Select the id of your zone. // If you dont know how to find your zone id is simple. // Go to data/zones/(your zone file).xml and find your zone // E.g: <zone name="dion_monster_pvp" id="6" type="ArenaZone" shape="NPoly" minZ="-3596" maxZ="0"> /**The id of your zone is id="6" */ /**---------------------------------------------------------------------------*/ /**WARNING: If your zone does not have any id or your location is not on any zone in data/zones/ folder, you have to add one by your self*/ // required to calculate parties & players /**---------------------------------------------------------------------------*/ private static final int ZoneId = 155; //Here you have to set your zone Id //------------------------------------- private static final int MinPtMembers = 2; // Minimum Party Members Count For Enter on Zone. private static final int ItemConsumeId = 57; // Item Consume id. private static final int ItemConsumeNum = 100; // Item Consume Am.ount. private static final boolean ShowPlayersInside = true; //If you set it true, NPC will show how many players are inside area. private static final boolean ShowPartiesInside = true; //If you set it true, NPC will show how many parties are inside area. //------------------------------------- private static String htm = "data/scripts/custom/PartyTeleporter/1.htm"; //html location. Alguem adapta pramin fazendo favo ?
  3. Yesterday
  4. Jadson Kewinn

    ADENA

    tenho minha soucer mais nao estou conseguindo colocar no eclipse para mexer ......
  5. ne kk tem como me ajudar? eu nao estou conseguindo colocar minha soucer no eclipse de jeito nenhum aff
  6. Brayan000

    ADENA

    Isso vc consegue alterar no core, caso tenha acesso...
  7. Exato. vírus = formatação, easy. ainda mais windows 10, aperta um botão o computador se auto-formata sem você mover um dedo
  8. Mesmo assim, bacana! Valeu por compartilhar!
  9. dodo_10

    L2j

    Boa Tarde Pessoal Gostaria De Esclarecer Uma Duvida Estou Pensando Em Abrir Um Servidor Porém Não To Com Tanta Grana Pra Comprar Um L2OFF Gostaria De Saber Na Opinião De Vocês Qual Projeto Está Compensando Mais Comprar L2J E Qual Free Indicam Tbm Desde Ja Muito Obrigado OBS CLIENTE INTERLUDE
  10. Poderia me informar qual java 10 eu uso , se poder postar o link correto para download eu agradeço por que o java jdk 10.0.2 deu erro com o eclipse
  11. Grand Opening - May 5 - 20:00 +2 GMT Website: http://l2neverland.com
  12. como e onde eu modifico esse arquivo é no servidor ou no cliente direto?
  13. Putz, e eu procurando aqui que nem um louco pra poder adicionar a restrição de sub-class de dark elfo e elfo. Uma pena ter perdido a source, tô editando ele pra colocar on para uns amigos meus jogarem. Edit: Esse Shield Imperial Walord Zombie não consegui achar ele nos item id, c lembra qual é? Edit2: Como faz para ativar o consumo de SS? Legal esse seu sistema de SS infinita mas é só uma dúvida
  14. copia o conteúdo de dentro da pasta jdk-10.0.2 e cola dentro da pasta jre-10.0.2 substituindo os arquivos.......
  15. Desistalei o java 8 e instalei o java 10.0.2 e agora so da erro
  16. Né que o negócio parece mermo, lamentável.
  17. tem animação porem tá com aquele mesmo bug das outras não fica 100% centralizado
  18. Você precisa compilar com o Java 10.
  19. Man to quase , me ajudem aqui , tentei compilar por Gradle , porem nao tem opcao ai tentei normalmente pelo build.xml , mais da esse erro o que eu faço aqui ?
  20. No meu da isso alguem pode me dar uma luz ? como não tem a buildgradle pra clicar , so tem o build.xml como faço agora , por que tentei compilar pelo build.xml e da erro ai na imagem abaixo
  1. Load more activity



     



  • Newsletter

    Want to keep up to date with all our latest news and information?

    Sign Up
×
×
  • Create New...