From 19aa33a5f61f0996d76d19db7dbe9d81f5daa090 Mon Sep 17 00:00:00 2001 From: smokexyz Date: Sat, 30 Jun 2018 04:20:03 +0100 Subject: Implementation of the official Achievement System. Source: http://ro.gnjoy.com/news/update/View.asp?seq=163&curpage=1 Script Commands - ``` achievement_progress(,,,{,}); ``` Includes an achievement_db.conf generator that reads from the item_db, mob_db (server side) and achievement_list.lub files to determine valid achievement entries based on item/monster availability. Achievements containing unsupported entries are commented out. This feature, although renewal-only in official servers, is capable of being used in pre-renewal mode on Hercules. Does not include the title system yet. A big thanks to - @MishimaHaruna for constantly reviewing. @4144 for all the support. @Asheraf for a lot of official information. Co-authored-by: "Dastgir" --- src/map/mob.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/map/mob.c') diff --git a/src/map/mob.c b/src/map/mob.c index 0dbff9211..27039490c 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -44,6 +44,7 @@ #include "map/script.h" #include "map/skill.h" #include "map/status.h" +#include "map/achievement.h" #include "common/HPM.h" #include "common/cbasetypes.h" #include "common/conf.h" @@ -2188,6 +2189,10 @@ static void mob_damage(struct mob_data *md, struct block_list *src, int damage) if (src) mob->log_damage(md, src, damage); md->dmgtick = timer->gettick(); + + // Achievements [Smokexyz/Hercules] + if (src != NULL && src->type == BL_PC) + achievement->validate_mob_damage(BL_UCAST(BL_PC, src), damage, false); } if (battle_config.show_mob_info&3) @@ -2420,6 +2425,8 @@ static int mob_dead(struct mob_data *md, struct block_list *src, int type) } if(zeny) // zeny from mobs [Valaris] pc->getzeny(tmpsd[i], zeny, LOG_TYPE_PICKDROP_MONSTER, NULL); + + achievement->validate_mob_kill(tmpsd[i], md->db->mob_id); // Achievements [Smokexyz/Hercules] } } -- cgit v1.2.3-70-g09d2