diff options
author | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-31 20:06:57 +0000 |
---|---|---|
committer | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-31 20:06:57 +0000 |
commit | 93c79a7017522d87e06b67af1959ecccff32cb7e (patch) | |
tree | 1ef1ed7b4a2c27499da24c7da7ecee67a3a1d760 /src | |
parent | 2a3063c4e48c78fc4f778a06349a6e87dae89f50 (diff) | |
download | hercules-93c79a7017522d87e06b67af1959ecccff32cb7e.tar.gz hercules-93c79a7017522d87e06b67af1959ecccff32cb7e.tar.bz2 hercules-93c79a7017522d87e06b67af1959ecccff32cb7e.tar.xz hercules-93c79a7017522d87e06b67af1959ecccff32cb7e.zip |
* Fixes and improvements related to MVP rewards (bugreport:1259):
- removed obsolete (since r1!) ExpPer column from mob_db
- official way to drop MVP rewards (always starts from first slot)
- added MAX_MVP_DROP as define for max possible MVP reward slots
* Updated mob_db SQL scripts.
* Removed some renewal only monsters from pre-RE mob_db (were commented out anyway).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15531 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/atcommand.c | 4 | ||||
-rw-r--r-- | src/map/mob.c | 23 | ||||
-rw-r--r-- | src/map/mob.h | 5 |
3 files changed, 14 insertions, 18 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index c723d6d73..716eb8f74 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7196,11 +7196,11 @@ ACMD_FUNC(mobinfo) clif_displaymessage(fd, atcmd_output); // mvp if (mob->mexp) { - sprintf(atcmd_output, " MVP Bonus EXP:%u %02.02f%%", mob->mexp, (float)mob->mexpper / 100); + sprintf(atcmd_output, " MVP Bonus EXP:%u", mob->mexp); clif_displaymessage(fd, atcmd_output); strcpy(atcmd_output, " MVP Items:"); j = 0; - for (i = 0; i < 3; i++) { + for (i = 0; i < MAX_MVP_DROP; i++) { if (mob->mvpitem[i].nameid <= 0 || (item_data = itemdb_exists(mob->mvpitem[i].nameid)) == NULL) continue; if (mob->mvpitem[i].p > 0) { diff --git a/src/map/mob.c b/src/map/mob.c index cc3c8e6e6..a620959ea 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2355,7 +2355,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) if(mvp_sd && md->db->mexp > 0 && !md->special_state.ai) { int log_mvp[2] = {0}; - int j; unsigned int mexp; struct item item; double exp; @@ -2378,10 +2377,8 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) if(map[m].flag.nomvploot || type&1) ; //No drops. else - for(j=0;j<3;j++) + for(i = 0; i < MAX_MVP_DROP; i++) { - i = rnd() % 3; - if(md->db->mvpitem[i].nameid <= 0) continue; if(!itemdb_exists(md->db->mvpitem[i].nameid)) @@ -3586,12 +3583,10 @@ static bool mob_parse_dbrow(char** str) memcpy(&data.status, status, sizeof(struct status_data)); status_calc_misc(&data.bl, status, db->lv); - // MVP EXP Bonus, Chance: MEXP,ExpPer + // MVP EXP Bonus: MEXP // Some new MVP's MEXP multipled by high exp-rate cause overflow. [LuzZza] exp = (double)atoi(str[30]) * (double)battle_config.mvp_exp_rate / 100.; db->mexp = (unsigned int)cap_value(exp, 0, UINT_MAX); - - db->mexpper = atoi(str[31]); //Now that we know if it is an mvp or not, apply battle_config modifiers [Skotlex] maxhp = (double)status->max_hp; @@ -3610,16 +3605,16 @@ static bool mob_parse_dbrow(char** str) status->sp = status->max_sp; // MVP Drops: MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per - for(i = 0; i < 3; i++) { + for(i = 0; i < MAX_MVP_DROP; i++) { struct item_data *id; int rate_adjust = battle_config.item_rate_mvp;; - db->mvpitem[i].nameid = atoi(str[32+i*2]); + db->mvpitem[i].nameid = atoi(str[31+i*2]); if (!db->mvpitem[i].nameid) { db->mvpitem[i].p = 0; //No item.... continue; } item_dropratio_adjust(db->mvpitem[i].nameid, class_, &rate_adjust); - db->mvpitem[i].p = mob_drop_adjust(atoi(str[33+i*2]), rate_adjust, battle_config.item_drop_mvp_min, battle_config.item_drop_mvp_max); + db->mvpitem[i].p = mob_drop_adjust(atoi(str[32+i*2]), rate_adjust, battle_config.item_drop_mvp_min, battle_config.item_drop_mvp_max); //calculate and store Max available drop chance of the MVP item if (db->mvpitem[i].p) { @@ -3635,7 +3630,7 @@ static bool mob_parse_dbrow(char** str) int rate = 0, rate_adjust, type; unsigned short ratemin, ratemax; struct item_data *id; - k = 38+i*2; + k = 31 + MAX_MVP_DROP*2 + i*2; db->dropitem[i].nameid = atoi(str[k]); if (!db->dropitem[i].nameid) { db->dropitem[i].p = 0; //No drop. @@ -3747,7 +3742,7 @@ static void mob_readdb(void) } } - sv_readdb(db_path, filename[fi], ',', 38+2*MAX_MOB_DROP, 38+2*MAX_MOB_DROP, -1, &mob_readdb_sub); + sv_readdb(db_path, filename[fi], ',', 31+2*MAX_MVP_DROP+2*MAX_MOB_DROP, 38+2*MAX_MVP_DROP+2*MAX_MOB_DROP, -1, &mob_readdb_sub); } } @@ -3775,12 +3770,12 @@ static int mob_read_sqldb(void) { // wrap the result into a TXT-compatible format char line[1024]; - char* str[38+2*MAX_MOB_DROP]; + char* str[31+2*MAX_MVP_DROP+2*MAX_MOB_DROP]; char* p; int i; lines++; - for(i = 0, p = line; i < 38 + 2*MAX_MOB_DROP; i++) + for(i = 0, p = line; i < 31+2*MAX_MVP_DROP+2*MAX_MOB_DROP; i++) { char* data; size_t len; diff --git a/src/map/mob.h b/src/map/mob.h index 2c6d882c9..0ad95ff19 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -20,6 +20,7 @@ //The number of drops all mobs have and the max drop-slot that the steal skill will attempt to steal from. #define MAX_MOB_DROP 10 +#define MAX_MVP_DROP 3 #define MAX_STEAL_DROP 7 //Min time between AI executions @@ -89,12 +90,12 @@ struct spawn_info { struct mob_db { char sprite[NAME_LENGTH],name[NAME_LENGTH],jname[NAME_LENGTH]; unsigned int base_exp,job_exp; - unsigned int mexp,mexpper; + unsigned int mexp; short range2,range3; short race2; // celest unsigned short lv; struct { int nameid,p; } dropitem[MAX_MOB_DROP]; - struct { int nameid,p; } mvpitem[3]; + struct { int nameid,p; } mvpitem[MAX_MVP_DROP]; struct status_data status; struct view_data vd; short option; |