EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   Need some insight on problem (https://www.eqemulator.org/forums/showthread.php?t=38883)

scrubtasticx 10-13-2014 04:17 PM

Need some insight on problem
 
so this is a quest kingly helped me with everything works good until the very last part where npc says congrats, gives weapon, and sets qglobals to 9. none of that last section works and im wondering whats wrong here..

Code:

sub EVENT_SAY {

    my %responses = (1 => "The next item you need is an eye from an evil unicorn in Lesser Faydark.",
    2 => "The next item I need is a Polished Shard from Droga.",
    3 => "The next item I need is a Sphere of Sandstorm from Bastion of Thunder.",
    4 => "The next item I need is dryad parts from Jagged Pine Forest.",
    5 => "The next item I need is werewolf talon from Castle Mistmoore.",
    6 => "The next item I need is a snowball from Permafrost.",
    7 => "This last part will not be so easy. I need Kallis' Head.");
       
    if ($text =~/Hail/i && $ulevel == 65 && !defined $qglobals{"Epic"})
        {
        plugin::Whisper("Hello $name, Along my journies I have aquired knowledge on how to create a " . quest::saylink("weapon", 1) . " with power like none seen before.");
    }

        elsif ($text =~/Hail/i && $ulevel <=64 && !defined $qglobals{"Epic"})
        {
                plugin::Whisper("Hello $name, Im sorry but you must be level 65 to start you're epic.");
        }
       
        elsif ($text=~/Hail/i && defined $qglobals{"Epic"})
        {
        if ($qglobals{"Epic"} >= 1 && $qglobals{"Epic"} <= 7)
                {
            plugin::Whisper($responses{$qglobals{"Epic"}});
        }
        }

    if ($text=~/^Weapon$/i)
        {
        plugin::Whisper("In order for me to make you this special weapon I need a few items. The first item I need is a greatsword from Acryila Caverns.");
    }
}

sub EVENT_ITEM {
    my %handins = (1 => [1815, 1, 2, "Wow you are making incredible time getting me these items. The next item I need is a Polished Shard from Droga."],
    2 => [81116, 2, 3, "You are getting closer to greatness. The next item I need is a Sphere of Sandstorm from Bastion of Thunder."],
    3 => [9429, 3, 4, "Incredible! The weapon is almost complete. The next item I need is dryad parts from Jagged Pine Forest."],
    4 => [8107, 4, 5, "You are half way there. The next item I need is werewolf talon from Castle Mistmoore."],
    5 => [13746, 5, 6, "The weapon is starting to glow. The next item I need is a snowball from permafrost."],
    6 => [19034, 6, 7, "Just one more peice to go. This last part will not be so easy. I need Kallis' Head."],
    7 => [31420, 7, 8, "That is everything. Give me a few seconds to get your weapon made."]);
    my %rewards = ("Warrior" => 60332,
    "Cleric" => 20076,
    "Paladin" => 48147,
    "Ranger" => 62649,
    "Shadowknight" => 48136,
    "Druid" => 62880,
    "Monk" => 67742,
    "Bard" => 77640,
    "Rogue" => 39941,
    "Shaman" => 57405,
    "Necromancer" => 64067,
    "Wizard" => 16576,
    "Magician" => 19839,
    "Enchanter" => 52962,
    "Beastlord" => 57054,
    "Berserker" => 18609);
    if (!defined $qglobals{"Epic"})
        {
        if (plugin::check_handin(\%itemcount, 51261 => 1))
                {
            plugin::Whisper("This is just what I was looking for! The next item you need is an eye from an evil unicorn in Lesser Faydark.");
            quest::setglobal("Epic", 1, 5, "F");
        }
    }
        elsif (defined $qglobals{"Epic"})
        {
        if ($qglobals{"Epic"} <= 7)
                {
            foreach $key (keys %handins)
                        {
                if (plugin::check_handin(\%itemcount, $handins{$key}[0] => 1) && $qglobals{"Epic"} == $handins{$key}[1])
                                {
                    quest::setglobal("Epic", $handins{$key}[2], 5, "F");
                    plugin::Whisper($handins{$key}[3]);
                }
            }
        }
                elsif ($qglobals{"Epic"} == 8)
                {
            quest::gmsay("Congratulations to $name on their " .    quest::varlink($rewards{$class}) . "!", 335, 1, 0, 0);
            quest::SummonItem($rewards{$class});
          quest::setglobal("Epic", 9, 5, "F");
        }
    }
    plugin::return_items(\%itemcount);
}


Kingly_Krab 10-13-2014 04:19 PM

Well, the quest::SummonItem should be quest::summonitem. Things like this are case-sensitive.

scrubtasticx 10-13-2014 04:20 PM

still not working with that change.

Kingly_Krab 10-13-2014 04:22 PM

Ignore this post.

scrubtasticx 10-13-2014 04:28 PM

Fixed thanks Kingly!!!! :)

chrsschb 10-13-2014 04:47 PM

I'm gonna guess the nesting of the last statement is wrong, but I haven't broken down the quest completely.

Kingly_Krab 10-13-2014 04:49 PM

It works now:
Code:

sub EVENT_SAY {
    my %responses = (1 => "The next item you need is an eye from an evil unicorn in Lesser Faydark.",
    2 => "The next item I need is a Polished Shard from Droga.",
    3 => "The next item I need is a Sphere of Sandstorm from Bastion of Thunder.",
    4 => "The next item I need is dryad parts from Jagged Pine Forest.",
    5 => "The next item I need is werewolf talon from Castle Mistmoore.",
    6 => "The next item I need is a snowball from Permafrost.",
    7 => "This last part will not be so easy. I need Kallis' Head.");
   
    if ($text =~/Hail/i && $ulevel == 65 && !defined $qglobals{"Epic"}) {
        plugin::Whisper("Hello $name, along my journies I have acquired knowledge on how to create a " . quest::saylink("weapon", 1) . " with power like none seen before.");
    } elsif ($text =~/Hail/i && $ulevel <= 64 && !defined $qglobals{"Epic"}) {
        plugin::Whisper("Hello $name, I'm sorry but you must be level 65 to start your epic.");
    } elsif ($text=~/Hail/i && defined $qglobals{"Epic"}) {
        if ($qglobals{"Epic"} >= 1 && $qglobals{"Epic"} <= 7) {
            plugin::Whisper($responses{$qglobals{"Epic"}});
        }
    }

    if ($text=~/^Weapon$/i) {
        plugin::Whisper("In order for me to make you this special weapon I need a few items. The first item I need is a greatsword from Acryila Caverns.");
    }
}

sub EVENT_ITEM {
    my %handins = (1 => [1815, 1, 2, "Wow you are making incredible time getting me these items. The next item I need is a Polished Shard from Droga."],
    2 => [81116, 2, 3, "You are getting closer to greatness. The next item I need is a Sphere of Sandstorm from Bastion of Thunder."],
    3 => [9429, 3, 4, "Incredible! The weapon is almost complete. The next item I need is dryad parts from Jagged Pine Forest."],
    4 => [8107, 4, 5, "You are half way there. The next item I need is werewolf talon from Castle Mistmoore."],
    5 => [13746, 5, 6, "The weapon is starting to glow. The next item I need is a snowball from permafrost."],
    6 => [19034, 6, 7, "Just one more peice to go. This last part will not be so easy. I need Kallis' Head."],
    7 => [31420, 7, 8, "That is everything. Give me a few seconds to get your weapon made."]);
    my %rewards = ("Warrior" => 60332,
    "Cleric" => 20076,
    "Paladin" => 48147,
    "Ranger" => 62649,
    "Shadowknight" => 48136,
    "Druid" => 62880,
    "Monk" => 67742,
    "Bard" => 77640,
    "Rogue" => 39941,
    "Shaman" => 57405,
    "Necromancer" => 64067,
    "Wizard" => 16576,
    "Magician" => 19839,
    "Enchanter" => 52962,
    "Beastlord" => 57054,
    "Berserker" => 18609);
    if (!defined $qglobals{"Epic"}) {
        if (plugin::check_handin(\%itemcount, 51261 => 1)) {
            plugin::Whisper("This is just what I was looking for! The next item you need is an eye from an evil unicorn in Lesser Faydark.");
            quest::setglobal("Epic", 1, 5, "F");
        }
    } elsif (defined $qglobals{"Epic"}) {
        foreach $key (keys %handins) {
            if (plugin::check_handin(\%itemcount, $handins{$key}[0] => 1) && $qglobals{"Epic"} == $handins{$key}[1]) {
                plugin::Whisper($handins{$key}[3]);
                if ($handins{$key}[2] <= 7) {
                    quest::setglobal("Epic", $handins{$key}[2], 5, "F");
                } elsif ($handins{$key}[2] == 8) {
                    quest::gmsay("Congratulations to $name on their " . quest::varlink($rewards{$class}) . "!", 335, 1, 0, 0);
                    quest::summonitem($rewards{$class});
                    quest::setglobal("Epic", 9, 5, "F");
                }
            }
        }
    }
    plugin::return_items(\%itemcount);
}



All times are GMT -4. The time now is 03:14 AM.

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