--- deliantra/server/ext/nimbus.ext 2006/12/30 10:16:10 1.3 +++ deliantra/server/ext/nimbus.ext 2007/06/11 21:38:13 1.10 @@ -1,4 +1,4 @@ -#! perl +#! perl # mandatory # handle the nimbus map and other stuff @@ -76,37 +76,10 @@ $ob->message ("\n"); } - my $path = sprintf "%s/%s/%s/%s", - cf::localdir, cf::playerdir, $ob->name, "nimbus"; - - if ($ob->map->path ne $path) { - my $nimbus = cf::map::find_map "/schmorp/nimbus"; - $nimbus->path ($path); - $nimbus->unique (1); - - $pl->savebed ($path, 24, 12); - } + $pl->savebed ("/nimbus", 24, 12); }, ); -sub teleport { - my ($pl, $map, $x, $y) = @_; - - return if $pl->ob->map->path eq $map - && abs ($pl->ob->x - $x) <= 1 - && abs ($pl->ob->y - $y) <= 1; - - my $portal = cf::object::new "exit"; - - $portal->slaying ($map); - $portal->stats->hp ($x); - $portal->stats->sp ($y); - - $portal->apply ($pl->ob); - - $portal->destroy; -} - cf::object::attachment nimbus_exit => on_trigger => sub { my ($self, $ob) = @_; @@ -131,23 +104,20 @@ @savebed = ("/scorn/taverns/inn", 10, 5); } - $pl->savebed (@savebed); - my $map = $ob->map; + $pl->savebed (@savebed); - teleport $pl, @savebed; - - # should make this a temporary map and let cf deal with it - unlink $map->path; - unlink $map->path . ".pst"; + cf::async { + $ob->goto (@savebed); - $map->delete_map; + $map->nuke; - $pl->play_sound_player_only (cf::SOUND_PLAYER_DIES); + $pl->play_sound_player_only (cf::SOUND_PLAYER_DIES); - $ob->message ("You feel as if you woke up from a dream.\n"); - $ob->message ("You have a headache.\n"); - $ob->message ("Maybe you should have a drink.\n"); + $ob->message ("You feel as if you woke up from a dream.\n"); + $ob->message ("You have a headache.\n"); + $ob->message ("Maybe you should have a drink.\n"); + }; cf::override; },