Jump to content
  • 0
Tio Akima

Manipulate Mob

Question

Hello everyone, does anyone know if you have some function in SRC to manipulate a mob?
(Make him walk in the directions that you want)

I've been looking at mob.c and seen that it has mob->randomwalk()
It makes the floor mob, but for random directions ...
If I do not have any specific commands, I will have to adapt this
To make the mob walk

It is a skill that summon a Mob and move it in the direction the player has selected.
This is the idea ... And when you find a cell "Not walkable", then the mob disappears.

Can someone help me with some idea or direction.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi!

I recommend you to see the doc/script_commands.txt file and search for unit_walk, unit_attack, unit_emote, etc. Those are the commands that you are looking for and in the same documentation file are examples of how to use them!

Share this post


Link to post
Share on other sites
  • 0
16 hours ago, Arduino said:

Hi!

I recommend you to see the doc/script_commands.txt file and search for unit_walk, unit_attack, unit_emote, etc. Those are the commands that you are looking for and in the same documentation file are examples of how to use them!

Hi Arduino
 right! unit_walk, unit_attack, unit_emote

I'm looking at the commands, I'll try to apply my skill ..
I'll edit it later if you have any questions.

@EDIT:
I found this skill in SRC, I believe that is the way!

case NPC_RUN:
			{
				const int mask[8][2] = {{0,-1},{1,-1},{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1}};
				uint8 dir = (bl == src)?unit->getdir(src):map->calc_dir(src,bl->x,bl->y); //If cast on self, run forward, else run away.
				unit->stop_attack(src);
				//Run skillv tiles overriding the can-move check.
				if (unit->walktoxy(src, src->x + skill_lv * mask[dir][0], src->y + skill_lv * mask[dir][1], 2) && md)
					md->state.skillstate = MSS_WALK; //Otherwise it isn't updated in the AI.
			}
			break;

 

Edited by Tio Akima

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.