diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 0fdf544a703..5420fbde0ee 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -2538,22 +2538,27 @@ static int64 battle_calc_base_damage(block_list *src, struct status_data *status if (atkmin > atkmax) atkmin = atkmax; } else { //PCs - atkmax = wa->atk; - type = (wa == &status->lhw)?EQI_HAND_L:EQI_HAND_R; - - if (!(flag&BDMG_CRIT) || (flag&BDMG_ARROW)) { //Normal attacks - atkmin = status->dex; + if (flag&BDMG_MAGIC) { + atkmin = status->matk_min; + atkmax = status->matk_max; + } else { + atkmax = wa->atk; + type = (wa == &status->lhw)?EQI_HAND_L:EQI_HAND_R; - if (sd->equip_index[type] >= 0 && sd->inventory_data[sd->equip_index[type]] && sd->inventory_data[sd->equip_index[type]]->type == IT_WEAPON) - atkmin = atkmin*(80 + sd->inventory_data[sd->equip_index[type]]->weapon_level*20)/100; + if (!(flag&BDMG_CRIT) || (flag&BDMG_ARROW)) { //Normal attacks + atkmin = status->dex; - if (atkmin > atkmax) - atkmin = atkmax; + if (sd->equip_index[type] >= 0 && sd->inventory_data[sd->equip_index[type]] != nullptr && sd->inventory_data[sd->equip_index[type]]->type == IT_WEAPON) + atkmin = atkmin*(80 + sd->inventory_data[sd->equip_index[type]]->weapon_level*20)/100; - if(flag&BDMG_ARROW) { //Bows - atkmin = atkmin*atkmax/100; if (atkmin > atkmax) - atkmax = atkmin; + atkmin = atkmax; + + if(flag&BDMG_ARROW) { //Bows + atkmin = atkmin*atkmax/100; + if (atkmin > atkmax) + atkmax = atkmin; + } } } } @@ -2615,9 +2620,7 @@ static int64 battle_calc_base_damage(block_list *src, struct status_data *status } //Finally, add baseatk - if(flag&BDMG_MAGIC) - damage += status->matk_min; - else + if(!(flag&BDMG_MAGIC)) damage += status->batk; if (sd) diff --git a/src/web/partybooking_controller.cpp b/src/web/partybooking_controller.cpp index 25dc3b6dc42..d046ce76e8f 100644 --- a/src/web/partybooking_controller.cpp +++ b/src/web/partybooking_controller.cpp @@ -306,7 +306,7 @@ HANDLER_FUNC(partybooking_get){ if( bookings.empty() ){ response = "{ \"Type\": 1 }"; }else{ - response = "{ \"Type\": 1, data: " + bookings.at( 0 ).to_json( world_name ) + " }"; + response = "{ \"Type\": 1, \"data\": " + bookings.at( 0 ).to_json( world_name ) + " }"; } res.set_content( response, "application/json" );