Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 07-26-2007, 09:09 AM
Striat
Sarnak
 
Join Date: Aug 2006
Posts: 60
Default

You could write it this way using your syntax to fix it:

*NOTE -- I've omitted sub EVENT_SAY for thread length reasons

Code:
sub EVENT_ITEM {
if ($itemcount{16290}) {
if ($class == 'Shaman') {
	quest::summonitem(9829); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') { 
	quest::summonitem(9820); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(9805); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}

if ($itemcount{16291}) {
if ($class == 'Shaman') {
	quest::summonitem(15773); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}

if ($class == 'Ranger') {
	quest::summonitem(15764); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(15474); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16292}) {
if ($class == 'Shaman') {
	quest::summonitem(11518); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') {
	quest::summonitem(11446);
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(11431); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16293})  {
if ($class == 'Shaman') {
	quest::summonitem(11273); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') {
	quest::summonitem(11180); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(11140); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16294})  {
if ($class == 'Shaman') {
	quest::summonitem(13569); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') { 
	quest::summonitem(12666); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(12597); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16295})  {
if ($class == 'Shaman') {
	quest::summonitem(16801); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') {
	quest::summonitem(16775); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(16711); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16296})  {
if ($class == 'Shaman') {
	quest::summonitem(20077); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') {
	quest::summonitem(19837); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(19442); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16347})  {
if ($class == 'Monk') {
	quest::summonitem(9808); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Beastlord') {
	quest::summonitem(9823); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Druid') {
	quest::summonitem(9832); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Berserker') {
	quest::summonitem(55505); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
}
While that would work, I strongly recommend the following script:

Code:
sub EVENT_ITEM {
if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16290 => 1)) {
    my %rewards = (
      "Shaman" => 9829, "Ranger" => 9820, "Rogue" => 9805
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	plugin::return_items(\%itemcount); 
    	quest::say("I did not ask for this from you, $name.");
	}
	}
}
  if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16291 => 1)) {
    my %rewards = (
      "Shaman" => 15773, "Ranger" => 15764, "Rogue" => 15474
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	plugin::return_items(\%itemcount); 
    	quest::say("I did not ask for this from you, $name.");
	}
  	}
}

if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16292 => 1)) {
    my %rewards = (
      "Shaman" => 11518, "Ranger" => 11446, "Rogue" => 11431
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	plugin::return_items(\%itemcount); 
    	quest::say("I did not ask for this from you, $name.");
	}
	}
  }

if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16293 => 1)) {
    my %rewards = (
      "Shaman" => 11273, "Ranger" => 11180, "Rogue" => 11140
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	quest::summonitem(16293);
    	quest::say("I did not ask for this from you, $name.");
	}
	}
  }
if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16294 => 1)) {
    my %rewards = (
      "Shaman" => 13569, "Ranger" => 12666, "Rogue" => 12597
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	quest::summonitem(16294);
    	quest::say("I did not ask for this from you, $name.");
	}
	}
  }

if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16295 => 1)) {
    my %rewards = (
      "Shaman" => 16801, "Ranger" => 16775, "Rogue" => 16711
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	quest::summonitem(16295);
    	quest::say("I did not ask for this from you, $name.");
	}
	}
  }

if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16296 => 1)) {
    my %rewards = (
      "Shaman" => 20077, "Ranger" => 19837, "Rogue" => 19442
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	quest::summonitem(16296);
    	quest::say("I did not ask for this from you, $name.");
	}
	}
  }

if ($class == 'Monk' || $class == 'Beastlord' || $class == 'Druid' || $class == 'Berserker') {
  if (plugin::check_handin(\%itemcount, 16347 => 1)) {
    my %rewards = (
      "Monk" => 9808, "Beastlord" => 9823, "Druid" => 9832, "Berserker" => 55505
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
    	quest::say("I did not ask for this from you, $name.");
	quest::summonitem(16347);
	}
	}
  }
	plugin::return_items(\%itemcount); 
}
Now, you could still do some clean up with this script and make the return_items at the end a little prettier. However, it does its job: Accepts turn ins from the appropriate class only. Otherwise, items are returned. Furthermore, inappropriate items are returned everytime.
Reply With Quote
 


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