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 10-14-2011, 12:54 PM
Emmeric
Sarnak
 
Join Date: Aug 2011
Posts: 72
Default

That worked wonderfully. In fact, I ended up combining her other quest into it because this was more efficient.

However, I experimented with different ways to return unwanted items.

Code:
else {
  plugin::return_items(\%itemcount);
      return 1;
 }
This doesn't seem to work within the scope of the newer set-up. In fact, the quest doesn't work at all if this is inserted into the sub event_item.

I tried inserting it after the if argument within the foreach and even after the foreach, but no luck. Is there a different command when using these different arguments?

Something like if itemcount (does not equal?) @items...
Reply With Quote
  #2  
Old 10-14-2011, 09:01 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

You should probably google "perl tutorial" or really any basic computer logical expression explanations. If you think an else can go after a foreach(not knocking you, we all start somewhere), then its going to be really frustrating for you to attempt to get things done. Most people spend a lot of time on the DB and spells, etc... spend a fraction of that time doing perl tutorials or C++ tutorials and in a few weeks you will be shocked.

Havent tested this, but may work.

Code:
sub EVENT_ITEM
{
	my @factions = (69,70,87,88,117,137,155,177,256,260,268,322,331);
	my @req_items = (1804,1805,1806,1807);
	my %exp_rewards = (1804 => 4000, 1805 => 6000, 1806 => 8000, 1807 => 10000);
	my %faction_rewards = (1804 => 5, 1805 => 10, 1806 => 15, 1807 => 20);
	## Iterate through all items handed in	
	for my $item ( keys %itemcount ) {
		my $item_count = $itemcount{$item};
		## Compare current item with all available turn ins
		foreach my $req_item(@req_items) {
			if($item == $req_item) {
				foreach $faction(@factions) { quest::faction($faction,($exp_rewards{$item}*$item_count)); }
				quest::exp($exp_rewards{$item});
				quest::ding;
				quest::say("I see you have been skulking about for Noble Villifar. You are wise to aid us and your effort shall not go unnoticed, $name.");	
				quest::givecash("0","0","8","0");
				delete $itemcount->{$item}; ## Remove used items from itemcount
				last; ## End this loop and continue onto next handed in item
			}
		}
	}
	## Return all items that didnt get used
	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 10:08 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