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 07-04-2008, 01:36 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default Can there be more than one item turn-in per EVENT_ITEM?

Some background to the quest:

A player finds an item and turns it into the ruler of one of four realms. Once he turns in the item, the npcid.pl belonging to the ruler rewards the player with full citizenship (faction), lots of plat, and enough exp to gain a full level at 32. Player is then given a note and instructed to travel to the fortress of the realm that is closest to the fortress of the enemy (opposing faction). That all occurs seamlessly in a different quest script.

(Concerning the script in question) Upon arrival, player hands in note (itemID 12854) to the Captain of the guard, and the turn-in rewards the player and spawns reinforcement guards along the wall and at the gate (preparing it for defense against the coming battle). The Captain of the Guard gives the player a different note (itemID 12855) and instructs the player to go and find the banished Commander to ask for help. Player turns in that note to the banished commander and is given a different note (itemID 12856) by BC to take back to the CotG. Upon receiving the note, the CotG spawns a second set of reinforcement guards, the king himself (who will eventually take refuge in the Keep), and announces to the server the impending NPC war that will follow (shout2). Here is the script for that:
Quote:
# # Turn-In Quest

sub EVENT_SAY
{
if($text=~/hail/i)
{
if(plugin::check_hasitem($client, 12854))
{
quest::say("You come in haste, my friend. What news from the king do you have? That note in your hand bears the king's own seal. Is all well? Is the king well? Let me have the note.");
}
##elseif(plugin::check_hasitem($client, 12856))
## {
## quest::say("What word do you have from the Commander?");
## }
elsif($faction >= 5)
{
quest::say("You have an ill-fated look about you, $name. And You bear no letter from the king. What proof do I have that you are no spy? The enemy is cunning, and his agents have slipped through our nets before. You may dwell here if you wish, but I will cast a watchful eye on you. If you would prove your allegiance to our realm, bring me the heads of our enemies. Then we'll talk.");
}
elsif($faction >= 2)
{
quest::say("You are proving yourself a trusted friend of our realm, $name. But suspicion still haunts my mind about you and gives me pause. Perhaps a bit more time,and a few more heads of our enemies, will allay my concerns about you.");
}
else{
quest::say("And hail to you, $name, trusted friend. The days are dark and the enemy stirs. Be ready, and keep watch. We may yet live to see the doom of our time.");
}
}
if($text=~/willing to help/i)
{
quest::say("Good. Go quickly and find the Commander. He rides as an outcast, banished by the king. But I sense he holds in his heart the good of our realm. You will find him far north and east of here. When you see him, give him this note. But you must be quick; the enemy stirs, and we have little time, so go now! And bring any others you may know.");
quest::summonitem("12855");
}
}


sub EVENT_ITEM
{
if(plugin::check_handin(\%itemcount,12854 => 1))
{
quest::givecash("0","0","0","500");
quest::exp(1000);
quest::faction(19927,1000);
quest::ding();
quest::emote("face grows pale; his eyebrows furrow");
quest::shout("Muster the Guard! Man your stations! Post a watch on the wall and at the gate!");
quest::say("We are in imminent danger, $name. The enemy will surely discover that our realm has the Item. And when he does, no fortress of our realm will be safe. I have reinforced the guard, but we lack strength of numbers. If you know those of true heart who can wield a sword, call them! Are you [Willing to help]?");
#spawns lvl 65 guards on the Wall, east facing
quest::spawn2(999151,0,0,3154,908,38.91,180);
quest::spawn2(999151,0,0,3154,948,38.91,180);
quest::spawn2(999151,0,0,3154,988,38.91,180);
quest::spawn2(999151,0,0,3154,1028,38.91,180);
quest::spawn2(999151,0,0,3154,1068,38.91,180);
quest::spawn2(999151,0,0,3154,1108,38.91,180);
quest::spawn2(999151,0,0,3154,1148,38.91,180);
quest::spawn2(999151,0,0,3154,1188,38.91,180);
quest::spawn2(999151,0,0,3154,1228,38.91,180);
quest::spawn2(999151,0,0,3154,1268,38.91,180);

#spawns lvl 65 guards on sloped Wall, east facing
quest::spawn2(999151,0,0,3219.54,1363.72,47.34,160 );
quest::spawn2(999151,0,0,3162.47,1307.52,38.91,160 );

#spawns lvl 65 guards over gate, east facing
quest::spawn2(999151,0,0,3163,1450,98.91,160);
quest::spawn2(999151,0,0,3190,1404,98.91,160);

#spawns lvl 65 guards at gate, east facing
quest::spawn2(999151,0,0,3153.56,1444.85,46.71,160 );
}

elsif(plugin::check_handin(\%itemcount,12856 => 1))
{
quest::givecash("0","0","0","200");
quest::exp(500);
quest::faction(19927,500);
quest::ding();
quest::spawn2(999137,0,0,3154,938,38.91,180);
quest::shout2("Friends of our realm! The king has arrived, and the enemy approaches--prepare for battle! Reinforce the Wall!");
quest::say("The king has arrived, and the enemy's forces approach. Protect the king, $name, or the Item may fall into the hands of the enemy!");

#spawns lvl 65 reinforcement guards on Wall, east facing
quest::spawn2(999151,0,0,3154,928,38.91,180);
quest::spawn2(999151,0,0,3154,968,38.91,180);
quest::spawn2(999151,0,0,3154,1008,38.91,180);
quest::spawn2(999151,0,0,3154,1048,38.91,180);
quest::spawn2(999151,0,0,3154,1088,38.91,180);
quest::spawn2(999151,0,0,3154,1128,38.91,180);
quest::spawn2(999151,0,0,3154,1168,38.91,180);
quest::spawn2(999151,0,0,3154,1208,38.91,180);
quest::spawn2(999151,0,0,3154,1248,38.91,180);
quest::spawn2(999151,0,0,3154,1288,38.91,180);


#spawns lvl 65 reinforcement guard on sloped Wall, east facing
quest::spawn2(999151,0,0,3194.59,1337.81,43.51,160 );

#spawns lvl 65 guards over gate, east facing
quest::spawn2(999151,0,0,3173,1431,98.91,160);
quest::spawn2(999151,0,0,3226,1392,98.91,160);

#spawns lvl 65 guards at gate, east facing
quest::spawn2(999151,0,0,3165.50,1431.72,48.11,160 );

}

else
{
quest::say("I have no use for this, $name. Be on your way.");
plugin::return_items(\%itemcount);
}
}

