L2jMobius essence Fix cast for teleport

Marcosl2

Знаменитый
Участник
Сообщения
12
Розыгрыши
0
Репутация
3
Реакции
5
Баллы
1 225
Хроники
  1. Prelude
Исходники
Присутствуют
Сборка
L2jmobius
On retail, the teleport cast time is not affected by casting speed or other stuff. So I make a little change in code to prevent this to happen on l2mobius assassin.

L2J_Mobius_Essence_7.1_Assassin\java\org\l2jmobius\gameserver\model\skill\SkillCaster.java
Finde calcSkillTiming and change with this
Java:
private void calcSkillTiming(Creature creature, Skill skill, int castTime)
    {
        final double timeFactor = Formulas.calcSkillTimeFactor(creature, skill);
        final double cancelTime = Formulas.calcSkillCancelTime(creature, skill);
        
        if (skill.getId() == 60018) // Skill ID of teleport, this code prevent to skill teleport be afected by casting speed
        {
            _hitTime = 4000; // retail time 4 seconds
        }
        else if (skill.getOperateType().isChanneling())
        {
            _hitTime = (int) Math.max(skill.getHitTime() - cancelTime, 0);
            _cancelTime = 2866;
        }
        else
        {
            int addedTime = 0;
            if (skill.hasEffectType(EffectType.TELEPORT) && creature.isPlayer())
            {
                switch (creature.getActingPlayer().getEinhasadOverseeingLevel())
                {
                    case 6:
                    {
                        addedTime = 2000;
                        break;
                    }
                    case 7:
                    {
                        addedTime = 3000;
                        break;
                    }
                    case 8:
                    {
                        addedTime = 4000;
                        break;
                    }
                    case 9:
                    {
                        addedTime = 5000;
                        break;
                    }
                    case 10:
                    {
                        addedTime = 6000;
                        break;
                    }
                }
            }
            
            if (castTime > -1)
            {
                _hitTime = (int) Math.max((castTime / timeFactor) - cancelTime, 0) + addedTime;
            }
            else
            {
                _hitTime = (int) Math.max((skill.getHitTime() / timeFactor) - cancelTime, 0) + addedTime;
            }
            _cancelTime = (int) cancelTime;
        }
        _coolTime = (int) (skill.getCoolTime() / timeFactor); // cooltimeMillis / timeFactor
    }
 

У Скилла тип пропиши в xml <ismagic>4 и все.

Хардкод не очень хорошая практика.
 
или заюзать параметр hitTimeLock, или какой там есть аналогичный параметр по действию у мобиуса.
 
I didn't know there was the option to put a lock on the hitime. Clearly if that option exists it will be a best practice.
 
Назад
Сверху Снизу