» Find Revision
L2J Revision Number:
L2JDP Revision Number:
I have made a customs for halls and i created a .java based on another file i saw in the internet... but i have syntaxes errors...
Can anyone help me?
someone like this:
setInstanceType(InstanceType.L2ClanHallDoormenInstance);
player.sendPacket(ActionFailed.STATIC_PACKET);
html.setFile(player.getHtmlPrefix(), "data/html/clanHallDoormen/doormen-tele.htm");
protected final void openDoors(L2PcInstance player, String command)
protected final void closeDoors(L2PcInstance player, String command)
Location _loc = getClanHall().getZone().getChaoticSpawnLoc();
private final ClanHall getClanHall()
protected final boolean isOwnerClan(L2PcInstance player)
In red the syntax error. (i dont put the code because you can't see the colors.)
I think that i wrote wrong that parameters, but i don't know where i have to look for them...
(if someone need the .java file i coded it below)
Code: Select all
* 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.actor.instance; import net.sf.l2j.gameserver.datatables.ClanTable;import net.sf.l2j.gameserver.datatables.MapRegionTable;import net.sf.l2j.gameserver.instancemanager.ClanHallManager;import net.sf.l2j.gameserver.model.L2Clan;import net.sf.l2j.gameserver.model.Location;import net.sf.l2j.gameserver.model.entity.ClanHall;import net.sf.l2j.gameserver.serverpackets.ActionFailed;import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;import net.sf.l2j.gameserver.templates.L2NpcTemplate; public class L2ClanHallTeleporterInstance extends L2DoormenInstance{ private boolean _init = false; private ClanHall _clanHall = null; public L2ClanHallTeleporterInstance(int objectID, L2NpcTemplate template) { super(objectID, template); setInstanceType(InstanceType.L2ClanHallDoormenInstance); } @Override public void showChatWindow(L2PcInstance player) { player.sendPacket(ActionFailed.STATIC_PACKET); NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); if (getClanHall() != null) { L2Clan owner = ClanTable.getInstance().getClan(getClanHall().getOwnerId()); if (isOwnerClan(player)) { html.setFile(player.getHtmlPrefix(), "data/html/clanHallDoormen/doormen-tele.htm"); html.replace("%clanname%", owner.getName()); } else { if (owner != null && owner.getLeader() != null) { html.setFile(player.getHtmlPrefix(), "data/html/clanHallDoormen/doormen-no.htm"); html.replace("%leadername%", owner.getLeaderName()); html.replace("%clanname%", owner.getName()); } else { html.setFile(player.getHtmlPrefix(), "data/html/clanHallDoormen/emptyowner.htm"); html.replace("%hallname%", getClanHall().getName()); } } } else return; html.replace("%objectId%", String.valueOf(getObjectId())); player.sendPacket(html); } @Override protected final void openDoors(L2PcInstance player, String command) { Location _loc = getClanHall().getZone().getSpawnLoc(); if (_loc != null) { player.teleToLocation(_loc, false); if (player.getPet() != null) player.getPet().teleToLocation(_loc, false); } } @Override protected final void closeDoors(L2PcInstance player, String command) { Location _loc = getClanHall().getZone().getChaoticSpawnLoc(); if (_loc != null) { player.teleToLocation(_loc, false); if (player.getPet() != null) player.getPet().teleToLocation(_loc, false); } else { player.teleToLocation(MapRegionTable.TeleportWhereType.Town); if (player.getPet() != null) player.getPet().teleToLocation(MapRegionTable.TeleportWhereType.Town); } } private final ClanHall getClanHall() { if (!_init) { synchronized (this) { if (!_init) { _clanHall = ClanHallManager.getInstance().getNearbyClanHall(getX(), getY(), 500); _init = true; } } } return _clanHall; } @Override protected final boolean isOwnerClan(L2PcInstance player) { if (player.getClan() != null && getClanHall() != null) { if (player.getClanId() == getClanHall().getOwnerId()) return true; } return false; }