@Override
protected void onDeath(final Creature killer)
{
// Check for active charm of luck for death penalty
getDeathPenalty().checkCharmOfLuck();
if (isInStoreMode())
{
setPrivateStoreType(Player.STORE_PRIVATE_NONE);
}
if (isProcessingRequest())
{
final Request request = getRequest();
if (isInTrade())
{
final Player partner = request.getOtherPlayer(this);
sendPacket(SendTradeDone.FAIL);
partner.sendPacket(SendTradeDone.FAIL);
}
request.cancel();
}
// cubicdata
deleteCubics();
deleteAgathion();
boolean checkPvp = true;
if (ServerConfig.ALLOW_CURSED_WEAPONS)
{
if (isCursedWeaponEquipped())
{
CursedWeaponsManager.getInstance().dropPlayer(this);
checkPvp = false;
}
else if (killer != null && killer.isPlayer() && killer.isCursedWeaponEquipped())
{
CursedWeaponsManager.getInstance().increaseKills(((Player) killer).getCursedWeaponEquippedId());
checkPvp = false;
}
}
if (checkPvp)
{
doPKPVPManage(killer);
altDeathPenalty(killer);
}
// And in the end of process notify death penalty that owner died :)
getDeathPenalty().notifyDead(killer);
setIncreasedForce(0);
if (isInParty() && getParty().isInReflection() && getParty().getReflection() instanceof DimensionalRift)
{
((DimensionalRift) getParty().getReflection()).memberDead(this);
}
stopWaterTask();
stopMountFeedTask();
if (!isSalvation() && isOnSiegeField() && isCharmOfCourage())
{
ask(new ConfirmDlg(SystemMsg.YOUR_CHARM_OF_COURAGE_IS_TRYING_TO_RESURRECT_YOU, 60000), new ReviveAnswerListener(this, 100, false, 60000));
setCharmOfCourage(false);
}
if (AllSettingsConfig.AltKillAnnounce && killer != null && killer.isPlayer())
AnnouncementUtils.announceToAll(killer.getName() + " убил игрока " + getName() + "!");
Player target = (Player) killer.getTarget();
if (killer instanceof Player)
target.setPkKills(target.getPkKills() + 1); // Счетчик смерти
super.onDeath(killer);
}