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-12-2008, 03:36 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default Class Specific Headaches

Trying to figure out whats wrong with this. Sorry to ask so many questions lately about quests. I am slowly learning though :( Anyways for this quest she responds to the hail. As soon as you hand the item in she just eats it and says nothing. It is supposed to hand you your epic and Ding you to lvl 51.

Code:
sub EVENT_SAY { 

if($text=~/Hail/i) {

quest::say("Hail, $class. I am Luana, The God of Life. I am in this world to see to it that those that have proven themselves worthy will be rewarded. If you have proof that Hanvar is dead, hand it to me."); }

}


sub EVENT_ITEM {
  if (plugin::check_handin(\%itemcount, 29294 => 1)) {
    my %rewards = (
      "Warrior" => 66177, 66176, 10908, "Paladin" => 10099, "Shadow Knight" => 14383,
      "Monk" => 10652, "Beastlord" => 6611, "Rogue" => 11057,
      "Cleric" => 5532, "Bard" => 20542, "Ranger" => 20487, 20488
      "Druid" => 20490, "Shaman" => 10651, "Necromancer" => 20544,
      "Wizard" => 14341, "Magician" => 28034, "Enchanter" => 10650
    );
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      $client->Message(6, "Luana raises her hands and says a prayer quietly. You feel your whole body begin to tingle as she brings her hands down to your shoulders." );
      quest::level(51);
      quest::ding();
      quest::shout2("Today $name has proved his worth to the gods of this world. He has now joined our ranks as a god himself and is a force to be reckoned with!");
    }
  }
  else {
    plugin::return_items(\%itemcount); 
    quest::say("I can't use this.");
  }
}
Reply With Quote
  #2  
Old 10-12-2008, 01:19 PM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

Found one small syntax error. Fixed it, script still broken though :(
Changed to:

Code:
sub EVENT_SAY { 

if($text=~/Hail/i) {

quest::say("Hail, $class. I am Luana, The God of Life. I am in this world to see to it that those that have proven themselves worthy will be rewarded. If you have proof that Hanvar is dead, hand it to me."); }

}


sub EVENT_ITEM {
  if (plugin::check_handin(\%itemcount, 29294 => 1)) {
    my %rewards = (
      "Warrior" => 66177, 66176, 10908, "Paladin" => 10099, "Shadow Knight" => 14383,
      "Monk" => 10652, "Beastlord" => 6611, "Rogue" => 11057,
      "Cleric" => 5532, "Bard" => 20542, "Ranger" => 20487, 20488,
      "Druid" => 20490, "Shaman" => 10651, "Necromancer" => 20544,
      "Wizard" => 14341, "Magician" => 28034, "Enchanter" => 10650
    );
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      $client->Message(6, "Luana raises her hands and says a prayer quietly. You feel your whole body begin to tingle as she brings her hands down to your shoulders." );
      quest::level(51);
      quest::ding();
      quest::shout2("Today $name has proved his worth to the gods of this world. He has now joined our ranks as a god himself and is a force to be reckoned with!");
    }
  }
  else {
    plugin::return_items(\%itemcount); 
    quest::say("I can't use this.");
  }
}
Reply With Quote
  #3  
Old 10-13-2008, 01:04 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

OK after deciding I was trying to be too complex with this quest for my small knowledge of perl I completely rewrote it. This is about the ugliest way I could possibly have written it probably, but it is also very simple. This is what I have now. Can someone tell me why she hands me every epic instead of just one? I used an SK to test btw.

Code:
sub EVENT_SAY { 

if($text=~/Hail/i) {

quest::say("Hail, $class. I am Luana, The God of Life. I am in this world to see to it that those that have proven themselves worthy will be rewarded. If you have proof that Hanvar is dead, hand it to me."); }

}

