Jump to content
  • 0

setunitdata doesn't change mob's ATK&MATK


ymcc

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  10/09/18
  • Last Seen:  

In the past,

I use *setunitdata <GID>,UMOB_ATKMIN,<new value> in the script to change some mob's ATK.

But in the latest update,

*setunitdata can not change the mob's ATKMIN,ATKMAX,MATKMIN,MATKMAX.

How can I change mob's ATKorMATK in script now?

Please help me,thx.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.02
  • Content Count:  176
  • Reputation:   60
  • Joined:  01/11/19
  • Last Seen:  

MIN and MAX MATK are calculated values in renewal so changing them without changing the base stats they are calculated from doesn't really work. You have to change the stats they are being calculated from instead : INT, MATK (aka ATK2) and LEVEL. However, that's the theory.

In practice, I do remember I had to actually fix/update the source to make it work, as MATK wasn't even available as a thing to read/write on mobs. See : https://github.com/rathena/rathena/pull/3968

Note this is for MATK specifically, I haven't really tested any of the other stats yet. There is a good chance they are also broken.

This is how my script that scales monster strength currently looks like :

				setunitdata $@mobid[.@i], UMOB_LEVEL, getmonsterinfo( getarg(1), MOB_LV ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_MAXHP, getmonsterinfo( getarg(1), MOB_MAXHP ) * (100+3*getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_ATKMIN, getmonsterinfo( getarg(1), MOB_ATK1 ) * (100+3*getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_ATKMAX, getmonsterinfo( getarg(1), MOB_ATK2 ) * (100+3*getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_MATK, getmonsterinfo( getarg(1), MOB_MATK ) * (100+3*getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_STR, getmonsterinfo( getarg(1), MOB_STR ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_AGI, getmonsterinfo( getarg(1), MOB_AGI ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_VIT, getmonsterinfo( getarg(1), MOB_VIT ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_INT, getmonsterinfo( getarg(1), MOB_INT ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_DEX, getmonsterinfo( getarg(1), MOB_DEX ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_LUK, getmonsterinfo( getarg(1), MOB_LUK ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_DEF, getmonsterinfo( getarg(1), MOB_DEF ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_MDEF, getmonsterinfo( getarg(1), MOB_MDEF ) * (100+getarg(3)) / 150;
			

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  10/09/18
  • Last Seen:  

2 hours ago, Seravy said:

MIN and MAX MATK are calculated values in renewal so changing them without changing the base stats they are calculated from doesn't really work. You have to change the stats they are being calculated from instead : INT, MATK (aka ATK2) and LEVEL. However, that's the theory.

In practice, I do remember I had to actually fix/update the source to make it work, as MATK wasn't even available as a thing to read/write on mobs. See : https://github.com/rathena/rathena/pull/3968

Note this is for MATK specifically, I haven't really tested any of the other stats yet. There is a good chance they are also broken.

This is how my script that scales monster strength currently looks like :


				setunitdata $@mobid[.@i], UMOB_LEVEL, getmonsterinfo( getarg(1), MOB_LV ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_MAXHP, getmonsterinfo( getarg(1), MOB_MAXHP ) * (100+3*getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_ATKMIN, getmonsterinfo( getarg(1), MOB_ATK1 ) * (100+3*getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_ATKMAX, getmonsterinfo( getarg(1), MOB_ATK2 ) * (100+3*getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_MATK, getmonsterinfo( getarg(1), MOB_MATK ) * (100+3*getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_STR, getmonsterinfo( getarg(1), MOB_STR ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_AGI, getmonsterinfo( getarg(1), MOB_AGI ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_VIT, getmonsterinfo( getarg(1), MOB_VIT ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_INT, getmonsterinfo( getarg(1), MOB_INT ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_DEX, getmonsterinfo( getarg(1), MOB_DEX ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_LUK, getmonsterinfo( getarg(1), MOB_LUK ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_DEF, getmonsterinfo( getarg(1), MOB_DEF ) * (100+getarg(3)) / 150;
				setunitdata $@mobid[.@i], UMOB_MDEF, getmonsterinfo( getarg(1), MOB_MDEF ) * (100+getarg(3)) / 150;
			

 

OH, I see.

Unfortunatelythis problem still need to fix/update the source.

That mean the script is not universal.

However, thx for your answer.

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.

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.

×
×
  • Create New...