Jump to content
  • 0
MrSky

Bg_monster vs bg_monster

Question

Anyone know how make this work?

 

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 ;

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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

-	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
#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 );}
Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

I will search it so

 

#edit

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

Edited by MrSky

Share this post


Link to post
Share on other sites
  • 0

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 doing

I 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

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.