PT_BR = Ola membros do Fórum sou novato, e estou escrevendo esse código mais logo a quanto o tempo termina ele teleporta mais gera muitos erro ao GameServer
Esta funcionando mais queria retirar os erros que da em
Google translator
EN=
The members of the Forum are newbies, and are signing this code sooner in time the teleports finish some more errors to GameServer
This works more wanted removed the errors that in
Model.Foke
Model.Player
Model.Walker
WARNING Exception in a Runnable execution:java.lang.ClassCastException: net.sf.l2j.gameserver.model.actor.instance.Walker cannot be cast to net.sf.l2j.gameserver.model.actor.instance.Player
I haven't tryied the subclass system because i will not use it but i can check it, for sure it has some dublicate ai's in npcdata.txt (two monsters have the same ai) so you need to change them, you can find them from other pack because it's easier that way. I can send you the system, i guess there is no point to send the whole client because my client is changing to c3 but also the pack reads specific files from the system thats why some people may get disconected when they are trying to login. https://www.mediafire.com/file/4nd8fb9nwmfmdb0/System.rar/file
Question
BAN_L2JDev
PT_BR = Ola membros do Fórum sou novato, e estou escrevendo esse código mais logo a quanto o tempo termina ele teleporta mais gera muitos erro ao GameServer
Esta funcionando mais queria retirar os erros que da em
Google translator
EN=
The members of the Forum are newbies, and are signing this code sooner in time the teleports finish some more errors to GameServer This works more wanted removed the errors that inModel.Foke
Model.Player
Model.Walker
WARNING Exception in a Runnable execution:java.lang.ClassCastException: net.sf.l2j.gameserver.model.actor.instance.Walker cannot be cast to net.sf.l2j.gameserver.model.actor.instance.Player
package net.sf.l2j.gameserver.model.zone.type; import java.util.Collection; import java.util.concurrent.ScheduledFuture; import java.util.stream.Collectors; import net.sf.l2j.commons.concurrent.ThreadPool; import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage; import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage.SMPOS; import net.sf.l2j.gameserver.model.actor.Creature; import net.sf.l2j.gameserver.model.actor.instance.Player; import net.sf.l2j.gameserver.model.zone.SpawnZoneType; import net.sf.l2j.gameserver.model.zone.ZoneId; public class EventZone extends SpawnZoneType { protected ScheduledFuture<?> _counterTask = null; protected int _timer = 5 * 60; public EventZone(int id) { super(id); } @Override protected void onEnter(Creature character) { if (character instanceof Player && _counterTask == null) _counterTask = startCounter(); character.setInsideZone(ZoneId.PEACE, true); ThreadPool.schedule(new Runnable() { @Override public void run() { ((Player) character).teleToLocation(83597, 147888, -3405, 0); ((Player) character).sendMessage("Evento Finalizado!"); } }, 1000 * 300); } private ScheduledFuture<?> startCounter() { return ThreadPool.scheduleAtFixedRate(new Counter(), 1000, 1000); } @Override protected void onExit(Creature character) { character.setInsideZone(ZoneId.PEACE, false); if (getPlayers().size() < 1) resetCounter(); } @Override public void onDieInside(Creature character) { } @Override public void onReviveInside(Creature character) { character.setCurrentHp(character.getMaxHp()); character.setCurrentCp(character.getMaxCp()); character.setCurrentMp(character.getMaxMp()); onEnter(character); } public Collection<Player> getPlayers() { return getCharacters().stream().filter(pl -> pl instanceof Player).map(cr -> (Player) cr).collect(Collectors.toList()); } protected void resetCounter() { if (_counterTask != null) { _counterTask.cancel(true); _counterTask = null; } _timer = 5 * 60; } class Counter implements Runnable { protected Counter() { } @Override public void run() { if (_timer < 1) { resetCounter(); return; } for (Player player : getPlayers()) { int minutes = _timer / 60; int second = _timer % 60; String timing = ((minutes < 10) ? ("0" + minutes) : minutes) + ":" + ((second < 10) ? ("0" + second) : second); player.sendPacket(new ExShowScreenMessage("Event Farm: " + timing, 1100, SMPOS.TOP_CENTER, false)); } _timer--; } } }BR= Soucer Acis Atual!
EN= Source Acis
5 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now