summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/char/int_quest.c2
-rw-r--r--src/map/battle.c19
-rw-r--r--src/map/battle.h4
-rw-r--r--src/map/clif.c19
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/itemdb.c31
-rw-r--r--src/map/mob.c22
-rw-r--r--src/map/pc.c13
8 files changed, 78 insertions, 33 deletions
diff --git a/src/char/int_quest.c b/src/char/int_quest.c
index b40cc97f8..fb90e8206 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -59,7 +59,7 @@ struct quest *mapif_quests_fromsql(int char_id, int *count) {
return NULL;
}
- *count = (int)SQL->NumRows(sql_handle);
+ *count = (int)SQL->StmtNumRows(stmt);
if (*count > 0) {
int i = 0;
questlog = (struct quest *)aCalloc(*count, sizeof(struct quest));
diff --git a/src/map/battle.c b/src/map/battle.c
index 38b516bd9..648e75bb3 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6458,7 +6458,7 @@ static const struct _battle_data {
{ "duel_time_interval", &battle_config.duel_time_interval, 60, 0, INT_MAX, },
{ "duel_only_on_same_map", &battle_config.duel_only_on_same_map, 0, 0, 1, },
{ "skip_teleport_lv1_menu", &battle_config.skip_teleport_lv1_menu, 0, 0, 1, },
- { "mob_max_skilllvl", &battle_config.mob_max_skilllvl, 100, 1, INT_MAX, },
+ { "mob_max_skilllvl", &battle_config.mob_max_skilllvl, 100, 1, INT_MAX, },
{ "allow_skill_without_day", &battle_config.allow_skill_without_day, 0, 0, 1, },
{ "allow_es_magic_player", &battle_config.allow_es_magic_pc, 0, 0, 1, },
{ "skill_caster_check", &battle_config.skill_caster_check, 1, 0, 1, },
@@ -6527,24 +6527,25 @@ static const struct _battle_data {
{ "atcommand_mobinfo_type", &battle_config.atcommand_mobinfo_type, 0, 0, 1 },
{ "homunculus_max_level", &battle_config.hom_max_level, 99, 0, MAX_LEVEL, },
{ "homunculus_S_max_level", &battle_config.hom_S_max_level, 150, 0, MAX_LEVEL, },
- { "mob_size_influence", &battle_config.mob_size_influence, 0, 0, 1, },
+ { "mob_size_influence", &battle_config.mob_size_influence, 0, 0, 1, },
/**
* Hercules
**/
{ "skill_trap_type", &battle_config.skill_trap_type, 0, 0, 1, },
{ "item_restricted_consumption_type", &battle_config.item_restricted_consumption_type,1, 0, 1, },
- { "max_walk_path", &battle_config.max_walk_path, 17, 1, MAX_WALKPATH, },
- { "item_enabled_npc", &battle_config.item_enabled_npc, 1, 0, 1, },
- { "gm_ignore_warpable_area", &battle_config.gm_ignore_warpable_area, 0, 2, 100, },
- { "packet_obfuscation", &battle_config.packet_obfuscation, 1, 0, 3, },
- { "client_accept_chatdori", &battle_config.client_accept_chatdori, 0, 0, INT_MAX, },
- { "snovice_call_type", &battle_config.snovice_call_type, 0, 0, 1, },
- { "guild_notice_changemap", &battle_config.guild_notice_changemap, 2, 0, 2, },
+ { "max_walk_path", &battle_config.max_walk_path, 17, 1, MAX_WALKPATH, },
+ { "item_enabled_npc", &battle_config.item_enabled_npc, 1, 0, 1, },
+ { "gm_ignore_warpable_area", &battle_config.gm_ignore_warpable_area, 0, 2, 100, },
+ { "packet_obfuscation", &battle_config.packet_obfuscation, 1, 0, 3, },
+ { "client_accept_chatdori", &battle_config.client_accept_chatdori, 0, 0, INT_MAX, },
+ { "snovice_call_type", &battle_config.snovice_call_type, 0, 0, 1, },
+ { "guild_notice_changemap", &battle_config.guild_notice_changemap, 2, 0, 2, },
{ "feature.banking", &battle_config.feature_banking, 1, 0, 1, },
{ "feature.auction", &battle_config.feature_auction, 0, 0, 2, },
{ "idletime_criteria", &battle_config.idletime_criteria, 0x25, 1, INT_MAX, },
{ "mon_trans_disable_in_gvg", &battle_config.mon_trans_disable_in_gvg, 0, 0, 1, },
+ { "case_sensitive_aegisnames", &battle_config.case_sensitive_aegisnames, 1, 0, 1, },
};
#ifndef STATS_OPT_OUT
/**
diff --git a/src/map/battle.h b/src/map/battle.h
index 4d4508742..ed5e40988 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -444,7 +444,7 @@ struct Battle_Config {
int mvp_tomb_enabled;
int atcommand_suggestions_enabled;
- int min_npc_vendchat_distance;
+ int min_npc_vendchat_distance;
int atcommand_mobinfo_type;
int mob_size_influence; // Enable modifications on earned experience, drop rates and monster status depending on monster size. [mkbu95]
@@ -466,6 +466,8 @@ struct Battle_Config {
int feature_auction;
int mon_trans_disable_in_gvg;
+
+ int case_sensitive_aegisnames;
} battle_config;
/* criteria for battle_config.idletime_critera */
diff --git a/src/map/clif.c b/src/map/clif.c
index 1caff12b1..d8a3274a0 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -13524,7 +13524,12 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd)
if ( (count=itemdb->search_name_array(item_array, 10, item_monster_name, 1)) > 0 ){
for(i = 0; i < count; i++){
- if( item_array[i] && strcmp(item_array[i]->name, item_monster_name) == 0 )// It only accepts aegis name
+ if( !item_array[i] )
+ continue;
+ // It only accepts aegis name
+ if( battle_config.case_sensitive_aegisnames && strcmp(item_array[i]->name, item_monster_name) == 0 )
+ break;
+ if( !battle_config.case_sensitive_aegisnames && strcasecmp(item_array[i]->name, item_monster_name) == 0 )
break;
}
@@ -13546,7 +13551,12 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd)
if( (count=mob->db_searchname_array(mob_array, 10, item_monster_name, 1)) > 0){
for(i = 0; i < count; i++){
- if( mob_array[i] && strcmp(mob_array[i]->sprite, item_monster_name) == 0 ) // It only accepts sprite name
+ if( !mob_array[i] )
+ continue;
+ // It only accepts sprite name
+ if( battle_config.case_sensitive_aegisnames && strcmp(mob_array[i]->sprite, item_monster_name) == 0 )
+ break;
+ if( !battle_config.case_sensitive_aegisnames && strcasecmp(mob_array[i]->sprite, item_monster_name) == 0 )
break;
}
@@ -14843,6 +14853,11 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd)
if ((data = itemdb->exists(sd->mail.inbox.msg[i].item.nameid)) == NULL)
return;
+ if( pc_is90overweight(sd) ) {
+ clif->mail_getattachment(fd, 2);
+ return;
+ }
+
switch( pc->checkadditem(sd, data->nameid, sd->mail.inbox.msg[i].item.amount) ) {
case ADDITEM_NEW:
fail = ( pc->inventoryblank(sd) == 0 );
diff --git a/src/map/clif.h b/src/map/clif.h
index 3418b0557..6ccd951a0 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -342,6 +342,7 @@ typedef enum useskill_fail_cause { // clif_skill_fail
}useskill_fail_cause;
enum clif_messages {
+ ITEM_CANT_OBTAIN_WEIGHT = 0x34, /* you cannot carry more items because you are overweight. */
SKILL_CANT_USE_AREA = 0x536,
ITEM_CANT_USE_AREA = 0x537,
};
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 8a7e34ceb..30f81c354 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -33,11 +33,13 @@ int itemdb_searchname_sub(DBKey key, DBData *data, va_list ap)
str=va_arg(ap,char *);
dst=va_arg(ap,struct item_data **);
dst2=va_arg(ap,struct item_data **);
- if(item == &itemdb->dummy) return 0;
+ if (item == &itemdb->dummy) return 0;
//Absolute priority to Aegis code name.
if (*dst != NULL) return 0;
- if( strcmp(item->name,str)==0 ) // Case sensitive
+ if ( battle_config.case_sensitive_aegisnames && strcmp(item->name,str) == 0 )
+ *dst=item;
+ else if ( !battle_config.case_sensitive_aegisnames && strcasecmp(item->name,str) == 0 )
*dst=item;
//Second priority to Client displayed name.
@@ -61,7 +63,9 @@ struct item_data* itemdb_searchname(const char *str) {
continue;
// Absolute priority to Aegis code name.
- if( strcmp(item->name,str) == 0 ) // Case sensitive
+ if ( battle_config.case_sensitive_aegisnames && strcmp(item->name,str) == 0 )
+ return item;
+ else if ( !battle_config.case_sensitive_aegisnames && strcasecmp(item->name,str) == 0 )
return item;
//Second priority to Client displayed name.
@@ -90,7 +94,9 @@ int itemdb_searchname_array_sub(DBKey key, DBData data, va_list ap)
return 1; //Invalid item.
if(stristr(item->jname,str))
return 0;
- if(stristr(item->name,str))
+ if(battle_config.case_sensitive_aegisnames && strstr(item->name,str))
+ return 0;
+ if(!battle_config.case_sensitive_aegisnames && stristr(item->name,str))
return 0;
return strcmpi(item->jname,str);
}
@@ -113,9 +119,18 @@ int itemdb_searchname_array(struct item_data** data, int size, const char *str,
if( item == NULL )
continue;
- if( (!flag && (stristr(item->jname,str) || stristr(item->name,str))) ||
- (flag && (strcmp(item->jname,str) == 0 || strcmp(item->name,str) == 0)) )
- {
+ if(
+ (!flag
+ && (stristr(item->jname,str)
+ || (battle_config.case_sensitive_aegisnames && strstr(item->name,str))
+ || (!battle_config.case_sensitive_aegisnames && stristr(item->name,str))
+ ))
+ || (flag
+ && (strcmp(item->jname,str) == 0
+ || (battle_config.case_sensitive_aegisnames && strcmp(item->name,str) == 0)
+ || (!battle_config.case_sensitive_aegisnames && strcasecmp(item->name,str) == 0)
+ ))
+ ) {
if( count < size )
data[count] = item;
++count;
@@ -2208,10 +2223,10 @@ void itemdb_reload(void) {
iter = mapit_geteachpc();
for( sd = (struct map_session_data*)mapit->first(iter); mapit->exists(iter); sd = (struct map_session_data*)mapit->next(iter) ) {
memset(sd->item_delay, 0, sizeof(sd->item_delay)); // reset item delays
+ pc->setinventorydata(sd);
if( battle_config.item_check )
sd->state.itemcheck = 1;
pc->checkitem(sd);
- pc->setinventorydata(sd);
/* clear combo bonuses */
if( sd->combos.count ) {
aFree(sd->combos.bonus);
diff --git a/src/map/mob.c b/src/map/mob.c
index 92fa98885..8bb0ebe65 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -95,7 +95,11 @@ int mobdb_searchname(const char *str)
monster = mob->db(i);
if(monster == mob->dummy) //Skip dummy mobs.
continue;
- if(strcmpi(monster->name,str)==0 || strcmpi(monster->jname,str)==0 || strcmp(monster->sprite,str)==0) // Sprite name case sensitive
+ if(strcmpi(monster->name,str)==0 || strcmpi(monster->jname,str)==0)
+ return i;
+ if(battle_config.case_sensitive_aegisnames && strcmp(monster->sprite,str)==0)
+ return i;
+ if(!battle_config.case_sensitive_aegisnames && strcasecmp(monster->sprite,str)==0)
return i;
}
@@ -106,18 +110,20 @@ int mobdb_searchname_array_sub(struct mob_db* monster, const char *str, int flag
return 1;
if(!monster->base_exp && !monster->job_exp && monster->spawn[0].qty < 1)
return 1; // Monsters with no base/job exp and no spawn point are, by this criteria, considered "slave mobs" and excluded from search results
- if( !flag ){
+ if( !flag ) {
if(stristr(monster->jname,str))
return 0;
if(stristr(monster->name,str))
return 0;
- return strcmpi(monster->jname,str);
+ } else {
+ if(strcmpi(monster->jname,str) == 0)
+ return 0;
+ if(strcmpi(monster->name,str) == 0)
+ return 0;
}
- if(strcmpi(monster->jname,str) == 0)
- return 0;
- if(strcmpi(monster->name,str) == 0)
- return 0;
- return strcmp(monster->sprite,str);
+ if (battle_config.case_sensitive_aegisnames)
+ return strcmp(monster->sprite,str);
+ return strcasecmp(monster->sprite,str);
}
/*==========================================
diff --git a/src/map/pc.c b/src/map/pc.c
index d0f5b0635..f29ff7567 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4310,10 +4310,15 @@ int pc_isUseitem(struct map_session_data *sd,int n)
else if( itemdb_is_poison(nameid) && (sd->class_&MAPID_THIRDMASK) != MAPID_GUILLOTINE_CROSS )
return 0;
- if( (item->package || item->group) && pc_is90overweight(sd) ) {
- //##TODO## find official response to this
- clif->colormes(sd->fd,COLOR_RED,msg_txt(1477));// Item cannot be open when overweight by 90%
- return 0;
+ if( item->package || item->group ) {
+ if( pc_is90overweight(sd) ) {
+ clif->msgtable(sd->fd,ITEM_CANT_OBTAIN_WEIGHT);
+ return 0;
+ }
+ if( !pc->inventoryblank(sd) ) {
+ clif->colormes(sd->fd,COLOR_RED,msg_txt(1477));
+ return 0;
+ }
}
//Gender check