
ton3
Members-
Posts
168 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by ton3
-
I changed some things from this code http://www.maxcheaters.com/topic/156243-advanced-party-teleporter/ to make it working for acis, but the zone checker is not working at all, the number of players and parties inside still 0 even when someone is inside. Can someone help? package net.sf.l2j.gameserver.scripting.scripts.custom; import net.sf.l2j.gameserver.cache.HtmCache; import net.sf.l2j.gameserver.datatables.ItemTable; import net.sf.l2j.gameserver.instancemanager.ZoneManager; import net.sf.l2j.gameserver.model.L2Party; import net.sf.l2j.gameserver.model.actor.L2Character; import net.sf.l2j.gameserver.model.actor.L2Npc; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.zone.L2ZoneType; import net.sf.l2j.gameserver.model.zone.type.L2FlagZone; import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate; import net.sf.l2j.gameserver.network.serverpackets.ItemList; import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate; import net.sf.l2j.gameserver.scripting.Quest; /** * @author `Heroin * Made For Maxcheaters.com * PartyTeleporter */ public class PartyTeleporter extends Quest { private static final String qn = "PartyTeleporter"; 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 = -10864; // npc id private static final int locationY = -185526; // npc id private static final int locationZ = -10946; // 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 = 19; //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/html/partychecker/1.htm"; //html location. private static String ItemName = ItemTable.getInstance().createDummyItem(ItemConsumeId).getItemName(); //Item name, Dont Change this public PartyTeleporter() { super(-1, "custom"); 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(L2FlagZone.class)) if (zone.getId() == zoneId) { for (L2Character character : zone.getCharactersInside()) 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(L2FlagZone.class)) if (zone.getId() == zoneId) { for (L2Character character : zone.getCharactersInside()) 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, 0);//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, player, null);//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(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(); System.out.println("Party Teleporter by `Heroin has been loaded successfully!"); } }
-
Does anyone know where can I find these icons code? L2ui.something but I cant find them anywhere, check link for image. http://joxi.ru/BA0n9nXFE61Pmy
-
thanks SweeTs, lock it pls.
-
Does anyone know how make a player teleport outside a zone if he restart inside zone? here is the zone: <zone type="FlagZone" shape="Cylinder" minZ="-10955" maxZ="-9960" rad="11000"> <node X="-15782" Y="-185531" /> </zone> I tried setting this zone to NoRestartZone aswell but if I close the game by ctrl+alt+del and relog in game my char still inside the zone.
-
Help Critical Error With Quest
ton3 replied to torsello's question in Request Server Development Help [L2J]
1.htm check line 22 <br><br><br><tr> I believe u must remove this code <tr> -
Discussion Help Login
ton3 replied to krauser12345's question in Request Server Development Help [Greek]
http://www.maxcheaters.com/topic/194453-help-i-need-a-bit-help-thank-you/ -
Help Add Npc From Sql To Xml
ton3 replied to Kouma's question in Request Server Development Help [L2J]
its not that hard to change sql for xml, just use your default custom npc template and change whatever u want for a new npc. <npc id="36600" displayId="36397" name="Augument Manager" usingServerSideName="true" title="[Server Name]" usingServerSideTitle="true" type="L2Npc"> <collision> <radius normal="8" /> (just change this to adjust your npc) <height normal="25" /> (just change this to adjust your npc) </collision> </npc> -
post your gameserver config.....
-
post your gameserver config.
-
check if gameserver ports are open.
-
ur server is hosted in a lan house? if so I believe u will have to add ur ipv4 address to your friends l2.ini but im not sure tho.
-
Change externalhostname to your public Ip and keep your l2.ini IP address as 127.0.0.1. Give your friends new l2.ini with ur public IP.
-
Help How To Load New Scripts (Acis)
ton3 replied to ton3's question in Request Server Development Help [L2J]
I'm acis customer, wtf. -
how do you load new scripts in acis? since they changed scripts.cfg and when I add new line I get this error http://joxi.ru/krD1L1YIlyKXmp
-
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
Thank you very much for ur patience, working as I wanted and I learned a thing or two from you. -
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
public void updatePvPStatus() { if (isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.FLAG_ZONE)) return; PvpFlagTaskManager.getInstance().add(this, Config.PVP_NORMAL_TIME); if (getPvpFlag() == 0) updatePvPFlag(1); } and public void updatePvPStatus(L2Character target) { final L2PcInstance player = target.getActingPlayer(); if (player == null) return; if (isInDuel() && player.getDuelId() == getDuelId()) return; if ((isInsideZone(ZoneId.FLAG_ZONE) && target.isInsideZone(ZoneId.FLAG_ZONE))) return; if ((!isInsideZone(ZoneId.PVP) || !target.isInsideZone(ZoneId.PVP)) && player.getKarma() == 0) { PvpFlagTaskManager.getInstance().add(this, checkIfPvP(player) ? Config.PVP_PVP_TIME : Config.PVP_NORMAL_TIME); if (getPvpFlag() == 0) updatePvPFlag(1); } } -
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
yes I registered zone and I can see onenter messages: ZoneID.java /* * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. */ package net.sf.l2j.gameserver.model.zone; /** * Zone Ids. * @author Zoey76 */ public enum ZoneId { PVP(0), PEACE(1), SIEGE(2), MOTHER_TREE(3), CLAN_HALL(4), NO_LANDING(5), WATER(6), JAIL(7), MONSTER_TRACK(8), CASTLE(9), SWAMP(10), NO_SUMMON_FRIEND(11), NO_STORE(12), TOWN(13), HQ(14), DANGER_AREA(15), CAST_ON_ARTIFACT(16), NO_RESTART(17), SCRIPT(18), FLAG_ZONE(19); private final int _id; private ZoneId(int id) { _id = id; } public int getId() { return _id; } public static int getZoneCount() { return values().length; } } L2FlagZone.java /* 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 net.sf.l2j.gameserver.model.zone.type; import net.sf.l2j.gameserver.model.actor.L2Character; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.zone.L2ZoneType; import net.sf.l2j.gameserver.model.zone.ZoneId; import net.sf.l2j.gameserver.network.SystemMessageId; public class L2FlagZone extends L2ZoneType { public L2FlagZone(final int id) { super(id); } @Override protected void onEnter(L2Character character) { if (character instanceof L2PcInstance) { L2PcInstance activeChar = ((L2PcInstance) character); activeChar.updatePvPFlag(1); activeChar.sendPacket(SystemMessageId.ENTERED_COMBAT_ZONE); } character.setInsideZone(ZoneId.FLAG_ZONE, true); character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true); } @Override protected void onExit(final L2Character character) { if (character instanceof L2PcInstance) { L2PcInstance activeChar = ((L2PcInstance) character); activeChar.updatePvPFlag(0); activeChar.sendPacket(SystemMessageId.LEFT_COMBAT_ZONE); } character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false); character.setInsideZone(ZoneId.FLAG_ZONE, false); } @Override public void onDieInside(final L2Character character) { } @Override public void onReviveInside(final L2Character character) { } } -
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
well, the same thing is happening. hit player outside zone> enter zone> flag is gone after 15sec and even if u hit flagged player inside zone ur pvp flag doesnt update. -
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
using your code, see what happens when u enter flag_zone while u are flagged. Check the video please. http://youtu.be/ie5pGSj7g58 -
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
I added the pvp check and still not working, flag is gone after 15sec when inside flag_zone. @Override protected void onEnter(L2Character character) { if (character instanceof L2PcInstance) { L2PcInstance activeChar = ((L2PcInstance) character); //set pvpflag if (activeChar.getPvpFlag() == 0) activeChar.updatePvPFlag(1); activeChar.sendMessage("You have entered a chaotic zone."); } character.setInsideZone(ZoneId.FLAG_ZONE, true); character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true); } -
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
yea I want to cancel flag from players who came flagged from outside zone, I will try to explain what is going on below; exit zone > hit a white player > enter zone > ur flag disappears after 30 seconds even if u are inside FLAG_ZONE. -
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
Now im having another problem related to pvp flag when player enter the zone while flagged. I have this code: @Override protected void onEnter(L2Character character) { L2PcInstance activeChar = ((L2PcInstance) character); activeChar.updatePvPFlag(0); activeChar.updatePvPFlag(1); character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true); character.setInsideZone(ZoneId.FLAG_ZONE, true); if (character instanceof L2PcInstance) { activeChar.sendMessage("You have entered a chaotic zone."); } } and still doesnt cancel flag when enter zone, sorry for so many questions but im still learning. -
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
SweeTs, I have to register character to FLAG_ZONE when he enters the zone? like this on flagzone.java protected void onEnter(L2Character character) { L2PcInstance activeChar = ((L2PcInstance) character); character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true); character.setInsideZone(ZoneId.FLAG_ZONE, true); activeChar.updatePvPFlag(1); if (character instanceof L2PcInstance) { activeChar.sendMessage("You have entered a chaotic zone."); } } Edit: working 100% thank you -
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
public void updatePvPStatus(L2Character target) { final L2PcInstance player = target.getActingPlayer(); if (player == null) return; if (isInDuel() && player.getDuelId() == getDuelId()) return; if ((!isInsideZone(ZoneId.FLAG_ZONE) || !target.isInsideZone(ZoneId.FLAG_ZONE))) return; if ((!isInsideZone(ZoneId.PVP) || !target.isInsideZone(ZoneId.PVP)) && player.getKarma() == 0) { PvpFlagTaskManager.getInstance().add(this, checkIfPvP(player) ? Config.PVP_PVP_TIME : Config.PVP_NORMAL_TIME); if (getPvpFlag() == 0) updatePvPFlag(1); } } this worked but im wondering if I will have any problem with this? Edit: Yes I will have problems when outside FLAG_ZONE, removing return; would fix it? Edit2: Removing return; didnt fix, I dont know what else to, if anyone could help I would be grateful! -
Help Pvp Flag Time Inside Zone
ton3 replied to ton3's question in Request Server Development Help [L2J]
what check? this? if (isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.FLAG_ZONE))