summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnieRuru <jeankof@ymail.com>2015-10-31 00:08:22 +0800
committerAnnieRuru <jeankof@ymail.com>2015-10-31 00:08:22 +0800
commit583ecd7e050413a4a6bd3845fb6124a3770abeb0 (patch)
tree30df861f49f7b5a9aead29ca141e3e32f5e6b45e
parent1be5817fdbefb0ad9bb760f1bc7eecdc2a7bb961 (diff)
downloadhercules-583ecd7e050413a4a6bd3845fb6124a3770abeb0.tar.gz
hercules-583ecd7e050413a4a6bd3845fb6124a3770abeb0.tar.bz2
hercules-583ecd7e050413a4a6bd3845fb6124a3770abeb0.tar.xz
hercules-583ecd7e050413a4a6bd3845fb6124a3770abeb0.zip
Add new config to allow player vend/chat room nearby hidden npc
make changes to (#837) - mske better battle_config clarification - Add FAKE_NPC constant in the source and use them - also use the HIDDEN_WARP_NPC constants
-rw-r--r--conf/battle/player.conf3
-rw-r--r--src/map/npc.c4
-rw-r--r--src/map/npc.h1
3 files changed, 5 insertions, 3 deletions
diff --git a/conf/battle/player.conf b/conf/battle/player.conf
index 4ddd3a30a..84f53af5e 100644
--- a/conf/battle/player.conf
+++ b/conf/battle/player.conf
@@ -148,7 +148,8 @@ idle_no_autoloot: 0
// Default: 3 (0: disabled).
min_npc_vendchat_distance: 3
-// Can players vend/chat room nearby hidden npc? (Ie: FAKE_NPC/HIDDEN_WARP_NPC)
+// If min_npc_vendchat_distance is enabled,
+// can players vend/chat room nearby hidden npc? (Ie: FAKE_NPC/HIDDEN_WARP_NPC)
vendchat_near_hiddennpc: no
// Super Novice's fury is enabled to increments of 10%, such as at 10.0%, 20.0% - 80.0%, 90.0%
diff --git a/src/map/npc.c b/src/map/npc.c
index 017d60fff..16fc07fe8 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -137,7 +137,7 @@ int npc_isnear_sub(struct block_list* bl, va_list args) {
if( nd->option & (OPTION_HIDE|OPTION_INVISIBLE) )
return 0;
- if( battle_config.vendchat_near_hiddennpc && ( nd->class_ == -1 || nd->class_ == 139 ) )
+ if( battle_config.vendchat_near_hiddennpc && ( nd->class_ == FAKE_NPC || nd->class_ == HIDDEN_WARP_CLASS ) )
return 0;
return 1;
@@ -4646,7 +4646,7 @@ int do_init_npc(bool minimal) {
npc->fake_nd = (struct npc_data *)aCalloc(1,sizeof(struct npc_data));
npc->fake_nd->bl.m = -1;
npc->fake_nd->bl.id = npc->get_new_npc_id();
- npc->fake_nd->class_ = -1;
+ npc->fake_nd->class_ = FAKE_NPC;
npc->fake_nd->speed = 200;
strcpy(npc->fake_nd->name,"FAKE_NPC");
memcpy(npc->fake_nd->exname, npc->fake_nd->name, 9);
diff --git a/src/map/npc.h b/src/map/npc.h
index bf3d1494d..e12f942ae 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -109,6 +109,7 @@ struct npc_data {
#define START_NPC_NUM 110000000
enum actor_classes {
+ FAKE_NPC = -1,
WARP_CLASS = 45,
HIDDEN_WARP_CLASS = 139,
WARP_DEBUG_CLASS = 722,