## Recommended Posts

Hello, how to increase min/max attack when adding spirit attribute and must be effective only if the player is Cleric, SM, or Voy. The idea is to have fair normal attack for magic types. Thanks in advance.

##### Share on other sites

There are some different approaches to achieve what you desire, if I understood you correctly.

One simple way I can think of is the following:

In AttrCalculate.lua, locate the function "ExAttrCheck(role)" .

After the local variables declarations, add the following:

```	if job == JOB_TYPE_SHENGZHIZHE or job == JOB_TYPE_HANGHAISHI or job == JOB_TYPE_FENGYINSHI then
mnatk = mnatk + (Sta(role) * 1 + math.pow(math.floor( Sta(role)*4/20), 2 ))  --  Or whatever formula you want to use for minimum attack
mxatk = mxatk + (Sta(role) * 1 + math.pow(math.floor( Sta(role)*4/20), 2 ))  --  Or whatever formula you want to use for maximum attack
end```

I haven't tested it tho.

##### Share on other sites
5 hours ago, Avatar said:

There are some different approaches to achieve what you desire, if I understood you correctly.

One simple way I can think of is the following:

In AttrCalculate.lua, locate the function "ExAttrCheck(role)" .

After the local variables declarations, add the following:

```
if job == JOB_TYPE_SHENGZHIZHE or job == JOB_TYPE_HANGHAISHI or job == JOB_TYPE_FENGYINSHI then
mnatk = mnatk + (Sta(role) * 1 + math.pow(math.floor( Sta(role)*4/20), 2 ))  --  Or whatever formula you want to use for minimum attack
mxatk = mxatk + (Sta(role) * 1 + math.pow(math.floor( Sta(role)*4/20), 2 ))  --  Or whatever formula you want to use for maximum attack
end```

I haven't tested it tho.

Thank you so much. This works perfectly. :)

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account. ×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.