summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-02-09 21:18:26 +0100
committerGitHub <noreply@github.com>2020-02-09 21:18:26 +0100
commit481d92bfa0fac1320aebf0ab4f4ceb8365fa3ff3 (patch)
tree807314fa875ca53ab1508f347bcf5ad12e9f3348 /doc
parent9e68350a054d5ec181a40528728d8de185a4f43c (diff)
parentd84aee4cd917fd1a151d7ec0b3a2d7e32df02441 (diff)
downloadhercules-481d92bfa0fac1320aebf0ab4f4ceb8365fa3ff3.tar.gz
hercules-481d92bfa0fac1320aebf0ab4f4ceb8365fa3ff3.tar.bz2
hercules-481d92bfa0fac1320aebf0ab4f4ceb8365fa3ff3.tar.xz
hercules-481d92bfa0fac1320aebf0ab4f4ceb8365fa3ff3.zip
Merge pull request #2590 from Kenpachi2k13/issue#2530
Change unload NPC behavior to kill mobs that were spawned by unloaded NPC (non-permanent monster spawns) [Issue #2530]
Diffstat (limited to 'doc')
-rw-r--r--doc/atcommands.txt34
-rw-r--r--doc/script_commands.txt5
2 files changed, 30 insertions, 9 deletions
diff --git a/doc/atcommands.txt b/doc/atcommands.txt
index 419cb0acd..0cddc1680 100644
--- a/doc/atcommands.txt
+++ b/doc/atcommands.txt
@@ -1273,31 +1273,47 @@ Example:
---------------------------------------
-@unloadnpc <npc name>
-
-Unloads an NPC.
+@unloadnpc <NPC_name> {<flag>}
+
+Unloads a NPC.
+Flag:
+ 0 - do not unload mobs spawned by NPCs in file
+ 1 - unload mobs spawned by NPCs in file
+ Default is 1; every number other than 0 will be treaten as 1.
+ Mobs that were spawned with monster/areamonster/guardian/bg_monster/atcommand("@monster xy") are affected.
+Note:
+ Be aware that some changes made by NPC are not reverted on unload.
+ Please use the OnNPCUnload label to clean things up by yourself. Commonly relevant for these script commands:
+ -> setmapflagnosave, setmapflag, removemapflags, setbattleflag, setcell, setwall
+ -> agitstart/agitstart2, agitend/agitend2, gvgon, gvgoff, pvpon, pvpoff
+ -> addmonsterdrop, setitemscript, npcshopitem, npcshopadditem, npcshopdelitem, hateffect, disguise
+ -> pcfollow, pcblockmove, setpcblock, setnpcdir, navigateto, viewpoint, add_group_command, skill/addtoskill
+ -> instance and battleground related stuff (excepting bg_monster)
Example:
-@unloadnpc Job Master
+@unloadnpc Job Master 0
---------------------------------------
-@unloadnpcfile <path>
+@unloadnpcfile <path> {<flag>}
Unloads all NPCs in a file.
+Flag: See @unloadnpc
+Note: See @unloadnpc
Example:
-@unloadnpcfile npc/custom/jobmaster.txt
+@unloadnpcfile npc/custom/jobmaster.txt 0
---------------------------------------
-@reloadnpc <path>
+@reloadnpc <path> {<flag>}
Unloads all NPCs in a file and reload it again.
-Note: Be aware that mapflags and monsters spawned directly are not removed.
+Flag: See @unloadnpc
+Note: See @unloadnpc
Example:
-@reloadnpc npc/custom/jobmaster.txt
+@reloadnpc npc/custom/jobmaster.txt 0
---------------------------------------
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 6a97bae1d..1914285f0 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -1034,6 +1034,11 @@ will only execute once and will not execute if the map server reconnects
to the char server later. Note that all those events will be executed upon
scripts reloading.
+OnNPCUnload:
+
+OnNPCUnload will be executed when a NPC is unloaded.
+OnNPCUnload is called when @reloadscript, @reloadnpc, @unloadnpc or @unloadnpcfile is used.
+
OnAgitStart:
OnAgitEnd:
OnAgitInit: