EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Little help please? (https://www.eqemulator.org/forums/showthread.php?t=41395)

Baelu 06-18-2017 03:34 AM

Little help please?
 
Really not sure what I did wrong here. Sorry if its something stupid lol, im still learning.

Npc isnt responding to anything.

Code:

sub EVENT_SAY {
    if($text=~/hail && $ulevel <= 50) {
        plugin::Whisper("Welcome $name! here is your  " . quest::saylink("reward", 1) . " !");
                quest::level(51);
                quest::scribespells(51, 1);
                quest::traindiscs(51, 1);
                $client->SetAAPoints(50);
    }elsif($text=~/hail && $ulevel >= 51) {
        plugin::Whisper("Hello $name! Need some  " . quest::saylink("information", 1) . " ?");
        } elsif($text=~/reward/i) {
        plugin::Whisper("This server is 51 / 50, plus much more! Would you like some  " . quest::saylink("information", 1) . "?");
    } elsif($text=~/information/i) {
        plugin::Whisper("Would you like info on  " . quest::saylink("files", 1) . " , " . quest::saylink("website", 1) . " , or the  " . quest::saylink("basics", 1) . " ?");
        } elsif($text=~/website/i) {
        plugin::Whisper("It is currently under cunstruction, patience please!");
        } elsif($text=~/files/i) {
        plugin::Whisper("All required files can be found on the server  " . quest::saylink("website", 1) . " !");
        } elsif($text=~/basics/i) {
        plugin::Whisper("Very well! Hmm lets see, right! I would say your first question would be where to get yourself
                some  " . quest::saylink("equipment", 1) . " ?");
                } elsif($text=~/equipment/i) {
        plugin::Whisper("Well your not going to find much of use without craftsmenship! Items found on your adeventures will be standard and protective. The trick is to use
                augmentation, you see! Most items you find can also be improved from their quality, such as from low to high. Now if you want to create truly powerful items, you my friend would
                need to use  " . quest::saylink("tradeskills", 1) . " .");
                } elsif($text=~/tradeskills/i) {
        plugin::Whisper("Oh yes! You can take items that are low quality and improve them to fine! Or use materials to create something from scratch! Crafted items will surely prove better
                than anything found on your adventures! Just make sure to save anything found along the way! Oh yes, there is plenty more! From making your own food and drinks, to making
        great potions, or exquisite jewlery there is something for everyone! Now one last  " . quest::saylink("tip", 1) . " .");
                } elsif($text=~/tip/i) {
        plugin::Whisper("Explore! Talk to those you see, most items you need to survive can be found, for a price. Seek companionship, you will eventually need some assistance. And most importantly, have fun!");
        }
        }

sub EVENT_SPAWN {
    plugin::SetMobColor(quest::ChooseRandom(0..255), quest::ChooseRandom(0..255), quest::ChooseRandom(0..255));
}

sub EVENT_ITEM {
  plugin::return_items(\%itemcount);


ghanja 06-18-2017 03:08 PM

perl -c script_name.pl

Do the above to check your scripts (syntax).

On a phone at the moment, though first thing that sticks out is a missing curly (closed) at the end of your EVENT_ITEM subroutine.

ghanja 06-18-2017 08:41 PM

I forgot to come back to this thread when I got home. Try this:

Code:

sub EVENT_SPAWN {
        plugin::SetMobColor(quest::ChooseRandom(0..255), quest::ChooseRandom(0..255), quest::ChooseRandom(0..255));
}

sub EVENT_SAY {
        if ($text=~/Hail/i) {
                if ($ulevel <= 50) {
                        plugin::Whisper("Welcome $name! here is your  ".quest::saylink("reward", 1)." !");
                        quest::level(51);
                        quest::scribespells(51, 1);
                        quest::traindiscs(51, 1);
                        $client->SetAAPoints(50);
                } else {
                        plugin::Whisper("Hello $name! Need some  ".quest::saylink("information", 1)." ?");
                }
        }
        elsif($text=~/reward/i) {
        plugin::Whisper("This server is 51 / 50, plus much more! Would you like some  ".quest::saylink("information", 1)."?");
        }
        elsif($text=~/information/i) {
        plugin::Whisper("Would you like info on  ".quest::saylink("files", 1)." , ".quest::saylink("website", 1)." , or the  ".quest::saylink("basics", 1)." ?");
        }
        elsif($text=~/website/i) {
        plugin::Whisper("It is currently under cunstruction, patience please!");
        }
        elsif($text=~/files/i) {
        plugin::Whisper("All required files can be found on the server  ".quest::saylink("website", 1)." !");
        }
        elsif($text=~/basics/i) {
        plugin::Whisper ("Very well! Hmm lets see, right! I would say your first question would be where to get yourself some  ".quest::saylink("equipment", 1)." ?");
        }
        elsif($text=~/equipment/i) {
        plugin::Whisper("Well your not going to find much of use without craftsmenship! Items found on your adeventures will be standard ".
                                                "and protective. The trick is to use augmentation, you see! Most items you find can also be improved from their quality, such as ".
                                                "from low to high. Now if you want to create truly powerful items, you my friend would need to use  ".quest::saylink("tradeskills", 1)." .");
        }
        elsif($text=~/tradeskills/i) {
        plugin::Whisper("Oh yes! You can take items that are low quality and improve them to fine! Or use materials to create something from ".
                                                "scratch! Crafted items will surely prove better than anything found on your adventures! Just make sure to save anything found along ".
                                                "the way! Oh yes, there is plenty more! From making your own food and drinks, to making great potions, or exquisite jewlery there is ".
                                                "something for everyone! Now one last  ".quest::saylink("tip", 1)." .");
        }
        elsif($text=~/tip/i) {
        plugin::Whisper("Explore! Talk to those you see, most items you need to survive can be found, for a price. Seek companionship, you will".
                                                "eventually need some assistance. And most importantly, have fun!");
        }
}

sub EVENT_ITEM {
        plugin::return_items(\%itemcount);
}

Untested because I'm lazy.

Baelu 06-18-2017 09:53 PM

Works flawlessly, thank you!


All times are GMT -4. The time now is 06:31 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.