--- deliantra/server/ext/schmorplog.ext 2008/04/30 06:40:28 1.13 +++ deliantra/server/ext/schmorplog.ext 2008/04/30 10:31:04 1.14 @@ -27,6 +27,19 @@ }; }; +cf::object->attach ( + on_kill => sub { + my ($ob, $hitter) = @_; + + return unless $hitter; + $hitter = $hitter->outer_owner; + my $pl = $hitter->contr + or return; + + ++$hitter->{stats_kill}{$ob->name}; + }, +); + cf::player->attach ( on_login => sub { my ($pl) = @_; @@ -71,6 +84,8 @@ my ($pl) = @_; ext::irc::do_notice (sprintf "%s was killed by %s", $pl->ob->name, $pl->killer_name); + ++$pl->ob->{stats_death}{$pl->killer_name}; + $pl->ob->set_ob_key_value (schmorplog_death_count => 1 + $pl->ob->get_ob_key_value ("schmorplog_death_count")); },