diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-09-06 15:21:25 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-09-06 15:21:25 +0000 |
commit | 59e98faf7bfc79b13cf1f2d006d19e1c08e8d5d1 (patch) | |
tree | 61eab22a7f17de14dfc078b8c91f432fcabbdb53 /src/map/mercenary.c | |
parent | 0769d6ded1ef403ed60d7d5d010ff4cec8b02c19 (diff) | |
download | hercules-59e98faf7bfc79b13cf1f2d006d19e1c08e8d5d1.tar.gz hercules-59e98faf7bfc79b13cf1f2d006d19e1c08e8d5d1.tar.bz2 hercules-59e98faf7bfc79b13cf1f2d006d19e1c08e8d5d1.tar.xz hercules-59e98faf7bfc79b13cf1f2d006d19e1c08e8d5d1.zip |
- Renamed createmercenary to mercenary_create.
- Added other required mercenary script commands for official script.
- New Constants entries for this script.
- Update to missing configuration on mercenary skills.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13195 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mercenary.c')
-rw-r--r-- | src/map/mercenary.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 4775f9beb..84974e906 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -94,6 +94,25 @@ int mercenary_get_lifetime(struct mercenary_data *md) return (td != NULL) ? DIFF_TICK(td->tick, gettick()) : 0; } +int mercenary_get_guild(struct mercenary_data *md) +{ + int class_; + + if( md == NULL || md->db == NULL ) + return -1; + + class_ = md->db->class_; + + if( class_ >= 6017 && class_ <= 6026 ) + return ARCH_MERC_GUILD; + if( class_ >= 6027 && class_ <= 6036 ) + return SPEAR_MERC_GUILD; + if( class_ >= 6037 && class_ <= 6046 ) + return SWORD_MERC_GUILD; + + return -1; +} + int mercenary_get_faith(struct mercenary_data *md) { struct map_session_data *sd; @@ -110,8 +129,6 @@ int mercenary_get_faith(struct mercenary_data *md) return sd->status.spear_faith; if( class_ >= 6037 && class_ <= 6046 ) return sd->status.sword_faith; - else - return 0; return 0; } @@ -158,8 +175,6 @@ int mercenary_get_calls(struct mercenary_data *md) return sd->status.spear_calls; if( class_ >= 6037 && class_ <= 6046 ) return sd->status.sword_calls; - else - return 0; return 0; } @@ -231,6 +246,12 @@ int merc_delete(struct mercenary_data *md, int reply) if( !sd ) return unit_free(&md->bl, 0); + if( md->devotion_flag ) + { + md->devotion_flag = 0; + status_change_end(&sd->bl, SC_DEVOTION, -1); + } + switch( reply ) { case 0: mercenary_set_faith(md, 1); break; // +1 Loyalty on Contract ends. @@ -278,6 +299,7 @@ int merc_data_received(struct s_mercenary *merc, bool flag) sd->md = md = (struct mercenary_data*)aCalloc(1,sizeof(struct mercenary_data)); md->bl.type = BL_MER; md->bl.id = npc_get_new_npc_id(); + md->devotion_flag = 0; md->master = sd; md->db = db; |