Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 04-14-2015, 10:11 PM
Bandor
Hill Giant
 
Join Date: May 2014
Posts: 209
Default Question..again

I know this is getting to be a weekly thing but I have yet another slightly broken quest lol. Please be patient with me im learning!


All of this works except the final part,were you say pick for the item. I had it working but it appears you could just say pick and get an item without achieving the global flag first. For whatever reason the script below doesnt seem to be setting the global to get trigger the pick text.

Code:
sub EVENT_SAY {
            my %hash = ("Warrior" => [2275, 2277],
        "Cleric" => [2376, 2275],
        "Paladin" => [2275, 2277],
        "Ranger" => [2277, 2379],
        "Shadowknight" => [2275, 2277],
        "Druid" => [2370, 2372, 2376],
        "Monk" => [2277, 2379],
        "Bard" => [2277, 2372, 2377],
        "Rogue" => [2277, 2379],
        "Shaman" => [2298, 2376, 2372],
        "Necromancer" => [2278, 2372],
        "Wizard" => [2298, 2370, 2378],
        "Magician" => [2278, 2370, 2378],
        "Enchanter" => [2377..2378],
        "Beastlord" => [2277..2278, 2298],
        "Berserker" => [2277, 2379]);
		my %spells = (2372 => 2385,
        2298 => 2380,
        2378 => 2381,
        2376 => 2383,
		2377 => 2393,
		2370 => 2381);
	if ($text=~/hail/i) {
        if ($ulevel > 69) {
            plugin::Whisper("Hello $name! A item of great power await all those that are willing to " . quest::saylink("slay", 1) . " their demons.");
        } elsif (defined $qglobals{"Epicz"} && $qglobals{"Epicz"} >= 2) {
            plugin::Whisper("You are a great adventurer $name.");
		} else {
            plugin::Whisper("You are not ready fur such an adventure. Find the Slayer's near the temple entrance,perhaps they could use someone of your stature. Return to me when you have gained more strength!");
        }
    }
elsif($text=~/slay/i) {
 plugin::Whisper("An ancient demon known as Azgraeth has chosen to take the form of a powerful master. Azgraeth quickly used his new body to unleash his 
 images upon a section of norrath. In an last minute effort to destroy Azgraeth once and for all a group of powerful adventurers banished him to a horrid chamber. Though that seemed to be all they could do. Once there Azgraeth mastered his magic and is now preparing to attempt to wreak havoc on Norrath again! Do you think you are strong enough to " . quest::saylink("stop", 1) . " him?");
 }
 elsif($text=~/stop/i) {
 plugin::Whisper("I will send you to the chamber and allow you to face Azgraeth. Please be prepared, you should bring many friends as this fight will test your skills to the limits! If you should happen to win this battle bring me back " . quest::varlink(4332) . " as proof. When you are " . quest::saylink("ready", 1) . " I will send you.");
 }
  elsif($text=~/stop/i) {
 plugin::Whisper("Very well $name!");
 quest::zone("chambersa");
 }
	elsif($text=~/pick/i && !defined $qglobals{"Epicz"} && $qglobals{"Epicz"} == 1) {
            plugin::Whisper("Just pick which item you want young $class.");
                    if (defined $hash{$class}[1]) {
                            foreach my $item (@{$hash{$class}}) {
                                    $client->Message(315, quest::varlink($item) . " " . quest::saylink($item, 1, "Choose"));
                }
                    } else {
                $client->Message(315, quest::varlink($hash{$class}) . " " . quest::saylink($hash{$class}, 1, "Choose"));
		}
		 } elsif($text=~/pick/i && defined $qglobals{"Epicz"} && $qglobals{"Epicz"} >= 2) {
            plugin::Whisper("You have already chosen your path!");
            } elsif (int($text) > 0 && int($text) < 999999 && !defined $qglobals{"Epicz"}) {
                    if (defined $hash{$class}[1]) {
                            foreach my $item (@{$hash{$class}}) {
                    if ($item == int($text)) {
                        quest::setglobal("Epicz", $item, 5, "F");
                        quest::summonitem($item);
                                            if (defined $spells{$item}) {
                                                    quest::summonitem($spells{$item});
                        }
                    }
                }
                    } else {
                            if ($hash{$class} == int($text)) {
                    quest::setglobal("Epicz", $hash{$class}, 5, "F");
                    quest::summonitem($hash{$class});
                }
            }
        }
		}
		
 
 
 sub EVENT_ITEM { 
    if(plugin::check_handin(\%itemcount, 4332 => 1)) {
        plugin::Whisper("As promised! Just " . quest::saylink("pick", 1) . " your item.");
     	quest::setglobal("Epicz", 1, 5, "F");
    }
    plugin::return_items(\%itemcount);
}
}
__________________
Owner and Developer - Everquest: A New World
Reply With Quote
  #2  
