mob em posição fixa - duvida

K4m4r40

New member
Messages
65
Points
0
Github
K4M4R40
Emulator
Olá a todos,

Gostaria de saber se é possível fazer um MOB ficar em posição fixa(em guarda) até que alguém se aproxime dele, dando liberdade do mob seguir seu target.

Caso só de para fazer o mob ficar fixo na coordenada,
preciso editar o mob para não andar na mob db, ou por comando consigo travá-lo na coordenada?

A idéia é fazer com que,

Raydrics e Raydrics Arqueiros fiquem em posição até que alguém se aproxime.

Agradeço o suporte.

~ K4m4r40

 
Last edited by a moderator:
EX: Os guardiões da floresta em Payon.

obs: eles se movem em determinadas situações...

use como inspiração.

 
mob db:
1277,GREATEST_GENERAL,Greatest General,Greatest General,55,1575,1,510,548,3,226,26,114,30,58,30,20,25,28,20,10,12,1,0,43,0x84,200,1152,1152,384,0,0,0,0,0,0,0,7054,2000,1019,2000,1501,100,662,300,2272,1,508,250,686,100,0,0,0,0,4283,1 

tirei do script re/mobs/dungeon/pay_dun.txt

pay_dun04,0,0,0,0 monster Greatest General 1277,1,5000,0,0 


eu olhei tb o .spr do monstro direto da data do bro extraída 

e não encontrei animação que indique que ele ande =/.


A idéia é criar uma inteligência artificial para um novo nivel de dificuldade no ragnarok,

muitas idéias surgirão através disso se for possivel hehe.

Agradeço suporte.
 
 
Last edited by a moderator:
usa alguma skill q altere o MD_CANMOVE do monstro, ou melhor ainda, usa o mob controller system

 
Entendi, no caso vc está dizendo para aplicar o skill ex:
trap ou teia de aranha, para imobilizar o mob, e usar um npc de área para liberar o efeito do mob certo? algo desse tipo

Sobre o Mob Controller System, me interessei porém nunca tinha ouvido falar nisso xD, fiquei 4 anos ausente com script, devo ter perdido bastante coisa.
Existe algum tutorial aqui no fórum que explique sobre o mob controller system?

Eu irei usar essa idéia em uns 20 mapas do jogo caso ela seja realizada, talvez esse sistema resuma bastante a dificuldade.

Agradeço pelo suporte @@evilpuncker e @@JulioCF .

 
mob controller system é um algo q foi tirado do eAthena a muitos anos atrás kk única coisa q consigo pra vc é esse link :/

 
@@evilpuncker

Tem como fazer o monstro andar somente em uma área x1,y1,x2,y2 , parecido com a função do setcell?

Se tiver, o que eu teria que editar neste script abaixo?
É um pedaço de um evento pessoal do meu servidor.

OnTimer300000:Announce "Devil Square do Bre@k RO COMEÇOU AGORA!!",8;initnpctimer "Cek";set $inf,0;set $mob,55;monster "06guild_01.gat",0,0,"Ninfa Perversa",1416,10,"HiddenNpc::Ondevildead"; 


@edit

Se isso desse certo, iria ficar top os raydrics e raydrics arqueiro defendendo GH =D.
Agradeço desde já o suporte.

 
Last edited by a moderator:
vc pode copiar o código do comando cell_walkable e alterar ele pra ele funcionar só em mobs

 
Entendi, fui no script_commands, procurei por walkable

e cheguei neste local,
 

Este comando permite alterar esses sinalizadores para todas as células do mapa na especificado
(x1, y1) - (x2, y2) rectângulo.
«tipo» que define bandeira modificar. As opções possíveis incluem cell_walkable,
cell_shootable, cell_basilica. Para uma lista completa, consulte const.txt.
'flag' pode ser 0 ou 1 (0: Bandeira clara, 1: flag set).
e no const, achei essas functions do cell, 

cell_walkable 0
cell_shootable 1
cell_water 2
cell_npc 3
cell_basilica 4
cell_landprotector 5
cell_novending 6
cell_nochat 7
OS DEBAIXO SERIA PARA O CHECK certo?
 
//cell_gettype 0
cell_chkwall 1
cell_chkwater 2
cell_chkcliff 3
cell_chkpass 4
cell_chkreach 5
cell_chknopass 6
cell_chknoreach 7
//cell_chkstack 8
cell_chknpc 9
cell_chkbasilica 10
cell_chklandprotector 11
cell_chknovending 12      
cell_chknochat 13          
Pensei em criar uma área grande de cell_walkable aonde pega-se todos os mobs referente ao evento, deixando todos imóveis.
E através de um npc área, ao jogador ou jogadores se aproximarem desta npc,
iria desativar o cell_walkable liberando a movimentação dos monstros.

