I have a modification of command @reloadscript that was performed by Shiraz, a member of brAthena community would like the help of you to be leaving the command compatible with Hercules.
Simple modification where you can choose to recharge only NPCs, or NPCs and mobs. Useful for those who do not want to relive MvPs after using the command.
@reloadscript: reloads scripts not mob ;@reloadscript mobscript: reloads all scripts;
Modification
Index: src/map/atcommand.c===================================================================--- src/map/atcommand.c (revision 1514)+++ src/map/atcommand.c (working copy)@@ -3702,6 +3702,7 @@ *------------------------------------------*/ ACMD_FUNC(reloadscript) {+ char arg[12]; nullpo_retr(-1, sd); //atcommand_broadcast( fd, sd, "@broadcast", "Server is reloading scripts..." ); //atcommand_broadcast( fd, sd, "@broadcast", "You will feel a bit of lag at this point !" );@@ -3709,7 +3710,8 @@ flush_fifos(); map_reloadnpc(true); // reload config files seeking for npcs script_reload();- npc_reload();+ snprintf(arg, sizeof(arg), "%s", message);+ npc_reload(arg); clif_displaymessage(fd, msg_txt(100)); // Scripts have been reloaded. Index: src/map/npc.c===================================================================--- src/map/npc.c (revision 1514)+++ src/map/npc.c (working copy)@@ -3635,7 +3635,7 @@ } //Clear then reload npcs files-int npc_reload(void) {+int npc_reload(char arg[]) { struct npc_src_list *nsl; int m, i; int npc_new_min = npc_id;@@ -3662,13 +3662,14 @@ npc_unload((struct npc_data *)bl, false); break; case BL_MOB:- unit_free(bl,CLR_OUTSIGHT);+ if(!strcmp(arg, "mobscript"))+ unit_free(bl,CLR_OUTSIGHT); break; } } mapit_free(iter); - if(battle_config.dynamic_mobs)+ if(battle_config.dynamic_mobs && !strcmp(arg, "mobscript")) {// dynamic check by [random] for (m = 0; m < map_num; m++) { for (i = 0; i < MAX_MOB_LIST_PER_MAP; i++) {@@ -3695,7 +3696,9 @@ //TODO: the following code is copy-pasted from do_init_npc(); clean it up // Reloading npcs now- for (nsl = npc_src_files; nsl; nsl = nsl->next) {+ for (nsl = npc_src_files; nsl; nsl = nsl->next){+ if(strstr(nsl->name, "npc/monstros/") && strcmp(arg, "mobscript"))+ continue; ShowStatus("Carregando arquivo de NPC: %s"CL_CLL"r", nsl->name); npc_parsesrcfile(nsl->name,false); }@@ -3706,7 +3709,7 @@ "t-'"CL_WHITE"%d"CL_RESET"' Monstrosn" "t-'"CL_WHITE"%d"CL_RESET"' Monstros em cachen" "t-'"CL_WHITE"%d"CL_RESET"' Monstros fora de cachen",- npc_id - npc_new_min, npc_warp, npc_shop, npc_script, npc_mob, npc_cache_mob, npc_delay_mob);+ npc_id - npc_new_min, npc_warp, npc_shop, npc_script, (!strcmp(arg, "mobscript")?npc_mob:0), (!strcmp(arg, "mobscript")?npc_cache_mob:0), npc_delay_mob); do_final_instance(); Index: src/map/npc.h===================================================================--- src/map/npc.h (revision 1514)+++ src/map/npc.h (working copy)@@ -154,7 +154,7 @@ int npc_remove_map(struct npc_data* nd); void npc_unload_duplicates (struct npc_data* nd); int npc_unload(struct npc_data* nd, bool single);-int npc_reload(void);+int npc_reload(char arg[]); void npc_read_event_script(void); int npc_script_event(struct map_session_data* sd, enum npce_event type);
Share this post
Link to post
Share on other sites