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 12-13-2017, 01:27 AM
Minirva
Fire Beetle
 
Join Date: Nov 2012
Posts: 19
Default Different Rewards Per Class?

I am trying to write a quest that will give a different reward for each class on turn in. When I just have the check for turn ins and a single reward things work fine. Once I try working in classes with different rewards, the npc just eats the turn ins.
I have tried a few variations of what I have below and hit a wall with my very limited knowledge. Am I way off on how I am trying to write this?

Code:
# Zone: The Plane of Knowledge (poknowledge) >> Magus_of_the_Planes (2000032)

sub EVENT_SAY 
{

	my $essence = quest::saylink("essence");
	my $reward = quest::saylink("reward");
	my $ready = quest::saylink("ready");
	my $Planeofhate = quest::saylink("Plane of Hate");
	my $Planeofear = quest::saylink("Plane of Fear");
	my $Planeofsky = quest::saylink("Plane of Sky");
	
	if ($text=~/hail/i) {
		quest::say("Can you feel it $name? The Faceless One, the Prince of Hate, and the ever watchful eye of the Wurmqueen! Their powers swell. Imagine what us mortals could do with such power! $name, you must gather their [$essence] for me. I would [$reward] you greatly for such a treacherous task. If you are willing to undertake this endeavor, let me know when you are [$ready], and I will send you to the planes.");
	}
	if ($text=~/essence/i) {
		quest::say("The power of the Gods themselves. Their never ending life force. Enter their realms and confront each. Kill their physical forms and drain the essence from their bodies. Make haste $name, you will not have much time to escape the planes before the Gods will manifest once again in thier physical form.");
	}
	if ($text=~/reward/i) {
		quest::say("Yes your reward. I will create five shards out of the essences, from which I will grant you one. This shard will have the ability to greatly enhance your equipment.");
	}
	if ($text=~/ready/i) {
		quest::say("I am glad yo hear it. Where shall I send you? [$Planeofhate], [$Planeofear], or the [$Planeofsky]?");
	}
	if ($text=~/Plane of Hate/i) {
		quest::movepc(186,-393,656,4); 
	}
	if ($text=~/Plane of Fear/i) {
		quest::movepc(72,1031,-771,108); 
	}
	if ($text=~/Plane of Sky/i) {
		quest::movepc(71,614,1415,663); 
	}
}

