summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-13 18:58:14 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-13 18:58:14 +0000
commit44ade8dfd6c775c9c2c0e47f049e2b99807ed3c1 (patch)
tree8e45d475ad540ecfa2fc4591213c477e9bacbf68 /src/map/mob.c
parent7751fc21990d18f215dff82669a470b7c3660b11 (diff)
downloadhercules-44ade8dfd6c775c9c2c0e47f049e2b99807ed3c1.tar.gz
hercules-44ade8dfd6c775c9c2c0e47f049e2b99807ed3c1.tar.bz2
hercules-44ade8dfd6c775c9c2c0e47f049e2b99807ed3c1.tar.xz
hercules-44ade8dfd6c775c9c2c0e47f049e2b99807ed3c1.zip
- Made Land Protector Block Hammerfall.
- More signed/unsigned comparison fixes. - Added dummy_item variable to itemdb. It will be used on all itemdb_searches that do not yield a valid item from the db. - Added itemdb_load, which is the one used for item_db loading (if the item does not exists, it'll be created) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5270 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 7400bbc77..ac53f77c2 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4310,6 +4310,11 @@ static int mob_readdb(void)
int rate = 0,rate_adjust,type,ratemin,ratemax;
struct item_data *id;
mob_db_data[class_]->dropitem[i].nameid=atoi(str[29+i*2]);
+ if (!mob_db_data[class_]->dropitem[i].nameid) {
+ //No drop.
+ mob_db_data[class_]->dropitem[i].p = 0;
+ continue;
+ }
type = itemdb_type(mob_db_data[class_]->dropitem[i].nameid);
rate = atoi(str[30+i*2]);
if (class_ >= 1324 && class_ <= 1363)
@@ -4378,9 +4383,13 @@ static int mob_readdb(void)
// MVP Drops: MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per
for(i=0;i<3;i++){
struct item_data *id;
- int rate=atoi(str[52+i*2]);
mob_db_data[class_]->mvpitem[i].nameid=atoi(str[51+i*2]);
- mob_db_data[class_]->mvpitem[i].p= mob_drop_adjust(rate, battle_config.item_rate_mvp,
+ if (!mob_db_data[class_]->mvpitem[i].nameid) {
+ //No item....
+ mob_db_data[class_]->mvpitem[i].p = 0;
+ continue;
+ }
+ mob_db_data[class_]->mvpitem[i].p= mob_drop_adjust(atoi(str[52+i*2]), 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
@@ -4892,6 +4901,11 @@ static int mob_read_sqldb(void)
int rate = 0, rate_adjust, type, ratemin, ratemax;
struct item_data *id;
mob_db_data[class_]->dropitem[i].nameid=TO_INT(29+i*2);
+ if (!mob_db_data[class_]->dropitem[i].nameid) {
+ //No drop.
+ mob_db_data[class_]->dropitem[i].p = 0;
+ continue;
+ }
type = itemdb_type(mob_db_data[class_]->dropitem[i].nameid);
rate = TO_INT(30+i*2);
if (class_ >= 1324 && class_ <= 1363)
@@ -4961,6 +4975,11 @@ static int mob_read_sqldb(void)
for (i=0; i<3; i++) {
struct item_data *id;
mob_db_data[class_]->mvpitem[i].nameid = TO_INT(51+i*2);
+ if (!mob_db_data[class_]->mvpitem[i].nameid) {
+ //No item....
+ mob_db_data[class_]->mvpitem[i].p = 0;
+ continue;
+ }
mob_db_data[class_]->mvpitem[i].p = mob_drop_adjust(TO_INT(52+i*2),
battle_config.item_rate_mvp, battle_config.item_drop_mvp_min, battle_config.item_drop_mvp_max);