summaryrefslogtreecommitdiff
path: root/src/map/party.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/party.c')
-rw-r--r--src/map/party.c63
1 files changed, 58 insertions, 5 deletions
diff --git a/src/map/party.c b/src/map/party.c
index 9649505b4..f47f8e5c9 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -566,7 +566,7 @@ int party_member_withdraw(int party_id, int account_id, int char_id)
ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == account_id && p->party.member[i].char_id == char_id );
if( i < MAX_PARTY )
{
- clif_party_withdraw(p,sd,account_id,p->party.member[i].name,0x00);
+ clif_party_withdraw(p,sd,account_id,p->party.member[i].name,0x0);
memset(&p->party.member[i], 0, sizeof(p->party.member[0]));
memset(&p->data[i], 0, sizeof(p->data[0]));
p->party.count--;
@@ -912,13 +912,64 @@ int party_send_xy_clear(struct party_data *p)
}
return 0;
}
-
+#if RRMODE
+/**
+ * Renewal Drop Earning Modifier
+ **/
+int party_renewal_drop_mod(int diff) {
+ if( diff >= -10 && diff <= 5 )
+ return 100;//no change.
+ if( diff > 0 ) {
+ if( diff > 5 && diff < 10 )
+ return 90;
+ if( diff > 9 && diff < 15 )
+ return 75;
+ if( diff > 14 && diff < 30 )
+ return 60;
+ } else {
+ if( diff <= -10 && diff <= -14 )
+ return 75;//75%
+ }
+ //other chases: 50%
+ return 50;
+}
+/**
+ * Renewal Experience Earning Mode
+ **/
+void party_renewal_exp_mod(unsigned int *base_exp, unsigned int *job_exp, int lvl, int moblvl) {
+ int diff = lvl - moblvl, boost = 0;
+ //-2 ~ +5: 100%
+ if( diff >= -2 && diff <= 5 )
+ return;//we don't change anything, it's 100% boost
+ //-3 ~ -10: +5% boost for each
+ if( diff >= -10 && diff <= -3 )
+ boost = 100 + (( -diff * 5 ) - 15 );
+ // 40% boost if difference is <= -10
+ else if ( diff <= -10 )
+ boost = 40;
+ else {
+ boost = ( diff > 5 && diff < 11 ) ? 95 :
+ ( diff > 10 && diff < 16 ) ? 90 :
+ ( diff > 15 && diff < 21 ) ? 85 :
+ ( diff > 20 && diff < 26 ) ? 60 :
+ ( diff > 25 && diff < 31 ) ? 35 :
+ 10;
+ }
+ if( *base_exp )
+ *base_exp = (unsigned int)cap_value(*base_exp * boost / 100, 1, UINT_MAX);
+ if( *job_exp )
+ *job_exp = (unsigned int)cap_value(*job_exp * boost / 100, 1, UINT_MAX);
+ return;
+}
+#endif
// exp share and added zeny share [Valaris]
int party_exp_share(struct party_data* p, struct block_list* src, unsigned int base_exp, unsigned int job_exp, int zeny)
{
struct map_session_data* sd[MAX_PARTY];
unsigned int i, c;
-
+#if RRMODE
+ int src_lvl = status_get_lv(src);
+#endif
nullpo_ret(p);
// count the number of players eligible for exp sharing
@@ -945,8 +996,10 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
zeny = (unsigned int) cap_value(zeny * bonus/100, INT_MIN, INT_MAX);
}
- for (i = 0; i < c; i++)
- {
+ for (i = 0; i < c; i++) {
+#if RRMODE
+ party_renewal_exp_mod(&base_exp,&job_exp,sd[i]->status.base_level,src_lvl);
+#endif
pc_gainexp(sd[i], src, base_exp, job_exp, false);
if (zeny) // zeny from mobs [Valaris]
pc_getzeny(sd[i],zeny);