--- deliantra/maps/perl/schmorp-neko.ext 2006/03/25 04:47:56 1.15 +++ deliantra/maps/perl/schmorp-neko.ext 2006/03/31 22:47:20 1.16 @@ -36,10 +36,10 @@ } sub on_move { - my ($data) = @_; + my ($event, $who) = @_; - if (my $pl = find_target_player $data->{who}) { - my ($d, undef, undef, $dir, undef) = $data->{who}->rangevector ($pl); + if (my $pl = find_target_player $who) { + my ($d, undef, undef, $dir, undef) = $who->rangevector ($pl); if ($d < 1.5) { if (grep $_->type == cf::FORCE && $_->slaying eq "schmorp-neko-gave-fish", $pl->inv) { @@ -66,7 +66,7 @@ $spell->set_attacktype (cf::AT_CONFUSION | cf::AT_POISON | cf::AT_BLIND | cf::AT_DISEASE); $pl->message ("(Neko-san makes strange noises)"); - $pl->cast_spell ($data->{who}, $dir, $spell); + $pl->cast_spell ($who, $dir, $spell); $spell->free; } @@ -100,35 +100,35 @@ $dir = $dir % 8 + 1 unless $d > 1.5; } - $data->{who}->move ($dir); + $who->move ($dir); } 1 } sub on_attack { - my ($data) = @_; + my ($event, $ob, $who) = @_; - $data->{activator}{neko_attack}++ - or cf::LOG cf::llevDebug, sprintf "QBERT Neko-san was attacked by %s!\n", $data->{activator}->name; + $who->{neko_attack}++ + or cf::LOG cf::llevDebug, sprintf "QBERT Neko-san was attacked by %s!\n", $who->name; - $data->{activator}->message ("Meoow! (Please do not hurt me)") - if !($data->{activator}{neko_attack} & 15); + $who->message ("Meoow! (Please do not hurt me)") + if !($who->{neko_attack} & 15); - if ($data->{activator}{neko_attack} > 512) { - $data->{activator}{neko_attack} -= 128; - $data->{activator}->message ("Neko-san is suddenly gone!"); - teleport $data->{activator}, "/scorn/misc/scorn_illusions", 15, 7; - $data->{activator}->message ("You hear strange noises all around you..."); - $data->{activator}->message ("You feel dumb."); + if ($who->{neko_attack} > 512) { + $who->{neko_attack} -= 128; + $who->message ("Neko-san is suddenly gone!"); + teleport $who, "/scorn/misc/scorn_illusions", 15, 7; + $who->message ("You hear strange noises all around you..."); + $who->message ("You feel dumb."); } 1 } sub on_say { - my ($data) = @_; + my ($event, $ob, $who, $msg) = @_; - cf::LOG cf::llevDebug, sprintf "QBERT [Neko-fon] %s: %s\n", $data->{activator}->name, $data->{message}; + cf::LOG cf::llevDebug, sprintf "QBERT [Neko-fon] %s: %s\n", $who->name, $msg; }