Не пропадает опыт после смерти игрока - Форум администраторов игровых серверов
Форум администраторов игровых серверов StormWall - Защита от DDos атак
Регистрация Мнения Справка Сообщество Календарь
Вернуться   Форум администраторов игровых серверов > MMO > Lineage II

Lineage II
Дискуссии на тему создания, настройки и обслуживания серверов Lineage 2. При поддержке: Премиум услуги по рекламе

Ответ
Опции темы
Непрочитано 07.04.2020, 17:27   #1
Пользователь

Автор темы (Топик Стартер) Не пропадает опыт после смерти игрока

Всем привет! Собственно вот такая проблема, после смерти, опыт игрока не уменьшается. Блин, где я только эту ошибку не искал...


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

        if (
killer != null)
        {
            if (
atEvent && killer instanceof L2PcInstance)
            {
                
L2PcInstance pk = (L2PcInstancekiller;
                
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) < || 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 код:
    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(thisqs);
                    }
                }
                
            }
        } 
        catch (
Exception e) { _log.log(Level.SEVERE""e); }

        
// Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
        
super.doDie(killer);
        
    } 
Метод deathPenalty

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);
    } 


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



Ребята, помогите пожалуйста
Magican вне форума Ответить с цитированием
Непрочитано 07.04.2020, 18:41   #2
Пользователь

Автор темы (Топик Стартер) Re: Не пропадает опыт после смерти игрока

Тему можно закрывать. Разобрался.
Magican вне форума Ответить с цитированием
Ответ


Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход

Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
пропадает кот после спавна, help Semper Lineage II 3 06.07.2013 22:59
Возрождение после смерти Map Lineage II 12 16.06.2013 11:32
Баф после смерти Klinz Lineage II 3 19.06.2012 18:30
Скил который не пропадает после смерти eleminator Серверная часть 6 17.05.2011 14:01
бафф после смерти ATOM Lineage II 6 13.07.2008 15:06


© 2007–2024 «Форум администраторов игровых серверов»
Защита сайта от DDoS атак — StormWall
Работает на Булке неизвестной версии с переводом от zCarot
Текущее время: 11:13. Часовой пояс GMT +3.

Вверх