Skip to content

Commit

Permalink
Bug fixes:
Browse files Browse the repository at this point in the history
- Wrong message when attempt to open boxes while inventory is full. (bugreport:9170)
- Revert a change on d670952, wrong commented line makes misc damage won't be relected. (bugreport:9185)
- Fixed 'devotion_rdamage' doesn't work for Magic Skill. (bugreport:8906)
- Follow up 8a81940, use vending/buyingstore db accessor on searchstore_query() for db_iterator()

Note for 'devotion_rdamage' for magic reflect.
- When this active to reflect magic damage, it still displays dummy damage value on devoted player, and this is custom config at first place. :P

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
  • Loading branch information
cydh committed Aug 4, 2014
1 parent 77549f7 commit 45a8e8f
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 166 deletions.
16 changes: 9 additions & 7 deletions src/map/battle.c
Expand Up @@ -4703,7 +4703,7 @@ static struct Damage initialize_weapon_data(struct block_list *src, struct block
* @param wd : weapon damage
* @param src : bl who did the attack
* @param target : target of the attack
* @parem skill_id : id of casted skill, 0 = basic atk
* @param skill_id : id of casted skill, 0 = basic atk
* @param skill_lv : lvl of skill casted
*/
void battle_do_reflect(int attack_type, struct Damage *wd, struct block_list* src, struct block_list* target, uint16 skill_id, uint16 skill_lv){
Expand All @@ -4730,7 +4730,8 @@ void battle_do_reflect(int attack_type, struct Damage *wd, struct block_list* sr
isDevotRdamage = true;
}
rdelay = clif_damage(src, (!isDevotRdamage) ? src : d_bl, tick, wd->amotion, sstatus->dmotion, rdamage, 1, DMG_ENDURE, 0);
if( tsd ) battle_drain(tsd, src, rdamage, rdamage, sstatus->race, sstatus->class_);
if( tsd )
battle_drain(tsd, src, rdamage, rdamage, sstatus->race, sstatus->class_);
//Use Reflect Shield to signal this kind of skill trigger. [Skotlex]
battle_delay_damage(tick, wd->amotion,target,(!isDevotRdamage) ? src : d_bl,0,CR_REFLECTSHIELD,0,rdamage,ATK_DEF,rdelay,true);
skill_additional_effect(target, (!isDevotRdamage) ? src : d_bl, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick);
Expand All @@ -4749,11 +4750,12 @@ void battle_do_reflect(int attack_type, struct Damage *wd, struct block_list* sr
if (ssc && ssc->data[SC_DEVOTION] && (d_bl = map_id2bl(ssc->data[SC_DEVOTION]->val1)))
isDevotRdamage = true;
}
if(attack_type == BF_WEAPON && tsc->data[SC_REFLECTDAMAGE] ) // Don't reflect your own damage (Grand Cross)
if( attack_type == BF_WEAPON && tsc->data[SC_REFLECTDAMAGE] ) // Don't reflect your own damage (Grand Cross)
map_foreachinshootrange(battle_damage_area,target,skill_get_splash(LG_REFLECTDAMAGE,1),BL_CHAR,tick,target,wd->amotion,sstatus->dmotion,rdamage,tstatus->race);
else if(attack_type == BF_WEAPON || attack_type == BF_MISC) {
else if( attack_type == BF_WEAPON || attack_type == BF_MISC) {
rdelay = clif_damage(src, (!isDevotRdamage) ? src : d_bl, tick, wd->amotion, sstatus->dmotion, rdamage, 1, DMG_ENDURE, 0);
if( tsd ) battle_drain(tsd, src, rdamage, rdamage, sstatus->race, sstatus->class_);
if( tsd )
battle_drain(tsd, src, rdamage, rdamage, sstatus->race, sstatus->class_);
// It appears that official servers give skill reflect damage a longer delay
battle_delay_damage(tick, wd->amotion,target,(!isDevotRdamage) ? src : d_bl,0,CR_REFLECTSHIELD,0,rdamage,ATK_DEF,rdelay,true);
skill_additional_effect(target, (!isDevotRdamage) ? src : d_bl, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick);
Expand Down Expand Up @@ -5864,7 +5866,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
MATK_ADDRATE(skill_damage);
#endif

//battle_do_reflect(BF_MAGIC,&ad, src, target, skill_id, skill_lv); //WIP [lighta]
//battle_do_reflect(BF_MAGIC,&ad, src, target, skill_id, skill_lv); //WIP [lighta] Magic skill has own handler at skill_attack
return ad;
}

Expand Down Expand Up @@ -6255,7 +6257,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
if(tstatus->mode&MD_IGNOREMISC && md.flag&(BF_MISC) ) //misc @TODO optimize me
md.damage = md.damage2 = 1;

//battle_do_reflect(BF_MISC,&md, src, target, skill_id, skill_lv); //WIP [lighta]
battle_do_reflect(BF_MISC,&md, src, target, skill_id, skill_lv); //WIP [lighta]

return md;
}
Expand Down
2 changes: 1 addition & 1 deletion src/map/pc.c
Expand Up @@ -4618,7 +4618,7 @@ bool pc_isUseitem(struct map_session_data *sd,int n)
return false;
}
if( !pc_inventoryblank(sd) ) {
clif_colormes(sd, color_table[COLOR_RED], msg_txt(sd, 1477)); //Item cannot be open when inventory is full
clif_colormes(sd, color_table[COLOR_RED], msg_txt(sd, 732)); //Item cannot be open when inventory is full
return false;
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/map/searchstore.c
Expand Up @@ -114,8 +114,6 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
struct s_search_store_search s;
searchstore_searchall_t store_searchall;
time_t querytime;
DBMap *vending_db = vending_getdb();
DBMap *buyingstore_db = buyingstore_getdb();

if( !battle_config.feature_search_stores ) {
return;
Expand Down Expand Up @@ -180,7 +178,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
s.card_count = card_count;
s.min_price = min_price;
s.max_price = max_price;
iter = db_iterator((type == SEARCHTYPE_VENDING) ? vending_db : buyingstore_db);
iter = db_iterator((type == SEARCHTYPE_VENDING) ? vending_getdb() : buyingstore_getdb());

for( pl_sd = dbi_first(iter); dbi_exists(iter); pl_sd = dbi_next(iter) ) {
if( sd == pl_sd ) {// skip own shop, if any
Expand Down

0 comments on commit 45a8e8f

Please sign in to comment.