diff --git a/Irpg/Quest.pm b/Irpg/Quest.pm index 9740f747a9ae74fc09c6e352770d36cfdd4ed65c..031b0ebf69c161ed00c214380400048374e02735 100644 --- a/Irpg/Quest.pm +++ b/Irpg/Quest.pm @@ -128,18 +128,30 @@ sub quest { } close(Q); if ($quest{type} == 1) { - Irpg::Irc::chanmsg(join(", ",(@{$quest{questers}})[0..2]).", and ". - "$quest{questers}->[3] have been chosen by the gods to ". + my $txt = "have been chosen by the gods to ". "$quest{text}. Quest to end in ".duration($quest{qtime}-time()). - "."); + "."; + Irpg::Irc::chanmsg(join(", ",(@{$quest{questers}})[0..2]).", and ". + "$quest{questers}->[3] $txt"); + for (my $i = 0 ; $i <= 3 ; $i++) { + Irpg::Irc::privmsg("You, $quest{questers}->[($i+1)%4], ". + "$quest{questers}->[($i+2)%4] and ". + "$quest{questers}->[($i+3)%4] $txt", $quest{questers}->[$i]); + } } elsif ($quest{type} == 2) { - Irpg::Irc::chanmsg(join(", ",(@{$quest{questers}})[0..2]).", and ". - "$quest{questers}->[3] have been chosen by the gods to ". + my $txt = "have been chosen by the gods to ". "$quest{text}. Participants must first reach [$quest{p1}->[0],". "$quest{p1}->[1]], then [$quest{p2}->[0],$quest{p2}->[1]].". ($opts->{mapurl}?" See $opts->{mapurl} to monitor their journey's ". - "progress.":"")); + "progress.":""); + Irpg::Irc::chanmsg(join(", ",(@{$quest{questers}})[0..2]).", and ". + "$quest{questers}->[3] $txt"); + for ($i = 0 ; $i <= 3 ; $i++) { + Irpg::Irc::privmsg("You, $quest{questers}->[($i+1)%4], ". + "$quest{questers}->[($i+2)%4] and ". + "$quest{questers}->[($i+3)%4] $txt", $quest{questers}->[$i]); + } } writequestfile(); } @@ -153,14 +165,15 @@ sub questpencheck { my ($quester,$player); for $quester (@{$quest{questers}}) { if ($quester eq $k) { - Irpg::Irc::chanmsg(Irpg::Utils::clog( - "$k\'s prudence and self-regard has brought the ". - "wrath of the gods upon the realm. All your great ". - "wickedness makes you as it were heavy with lead, ". - "and to tend downwards with great weight and ". - "pressure towards hell. Therefore have you drawn ". - "yourselves 15 steps closer to that gaping maw.")); + my $txt = "$k\'s prudence and self-regard has brought the ". + "wrath of the gods upon the realm. All your great ". + "wickedness makes you as it were heavy with lead, ". + "and to tend downwards with great weight and ". + "pressure towards hell. Therefore have you drawn ". + "yourselves 15 steps closer to that gaping maw."; + Irpg::Irc::chanmsg(Irpg::Utils::clog($txt)); for $player (grep { $rps->{$_}{online} } keys %$rps) { + Irpg::Irc::privmsg($txt, $player); my $gain = int(15 * ($opts->{rppenstep}**$rps->{$player}{level})); $gain = $rps->{$player}{class}->real_gain($gain); $rps->{$player}{pen_quest} += $gain; @@ -195,9 +208,14 @@ sub movequesters { # all participants have reached point 1, now point 2 Irpg::Irc::chanmsg(Irpg::Utils::clog( join(", ",(@{$quest{questers}})[0..2]).", ". - "and $quest{questers}->[3] have reached ". - "the first step of their long quest. May the ". - "Gods keep on smiling upon them.")); + "and $quest{questers}->[3] have reached ". + "the first step of their long quest. May the ". + "Gods keep on smiling upon them.")); + for (@{$quest{questers}}) { + Irpg::Irc::privmsg("You and your journey's companions ". + "have reached the first step of your long quest. May the ". + "Gods keep on smiling upon you.", $_); + } $quest{stage}=2; $allgo=0; # have not all reached p2 yet } @@ -205,11 +223,16 @@ sub movequesters { # all participants have reached point 2, time for reward \o/ Irpg::Irc::chanmsg(Irpg::Utils::clog( join(", ",(@{$quest{questers}})[0..2]).", ". - "and $quest{questers}->[3] have completed their ". - "journey! 25% of their burden is eliminated. ". - "The people can rejoice, the realm is sure a safer ". - "place now, thanks to these heroes.")); + "and $quest{questers}->[3] have completed their ". + "journey! 25% of their burden is eliminated. ". + "The people can rejoice, the realm is sure a safer ". + "place now, thanks to these heroes.")); for (@{$quest{questers}}) { + Irpg::Irc::privmsg("You and your companions ". + "have completed your ". + "journey! 25% of your burden is eliminated. ". + "The people can rejoice, the realm is sure a safer ". + "place now, thanks to the heroes you are.", $_); $rps->{$_}{next} = int($rps->{$_}{class}->real_gain( $rps->{$_}{next} * .75)); } @@ -257,6 +280,10 @@ sub rpcheck { "completing their quest! 25% of their burden is ". "eliminated.")); for (@{$quest{questers}}) { + Irpg::Irc::privmsg("You and your companions ". + "have blessed the realm by ". + "completing your quest! 25% of your burden is ". + "eliminated.", $_); $rps->{$_}{next} = int($rps->{$_}{class}->real_gain( $rps->{$_}{next} * .75)); }