Guest User

Untitled

a guest
Jan 21st, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.09 KB | None | 0 0
  1. ## 01/21/2019 ##
  2. ## Rule_NPC.pl ##
  3. ## Author: Kinglykrab ##
  4.  
  5. sub EVENT_SAY {
  6.     if ($text=~/Hail/i) {
  7.         plugin::Whisper("Hello $name, would you like to " . quest::saylink("view", 1, "view the rules") . " or " . quest::saylink("set", 1, "modify the rules") . "?");
  8.     } elsif ($text=~/View/i) {
  9.         if (length(substr($text, 5)) > 0) {
  10.             my $rule_name = substr($text, 5);
  11.             quest::shout("$rule_name: " . quest::get_rule($rule_name));
  12.         } else {
  13.             plugin::Whisper("Please say your command in the following format: \"view [rule_name]\"");
  14.         }
  15.     } elsif ($text=~/Set/i) {
  16.         if (length(substr($text, 4)) > 0) {
  17.             my $data = substr($text, 4);
  18.             my @player_command = split(/ /, $data);
  19.             my $rule_name = $player_command[0];
  20.             my $rule_value = $player_command[1];
  21.             quest::set_rule($rule_name, $rule_value);
  22.             plugin::Whisper("Set Rule '$rule_name' to value '$rule_value', checking get_rule value now.");
  23.             plugin::Whisper("$rule_name: " . quest::get_rule($rule_name));
  24.         } else {
  25.             plugin::Whisper("Please say your command in the following format: \"set [rule_name] [rule_value]\"");
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment