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

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 09-11-2009, 08:37 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Armor Quest for each Armor Type

This script is for armor quests based on Armor type. So, all plate classes get the same rewards, all chain get the same rewards and so on. In this example, I used the Simple Defiant Armor set, but you could easily swap in any armor set that is based on armor type like this. It also makes use of Saylinks and Varlinks to be able to show the rewards beforehand if you want.

The only custom items in this script are the items being turned in to earn the rewards. The armor set in this example already exists in the PEQ DB, so you would just need to change out the item IDs being turned in and this script should be able to function on any server.

I mostly wanted to put this up just as an example of another way to write armor quests. I think it keeps them fairly clean and easy to change out items in them to make more similar quests.

Code:
#Simple 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",
);

%Rewards = (	#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
);

sub EVENT_SAY {

my $armor = quest::saylink("armor");
my $chest = quest::saylink("chest");
my $legs = quest::saylink("legs");
my $arms = quest::saylink("arms");
my $head = quest::saylink("head");
my $feet = quest::saylink("feet");
my $hands = quest::saylink("hands");
my $wrists = quest::saylink("wrists");

# 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});

my $chest_template = quest::varlink(6454);
my $leg_template = quest::varlink(6455);
my $arm_template = quest::varlink(6456);
my $boot_template = quest::varlink(6458);
my $helm_template = quest::varlink(6459);
my $hand_template = quest::varlink(6460);
my $bracer_template = quest::varlink(6461);
my $chipped_emerald = quest::varlink(6453);

	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 create armor for [$chest], [$legs], [$arms], [$head], [$feet], [$hands], and [$wrists].");
	}

	if($text=~/chest/i)
	{
		quest::say("You will need to bring me a $chest_template and a $chipped_emerald so I can create that piece for you.");
	}

	if($text=~/legs/i)
	{
		quest::say("You will need to bring me a $leg_template and a $chipped_emerald so I can create that piece for you.");
	}
	
	if($text=~/arms/i)
	{
		quest::say("You will need to bring me a $arm_template and a $chipped_emerald so I can create that piece for you.");
	}
	
	if($text=~/head/i)
	{
		quest::say("You will need to bring me a $helm_template and a $chipped_emerald so I can create that piece for you.");
	}
	
	if($text=~/feet/i)
	{
		quest::say("You will need to bring me a $boot_template and a $chipped_emerald so I can create that piece for you.");
	}
	
	if($text=~/hands/i)
	{
		quest::say("You will need to bring me a $hand_template and a $chipped_emerald so I can create that piece for you.");
	}
	
	if($text=~/wrists/i)
	{
		quest::say("You will need to bring me a $bracer_template and a $chipped_emerald so I can create that piece for you.");
	}

}

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, 6461 => 1, 6453 => 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, 6460 => 1, 6453 => 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, 6458 => 1, 6453 => 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, 6459 => 1, 6453 => 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, 6456 => 1, 6453 => 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, 6455 => 1, 6453 => 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, 6454 => 1, 6453 => 1)) {
		quest::summonitem($Rewards{$Breastplate});
		quest::exp(450);
		quest::say ("There you go, $name.  You're looking tougher already!");
	}
	
	else
	{
	plugin::return_items(\%itemcount);
	}

}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 10-09-2009, 10:14 PM
Valdaun
Fire Beetle
 
Join Date: Oct 2009
Posts: 28
Default

This is really awesome, thanks so much for putting it up! I took the liberty of making some small modifications that I think makes it even cleaner. Primarily I setup variables to hold the item IDs of the requested turn-in items so that they only need to be defined in one place. I also put quote blocks around the reward and turn-in sections so they are clearly defined as to where you need to modify in order to get them working. The rest of the script can be left as-is except for changing the text spoken by the NPC.

Also in this example I have put in a level 30 requirement to receive the quest text or process the item hand ins. If you are 29 or under, you will just be asked to come back later and even valid hand-ins result in you receiving the items back.

Lastly, I added in the previously unused reward link for when you ask about a specific item. That way you can see ahead of time what is in store for you.

Hope it helps, thanks again for putting the original up.

Code:
#Simple 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",
);

################################################
#
# MODIFY HERE
# 
# QUEST REWARDS
#
################################################
%Rewards = (	#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
);
################################################

################################################
#
# MODIFY HERE
# 
# REQUIRED QUEST TURNINS
#
################################################
my $chest_turnin =	4409;		#Brown Chitin Protector (Sol B) 
my $leg_turnin =	4116;		#Shin Greaves (Lower Guk)
my $arm_turnin =	1361;		#Azure Sleeves (Lower Guk)
my $boot_turnin =	8880;		#Blackened Mithril Boots (Sol B)
my $helm_turnin =	4504;		#Crown of King Tranix (Sol B)
my $hand_turnin =	4114;		#Shin Gauntlets (Lower Guk)
my $bracer_turnin =	4406;		#Runed Mithril Bracer (Sol B)
my $cost =		16503;	#Platinum Bar (Bought)
################################################

sub EVENT_SAY {

my $armor = quest::saylink("armor");
my $chest = quest::saylink("chest");
my $legs = quest::saylink("legs");
my $arms = quest::saylink("arms");
my $head = quest::saylink("head");
my $feet = quest::saylink("feet");
my $hands = quest::saylink("hands");
my $wrists = quest::saylink("wrists");

# 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});

#Create the required quest turnin item links for use in say messages
my $chest_template = quest::varlink($chest_turnin);
my $leg_template = quest::varlink($leg_turnin);
my $arm_template = quest::varlink($arm_turnin);
my $boot_template = quest::varlink($boot_turnin);
my $helm_template = quest::varlink($helm_turnin);
my $hand_template = quest::varlink($hand_turnin);
my $bracer_template = quest::varlink($bracer_turnin);
my $chipped_emerald = quest::varlink($cost);

if($ulevel > 29)
{
	if($text=~/hail/i)
	{
		quest::say("Ahh, $name, I am glad you stopped by!  It seems to
me you are now ready for some new $ArmorType [$armor].  I am able to call
upon the power of Tunare to transmute specific lesser items into something
more befitting a $class of your stature.  The items I require can be found in
the depths of Guk and Solusek.  I will also need a $chipped_emerald for each
piece which I will fuse together with your item.");
	}

	if($text=~/armor/i)
	{
		quest::say("I can enhance armor for [$chest], [$legs], [$arms], [$head], [$feet], [$hands], and [$wrists].");
	}

	if($text=~/chest/i)
	{
		quest::say("You will need to bring me a $chest_template and a $chipped_emerald so I can create a $Breastplate_Link for you.");
	}

	if($text=~/legs/i)
	{
		quest::say("You will need to bring me a $leg_template and a $chipped_emerald so I can create a $Greaves_Link for you.");
	}
	
	if($text=~/arms/i)
	{
		quest::say("You will need to bring me a $arm_template and a $chipped_emerald so I can create a $Vambraces_Link for you.");
	}
	
	if($text=~/head/i)
	{
		quest::say("You will need to bring me a $helm_template and a $chipped_emerald so I can create a $Helm_Link for you.");
	}
	
	if($text=~/feet/i)
	{
		quest::say("You will need to bring me a $boot_template and a $chipped_emerald so I can create a $Boots_Link for you.");
	}
	
	if($text=~/hands/i)
	{
		quest::say("You will need to bring me a $hand_template and a $chipped_emerald so I can create a $Gauntlets_Link for you.");
	}
	
	if($text=~/wrists/i)
	{
		quest::say("You will need to bring me a $bracer_template and a $chipped_emerald so I can create a $Bracer_Link for you.");
	}
}

else
{
	if($text=~/hail/i)
	{
		quest::say("Hi there, $name.  I'm afraid the quests I have for
you are a little too dangerous at this time.  Please stop by again after you
have gained some more experience.");
	}
}	
}

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}";

if ($ulevel > 29)
{
	#Reward for turning in the Bracer piece
	if (plugin::check_handin(\%itemcount, $bracer_turnin => 1, $cost => 1)) {
		quest::emote(" uses her Druidic powers to fuse the items together.");
		quest::summonitem($Rewards{$Bracer});
		quest::exp(450);
		quest::say ("Your item is ready, $name.");
	}

	#Reward for turning in the Gauntlets piece
	if (plugin::check_handin(\%itemcount, $hand_turnin => 1, $cost => 1)) {
		quest::emote(" uses her Druidic powers to fuse the items together.");
		quest::summonitem($Rewards{$Gauntlets});
		quest::exp(450);
		quest::say ("Your item is ready, $name.");
	}

	#Reward for turning in the Boots piece
	if (plugin::check_handin(\%itemcount, $boot_turnin => 1, $cost => 1)) {
		quest::emote(" uses her Druidic powers to fuse the items together.");
		quest::summonitem($Rewards{$Boots});
		quest::exp(450);
		quest::say ("Your item is ready, $name.");
	}

	#Reward for turning in the Helm piece
	if (plugin::check_handin(\%itemcount, $helm_turnin => 1, $cost => 1)) {
		quest::emote(" uses her Druidic powers to fuse the items together.");
		quest::summonitem($Rewards{$Helm});
		quest::exp(450);
		quest::say ("Your item is ready, $name.");
	}

	#Reward for turning in the Vambraces piece
	if (plugin::check_handin(\%itemcount, $arm_turnin => 1, $cost => 1)) {
		quest::emote(" uses her Druidic powers to fuse the items together.");
		quest::summonitem($Rewards{$Vambraces});
		quest::exp(450);
		quest::say ("Your item is ready, $name.");
	}

	#Reward for turning in the Greaves piece
	if (plugin::check_handin(\%itemcount, $leg_turnin => 1, $cost => 1)) {
		quest::emote(" uses her Druidic powers to fuse the items together.");
		quest::summonitem($Rewards{$Greaves});
		quest::exp(450);
		quest::say ("Your item is ready, $name.");
	}

	#Reward for turning in the Breastplate piece
	if (plugin::check_handin(\%itemcount, $chest_turnin => 1, $cost => 1)) {
		quest::emote(" uses her Druidic powers to fuse the items together.");
		quest::summonitem($Rewards{$Breastplate});
		quest::exp(450);
		quest::say ("Your item is ready, $name.");
	}
	
	else
	{
		plugin::return_items(\%itemcount);
	}
}
else
{
	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 12:35 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