obiviamente iria bloquiar teleport, save nestes mapas.

Dúvida:

O cell_walkable,1;    
bloqueia o movimento de (jogadores e mobs) ou só jogadores?

 

*Caso só de jogadores, como iria fazer para bloquiar os mobs tb?

--------------------------------------------------------------------------------------------------
Obs.: irei adicionar a função do walkable no tuto do setcell que to montando,
resolvi fazer um vídeo aula, ficar renovando link é muito chato xD.

Desde já obrigado pelo suporte.



 

 
Last edited by a moderator:
evilpuncker, on 30 May 2015 - 18:48, said:

achei um tópico no eathena com exatamente oq vc quer, porém o link do diff está quebrado :/ http://www.eathena.ws/board/index.php?showtopic=230124
https://code.google.com/p/orcao/downloads/detail?name=cell_mobnopassv01_workingdiff.diff&can=2&q=
default_wink.png


depois faço 2 mirros e salvo aqui.


edit, mirror

Mirror 1 - 4shared

Code:
[URL="http://www.4shared.com/file/JrvcNrVfce/cell_mobnopassv01_workingdiff.html"]http://www.4shared.com/file/JrvcNrVfce/cell_mobnopassv01_workingdiff.html[/URL]
Mirror 2 - Mega
Code:
[URL="https://mega.co.nz/#!fgpTCQaK!hTJOQg8qwqiuVCIqtrglFyMmOEUGLebOzi7tohbmtl4"]https://mega.co.nz/#!fgpTCQaK!hTJOQg8qwqiuVCIqtrglFyMmOEUGLebOzi7tohbmtl4[/URL]
Mirror 3 - CODE
Code:
Index: db/const.txt===================================================================--- db/const.txt	(revision 14075)+++ db/const.txt	(working copy)@@ -232,6 +232,7 @@ cell_landprotector	5 cell_novending	6 cell_nochat	7+cell_nomobpass	8  //cell_gettype	0 cell_chkwall	1Index: src/map/battle.c===================================================================--- src/map/battle.c	(revision 14075)+++ src/map/battle.c	(working copy)@@ -3428,7 +3428,7 @@  *------------------------------------------*/ bool battle_check_range(struct block_list *src, struct block_list *bl, int range) {-	int d;+	int d, CHK_Type;	 nullpo_retr(false, src);	 nullpo_retr(false, bl); @@ -3453,7 +3453,12 @@	 if( d > AREA_SIZE )		 return false; // Avoid targetting objects beyond your range of sight. -	return path_search_long(NULL,src->m,src->x,src->y,bl->x,bl->y,CELL_CHKWALL);+	if (src->type == BL_MOB)+		CHK_Type = CELL_CHKMOBWALL;+	else+		CHK_Type = CELL_CHKWALL;++	return path_search_long(NULL,src->m,src->x,src->y,bl->x,bl->y,CHK_Type); }  static const struct _battle_data {Index: src/map/map.c===================================================================--- src/map/map.c	(revision 14075)+++ src/map/map.c	(working copy)@@ -1247,7 +1247,7 @@  *------------------------------------------*/ int map_search_freecell(struct block_list *src, int m, short *x,short *y, int rx, int ry, int flag) {-	int tries, spawn=0;+	int tries, CHK_Type, spawn=0;	 int bx, by;	 int rx2 = 2*rx+1;	 int ry2 = 2*ry+1;@@ -1258,6 +1258,11 @@		 return 0;	 } +	if ((src && src->type == BL_MOB) || !src) //Assume null source = mob... probably not a good idea+		CHK_Type = CELL_CHKMOBPASS;+	else+		CHK_Type = CELL_CHKREACH;+	 if (flag&1) {		 bx = *x;		 by = *y;@@ -1270,7 +1275,7 @@		 //No range? Return the target cell then....		 *x = bx;		 *y = by;-		return map_getcell(m,*x,*y,CELL_CHKREACH);+		return map_getcell(m,*x,*y,CHK_Type);	 }	 	 if (rx >= 0 && ry >= 0) {@@ -1288,7 +1293,7 @@		 if (*x == bx && *y == by)			 continue; //Avoid picking the same target tile.		 -		if (map_getcell(m,*x,*y,CELL_CHKREACH))+		if (map_getcell(m,*x,*y,CHK_Type))		 {			 if(flag&2 && !unit_can_reach_pos(src, *x, *y, 1))				 continue;@@ -2328,6 +2333,8 @@		 case CELL_GETTYPE:			 return map_cell2gat(cell); +		case CELL_CHKMOBWALL:+			if (cell.nomobpass && !cell.shootable) return 1;		 // base gat type checks		 case CELL_CHKWALL:			 return (!cell.walkable && !cell.shootable);@@ -2352,6 +2359,9 @@			 return (cell.nochat); 		 // special checks+		case CELL_CHKMOBPASS:++			if (cell.nomobpass == 1) return 0;		 case CELL_CHKPASS: #ifdef CELL_NOSTACK			 if (cell.cell_bl >= battle_config.cell_stack_limit) return 0;@@ -2359,6 +2369,8 @@		 case CELL_CHKREACH:			 return (cell.walkable); +		case CELL_CHKMOBNOPASS:+			if (cell.nomobpass == 1) return 1;		 case CELL_CHKNOPASS: #ifdef CELL_NOSTACK			 if (cell.cell_bl >= battle_config.cell_stack_limit) return 1;@@ -2402,6 +2414,7 @@		 case CELL_LANDPROTECTOR: map[m].cell[j].landprotector = flag; break;		 case CELL_NOVENDING:     map[m].cell[j].novending = flag;     break;		 case CELL_NOCHAT:        map[m].cell[j].nochat = flag;        break;+		case CELL_NOMOBPASS:     map[m].cell[j].nomobpass = flag;     break;		 default:			 ShowWarning("map_setcell: invalid cell type '%d'n", (int)cell);			 break;Index: src/map/map.h===================================================================--- src/map/map.h	(revision 14075)+++ src/map/map.h	(working copy)@@ -349,6 +349,7 @@	 CELL_LANDPROTECTOR,	 CELL_NOVENDING,	 CELL_NOCHAT,+	CELL_NOMOBPASS, } cell_t;  // used by map_getcell()@@ -370,6 +371,9 @@	 CELL_CHKLANDPROTECTOR,	 CELL_CHKNOVENDING,	 CELL_CHKNOCHAT,+	CELL_CHKMOBPASS,	// Passable by monsters, Check CELL_NOMOB then work as CELL_CHKPASS [Orcao]+	CELL_CHKMOBNOPASS,	// Used like the other No checks... seems redundant+	CELL_CHKMOBWALL,	// Mob version of CHKWALL...  } cell_chk;  struct mapcell@@ -386,7 +390,8 @@		 basilica : 1,		 landprotector : 1,		 novending : 1,-		nochat : 1;+		nochat : 1,+		nomobpass : 1;  #ifdef CELL_NOSTACK	 unsigned char cell_bl; //Holds amount of bls in this cell.Index: src/map/mob.c===================================================================--- src/map/mob.c	(revision 14075)+++ src/map/mob.c	(working copy)@@ -382,7 +382,7 @@		 map_search_freecell(bl, m, &x, &y, 1, 1, 0); 	 // if none found, pick random position on map-	if (x <= 0 || y <= 0 || map_getcell(m,x,y,CELL_CHKNOREACH))+	if (x <= 0 || y <= 0 || map_getcell(m,x,y,CELL_CHKMOBNOPASS))		 map_search_freecell(NULL, m, &x, &y, -1, -1, 1);	 	 data.x = x;@@ -477,7 +477,7 @@			 x = rand()%(x1-x0+1)+x0;			 y = rand()%(y1-y0+1)+y0;			 j++;-		} while( map_getcell(m,x,y,CELL_CHKNOPASS) && j < max );+		} while( map_getcell(m,x,y,CELL_CHKMOBNOPASS) && j < max ); 		 if( j == max )		 {// attempt to find an available cell failed@@ -1230,7 +1230,7 @@		 x+=md->bl.x;		 y+=md->bl.y; -		if((map_getcell(md->bl.m,x,y,CELL_CHKPASS)) && unit_walktoxy(&md->bl,x,y,1)){+		if((map_getcell(md->bl.m,x,y,CELL_CHKMOBPASS)) && unit_walktoxy(&md->bl,x,y,1)){			 break;		 }	 }Index: src/map/pc.c===================================================================--- src/map/pc.c	(revision 14075)+++ src/map/pc.c	(working copy)@@ -4032,10 +4032,15 @@  *------------------------------------------*/ int pc_randomwarp(struct map_session_data *sd, int type) {-	int x,y,i=0;+	int x,y,CHK_Type,i=0;	 int m; 	 nullpo_retr(0, sd); 	 m=sd->bl.m; +	if (sd->bl.type == BL_MOB)+		CHK_Type = CELL_CHKMOBNOPASS;+	else+		CHK_Type = CELL_CHKNOPASS;+@@ -4045,7 +4050,7 @@	 do{		 x=rand()%(map[m].xs-2)+1;		 y=rand()%(map[m].ys-2)+1;-	}while(map_getcell(m,x,y,CELL_CHKNOPASS) && (i++)<1000 );+	}while(map_getcell(m,x,y,CHK_Type) && (i++)<1000 ); 	 if (i < 1000)		 return pc_setpos(sd,map[sd->bl.m].index,x,y,type);Index: src/map/unit.c===================================================================--- src/map/unit.c	(revision 14075)+++ src/map/unit.c	(working copy)@@ -55,15 +55,20 @@  int unit_walktoxy_sub(struct block_list *bl) {-	int i;+	int i, CHK_Type;	 struct walkpath_data wpd;	 struct unit_data *ud = NULL; 	 nullpo_retr(1, bl);	 ud = unit_bl2ud(bl);	 if(ud == NULL) return 0;+	+	if (bl->type == BL_MOB)+		CHK_Type = CELL_CHKMOBNOPASS;+	else+		CHK_Type = CELL_CHKNOPASS; -	if( !path_search(&wpd,bl->m,bl->x,bl->y,ud->to_x,ud->to_y,ud->state.walk_easy,CELL_CHKNOPASS) )+	if( !path_search(&wpd,bl->m,bl->x,bl->y,ud->to_x,ud->to_y,ud->state.walk_easy,CHK_Type) )		 return 0; 	 memcpy(&ud->walkpath,&wpd,sizeof(wpd));@@ -565,6 +570,7 @@ //it respects the no warp flags, so it is safe to call this without doing nowarpto/nowarp checks. int unit_warp(struct block_list *bl,short m,short x,short y,int type) {+	int CHK_Type;	 struct unit_data *ud;	 nullpo_retr(0, bl);	 ud = unit_bl2ud(bl);@@ -585,10 +591,13 @@				 return 1;			 if (m != bl->m && map[m].flag.nobranch && battle_config.mob_warp&4)				 return 1;+			CHK_Type = CELL_CHKMOBNOPASS;			 break;		 case BL_PC:			 if (map[bl->m].flag.noteleport)				 return 1;+		default:+			CHK_Type = CELL_CHKNOREACH;			 break;	 }	 @@ -599,7 +608,7 @@			 return 2;			 		 }-	} else if (map_getcell(m,x,y,CELL_CHKNOREACH))+	} else if (map_getcell(m,x,y,CHK_Type))	 {	//Invalid target cell		 ShowWarning("unit_warp: Specified non-walkable target cell: %d (%s) at [%d,%d]n", m, map[m].name, x,y);		 @@ -1342,4 +1351,5 @@  *------------------------------------------*/ bool unit_can_reach_pos(struct block_list *bl,int x,int y, int easy) {+	int CHK_Type;	 nullpo_retr(false, bl);@@ -1350,2 +1360,7 @@-	return path_search(NULL,bl->m,bl->x,bl->y,x,y,easy,CELL_CHKNOREACH);+	if (bl->type == BL_MOB)+		CHK_Type = CELL_CHKMOBNOPASS;+	else+		CHK_Type = CELL_CHKNOREACH;++	return path_search(NULL,bl->m,bl->x,bl->y,x,y,easy,CHK_Type); }@@ -1355,7 +1370,7 @@  *------------------------------------------*/ bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, int easy, short *x, short *y) {-	int i;+	int i, CHK_Type;	 short dx,dy;	 nullpo_retr(false, bl);	 nullpo_retr(false, tbl);@@ -1375,9 +1390,16 @@	 dx=(dx>0)?1:((dx<0)?-1:0);	 dy=(dy>0)?1:((dy<0)?-1:0);	 -	if (map_getcell(tbl->m,tbl->x-dx,tbl->y-dy,CELL_CHKNOPASS))+	if(bl->type != BL_MOB){+		CHK_Type = CELL_CHKNOPASS;+	}+	else{+		CHK_Type = CELL_CHKMOBNOPASS;+	}++	if (map_getcell(tbl->m,tbl->x-dx,tbl->y-dy,CHK_Type))	 {	//Look for a suitable cell to place in.-		for(i=0;i<9 && map_getcell(tbl->m,tbl->x-dirx[i],tbl->y-diry[i],CELL_CHKNOPASS);i++);+		for(i=0;i<9 && map_getcell(tbl->m,tbl->x-dirx[i],tbl->y-diry[i],CHK_Type);i++);		 if (i==9) return false; //No valid cells.		 dx = dirx[i];		 dy = diry[i];@@ -1385,7 +1407,7 @@ 	 if (x) *x = tbl->x-dx;	 if (y) *y = tbl->y-dy;-	return path_search(NULL,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH);+	return path_search(NULL,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CHK_Type); } /*==========================================  * Calculates position of Pet/Mercenary/Homunculus
 
Last edited by a moderator:
Back
Top