Manipulate Mob

Tio Akima

New member
Messages
349
Points
0
Age
36
Discord
TioAkima#0636
Github
Tio Akima
Emulator
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.

 
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!

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!


Code:
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;
 
Last edited by a moderator:
Back
Top