Old 04-14-2015, 10:42 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Check this line:
Code:
elsif($text=~/pick/i && !defined $qglobals{"Epicz"} && $qglobals{"Epicz"} == 1) {
You're checking if it's not defined then checking its value even though this line sets it to 1:
Code:
quest::setglobal("Epicz", 1, 5, "F");
Also, you're checking for $hash{$class} even though they all have at least 2 elements in their array, here's my re-write (keep in mind it is untested):
Code:
sub EVENT_SAY {
    my %hash = ("Warrior" => [2275, 2277],
    "Cleric" => [2376, 2275],
    "Paladin" => [2275, 2277],
    "Ranger" => [2277, 2379],
    "Shadowknight" => [2275, 2277],
    "Druid" => [2370, 2372, 2376],
    "Monk" => [2277, 2379],
    "Bard" => [2277, 2372, 2377],
    "Rogue" => [2277, 2379],
    "Shaman" => [2298, 2376, 2372],
    "Necromancer" => [2278, 2372],
    "Wizard" => [2298, 2370, 2378],
    "Magician" => [2278, 2370, 2378],
    "Enchanter" => [2377..2378],
    "Beastlord" => [2277..2278, 2298],
    "Berserker" => [2277, 2379]);
    my %spells = (2372 => 2385,
    2298 => 2380,
    2378 => 2381,
    2376 => 2383,
    2377 => 2393,
    2370 => 2381);
    if ($text=~/hail/i) {
        if ($ulevel > 69) {
            plugin::Whisper("Hello $name! A item of great power await all those that are willing to " . quest::saylink("slay", 1) . " their demons.");
        } elsif (defined $qglobals{"Epicz"} && $qglobals{"Epicz"} >= 2) {
            plugin::Whisper("You are a great adventurer $name.");
        } else {
            plugin::Whisper("You are not ready fur such an adventure. Find the Slayer's near the temple entrance,perhaps they could use someone of your stature. Return to me when you have gained more strength!");
        }
    } elsif($text=~/slay/i) {
        plugin::Whisper("An ancient demon known as Azgraeth has chosen to take the form of a powerful master. Azgraeth quickly used his new body to unleash his 
        images upon a section of norrath. In an last minute effort to destroy Azgraeth once and for all a group of powerful adventurers banished him to a horrid chamber. Though that seemed to be all they could do. Once there Azgraeth mastered his magic and is now preparing to attempt to wreak havoc on Norrath again! Do you think you are strong enough to " . quest::saylink("stop", 1) . " him?");
    } elsif($text=~/stop/i) {
        plugin::Whisper("I will send you to the chamber and allow you to face Azgraeth. Please be prepared, you should bring many friends as this fight will test your skills to the limits! If you should happen to win this battle bring me back " . quest::varlink(4332) . " as proof. When you are " . quest::saylink("ready", 1) . " I will send you.");
    } elsif($text=~/stop/i) {
        plugin::Whisper("Very well $name!");
        quest::zone("chambersa");
    } elsif($text=~/pick/i && defined $qglobals{"Epicz"} && $qglobals{"Epicz"} == 1) {
        plugin::Whisper("Just pick which item you want young $class.");
        $client->Message(315, quest::varlink($_) . " " . quest::saylink($_, 1, "Choose")) for @{$hash{$class}};
    } elsif($text=~/pick/i && defined $qglobals{"Epicz"} && $qglobals{"Epicz"} >= 2) {
        plugin::Whisper("You have already chosen your path!");
    } elsif (int($text) > 0 && int($text) < 999999 && defined $qglobals{"Epicz"} && $qglobals{"Epicz"} == 1) {
        if (int($text) ~~ @{$hash{$class}}) {
            quest::setglobal("Epicz", int($text), 5, "F");
            quest::summonitem(int($text));
            if (defined $spells{int($text)}) {
                quest::summonitem($spells{int($text)});
            }
        }
    }
}
 
sub EVENT_ITEM { 
    if(plugin::check_handin(\%itemcount, 4332 => 1)) {
        plugin::Whisper("As promised! Just " . quest::saylink("pick", 1) . " your item.");
         quest::setglobal("Epicz", 1, 5, "F");
    }
    plugin::return_items(\%itemcount);
}

Last edited by Kingly_Krab; 04-15-2015 at 05:49 PM..
Reply With Quote
  #3  
Old 04-15-2015, 08:10 AM
Bandor
Hill Giant
 
Join Date: May 2014
Posts: 209
Default

Gave it a shot,no go on the rewrite,isnt responsive to anything.
__________________
Owner and Developer - Everquest: A New World
Reply With Quote
  #4  
Old 04-15-2015, 11:38 AM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Make line 42 read this:

Code:
        $client->Message(315, quest::varlink($_) . " " . quest::saylink($_, 1, "Choose")) for @{$hash{$class}};
Reply With Quote
  #5  
Old 04-15-2015, 03:02 PM
Bandor
Hill Giant
 
Join Date: May 2014
Posts: 209
Default

Got that working now. However its still not wanting to respond to pick after giving him the item. Not sure if the global isnt setting or if the 'pick' part is acting up
__________________
Owner and Developer - Everquest: A New World
Reply With Quote
  #6  
Old 04-15-2015, 03:51 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by Bandor View Post
Got that working now. However its still not wanting to respond to pick after giving him the item. Not sure if the global isnt setting or if the 'pick' part is acting up
Verify qglobal is set on the NPC. It is perhaps the single most often over looked setting (because normally, most firmly believe they already set it, but, didn't). I still fall victim to this time to time.

Krab said it was untested, and I didn't bother to test it either, it was a missing close brace } that was missing, rather, it popped out at me. I'll give it another look, though I suspect Krab is lurking (he's sneaky like that).
Reply With Quote
  #7  
Old 04-15-2015, 04:09 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Changed formatting a little for my eyes, line 55 I didnt think was supposed to check for another "stop" (or whatever it was). Curious, line 59 is checking to see if Epicz is not defined, yet, also checking to see if it has a value of 1?

Code:
%hash = (
			"Warrior" => [2275, 2277],
			"Cleric" => [2376, 2275],
			"Paladin" => [2275, 2277],
			"Ranger" => [2277, 2379],
			"Shadowknight" => [2275, 2277],
			"Druid" => [2370, 2372, 2376],
			"Monk" => [2277, 2379],
			"Bard" => [2277, 2372, 2377],
			"Rogue" => [2277, 2379],
			"Shaman" => [2298, 2376, 2372],
			"Necromancer" => [2278, 2372],
			"Wizard" => [2298, 2370, 2378],
			"Magician" => [2278, 2370, 2378],
			"Enchanter" => [2377..2378],
			"Beastlord" => [2277..2278, 2298],
			"Berserker" => [2277, 2379]
		);

%spells = (
			2372 => 2385,
			2298 => 2380,
			2378 => 2381,
			2376 => 2383,
			2377 => 2393,
			2370 => 2381
		);


sub EVENT_SAY {
	if ($text=~/hail/i) {
		if ($ulevel > 69) {
			plugin::Whisper("Hello $name! A item of great power await all those that are willing to " . quest::saylink("slay", 1) . " their demons.");
		} 
		elsif (defined $qglobals{"Epicz"} && $qglobals{"Epicz"} >= 2) {
			plugin::Whisper("You are a great adventurer $name.");
		} 
		else {
			plugin::Whisper("You are not ready fur such an adventure. Find the Slayer's near the temple entrance,perhaps they could use someone ".
							"of your stature. Return to me when you have gained more strength!");
		}
    } 
	elsif($text=~/slay/i) {
		plugin::Whisper("An ancient demon known as Azgraeth has chosen to take the form of a powerful master. Azgraeth quickly used his new body ".
						"to unleash his images upon a section of norrath. In an last minute effort to destroy Azgraeth once and for all a group of ".
						"powerful adventurers banished him to a horrid chamber. Though that seemed to be all they could do. Once there Azgraeth ".
						"mastered his magic and is now preparing to attempt to wreak havoc on Norrath again! Do you think you are strong enough ".
						"to ".quest::saylink("stop", 1)." him?");
    } 
	elsif($text=~/stop/i) {
        plugin::Whisper("I will send you to the chamber and allow you to face Azgraeth. Please be prepared, you should bring many friends as ".
						"this fight will test your skills to the limits! If you should happen to win this battle bring me back ".quest::varlink(4332).
						" as proof. When you are " . quest::saylink("ready", 1) . " I will send you.");
    } 
	elsif($text=~/ready/i) {
		plugin::Whisper("Very well $name!");
		quest::zone("chambersa");
	}
	elsif($text=~/pick/i && !defined $qglobals{"Epicz"} && $qglobals{"Epicz"} == 1) {
		plugin::Whisper("Just pick which item you want young $class.");
		$client->Message(315, quest::varlink($_)." ".quest::saylink($_, 1, "Choose")) for @{$hash{$class}};
	} 
	elsif($text=~/pick/i && defined $qglobals{"Epicz"} && $qglobals{"Epicz"} >= 2) {
		plugin::Whisper("You have already chosen your path!");
	} 
	elsif (int($text) > 0 && int($text) < 999999 && defined $qglobals{"Epicz"} && $qglobals{"Epicz"} == 1) {
		if (int($text) ~~ @{$hash{$class}}) {
			quest::setglobal("Epicz", int($text), 5, "F");
			quest::summonitem(int($text));
			if (defined $spells{int($text)}) {
				quest::summonitem($spells{int($text)});
			}
		}
	}
}
 
sub EVENT_ITEM { 
	if (plugin::check_handin(\%itemcount, 4332 => 1)) {
		plugin::Whisper("As promised! Just ".quest::saylink("pick", 1)." your item.");
		quest::setglobal("Epicz", 1, 5, "F");
	}
	plugin::return_items(\%itemcount);
}

Last edited by ghanja; 04-15-2015 at 04:19 PM.. Reason: had something ass backwards
Reply With Quote
  #8  
Old 04-15-2015, 04:26 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

I'm going to go out on a limb and assume line 59 should read:

Code:
	elsif($text=~/pick/i && defined $qglobals{"Epicz"} && $qglobals{"Epicz"} == 1) {
Reply With Quote
  #9  
Old 04-15-2015, 05:08 PM
Bandor
Hill Giant
 
Join Date: May 2014
Posts: 209
Default

That did it,working flawlessly now tyvm for the help!
__________________
Owner and Developer - Everquest: A New World
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:45 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3