summaryrefslogtreecommitdiff
path: root/src/map/mercenary.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-09-01 19:23:57 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-09-01 19:23:57 +0000
commitde683beed6af67c57efd4b762a9797f98d4e28c6 (patch)
tree6939979299976a6f9cec9bbb3668973cb2b1ecd8 /src/map/mercenary.c
parentf6949cdf82ae995c013d96c1ce6510ff87dfa850 (diff)
downloadhercules-de683beed6af67c57efd4b762a9797f98d4e28c6.tar.gz
hercules-de683beed6af67c57efd4b762a9797f98d4e28c6.tar.bz2
hercules-de683beed6af67c57efd4b762a9797f98d4e28c6.tar.xz
hercules-de683beed6af67c57efd4b762a9797f98d4e28c6.zip
- Mercenary Bonus Status (currently activated each mob kill for testing).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13182 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mercenary.c')
-rw-r--r--src/map/mercenary.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index b06cf89bb..36d67b52e 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -87,7 +87,7 @@ int merc_create(struct map_session_data *sd, int class_, unsigned int lifetime)
int mercenary_get_lifetime(struct mercenary_data *md)
{
const struct TimerData * td;
- if( md == NULL )
+ if( md == NULL || md->contract_timer == INVALID_TIMER )
return 0;
td = get_timer(md->contract_timer);
@@ -331,6 +331,15 @@ int mercenary_dead(struct mercenary_data *md, struct block_list *src)
return 0;
}
+int mercenary_killbonus(struct mercenary_data *md)
+{
+ const enum sc_type scs[] = { SC_MERC_FLEEUP, SC_MERC_ATKUP, SC_MERC_HPUP, SC_MERC_SPUP, SC_MERC_HITUP };
+ int index = rand() % ARRAYLENGTH(scs);
+
+ status_change_start(&md->bl, scs[index], 10000, rand()%5, 0, 0, 0, 600000, 0);
+ return 0;
+}
+
int mercenary_kills(struct mercenary_data *md)
{
md->mercenary.kill_count++;
@@ -342,6 +351,8 @@ int mercenary_kills(struct mercenary_data *md)
if( md->master )
clif_mercenary_updatestatus(md->master, SP_MERCKILLS);
+ mercenary_killbonus(md);
+
return 0;
}