summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-29 12:20:43 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-29 12:20:43 +0000
commit963beba0da94d8b4e3d4175599c570a0b1d77ad2 (patch)
tree0cd50931653f23d097fb3eef69151948bfcade07 /src/map/mob.c
parentd4f105021aa5678c771b2a6b72ab50baa61799ce (diff)
downloadhercules-963beba0da94d8b4e3d4175599c570a0b1d77ad2.tar.gz
hercules-963beba0da94d8b4e3d4175599c570a0b1d77ad2.tar.bz2
hercules-963beba0da94d8b4e3d4175599c570a0b1d77ad2.tar.xz
hercules-963beba0da94d8b4e3d4175599c570a0b1d77ad2.zip
- 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
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c27
1 files changed, 17 insertions, 10 deletions
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.);