From 963beba0da94d8b4e3d4175599c570a0b1d77ad2 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 29 Nov 2007 12:20:43 +0000 Subject: - Integrated the SG related info of hate_mob and feel_map into a single structure (sg_info). - Modified skill_blown and skill_attack so that reflected spells do not cause knockback. - SG Blessing skills now grant the extra experience to everyone when the SG killed the mob. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11840 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src/map/mob.c') diff --git a/src/map/mob.c b/src/map/mob.c index d38e4b098..5f82b4b6a 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1866,13 +1866,27 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) (!md->master_id || !md->special_state.ai) && //Only player-summoned mobs do not give exp. [Skotlex] (!map[m].flag.nobaseexp || !map[m].flag.nojobexp) //Gives Exp ) { //Experience calculation. - + int bonus = 100; //Bonus on top of your share (common to all attackers). + if (md->sc.data[SC_RICHMANKIM]) + bonus += md->sc.data[SC_RICHMANKIM]->val2; + if(sd) { + temp = status_get_class(&md->bl); + ARR_FIND(0, 3, i, temp == sd->hate_mob[i]); + if (i < 3 && ( + battle_config.allow_skill_without_day || + sg_info[i].day_func() || + (i==2 && sd->sc.data[SC_MIRACLE]) //Miracle only applies to Star target + )) + bonus += (i==2?20:10)*pc_checkskill(sd,sg_info[i].bless_id); + + if(battle_config.mobs_level_up && md->level > md->db->lv) // [Valaris] + bonus += (md->level-md->db->lv)*battle_config.mobs_level_up_exp_rate; + } for(i = 0; i < DAMAGELOG_SIZE && md->dmglog[i].id; i++) { int flag=1,zeny=0; unsigned int base_exp, job_exp; double per; //Your share of the mob's exp - int bonus; //Bonus on top of your share. if (!tmpsd[i]) continue; @@ -1897,15 +1911,8 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) per /=2.; else if(md->special_state.size==2) per *=2.; - - bonus = 100; - if (md->sc.data[SC_RICHMANKIM]) - bonus += md->sc.data[SC_RICHMANKIM]->val2; - - if(battle_config.mobs_level_up && md->level > md->db->lv) // [Valaris] - bonus += (md->level-md->db->lv)*battle_config.mobs_level_up_exp_rate; - + if(battle_config.zeny_from_mobs && md->level) { // zeny calculation moblv + random moblv [Valaris] zeny=(int) ((md->level+rand()%md->level)*per*bonus/100.); -- cgit v1.2.3-70-g09d2