O fórum teve que ser recriado do zero, usuários do fórum antigo precisam se cadastrar novamente e caso você seja usuário vip se identifique perante a um administrador que o status vip será reatribuído..

Welcome to L2JDream Project

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Zeit

Membro VIP
  • Content count

    2
  • Joined

  • Last visited

  • Days Won

    1

Zeit last won the day on September 18

Zeit had the most liked content!

Community Reputation

1 Neutral

About Zeit

  • Rank
    Newbie
  • Birthday 06/17/1993

Recent Profile Visitors

69 profile views
  1. Todo mundo tem o mesmo problema com geodata: Com esta solução, o personagem retorna ao ponto anterior. Pack: com.dream.game.network.clientpackets.ValidatePosition; Change for this: package com.dream.game.network.clientpackets; import org.apache.log4j.Logger; import com.dream.Config; import com.dream.game.geodata.GeoEngine; import com.dream.game.model.actor.instance.L2PcInstance; import com.dream.game.network.serverpackets.MoveToLocation; import com.dream.game.network.serverpackets.PartyMemberPosition; import com.dream.game.network.serverpackets.ValidateLocation; import com.dream.game.network.serverpackets.ValidateLocationInVehicle; import com.dream.game.util.Broadcast; public class ValidatePosition extends L2GameClientPacket { private static Logger LOGGER = Logger.getLogger(ValidatePosition.class); private int _x, _y, _z, _heading; @SuppressWarnings("unused") private int _data; @Override protected void readImpl() { _x = readD(); _y = readD(); _z = readD(); _heading = readD(); _data = readD(); } @Override protected void runImpl() { L2PcInstance activeChar = getClient().getActiveChar(); if (activeChar == null || activeChar.isTeleporting()) return; activeChar.checkSummon(); int realX = activeChar.getX(); int realY = activeChar.getY(); int realZ = activeChar.getZ(); if (_x == 0 && _y == 0) if (realX != 0) return; activeChar.setHeading(_heading); double dx = _x - realX; double dy = _y - realY; double dz = _z - realZ; int finalZ = _z; if (Math.abs(dz) <= 200) { finalZ = realZ; } double diffSq = dx * dx + dy * dy; double speedsq = activeChar.getStat().getMoveSpeed() * activeChar.getStat().getMoveSpeed(); if (diffSq <= speedsq * 1.5 && dz < 1500) { activeChar.setLastServerPosition(realX, realY, realZ); activeChar.getPosition().setXYZ(_x, _y, _z); if (activeChar.getParty() != null) { activeChar.setLastPartyPosition(_x, _y, _z); activeChar.getParty().broadcastToPartyMembers(activeChar, new PartyMemberPosition(activeChar)); } if (activeChar.isInBoat()) { Broadcast.toKnownPlayers(activeChar, new ValidateLocationInVehicle(activeChar)); } else { Broadcast.toKnownPlayers(activeChar, new ValidateLocation(activeChar)); } } // COORD Client<-->Server synchronization switch (Config.COORD_SYNCHRONIZE) { case 1: { // full synchronization Client --> Server // only * using this option it is difficult // for players to bypass obstacles if (!activeChar.isMoving() || !activeChar.validateMovementHeading(_heading)) // Heading changed on client = possible obstacle { // character is not moving, take coordinates from client if (diffSq < 2500) { // 50*50 - attack won't work fluently if even small differences are corrected activeChar.getPosition().setXYZ(realX, realY, finalZ); } else { activeChar.getPosition().setXYZ(_x, _y, finalZ); } } else { activeChar.getPosition().setXYZ(realX, realY, finalZ); } activeChar.setHeading(_heading); } break; case 2: { // full synchronization Server --> Client (bounces for validation) if (Config.GEODATAS > 0 && (diffSq > 250000 || Math.abs(dz) > 200)) { if (Math.abs(dz) > 200) { if (Math.abs(finalZ - activeChar.getClientZ()) < 800) { activeChar.getPosition().setXYZ(realX, realY, finalZ); } } else { if (!activeChar.isMoving()) { if (activeChar.isInBoat()) sendPacket(new ValidateLocationInVehicle(activeChar)); else sendPacket(new ValidateLocation(activeChar)); } else if (diffSq > activeChar.getStat().getMoveSpeed()) activeChar.broadcastPacket(new MoveToLocation(activeChar)); finalZ = activeChar.getPosition().getZ(); } } } break; case -1: { // just (client-->server) Z coordination if (Math.abs(dz) > 200) { if (Math.abs(_z - activeChar.getClientZ()) < 800) activeChar.getPosition().setXYZ(realX, realY, finalZ); } else finalZ = realZ; } break; default: case 0: { // no synchronization at all // the server has the correct information finalZ = realZ; } break; } // EXPERIMENTAL fix when players cross the floor adapted By Zeit int deltaZ = activeChar.getZ() - _z; if(deltaZ > 1024) { int zLocation = GeoEngine.getInstance().getHeight(activeChar.getX(), activeChar.getY(), activeChar.getZ()); activeChar.teleToLocation(activeChar.getX(), activeChar.getY(), zLocation); LOGGER.info("Player " + activeChar.getName() + " has fallen more than 1024 units, returned to last position (" + activeChar.getX() + ", " + activeChar.getY() + ", " + zLocation + ")"); return; } // check water if (Config.ALLOW_WATER) activeChar.checkWaterState(); } } Config.java public static String IGNORE_LOG; public static boolean FALLDOWNONDEATH; +public static int COORD_SYNCHRONIZE; public static int DELETE_DAYS; LAZY_ITEMS_UPDATE = Boolean.parseBoolean(p.getProperty("LazyItemsUpdate", "false")); +COORD_SYNCHRONIZE = Integer.parseInt(p.getProperty("CoordSynchronize", "-1")); SERVER_GMONLY = Boolean.parseBoolean(p.getProperty("ServerGMOnly", "false")); game\config\main.options: # A type of synchronization between the client and the server location # -1 - Will synchronize only Z from Client --> Server. Default when no geodata. # 1 - Synchronization Client --> Server only. Using this option (without geodata) it is more difficult for players to bypass obstacles # 2 - Intended for geodata (at least when cell-level pathfinding, otherwise can try -1 also)! # It is advisable not to change CoordSynchronize = -1 PcInstance: private int clientZ; /** * Gets the client z. * @return the client z */ public final int getClientZ() { return clientZ; }
  2. File Name: "classDamages.properties" Location: game\config\main #Damages to Fighters Duelist__ToFighter=0.8 DreadNought__ToFighter=1.0 Phoenix_Knight__ToFighter=1.0 Hell_Knight__ToFighter=1.0 Sagittarius__ToFighter=1.0 Adventurer__ToFighter=0.8 Archmage__ToFighter=1.0 Soultaker__ToFighter=1.0 Arcana_Lord__ToFighter=1.0 Cardinal__ToFighter=1.0 Hierophant__ToFighter=1.0 Eva_Templar__ToFighter=1.0 Sword_Muse__ToFighter=1.0 Wind_Rider__ToFighter=0.8 Moonlight_Sentinel__ToFighter=1.0 Mystic_Muse__ToFighter=1.0 Elemental_Master__ToFighter=1.0 Eva_s_Saint__ToFighter=1.0 Shillien_Templar__ToFighter=1.0 Spectral_Dancer__ToFighter=1.0 Ghost_Hunter__ToFighter=0.8 Ghost_Sentinel__ToFighter=1.0 Storm_Screamer__ToFighter=1.0 Spectral_Master__ToFighter=1.0 Shillien_Saint__ToFighter=1.0 Titan__ToFighter=1.0 Grand_Khauatari__ToFighter=0.9 Dominator__ToFighter=1.0 Doomcryer__ToFighter=1.0 Fortune_Seeker__ToFighter=1.0 Maestro__ToFighter=1.0 #Damages to Mage Duelist__ToMage=0.6 DreadNought__ToMage=1.0 Phoenix_Knight__ToMage=1.0 Hell_Knight__ToMage=1.0 Sagittarius__ToMage=1.0 Adventurer__ToMage=0.8 Archmage__ToMage=1.0 Soultaker__ToMage=1.0 Arcana_Lord__ToMage=1.0 Cardinal__ToMage=1.0 Hierophant__ToMage=1.0 Eva_Templar__ToMage=1.0 Sword_Muse__ToMage=1.0 Wind_Rider__ToMage=0.8 Moonlight_Sentinel__ToMage=1.0 Mystic_Muse__ToMage=1.0 Elemental_Master__ToMage=1.0 Eva_s_Saint__ToMage=1.0 Shillien_Templar__ToMage=1.0 Spectral_Dancer__ToMage=1.0 Ghost_Hunter__ToMage=0.8 Ghost_Sentinel__ToMage=1.0 Storm_Screamer__ToMage=1.0 Spectral_Master__ToMage=1.0 Shillien_Saint__ToMage=1.0 Titan__ToMage=1.0 Grand_Khauatari__ToMage=0.8 Dominator__ToMage=1.0 Doomcryer__ToMage=1.0 Fortune_Seeker__ToMage=1.0 Maestro__ToMage=1.0 #Damages By Fighters Duelist__ByFighter=0.7 DreadNought__ByFighter=1.0 Phoenix_Knight__ByFighter=1.0 Hell_Knight__ByFighter=1.0 Sagittarius__ByFighter=1.0 Adventurer__ByFighter=0.8 Archmage__ByFighter=1.0 Soultaker__ByFighter=1.0 Arcana_Lord__ByFighter=1.0 Cardinal__ByFighter=1.0 Hierophant__ByFighter=1.0 Eva_Templar__ByFighter=1.0 Sword_Muse__ByFighter=1.0 Wind_Rider__ByFighter=0.8 Moonlight_Sentinel__ByFighter=1.0 Mystic_Muse__ByFighter=1.0 Elemental_Master__ByFighter=1.0 Eva_s_Saint__ByFighter=1.0 Shillien_Templar__ByFighter=1.0 Spectral_Dancer__ByFighter=1.0 Ghost_Hunter__ByFighter=0.8 Ghost_Sentinel__ByFighter=1.0 Storm_Screamer__ByFighter=1.0 Spectral_Master__ByFighter=1.0 Shillien_Saint__ByFighter=1.0 Titan__ByFighter=1.0 Grand_Khauatari__ByFighter=0.9 Dominator__ByFighter=1.0 Doomcryer__ByFighter=1.0 Fortune_Seeker__ByFighter=1.0 Maestro__ByFighter=1.0 #Damages By Mages Duelist__ByMage=0.8 DreadNought__ByMage=1.0 Phoenix_Knight__ByMage=1.0 Hell_Knight__ByMage=1.0 Sagittarius__ByMage=1.0 Adventurer__ByMage=0.9 Archmage__ByMage=1.0 Soultaker__ByMage=1.0 Arcana_Lord__ByMage=1.0 Cardinal__ByMage=1.0 Hierophant__ByMage=1.0 Eva_Templar__ByMage=1.0 Sword_Muse__ByMage=1.0 Wind_Rider__ByMage=1.0 Moonlight_Sentinel__ByMage=1.0 Mystic_Muse__ByMage=1.0 Elemental_Master__ByMage=1.0 Eva_s_Saint__ByMage=1.0 Shillien_Templar__ByMage=1.0 Spectral_Dancer__ByMage=1.0 Ghost_Hunter__ByMage=1.0 Ghost_Sentinel__ByMage=1.0 Storm_Screamer__ByMage=1.0 Spectral_Master__ByMage=1.0 Shillien_Saint__ByMage=1.0 Titan__ByMage=1.0 Grand_Khauatari__ByMage=0.9 Dominator__ByMage=1.0 Doomcryer__ByMage=1.0 Fortune_Seeker__ByMage=1.0 Maestro__ByMage=1.0 New Class in package com.dream.game.manager; package com.dream.game.manager; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Hashtable; import java.util.Properties; import java.util.Set; import java.util.logging.Logger; import com.dream.ConfigFiles; import com.dream.game.datatables.xml.CharTemplateTable; import com.dream.game.model.actor.instance.L2PcInstance; /** * @author Shyla * Adapted By Zeit */ public class ClassDamageManager { protected static final Logger _log = Logger.getLogger(ClassDamageManager.class.getName()); private static Hashtable<Integer, Double> damage_to_mage = new Hashtable<>(); private static Hashtable<Integer, Double> damage_to_fighter = new Hashtable<>(); private static Hashtable<Integer, Double> damage_by_mage = new Hashtable<>(); private static Hashtable<Integer, Double> damage_by_fighter = new Hashtable<>(); private static Hashtable<Integer, String> id_to_name = new Hashtable<>(); private static Hashtable<String, Integer> name_to_id = new Hashtable<>(); public static void loadConfig() { final String SCRIPT = ConfigFiles.CLASS_DAMAGES_FILE; InputStream is = null; File file = null; try { final Properties scriptSetting = new Properties(); file = new File(SCRIPT); is = new FileInputStream(file); scriptSetting.load(is); final Set<Object> key_set = scriptSetting.keySet(); for (final Object key : key_set) { final String key_string = (String) key; final String[] class_and_type = key_string.split("__"); String class_name = class_and_type[0].replace("_", " "); if (class_name.equals("Eva s Saint")) class_name = "Eva's Saint"; final String type = class_and_type[1]; final Integer class_id = CharTemplateTable.getClassIdByName(class_name) - 1; id_to_name.put(class_id, class_name); name_to_id.put(class_name, class_id); if (type.equals("ToFighter")) { damage_to_fighter.put(class_id, Double.parseDouble(scriptSetting.getProperty(key_string))); } else if (type.equals("ToMage")) { damage_to_mage.put(class_id, Double.parseDouble(scriptSetting.getProperty(key_string))); } else if (type.equals("ByFighter")) { damage_by_fighter.put(class_id, Double.parseDouble(scriptSetting.getProperty(key_string))); } else if (type.equals("ByMage")) { damage_by_mage.put(class_id, Double.parseDouble(scriptSetting.getProperty(key_string))); } } _log.info("ClassDamageManager: Loaded " + id_to_name.size() + " class damage configurations"); } catch (final Exception e) { e.printStackTrace(); } finally { if (is != null) { try { is.close(); } catch (final IOException e) { e.printStackTrace(); } } } } public static double getClassDamageToMage(final int id) { final Double multiplier = damage_to_mage.get(id); if (multiplier != null) return multiplier; return 1; } public static double getClassDamageToFighter(final int id) { final Double multiplier = damage_to_fighter.get(id); if (multiplier != null) return multiplier; return 1; } public static double getClassDamageByMage(final int id) { final Double multiplier = damage_by_mage.get(id); if (multiplier != null) return multiplier; return 1; } public static double getClassDamageByFighter(final int id) { final Double multiplier = damage_by_fighter.get(id); if (multiplier != null) return multiplier; return 1; } public static int getIdByName(final String name) { final Integer id = name_to_id.get(name); if (id != null) return id; return 0; } public static String getNameById(final int id) { final String name = id_to_name.get(id); if (name != null) return name; return ""; } /** * return the product between the attackerMultiplier and attackedMultiplier configured into the classDamages.properties * @param attacker * @param attacked * @return output = attackerMulti*attackedMulti */ public static double getDamageMultiplier(final L2PcInstance attacker, final L2PcInstance attacked) { if (attacker == null || attacked == null) return 1; double attackerMulti = 1; if (attacked.isMageClass()) attackerMulti = getClassDamageToMage(attacker.getClassId().getId()); else attackerMulti = getClassDamageToFighter(attacker.getClassId().getId()); double attackedMulti = 1; if (attacker.isMageClass()) attackedMulti = getClassDamageByMage(attacked.getClassId().getId()); else attackedMulti = getClassDamageByFighter(attacked.getClassId().getId()); final double output = attackerMulti * attackedMulti; return output; } } package com.dream.ConfigFiles; public class ConfigFiles { public static final String NPC_FILE = "./config/main/npc.properties"; public static final String PLAYER_FILE = "./config/main/player.properties"; public static final String ALT_FILE = "./config/main/altgame.properties"; +public static final String CLASS_DAMAGES_FILE = "./config/main/classDamages.properties"; public static final String RATES_FILE = "./config/main/rates.properties";