Forráskód Böngészése

Added an exception for quest locations for memorial. (#6392)

* Updated the docs

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
Co-authored-by: Aleos <aleos89@users.noreply.github.com>
Atemo 3 éve
szülő
commit
42a1f6413b

+ 3 - 1
db/import-tmpl/quest_db.yml

@@ -42,7 +42,9 @@
 #       Element     Monster element target (default All). Valid elements are Dark, Earth, Fire, Ghost, Holy, Neutral, Poison, Undead, Water, Wind, All.
 #       MinLevel    Minimum monster level target. If not supplied but MaxLevel defined, MinLevel is 1. Set to 0 to ignore MinLevel on import. (Default: 0)
 #       MaxLevel    Maximum monster level target. Set to 0 to ignore MaxLevel on import. (Default: 0)
-#       Location    Name of hunting location from mapindex. (Default any location)
+#       Location    Map name where kills are counted. (Default any location)
+#                   On normal maps only kills of permanently spawned monsters increase the counter.
+#                   On instance maps all monster kills increase the counter.
 #       MapName     Displayed map name in quest UI. (Default: empty string)
 #   Drops:          Quest item drop targets. (Default: null)
 #     - Mob         Monster to kill. 0 will apply to all monsters. (Default: 0)

+ 3 - 1
db/pre-re/quest_db.yml

@@ -42,7 +42,9 @@
 #       Element     Monster element target (default All). Valid elements are Dark, Earth, Fire, Ghost, Holy, Neutral, Poison, Undead, Water, Wind, All.
 #       MinLevel    Minimum monster level target. If not supplied but MaxLevel defined, MinLevel is 1. Set to 0 to ignore MinLevel on import. (Default: 0)
 #       MaxLevel    Maximum monster level target. Set to 0 to ignore MaxLevel on import. (Default: 0)
-#       Location    Name of hunting location from mapindex. (Default any location)
+#       Location    Map name where kills are counted. (Default any location)
+#                   On normal maps only kills of permanently spawned monsters increase the counter.
+#                   On instance maps all monster kills increase the counter.
 #       MapName     Displayed map name in quest UI. (Default: empty string)
 #   Drops:          Quest item drop targets. (Default: null)
 #     - Mob         Monster to kill. 0 will apply to all monsters. (Default: 0)

+ 3 - 1
db/quest_db.yml

@@ -42,7 +42,9 @@
 #       Element     Monster element target (default All). Valid elements are Dark, Earth, Fire, Ghost, Holy, Neutral, Poison, Undead, Water, Wind, All.
 #       MinLevel    Minimum monster level target. If not supplied but MaxLevel defined, MinLevel is 1. Set to 0 to ignore MinLevel on import. (Default: 0)
 #       MaxLevel    Maximum monster level target. Set to 0 to ignore MaxLevel on import. (Default: 0)
-#       Location    Name of hunting location from mapindex. (Default any location)
+#       Location    Map name where kills are counted. (Default any location)
+#                   On normal maps only kills of permanently spawned monsters increase the counter.
+#                   On instance maps all monster kills increase the counter.
 #       MapName     Displayed map name in quest UI. (Default: empty string)
 #   Drops:          Quest item drop targets. (Default: null)
 #     - Mob         Monster to kill. 0 will apply to all monsters. (Default: 0)

+ 3 - 1
db/re/quest_db.yml

@@ -42,7 +42,9 @@
 #       Element     Monster element target (default All). Valid elements are Dark, Earth, Fire, Ghost, Holy, Neutral, Poison, Undead, Water, Wind, All.
 #       MinLevel    Minimum monster level target. If not supplied but MaxLevel defined, MinLevel is 1. Set to 0 to ignore MinLevel on import. (Default: 0)
 #       MaxLevel    Maximum monster level target. Set to 0 to ignore MaxLevel on import. (Default: 0)
-#       Location    Name of hunting location from mapindex. (Default any location)
+#       Location    Map name where kills are counted. (Default any location)
+#                   On normal maps only kills of permanently spawned monsters increase the counter.
+#                   On instance maps all monster kills increase the counter.
 #       MapName     Displayed map name in quest UI. (Default: empty string)
 #   Drops:          Quest item drop targets. (Default: null)
 #     - Mob         Monster to kill. 0 will apply to all monsters. (Default: 0)

+ 3 - 1
doc/yaml/db/quest_db.yml

@@ -25,7 +25,9 @@
 #       Element     Monster element target (default All). Valid elements are Dark, Earth, Fire, Ghost, Holy, Neutral, Poison, Undead, Water, Wind, All.
 #       MinLevel    Minimum monster level target. If not supplied but MaxLevel defined, MinLevel is 1. Set to 0 to ignore MinLevel on import. (Default: 0)
 #       MaxLevel    Maximum monster level target. Set to 0 to ignore MaxLevel on import. (Default: 0)
-#       Location    Name of hunting location from mapindex. (Default any location)
+#       Location    Map name where kills are counted. (Default any location)
+#                   On normal maps only kills of permanently spawned monsters increase the counter.
+#                   On instance maps all monster kills increase the counter.
 #       MapName     Displayed map name in quest UI. (Default: empty string)
 #   Drops:          Quest item drop targets. (Default: null)
 #     - Mob         Monster to kill. 0 will apply to all monsters. (Default: 0)

+ 6 - 0
src/map/quest.cpp

@@ -726,6 +726,12 @@ void quest_update_objective(struct map_session_data *sd, struct mob_data* md)
 					objective_check++;
 				if (qi->objectives[j]->mapid < 0 || (qi->objectives[j]->mapid == sd->bl.m && md->spawn != nullptr))
 					objective_check++;
+				else if (qi->objectives[j]->mapid >= 0) {
+					struct map_data *mapdata = map_getmapdata(sd->bl.m);
+
+					if (mapdata->instance_id && mapdata->instance_src_map == qi->objectives[j]->mapid)
+						objective_check++;
+				}
 			}
 
 			if (objective_check == 6 && sd->quest_log[i].count[j] < qi->objectives[j]->count)  {