diff options
author | AnnieRuru <jeankof@ymail.com> | 2015-10-29 17:12:02 +0800 |
---|---|---|
committer | AnnieRuru <jeankof@ymail.com> | 2015-10-29 17:12:02 +0800 |
commit | 1be5817fdbefb0ad9bb760f1bc7eecdc2a7bb961 (patch) | |
tree | 18874c88ef96d35bfac78220783303ed76147710 | |
parent | 6abd0fb8b1bbfe2101cc68503897b0449027fb3d (diff) | |
download | hercules-1be5817fdbefb0ad9bb760f1bc7eecdc2a7bb961.tar.gz hercules-1be5817fdbefb0ad9bb760f1bc7eecdc2a7bb961.tar.bz2 hercules-1be5817fdbefb0ad9bb760f1bc7eecdc2a7bb961.tar.xz hercules-1be5817fdbefb0ad9bb760f1bc7eecdc2a7bb961.zip |
Add new config to allow player vend/chat room nearby hidden npc (#834)
credit to Emistry for the idea
-rw-r--r-- | conf/battle/player.conf | 3 | ||||
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/npc.c | 3 |
4 files changed, 8 insertions, 0 deletions
diff --git a/conf/battle/player.conf b/conf/battle/player.conf index babd6cfc3..4ddd3a30a 100644 --- a/conf/battle/player.conf +++ b/conf/battle/player.conf @@ -148,6 +148,9 @@ 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) +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% // Changing snovice_call_type config to 1 enables its use at 0%, for maxed super novices. // default: 0 diff --git a/src/map/battle.c b/src/map/battle.c index 1cbc3baa5..ba640fedf 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7103,6 +7103,7 @@ static const struct battle_data { { "mvp_tomb_enabled", &battle_config.mvp_tomb_enabled, 1, 0, 1 }, { "feature.atcommand_suggestions", &battle_config.atcommand_suggestions_enabled, 0, 0, 1 }, { "min_npc_vendchat_distance", &battle_config.min_npc_vendchat_distance, 3, 0, 100 }, + { "vendchat_near_hiddennpc", &battle_config.vendchat_near_hiddennpc, 0, 0, 1 }, { "atcommand_mobinfo_type", &battle_config.atcommand_mobinfo_type, 0, 0, 1 }, { "homunculus_max_level", &battle_config.hom_max_level, 99, 0, MAX_LEVEL, }, { "homunculus_S_max_level", &battle_config.hom_S_max_level, 150, 0, MAX_LEVEL, }, diff --git a/src/map/battle.h b/src/map/battle.h index 0ebc0aeb9..55ddf3b9b 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -471,6 +471,7 @@ struct Battle_Config { int atcommand_suggestions_enabled; int min_npc_vendchat_distance; + int vendchat_near_hiddennpc; int atcommand_mobinfo_type; int mob_size_influence; // Enable modifications on earned experience, drop rates and monster status depending on monster size. [mkbu95] diff --git a/src/map/npc.c b/src/map/npc.c index 7044fefcf..017d60fff 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -137,6 +137,9 @@ 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 ) ) + return 0; + return 1; } |