View Single Post
  #6  
Old 11-18-2017, 05:47 PM
Movement
Sarnak
 
Join Date: Sep 2011
Posts: 77
Default

I got it working. Natedog (actually thinking of calling him NateGod instead! :P) helped me. Theres no way I could have gotten it working with out him and no way I could have figured out the code below. I am posting here to give him credit and thanks and going to post the code below so that it may help others in the future!

Code:
sub EVENT_SAY {
    my %stuff = (
        #itemID->POINTS->THEME
        4613 => [1, 1], # Some item, Deepest Guk Theme
        1234 => [1, 2], # some item, Miraguls Menagerie Theme
        2345 => [1, 3], # some item, Mistmoore Catacombs Theme
        3456 => [1, 4], # some item, Rujarkian Hills Theme
        13006 => [1, 5], # some item, Takish-Hiz Theme   --- WATER FLASK for example..
    );
    
    my %themes = (
        1 => "Deepest Guk Theme",
        2 => "Miraguls Menagerie Theme",
        3 => "Mistmoore Catacombs Theme",
        4 => "Rujarkian Hills Theme",
        5 => "Takish-Hiz Theme"
    );
    
    my $collected = 0;
            
    if ($text=~/Hail/i) {
        plugin::Whisper("You can hand in your " . quest::saylink("stuff",1));
    } elsif ($text=~/stuff/i) {
        plugin::Whisper("Collecting all LDON items...");
        foreach my $key (keys %stuff) {
            $collected = quest::collectitems($key, 1);
            if($collected) {
                quest::addldonpoints($stuff{$key}[0]*$collected, $stuff{$key}[1]);
                $client->Message(315, "Added " . $stuff{$key}[0]*$collected . " points to " . $themes{$stuff{$key}[1]});
            }
        }
    }
}
Reply With Quote