Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
Не пропадает опыт после смерти игрока
#1
Всем привет! Собственно вот такая проблема, после смерти, опыт игрока не уменьшается. Блин, где я только эту ошибку не искал...


L2PcInstance
PHP код:
<?php 
public void doDie(L2Character killer)
{
// Kill the L2PcInstance
super.doDie(killer);

if (
killer != null)
{
if (
atEvent && killer instanceof L2PcInstance)
{
L2PcInstance pk = (L2PcInstance) killer;
pk.kills.add(getName());
}

onDieDropItem(killer); // Check if any item should be dropped

if (!isInsideZone(ZONE_PVP) && (!isGM() || Config.KARMA_DROP_GM))
{
if (
Config.ALT_GAME_DELEVEL)
{
// Reduce the Experience of the L2PcInstance in function of the calculated Death Penalty
// NOTE: deathPenalty +- Exp will update karma
if (getSkillLevel(L2Skill.SKILL_LUCKY) < 0 || getStat().getLevel() > 4)
deathPenalty((killer instanceof L2PcInstance && this.getClan() != null && ((L2PcInstance)killer).getClan() != null && ((L2PcInstance)killer).getClan().isAtWarWith(this.getClanId())));
}
else
onDieUpdateKarma(); // Update karma if delevel is not allowed
}
}

setPvpFlag(0); // Clear the pvp flag

// Unsummon the Pet
if (getPet() != null)
getPet().unSummon(this);

// Unsummon Cubics
if (_cubics.size() > 0)
{
for (
L2CubicInstance cubic : _cubics.values())
{
cubic.stopAction();
cubic.cancelDisappear();
}

_cubics.clear();
}

stopRentPet();
stopWaterTask();
}



L2Chacarcer:
PHP код:
<?php 
public void doDie(L2Character killer)
{
// Enhance soul crystals of the attacker if this L2Attackable had its soul absorbed
try {
if (
killer instanceof L2PcInstance)
{
levelSoulCrystals(killer);
}
}
catch (
Exception e) { _log.log(Level.SEVERE, "", e); }

// Distribute Exp and SP rewards to L2PcInstance (including Summon owner) that hit the L2Attackable and to their Party members
try { calculateRewards(killer); } catch (Exception e) { _log.log(Level.SEVERE, "", e); }

// Notify the Quest Engine of the L2Attackable death if necessary
try {
if (
killer instanceof L2PcInstance || killer instanceof L2SummonInstance)
{
// Get the L2PcInstance that killed the L2Attackable
L2PcInstance player = killer instanceof L2PcInstance?(L2PcInstance)killer:((L2SummonInstance)killer).getOwner();

// Get a table containing all QuestState to modify after the L2Attackable killing
QuestState[] quests = player.getQuestsForKills(this);

if (
quests != null)
{
// Go through table containing all QuestState to modify
for (QuestState qs : quests)
{
// Notify the Quest Engine of the L2Attackable death
qs.getQuest().notifyKill(this, qs);
}
}

}
}
catch (
Exception e) { _log.log(Level.SEVERE, "", e); }

// Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
super.doDie(killer);

}

Метод deathPenalty

PHP код:
<?php 
public void deathPenalty(boolean atwar)
{
// TODO Need Correct Penalty
// Get the level of the L2PcInstance
final int lvl = getLevel();

//The death steal you some Exp
double percentLost = -0.07 * lvl + 6.5;

if (
getKarma() > 0)
percentLost *= Config.RATE_KARMA_EXP_LOST;

if (
isFestivalParticipant() || atwar || isInsideZone(ZONE_SIEGE))
percentLost /= 4.0;

// Calculate the Experience loss
int lostExp = 0;
if (!
atEvent)
if (
lvl < Experience.MAX_LEVEL)
lostExp = (int) Math.round((getStat().getExpForLevel(lvl+1) - getStat().getExpForLevel(lvl)) * percentLost /100);
else
lostExp = (int) Math.round((getStat().getExpForLevel(Experience.MAX_LEVEL) - getStat().getExpForLevel(Experience.MAX_LEVEL - 1)) * percentLost /100);

// Get the Experience before applying penalty
_expBeforeDeath = getExp();

if (
Config.DEBUG)
_log.fine(getName() + " died and lost " + lostExp + " experience.");

// Set the new Experience value of the L2PcInstance
getStat().addExp(-lostExp);
}



Я не могу понять, где происходит событие, когда после смерти минусуется экспа?



Ребята, помогите пожалуйста
Ответ
#2
Тему можно закрывать. Разобрался.
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  После замены порта висит клиент TFH 3 1,339 03-27-2022, 06:45 AM
Последний пост: Nab
  Нет агра мобов после респа Kagaku 0 877 03-30-2020, 06:54 PM
Последний пост: Kagaku
  Удаляется скилл после рестарта перса ntking 2 1,596 09-10-2018, 04:47 PM
Последний пост: ntking
  Черный экран, звук есть, после выбора персонажа. Taurus2790 19 5,234 07-12-2016, 11:45 PM
Последний пост: L2scripts-Guard
  Не запускается сервер после переноса значений стат с более старой сборки project1994 4 1,525 07-10-2016, 01:05 PM
Последний пост: Emperor
  Клановое вх пустое после рестарта.. TFH 4 1,439 10-09-2015, 10:38 PM
Последний пост: Daan Raven
  перенос аукциона\осад после рестарта HiredKiller 4 1,512 09-05-2015, 08:42 AM
Последний пост: HiredKiller
  заставить игрока подобрать айтем slayer48 9 2,425 08-05-2015, 02:13 PM
Последний пост: Gawric
  Не могу убрать хиро свечение после удаление статуса Dementor 14 4,123 05-20-2015, 06:40 PM
Последний пост: Dementor
  Потеря после смерти [Shoot] 20 3,833 05-10-2015, 02:02 AM
Последний пост: Donatte

Перейти к форуму:


Пользователи, просматривающие эту тему: 1 Гость(ей)