Jump to content
  • 0

HELP! Clone behavior


pajodex

Question


  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  436
  • Reputation:   167
  • Joined:  12/12/17
  • Last Seen:  

Hi,

So I was able to manage to make a custom skill that creates a slave clone, However, It doesn't use any skills, just basic attack. What mode should I put to make it use skills too?

I tried MD_AGGRESSIVE/MD_ANGRY But it makes them idle like rock (see image 1). I'm using MD_NONE because it makes them move like clones but doesn't do any skills. (image 2)

I also tried Flag 1 but it crashes the client.

mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, MD_NONE, 2, 20000);

image.thumb.png.9f8e8cef1b30ac52a28ca651587e3aa5.png

image 1

image.thumb.png.89b2d7cb401f6c9adc90ac90a6fe0b58.png

Image 2

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   3
  • Joined:  04/16/12
  • Last Seen:  

I cant help that much since I dont have that much know knowledge about c++ or rathena in general.
But I'm working on something similear that I can't get working the way I want it to.

I think your problem could be that you only use 1 mode instead of putting them together.
BUILDIN_FUNC(clone) in script.cpp used mode=static_cast<e_mode>(script_getnum(st,8)); to convert the string into modes.

So maybe using static_cast<e_mode>(your modes) would do the trick?

So as a example in your case:

mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, static_cast<e_mode>(0x3885), 2, 20000);

This made my clones able to attack and use skills.
I have no idea what the static_cast thingy is actually there for though, and just copied what I thought was right.
So you probably still have to try around and see what you actually have to take there.

If it helps let me know. :D
 

  • Upvote 1
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  436
  • Reputation:   167
  • Joined:  12/12/17
  • Last Seen:  

15 hours ago, Creobnil said:

I cant help that much since I dont have that much know knowledge about c++ or rathena in general.
But I'm working on something similear that I can't get working the way I want it to.

I think your problem could be that you only use 1 mode instead of putting them together.
BUILDIN_FUNC(clone) in script.cpp used mode=static_cast<e_mode>(script_getnum(st,8)); to convert the string into modes.

So maybe using static_cast<e_mode>(your modes) would do the trick?

So as a example in your case:


mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, static_cast<e_mode>(0x3885), 2, 20000);

This made my clones able to attack and use skills.
I have no idea what the static_cast thingy is actually there for though, and just copied what I thought was right.
So you probably still have to try around and see what you actually have to take there.

If it helps let me know. :D
 

I love you :* 

May I ask where did you get those modes? XD

Edited by pajodex
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   3
  • Joined:  04/16/12
  • Last Seen:  

Glad I could help. :>
In the doc folder is a mob_db_mode_list.txt with all the modes available. :D

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  275
  • Reputation:   23
  • Joined:  01/06/13
  • Last Seen:  

@pajodex I'm trying to make my own clone skill. but I keep crashing the map-server with a segmentation error.

Can you help explain to me the values for this function?

int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, enum e_mode mode, int flag, unsigned int duration);

I'd like to understand the code so I can manipulate it according to my will. ?

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   26
  • Joined:  11/20/11
  • Last Seen:  

you guys able to solve the errors when the slave attacking mobs then spam crash errors?

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