diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-09-01 00:45:56 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-09-01 00:45:56 +0000 |
commit | a1ee9fdfc9e4be285a2c21fa2bcd309da89ffe43 (patch) | |
tree | 266a5e008ae6a16ca9d4d644a9cee86e7271c7d8 /src/map/mercenary.c | |
parent | bb1a4e56b358c36a7996be8d34b84e7f118f63f5 (diff) | |
download | hercules-a1ee9fdfc9e4be285a2c21fa2bcd309da89ffe43.tar.gz hercules-a1ee9fdfc9e4be285a2c21fa2bcd309da89ffe43.tar.bz2 hercules-a1ee9fdfc9e4be285a2c21fa2bcd309da89ffe43.tar.xz hercules-a1ee9fdfc9e4be285a2c21fa2bcd309da89ffe43.zip |
- Something i forget to commit mmo.h.
- Preparatives for Faith/Calls/Kills for mercenaries.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13167 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mercenary.c')
-rw-r--r-- | src/map/mercenary.c | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c index bcbba3dd1..bcc5cda9b 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -94,6 +94,86 @@ int mercenary_get_lifetime(struct mercenary_data *md) return (td != NULL) ? DIFF_TICK(td->tick, gettick()) : 0; } +int mercenary_get_faith(struct mercenary_data *md) +{ + struct map_session_data *sd; + int class_; + + if( md == NULL || md->db == NULL || (sd = md->master) == NULL ) + return 0; + + class_ = md->db->class_; + + if( class_ >= 6017 && class_ <= 6026 ) + return sd->status.arch_faith; + if( class_ >= 6027 && class_ <= 6036 ) + return sd->status.spear_faith; + if( class_ >= 6037 && class_ <= 6046 ) + return sd->status.sword_faith; + + return 0; +} + +int mercenary_set_faith(struct mercenary_data *md, int value) +{ + struct map_session_data *sd; + int class_; + + if( md == NULL || md->db == NULL || (sd = md->master) == NULL ) + return 0; + + class_ = md->db->class_; + + if( class_ >= 6017 && class_ <= 6026 ) + sd->status.arch_faith += value; + else if( class_ >= 6027 && class_ <= 6036 ) + sd->status.spear_faith += value; + else if( class_ >= 6037 && class_ <= 6046 ) + sd->status.sword_faith += value; + + return 0; +} + +int mercenary_get_calls(struct mercenary_data *md) +{ + struct map_session_data *sd; + int class_; + + if( md == NULL || md->db == NULL || (sd = md->master) == NULL ) + return 0; + + class_ = md->db->class_; + + if( class_ >= 6017 && class_ <= 6026 ) + return sd->status.arch_calls; + if( class_ >= 6027 && class_ <= 6036 ) + return sd->status.spear_calls; + if( class_ >= 6037 && class_ <= 6046 ) + return sd->status.sword_calls; + + return 0; +} + +int mercenary_set_calls(struct mercenary_data *md, int value) +{ + struct map_session_data *sd; + int class_; + + if( md == NULL || md->db == NULL || (sd = md->master) == NULL ) + return 0; + + class_ = md->db->class_; + + if( class_ >= 6017 && class_ <= 6026 ) + sd->status.arch_calls += value; + else if( class_ >= 6027 && class_ <= 6036 ) + sd->status.spear_calls += value; + else if( class_ >= 6037 && class_ <= 6046 ) + sd->status.sword_calls += value; + + return 0; +} + int mercenary_save(struct mercenary_data *md) { md->mercenary.hp = md->battle_status.hp; |