summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorrud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-10-30 07:30:36 +0000
committerrud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-10-30 07:30:36 +0000
commitdf5609c5d94b7967b5fd7857b6a80be366821280 (patch)
treee263466bd67d2f8112d6fd21336256217685832a /src/map/pc.c
parent3aa301531937846138b34654db101ee2916fe4f5 (diff)
downloadhercules-df5609c5d94b7967b5fd7857b6a80be366821280.tar.gz
hercules-df5609c5d94b7967b5fd7857b6a80be366821280.tar.bz2
hercules-df5609c5d94b7967b5fd7857b6a80be366821280.tar.xz
hercules-df5609c5d94b7967b5fd7857b6a80be366821280.zip
Fixed Level/Drop modifier based on level difference and created a db as suggested in pid:137564. (bugreport:6585)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16842 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 7dd648715..e827e760e 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -51,6 +51,9 @@
static unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL];
static unsigned int max_level[CLASS_COUNT][2];
static unsigned int statp[MAX_LEVEL+1];
+#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
+static unsigned int level_penalty[3][RC_MAX][MAX_LEVEL*2+1];
+#endif
// h-files are for declarations, not for implementations... [Shinomori]
struct skill_tree_entry skill_tree[CLASS_COUNT][MAX_SKILL_TREE];
@@ -86,7 +89,6 @@ struct item_cd {
short nameid[MAX_ITEMDELAYS];//skill id
};
-
//Converts a class to its array index for CLASS_COUNT defined arrays.
//Note that it does not do a validity check for speed purposes, where parsing
//player input make sure to use a pcdb_checkid first!
@@ -9105,7 +9107,42 @@ int pc_del_talisman(struct map_session_data *sd,int count,int type)
clif_talisman(sd, type);
return 0;
}
+#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
+/*==========================================
+ * Renewal EXP/Itemdrop rate modifier base on level penalty
+ * 1=exp 2=itemdrop
+ *------------------------------------------*/
+int pc_level_penalty_mod(struct map_session_data *sd, struct mob_data *md, int type)
+{
+ int diff, rate = 100, i;
+
+ nullpo_ret(sd);
+ nullpo_ret(md);
+
+ diff = md->level - sd->status.base_level;
+
+ if( diff < 0 )
+ diff = MAX_LEVEL + ( ~diff + 1 );
+
+ for(i=0; i<RC_MAX; i++){
+ int tmp;
+ if( md->status.race != i ){
+ if( md->status.mode&MD_BOSS && i < RC_BOSS )
+ i = RC_BOSS;
+ else if( i <= RC_BOSS )
+ continue;
+ }
+
+ if( (tmp=level_penalty[type][i][diff]) > 0 ){
+ rate = tmp;
+ break;
+ }
+ }
+
+ return rate;
+}
+#endif
int pc_split_str(char *str,char **val,int num)
{
int i;