sub EVENT_ITEM {
  if (plugin::check_handin(\%itemcount, 29294 => 1)) {
 if ( $class == "Cleric" ) {
      quest::summonitem(5532);
    }
 if ( $class == "Warrior" ) {
      quest::summonitem(66177);
      quest::summonitem(66176);
      quest::summonitem(10908);
    }
 if ( $class == "Paladin" ) {
      quest::summonitem(10099);
    }
 if ( $class == "Shadow Knight" ) {
      quest::summonitem(14383);
    }
 if ( $class == "Monk" ) {
      quest::summonitem(10652);
    }
 if ( $class == "Beastlord" ) {
      quest::summonitem(29442);
    }
 if ( $class == "Rogue" ) {
      quest::summonitem(11057);
    }
 if ( $class == "Bard" ) {
      quest::summonitem(20542);
    }
 if ( $class == "Ranger" ) {
      quest::summonitem(20487);
      quest::summonitem(20488);
    }
 if ( $class == "Druid" ) {
      quest::summonitem(20490);
    }
 if ( $class == "Shaman" ) {
      quest::summonitem(10651);
    }
 if ( $class == "Necromancer" ) {
      quest::summonitem(20544);
    }
 if ( $class == "Wizard" ) {
      quest::summonitem(14341);
    }
 if ( $class == "Magician" ) {
      quest::summonitem(28034);
    }
 if ( $class == "Enchanter" ) {
      quest::summonitem(10650);
    }
      $client->Message(6, "Luana raises her hands and says a prayer quietly. You feel your whole body begin to tingle as she brings her hands down to your shoulders." );
      quest::level(51);
      quest::ding();
      quest::shout2("Today $name has proved his worth to the gods of this world. He has now joined our ranks as a god himself and is a force to be reckoned with!");
  }
  else {
    plugin::return_items(\%itemcount); 
    quest::say("I can't use this");
  }
}
Reply With Quote
  #4  
Old 10-13-2008, 01:17 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

OK realized how noob some of the mistakes in that quest were. This is what I'm tinkering with now. For some reason it hands me the cleric epic no matter what class I am. ( Which is the first epic on the list.

Code:
sub EVENT_SAY { 

if($text=~/Hail/i) {

quest::say("Hail, $class. I am Luana, The God of Life. I am in this world to see to it that those that have proven themselves worthy will be rewarded. If you have proof that Hanvar is dead, hand it to me."); }

}

sub EVENT_ITEM {
  if ((plugin::check_handin(\%itemcount, 29294 => 1))&&( $class == "Cleric" )) {
      quest::summonitem(5532);
    }
 elsif ( $class == "Warrior" ) {
      quest::summonitem(66177);
      quest::summonitem(66176);
      quest::summonitem(10908);
    }
 elsif ( $class == "Paladin" ) {
      quest::summonitem(10099);
    }
 elsif ( $class == "Shadow Knight" ) {
      quest::summonitem(14383);
    }
 elsif ( $class == "Monk" ) {
      quest::summonitem(10652);
    }
 elsif ( $class == "Beastlord" ) {
      quest::summonitem(29442);
    }
 elsif ( $class == "Rogue" ) {
      quest::summonitem(11057);
    }
 elsif ( $class == "Bard" ) {
      quest::summonitem(20542);
    }
 elsif ( $class == "Ranger" ) {
      quest::summonitem(20487);
      quest::summonitem(20488);
    }
 elsif ( $class == "Druid" ) {
      quest::summonitem(20490);
    }
 elsif ( $class == "Shaman" ) {
      quest::summonitem(10651);
    }
 elsif ( $class == "Necromancer" ) {
      quest::summonitem(20544);
    }
 elsif ( $class == "Wizard" ) {
      quest::summonitem(14341);
    }
 elsif ( $class == "Magician" ) {
      quest::summonitem(28034);
    }
 elsif ( $class == "Enchanter" ) {
      quest::summonitem(10650);
    }
      $client->Message(6, "Luana raises her hands and says a prayer quietly. You feel your whole body begin to tingle as she brings her hands down to your shoulders." );
      quest::level(51);
      quest::ding();
      quest::shout2("Today $name has proved his worth to the gods of this world. He has now joined our ranks as a god himself and is a force to be reckoned with!");
  }
  else {
    plugin::return_items(\%itemcount); 
    quest::say("I can't use this");
  }
}
Reply With Quote
  #5  
Old 10-13-2008, 01:24 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

You need to define class first:

