Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2J_Server
- Index: java/com/l2jserver/Config.java
- ===================================================================
- --- java/com/l2jserver/Config.java (revision 6245)
- +++ java/com/l2jserver/Config.java (working copy)
- @@ -103,6 +103,7 @@
- public static final String SECURITY_CONFIG_FILE = "./config/Security.properties";
- public static final String EMAIL_CONFIG_FILE = "./config/Email.properties";
- public static final String CH_SIEGE_FILE = "./config/ConquerableHallSiege.properties";
- + public static final String L2J_ROL_FILE = "./config/L2JRol.properties";
- // --------------------------------------------------
- // L2J Variable Definitions
- // --------------------------------------------------
- @@ -1127,6 +1128,54 @@
- public static int CHS_FAME_AMOUNT;
- public static int CHS_FAME_FREQUENCY;
- + // L2J Rol (Nombre del proyecto)
- + // Variables para incrementar el fuerza de ataque de una raza a otra
- + public static boolean POWER_UP_ACTIVATED; // Activa o desactiva el incrementador de ataque de una raza sobre otra
- + // Razas
- +
- + // Humano
- + public static double POWER_UP_HUMAN_vs_HUMAN;
- + public static double POWER_UP_HUMAN_vs_ELF;
- + public static double POWER_UP_HUMAN_vs_DELF;
- + public static double POWER_UP_HUMAN_vs_ORC;
- + public static double POWER_UP_HUMAN_vs_DWARF;
- + public static double POWER_UP_HUMAN_vs_KAMAEL;
- + // Elfo
- + public static double POWER_UP_ELF_vs_HUMAN;
- + public static double POWER_UP_ELF_vs_ELF;
- + public static double POWER_UP_ELF_vs_DELF;
- + public static double POWER_UP_ELF_vs_ORC;
- + public static double POWER_UP_ELF_vs_DWARF;
- + public static double POWER_UP_ELF_vs_KAMAEL;
- + // Elfo Oscuro
- + public static double POWER_UP_DELF_vs_HUMAN;
- + public static double POWER_UP_DELF_vs_ELF;
- + public static double POWER_UP_DELF_vs_DELF;
- + public static double POWER_UP_DELF_vs_ORC;
- + public static double POWER_UP_DELF_vs_DWARF;
- + public static double POWER_UP_DELF_vs_KAMAEL;
- + // Orco
- + public static double POWER_UP_ORC_vs_HUMAN;
- + public static double POWER_UP_ORC_vs_ELF;
- + public static double POWER_UP_ORC_vs_DELF;
- + public static double POWER_UP_ORC_vs_ORC;
- + public static double POWER_UP_ORC_vs_DWARF;
- + public static double POWER_UP_ORC_vs_KAMAEL;
- + // Enano
- + public static double POWER_UP_DWARF_vs_HUMAN;
- + public static double POWER_UP_DWARF_vs_ELF;
- + public static double POWER_UP_DWARF_vs_DELF;
- + public static double POWER_UP_DWARF_vs_ORC;
- + public static double POWER_UP_DWARF_vs_DWARF;
- + public static double POWER_UP_DWARF_vs_KAMAEL;
- + // Kamael
- + public static double POWER_UP_KAMAEL_vs_HUMAN;
- + public static double POWER_UP_KAMAEL_vs_ELF;
- + public static double POWER_UP_KAMAEL_vs_DELF;
- + public static double POWER_UP_KAMAEL_vs_ORC;
- + public static double POWER_UP_KAMAEL_vs_DWARF;
- + public static double POWER_UP_KAMAEL_vs_KAMAEL;
- +
- /**
- * This class initializes all global variables for configuration.<br>
- * If the key doesn't appear in properties file, a default value is set by this class. {@link #CONFIGURATION_FILE} (properties file) for configuring your server.
- @@ -3001,6 +3050,64 @@
- CHS_ENABLE_FAME = Boolean.parseBoolean(ClanHallSiege.getProperty("EnableFame", "false"));
- CHS_FAME_AMOUNT = Integer.parseInt(ClanHallSiege.getProperty("FameAmount", "0"));
- CHS_FAME_FREQUENCY = Integer.parseInt(ClanHallSiege.getProperty("FameFrequency", "0"));
- +
- + // Carga la configuracion de L2J_Rol
- + L2Properties L2JRol_properties = new L2Properties();
- + final File l2jrol = new File(L2J_ROL_FILE);
- + try (InputStream is = new FileInputStream(l2jrol))
- + {
- + L2JRol_properties.load(is);
- + _log.log(Level.INFO, "La bonificacion L2J_ROL ha sido cargada con exito.");
- + }
- + catch (Exception e)
- + {
- + _log.log(Level.SEVERE, L2J_ROL_FILE + ": no ha cargado correctamente!", e);
- + }
- + POWER_UP_ACTIVATED = Boolean.parseBoolean(L2JRol_properties.getProperty("POWER_UP_ACTIVATED", "True"));
- +
- + POWER_UP_HUMAN_vs_HUMAN = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_HUMAN_vs_HUMAN", "1.0"));
- + POWER_UP_HUMAN_vs_ELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_HUMAN_vs_ELF", "1.0"));
- + POWER_UP_HUMAN_vs_DELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_HUMAN_vs_DELF", "1.0"));
- + POWER_UP_HUMAN_vs_ORC = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_HUMAN_vs_ORC", "1.0"));
- + POWER_UP_HUMAN_vs_DWARF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_HUMAN_vs_DWARF", "1.0"));
- + POWER_UP_HUMAN_vs_KAMAEL = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_HUMAN_vs_KAMAEL", "1.0"));
- +
- + POWER_UP_ELF_vs_HUMAN = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ELF_vs_HUMAN", "1.0"));
- + POWER_UP_ELF_vs_ELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ELF_vs_ELF", "1.0"));
- + POWER_UP_ELF_vs_DELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ELF_vs_DELF", "1.0"));
- + POWER_UP_ELF_vs_ORC = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ELF_vs_ORC", "1.0"));
- + POWER_UP_ELF_vs_DWARF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ELF_vs_DWARF", "1.0"));
- + POWER_UP_ELF_vs_KAMAEL = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ELF_vs_KAMAEL", "1.0"));
- +
- + POWER_UP_DELF_vs_HUMAN = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DELF_vs_HUMAN", "1.0"));
- + POWER_UP_DELF_vs_ELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DELF_vs_ELF", "1.0"));
- + POWER_UP_DELF_vs_DELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DELF_vs_DELF", "1.0"));
- + POWER_UP_DELF_vs_ORC = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DELF_vs_ORC", "1.0"));
- + POWER_UP_DELF_vs_DWARF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DELF_vs_DWARF", "1.0"));
- + POWER_UP_DELF_vs_KAMAEL = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DELF_vs_KAMAEL", "1.0"));
- +
- + POWER_UP_ORC_vs_HUMAN = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ORC_vs_HUMAN", "1.0"));
- + POWER_UP_ORC_vs_ELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ORC_vs_ELF", "1.0"));
- + POWER_UP_ORC_vs_DELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ORC_vs_DELF", "1.0"));
- + POWER_UP_ORC_vs_ORC = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ORC_vs_ORC", "1.0"));
- + POWER_UP_ORC_vs_DWARF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ORC_vs_DWARF", "1.0"));
- + POWER_UP_ORC_vs_KAMAEL = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_ORC_vs_KAMAEL", "1.0"));
- +
- + POWER_UP_DWARF_vs_HUMAN = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DWARF_vs_HUMAN", "1.0"));
- + POWER_UP_DWARF_vs_ELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DWARF_vs_ELF", "1.0"));
- + POWER_UP_DWARF_vs_DELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DWARF_vs_DELF", "1.0"));
- + POWER_UP_DWARF_vs_ORC = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DWARF_vs_ORC", "1.0"));
- + POWER_UP_DWARF_vs_DWARF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DWARF_vs_DWARF", "1.0"));
- + POWER_UP_DWARF_vs_KAMAEL = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_DWARF_vs_KAMAEL", "1.0"));
- +
- + POWER_UP_KAMAEL_vs_HUMAN = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_KAMAEL_vs_HUMAN", "1.0"));
- + POWER_UP_KAMAEL_vs_ELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_KAMAEL_vs_ELF", "1.0"));
- + POWER_UP_KAMAEL_vs_DELF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_KAMAEL_vs_DELF", "1.0"));
- + POWER_UP_KAMAEL_vs_ORC = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_KAMAEL_vs_ORC", "1.0"));
- + POWER_UP_KAMAEL_vs_DWARF = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_KAMAEL_vs_DWARF", "1.0"));
- + POWER_UP_KAMAEL_vs_KAMAEL = Double.parseDouble(L2JRol_properties.getProperty("POWER_UP_KAMAEL_vs_KAMAEL", "1.0"));
- + // -- L2J_Rol -- //
- +
- }
- else if (Server.serverMode == Server.MODE_LOGINSERVER)
- {
- Index: java/com/l2jrol/Calculadora_L2JRol.java
- ===================================================================
- --- java/com/l2jrol/Calculadora_L2JRol.java (revision 0)
- +++ java/com/l2jrol/Calculadora_L2JRol.java (working copy)
- @@ -0,0 +1,226 @@
- +/*
- + * Copyright (C) 2004-2013 L2J Server
- + *
- + * This file is part of L2J Server.
- + *
- + * L2J Server 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.
- + *
- + * L2J Server 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 com.l2jrol;
- +
- +import com.l2jserver.Config;
- +import com.l2jserver.gameserver.model.actor.L2Character;
- +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.model.base.Race;
- +
- +/**
- + * @author Tony
- + */
- +public class Calculadora_L2JRol
- +{
- + /**
- + * Modifica el daño desde L2JRol.properties.
- + * @param atk
- + * @param vict
- + * @return
- + */
- + public static double getDamage_L2JRol(L2Character atk, L2Character vict)
- + {
- + double damage = 1.0;
- + Race atacante_raza, victima_raza;
- +
- + if (Config.POWER_UP_ACTIVATED)
- + {
- + if ((atk instanceof L2PcInstance) && (vict instanceof L2PcInstance))
- + {
- + L2PcInstance atacante = atk.getActingPlayer();
- + L2PcInstance victima = vict.getActingPlayer();
- + atacante_raza = atacante.getRace();
- + victima_raza = victima.getRace();
- + System.out.println("A:" + atacante_raza.toString() + " B:" + victima_raza.toString());
- + switch (atacante_raza)
- + {
- + case Human:
- + switch (victima_raza)
- + {
- + case Human:
- + damage = Config.POWER_UP_HUMAN_vs_HUMAN;
- + break;
- + case Elf:
- + damage = Config.POWER_UP_HUMAN_vs_ELF;
- + break;
- + case DarkElf:
- + damage = Config.POWER_UP_HUMAN_vs_DELF;
- + break;
- + case Orc:
- + damage = Config.POWER_UP_HUMAN_vs_ORC;
- + System.out.println("CONFIG: " + Config.POWER_UP_HUMAN_vs_ORC);
- + break;
- + case Dwarf:
- + damage = Config.POWER_UP_HUMAN_vs_DWARF;
- + break;
- + case Kamael:
- + damage = Config.POWER_UP_HUMAN_vs_KAMAEL;
- + break;
- + default:
- + System.out.println("La raza " + victima_raza + " no se encuentra.");
- + break;
- + }
- + break;
- + case Elf:
- + switch (victima_raza)
- + {
- + case Human:
- + damage = Config.POWER_UP_ELF_vs_HUMAN;
- + break;
- + case Elf:
- + damage = Config.POWER_UP_ELF_vs_ELF;
- + break;
- + case DarkElf:
- + damage = Config.POWER_UP_ELF_vs_DELF;
- + break;
- + case Orc:
- + damage = Config.POWER_UP_ELF_vs_ORC;
- + break;
- + case Dwarf:
- + damage = Config.POWER_UP_ELF_vs_DWARF;
- + break;
- + case Kamael:
- + damage = Config.POWER_UP_ELF_vs_KAMAEL;
- + break;
- + default:
- + System.out.println("La raza " + victima_raza + " no se encuentra.");
- + break;
- + }
- + break;
- + case DarkElf:
- + switch (victima_raza)
- + {
- + case Human:
- + damage = Config.POWER_UP_DELF_vs_HUMAN;
- + break;
- + case Elf:
- + damage = Config.POWER_UP_DELF_vs_ELF;
- + break;
- + case DarkElf:
- + damage = Config.POWER_UP_DELF_vs_DELF;
- + break;
- + case Orc:
- + damage = Config.POWER_UP_DELF_vs_ORC;
- + break;
- + case Dwarf:
- + damage = Config.POWER_UP_DELF_vs_DWARF;
- + break;
- + case Kamael:
- + damage = Config.POWER_UP_DELF_vs_KAMAEL;
- + break;
- + default:
- + System.out.println("La raza " + victima_raza + " no se encuentra.");
- + break;
- + }
- + break;
- + case Orc:
- + switch (victima_raza)
- + {
- + case Human:
- + damage = Config.POWER_UP_ORC_vs_HUMAN;
- + break;
- + case Elf:
- + damage = Config.POWER_UP_ORC_vs_ELF;
- + break;
- + case DarkElf:
- + damage = Config.POWER_UP_ORC_vs_DELF;
- + break;
- + case Orc:
- + damage = Config.POWER_UP_ORC_vs_ORC;
- + break;
- + case Dwarf:
- + damage = Config.POWER_UP_ORC_vs_DWARF;
- + break;
- + case Kamael:
- + damage = Config.POWER_UP_ORC_vs_KAMAEL;
- + break;
- + default:
- + System.out.println("La raza " + victima_raza + " no se encuentra.");
- + break;
- + }
- + break;
- + case Dwarf:
- + switch (victima_raza)
- + {
- + case Human:
- + damage = Config.POWER_UP_DWARF_vs_HUMAN;
- + break;
- + case Elf:
- + damage = Config.POWER_UP_DWARF_vs_ELF;
- + break;
- + case DarkElf:
- + damage = Config.POWER_UP_DWARF_vs_DELF;
- + break;
- + case Orc:
- + damage = Config.POWER_UP_DWARF_vs_ORC;
- + break;
- + case Dwarf:
- + damage = Config.POWER_UP_DWARF_vs_DWARF;
- + break;
- + case Kamael:
- + damage = Config.POWER_UP_DWARF_vs_KAMAEL;
- + break;
- + default:
- + System.out.println("La raza " + victima_raza + " no se encuentra.");
- + break;
- + }
- + break;
- + case Kamael:
- + switch (victima_raza)
- + {
- + case Human:
- + damage = Config.POWER_UP_KAMAEL_vs_HUMAN;
- + break;
- + case Elf:
- + damage = Config.POWER_UP_KAMAEL_vs_ELF;
- + break;
- + case DarkElf:
- + damage = Config.POWER_UP_KAMAEL_vs_DELF;
- + break;
- + case Orc:
- + damage = Config.POWER_UP_KAMAEL_vs_ORC;
- + break;
- + case Dwarf:
- + damage = Config.POWER_UP_KAMAEL_vs_DWARF;
- + break;
- + case Kamael:
- + damage = Config.POWER_UP_KAMAEL_vs_KAMAEL;
- + break;
- + default:
- + System.out.println("La raza " + victima_raza + " no se encuentra.");
- + break;
- + }
- + break;
- + default:
- + System.out.println("La raza " + victima_raza + " no se encuentra.");
- + break;
- + }
- + }
- + else
- + {
- + // System.out.println("A:" + atk.getInstanceType().toString() + " V: " + vict.getInstanceType().toString());
- + }
- + }
- + else
- + {
- + // System.out.println("POWERUP esta desactivado.");
- + }
- + return damage;
- + }
- +}
- Index: dist/game/config/L2JRol.properties
- ===================================================================
- --- dist/game/config/L2JRol.properties (revision 0)
- +++ dist/game/config/L2JRol.properties (working copy)
- @@ -0,0 +1,58 @@
- +# En esta configuracion se bonifican o no, el daño en pvp de una raza a otra.
- +# False desactiva la bonificacion.
- +POWER_UP_ACTIVATED = true
- +# La formula es daño = daño * bonificacion
- +#
- +# Humano
- +# En esta configuracion: 10% daño extra a los orcos
- +POWER_UP_HUMAN_vs_HUMAN = 1.0
- +POWER_UP_HUMAN_vs_ELF = 1.0
- +POWER_UP_HUMAN_vs_DELF = 1.0
- +POWER_UP_HUMAN_vs_ORC = 10.1
- +POWER_UP_HUMAN_vs_DWARF = 1.0
- +POWER_UP_HUMAN_vs_KAMAEL 1.0
- +
- +#Elfo
- +# En esta configuracion: 10% daño extra a los elfos oscuros
- +POWER_UP_ELF_vs_HUMAN = 1.0
- +POWER_UP_ELF_vs_ELF = 1.0
- +POWER_UP_ELF_vs_DELF = 1.1
- +POWER_UP_ELF_vs_ORC = 1.0
- +POWER_UP_ELF_vs_DWARF = 1.0
- +POWER_UP_ELF_vs_KAMAEL = 1.0
- +
- +#Elfo Oscuro
- +# En esta configuracion: 10% daño extra a los humanos
- +POWER_UP_DELF_vs_HUMAN = 1.1
- +POWER_UP_DELF_vs_ELF = 1.0
- +POWER_UP_DELF_vs_DELF = 1.0
- +POWER_UP_DELF_vs_ORC = 1.0
- +POWER_UP_DELF_vs_DWARF = 1.0
- +POWER_UP_DELF_vs_KAMAEL = 1.0
- +
- +# Orco
- +# En esta configuracion: 5% daño extra a los enanos
- +POWER_UP_ORC_vs_HUMAN = 1.0
- +POWER_UP_ORC_vs_ELF = 1.0
- +POWER_UP_ORC_vs_DELF = 1.0
- +POWER_UP_ORC_vs_ORC = 1.0
- +POWER_UP_ORC_vs_DWARF = 1.05
- +POWER_UP_ORC_vs_KAMAEL = 1.0
- +
- +# Enano
- +# En esta configuracion: 10% daño extra a los kamael
- +POWER_UP_DWARF_vs_HUMAN = 1.0
- +POWER_UP_DWARF_vs_ELF = 1.0
- +POWER_UP_DWARF_vs_DELF = 1.0
- +POWER_UP_DWARF_vs_ORC = 1.0
- +POWER_UP_DWARF_vs_DWARF = 1.0
- +POWER_UP_DWARF_vs_KAMAEL = 1.1
- +
- +# Kamael
- +# En esta configuracion: 10% daño extra a los elfos blancos
- +POWER_UP_KAMAEL_vs_HUMAN = 1.0
- +POWER_UP_KAMAEL_vs_ELF = 1.1
- +POWER_UP_KAMAEL_vs_DELF = 1.0
- +POWER_UP_KAMAEL_vs_ORC = 1.0
- +POWER_UP_KAMAEL_vs_DWARF = 1.0
- +POWER_UP_KAMAEL_vs_KAMAEL = 1.0
- \ No newline at end of file
- Index: java/com/l2jserver/gameserver/model/stats/Formulas.java
- ===================================================================
- --- java/com/l2jserver/gameserver/model/stats/Formulas.java (revision 6245)
- +++ java/com/l2jserver/gameserver/model/stats/Formulas.java (working copy)
- @@ -22,6 +22,7 @@
- import java.util.List;
- import java.util.logging.Logger;
- +import com.l2jrol.Calculadora_L2JRol;
- import com.l2jserver.Config;
- import com.l2jserver.gameserver.SevenSigns;
- import com.l2jserver.gameserver.SevenSignsFestival;
- @@ -606,6 +607,7 @@
- public static double calcBlowDamage(L2Character attacker, L2Character target, L2Skill skill, byte shld, boolean ss)
- {
- +
- double defence = target.getPDef(attacker);
- switch (shld)
- @@ -697,6 +699,7 @@
- damage *= calcValakasTrait(attacker, target, skill);
- // Def bonuses in PvP fight
- + // TODO: Quizas haya que añadir el modo rol aqui
- if (isPvP)
- {
- if (skill == null)
- @@ -955,7 +958,10 @@
- }
- }
- }
- -
- + // System.out.println("Entrada: " + damage);
- + // System.out.println(">>" + Calculadora_L2JRol.getDamage_L2JRol(attacker, target) + "<<");
- + damage = damage * Calculadora_L2JRol.getDamage_L2JRol(attacker, target);
- + // System.out.println("Salida: " + damage);
- return damage;
- }
- @@ -1084,7 +1090,7 @@
- }
- }
- }
- -
- + damage = damage * Calculadora_L2JRol.getDamage_L2JRol(attacker, target);
- return damage;
- }
- @@ -1994,7 +2000,7 @@
- }
- }
- }
- -
- + damage = damage * Calculadora_L2JRol.getDamage_L2JRol(attacker, target);
- return damage;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement