Bg_monster vs bg_monster

MrSky

New member
Messages
25
Points
0
Emulator
Anyone know how make this work?

Code:
set .@mob1, bg_monster ( 1, "bat_c01", 100, 103, "Poring 1", 1002) ;set .@mob2, bg_monster ( 2, "bat_c01", 104, 103, "Poring 2", 1002) ;sleep 500 ;unitattack .@mob1, .@mob2 ;unitattack .@mob2, .@mob1 ;
 
I already started writing battleground script since eathena you know ... ?

https://www.eathena.ws/board/index.php?showtopic=276681

and another

https://rathena.org/board/topic/91274-about-mob-summoned-by-bg-monster/

battleground monsters NEVER fight each other

if you want, you have to make source modification ... probably in battle_check_target

just to double check

Code:
-	script	custom_bg#control	FAKE_NPC,{OnStart:	if ( !getwaitingroomstate( 0, "Attack Team" ) || !getwaitingroomstate( 0, "Defend Team" ) ) end;	.atkteam = waitingroom2bg( "prontera", 152,187, "", "", "Attack Team" );	.defteam = waitingroom2bg( "prontera", 160,187, "", "", "Defend Team" );	delwaitingroom "Attack Team";	delwaitingroom "Defend Team";	bg_warp .atkteam, "prontera", 152,187;	bg_warp .defteam, "prontera", 160,187;	bg_monster .atkteam, "prontera", 155,187, "--ja--", BOW_GUARDIAN_, "custom_bg#control::OnEnd";	bg_monster .defteam, "prontera", 157,187, "--ja--", BOW_GUARDIAN_, "custom_bg#control::OnEnd";	sleep 10000; // 10 seconds to kill	killmonster "prontera", "custom_bg#control::OnEnd";	bg_destroy .atkteam;	bg_destroy .defteam;	donpcevent "Attack Team::OnInit";	donpcevent "Defend Team::OnInit";	end;OnEnd://	awake strnpcinfo(0);	end;}prontera,155,182,5	script	Attack Team	1_F_MARIA,{	end;OnInit:	waitingroom "ATTACK",2,"custom_bg#control::OnStart",1;	end;}prontera,158,182,5	script	Defend Team	1_F_MARIA,{	end;OnInit:	waitingroom "DEFEND",2,"custom_bg#control::OnStart",1;	end;}prontera	mapflag	battleground
this plugin should do it
Code:
#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pc.h"#include "map/mob.h"#include "common/nullpo.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = {	"bgmobattack", // Plugin name	SERVER_TYPE_MAP,// Which server types this plugin works with?	"0.1",			// Plugin version	HPM_VERSION,	// HPM Version (don't change, macro is automatically updated)};int battle_check_target_post( int retVal, struct block_list *src, struct block_list *target, int flag ) {	int16 m = target->m;	struct block_list *s_bl = src, *t_bl = target;	nullpo_ret(src);	nullpo_ret(target);	if( (t_bl = battle->get_master(target)) == NULL )		t_bl = target;	if( (s_bl = battle->get_master(src)) == NULL )		s_bl = src;	if ( t_bl->type == BL_MOB && s_bl->type == BL_MOB && map->list[m].flag.battleground )		if ( ((TBL_MOB*)t_bl)->bg_id != ((TBL_MOB*)s_bl)->bg_id )			return 1;	return retVal;}HPExport void plugin_init (void) {	addHookPost( "battle->check_target", battle_check_target_post );}
 
Last edited by a moderator:
Hello AnnieRuru, i'm getting this error:

battle_check_target.obj : error LNK2019: unresolved external symbol _assert_report referenced in function _battle_check_target_post
My hercules is from 2014, i dont know if this is the problem :3

 
You can't use this plugin in 2014 Hercules..

2014 plugin were having many limitation..

 
that mob controller is seriously outdated

rathena already has a more update mob unit controller script commands now

ima thinking of integrate these new stuffs into my setmobdata

MOBDATA_KILLER - make the monster freely attack by anything, even other monster can attack it

MOBDATA_PLAYER - that player can't attack that monster, everyone else can

MOBDATA_PARTY - in pvp/gvg maps, the party can't attack that monster, everyone else can

MOBDATA_GUILD - in gvg maps, the guild can't attack that monster, everyone else can

bg already has *bg_monster_set_team script command so can leave it out

hmm ... need more ideas ...

 
Last edited by a moderator:
I will search it so

#edit

A check on getmobdata can be made to check if the monster is attacking/chasing anything?

 
Last edited by a moderator:
A check on getmobdata can be made to check if the monster is attacking/chasing anything?
no, getmobdata doesn't tell what is the monster doingI will code the mobevent script command later

but if you are successfully patch that mob controller system

you can use AI_ACTION_TYPE_ATTACK flag to check if the monster is attacking

ahh ... that patch doesn't include those constants, it was removed later

http://herc.ws/board/tracker/issue-7964-left-over-constants-from-mob-controller-system/

you have to re-add it

 
Back
Top