Перейти к содержанию
Авторизация  
qweqwe

Как сделать рейты х0.1 имея исходники!

Рекомендуемые сообщения

Всем привет помогите пожалуйста есть исходники сервера, пытаюсь сделать рейты - х0.1

Никак не получается искал в Config.java, Experience.java, ExProperties.java.

Не где не нашел, того что мне нужно!

 

В конфиге rates.ini пытался выставить RateXp = 0.5 не работает!

Изменено пользователем qweqwe

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Возьмите пример со сборки где поддерживаются не цельные значения,и там гляньте

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Возьмите пример со сборки где поддерживаются не цельные значения,и там гляньте

 

Не нашел сборки такой!

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

int меняем на double

Та в смысле int меняем на double ? >:( В каком класе и примерно какой строке, в какой сборке?

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

переменную int на double смени в исходниках

это не переменная, а тип переменной

не надо употреблять термины, если не знаете их

  • Upvote 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

это не переменная, а тип переменной

не надо употреблять термины, если не знаете их

В каком файле? (Классе)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

В каком файле? (Классе)

Прочитайте сначала о "примитивных типах данных" что бы не задавать подобных вопросов.

И менять возможно прийдеться не в одном классе. Будьте готовы к этому.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

И так стоит double:

private double rateXp = 1.;

 

public double getRateXp()
{
return rateXp;
}
 
public void setRateXp(double rateXp)
{
this.rateXp = rateXp;
}

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

 Так не кто и не помог спасибо :'(

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

 Так не кто и не помог спасибо :'(

Листайте код, вам в этом деле не кто не поможет.. Посмотрите формулы расчета получаемой exp... В каком классе смотреть даже не спрашивайте в глаза этот код не видел.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Если поставить рейты к примеру х50, поставится?

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Если поставить рейты к примеру х50, поставится?

да

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

java\lineage\commons\configuration\ExProperties.java

 

 

/*
 * 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 lineage2.commons.configuration;
 
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
 
import org.apache.commons.io.IOUtils;
 
/**
 * @author Mobius
 * @version $Revision: 1.0 $
 */
public class ExProperties extends Properties
{
public static final String defaultDelimiter = "[\\s,;]+";
 
/**
* Method load.
* @param fileName String
* @throws IOException
*/
void load(String fileName) throws IOException
{
load(new File(fileName));
}
 
/**
* Method load.
* @param file File
* @throws IOException
*/
public void load(File file) throws IOException
{
InputStream is = null;
 
try
{
load(is = new FileInputStream(file));
}
finally
{
IOUtils.closeQuietly(is);
}
}
 
/**
* Method parseBoolean.
* @param s String
* @return boolean
*/
private static boolean parseBoolean(String s)
{
switch (s.length())
{
case 1:
{
char ch0 = s.charAt(0);
 
if ((ch0 == 'y') || (ch0 == 'Y') || (ch0 == '1'))
{
return true;
}
 
if ((ch0 == 'n') || (ch0 == 'N') || (ch0 == '0'))
{
return false;
}
break;
}
 
case 2:
{
char ch0 = s.charAt(0);
char ch1 = s.charAt(1);
 
if (((ch0 == 'o') || (ch0 == 'O')) && ((ch1 == 'n') || (ch1 == 'N')))
{
return true;
}
 
if (((ch0 == 'n') || (ch0 == 'N')) && ((ch1 == 'o') || (ch1 == 'O')))
{
return false;
}
break;
}
 
case 3:
{
char ch0 = s.charAt(0);
char ch1 = s.charAt(1);
char ch2 = s.charAt(2);
 
if (((ch0 == 'y') || (ch0 == 'Y')) && ((ch1 == 'e') || (ch1 == 'E')) && ((ch2 == 's') || (ch2 == 'S')))
{
return true;
}
 
if (((ch0 == 'o') || (ch0 == 'O')) && ((ch1 == 'f') || (ch1 == 'F')) && ((ch2 == 'f') || (ch2 == 'F')))
{
return false;
}
break;
}
 
case 4:
{
char ch0 = s.charAt(0);
char ch1 = s.charAt(1);
char ch2 = s.charAt(2);
char ch3 = s.charAt(3);
 
if (((ch0 == 't') || (ch0 == 'T')) && ((ch1 == 'r') || (ch1 == 'R')) && ((ch2 == 'u') || (ch2 == 'U')) && ((ch3 == 'e') || (ch3 == 'E')))
{
return true;
}
break;
}
 
case 5:
{
char ch0 = s.charAt(0);
char ch1 = s.charAt(1);
char ch2 = s.charAt(2);
char ch3 = s.charAt(3);
char ch4 = s.charAt(4);
 
if (((ch0 == 'f') || (ch0 == 'F')) && ((ch1 == 'a') || (ch1 == 'A')) && ((ch2 == 'l') || (ch2 == 'L')) && ((ch3 == 's') || (ch3 == 'S')) && ((ch4 == 'e') || (ch4 == 'E')))
{
return false;
}
break;
}
}
 
throw new IllegalArgumentException("For input string: \"" + s + "\"");
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue boolean
* @return boolean
*/
public boolean getProperty(String name, boolean defaultValue)
{
boolean val = defaultValue;
String value;
 
if ((value = super.getProperty(name, null)) != null)
{
val = parseBoolean(value);
}
 
return val;
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue int
* @return int
*/
public int getProperty(String name, int defaultValue)
{
int val = defaultValue;
String value;
 
if ((value = super.getProperty(name, null)) != null)
{
val = Integer.parseInt(value);
}
 
return val;
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue long
* @return long
*/
public long getProperty(String name, long defaultValue)
{
long val = defaultValue;
String value;
 
if ((value = super.getProperty(name, null)) != null)
{
val = Long.parseLong(value);
}
 
return val;
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue double
* @return double
*/
public double getProperty(String name, double defaultValue)
{
double val = defaultValue;
String value;
 
if ((value = super.getProperty(name, null)) != null)
{
val = Double.parseDouble(value);
}
 
return val;
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue String[]
* @return String[]
*/
public String[] getProperty(String name, String[] defaultValue)
{
return getProperty(name, defaultValue, defaultDelimiter);
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue String[]
* @param delimiter String
* @return String[]
*/
private String[] getProperty(String name, String[] defaultValue, String delimiter)
{
String[] val = defaultValue;
String value;
 
if ((value = super.getProperty(name, null)) != null)
{
val = value.split(delimiter);
}
 
return val;
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue boolean[]
* @return boolean[]
*/
boolean[] getProperty(String name, boolean[] defaultValue)
{
return getProperty(name, defaultValue, defaultDelimiter);
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue boolean[]
* @param delimiter String
* @return boolean[]
*/
private boolean[] getProperty(String name, boolean[] defaultValue, String delimiter)
{
boolean[] val = defaultValue;
String value;
 
if ((value = super.getProperty(name, null)) != null)
{
String[] values = value.split(delimiter);
val = new boolean[values.length];
 
for (int i = 0; i < val.length; i++)
{
val = parseBoolean(values);
}
}
 
return val;
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue int[]
* @return int[]
*/
public int[] getProperty(String name, int[] defaultValue)
{
return getProperty(name, defaultValue, defaultDelimiter);
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue int[]
* @param delimiter String
* @return int[]
*/
private int[] getProperty(String name, int[] defaultValue, String delimiter)
{
int[] val = defaultValue;
String value;
 
if ((value = super.getProperty(name, null)) != null)
{
String[] values = value.split(delimiter);
val = new int[values.length];
 
for (int i = 0; i < val.length; i++)
{
val = Integer.parseInt(values);
}
}
 
return val;
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue long[]
* @return long[]
*/
long[] getProperty(String name, long[] defaultValue)
{
return getProperty(name, defaultValue, defaultDelimiter);
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue long[]
* @param delimiter String
* @return long[]
*/
private long[] getProperty(String name, long[] defaultValue, String delimiter)
{
long[] val = defaultValue;
String value;
 
if ((value = super.getProperty(name, null)) != null)
{
String[] values = value.split(delimiter);
val = new long[values.length];
 
for (int i = 0; i < val.length; i++)
{
val = Long.parseLong(values);
}
}
 
return val;
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue double[]
* @return double[]
*/
public double[] getProperty(String name, double[] defaultValue)
{
return getProperty(name, defaultValue, defaultDelimiter);
}
 
/**
* Method getProperty.
* @param name String
* @param defaultValue double[]
* @param delimiter String
* @return double[]
*/
private double[] getProperty(String name, double[] defaultValue, String delimiter)
{
double[] val = defaultValue;
String value;
 
if ((value = super.getProperty(name, null)) != null)
{
String[] values = value.split(delimiter);
val = new double[values.length];
 
for (int i = 0; i < val.length; i++)
{
val = Double.parseDouble(values);
}
}
 
return val;
}
}
 

 

 

lineage2\gameserver\model\actor\instances\player\Bonus.java

 

 

/*
 * 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 lineage2.gameserver.model.actor.instances.player;
 
/**
 * @author Mobius
 * @version $Revision: 1.0 $
 */
public class Bonus
{
public static final int NO_BONUS = 0;
public static final int BONUS_GLOBAL_ON_LOGINSERVER = 1;
public static final int BONUS_GLOBAL_ON_GAMESERVER = 2;
private double rateXp = 1.;
private double rateSp = 1.;
private double questRewardRate = 1.;
private double questDropRate = 1.;
private double dropAdena = 1.;
private double dropItems = 1.;
private double dropSpoil = 1.;
private int bonusExpire;
 
/**
* Method getRateXp.
* @return double
*/
public double getRateXp()
{
return rateXp;
}
 
/**
* Method setRateXp.
* @param rateXp double
*/
public void setRateXp(double rateXp)
{
this.rateXp = rateXp;
}
 
/**
* Method getRateSp.
* @return double
*/
public double getRateSp()
{
return rateSp;
}
 
/**
* Method setRateSp.
* @param rateSp double
*/
public void setRateSp(double rateSp)
{
this.rateSp = rateSp;
}
 
/**
* Method getQuestRewardRate.
* @return double
*/
public double getQuestRewardRate()
{
return questRewardRate;
}
 
/**
* Method setQuestRewardRate.
* @param questRewardRate double
*/
public void setQuestRewardRate(double questRewardRate)
{
this.questRewardRate = questRewardRate;
}
 
/**
* Method getQuestDropRate.
* @return double
*/
public double getQuestDropRate()
{
return questDropRate;
}
 
/**
* Method setQuestDropRate.
* @param questDropRate double
*/
public void setQuestDropRate(double questDropRate)
{
this.questDropRate = questDropRate;
}
 
/**
* Method getDropAdena.
* @return double
*/
public double getDropAdena()
{
return dropAdena;
}
 
/**
* Method setDropAdena.
* @param dropAdena double
*/
public void setDropAdena(double dropAdena)
{
this.dropAdena = dropAdena;
}
 
/**
* Method getDropItems.
* @return double
*/
public double getDropItems()
{
return dropItems;
}
 
/**
* Method setDropItems.
* @param dropItems double
*/
public void setDropItems(double dropItems)
{
this.dropItems = dropItems;
}
 
/**
* Method getDropSpoil.
* @return double
*/
public double getDropSpoil()
{
return dropSpoil;
}
 
/**
* Method setDropSpoil.
* @param dropSpoil double
*/
public void setDropSpoil(double dropSpoil)
{
this.dropSpoil = dropSpoil;
}
 
/**
* Method getBonusExpire.
* @return int
*/
public int getBonusExpire()
{
return bonusExpire;
}
 
/**
* Method setBonusExpire.
* @param bonusExpire int
*/
public void setBonusExpire(int bonusExpire)
{
this.bonusExpire = bonusExpire;
}
}

lineage2\gameserver\model\base\Expirience.java


/*
 * 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 lineage2.gameserver.model.base;
 
import lineage2.gameserver.Config;
 
/**
 * @author Mobius
 * @version $Revision: 1.0 $
 */
public class Experience
{
public final static long LEVEL[] =
{
-1L,
0L,//1
68L,
363L,
1168L,
2884L,
6038L,
11287L,
19423L,
31378L,
48229L,
71202L,//10
101677L,
141193L,
191454L,
254330L,
331867L,
426288L,
540000L,
675596L,
835862L,
920357L,//20
1015431L,
1123336L,
1246808L,
1389235L,
1554904L,
1749413L,
1980499L,
2260321L,
2634751L,
2844287L,//30
3093068L,
3389496L,
3744042L,
4169902L,
4683988L,
5308556L,
6074376L,
7029248L,
8342182L,
8718976L,//40
9289560L,
9991807L,
10856075L,
11920512L,
13233701L,
14858961L,
16882633L,
19436426L,
22977080L,
24605660L,//50
26635948L,
29161263L,
32298229L,
36193556L,
41033917L,
47093035L,
54711546L,
64407353L,
77947292L,
85775204L,//60
95595386L,
107869713L,
123174171L,
142229446L,
165944812L,
195677269L,
233072222L,
280603594L,
335732975L,
383597045L,//70
442752112L,
516018015L,
606913902L,
719832095L,
860289228L,
1035327669L,
1259458516L,
1534688053L,
1909610088L,
2342785974L,//80
2861857696L,
3478378664L,
4211039578L,
5078544041L,
10985069426L,
19192594397L,
33533938399L,
43503026615L,
61895085913L,
84465260437L,
112359133751L,
146853833970L,
189558054903L,
242517343994L,
343490462139L,
538901012155L,
923857608218L,
1701666675991L,
1801666675991L
};
 
/**
* Method penaltyModifier.
* @param count long
* @param percents double
* @return double
*/
public static double penaltyModifier(long count, double percents)
{
return Math.max(1. - ((count * percents) / 100), 0);
}
 
/**
* Method getMaxLevel.
* @return int
*/
public static int getMaxLevel()
{
return Config.ALT_MAX_LEVEL;
}
 
/**
* Method getMaxSubLevel.
* @return int
*/
public static int getMaxSubLevel()
{
return Config.ALT_MAX_SUB_LEVEL;
}
 
/**
* Method getLevel.
* @param thisExp long
* @return int
*/
public static int getLevel(long thisExp)
{
int level = 0;
 
for (int i = 0; i < LEVEL.length; i++)
{
long exp = LEVEL;
 
if (thisExp >= exp)
{
level = i;
}
}
 
return level;
}
 
/**
* Method getExpForLevel.
* @param lvl int
* @return long
*/
public static long getExpForLevel(int lvl)
{
if (lvl >= Experience.LEVEL.length)
{
return 0;
}
 
return Experience.LEVEL[lvl];
}
 
/**
* Method getExpPercent.
* @param level int
* @param exp long
* @return double
*/
public static double getExpPercent(int level, long exp)
{
return ((exp - getExpForLevel(level)) / ((getExpForLevel(level + 1) - getExpForLevel(level)) / 100.0D)) * 0.01D;
}
 
/**
* Method getMaxDualLevel.
* @return int
*/
public static int getMaxDualLevel()
{
return Config.ALT_MAX_DUAL_SUB_LEVEL;
}
}

Изменено пользователем qweqwe

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

 

И так стоит double:

private double rateXp = 1.;

 

public double getRateXp()
{
return rateXp;
}
 
public void setRateXp(double rateXp)
{
this.rateXp = rateXp;
}

 

У тебя это всё есть, ставь в настройках нужное значение с точкой

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

У тебя это всё есть, ставь в настройках нужное значение с точкой

Да пробовал 0.1 XP идет как 1 

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

вот что мешает отследить где вызвается переменная, cчитанная из конфига и сделать везде нужные правки?

в нормальном IDE (эклипс, идеа) это делается за считанные минуты.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
Авторизация  

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×
×
  • Создать...