Nightmare Kamaloka.

Contributed by NviX.
This commit is contained in:
MobiusDev
2016-04-15 08:33:21 +00:00
parent b3cb70feb4
commit 9f649e00f2
27 changed files with 968 additions and 224 deletions

View File

@ -494,9 +494,9 @@ public class L2Attackable extends L2Npc
// mob = 24, atk = 50, diff = 26 (no xp)
final int levelDiff = attacker.getLevel() - getLevel();
final int[] expSp = calculateExpAndSp(levelDiff, damage, totalDamage);
final long[] expSp = calculateExpAndSp(levelDiff, damage, totalDamage);
long exp = expSp[0];
int sp = expSp[1];
int sp = (int) expSp[1];
if (((levelDiff >= 10) && (levelDiff <= 14)) || ((levelDiff <= -10) && (levelDiff >= -14))) // 30% on 10 - 14 level diff
{
@ -615,9 +615,9 @@ public class L2Attackable extends L2Npc
final int levelDiff = partyLvl - getLevel();
// Calculate Exp and SP rewards
final int[] expSp = calculateExpAndSp(levelDiff, partyDmg, totalDamage);
final long[] expSp = calculateExpAndSp(levelDiff, partyDmg, totalDamage);
long exp = expSp[0];
int sp = expSp[1];
int sp = (int) expSp[1];
if (Config.L2JMOD_CHAMPION_ENABLE && isChampion())
{
@ -1347,7 +1347,7 @@ public class L2Attackable extends L2Npc
* @param totalDamage The total damage done
* @return
*/
private int[] calculateExpAndSp(int diff, int damage, long totalDamage)
private long[] calculateExpAndSp(int diff, int damage, long totalDamage)
{
double xp;
double sp;
@ -1388,9 +1388,9 @@ public class L2Attackable extends L2Npc
sp = 0;
}
}
final int[] tmp =
final long[] tmp =
{
(int) xp,
(long) xp,
(int) sp
};
return tmp;

View File

@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.util;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Logger;
@ -44,6 +45,15 @@ public class MinionList
/** List containing the cached deleted minions for reuse */
protected List<L2MonsterInstance> _reusedMinionReferences = null;
private final static List<Integer> KEEP_MINION_AFTER_DEATH_BOSS_IDS = new ArrayList<>();
static
{
KEEP_MINION_AFTER_DEATH_BOSS_IDS.add(26094);
KEEP_MINION_AFTER_DEATH_BOSS_IDS.add(26096);
KEEP_MINION_AFTER_DEATH_BOSS_IDS.add(26099);
KEEP_MINION_AFTER_DEATH_BOSS_IDS.add(26102);
}
public MinionList(L2MonsterInstance pMaster)
{
if (pMaster == null)
@ -169,7 +179,7 @@ public class MinionList
*/
public void onMasterDie(boolean force)
{
if (_master.isRaid() || force)
if ((_master.isRaid() && !KEEP_MINION_AFTER_DEATH_BOSS_IDS.contains(_master.getId())) || force)
{
deleteSpawnedMinions();
}