summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-05 20:51:58 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-05 20:51:58 +0000
commitce9b9e74f648f3dd52e4161d3183612ecd002f80 (patch)
treeb6069d2b4687cd979685c6d803ec93a5e54d0590 /src/map/mob.c
parentd9a43b19b761c9d1726fc971044634cd3fa917b8 (diff)
downloadhercules-ce9b9e74f648f3dd52e4161d3183612ecd002f80.tar.gz
hercules-ce9b9e74f648f3dd52e4161d3183612ecd002f80.tar.bz2
hercules-ce9b9e74f648f3dd52e4161d3183612ecd002f80.tar.xz
hercules-ce9b9e74f648f3dd52e4161d3183612ecd002f80.zip
Merging RREmu into rAthena -- quite a few stuff yet to be renamed, but we'll get it sorted.
Some of the stuff included in RREmu that is now part of rAthena: - RE Drop Rate Modifier - RE Experience Rate Modifier - RE Weapon MATK - RE Shield ASPD job-specific penalty - RE Cast Time - Renewal-specific item DEF - 3.1 classes. - All-New Mounts - Official Magical Reflection - And other perks, such as fully-functional @mapflag also merged eAthena 15006 into rAthena. For Bugs, Comments and Suggestions: http://rathena.org/board/tracker/ git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15009 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 5272b17e8..8181fb5e7 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2163,8 +2163,12 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
merc_hom_gainexp(tmpsd[i]->hd, base_exp);
if(base_exp || job_exp)
{
- if( md->dmglog[i].flag != MDLF_PET || battle_config.pet_attack_exp_to_master )
+ if( md->dmglog[i].flag != MDLF_PET || battle_config.pet_attack_exp_to_master ) {
+#if RRMODE
+ party_renewal_exp_mod(&base_exp,&job_exp,tmpsd[i]->status.base_level,md->level);
+#endif
pc_gainexp(tmpsd[i], &md->bl, base_exp, job_exp, false);
+ }
}
if(zeny) // zeny from mobs [Valaris]
pc_getzeny(tmpsd[i], zeny);
@@ -2185,6 +2189,11 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
struct item_drop_list *dlist = ers_alloc(item_drop_list_ers, struct item_drop_list);
struct item_drop *ditem;
int drop_rate;
+#if RRMODE
+ int drop_modifier = mvp_sd ? party_renewal_drop_mod(mvp_sd->status.base_level - md->level) :
+ second_sd ? party_renewal_drop_mod(second_sd->status.base_level - md->level) :
+ third_sd ? party_renewal_drop_mod(third_sd->status.base_level - md->level) : 100;
+#endif
dlist->m = md->bl.m;
dlist->x = md->bl.x;
dlist->y = md->bl.y;
@@ -2226,7 +2235,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
// Increase drop rate if user has SC_ITEMBOOST
if (sd && sd->sc.data[SC_ITEMBOOST]) // now rig the drop rate to never be over 90% unless it is originally >90%.
drop_rate = max(drop_rate,cap_value((int)(0.5+drop_rate*(sd->sc.data[SC_ITEMBOOST]->val1)/100.),0,9000));
-
+#if RRMODE
+ if( drop_modifier != 100 )
+ drop_rate = drop_rate * drop_modifier / 100;
+#endif
// attempt to drop the item
if (rand() % 10000 >= drop_rate)
continue;
@@ -2437,8 +2449,11 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
delete_timer(md->deletetimer,mob_timer_delete);
md->deletetimer = INVALID_TIMER;
}
-
- mob_deleteslave(md);
+ /**
+ * Only loops if necessary (e.g. a poring would never need to loop)
+ **/
+ if( md->can_summon )
+ mob_deleteslave(md);
map_freeblock_unlock();
@@ -2700,6 +2715,10 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
if(mobdb_checkid(value[0]) == 0)
return 0;
+ /**
+ * Flags this monster is able to summon; saves a worth amount of memory upon deletion
+ **/
+ md2->can_summon = 1;
while(count < 5 && mobdb_checkid(value[count])) count++;
if(count < 1) return 0;