Bug report moved to the new portal: Mmore.club
Detailed info: L2-scripts.com
Skype: Urchika

Our portfolio of solved reports: High Five
Our portfolio of solved reports: GOD
Our portfolio of solved reports: Classic

This forum is closed and open for viewing our work on bug reports for a long time. Thank you all !
Prev Предыдущее сообщение   Следующее сообщение Next
Старый 17.12.2013, 15:54   #1
boulanger
L2-scripts клиент Classic 1.5 + ГЕО до 1 июля
 
Аватар для boulanger
 
Регистрация: 23.09.2013
Сообщений: 437
По умолчанию Magical Evasion Not working

hello
Magical evasion is not working at all, in core at formulas it is clearly missing, only for physical attacks is made, please add ( keep in mind max evasion if 500 for magical accuracy/evasion)

Код:
 public static boolean calcHitMiss(Creature attacker, Creature target)
  {
    int chanceToHit = 88 + 2 * (attacker.getPAccuracy() - target.getPEvasionRate(attacker));

    chanceToHit = Math.max(chanceToHit, 28);
    chanceToHit = Math.min(chanceToHit, 98);

    PositionUtils.TargetDirection direction = PositionUtils.getDirectionTo(attacker, target);
    switch (1.$SwitchMap$l2s$gameserver$utils$PositionUtils$TargetDirection[direction.ordinal()])
    {
    case 1:
      chanceToHit = (int)(chanceToHit * 1.2D);
      break;
    case 2:
      chanceToHit = (int)(chanceToHit * 1.1D);
    }

    return !Rnd.chance(chanceToHit);
  }
there is also a part in code about magical skill evasion, but that also doesent depend at all on the magical accuracy or magical evasion , but only level difference as i see

Код:
 double magic_rcpt = target.calcStat(Stats.MAGIC_RESIST, attacker, skill) - attacker.calcStat(Stats.MAGIC_POWER, target, skill);
    double failChance = 4.0D * Math.max(1.0D, levelDiff) * (1.0D + magic_rcpt / 100.0D);
    if (Rnd.chance(failChance))
    {
      if (levelDiff > 9)
      {
        damage = 0.0D;
        SystemMessage2 msg = (SystemMessage2)((SystemMessage2)new SystemMessage2(SystemMsg.C1_RESISTED_C2S_MAGIC).addName(target)).addName(attacker);
        attacker.sendPacket(msg);
        target.sendPacket(msg);
      }
      else
      {
        damage /= 2.0D;
        SystemMessage2 msg = (SystemMessage2)((SystemMessage2)new SystemMessage2(SystemMsg.DAMAGE_IS_DECREASED_BECAUSE_C1_RESISTED_C2S_MAGIC).addName(target)).addName(attacker);
        attacker.sendPacket(msg);
        target.sendPacket(msg);
      }
    }

    if ((damage > 1.0D) && (Rnd.chance(target.calcStat(Stats.M_SKILL_EVASION, 0.0D, attacker, skill))))
    {
      attacker.sendPacket(new SystemMessage2(SystemMsg.C1S_ATTACK_WENT_ASTRAY).addName(attacker));
      target.sendPacket(((SystemMessage2)new SystemMessage2(SystemMsg.C1_HAS_EVADED_C2S_ATTACK).addName(target)).addName(attacker));
      damage = 0.0D;
    }

    if (damage > 0.0D) {
      attacker.displayGiveDamageMessage(target, (int)damage, crit, false, false, true);
    }
    if (calcCastBreak(target, crit)) {
      target.abortCast(false, true);
    }
    return damage;
  }
boulanger вне форума  
 

Опции темы
Опции просмотра

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

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

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


Часовой пояс GMT +4, время: 18:07.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot