Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 09-09-2008, 05:07 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Any time you are only checking for certain classes and not all classes, then you have to do a Not Equal check as well for the other classes you don't want to use that turn in.

Don't ask me why it doesn't work the other way, as I have no clue. I also don't know why for equals you have to use ==, but for not equals, you have to use "ne". It doesn't make sense to me, but it does work.

Here is an example of what I mean:

Code:
if (($class == 'Wizard' || $class == 'Magician' || $class == 'Enchanter' || $class == 'Necromancer') && ($class ne 'Warrior' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker' && $class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman'))
So, for every if(class) check, you have to include every class and just ne the ones you don't want.

Also, don't forget to add this at the bottom as shown in my example:
Code:
else {
 	    plugin::return_items(\%itemcount);
	}
Or the NPC will eat any incorrect items turned into it.

I imagine there are much better ways of doing this, but I haven't really gone back and tried lately. The next time I make a similar armor quest using better code, I will definitely post it.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 09-10-2008 at 01:10 AM..
Reply With Quote
  #2  
Old 09-09-2008, 08:48 PM
Frothel
Fire Beetle
 
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 10
Default

Now my code has changed to the below code, thanks to your suggestions =) However, it is still not working in game for some reason:

Code:
#An Armor Quest for all classes
sub EVENT_SAY
{
if ($text =~/Hail/i)
 {
quest::say ("Good day to you, $name. The Pirates in Dulak are a menace to the sea-faring travelers in Norrath and must be stopped!  They will occasionally drop armor molds/patterns that I can change into [armor] suitable for your class.  I can send you there [now] if you like.");
 }
if ($text =~/armor/i)
 {
quest::say ("Yes, it is said that some of the Pirates of Dulak hold instructions for basic armor crafting.  I think they sound perfect for a novice crafter such as myself.  Would you like to hear more [rumors] about the patterns? ");
 }
 if ($text =~/rumors/i)
 {
quest::say ("I hear the easier parts to make are kept by the common Pirates you will find there, but the harder leggings and chest instructions are only to be had by Captain Varns himself, and Quigli.");
 }
if ($text =~/now/i)
 {
quest::say ("$name , see you later.");
quest::movepc(225, 518,431,5);
 }
}

