Bandor
04-14-2015, 10:11 PM
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.
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);
}
}
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.
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);
}
}