summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-09-11 05:38:13 +0000
committerFate <fate-tmw@googlemail.com>2009-09-11 05:38:13 +0000
commit80361c9a3b7fde14bbc094cc1dd241b52e33d9bc (patch)
tree91a482b0e62ea440bd51ee6985ddd25d1d23d8da /src/map/battle.c
parent77af951f441c1c455550e5473b4fb30b4a5f5302 (diff)
downloadtmwa-80361c9a3b7fde14bbc094cc1dd241b52e33d9bc.tar.gz
tmwa-80361c9a3b7fde14bbc094cc1dd241b52e33d9bc.tar.bz2
tmwa-80361c9a3b7fde14bbc094cc1dd241b52e33d9bc.tar.xz
tmwa-80361c9a3b7fde14bbc094cc1dd241b52e33d9bc.zip
Added mapserver config option log_file to specify gzipped player action log file
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index e424ef9..ebc395d 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3937,6 +3937,32 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
skill_castend_damage_id(src,target,0,-1,tick,0);
map_freeblock_lock();
+ if (src->type == BL_PC) {
+ int weapon_index = sd->equip_index[9];
+ int weapon = 0;
+ if (sd->inventory_data[weapon_index] && sd->status.inventory[weapon_index].equip & 0x2)
+ weapon = sd->inventory_data[weapon_index]->nameid;
+
+ MAP_LOG("PC%d %d:%d,%d WPNDMG %s%d %d FOR %d WPN %d",
+ sd->status.char_id, src->m, src->x, src->y,
+ (target->type == BL_PC)? "PC" : "MOB",
+ (target->type == BL_PC)? ((struct map_session_data *) target)->status.char_id : target->id,
+ (target->type == BL_PC)? 0 : ((struct mob_data *)target)->class,
+ wd.damage+wd.damage2,
+ weapon
+ );
+ }
+
+ if (target->type == BL_PC) {
+ struct map_session_data *sd2 = (struct map_session_data *) target;
+ MAP_LOG("PC%d %d:%d,%d WPNINJURY %s%d %d FOR %d",
+ sd2->status.char_id, target->m, target->x, target->y,
+ (src->type == BL_PC)? "PC" : "MOB",
+ (src->type == BL_PC)? ((struct map_session_data *) src)->status.char_id : src->id,
+ (src->type == BL_PC)? 0 : ((struct mob_data *)src)->class,
+ wd.damage+wd.damage2);
+ }
+
battle_damage(src,target,(wd.damage+wd.damage2),0);
if(target->prev != NULL &&
(target->type != BL_PC || (target->type == BL_PC && !pc_isdead((struct map_session_data *)target) ) ) ) {