Jump to content
  • 0

HELP! Clone behavior


Question

Posted

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

5 answers to this question

Recommended Posts

  • 1
Posted

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
  • 0
Posted (edited)
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
  • 0
Posted

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

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...