summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-02-17 17:19:26 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-02-17 17:19:26 +0000
commit4f192318c6ce14dc231dba81426161cb7d450738 (patch)
tree432b866b6d51dadf8f48581ab162c8883a77027d /src
parentff8a0342bc95eb2064ed7c620a0c410a92fde310 (diff)
downloadhercules-4f192318c6ce14dc231dba81426161cb7d450738.tar.gz
hercules-4f192318c6ce14dc231dba81426161cb7d450738.tar.bz2
hercules-4f192318c6ce14dc231dba81426161cb7d450738.tar.xz
hercules-4f192318c6ce14dc231dba81426161cb7d450738.zip
added +2 drops slots into MOBS DBs
brushed up srcs for 10 drops fixed some mobs... fixed TXT logs fixed 1 guardian spawn changed 2 SQL files. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1126 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/log.c5
-rw-r--r--src/map/mob.c57
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/script.c4
-rw-r--r--src/map/skill.c4
-rw-r--r--src/map/trade.c8
-rw-r--r--src/map/vending.c3
7 files changed, 24 insertions, 59 deletions
diff --git a/src/map/log.c b/src/map/log.c
index 5b0ff78de..b788ab3ba 100644
--- a/src/map/log.c
+++ b/src/map/log.c
@@ -24,7 +24,7 @@ int log_branch(struct map_session_data *sd)
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
#endif
- if((logfp=fopen(log_config.log_drop,"a+")) != NULL) {
+ if((logfp=fopen(log_config.log_branch,"a+")) != NULL) {
char timestring[255];
time_t curtime;
time(&curtime);
@@ -48,8 +48,7 @@ int log_drop(struct map_session_data *sd, int monster_id, int *log_drop)
#ifndef TXT_ONLY
if(log_config.sql_logs > 0)
{
- //TODO: Expand 8 slots into 10
- sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`drop_date`, `kill_char_id`, `monster_id`, `item1`, `item2`, `item3`, `item4`, `item5`, `item6`, `item7`, `item8`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s') ", log_config.log_drop_db, sd->status.char_id, monster_id, log_drop[0], log_drop[1], log_drop[2], log_drop[3], log_drop[4], log_drop[5], log_drop[6], log_drop[7], sd->mapname);
+ sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`drop_date`, `kill_char_id`, `monster_id`, `item1`, `item2`, `item3`, `item4`, `item5`, `item6`, `item7`, `item8`, `item9`, `itemCard`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s') ", log_config.log_drop_db, sd->status.char_id, monster_id, log_drop[0], log_drop[1], log_drop[2], log_drop[3], log_drop[4], log_drop[5], log_drop[6], log_drop[7], log_drop[8], log_drop[9], sd->mapname);
if(mysql_query(&mmysql_handle, tmp_sql))
printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
} else {
diff --git a/src/map/mob.c b/src/map/mob.c
index b32db9966..da90f18c2 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2578,7 +2578,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
int itemid[17] = { 714, 756, 757, 969, 984, 985, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1002 };
ditem=(struct delay_item_drop *)aCalloc(1,sizeof(struct delay_item_drop));
ditem->nameid = itemid[rand()%17]; //should return from 0 to 16
- if (drop_ore<0) i=7; //we have only 10 slots in LOG, there's a check to not overflow <- TODO: change 7 to 9
+ if (drop_ore<0) i=8; //we have only 10 slots in LOG, there's a check to not overflow (9th item usually a card, so we use 8th slot)
log_item[i] = ditem->nameid; //it's for logging only
drop_items++; //we cound if there were any drops
ditem->amount = 1;
@@ -3883,12 +3883,12 @@ static int mob_readdb(void)
}
while(fgets(line,1020,fp)){
int class_,i;
- char *str[55],*p,*np;
+ char *str[60],*p,*np; // 55->60 Lupus
if(line[0] == '/' && line[1] == '/')
continue;
- for(i=0,p=line;i<55;i++){
+ for(i=0,p=line;i<60;i++){
if((np=strchr(p,','))!=NULL){
str[i]=p;
*np=0;
@@ -3948,7 +3948,7 @@ static int mob_readdb(void)
mob_db[class_].amotion=atoi(str[27]);
mob_db[class_].dmotion=atoi(str[28]);
- for(i=0;i<8;i++){ // TODO: 8 -> 10 Lupus
+ for(i=0;i<10;i++){ // 8 -> 10 Lupus
int rate = 0,type,ratemin,ratemax;
mob_db[class_].dropitem[i].nameid=atoi(str[29+i*2]);
type = itemdb_type(mob_db[class_].dropitem[i].nameid);
@@ -4020,21 +4020,13 @@ static int mob_readdb(void)
rate = (rate < ratemin)? ratemin: (rate > ratemax)? ratemax: rate;
mob_db[class_].dropitem[i].p = rate;
}
- //TEMP PLUG till we expand TXT DB and SQL DBs [Lupus]
- for(i=8;i<10;i++){ //TODO: 8 -> 10 Lupus
- //we fill 9th and 10th DROP slots with 0
- mob_db[class_].dropitem[i].nameid = mob_db[class_].dropitem[i].p = 0;
- }
- //END of temp plug
-
- //TODO: Shift columns (after adding 2 drops (4 coulmns)) Lupus
-
- // Item1,Item2
- mob_db[class_].mexp=atoi(str[45])*battle_config.mvp_exp_rate/100;
- mob_db[class_].mexpper=atoi(str[46]);
+ // MVP EXP Bonus, Chance: MEXP,ExpPer
+ mob_db[class_].mexp=atoi(str[49])*battle_config.mvp_exp_rate/100;
+ mob_db[class_].mexpper=atoi(str[50]);
+ // MVP Drops: MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per
for(i=0;i<3;i++){
- mob_db[class_].mvpitem[i].nameid=atoi(str[47+i*2]);
- mob_db[class_].mvpitem[i].p=atoi(str[48+i*2])*battle_config.mvp_item_rate/100;
+ mob_db[class_].mvpitem[i].nameid=atoi(str[51+i*2]);
+ mob_db[class_].mvpitem[i].p=atoi(str[52+i*2])*battle_config.mvp_item_rate/100;
}
for(i=0;i<MAX_RANDOMMONSTER;i++)
mob_db[class_].summonper[i]=0;
@@ -4349,7 +4341,7 @@ static int mob_read_sqldb(void)
char line[1024];
int i,class_;
long unsigned int ln=0;
- char *str[55],*p,*np;
+ char *str[60],*p,*np; // 55->60 Lupus
memset(mob_db,0,sizeof(mob_db));
@@ -4360,7 +4352,7 @@ static int mob_read_sqldb(void)
sql_res = mysql_store_result(&mmysql_handle);
if (sql_res) {
while((sql_row = mysql_fetch_row(sql_res))){
- sprintf(line,"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s",
+ sprintf(line,"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s",
sql_row[0],sql_row[1],sql_row[2],sql_row[3],sql_row[4],
sql_row[5],sql_row[6],sql_row[7],sql_row[8],sql_row[9],
sql_row[10],sql_row[11],sql_row[12],sql_row[13],sql_row[14],
@@ -4371,9 +4363,10 @@ static int mob_read_sqldb(void)
sql_row[35],sql_row[36],sql_row[37],sql_row[38],sql_row[39],
sql_row[40],sql_row[41],sql_row[42],sql_row[43],sql_row[44],
sql_row[45],sql_row[46],sql_row[47],sql_row[48],sql_row[49],
- sql_row[50],sql_row[51],sql_row[52]);
+ sql_row[50],sql_row[51],sql_row[52],sql_row[53],sql_row[54],
+ sql_row[56],sql_row[57],sql_row[58],sql_row[59]);
- for(i=0,p=line;i<55;i++){
+ for(i=0,p=line;i<60;i++){
if((np=strchr(p,','))!=NULL){
str[i]=p;
*np=0;
@@ -4424,7 +4417,7 @@ static int mob_read_sqldb(void)
mob_db[class_].amotion=atoi(str[27]);
mob_db[class_].dmotion=atoi(str[28]);
- for(i=0;i<8;i++){ //TODO: 8 -> 10 Lupus
+ for(i=0;i<10;i++){ // 8 -> 10 Lupus
int rate = 0,type,ratemin,ratemax;
mob_db[class_].dropitem[i].nameid=atoi(str[29+i*2]);
type = itemdb_type(mob_db[class_].dropitem[i].nameid);
@@ -4457,19 +4450,13 @@ static int mob_read_sqldb(void)
rate = (rate < ratemin)? ratemin: (rate > ratemax)? ratemax: rate;
mob_db[class_].dropitem[i].p = rate;
}
- //TEMP PLUG till we expand TXT DB and SQL DBs [Lupus]
- for(i=8;i<10;i++){ //TODO: 8 -> 10 Lupus
- //we fill 9th and 10th DROP slots with 0
- mob_db[class_].dropitem[i].nameid = mob_db[class_].dropitem[i].p = 0;
- }
- //END of temp plug
-
- //TODO: Shift columns (after adding 2 drops (4 coulmns)) Lupus
- mob_db[class_].mexp=atoi(str[45])*battle_config.mvp_exp_rate/100;
- mob_db[class_].mexpper=atoi(str[46]);
+ // MVP EXP Bonus, Chance: MEXP,ExpPer
+ mob_db[class_].mexp=atoi(str[49])*battle_config.mvp_exp_rate/100;
+ mob_db[class_].mexpper=atoi(str[50]);
+ // MVP Drops: MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per
for(i=0;i<3;i++){
- mob_db[class_].mvpitem[i].nameid=atoi(str[47+i*2]);
- mob_db[class_].mvpitem[i].p=atoi(str[48+i*2])*battle_config.mvp_item_rate/100;
+ mob_db[class_].mvpitem[i].nameid=atoi(str[51+i*2]);
+ mob_db[class_].mvpitem[i].p=atoi(str[52+i*2])*battle_config.mvp_item_rate/100;
}
for(i=0;i<MAX_RANDOMMONSTER;i++)
mob_db[class_].summonper[i]=0;
diff --git a/src/map/pc.c b/src/map/pc.c
index 87ad099ac..2bb6ddf5d 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2367,10 +2367,8 @@ int pc_isUseitem(struct map_session_data *sd,int n)
(sd->status.class_>=4023 && ((1<<(sd->status.class_-4023))&item->class_) == 0))
return 0;
-#ifndef TXT_ONLY
if((log_config.branch > 0) && (nameid == 604))
log_branch(sd);
-#endif
return 1;
}
diff --git a/src/map/script.c b/src/map/script.c
index 482a136cf..c9f0b8bd5 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3067,10 +3067,8 @@ int buildin_successrefitem(struct script_state *st)
if(i >= 0) {
ep=sd->status.inventory[i].equip;
- #ifndef TXT_ONLY
if(log_config.refine > 0)
log_refine(sd, i, 1);
- #endif //USE_SQL
sd->status.inventory[i].refine++;
pc_unequipitem(sd,i,2);
@@ -3097,10 +3095,8 @@ int buildin_failedrefitem(struct script_state *st)
sd=script_rid2sd(st);
i=pc_checkequip(sd,equip[num-1]);
if(i >= 0) {
- #ifndef TXT_ONLY
if(log_config.refine > 0)
log_refine(sd, i, 0);
- #endif //USE_SQL
sd->status.inventory[i].refine = 0;
pc_unequipitem(sd,i,3);
diff --git a/src/map/skill.c b/src/map/skill.c
index 240ad284e..4bdf4ae2a 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9569,10 +9569,8 @@ int skill_produce_mix( struct map_session_data *sd,
*((unsigned long *)(&tmp_item.card[2]))=sd->char_id; /* ƒLƒƒƒ‰ID */
}
- #ifndef TXT_ONLY
if(log_config.produce > 0)
log_produce(sd,nameid,slot1,slot2,slot3,1);
- #endif //USE_SQL
switch (skill_produce_db[idx].req_skill) {
case AM_PHARMACY:
@@ -9595,10 +9593,8 @@ int skill_produce_mix( struct map_session_data *sd,
}
}
else {
- #ifndef TXT_ONLY
if(log_config.produce > 0)
log_produce(sd,nameid,slot1,slot2,slot3,0);
- #endif //USE_SQL
switch (skill_produce_db[idx].req_skill) {
case AM_PHARMACY:
diff --git a/src/map/trade.c b/src/map/trade.c
index 91b21a38b..6ab75651a 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -236,10 +236,8 @@ void trade_tradecommit(struct map_session_data *sd) {
if (sd->status.inventory[n].amount < sd->deal_item_amount[trade_i])
sd->deal_item_amount[trade_i] = sd->status.inventory[n].amount;
- #ifndef TXT_ONLY
if(log_config.trade > 0)
log_trade(sd,target_sd,n,sd->deal_item_amount[trade_i]);
- #endif //USE_SQL
flag = pc_additem(target_sd, &sd->status.inventory[n], sd->deal_item_amount[trade_i]);
if (flag == 0)
@@ -255,10 +253,8 @@ void trade_tradecommit(struct map_session_data *sd) {
if (target_sd->status.inventory[n].amount < target_sd->deal_item_amount[trade_i])
target_sd->deal_item_amount[trade_i] = target_sd->status.inventory[n].amount;
- #ifndef TXT_ONLY
if(log_config.trade > 0)
log_trade(target_sd,sd,n,target_sd->deal_item_amount[trade_i]);
- #endif //USE_SQL
flag = pc_additem(sd, &target_sd->status.inventory[n], target_sd->deal_item_amount[trade_i]);
if (flag == 0)
@@ -270,18 +266,14 @@ void trade_tradecommit(struct map_session_data *sd) {
}
}
if (sd->deal_zeny) {
- #ifndef TXT_ONLY
if (log_config.trade > 0 && log_config.zeny > 0)
log_zeny(sd, target_sd, sd->deal_zeny);
- #endif //USE_SQL
sd->status.zeny -= sd->deal_zeny;
target_sd->status.zeny += sd->deal_zeny;
}
if (target_sd->deal_zeny) {
- #ifndef TXT_ONLY
if (log_config.trade > 0 && log_config.zeny > 0)
log_zeny(target_sd, sd, sd->deal_zeny);
- #endif //USE_SQL
target_sd->status.zeny -= target_sd->deal_zeny;
sd->status.zeny += target_sd->deal_zeny;
diff --git a/src/map/vending.c b/src/map/vending.c
index 42b9f6fea..2d3790596 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -125,14 +125,11 @@ void vending_purchasereq(struct map_session_data *sd,int len,int id,unsigned cha
clif_vendingreport(vsd, index, amount);
//log added by Lupus
- #ifndef TXT_ONLY
if(log_config.vend > 0) {
log_vend(sd,vsd, index, amount, z); // for Item + Zeny. log.
//we log ZENY only with the 1st item. Then zero it for the rest items 8).
z = 0;
}
- #endif
-
}
}