summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/mob.c40
-rw-r--r--src/map/npc.c56
2 files changed, 38 insertions, 58 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index f43e049..1d29a22 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -152,6 +152,33 @@ mutation_scale[MOB_XP_BONUS] =
};
+// The table below indicates the `average' value for each of the statistics, or -1 if there is none.
+// This average is used to determine XP modifications for mutations. The experience point bonus is
+// based on mutation_value and mutation_base as follows:
+// (1) first, compute the percentage change of the attribute (p0)
+// (2) second, determine the absolute stat change
+// (3) third, compute the percentage stat change relative to mutation_base (p1)
+// (4) fourth, compute the XP mofication based on the smaller of (p0, p1).
+static int
+mutation_base[MOB_XP_BONUS] =
+{
+ 30, // MOB_LV
+ -1, // MOB_MAX_HP
+ 20, // MOB_STR
+ 20, // MOB_AGI
+ 20, // MOB_VIT
+ 20, // MOB_INT
+ 20, // MOB_DEX
+ 20, // MOB_LUK
+ -1, // MOB_ATK1
+ -1, // MOB_ATK2
+ -1, // MOB_ADELAY
+ -1, // MOB_DEF
+ 20, // MOB_MDEF
+ -1, // MOB_SPEED
+};
+
+
/*========================================
* Mutates a MOB. For large `direction' values, calling this multiple times will give bigger XP boni.
*----------------------------------------
@@ -2147,6 +2174,11 @@ int mob_deleteslave(struct mob_data *md)
return 0;
}
+#define DAMAGE_BONUS_COUNT 6 // max. number of players to account for
+const static double damage_bonus_factor[DAMAGE_BONUS_COUNT + 1] = {
+ 1.0, 1.0, 2.0, 2.5, 2.75, 2.9, 3.0
+};
+
/*==========================================
* It is the damage of sd to damage to md.
*------------------------------------------
@@ -2434,6 +2466,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
// 経験値の分配
for(i=0;i<DAMAGELOG_SIZE;i++){
+
int pid,base_exp,job_exp,flag=1;
double per;
struct party *p;
@@ -2451,8 +2484,11 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(job_exp < 0) job_exp = 0;
*/
//eAthena's exp formula rather than jAthena's
- per=(double)md->dmglog[i].dmg*256*(9+(double)((count > 6)? 6:count))/10/(double)max_hp;
- if(per>512) per=512;
+// per=(double)md->dmglog[i].dmg*256*(9+(double)((count > 6)? 6:count))/10/(double)max_hp;
+ // [Fate] The above is the old formula. We do a more involved computation below.
+ per = (double)md->dmglog[i].dmg * 256 / (double) max_hp; // 256 = 100% of the score
+ per *= damage_bonus_factor[count > DAMAGE_BONUS_COUNT ? DAMAGE_BONUS_COUNT : count]; // Bonus for party attack
+ if(per>512) per=512; // [Fate] Retained from before. The maximum a single individual can get is double the original value.
if(per<1) per=1;
base_exp = ((mob_db[md->class].base_exp * md->stats[MOB_XP_BONUS]) >> MOB_XP_BONUS_SHIFT) * per/256;
diff --git a/src/map/npc.c b/src/map/npc.c
index 31a0c42..849030f 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -259,62 +259,6 @@ int npc_event_export(void *key,void *data,va_list ap)
return 0;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
/*==========================================
* 全てのNPCのOn*イベント実行
*------------------------------------------