I have commented out the second check_hasitem function because the quest breaks with it there. Is it not possible to have more than one item turn-in per quest EVENT; or am I just writing this script incorrectly? I need the npc to accept the first note (12854), give a second note (12855), and accept the third note (12866) for this quest to support the story line.

I should mention also that the second turn-in (elsif(plugin::check_handin(\%itemcount,12856 => 1)) actually rewards the player with cash, but does not do the rest of the quest:: commands (shout, say, spawn). Can't figure out why.

On a separate note, I would then like to set a timer that will (1) turn the sky red, then (2) make it rain, then (3) spawn the enemy npcs at the far zoneline, then (4) have all enemy npcs begin a march toward the fortress, (5) stop just short of aggro range of the fortress and wait, (6) then walk to the wall where they engage the first realm forces (both npcs and any players that show up for the battle). I have an idea about how to make all this work, but am not that far along yet in its development. If and when the enemy forces overwhelm the realm's forces, the players on the enemy side can find the king, hand in a drop from one of the key mobs they killed, and get the Item for themselves to give to the ruler of their own realm.
Reply With Quote
  #2  
Old 07-05-2008, 12:25 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

yes you can have multyple items turns in single event. just make sure to get all the parentesis, semicolomns, etc right.
here is a workign exmaple you may want to check against.

Code:
sub EVENT_ITEM 
{

	if(plugin::check_handin(\%itemcount, 5056 => 4))
	{
	quest::say("Here are you coins as promised. Good work!
	One more thing, I belive I have spoted a large nasty rat outside of city gates!
	I belive the rat was infected with some sort of disease. This could be bad.
	If that rat passes the disease to the rest of the rodents, we up for realy big troubles!
	I tried to sent Lucy after it, but the rat managed to hid somewhere. If you see that big rat - slay it 
	wihout hesitation. Collect sample of its blood, so I can study it and what kind of disease it was
	carrying.");

	quest::faction(11,5);
	quest::faction(13,5);
	quest::faction(18,-10);

	quest::exp("1000"); 
	
	my $a = int(rand(5)+2);
	quest::givecash(0,$a,0,0);
	}

	if(plugin::check_handin(\%itemcount, 5057 => 4))
	{
	quest::say("Oh dear! What a smell! Where did you found those? In the sewer? Oh...
	Well, its better to have few less of those, than a few more I guess! Here, take these coins for your work!");

	quest::faction(11,5);
	quest::faction(13,5);
	quest::faction(18,-10);

	quest::exp("2500"); 

	my $a = int(rand(5)+2);
	quest::givecash(0,0,$a,0);
	}

}
Reply With Quote
  #3  
Old 07-05-2008, 02:10 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

So then, the second hand-in is an "if" and not an "elsif"?
Reply With Quote
  #4  
Old 07-05-2008, 02:29 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Quote:
So then, the second hand-in is an "if" and not an "elsif"?
well, I think I solved my own problem. I had "elseif" instead of "elsif." I changed the spelling and the quest now works.
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 09:35 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