Code:
if ($class eq 'Warrior' || $class eq 'Rogue' || $class eq 'Monk' || $class eq 'Berserker' || $class eq 'Shadowkight' || $class eq 'Paladin' || $class eq 'Ranger' || $class eq 'Bard' || $class eq 'Beastlord' || $class eq 'Cleric' || $class eq 'Druid' || $class eq 'Shaman' || $class eq 'Wizard' || $class eq 'Mage' || $class eq 'Enchanter' || $class eq 'Necromancer') {
You can use my quest here as an example:

http://www.eqemulator.net/forums/showthread.php?t=24321
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #6  
Old 10-13-2008, 01:27 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

Thank you Trev, I really do appreciate all the help you have given me on quests. I swear I'm slowly learning
Reply With Quote
  #7  
Old 10-13-2008, 01:45 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

Added the line in and it still just hands me the cleric epic /sigh


Code:
sub EVENT_SAY { 

if($text=~/Hail/i) {

quest::say("Hail, $class. I am Luana, The God of Life. I am in this world to see to it that those that have proven themselves worthy will be rewarded. If you have proof that Hanvar is dead, hand it to me."); }

}

sub EVENT_ITEM {
if ($class == 'Warrior' || $class == 'Rogue' || $class == 'Monk' || $class == 'Berserker' || $class == 'Shadowkight' || $class == 'Paladin' || $class == 'Ranger' || $class == 'Bard' || $class == 'Beastlord' || $class == 'Cleric' || $class == 'Druid' || $class == 'Shaman' || $class == 'Wizard' || $class == 'Mage' || $class == 'Enchanter' || $class == 'Necromancer') {
  if ((plugin::check_handin(\%itemcount, 29294 => 1))&&( $class == "Cleric" )) {
      quest::summonitem(5532);
    }
 elsif ( $class == "Warrior" ) {
      quest::summonitem(66177);
      quest::summonitem(66176);
      quest::summonitem(10908);
    }
 elsif ( $class == "Paladin" ) {
      quest::summonitem(10099);
    }
 elsif ( $class == "Shadow Knight" ) {
      quest::summonitem(14383);
    }
 elsif ( $class == "Monk" ) {
      quest::summonitem(10652);
    }
 elsif ( $class == "Beastlord" ) {
      quest::summonitem(29442);
    }
 elsif ( $class == "Rogue" ) {
      quest::summonitem(11057);
    }
 elsif ( $class == "Bard" ) {
      quest::summonitem(20542);
    }
 elsif ( $class == "Ranger" ) {
      quest::summonitem(20487);
      quest::summonitem(20488);
    }
 elsif ( $class == "Druid" ) {
      quest::summonitem(20490);
    }
 elsif ( $class == "Shaman" ) {
      quest::summonitem(10651);
    }
 elsif ( $class == "Necromancer" ) {
      quest::summonitem(20544);
    }
 elsif ( $class == "Wizard" ) {
      quest::summonitem(14341);
    }
 elsif ( $class == "Magician" ) {
      quest::summonitem(28034);
    }
 elsif ( $class == "Enchanter" ) {
      quest::summonitem(10650);
    }
      $client->Message(6, "Luana raises her hands and says a prayer quietly. You feel your whole body begin to tingle as she brings her hands down to your shoulders." );
      quest::level(51);
      quest::ding();
      quest::shout2("Today $name has proved his worth to the gods of this world. He has now joined our ranks as a god himself and is a force to be reckoned with!");
  }
  else {
    plugin::return_items(\%itemcount); 
    quest::say("I can't use this");
  }
}
Reply With Quote
  #8  
Old 10-13-2008, 02:09 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

Giving up for tonight before I throw my computer out the window. Still gives me a cleric epic :(

Code:
sub EVENT_SAY { 

if($text=~/Hail/i) {

quest::say("Hail, $class. I am Luana, The God of Life. I am in this world to see to it that those that have proven themselves worthy will be rewarded. If you have proof that Hanvar is dead, hand it to me."); }

}

sub EVENT_ITEM {
if ($class == 'Warrior' || $class == 'Rogue' || $class == 'Monk' || $class == 'Berserker' || $class == 'Shadowkight' || $class == 'Paladin' || $class == 'Ranger' || $class == 'Bard' || $class == 'Beastlord' || $class == 'Cleric' || $class == 'Druid' || $class == 'Shaman' || $class == 'Wizard' || $class == 'Mage' || $class == 'Enchanter' || $class == 'Necromancer') {
  

if ((plugin::check_handin(\%itemcount, 29294 => 1))&&(defined{$class})) {

if( $class == "Cleric" ) {
      quest::summonitem(5532);
    }
 elsif ( $class == "Warrior" ) {
      quest::summonitem(66177);
      quest::summonitem(66176);
      quest::summonitem(10908);
    }
 elsif ( $class == "Paladin" ) {
      quest::summonitem(10099);
    }
 elsif ( $class == "Shadow Knight" ) {
      quest::summonitem(14383);
    }
 elsif ( $class == "Monk" ) {
      quest::summonitem(10652);
    }
 elsif ( $class == "Beastlord") {
      quest::summonitem(29442);
    }
 elsif ( $class == "Rogue" ) {
      quest::summonitem(11057);
    }
 elsif ( $class == "Bard" ) {
      quest::summonitem(20542);
    }
 elsif ( $class == "Ranger" ) {
      quest::summonitem(20487);
      quest::summonitem(20488);
    }
 elsif ( $class == "Druid" ) {
      quest::summonitem(20490);
    }
 elsif ( $class == "Shaman" ) {
      quest::summonitem(10651);
    }
 elsif ( $class == "Necromancer" ) {
      quest::summonitem(20544);
    }
 elsif ( $class == "Wizard" ) {
      quest::summonitem(14341);
    }
 elsif ( $class == "Magician" ) {
      quest::summonitem(28034);
    }
 elsif ( $class == "Enchanter" ) {
      quest::summonitem(10650);
    }
      $client->Message(6, "Luana raises her hands and says a prayer quietly. You feel your whole body begin to tingle as she brings her hands down to your shoulders." );
      quest::level(51);
      quest::ding();
      quest::shout2("Today $name has proved his worth to the gods of this world. He has now joined our ranks as a god himself and is a force to be reckoned with!");
  }
  else {
    plugin::return_items(\%itemcount); 
    quest::say("I can't use this");
  }
}
}
Reply With Quote
  #9  
Old 10-13-2008, 02:19 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

You were closer with your first format. I haven't tested this for you, but something like this should work:

Code:
sub EVENT_SAY { 

if($text=~/Hail/i) {

quest::say("Hail, $class. I am Luana, The God of Life. I am in this world to see to it that those that have proven themselves worthy will be rewarded. If you have proof that Hanvar is dead, hand it to me."); }

}


sub EVENT_ITEM {
  if ($class eq 'Warrior' || $class eq 'Rogue' || $class eq 'Monk' || $class eq 'Berserker' || $class eq 'Shadowknight' || $class eq 'Paladin' || $class eq 'Ranger' || $class eq 'Bard' || $class eq 'Beastlord' || $class eq 'Cleric' || $class eq 'Druid' || $class eq 'Shaman' || $class eq 'Wizard' || $class eq 'Magician' || $class eq 'Enchanter' || $class eq 'Necromancer') {
    if (plugin::check_handin(\%itemcount, 29294 => 1)) {
      my %rewards = (
      "Warrior" => 66177, 66176, 10908, "Paladin" => 10099, "Shadowknight" => 14383,
      "Monk" => 10652, "Beastlord" => 6611, "Rogue" => 11057,
      "Cleric" => 5532, "Bard" => 20542, "Ranger" => 20487, 20488,
      "Druid" => 20490, "Shaman" => 10651, "Necromancer" => 20544,
      "Wizard" => 14341, "Magician" => 28034, "Enchanter" => 10650
      );
      if(defined($rewards{$class})) {
        quest::summonitem($rewards{$class});
        $client->Message(6, "Luana raises her hands and says a prayer quietly. You feel your whole body begin to tingle as she brings her hands down to your shoulders." );
        quest::level(51);
        quest::ding();
        quest::shout2("Today $name has proved his worth to the gods of this world. He has now joined our ranks as a god himself and is a force to be reckoned with!");
      }
    }
    else {
      plugin::return_items(\%itemcount); 
      quest::say("I can't use this.");
    }
  }
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #10  
Old 10-13-2008, 02:26 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

Thank you again trev, man I hate when I have to keep posting wrong stuff. I feel dumber with every post :(

Just tested and it appears to work great now. I swear about 5 more minutes with this one and I was gonna throw my computer out the window.
Reply With Quote
  #11  
Old 10-13-2008, 02:41 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Quote:
if ($class eq 'Warrior' || $class eq 'Rogue' || $class eq 'Monk' || $class eq 'Berserker' || $class eq 'Shadowknight' || $class eq 'Paladin' || $class eq 'Ranger' || $class eq 'Bard' || $class eq 'Beastlord' || $class eq 'Cleric' || $class eq 'Druid' || $class eq 'Shaman' || $class eq 'Wizard' || $class eq 'Magician' || $class eq 'Enchanter' || $class eq 'Necromancer')
Is there a time that they would not be one of these classes? You are just doing a test, not defining anything.
Reply With Quote
  #12  
Old 10-13-2008, 03:03 AM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

from what I can see the the primary problem all along was that you kept using

$class == "Wizard"

instead of

$class eq 'Warrior'
Reply With Quote
  #13  
Old 10-13-2008, 03:33 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Quote:
Originally Posted by joligario View Post
Is there a time that they would not be one of these classes? You are just doing a test, not defining anything.
You know, I would think the same thing, but I can not get it to work without setting it up that way. I think it needs to check the class first so it knows which reward to summon. Otherwise, it doesn't want to do the class check for my rewards after the rewards are defined.

And ya, if you aren't using a numeric value, you have to use eq instead of ==.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #14  
Old 10-14-2008, 03:03 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

Using the last code you posted Trevius, I can't seem to figure out why but...

Shadowknight = Quest works 100%
Druid = Nothing happens, Eats the item
Warrior = You get the first reward on the list for Warriors
Every other class tested = eats the item...tested Ranger, Mage, Necro
Reply With Quote
  #15  
Old 10-14-2008, 03:51 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

fixed using my earlier version of the quest, replaced all of the == with eq and it works fine.
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:03 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3