Ir para conteúdo
  • Cadastre-se

L2Angel

Membro
  • Total de itens

    92
  • Registro em

  • Última visita

2 Seguidores

Sobre L2Angel

Últimos Visitantes

3960 visualizações

L2Angel's Achievements

Aprendiz de Novato

Aprendiz de Novato (1/14)

3

Reputação

  1. A solução para o seu problema. [Hidden Content]
  2. L2Angel

    Adaptação FakePlayers

    Peço desculpas, só fiz pois vi que o pessoal andou fazendo e vc ajudou. Se tivesse dito isso nos posts que fizeram com certeza eu não teria feito! Removido.
  3. Alguém poderia dar uma olhada no código que adaptei para Frozen? Estou começando, não sou um expert em java então creio que possa ter coisas erradas no código mas funcionou. :feliz: O único problema que venho tendo é um erro no gameserver. Me parece que quanto ele vai executar o "AutoSaveManager" recebo o erro da imagem. Abaixo segue o erro, o código original e no final meu código. Obs: Não sei como diminuir as caixas com os códigos. Desde já obrigado! ERRO Código original retirado de um Forum Russo Index: java/com/descja/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/com/descja/gameserver/model/actor/instance/L2PcInstance.java (revision 38) +++ java/com/descja/gameserver/model/actor/instance/L2PcInstance.java (revision 38) private long _chatBanTimer = 0L; private ScheduledFuture<?> _chatBanTask = null; private boolean _isOffline = false; + private boolean _isFakePlayer = false; public void setOffline(boolean set) { _isOffline = set; } + public boolean isFakePlayer() + { + return _isFakePlayer; + } =================================================================== Index: java/com/descja/FakePlayers.java =================================================================== --- java/com/descja/FakePlayers.java (revision 0) +++ java/com/descja/FakePlayers.java (revision 0) package com.descja; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.network.L2GameClient; import com.l2jfrozen.gameserver.network.L2GameClient.GameClientState; import com.l2jfrozen.gameserver.thread.LoginServerThread; import com.l2jfrozen.util.ResourceUtil; import com.l2jfrozen.util.database.L2DatabaseFactory; public class FakePlayers { private static final Log _log = LogFactory.getLog(FakePlayers.class.getName()); private static final String CLEAR_OFFLINE_TABLE = "DELETE FROM fake_players"; private static final String LOAD_OFFLINE_STATUS = "SELECT * FROM fake_players"; private static FakePlayers _instance; public static FakePlayers getInstance() { if(_instance == null) { _instance = new FakePlayers(); } return _instance; } private FakePlayers() { storeFakePlayers(); } public static void storeFakePlayers() { _log.info("FakePlayers: Activated"); Connection con = null; int nPlayers = 0; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement stm = con.prepareStatement(LOAD_OFFLINE_STATUS); ResultSet rs = stm.executeQuery(); while(rs.next()) { L2PcInstance player = null; try { L2GameClient client = new L2GameClient(null); player = L2PcInstance.load(rs.getInt("charId")); client.setActiveChar(player); client.setAccountName(player.getAccountNamePlayer()); client.setState(GameClientState.IN_GAME); player.setClient(client); player.isFakePlayer(); player.spawnMe(player.getX(), player.getY(), player.getZ()); LoginServerThread.getInstance().addGameServerLogin(player.getAccountName(), client); if(Config.FAKE_PLAYERS_SIT) { player.sitDown(); } player.setOnlineStatus(true); player.restoreEffects(); player.broadcastUserInfo(); nPlayers++; } catch(Exception e) { _log.error("Fake Players Engine: Error loading player: "+player,e); if(player != null) { player.deleteMe(); } } } rs.close(); stm.close(); _log.info("Loaded: " +nPlayers+ " Fake Players"); } catch(Exception e) { _log.error("Fake Players Engine : Error while loading player: ",e); } finally { ResourceUtil.closeConnection(con); } } } =================================================================== Index: java/com/descja/gameserver/GameServer.java =================================================================== --- java/com/descja/gameserver/GameServer.java (revision 53) +++ java/com/descja/gameserver/GameServer.java (revision 53) +import com.l2jfrozen.FakePlayers; private static void loadCharacters() { Util.printSection("Characters"); ClanTable.getInstance(); CharTemplateTable.getInstance(); LevelUpData.getInstance(); } + //DescJa Fake Players// + private static void loadWhiteAttack() + { + if(Config.FAKE_PLAYERS) + { + Util.printSection("Fake Characters"); + FakePlayers.getInstance(); + } + } + //DescJa Fake Players// =================================================================== Index: java/com/descja/Config.java =================================================================== --- java/com/descja/Config.java (revision 162) +++ java/com/descja/Config.java (revision 162) + /*DescJa*/ + public static boolean FAKE_PLAYERS_SIT; + public static boolean FAKE_PLAYERS; + //FakePlayers.ini// + public static void FakePlayersConfig() + { + try + { + L2Properties p = new L2Properties(ConfigFiles.FakePlayers_INI); + + FAKE_PLAYERS = TypeFormat.parseBoolean(FakePlayers.getProperty("FakePlayers", "False")); + FAKE_PLAYERS_SIT = TypeFormat.parseBoolean(FakePlayers.getProperty("FakePlayersSit", "False")); + + p.clear(); + } + catch(Exception e) + { + _log.warn("Failed to load " + ConfigFiles.FakePlayers_INI); + } + } + /*DescJa*/ =================================================================== Index: java/com/descja/util/services/ConfigFiles.java =================================================================== --- java/com/descja/util/services/ConfigFiles.java +++ java/com/descja/util/services/ConfigFiles.java + public static final String FakePlayers_INI = "./config/FakePlayers.ini"; =================================================================== Index: config/FakePlayers.ini =================================================================== --- config/FakePlayers.ini +++ config/FakePlayers.ini +#============================================ +# Fake Players Mod # +#============================================ + +# Enable Fake Players System +# Default: False +FakePlayers = False + +# Fake Players Sit Down +# Default: False +FakePlayersSit = False CREATE TABLE `fake_players` ( `charId` decimal(11,0) NOT NULL DEFAULT '0', PRIMARY KEY (`charId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Minha adaptação para L2jFrozen Index: java/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 38) +++ java/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 38) /** The _is offline. */ private boolean _isInOfflineMode = false; + private boolean _isFakePlayer = false; public void setOfflineMode(final boolean set) { _isInOfflineMode = set; } + public boolean isFakePlayer() + { + return _isFakePlayer; + } =================================================================== Index: java/com/l2jfrozen/FakePlayers.java =================================================================== --- java/com/l2jfrozen/FakePlayers.java (revision 0) +++ java/com/l2jfrozen/FakePlayers.java (revision 0) package com.l2jfrozen; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.network.L2GameClient; import com.l2jfrozen.gameserver.network.L2GameClient.GameClientState; import com.l2jfrozen.gameserver.thread.LoginServerThread; import com.l2jfrozen.util.CloseUtil; import com.l2jfrozen.util.database.L2DatabaseFactory; public class FakePlayers { private static final Log _log = LogFactory.getLog(FakePlayers.class.getName()); private static final String CLEAR_OFFLINE_TABLE = "DELETE FROM fake_players"; private static final String LOAD_OFFLINE_STATUS = "SELECT * FROM fake_players"; private static FakePlayers _instance; public static FakePlayers getInstance() { if(_instance == null) { _instance = new FakePlayers(); } return _instance; } private FakePlayers() { storeFakePlayers(); } public static void storeFakePlayers() { _log.info("FakePlayers: Activated"); Connection con = null; int nPlayers = 0; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement stm = con.prepareStatement(LOAD_OFFLINE_STATUS); ResultSet rs = stm.executeQuery(); while(rs.next()) { L2PcInstance player = null; try { L2GameClient client = new L2GameClient(null); player = L2PcInstance.load(rs.getInt("charId")); client.setActiveChar(player); client.setAccountName(player.getAccountName()); client.setState(GameClientState.IN_GAME); player.setClient(client); player.isFakePlayer(); player.spawnMe(player.getX(), player.getY(), player.getZ()); LoginServerThread.getInstance().addGameServerLogin(player.getAccountName(), client); if(Config.FAKE_PLAYERS_SIT) { player.sitDown(); } player.setOnlineStatus(true); player.restoreEffects(); player.broadcastUserInfo(); nPlayers++; } catch(Exception e) { _log.error("Fake Players Engine: Error loading player: "+player,e); if(player != null) { player.deleteMe(); } } } rs.close(); stm.close(); _log.info("Loaded: " +nPlayers+ " Fake Players"); } catch(Exception e) { _log.error("Fake Players Engine : Error while loading player: ",e); } finally { CloseUtil.close(con); } } } =================================================================== Index: java/com/l2jfrozen/gameserver/GameServer.java =================================================================== --- java/com/l2jfrozen/gameserver/GameServer.java (revision 53) +++ java/com/l2jfrozen/gameserver/GameServer.java (revision 53) +import com.l2jfrozen.FakePlayers; import com.l2jfrozen.gameserver.model.entity.Hero; import com.l2jfrozen.gameserver.model.entity.MonsterRace; { ClanTable.getInstance(); CharTemplateTable.getInstance(); LevelUpData.getInstance(); } + //DescJa Fake Players// + { + if(Config.FAKE_PLAYERS) + { + Util.printSection("Fake Characters"); + FakePlayers.getInstance(); + } + } + //DescJa Fake Players// =================================================================== Index: java/com/l2jfrozen/Config.java =================================================================== --- java/com/l2jfrozen/Config.java (revision 162) +++ java/com/l2jfrozen/Config.java (revision 162) LOGGER.info("[Aio System]: invalid config property in " + OTHER + " -> AioSkills \"" + skillSplit[0] + "\"" + skillSplit[1]); } } } } /*DescJa*/ + FAKE_PLAYERS = Boolean.parseBoolean(otherSettings.getProperty("FakePlayers", "False")); + FAKE_PLAYERS_SIT = Boolean.parseBoolean(otherSettings.getProperty("FakePlayersSit", "False")); STARTING_ADENA = Integer.parseInt(otherSettings.getProperty("StartingAdena", "100")); STARTING_AA = Integer.parseInt(otherSettings.getProperty("StartingAncientAdena", "0")); =================================================================== Index: config/FakePlayers.ini =================================================================== --- config/head/other.properties +++ config/head/other.properties # Click task when target an Npc # Leave as default if you don't know what you are changing # Default: 50 ClickTask = 50 +#============================================ +# Fake Players Mod # +#============================================ + +# Enable Fake Players System +# Default: False +FakePlayers = False + +# Fake Players Sit Down +# Default: False +FakePlayersSit = False CREATE TABLE `fake_players` ( `charId` decimal(11,0) NOT NULL DEFAULT '0', PRIMARY KEY (`charId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  4. Estou com um probleminha no TVT da Frozen, O top looser não recebe premio mesmo estando no time vencedor, até aí tudo bem.. Mas o problema é que o evento está calculando as mortes do player referente a todos os eventos que ele foi no dia.. As vezes o tvt acaba com o cara tendo mais mortes do que o outro time matou.. Alguém pode me dizer onde eu retiro a parte do top looser no java? Para que ele não apareça o anuncio e nem deixe de dar o premio a ele. Vlw
  5. Conseguiram resolver? Estou com o mesmo problema, tudo funcionando mas quando munto nele, fica marrom! :T
  6. L2Angel

    Adaptar VIP mod

    é só substituir o _log por LOGGER no código
  7. L2Angel

    Adaptar VIP mod

    huahuah, eu consegui adaptar. O Donator realmente é mt bom, mas a questão do tempo ajuda a manter o servidor! Vlw pela ajuda ae.
  8. L2Angel

    Npc sound

    Galera, como coloco som em um npc? Ex. baixei um npc custom, está funcionando perfeitamente.. Porém quando ele anda ou bate não faz som algum. Tentei copiar de outro NPC no arquivo npcgrp.dat e não obtive sucesso, alguém pode dar uma luz?
  9. Manero, tem como por som neles? Pois são mudos quando andam batem etc..
  10. L2Angel

    Adaptar VIP mod

    Apenas o Aio, o Vip não.. Lá tem o Donator mas não da para definir tempo.
  11. L2Angel

    Adaptar VIP mod

    Alguém poderia ajudar a adaptar este mod para a nova rev. da L2jFrozen? Estou tendo alguns erros no Eclipse. [Hidden Content]
  12. L2Angel

    Vote Reward System

    Sim, os comandos eu notei porem apenas votar e usar os comandos não funciona.. Enfim, pelo que li no forum do L2jFrozen, me parece que existe um problema com HopZone e TopZone no próprio código..
  13. Alguém pode me explicar como funciona este VoteSystem que vem na L2jFrozen? Após configurar como procede dentro do jogo? Vlw
×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.