Jump to content
  • 0

Bug Atak Speed o Fix :L2Jfrozen 1132


kairu

Question

4 answers to this question

Recommended Posts


  • 0

Olá,

Não conheço muito sobre esse bug, mas tirando de base que outros jogos partilham desses problemas semelhantes, suspeito que não existe um limite para o calculo do Attack Speed(base + modifier).

Só para caso de exemplo, fui ao source dessa rev e no método getAttackSpeedMultiplier() em gameserver/model/actor/stat/CharStat.java, não existe um limitador para o calculo.

/**
* Return the Attack Speed multiplier (base+modifier) of the L2Character to get proper animations.
* @return the attack speed multiplier
*/
public final float getAttackSpeedMultiplier()
{
  if (_activeChar == null)
    return 1;

  return (float) (1.1 * getPAtkSpd() / _activeChar.getTemplate().basePAtkSpd);
}

 

Já na getPAtkSpd() que é utilizado nesse método, temos um MAX_PATK_SPEED, que controla o valor máximo que pode ser retornado no getPAtkSpd().

if (val > Config.MAX_PATK_SPEED && _activeChar instanceof L2PcInstance)
{
	val = Config.MAX_PATK_SPEED;
}

return (int) val;

 

Acredito que um dos fix deva consistir em algo semelhante ao que temos no método getPAtkSpd(), um IF ao seu final, verificando se o valor atual é maior que o máximo permitido e caso for, substituir o valor atual para o máximo permitido. Tipo assim:

/**
* Return the Attack Speed multiplier (base+modifier) of the L2Character to get proper animations.
* @return the attack speed multiplier
*/
public final float getAttackSpeedMultiplier()
{

  if (_activeChar == null)
    return 1;

  float val = (float) (1.1 * getPAtkSpd() / _activeChar.getTemplate().basePAtkSpd);
	
  if (val > Config.MAX_ATTACK_SPEED)
  {
    val = Config.MAX_ATTACK_SPEED;
  }
  
  return val;
}

 

Lembrando que esse MAX_ATTACK_SPEED deve ser uma nova variável colocada na class Config no arquivo Config.java.

NOTA: Isso é apenas um caso de exemplo, não deve servir para arrumar o problema, até porque eu não sei qual é o real problema.

Edited by GrupoBw

banner2.png.30b4e74bf5d5418afb97fb5eb86809f8.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.