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 06-25-2008, 09:08 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

i think you have an icorect follow up of elses and ifs in first part

there can only be ONE else inside a single if and i belvie you have incorect open closed brakets

Code:
sub EVENT_SAY 
{  - OPENED
if($text=~/hail/i)
{ - OPENED
if(plugin::check_hasitem($client, 13732))
{ - OPENED
quest::say("What is this? You bring good tidings indeed, $name! Give me the item.");
}  - CLOSED
else
{  - OPENED
quest::say("Do you not see I have enough [trouble] already? Your welcome here is doubtful");
}  - CLOSED


- MISSING CLOSEING BRAKET HERE

if($text=~/trouble/i)
{
quest::say("I sense my will is being bent by some [evil].");
}
if($text=~/evil/i)
{
quest::emote("mumbles inaudibly; his eyes stare blankly");
}
}

}  - WRONGLY PLACED BRAKET
Reply With Quote
  #2  
Old 06-25-2008, 09:30 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

I made your change, Chaos, and (oddly enough) it made no difference in the quest (not sure why--you'd think placement of brackets would matter). I'm making live changes directly to the quest/zone folder, and I "reloadquest" after each change. As I mentioned above, that part of the script has always worked fine. It fails only once it calls the EVENT_ITEM script.
Reply With Quote
  #3  
Old 06-25-2008, 09:56 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Okay, I have been experimenting with this code, and got it to (semi-) work. I replaced:

sub EVENT_ITEM {
if(plugin::check_handin(\%itemcount,13732 == 1))
{

with . . .

sub EVENT_ITEM {
if($item,13732)
{

I though, as long as I have only one item to turn in, maybe I won't need the count variable. I have no idea whether this is "sound" from a scripting standpoint, but the npc now takes the item and rewards me with the right exp, plat and faction. But now he'll also take just any item and give the same reward. Any way to modify this so only that item is recognized?
Reply With Quote
  #4  
Old 06-25-2008, 09:58 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

oh yeah make sure than you only have ONE EVENT_SAY section as Trevies pointed out

and to be sure
you need to place a closing curcly braket when I said
and remove one where i said
Reply With Quote
  #5  
Old 06-25-2008, 10:16 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

try this.
replace

if(plugin::check_handin(\%itemcount,13732 == 1))

with

if(plugin::check_handin(\%itemcount,13732 => 1))
Reply With Quote
  #6  
Old 06-25-2008, 10:39 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Quote:
Originally Posted by ChaosSlayer View Post
try this.
replace

if(plugin::check_handin(\%itemcount,13732 == 1))

with

if(plugin::check_handin(\%itemcount,13732 => 1))
Yay! That did it! It's now accepting only item 13732. Since that item is lore, the ">" operator becomes moot. (But why doesn't == work?)

Thanks for all the help. Next up; mob spawns triggered by the same turn-in. Going to try my hand at solo-ing the quest:spawn feature, but I may be back. Thanks again.
Reply With Quote
  #7  
Old 06-25-2008, 10:46 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Was about to paste this when you apparently resolved your issues. Your quest still had the brackets in the wrong lines for your hasitem check and text responses to work properly. I adjusted that, I also did the => fix, and I removed all of the ;s and --s in your quest::say's, because you have to be careful when using certain characters in there, and I haven't personally used either of those in that way. So, I thought it might have something to do with your issue, but apparently not.

Here is the final quest after my edits:

Code:
sub EVENT_SAY {

  if($text=~/hail/i) {
    if(plugin::check_hasitem($client, 13732)) {
      quest::say("What is this? You bring good tidings indeed, $name! Give me the item."); }

    else  {
      quest::say("Do you not see I have enough [trouble] already? Your welcome here is doubtful"); }
  }

  if($text=~/trouble/i) {
    quest::say("I sense my will is being bent by some [evil]."); }

  if($text=~/evil/i) {
    quest::emote("mumbles inaudibly and his eyes stare blankly"); }

  if($text=~/cities/i) {
    quest::say("Who knows where he may strike first? Go now, $name, and make preparations for war. Take the Interior Road to the Palace, and take word to the Captain of our good fortune, and of the threat that follows. He will know what to do. I will keep watch here the time being, but will make way there if it [comes to that]."); }

  if($text=~/comes to that/i) {
    quest::say("$name, listen to me carefully. You must take word to the Captain of the Guard. He knows nothing of this find, and very soon it may be too late. The Palace lies defenseless, and is vulnerable to the enemy's attack. The fate of the Palace is in your hands, $name. If you do not go quickly, who can tell what [fate] awaits them?"); }

  if($text=~/fate/i) {
    quest::say("There is little time to explain it all now, Go! I have made you a full citizen of the Realm and a knight of the Palace. On this journey you bear the authority of the king himself! Go! And may the blessing of the Realm go with you! My trusted advisor will take care of matters here."); }

}


sub EVENT_ITEM {

  if(plugin::check_handin(\%itemcount, 13732 => 1)) {
    quest::givecash("0","0","0","5000");
    quest::exp(3500000);
    quest::faction(19927,4000);
    quest::ding();
    quest::say("Well done, $name! We now have the item. Yet it is certain the enemy knows of our plans. Even now he is planning his attack. We must muster our defenses and set reinforcements on our [cities].");
    $client->Message(15, "You receive 5000 platinum pieces");
    $client->Message(15, "You receive 3500000 exp points");
    $client->Message(15, "Your faction standing with the Realm could not get any better!"); }

  else {
    quest::say("I have no use for this, $name. Do not trouble me again.  Unless you bring the item!");
    plugin::return_items(\%itemcount); }

}
Notice that I also changed the format on how the quest is written so that it is easier to read. It is a good idea to write in a way similar to that so you can find mistakes quicker.

And, whenever I am working on a quest, I remove 1 section at a time until I narrow it down to a certain section and then I remove a line at a time until it works. Then add them in again until it breaks and fix the line that is causing the break to happen.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #8  
Old 06-26-2008, 09:51 AM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Thanks Trevius. I replaced my current version with yours just to be on the safe side, so your work wasn't in vain. It also helped me to see a better way to format. Thanks again.
Reply With Quote
  #9  
Old 06-26-2008, 12:16 AM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

Quote:
Originally Posted by Neiv View Post
Yay! That did it! It's now accepting only item 13732. Since that item is lore, the ">" operator becomes moot. (But why doesn't == work?)

Thanks for all the help. Next up; mob spawns triggered by the same turn-in. Going to try my hand at solo-ing the quest:spawn feature, but I may be back. Thanks again.

I belive its not the operator you thing it is.
rather than "greater or equal" it reads something like "fetch from item slot"
- basilcy its not an operator at all (from my logical understanding)

regading mob spawns. here is an easy sample for you to work with pulled from one of my quests

Code:


sub EVENT_ITEM 
{

	if(plugin::check_handin(\%itemcount, 1027 => 1))
	{
	quest::say("Now that you got back my magical tome, I have no more use for you. Sorry dear...");

#spawns 4 KOS mobs around you

             my $x;
	my $y;
	my $z;
	my $h;

	$x = $npc->GetX();
	$y = $npc->GetY();
	$z = $npc->GetZ();
	$h = $npc->GetHeading();

	quest::spawn2(58012,0,0,$x+5,$y+5,$z,$h);
	quest::spawn2(58012,0,0,$x-5,$y-5,$z,$h);
	quest::spawn2(58012,0,0,$x+5,$y-5,$z,$h);
	quest::spawn2(58012,0,0,$x-5,$y+5,$z,$h);
	}



	else 
	{
	plugin::return_items(\%itemcount);

	}



}

Enjoy =)
Reply With Quote
  #10  
Old 06-26-2008, 10:04 AM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Quote:
Originally Posted by ChaosSlayer View Post
I belive its not the operator you thing it is.
rather than "greater or equal" it reads something like "fetch from item slot"
- basilcy its not an operator at all (from my logical understanding)
That's good to know. I just assumed it was a "greater than or equal to" operator, but could not figure out why the = comes before the >. That explains it.

Quote:
regading mob spawns. here is an easy sample for you to work with pulled from one of my quests
Very helpful. I will use this as a template. Thanks. What's the logic behind using quest::spawn2 rather than quest::spawn?
Reply With Quote
Reply

Thread Tools
Display Modes

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:22 PM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3