Jump to content
  • 0

setunitdata parameters, what are these for?


Lord Ganja

Question


  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

Can anyone explain to me what are these parameters for? and how to use it?

Idk how to use them since there's not further explanation on the script commands doc.

Thanks in advance!

 

UMOB_MASTERAID
UMOB_AI
UMOB_SCOPTION
UMOB_SLAVECPYMSTRMD
UMOB_DMGIMMUNE

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

don't know why, but I feel  the urge to answer this particular topic
... hmph ... some of them actually rip off my source code actually...
1st thing that you need to know is, this rathena unit controller script command is based on mob controller script commands
which you can find them here 
 

case UMOB_MASTERAID: md->master_id = value; break;

the master GID of the monster
the original mob controller system has *mobattach script command, which is missing in rathena
means, yes, if you attach a monster to a player, you can use this constant to check this particular monster belongs to which player

for example, in that script I link the to, pet vs pet system
if AI_ACTION_TYPE_ATTACK is triggered, that mob controller system doesn't have a RID attached
so have to check the target it was killed with AI_ACTION_TAR, which push the GID of the unit it killed
then we can use UMOB_MASTERAID of the AI_ACTION_TAR to know the winner of the duel

if you don't understand, don't worry, I haven't code mobevent script command yet
once I did it, rathena will going to have it anyway, so you can play with it later
so, this is currently useless until I make the mobevent script command
 

case UMOB_AI: md->special_state.ai = (enum mob_ai)value; break;

the special_state ai is defined, in rathena, here
https://github.com/rathena/rathena/blob/master/src/map/map.h#L385
... seriously this should go inside mob.h ...
from the PM you talk to me earlier, you should be able to read the source code to understand how to search these AI_ constants ...
 

case UMOB_SCOPTION: md->sc.option = (unsigned short)value; break;

similar to player's setoption
https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L3451
in theory, if you setoption it with OPTION_HIDE, the monster will hide permanently until it dead
(unsigned short) .. ? LOL this is funny XD

case UMOB_SLAVECPYMSTRMD: md->state.copy_master_mode = value > 0 ? 1 : 0; if (value > 0) { TBL_MOB *md2 = map_id2md(md->master_id); md->status.mode = md2->status.mode; } break;

this is currently useless, mobattach script command can attach to the player, and can also attach to another mob
yes, attach to another mob, then copy the master's mode, which is master's UMOB_MODE
without mobattach script command, this is useless
 

case UMOB_DMGIMMUNE: md->ud.immune_attack = (bool)value > 0 ? 1 : 0; break;

immune attack should be self explain
you can find the responsible line here
https://github.com/rathena/rathena/blob/master/src/map/battle.c#L7413
if the battle_check_target function return 0; you know what it means right ?

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

Thank you for the explanation, glad that you somehow answer a question posted in rathena. LOL :)

Guess I'll just have to wait for your mobevent patch to be released in hercules. Hope it wouldn't be a plugin. xD

I also found it useful since the script im working on requires lot of mob tweaks.

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...