sub EVENT_ITEM {
	if (plugin::check_handin(\%itemcount, 147514 => 1, 147515 => 1, 147516 => 1)){
	if ($class eq "Warrior") {
		quest::summonitem(29648);
	}
	elsif ($class eq "Cleric") {
		quest::summonitem(16272);
	}
	elsif ($class eq "Paladin") {
		quest::summonitem(147513);
	}
}
Reply With Quote
  #2  
Old 12-13-2017, 02:56 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Code:
perl -c name_of_script.pl
Reply With Quote
  #3  
Old 12-13-2017, 03:05 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Code:
elsif ($lookingfor eq "easy answer") {

Code:
# Zone: The Plane of Knowledge (poknowledge) >> Magus_of_the_Planes (2000032)
sub EVENT_SAY {
	if ($text=~/hail/i) {
		quest::say(	"Can you feel it $name? The Faceless One, the Prince of Hate, and the ever watchful eye of the Wurmqueen! ".
					"Their powers swell. Imagine what us mortals could do with such power! $name, you must gather their ".
					"[".quest::saylink("essence")."] for me. I would [".quest::saylink("reward")."] you greatly for such ".
					"a treacherous task. If you are willing to undertake this endeavor, let me know when you are [".
					quest::saylink("ready")."], and I will send you to the planes.");
	}
	elsif ($text=~/essence/i) {
		quest::say(	"The power of the Gods themselves. Their never ending life force. Enter their realms and confront each. ".
					"Kill their physical forms and drain the essence from their bodies. Make haste $name, you will not have ".
					"much time to escape the planes before the Gods will manifest once again in thier physical form.");
	}
	elsif ($text=~/reward/i) {
		quest::say(	"Yes your reward. I will create five shards out of the essences, from which I will grant you one. This ".
					"shard will have the ability to greatly enhance your equipment.");
	}
	elsif ($text=~/ready/i) {
		quest::say(	"I am glad yo hear it. Where shall I send you? [".quest::saylink("Plane of Hate")."], ".
					"[".quest::saylink("Plane of Fear")."], or the [".quest::saylink("Plane of Sky")."]?");
	}
	elsif ($text=~/Plane of Hate/i) {
		quest::movepc(186,-393,656,4); 
	}
	elsif ($text=~/Plane of Fear/i) {
		quest::movepc(72,1031,-771,108); 
	}
	elsif ($text=~/Plane of Sky/i) {
		quest::movepc(71,614,1415,663); 
	}
}

sub EVENT_ITEM {
	if (plugin::check_handin(\%itemcount, 147514 => 1, 147515 => 1, 147516 => 1)) {
		if ($class eq "Warrior") {
			quest::summonitem(29648);
		} 
		elsif ($class eq "Cleric") {
			quest::summonitem(16272);
		}
		elsif ($class eq "Paladin") {
			quest::summonitem(147513);
		}
	}
}
You were missing a closing curly in your EVENT_ITEM subroutine.
Reply With Quote
  #4  
Old 12-13-2017, 11:35 PM
Minirva
Fire Beetle
 
Join Date: Nov 2012
Posts: 19
Default

Thanks once again Ghanja
Reply With Quote
  #5  
Old 12-13-2017, 11:41 PM
Minirva
Fire Beetle
 
Join Date: Nov 2012
Posts: 19
Default

Btw at the risk of looking even more noobish, what did you mean by

Code:
elsif ($lookingfor eq "easy answer") {
and

Code:
perl -c name_of_script.pl
Reply With Quote
  #6  
Old 12-13-2017, 11:49 PM
Splose's Avatar
Splose
Discordant
 
Join Date: Apr 2014
Posts: 279
Default

if looking for an easy answer and that's a command prompt command to check if there are any syntax errors in your scripts. Can also use this webpage for that http://ult-tex.net/tools/ultra/line_count.pl

Also.. Use this, you'll have to fix the item id's but this'll cut down on a lot of space.. also when you're doing a turnin npc always put the return items at the bottom of the script so if players hand it some random shit it wont eat it.

Code:
# Zone: The Plane of Knowledge (poknowledge) >> Magus_of_the_Planes (2000032)
sub EVENT_SAY {
	if ($text=~/hail/i) {
		quest::say(	"Can you feel it $name? The Faceless One, the Prince of Hate, and the ever watchful eye of the Wurmqueen! ".
					"Their powers swell. Imagine what us mortals could do with such power! $name, you must gather their ".
					"[".quest::saylink("essence")."] for me. I would [".quest::saylink("reward")."] you greatly for such ".
					"a treacherous task. If you are willing to undertake this endeavor, let me know when you are [".
					quest::saylink("ready")."], and I will send you to the planes.");
	}
	elsif ($text=~/essence/i) {
		quest::say(	"The power of the Gods themselves. Their never ending life force. Enter their realms and confront each. ".
					"Kill their physical forms and drain the essence from their bodies. Make haste $name, you will not have ".
					"much time to escape the planes before the Gods will manifest once again in thier physical form.");
	}
	elsif ($text=~/reward/i) {
		quest::say(	"Yes your reward. I will create five shards out of the essences, from which I will grant you one. This ".
					"shard will have the ability to greatly enhance your equipment.");
	}
	elsif ($text=~/ready/i) {
		quest::say(	"I am glad to hear it. Where shall I send you? [".quest::saylink("Plane of Hate")."], ".
					"[".quest::saylink("Plane of Fear")."], or the [".quest::saylink("Plane of Sky")."]?");
	}
	elsif ($text=~/Plane of Hate/i) {
		quest::movepc(186,-393,656,4); 
	}
	elsif ($text=~/Plane of Fear/i) {
		quest::movepc(72,1031,-771,108); 
	}
	elsif ($text=~/Plane of Sky/i) {
		quest::movepc(71,614,1415,663); 
	}
}

sub EVENT_ITEM {
	my %rewards = (
		"Warrior" => 135015,
		"Cleric" => 135015,
		"Paladin" => 135015,
		"Ranger" => 135008,
		"Shadowknight" => 135015,
		"Druid" => 135022,
		"Monk" => 135029,
		"Bard" => 135015,
		"Rogue" => 135008,
		"Shaman" => 135008,
		"Necromancer" => 135001,
		"Wizard" => 135001,
		"Magician" => 135001,
		"Enchanter" => 135001,
		"Beastlord" => 135022,
		"Berserker" => 135008
	);
	
	if(plugin::check_handin(\%itemcount, 147514 => 1, 147515 => 1, 147516 => 1)) {
		quest::summonitem($rewards{$class});
	}
	plugin::return_items(\%itemcount);
}
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 07:05 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