123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- /*
- * Copyright (C) 2004-2014 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.l2jserver.gameserver.model.entity;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- /**
- * @author Gnacik
- */
- public final class RecoBonus
- {
- private static final int[][] _recoBonus =
- {
- {
- 25,
- 50,
- 50,
- 50,
- 50,
- 50,
- 50,
- 50,
- 50,
- 50
- },
- {
- 16,
- 33,
- 50,
- 50,
- 50,
- 50,
- 50,
- 50,
- 50,
- 50
- },
- {
- 12,
- 25,
- 37,
- 50,
- 50,
- 50,
- 50,
- 50,
- 50,
- 50
- },
- {
- 10,
- 20,
- 30,
- 40,
- 50,
- 50,
- 50,
- 50,
- 50,
- 50
- },
- {
- 8,
- 16,
- 25,
- 33,
- 41,
- 50,
- 50,
- 50,
- 50,
- 50
- },
- {
- 7,
- 14,
- 21,
- 28,
- 35,
- 42,
- 50,
- 50,
- 50,
- 50
- },
- {
- 6,
- 12,
- 18,
- 25,
- 31,
- 37,
- 43,
- 50,
- 50,
- 50
- },
- {
- 5,
- 11,
- 16,
- 22,
- 27,
- 33,
- 38,
- 44,
- 50,
- 50
- },
- {
- 5,
- 10,
- 15,
- 20,
- 25,
- 30,
- 35,
- 40,
- 45,
- 50
- }
- };
-
- public static int getRecoBonus(L2PcInstance activeChar)
- {
- if ((activeChar != null) && activeChar.isOnline() && (activeChar.getRecomHave() != 0))
- {
- final int lvl = activeChar.getLevel() / 10;
- final int exp = (Math.min(100, activeChar.getRecomHave()) - 1) / 10;
-
- return _recoBonus[lvl][exp];
- }
- return 0;
- }
-
- public static double getRecoMultiplier(L2PcInstance activeChar)
- {
- double multiplier = 1.0;
- final double bonus = getRecoBonus(activeChar);
- if (bonus > 0)
- {
- multiplier += (bonus / 100);
- }
- return multiplier;
- }
- }
|