- 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
#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 );}
no, getmobdata doesn't tell what is the monster doingI will code the mobevent script command laterA check on getmobdata can be made to check if the monster is attacking/chasing anything?
We use essential cookies to make this site work, and optional cookies to enhance your experience.