- Added constant MAX_MOB_DROP to specify the amount of normal drops a mob has. The mob_db reading code will automatically parse the file according to the number of drops expected (the Mexp/Mper and MVP item rewards must still be after the normal drops). Set to 10 currently.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6347 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
1b38364cab
commit
f8db64c952
@ -3,6 +3,10 @@ Date Added
|
|||||||
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
|
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
|
||||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||||
2006/04/28
|
2006/04/28
|
||||||
|
* Added constant MAX_MOB_DROP to specify the amount of normal drops a mob
|
||||||
|
has. The mob_db reading code will automatically parse the file according to
|
||||||
|
the number of drops expected (the Mexp/Mper and MVP item rewards must still
|
||||||
|
be after the normal drops). Set to 10 currently. [Skotlex]
|
||||||
* Mobinfo's drop list will use jName rather than Name for drop names.
|
* Mobinfo's drop list will use jName rather than Name for drop names.
|
||||||
[Skotlex]
|
[Skotlex]
|
||||||
* Some cleaning of the ASC_BREAKER code in skill_attack [Skotlex]
|
* Some cleaning of the ASC_BREAKER code in skill_attack [Skotlex]
|
||||||
|
@ -9370,7 +9370,7 @@ int atcommand_mobinfo(
|
|||||||
clif_displaymessage(fd, " Drops:");
|
clif_displaymessage(fd, " Drops:");
|
||||||
strcpy(atcmd_output, " ");
|
strcpy(atcmd_output, " ");
|
||||||
j = 0;
|
j = 0;
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < MAX_MOB_DROP; i++) {
|
||||||
if (mob->dropitem[i].nameid <= 0 || (item_data = itemdb_search(mob->dropitem[i].nameid)) == NULL)
|
if (mob->dropitem[i].nameid <= 0 || (item_data = itemdb_search(mob->dropitem[i].nameid)) == NULL)
|
||||||
continue;
|
continue;
|
||||||
if (mob->dropitem[i].p > 0) {
|
if (mob->dropitem[i].p > 0) {
|
||||||
|
@ -1940,7 +1940,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
|
|||||||
)))
|
)))
|
||||||
; //No normal loot.
|
; //No normal loot.
|
||||||
else
|
else
|
||||||
for (i = 0; i < 10; i++) { // 8 -> 10 Lupus
|
for (i = 0; i < MAX_MOB_DROP; i++) {
|
||||||
if (md->db->dropitem[i].nameid <= 0)
|
if (md->db->dropitem[i].nameid <= 0)
|
||||||
continue;
|
continue;
|
||||||
drop_rate = md->db->dropitem[i].p;
|
drop_rate = md->db->dropitem[i].p;
|
||||||
@ -3171,18 +3171,19 @@ static int mob_readdb(void)
|
|||||||
mob_db_data[class_]->amotion=atoi(str[28]);
|
mob_db_data[class_]->amotion=atoi(str[28]);
|
||||||
mob_db_data[class_]->dmotion=atoi(str[29]);
|
mob_db_data[class_]->dmotion=atoi(str[29]);
|
||||||
|
|
||||||
for(i=0;i<10;i++){ // 8 -> 10 Lupus
|
for(i=0;i<MAX_MOB_DROP;i++){
|
||||||
int rate = 0,rate_adjust,type;
|
int rate = 0,rate_adjust,type;
|
||||||
unsigned short ratemin,ratemax;
|
unsigned short ratemin,ratemax;
|
||||||
struct item_data *id;
|
struct item_data *id;
|
||||||
mob_db_data[class_]->dropitem[i].nameid=atoi(str[30+i*2]);
|
k=30+i*2;
|
||||||
|
mob_db_data[class_]->dropitem[i].nameid=atoi(str[k]);
|
||||||
if (!mob_db_data[class_]->dropitem[i].nameid) {
|
if (!mob_db_data[class_]->dropitem[i].nameid) {
|
||||||
//No drop.
|
//No drop.
|
||||||
mob_db_data[class_]->dropitem[i].p = 0;
|
mob_db_data[class_]->dropitem[i].p = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
type = itemdb_type(mob_db_data[class_]->dropitem[i].nameid);
|
type = itemdb_type(mob_db_data[class_]->dropitem[i].nameid);
|
||||||
rate = atoi(str[31+i*2]);
|
rate = atoi(str[k+1]);
|
||||||
if (class_ >= 1324 && class_ <= 1363)
|
if (class_ >= 1324 && class_ <= 1363)
|
||||||
{ //Treasure box drop rates [Skotlex]
|
{ //Treasure box drop rates [Skotlex]
|
||||||
rate_adjust = battle_config.item_rate_treasure;
|
rate_adjust = battle_config.item_rate_treasure;
|
||||||
@ -3240,9 +3241,11 @@ static int mob_readdb(void)
|
|||||||
id->mob[k].id = class_;
|
id->mob[k].id = class_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Since MAX_MOB_DROP can change, we use k as base for the rest of fields. [Skotlex]
|
||||||
|
k=30+i*2;
|
||||||
// MVP EXP Bonus, Chance: MEXP,ExpPer
|
// MVP EXP Bonus, Chance: MEXP,ExpPer
|
||||||
mob_db_data[class_]->mexp=atoi(str[50])*battle_config.mvp_exp_rate/100;
|
mob_db_data[class_]->mexp=atoi(str[k])*battle_config.mvp_exp_rate/100;
|
||||||
mob_db_data[class_]->mexpper=atoi(str[51]);
|
mob_db_data[class_]->mexpper=atoi(str[k+1]);
|
||||||
//Now that we know if it is an mvp or not,
|
//Now that we know if it is an mvp or not,
|
||||||
//apply battle_config modifiers [Skotlex]
|
//apply battle_config modifiers [Skotlex]
|
||||||
maxhp = (double)mob_db_data[class_]->max_hp;
|
maxhp = (double)mob_db_data[class_]->max_hp;
|
||||||
@ -3259,13 +3262,13 @@ static int mob_readdb(void)
|
|||||||
// MVP Drops: MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per
|
// MVP Drops: MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per
|
||||||
for(i=0;i<3;i++){
|
for(i=0;i<3;i++){
|
||||||
struct item_data *id;
|
struct item_data *id;
|
||||||
mob_db_data[class_]->mvpitem[i].nameid=atoi(str[52+i*2]);
|
mob_db_data[class_]->mvpitem[i].nameid=atoi(str[k+2+i*2]);
|
||||||
if (!mob_db_data[class_]->mvpitem[i].nameid) {
|
if (!mob_db_data[class_]->mvpitem[i].nameid) {
|
||||||
//No item....
|
//No item....
|
||||||
mob_db_data[class_]->mvpitem[i].p = 0;
|
mob_db_data[class_]->mvpitem[i].p = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mob_db_data[class_]->mvpitem[i].p= mob_drop_adjust(atoi(str[53+i*2]), battle_config.item_rate_mvp,
|
mob_db_data[class_]->mvpitem[i].p= mob_drop_adjust(atoi(str[k+3+i*2]), battle_config.item_rate_mvp,
|
||||||
battle_config.item_drop_mvp_min, battle_config.item_drop_mvp_max);
|
battle_config.item_drop_mvp_min, battle_config.item_drop_mvp_max);
|
||||||
|
|
||||||
//calculate and store Max available drop chance of the MVP item
|
//calculate and store Max available drop chance of the MVP item
|
||||||
@ -3798,18 +3801,19 @@ static int mob_read_sqldb(void)
|
|||||||
mob_db_data[class_]->amotion = TO_INT(28);
|
mob_db_data[class_]->amotion = TO_INT(28);
|
||||||
mob_db_data[class_]->dmotion = TO_INT(29);
|
mob_db_data[class_]->dmotion = TO_INT(29);
|
||||||
|
|
||||||
for (i = 0; i < 10; i++){ // 8 -> 10 Lupus
|
for (i = 0; i < MAX_MOB_DROP; i++){ // 8 -> 10 Lupus
|
||||||
int rate = 0, rate_adjust, type;
|
int rate = 0, rate_adjust, type;
|
||||||
unsigned short ratemin, ratemax;
|
unsigned short ratemin, ratemax;
|
||||||
struct item_data *id;
|
struct item_data *id;
|
||||||
mob_db_data[class_]->dropitem[i].nameid=TO_INT(30+i*2);
|
k=30+i*2;
|
||||||
|
mob_db_data[class_]->dropitem[i].nameid=TO_INT(k);
|
||||||
if (!mob_db_data[class_]->dropitem[i].nameid) {
|
if (!mob_db_data[class_]->dropitem[i].nameid) {
|
||||||
//No drop.
|
//No drop.
|
||||||
mob_db_data[class_]->dropitem[i].p = 0;
|
mob_db_data[class_]->dropitem[i].p = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
type = itemdb_type(mob_db_data[class_]->dropitem[i].nameid);
|
type = itemdb_type(mob_db_data[class_]->dropitem[i].nameid);
|
||||||
rate = TO_INT(31+i*2);
|
rate = TO_INT(k+1);
|
||||||
if (class_ >= 1324 && class_ <= 1363)
|
if (class_ >= 1324 && class_ <= 1363)
|
||||||
{ //Treasure box drop rates [Skotlex]
|
{ //Treasure box drop rates [Skotlex]
|
||||||
rate_adjust = battle_config.item_rate_treasure;
|
rate_adjust = battle_config.item_rate_treasure;
|
||||||
@ -3867,9 +3871,10 @@ static int mob_read_sqldb(void)
|
|||||||
id->mob[k].id = class_;
|
id->mob[k].id = class_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
k=30+i*2;
|
||||||
// MVP EXP Bonus, Chance: MEXP,ExpPer
|
// MVP EXP Bonus, Chance: MEXP,ExpPer
|
||||||
mob_db_data[class_]->mexp = TO_INT(50) * battle_config.mvp_exp_rate / 100;
|
mob_db_data[class_]->mexp = TO_INT(k) * battle_config.mvp_exp_rate / 100;
|
||||||
mob_db_data[class_]->mexpper = TO_INT(51);
|
mob_db_data[class_]->mexpper = TO_INT(k+1);
|
||||||
//Now that we know if it is an mvp or not,
|
//Now that we know if it is an mvp or not,
|
||||||
//apply battle_config modifiers [Skotlex]
|
//apply battle_config modifiers [Skotlex]
|
||||||
maxhp = (double)mob_db_data[class_]->max_hp;
|
maxhp = (double)mob_db_data[class_]->max_hp;
|
||||||
@ -3886,13 +3891,13 @@ static int mob_read_sqldb(void)
|
|||||||
// MVP Drops: MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per
|
// MVP Drops: MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per
|
||||||
for (i=0; i<3; i++) {
|
for (i=0; i<3; i++) {
|
||||||
struct item_data *id;
|
struct item_data *id;
|
||||||
mob_db_data[class_]->mvpitem[i].nameid = TO_INT(52+i*2);
|
mob_db_data[class_]->mvpitem[i].nameid = TO_INT(k+2+i*2);
|
||||||
if (!mob_db_data[class_]->mvpitem[i].nameid) {
|
if (!mob_db_data[class_]->mvpitem[i].nameid) {
|
||||||
//No item....
|
//No item....
|
||||||
mob_db_data[class_]->mvpitem[i].p = 0;
|
mob_db_data[class_]->mvpitem[i].p = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mob_db_data[class_]->mvpitem[i].p = mob_drop_adjust(TO_INT(53+i*2),
|
mob_db_data[class_]->mvpitem[i].p = mob_drop_adjust(TO_INT(k+3+i*2),
|
||||||
battle_config.item_rate_mvp, battle_config.item_drop_mvp_min, battle_config.item_drop_mvp_max);
|
battle_config.item_rate_mvp, battle_config.item_drop_mvp_min, battle_config.item_drop_mvp_max);
|
||||||
|
|
||||||
//calculate and store Max available drop chance of the MVP item
|
//calculate and store Max available drop chance of the MVP item
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#define MAX_RANDOMMONSTER 3
|
#define MAX_RANDOMMONSTER 3
|
||||||
#define MAX_MOB_RACE_DB 6
|
#define MAX_MOB_RACE_DB 6
|
||||||
#define MAX_MOB_DB 10000
|
#define MAX_MOB_DB 10000
|
||||||
|
#define MAX_MOB_DROP 10
|
||||||
/* Change this to increase the table size in your mob_db to accomodate
|
/* Change this to increase the table size in your mob_db to accomodate
|
||||||
a larger mob database. Be sure to note that IDs 4001 to 4048 are reserved for advanced/baby/expanded classes.
|
a larger mob database. Be sure to note that IDs 4001 to 4048 are reserved for advanced/baby/expanded classes.
|
||||||
*/
|
*/
|
||||||
@ -46,7 +47,7 @@ struct mob_db {
|
|||||||
short race2; // celest
|
short race2; // celest
|
||||||
int speed,adelay,amotion,dmotion;
|
int speed,adelay,amotion,dmotion;
|
||||||
int mexp,mexpper;
|
int mexp,mexpper;
|
||||||
struct { int nameid,p; } dropitem[10]; //8 -> 10 Lupus
|
struct { int nameid,p; } dropitem[MAX_MOB_DROP];
|
||||||
struct { int nameid,p; } mvpitem[3];
|
struct { int nameid,p; } mvpitem[3];
|
||||||
struct view_data vd;
|
struct view_data vd;
|
||||||
short option;
|
short option;
|
||||||
|
@ -2938,12 +2938,12 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl)
|
|||||||
if (skill < 1)
|
if (skill < 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
j = i = rand()%10; //Pick one mobs drop slot.
|
j = i = rand()%MAX_MOB_DROP; //Pick one mobs drop slot.
|
||||||
do {
|
do {
|
||||||
//if it's empty, we check one by one, till find an item
|
//if it's empty, we check one by one, till find an item
|
||||||
i--;
|
i--;
|
||||||
if(i<0)
|
if(i<0)
|
||||||
i=9; //9th slot
|
i=MAX_MOB_DROP-1;
|
||||||
itemid = md->db->dropitem[i].nameid;
|
itemid = md->db->dropitem[i].nameid;
|
||||||
//now try all 10 slots till success
|
//now try all 10 slots till success
|
||||||
if(itemid <= 0 || (itemdb_type(itemid) == 6 && pc_checkskill(sd,TF_STEAL) <= 5))
|
if(itemid <= 0 || (itemdb_type(itemid) == 6 && pc_checkskill(sd,TF_STEAL) <= 5))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user