View Single Post
  #1  
Old 02-03-2015, 03:32 PM
utbbop
Sarnak
 
Join Date: May 2009
Location: Mentor
Posts: 58
Default Help with quest turn in code.

Hi All,
I am writing some quests for class specific armors.

Without going into much detail I am running into an issue trying to make my quest code re-usable.

I want to be able to copy/paste the code with as few needed modifications as possible for other classes.

Here are the following elements of code I am working with:


Code 1. The following code doesn't seem to work, the NPC returns the items and says he has no need for them:
Code:
if (plugin::check_handin(\%itemcount, $T1Chestpatternitemid => 1, $T1armorscrapsitemid => 1, $T1gemitemid => 1, $T1essenceitemid => 1))
Code 2. The following code works and the NPC accepts the items and provides the reward:
Code:
if (plugin::check_handin(\%itemcount, 2422 => 1, 1656 => 1, 1375 => 1, 1266 => 1,))
Code 3. In relation to Code 1, I have the following items defined in my code:
Code:
my $T1armorscrapsitemid = 1656;
my $T1gemitemid = 1375;
my $T1essenceitemid = 1266;
my $T1Chestpatternitemid = 2422;

If I could get the items in Code 3 to work with Code 1 it would allow me to copy and paste my entire code from NPC to NPC and I would only need to adjust the items in the "my" section of the code rather then adjusting EACH "plugin::check_handin" line with the correct item id's.


Hope this makes sense and hope someone can assist!

Thanks!
Reply With Quote