//===== eAthena Script =====================================
//= Vendor Control
//===== By: ================================================
//= Original by Emistry
//= Rewrite by AnnieRuru
//===== Current Version: ===================================
//= 2.0
//===== Compatible With: ===================================
//= Hercules 2015-10-29
//===== Description: =======================================
//= Vendors only vend on certain coordinate, looks tidy :P
//===== Topic ==============================================
//= http://hercules.ws/board/topic/4509-
//===== Additional Comments: ===============================
//= Emistry ... please don't simply use Bug tracker to request a core developer to get your custom script fixed
//==========================================================
#include "common/hercules.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "map/pc.h"
#include "common/mmo.h"
#include "common/HPMDataCheck.h"
// Note down the area where your players allow to vend
// this is meant to bypass the 'min_npc_vendchat_distance' check
char mapname[MAP_NAME_LENGTH] = "prontera";
int x1 = 150; // 1st element of setarray .@x
int x2 = 162; // last element of setarray .@x
int y1 = 133; // 1st element of setarray .@y
int y2 = 175; // last element of setarray .@y
HPExport struct hplugin_info pinfo = {
"VendorControl", // Plugin name
SERVER_TYPE_MAP,// Which server types this plugin works with?
"2.0", // Plugin version
HPM_VERSION, // HPM Version (don't change, macro is automatically updated)
};
bool npc_isnear_pre( struct block_list * bl ) {
TBL_PC* sd = (TBL_PC*)bl;
if ( !strcmp( mapindex_id2name(sd->mapindex), mapname ) && sd->bl.x >= x1 && sd->bl.x <= x2 && sd->bl.y >= y1 && sd->bl.y <= y2 )
hookStop();
return false;
}
HPExport void plugin_init (void) {
addHookPre( "npc->isnear", npc_isnear_pre );
}