--- deliantra/server/ext/schmorp-neko.ext 2006/12/15 19:29:18 1.1 +++ deliantra/server/ext/schmorp-neko.ext 2008/05/04 08:55:52 1.8 @@ -1,21 +1,7 @@ -#! perl +#! perl # depends=irc # archetype nekosan -sub teleport { - my ($pl, $map, $x, $y) = @_; - - my $portal = cf::object::new "exit"; - - $portal->slaying ($map); - $portal->stats->hp ($x); - $portal->stats->sp ($y); - - $portal->apply ($pl); - - $portal->destroy; -} - sub find_target_player { my ($obj) = @_; @@ -64,19 +50,19 @@ $spell->attacktype (cf::AT_CONFUSION | cf::AT_POISON | cf::AT_BLIND | cf::AT_DISEASE); $pl->message ("(Neko-san makes strange noises)"); - $pl->cast_spell ($self, $dir, $spell); + $pl->cast_heal ($self, $spell, 0); $spell->destroy; } } else { # check for fish in his inv and steal it - if (my $fish = (grep $_->arch->name eq "fishfood", $pl->inv)[0]) { + if (my $fish = (grep $_->arch->archname eq "fishfood", $pl->inv)[0]) { # add force my $gave_fish = cf::object::new "force"; $gave_fish->slaying ("schmorp-neko-gave-fish"); $gave_fish->speed (0); - $gave_fish->insert_ob_in_ob ($pl); + $pl->insert ($gave_fish); # remove fish $fish->destroy; @@ -113,7 +99,7 @@ $hitter->{neko_last_attack} = time; $hitter->{neko_attack}++ - or ext::schmorp_irc::do_notice "Neko-san was attacked by ". $hitter->name . "!\n"; + or ext::irc::do_notice "Neko-san was attacked by ". $hitter->name . "!\n"; $hitter->message ("Meoow! (Please do not hurt me)") if !($hitter->{neko_attack} & 15); @@ -121,7 +107,7 @@ if ($hitter->{neko_attack} > 512) { $hitter->{neko_attack} -= 128; $hitter->message ("Neko-san is suddenly gone!"); - teleport $hitter, "/scorn/misc/scorn_illusions", 15, 7; + $hitter->goto ("/scorn/misc/scorn_illusions", 15, 7); $hitter->message ("You hear strange noises all around you..."); $hitter->message ("You feel dumb."); } @@ -136,8 +122,8 @@ sub on_say { my ($self, $pl, $msg) = @_; - ext::schmorp_irc::do_notice (sprintf "[Neko-fon] %s: %s\n", $pl->ob->name, $msg); + ext::irc::do_notice (sprintf "[Neko-fon] %s: %s\n", $pl->ob->name, $msg); } -cf::register_attachment "Nekosan", package => __PACKAGE__; +cf::object::attachment "Nekosan", package => __PACKAGE__;