diff options
author | Haruna <haru@dotalux.com> | 2015-11-18 15:11:54 +0100 |
---|---|---|
committer | Haruna <haru@dotalux.com> | 2015-11-18 15:11:54 +0100 |
commit | 8ccf62de1675498991c5795ce1a63f414273290f (patch) | |
tree | 2680f3e1ff72c89adc694b5151833483286f0e5f | |
parent | c7f6a3daec449964459e70c0d76fadbc9fdf1345 (diff) | |
parent | 583ecd7e050413a4a6bd3845fb6124a3770abeb0 (diff) | |
download | hercules-8ccf62de1675498991c5795ce1a63f414273290f.tar.gz hercules-8ccf62de1675498991c5795ce1a63f414273290f.tar.bz2 hercules-8ccf62de1675498991c5795ce1a63f414273290f.tar.xz hercules-8ccf62de1675498991c5795ce1a63f414273290f.zip |
Merge pull request #837 from AnnieRuru/request_5
Add new config to allow player vend/chat room nearby hidden npc (#834)
-rw-r--r-- | conf/battle/player.conf | 4 | ||||
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/npc.c | 5 | ||||
-rw-r--r-- | src/map/npc.h | 1 |
5 files changed, 11 insertions, 1 deletions
diff --git a/conf/battle/player.conf b/conf/battle/player.conf index cc2655580..2682a34c7 100644 --- a/conf/battle/player.conf +++ b/conf/battle/player.conf @@ -151,6 +151,10 @@ idle_no_autoloot: 0 // Default: 3 (0: disabled). min_npc_vendchat_distance: 3 +// 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% // 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 10990f013..d1cdd19c4 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7106,6 +7106,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 eeecaaf89..68a427e72 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 9573c1c6f..6ecc22282 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_ == FAKE_NPC || nd->class_ == HIDDEN_WARP_CLASS ) ) + return 0; + return 1; } @@ -4685,7 +4688,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 60be1fbe4..e7fc16a21 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, MOB_TOMB = 565, |