sub EVENT_ITEM {
if (($class == 'Warrior' || $class == 'Shadowknight' || $class == 'Paladin' || $class == 'Bard' || $class == 'Cleric') && ($class ne 'Berserker' && $class ne 'Ranger' && $class ne 'Rogue' && $class ne 'Shaman' && $class ne 'Druid' && $class ne 'Beastlord' && $class ne 'Monk' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16298 => 1)) {
    my %rewards = (
"Warrior" => 19440, "Shadowknight" => 19546, "Paladin" => 19449, "Bard" => 19549, "Cleric" => 20074
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    } 
}  
}
if (($class == 'Warrior' || $class == 'Shadowknight' || $class == 'Paladin' || $class == 'Bard' || $class == 'Cleric') && ($class ne 'Berserker' && $class ne 'Ranger' && $class ne 'Rogue' && $class ne 'Shaman' && $class ne 'Druid' && $class ne 'Beastlord' && $class ne 'Monk' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16344 => 1)) {
    my %rewards = (
"Warrior" => 16693, "Shadowknight" => 16763, "Paladin" => 16757, "Bard" => 16771, "Cleric" => 16797
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    } 
}  
}
if (($class == 'Warrior' || $class == 'Shadowknight' || $class == 'Paladin' || $class == 'Bard' || $class == 'Cleric') && ($class ne 'Berserker' && $class ne 'Ranger' && $class ne 'Rogue' && $class ne 'Shaman' && $class ne 'Druid' && $class ne 'Beastlord' && $class ne 'Monk' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16299 => 1)) {
    my %rewards = (
"Warrior" => 9629, "Shadowknight" => 9815, "Paladin" => 9812, "Bard" => 9818, "Cleric" => 9827
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    } 
}  
}
if (($class == 'Warrior' || $class == 'Shadowknight' || $class == 'Paladin' || $class == 'Bard' || $class == 'Cleric') && ($class ne 'Berserker' && $class ne 'Ranger' && $class ne 'Rogue' && $class ne 'Shaman' && $class ne 'Druid' && $class ne 'Beastlord' && $class ne 'Monk' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16346 => 1)) {
    my %rewards = (
"Warrior" => 47642, "Shadowknight" => 47645, "Paladin" => 47644, "Bard" => 47643, "Cleric" => 47646
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    } 
}  
}
if (($class == 'Warrior' || $class == 'Shadowknight' || $class == 'Paladin' || $class == 'Bard' || $class == 'Cleric') && ($class ne 'Berserker' && $class ne 'Ranger' && $class ne 'Rogue' && $class ne 'Shaman' && $class ne 'Druid' && $class ne 'Beastlord' && $class ne 'Monk' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16343 => 1)) {
    my %rewards = (
"Warrior" => 11429, "Shadowknight" => 11441, "Paladin" => 11438, "Bard" => 11444, "Cleric" => 32012
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    } 
}  
}
if (($class == 'Warrior' || $class == 'Shadowknight' || $class == 'Paladin' || $class == 'Bard' || $class == 'Cleric') && ($class ne 'Berserker' && $class ne 'Ranger' && $class ne 'Rogue' && $class ne 'Shaman' && $class ne 'Druid' && $class ne 'Beastlord' && $class ne 'Monk' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16345 => 1)) {
    my %rewards = (
"Warrior" => 12595, "Shadowknight" => 12637, "Paladin" => 12627, "Bard" => 12664, "Cleric" => 13563
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    } 
}  
}
if (($class == 'Warrior' || $class == 'Shadowknight' || $class == 'Paladin' || $class == 'Bard' || $class == 'Cleric') && ($class ne 'Berserker' && $class ne 'Ranger' && $class ne 'Rogue' && $class ne 'Shaman' && $class ne 'Druid' && $class ne 'Beastlord' && $class ne 'Monk' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16297 => 1)) {
    my %rewards = (
"Warrior" => 11138, "Shadowknight" => 11173, "Paladin" => 11163, "Bard" => 11178, "Cleric" => 11199
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    } 
}  
}
if (($class == 'Berserker' || $class == 'Rogue' || $class == 'Ranger' || $class == 'Shaman') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Druid' && $class ne 'Monk' && $class ne 'Beastlord' && $class ne 'Magician' && $class ne 'Enchanter' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16296 => 1)) {
    my %rewards = (
"Berserker" => 55509, "Ranger" => 19838, "Rogue" => 19443, "Shaman" => 20078
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Berserker' || $class == 'Rogue' || $class == 'Ranger' || $class == 'Shaman') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Druid' && $class ne 'Monk' && $class ne 'Beastlord' && $class ne 'Magician' && $class ne 'Enchanter' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16295 => 1)) {
    my %rewards = (
"Berserker" => 55512, "Ranger" => 16777, "Rogue" => 16717, "Shaman" => 16803
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Berserker' || $class == 'Rogue' || $class == 'Ranger' || $class == 'Shaman') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Druid' && $class ne 'Monk' && $class ne 'Beastlord' && $class ne 'Magician' && $class ne 'Enchanter' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16290 => 1)) {
    my %rewards = (
"Berserker" => 55513, "Ranger" => 9821, "Rogue" => 9806, "Shaman" => 9830
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Berserker' || $class == 'Rogue' || $class == 'Ranger' || $class == 'Shaman') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Druid' && $class ne 'Monk' && $class ne 'Beastlord' && $class ne 'Magician' && $class ne 'Enchanter' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16291 => 1)) {
    my %rewards = (
"Berserker" => 55511, "Ranger" => 47647, "Rogue" => 47648, "Shaman" => 47649
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Berserker' || $class == 'Rogue' || $class == 'Ranger' || $class == 'Shaman') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Druid' && $class ne 'Monk' && $class ne 'Beastlord' && $class ne 'Magician' && $class ne 'Enchanter' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16292 => 1)) {
    my %rewards = (
"Berserker" => 55508, "Ranger" => 11447, "Rogue" => 11432, "Shaman" => 11529
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Berserker' || $class == 'Rogue' || $class == 'Ranger' || $class == 'Shaman') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Druid' && $class ne 'Monk' && $class ne 'Beastlord' && $class ne 'Magician' && $class ne 'Enchanter' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16294 => 1)) {
    my %rewards = (
"Berserker" => 55514, "Ranger" => 12598, "Rogue" => 12598, "Shaman" => 13579
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Berserker' || $class == 'Rogue' || $class == 'Ranger' || $class == 'Shaman') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Druid' && $class ne 'Monk' && $class ne 'Beastlord' && $class ne 'Magician' && $class ne 'Enchanter' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16293 => 1)) {
    my %rewards = (
"Berserker" => 55510, "Ranger" => 11193, "Rogue" => 11141, "Shaman" => 11278
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Wizard' || $class == 'Magician' || $class == 'Enchanter' || $class == 'Necromancer') && ($class ne 'Warrior' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker' && $class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman')) {
  if (plugin::check_handin(\%itemcount, 16360 => 1)) {
    my %rewards = (
"Enchanter" => 20425, "Magician" => 20428, "Necromancer" => 20431, "Wizard" => 20434
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Wizard' || $class == 'Magician' || $class == 'Enchanter' || $class == 'Necromancer') && ($class ne 'Warrior' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker' && $class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman')) {
  if (plugin::check_handin(\%itemcount, 16359 => 1)) {
    my %rewards = (
"Enchanter" => 16931, "Magician" => 19021, "Necromancer" => 19024, "Wizard" => 19027
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Wizard' || $class == 'Magician' || $class == 'Enchanter' || $class == 'Necromancer') && ($class ne 'Warrior' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker' && $class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman')) {
  if (plugin::check_handin(\%itemcount, 16354 => 1)) {
    my %rewards = (
"Enchanter" => 9836, "Magician" => 9944, "Necromancer" => 9947, "Wizard" => 9950
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Wizard' || $class == 'Magician' || $class == 'Enchanter' || $class == 'Necromancer') && ($class ne 'Warrior' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker' && $class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman')) {
  if (plugin::check_handin(\%itemcount, 16355 => 1)) {
    my %rewards = (
"Enchanter" => 47656, "Magician" => 47655, "Necromancer" => 47653, "Wizard" => 47654
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Wizard' || $class == 'Magician' || $class == 'Enchanter' || $class == 'Necromancer') && ($class ne 'Warrior' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker' && $class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman')) {
  if (plugin::check_handin(\%itemcount, 16356 => 1)) {
    my %rewards = (
"Enchanter" => 11578, "Magician" => 11598, "Necromancer" => 11618, "Wizard" => 11876
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Wizard' || $class == 'Magician' || $class == 'Enchanter' || $class == 'Necromancer') && ($class ne 'Warrior' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker' && $class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman')) {
  if (plugin::check_handin(\%itemcount, 16358 => 1)) {
    my %rewards = (
"Enchanter" => 13614, "Magician" => 13619, "Necromancer" => 13623, "Wizard" => 13627
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Wizard' || $class == 'Magician' || $class == 'Enchanter' || $class == 'Necromancer') && ($class ne 'Warrior' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker' && $class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman')) {
  if (plugin::check_handin(\%itemcount, 16357 => 1)) {
    my %rewards = (
"Enchanter" => 11298, "Magician" => 11303, "Necromancer" => 11306, "Wizard" => 11309
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Beastlord' || $class == 'Druid' || $class == 'Monk') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Berserker' && $class ne 'Rogue' && $class ne 'Ranger' && $class ne 'Shaman' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16353 => 1)) {
    my %rewards = (
"Beastlord" => 20032, "Druid" => 20422, "Monk" => 19446
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Beastlord' || $class == 'Druid' || $class == 'Monk') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Berserker' && $class ne 'Rogue' && $class ne 'Ranger' && $class ne 'Shaman' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16352 => 1)) {
    my %rewards = (
"Beastlord" => 16787, "Druid" => 16811, "Monk" => 16727
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Beastlord' || $class == 'Druid' || $class == 'Monk') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Berserker' && $class ne 'Rogue' && $class ne 'Ranger' && $class ne 'Shaman' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16347 => 1)) {
    my %rewards = (
"Beastlord" => 9824, "Druid" => 9833, "Monk" => 9809
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Beastlord' || $class == 'Druid' || $class == 'Monk') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Berserker' && $class ne 'Rogue' && $class ne 'Ranger' && $class ne 'Shaman' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16348 => 1)) {
    my %rewards = (
"Beastlord" => 47652, "Druid" => 47651, "Monk" => 47650
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Beastlord' || $class == 'Druid' || $class == 'Monk') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Berserker' && $class ne 'Rogue' && $class ne 'Ranger' && $class ne 'Shaman' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16349 => 1)) {
    my %rewards = (
"Beastlord" => 11450, "Druid" => 11575, "Monk" => 11435
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
}
}
if (($class == 'Beastlord' || $class == 'Druid' || $class == 'Monk') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Berserker' && $class ne 'Rogue' && $class ne 'Ranger' && $class ne 'Shaman' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16351 => 1)) {
    my %rewards = (
"Beastlord" => 13553, "Druid" => 13603, "Monk" => 12624
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
} 
}
if (($class == 'Beastlord' || $class == 'Druid' || $class == 'Monk') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Berserker' && $class ne 'Rogue' && $class ne 'Ranger' && $class ne 'Shaman' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16350 => 1)) {
    my %rewards = (
"Beastlord" => 1196, "Druid" => 11281, "Monk" => 11146
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
}
else {
 	    plugin::return_items(\%itemcount);
	}
}
}
Reply With Quote
  #3  
Old 09-09-2008, 09:58 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

The best way to solve a quest issue is to copy your entire quest into notepad so you don't lose it and then start with just 1 very small section at a time to make sure they work. Eventually you will get to a point where it doesn't work at all and you will know that the last thing you added is what caused it.

Try just using this from your code as the entire quest:

Code:
sub EVENT_ITEM {

if (($class == 'Beastlord' || $class == 'Druid' || $class == 'Monk') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Berserker' && $class ne 'Rogue' && $class ne 'Ranger' && $class ne 'Shaman' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16350 => 1)) {
    my %rewards = (
"Beastlord" => 1196, "Druid" => 11281, "Monk" => 11146
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
}
else {
 	    plugin::return_items(\%itemcount);
	}
}
}
Test that and see if it works. If it doesn't, the I think you probably have a plugin problem. You will need to make sure that you moved your plugins from the quests/plugins folder into your eqemu/plugins folder. Without the plugins in the right place, these item exchanges can't work. Also, you might want to run the check syntax button on GeorgeS quest editor tool to verify that you aren't missing any brackets. Remember that a single extra bracket or quote missing or in the wrong place can break the entire quest.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 09-10-2008, 09:48 AM
Frothel
Fire Beetle
 
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 10
Default

Moving the plugins is what worked, thank you =)
Reply With Quote
  #5  
Old 06-03-2009, 05:25 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Trev, can't

$class == 'Warrior'

be replaced with

$class == 1

?
Reply With Quote
  #6  
Old 06-03-2009, 05:44 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Since that quest, I have refined our armor scripts that use Arrays a bit to make them cleaner and a bit easier to manage. If done properly, I don't think the whole "if $class" stuff needs to be checked at all. Here is an example of the new format we use on Storm Haven for a bit more advanced Arrays for armor quests:

Code:
#Rough Defiant Armor Quests

%GetArmorType = (	#Convert each Class Name into an Armor Type Name
	"Warrior" => "Plate",
	"Rogue" => "Chain",
	"Monk" => "Leather",
	"Berserker" => "Chain",
	"Shadowknight" => "Plate",
	"Paladin" => "Plate",
	"Ranger" => "Chain",
	"Bard" => "Plate",
	"Beastlord" => "Leather",
	"Cleric" => "Plate",
	"Druid" => "Leather",
	"Shaman" => "Chain",
	"Wizard" => "Cloth",
	"Magician" => "Cloth",
	"Enchanter" => "Cloth",
	"Necromancer" => "Cloth"
);

%ArmorSlot = (	#Convert each Slot Name into a String for use in the Rewards Choosing
	"Bracer" => "_Bracer",
	"Gauntlets" => "_Gauntlets",
	"Boots" => "_Boots",
	"Helm" => "_Helm",
	"Vambraces" => "_Vambraces",
	"Greaves" => "_Greaves",
	"Breastplate" => "_Breastplate",
);

%SimpleArmor = (	#Name each item appropriately for use With the Armor Type And Armor Slot selections
"Plate_Bracer" => 50033,	#Simple Defiant Plate Bracer
"Plate_Gauntlets" => 50034,	#Simple Defiant Plate Gauntlets
"Plate_Boots" => 50035,		#Simple Defiant Plate Boots
"Plate_Helm" => 50036,		#Simple Defiant Plate Helm
"Plate_Vambraces" => 50037,	#Simple Defiant Plate Vambraces
"Plate_Greaves" => 50038,	#Simple Defiant Plate Greaves
"Plate_Breastplate" => 50039,	#Simple Defiant Breastplate

"Chain_Bracer" => 50040,	#Simple Defiant Chain Bracer
"Chain_Gauntlets" => 50041,	#Simple Defiant Chain Gauntlets
"Chain_Boots" => 50042,		#Simple Defiant Chain Boots
"Chain_Helm" => 50043,		#Simple Defiant Chain Coif
"Chain_Vambraces" => 50044,	#Simple Defiant Chain Sleeves
"Chain_Greaves" => 50045,	#Simple Defiant Chain Leggings
"Chain_Breastplate" => 50046,	#Simple Defiant Chain Tunic

"Leather_Bracer" => 50047,	#Simple Defiant Leather Bracer
"Leather_Gauntlets" => 50048,	#Simple Defiant Leather Gloves
"Leather_Boots" => 50049,	#Simple Defiant Leather Boots
"Leather_Helm" => 50050,	#Simple Defiant Leather Cap
"Leather_Vambraces" => 50051,	#Simple Defiant Leather Sleeves
"Leather_Greaves" => 50052,	#Simple Defiant Leather Trousers
"Leather_Breastplate" => 50053,	#Simple Defiant Leather Tunic

"Cloth_Bracer" => 50054,	#Simple Defiant Cloth Wristwrap
"Cloth_Gauntlets" => 50055,	#Simple Defiant Cloth Gloves
"Cloth_Boots" => 50056,		#Simple Defiant Cloth Sandals
"Cloth_Helm" => 50057,		#Simple Defiant Cloth Cap
"Cloth_Vambraces" => 50058,	#Simple Defiant Cloth Sleeves
"Cloth_Greaves" => 50059,	#Simple Defiant Cloth Pantaloons
"Cloth_Breastplate" => 50060,	#Simple Defiant Cloth Robe
);

%Rewards = (
"Plate_Bracer" => 50061,	#Rough Defiant Plate Bracer
"Plate_Gauntlets" => 50062,	#Rough Defiant Plate Gauntlets
"Plate_Boots" => 50063,		#Rough Defiant Plate Boots
"Plate_Helm" => 50064,		#Rough Defiant Plate Helm
"Plate_Vambraces" => 50065,	#Rough Defiant Plate Vambraces
"Plate_Greaves" => 50066,	#Rough Defiant Plate Greaves
"Plate_Breastplate" => 50067,	#Rough Defiant Breastplate

"Chain_Bracer" => 50068,	#Rough Defiant Chain Bracer
"Chain_Gauntlets" => 50069,	#Rough Defiant Chain Gauntlets
"Chain_Boots" => 50070,		#Rough Defiant Chain Boots
"Chain_Helm" => 50071,		#Rough Defiant Chain Coif
"Chain_Vambraces" => 50072,	#Rough Defiant Chain Sleeves
"Chain_Greaves" => 50073,	#Rough Defiant Chain Leggings
"Chain_Breastplate" => 50074,	#Rough Defiant Chain Tunic

"Leather_Bracer" => 50075,	#Rough Defiant Leather Bracer
"Leather_Gauntlets" => 50076,	#Rough Defiant Leather Gloves
"Leather_Boots" => 50077,	#Rough Defiant Leather Boots
"Leather_Helm" => 50078,	#Rough Defiant Leather Cap
"Leather_Vambraces" => 50079,	#Rough Defiant Leather Sleeves
"Leather_Greaves" => 50080,	#Rough Defiant Leather Trousers
"Leather_Breastplate" => 50081,	#Rough Defiant Leather Tunic

"Cloth_Bracer" => 50082,	#Rough Defiant Cloth Wristwrap
"Cloth_Gauntlets" => 50083,	#Rough Defiant Cloth Gloves
"Cloth_Boots" => 50084,		#Rough Defiant Cloth Sandals
"Cloth_Helm" => 50085,		#Rough Defiant Cloth Cap
"Cloth_Vambraces" => 50086,	#Rough Defiant Cloth Sleeves
"Cloth_Greaves" => 50087,	#Rough Defiant Cloth Pantaloons
"Cloth_Breastplate" => 50088,	#Rough Defiant Cloth Robe
);

sub EVENT_SAY {

# Get the Armor Type of the Character character currently speaking With this NPC
my $ArmorType = $GetArmorType{$class};

#Create the full name of each item for the Rewards array
my $Bracer = "$ArmorType$ArmorSlot{Bracer}";
my $Gauntlets = "$ArmorType$ArmorSlot{Gauntlets}";
my $Boots = "$ArmorType$ArmorSlot{Boots}";
my $Helm = "$ArmorType$ArmorSlot{Helm}";
my $Vambraces = "$ArmorType$ArmorSlot{Vambraces}";
my $Greaves = "$ArmorType$ArmorSlot{Greaves}";
my $Breastplate = "$ArmorType$ArmorSlot{Breastplate}";

#Create the Item Links from the Rewards Array for use in say messages
my $Bracer_Link = quest::varlink($Rewards{$Bracer});
my $Gauntlets_Link = quest::varlink($Rewards{$Gauntlets});
my $Boots_Link = quest::varlink($Rewards{$Boots});
my $Helm_Link = quest::varlink($Rewards{$Helm});
my $Vambraces_Link = quest::varlink($Rewards{$Vambraces});
my $Greaves_Link = quest::varlink($Rewards{$Greaves});
my $Breastplate_Link = quest::varlink($Rewards{$Breastplate});

	if($text=~/hail/i)
	{
		quest::say("What a fine looking $class you are.  
		You look Like you could use some new $ArmorType [armor], though.");
	}

	if($text=~/armor/i)
	{
		quest::say("I can provide you with the following if you are [interested]:");
		quest::say("A $Bracer_Link");
		quest::say("A $Gauntlets_Link");
		quest::say("A $Boots_Link");
		quest::say("A $Helm_Link");
		quest::say("A $Vambraces_Link");
		quest::say("A $Greaves_Link");
		quest::say("A $Breastplate_Link");
	}

	if($text=~/interested/i)
	{
		quest::say("You will need to collect some items for me.  
		But, I don't have a list of those needed item yet. 
		(quest is still in progress of being finished)");
	}

}

sub EVENT_ITEM {

# Get the Armor Type of the Character character currently speaking With this NPC
my $ArmorType = $GetArmorType{$class};

#Create the full name of each item for the Rewards array
my $Bracer = "$ArmorType$ArmorSlot{Bracer}";
my $Gauntlets = "$ArmorType$ArmorSlot{Gauntlets}";
my $Boots = "$ArmorType$ArmorSlot{Boots}";
my $Helm = "$ArmorType$ArmorSlot{Helm}";
my $Vambraces = "$ArmorType$ArmorSlot{Vambraces}";
my $Greaves = "$ArmorType$ArmorSlot{Greaves}";
my $Breastplate = "$ArmorType$ArmorSlot{Breastplate}";

	#Reward for turning in the Bracer piece
	if (plugin::check_handin(\%itemcount, $SimpleArmor{$Bracer} => 1, 1001 => 1)) {
		quest::summonitem($Rewards{$Bracer});
		quest::exp(450);
		quest::say ("There you go, $name.  You're looking tougher already!");
	}

	#Reward for turning in the Gauntlets piece
	if (plugin::check_handin(\%itemcount, $SimpleArmor{$Gauntlets} => 1, 1001 => 1)) {
		quest::summonitem($Rewards{$Gauntlets});
		quest::exp(450);
		quest::say ("There you go, $name.  You're looking tougher already!");
	}

	#Reward for turning in the Boots piece
	if (plugin::check_handin(\%itemcount, $SimpleArmor{$Boots} => 1, 1001 => 1)) {
		quest::summonitem($Rewards{$Boots});
		quest::exp(450);
		quest::say ("There you go, $name.  You're looking tougher already!");
	}

	#Reward for turning in the Helm piece
	if (plugin::check_handin(\%itemcount, $SimpleArmor{$Helm} => 1, 1001 => 1)) {
		quest::summonitem($Rewards{$Helm});
		quest::exp(450);
		quest::say ("There you go, $name.  You're looking tougher already!");
	}

	#Reward for turning in the Vambraces piece
	if (plugin::check_handin(\%itemcount, $SimpleArmor{$Vambraces} => 1, 1001 => 1)) {
		quest::summonitem($Rewards{$Vambraces});
		quest::exp(450);
		quest::say ("There you go, $name.  You're looking tougher already!");
	}

	#Reward for turning in the Greaves piece
	if (plugin::check_handin(\%itemcount, $SimpleArmor{$Greaves} => 1, 1001 => 1)) {
		quest::summonitem($Rewards{$Greaves});
		quest::exp(450);
		quest::say ("There you go, $name.  You're looking tougher already!");
	}

	#Reward for turning in the Breastplate piece
	if (plugin::check_handin(\%itemcount, $SimpleArmor{$Breastplate} => 1, 1001 => 1)) {
		quest::summonitem($Rewards{$Breastplate});
		quest::exp(450);
		quest::say ("There you go, $name.  You're looking tougher already!");
	}
	
	else
	{
	plugin::return_items(\%itemcount);
	}

}
Of course, this script takes it a step further and defines the armor type for each class and then uses that to find which classes should get which piece of armor. This script could be simplified to just map each piece of armor to a specific class, which shouldn't be too hard to figure out for people wanting to do that.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 06-03-2009, 06:06 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

looks interetsing, but you not answering my question though =P

I have looked at the quest wiki, and it doesn't say anywhere if numbers instead of class names can be used for the IF check - you know like 1 (warrior), 7 (monk) etc
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 10:59 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