summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-09 15:12:53 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-09 15:12:53 +0000
commit6bd0769c68ca86c5454a360f46d0facbbc75cfe5 (patch)
tree91bffd583777704b9ebb1d00e2831ea2faed59eb /src/char
parent8711b3099048ccacaa84f52fef06e4c6ded4aa4b (diff)
downloadhercules-6bd0769c68ca86c5454a360f46d0facbbc75cfe5.tar.gz
hercules-6bd0769c68ca86c5454a360f46d0facbbc75cfe5.tar.bz2
hercules-6bd0769c68ca86c5454a360f46d0facbbc75cfe5.tar.xz
hercules-6bd0769c68ca86c5454a360f46d0facbbc75cfe5.zip
- Fixed @mapinfo displaying incorrectly maps with nosave which send you back to your last savepoint.
- Moved guild_exp_rate from a mapserver battle config setting to a char server config. It no longer modifies the total taxed exp as seen on the guild information window, but directly modifies the exp that the guild earns. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7074 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c3
-rw-r--r--src/char/char.h2
-rw-r--r--src/char/int_guild.c22
3 files changed, 20 insertions, 7 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 78ad37146..5a9b2668a 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -127,6 +127,7 @@ int save_log = 1;
int start_zeny = 500;
int start_weapon = 1201;
int start_armor = 2301;
+int guild_exp_rate = 100;
//Custom limits for the fame lists. [Skotlex]
int fame_list_size_chemist = MAX_FAME_LIST;
@@ -4107,6 +4108,8 @@ int char_config_read(const char *cfgName) {
ShowWarning("Max fame list size is %d (fame_list_taekwon)\n", MAX_FAME_LIST);
fame_list_size_taekwon = MAX_FAME_LIST;
}
+ } else if (strcmpi(w1, "guild_exp_rate") == 0) {
+ guild_exp_rate = atoi(w2);
} else if (strcmpi(w1, "import") == 0) {
char_config_read(w2);
}
diff --git a/src/char/char.h b/src/char/char.h
index dfec9104f..773532035 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -44,5 +44,5 @@ extern int char_name_option;
extern char char_name_letters[];
extern int autosave_interval;
extern char db_path[];
-
+extern int guild_exp_rate;
#endif
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 3cd5572d9..a676de285 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -4,6 +4,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#include "../common/mmo.h"
#include "../common/socket.h"
@@ -1205,12 +1206,21 @@ int mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int
g->member[i].position = *((int *)data);
break;
case GMI_EXP: // EXP
- {
- unsigned int exp, oldexp = g->member[i].exp;
- exp = g->member[i].exp = *((unsigned int *)data);
- g->exp += (exp - oldexp);
- guild_calcinfo(g); // LvƒAƒbƒv”»’f
- mapif_guild_basicinfochanged(guild_id, GBI_EXP, &g->exp, 4);
+ {
+ unsigned int exp, old_exp=g->member[i].exp;
+ g->member[i].exp=*((unsigned int *)data);
+ if (g->member[i].exp > old_exp)
+ {
+ exp = g->member[i].exp - old_exp;
+ if (guild_exp_rate != 100)
+ exp = exp*guild_exp_rate/100;
+ if (exp > UINT_MAX - g->exp)
+ g->exp = UINT_MAX;
+ else
+ g->exp+=exp;
+ guild_calcinfo(g);
+ mapif_guild_basicinfochanged(guild_id,GBI_EXP,&g->exp,4);
+ }
break;
}
case GMI_HAIR: