PDA

View Full Version : Help with quest turn in code.


utbbop
02-03-2015, 03:32 PM
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:
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:
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:
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!

utbbop
02-03-2015, 04:09 PM
It appears that moving the following items out of my Event_Say and putting them outside of an Event in general has solved my problem:
my $T1armorscrapsitemid = 1656;
my $T1gemitemid = 1375;
my $T1essenceitemid = 1266;
my $T1Chestpatternitemid = 2422;

Can anyone advise what exactly I achieved? If these items aren't in an Event and they are just in the "nether" of my code, what is this area referred to as?

Thanks...

Kingly_Krab
02-03-2015, 05:10 PM
If you define a variable the way you did in the EVENT_SAY subroutine and try to use it in the EVENT_ITEM subroutine it will not work, what you did was move it to a global definition, allowing it to be used in any subroutine.

utbbop
02-03-2015, 05:27 PM
If you define a variable the way you did in the EVENT_SAY subroutine and try to use it in the EVENT_ITEM subroutine it will not work, what you did was move it to a global definition, allowing it to be used in any subroutine.

Thank King, makes sense.

Appreciate the intel...

Kingly_Krab
02-03-2015, 06:10 PM
You're welcome, I'm glad your issue has been resolved.

chrsschb
02-05-2015, 10:47 AM
There's a few really good examples in the Custom Quests forum for reusable quest scripts using variables and arrays.

utbbop
02-09-2015, 07:21 PM
Hi Everyone,
Back with another turn in related question/troubleshoot.

For some reason, the following code isn't working as I want it to.

In practice, as a warrior, if I turn in item 2995 it should return item 1563 to me. However, it is returning BOTH items 1563 and item 1568 from the second block of code. Really, It should only return item 1568 if I turn in say item 2296...

I am sure something is wrong with my logic but have spent all day putzing with it and am only making it worse. If anyone can review and provide feedback it is much appreciated...


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, 2995 => 1 or 3137 => 1 or 3226 => 1 or 3235 => 1 or 3295 => 1 or 3484 => 1 or 2835 => 1 or 2868 => 1 or 2958 => 1 or 2845 => 1 or 2886 => 1 or 2861 => 1 or 1591 => 1 or 3540 => 1 or 3680 => 1 or 3854 => 1))
{
my %rewards = ("Mage" => 2278, "Necromancer" => 2381, "Wizard" => 2422, "Cleric" => 1803, "Druid" => 2434, "Shaman" => 2665, "Berserker" => 2684, "Monk" => 2444, "Ranger" => 2493, "Rogue" => 2828, "Paladin" => 1810, "Shadowknight" => 1819, "Warrior" => 1563, "Bard" => 1846, "Beastlord" => 2562, "Enchanter" => 2561);
if(defined($rewards{$class}))
{
quest::summonitem($rewards{$class});
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
}
}
else
{
plugin::return_items(\%itemcount);
}
}
################################################## ################################################## ################################################## ################################################## ###########################
{
if (plugin::check_handin(\%itemcount, 2996 => 1 or 3174 => 1 or 3227 => 1 or 3236 => 1 or 3404 => 1 or 3485 => 1 or 2836 => 1 or 2871 => 1 or 2964 => 1 or 2846 => 1 or 3397 => 1 or 2863 => 1 or 2095 => 1 or 3541 => 1 or 3682 => 1 or 3855 => 1))
{
my %rewards = ("Mage" => 2298, "Necromancer" => 2382, "Wizard" => 2423, "Cleric" => 1806, "Druid" => 2435, "Shaman" => 2666, "Berserker" => 2685, "Monk" => 2445, "Ranger" => 2494, "Rogue" => 2829, "Paladin" => 1811, "Shadowknight" => 1823, "Warrior" => 1568, "Bard" => 1847, "Beastlord" => 2564, "Enchanter" => 2656);
if(defined($rewards{$class}))
{
quest::summonitem($rewards{$class});
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
}
}
else
{
plugin::return_items(\%itemcount);
}
}
}

NatedogEZ
02-09-2015, 08:04 PM
Wait a second.. why do you check for every class? lol.. but in the middle there is missing code.. just random brackets for no reason

utbbop
02-09-2015, 08:39 PM
Hi Nate,
I was checking for every class as the armor is class specific.

This specific quest allows say a warrior to trade in a piece of wizard gear for the warrior pattern that makes the slot of wizard gear that was turned in.

I am a warrior.
I made the Wizard Robe, because I had the regents...

This quest should allow me to turn in the Wizard Robe for the Warrior Breastplate pattern.

utbbop
02-09-2015, 09:23 PM
Also, it appears that its not checking the turn in item... I am able to turn in anything and get the rewards...

:(

utbbop
02-10-2015, 11:11 AM
Changed to an array per some feedback but still cant get it to work.
The following code doesnt accept the item and doesnt provide a reward. The NPC returns the item stating they have no need for it...

sub EVENT_ITEM
{
my @t1chestarmor = [2995,3137,3226,3235,3295,3484,2835,2868,2958,2845, 2886,2861,1591,3540,3680,3854];
my @t1legarmor = [2996,3174,3227,3236,3404,3485,2836,2871,2964,2846, 3397,2863,2095,3541,3682,3855];

if ($class == 'Mage' || $class == 'Necromance' || $class == 'Wizard' || $class == 'Cleric' || $class == 'Druid' || $class == 'Shaman' || $class == 'Berserker' || $class == 'Monk' || $class == 'Ranger' || $class == 'Rogue' || $class == 'Paladin' || $class == 'Shadowknight' || $class == 'Warrior' || $class == 'Bard' || $class == 'Beastlord' || $class == 'Enchanter')
{
if (($item1 ~~ @t1chestarmor))
{
my %rewards = ( "Mage" => 2278, "Necromancer" => 2381, "Wizard" => 2422, "Cleric" => 1803, "Druid" => 2434, "Shaman" => 2665, "Berserker" => 2684, "Monk" => 2444, "Ranger" => 2493, "Rogue" => 2828, "Paladin" => 1810, "Shadowknight" => 1819, "Warrior" => 1563, "Bard" => 1846, "Beastlord" => 2562, "Enchanter" => 2561);
}
elsif (($item1 = @t1legarmor))
{
my %rewards = ( "Mage" => 2298, "Necromancer" => 2382, "Wizard" => 2423, "Cleric" => 1806, "Druid" => 2435, "Shaman" => 2666, "Berserker" => 2685, "Monk" => 2445, "Ranger" => 2494, "Rogue" => 2829, "Paladin" => 1811, "Shadowknight" => 1823, "Warrior" => 1568, "Bard" => 1847, "Beastlord" => 2564, "Enchanter" => 2656);
}
if(defined($rewards{$class}))
{
quest::summonitem($rewards{$class});
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
}
else
{
plugin::return_items(\%itemcount);
}
}
}

trevius
02-10-2015, 12:08 PM
This is a much cleaner way of doing it via hashes:

Note that I only updated the first hash with your item IDs and the second one was just a copy/paste of the first one because I was too lazy to copy your item IDs all over for it. So, you will need to update the second hash (HandInHash2). Also, note that I am not sure what class order you had for your arrays @t1chestarmor or @t1legarmor, so please make sure to review the Turn-In column of the hash and ensure it is the correct one for each class.

sub EVENT_ITEM {

my $RewardReceived = 0;

# t1chestarmor
# Class => [ Turn-In, Reward ],
my %HandInHash = (
"Warrior" => [ 1591, 1563 ],
"Rogue" => [ 2845, 2828 ],
"Monk" => [ 2868, 2444 ],
"Berserker" => [ 2835, 2684 ],
"Shadowknight" => [ 2861, 1819 ],
"Paladin" => [ 2886, 1810 ],
"Ranger" => [ 2958, 2493 ],
"Bard" => [ 3540, 1846 ],
"Beastlord" => [ 3680, 2562 ],
"Cleric" => [ 3235, 1803 ],
"Druid" => [ 3295, 2434 ],
"Shaman" => [ 3484, 2665 ],
"Wizard" => [ 3226, 2422 ],
"Magician" => [ 2995, 2278 ],
"Enchanter" => [ 3854, 2561 ],
"Necromancer" => [ 3137, 2381 ]
);

# t1legarmor (Note that this is just a copy of the above array - Make sure you update the IDs!)
# Class => [ Turn-In, Reward ],
my %HandInHash2 = (
"Warrior" => [ 1591, 1563 ],
"Rogue" => [ 2845, 2828 ],
"Monk" => [ 2868, 2444 ],
"Berserker" => [ 2835, 2684 ],
"Shadowknight" => [ 2861, 1819 ],
"Paladin" => [ 2886, 1810 ],
"Ranger" => [ 2958, 2493 ],
"Bard" => [ 3540, 1846 ],
"Beastlord" => [ 3680, 2562 ],
"Cleric" => [ 3235, 1803 ],
"Druid" => [ 3295, 2434 ],
"Shaman" => [ 3484, 2665 ],
"Wizard" => [ 3226, 2422 ],
"Magician" => [ 2995, 2278 ],
"Enchanter" => [ 3854, 2561 ],
"Necromancer" => [ 3137, 2381 ]
);

if($HandInHash{$class})
{
# $HandInHash{$class}[0]; # Item Turned In
# $HandInHash{$class}[1]; # Reward

if (plugin::check_handin(\%itemcount, $HandInHash{$class}[0] => 1))
{
quest::summonitem($HandInHash{$class}[1]);
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
# Example for below: Percent Experience (5), Max Level to give full exp percentage (level 45)
$client->AddLevelBasedExp(5, 45);
quest::ding();
$RewardReceived = 1;
}
}

if ($HandInHash2{$class})
{
# $HandInHash2{$class}[0]; # Item Turned In
# $HandInHash2{$class}[1]; # Reward

if (plugin::check_handin(\%itemcount, $HandInHash2{$class}[0] => 1))
{
quest::summonitem($HandInHash2{$class}[1]);
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
# Example for below: Percent Experience (5), Max Level to give full exp percentage (level 45)
$client->AddLevelBasedExp(5, 45);
quest::ding();
$RewardReceived = 1;
}
}

if ($RewardReceived == 0)
{
quest::say ("Sorry, $name, but I cannot accept that.");
}

plugin::return_items(\%itemcount);
}

utbbop
02-10-2015, 01:06 PM
This is a much cleaner way of doing it via hashes:

Note that I only updated the first hash with your item IDs and the second one was just a copy/paste of the first one because I was too lazy to copy your item IDs all over for it. So, you will need to update the second hash (HandInHash2). Also, note that I am not sure what class order you had for your arrays @t1chestarmor or @t1legarmor, so please make sure to review the Turn-In column of the hash and ensure it is the correct one for each class.

sub EVENT_ITEM {

my $RewardReceived = 0;

# t1chestarmor
# Class => [ Turn-In, Reward ],
my %HandInHash = (
"Warrior" => [ 1591, 1563 ],
"Rogue" => [ 2845, 2828 ],
"Monk" => [ 2868, 2444 ],
"Berserker" => [ 2835, 2684 ],
"Shadowknight" => [ 2861, 1819 ],
"Paladin" => [ 2886, 1810 ],
"Ranger" => [ 2958, 2493 ],
"Bard" => [ 3540, 1846 ],
"Beastlord" => [ 3680, 2562 ],
"Cleric" => [ 3235, 1803 ],
"Druid" => [ 3295, 2434 ],
"Shaman" => [ 3484, 2665 ],
"Wizard" => [ 3226, 2422 ],
"Magician" => [ 2995, 2278 ],
"Enchanter" => [ 3854, 2561 ],
"Necromancer" => [ 3137, 2381 ]
);

# t1legarmor (Note that this is just a copy of the above array - Make sure you update the IDs!)
# Class => [ Turn-In, Reward ],
my %HandInHash2 = (
"Warrior" => [ 1591, 1563 ],
"Rogue" => [ 2845, 2828 ],
"Monk" => [ 2868, 2444 ],
"Berserker" => [ 2835, 2684 ],
"Shadowknight" => [ 2861, 1819 ],
"Paladin" => [ 2886, 1810 ],
"Ranger" => [ 2958, 2493 ],
"Bard" => [ 3540, 1846 ],
"Beastlord" => [ 3680, 2562 ],
"Cleric" => [ 3235, 1803 ],
"Druid" => [ 3295, 2434 ],
"Shaman" => [ 3484, 2665 ],
"Wizard" => [ 3226, 2422 ],
"Magician" => [ 2995, 2278 ],
"Enchanter" => [ 3854, 2561 ],
"Necromancer" => [ 3137, 2381 ]
);

if($HandInHash{$class})
{
# $HandInHash{$class}[0]; # Item Turned In
# $HandInHash{$class}[1]; # Reward

if (plugin::check_handin(\%itemcount, $HandInHash{$class}[0] => 1))
{
quest::summonitem($HandInHash{$class}[1]);
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
# Example for below: Percent Experience (5), Max Level to give full exp percentage (level 45)
$client->AddLevelBasedExp(5, 45);
quest::ding();
$RewardReceived = 1;
}
}

if ($HandInHash2{$class})
{
# $HandInHash2{$class}[0]; # Item Turned In
# $HandInHash2{$class}[1]; # Reward

if (plugin::check_handin(\%itemcount, $HandInHash2{$class}[0] => 1))
{
quest::summonitem($HandInHash2{$class}[1]);
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
# Example for below: Percent Experience (5), Max Level to give full exp percentage (level 45)
$client->AddLevelBasedExp(5, 45);
quest::ding();
$RewardReceived = 1;
}
}

if ($RewardReceived == 0)
{
quest::say ("Sorry, $name, but I cannot accept that.");
}

plugin::return_items(\%itemcount);
}

Going to work with this now, will let you know the results!
Thanks Trev.

utbbop
02-10-2015, 01:17 PM
Okay, got a question for ya Trev.

# t1chestarmor
# Class => [ Turn-In, Reward ],
my %HandInHash = (
"Warrior" => [ 1591, 1563 ],
"Rogue" => [ 2845, 2828 ],
"Monk" => [ 2868, 2444 ],
"Berserker" => [ 2835, 2684 ],
"Shadowknight" => [ 2861, 1819 ],
"Paladin" => [ 2886, 1810 ],
"Ranger" => [ 2958, 2493 ],
"Bard" => [ 3540, 1846 ],
"Beastlord" => [ 3680, 2562 ],
"Cleric" => [ 3235, 1803 ],
"Druid" => [ 3295, 2434 ],
"Shaman" => [ 3484, 2665 ],
"Wizard" => [ 3226, 2422 ],
"Magician" => [ 2995, 2278 ],
"Enchanter" => [ 3854, 2561 ],
"Necromancer" => [ 3137, 2381 ]

If the format is [ Turn-in, Reward ], how do I handle multiple potential turn-in's for the same reward?

Example:
I am a Warrior.
I have item 1234 which is a Wizard Leg Item.
I want to turn in item 1234 for the Warrior Leg Item which is item number 12345.

Alternatively, I may have created item 123 which is a Druid Leg Item.
I want to be able to then turn in item 123 and receive the Warrior Leg Item which again is item 12345.


Edit:
Might have stumbled onto something that seems to have worked initially...

my $RewardReceived = 0;

# t1chestarmor
# Class => [ Turn-In, Reward ],
my %HandInHash = (
"Warrior" => [ 1591, 2995, 1563 ],

if($HandInHash{$class})
{
# $HandInHash{$class}[0]; # Item Turned In 1
# $HandInHash{$class}[1]; # Item Turned In 2
# $HandInHash{$class}[2]; # Reward

if (plugin::check_handin(\%itemcount, $HandInHash{$class}[0,1] => 1))
{
quest::summonitem($HandInHash{$class}[2]);
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
# Example for below: Percent Experience (5), Max Level to give full exp percentage (level 45)
$client->AddLevelBasedExp(5, 45);
quest::ding();
$RewardReceived = 1;
}
}

Any feedback on this?

Thanks for the help...

ghanja
02-10-2015, 03:02 PM
You're in need of a multidimensional hash.

For any of us to begin working on this to produce the results you want, you need to provide all item id numbers, though in such a manner.

Magician Head - 2500
Enchanter Head - 2501
Rogue Head - 2502

etc.

Magician Head - 2600
Enchanter Head - 2601
etc.

As you can see, which I try to tactfully suggest, if you had/have control over the item ids and know you want to do this sort of thing from the get go (which I assume so many things are in place by now that -your- best method is through a MD hash), make an item numbering convention. Too late for that now, so, time for code. :)

Though we will need to know the item id's of all gear, preferably listed in the manner shown above.

NatedogEZ
02-10-2015, 03:40 PM
This may work .. now that I know what you are asking for.

Place all rewards into the correct spot...
Place all possibly turn in items into @item_list...

This will ONLY work if they are single slot items and they match.. (helms give helms.. ect ect...)


Turning in any helm from the list of items will give you your class helm.. ect..


sub EVENT_ITEM {
my %rewards = ( #head arm bracer hands chest legs feet
"Warrior" => [4515, 4517, 4518, 4519, 4516, 4520, 4521], #All the cobalt set.. (for testing)
"Rogue" => [2828, 1001, 1002, 1003, 1004, 1005, 1006],
"Monk" => [2444, 1001, 1002, 1003, 1004, 1005, 1006],
"Berserker" => [2684, 1001, 1002, 1003, 1004, 1005, 1006],
"Shadowknight" => [1819, 1001, 1002, 1003, 1004, 1005, 1006],
"Paladin" => [1810, 1001, 1002, 1003, 1004, 1005, 1006],
"Ranger" => [2493, 1001, 1002, 1003, 1004, 1005, 1006],
"Bard" => [1846, 1001, 1002, 1003, 1004, 1005, 1006],
"Beastlord" => [2562, 1001, 1002, 1003, 1004, 1005, 1006],
"Cleric" => [1803, 1001, 1002, 1003, 1004, 1005, 1006],
"Druid" => [2434, 1001, 1002, 1003, 1004, 1005, 1006],
"Shaman" => [2665, 1001, 1002, 1003, 1004, 1005, 1006],
"Wizard" => [2422, 1001, 1002, 1003, 1004, 1005, 1006],
"Magician" => [2278, 1001, 1002, 1003, 1004, 1005, 1006],
"Enchanter" => [2561, 1001, 1002, 1003, 1004, 1005, 1006],
"Necromancer" => [2381, 1001, 1002, 1003, 1004, 1005, 1006]
);
my %reward_type = (
4 => 0, #Head
128 => 1, #Arm
1536 => 2, #Bracer
4096 => 3, #hands
131072 => 4, #chest
262144 => 5, #legs
524288 => 6 #feet
);

my @item_list = (1001, 1004, 1008, 1009, 1010, 1011, 1012); #THIS would be ALL items that are turned IN
my $item_turnin = 0;
if (grep { $_ == $item1 } @item_list) { $item_turnin = $item1; }
elsif (grep { $_ == $item2 } @item_list) { $item_turnin = $item2; }
elsif (grep { $_ == $item3 } @item_list) { $item_turnin = $item3; }
elsif (grep { $_ == $item4 } @item_list) { $item_turnin = $item4; }

if($item_turnin > 0) {
my $slots = $client->GetItemStat($item_turnin, "slots");
if (plugin::check_handin(\%itemcount, $item_turnin => 1)) {
quest::summonitem($rewards{$class}[$reward_type{$slots}]);
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
}
}

plugin::return_items(\%itemcount);
}

ghanja
02-10-2015, 03:45 PM
[code]
Class Chest Legs Head Shoulders Arms Gloves Boots Bracers
Magician 2278 2298 2370 2372 2376 2377 2378 2379
Necromancer 2381 2382 2383 2385 2380 2393 2415 2421
Wizard 2422 2423 2424 2425 2430 2431 2432 2433
Cleric 1803 1806 1805 1807 1800 1804 1801 1802
Druid 2434 2435 2436 2437 2438 2439 2442 2443
Shaman 2665 2666 2667 2668 2669 2670 2672 2673
Berserker 2684 2685 2686 2687 2717 2718 2730 2820
Monk 2444 2445 2451 2473 2486 2487 2488 2489
Ranger 2493 2494 2495 2496 2497 2508 2511 2556
Rogue 2828 2829 2830 2831 2832 2833 2834 2827
Paladin 1810 1811 1812 1813 1808 1817 1809 1818
Warrior 1563 1568 1569 1577 1579 1581 1582 1586
Bard 1846 1847 1848 1901 1902 1907 1909 2052
Beastlord 2562 2564 2613 2614 2632 2633 2634 2650
Enchanter 2561 2656 2657 2660 2661 2662 2663 2664
Shadowknight 1819 1823 1824 1825 1826 1836 1844 1845


As per your PM. Yeah a hash of arrays would work just as NateDog provided. Populate his script accordingly using what you PM'ed me.

ghanja
02-10-2015, 03:48 PM
You could also make the turn in item the key, then if you kept the array elements aligned (as he said you should anyway), you could use the class id (1-16) to choose the applicable element. If item turned in == element contents, then let the player know they already have their item. <shrug> A few methods of attack with this.

utbbop
02-10-2015, 03:48 PM
Ok, here are my item numbers as requested...
(There is a large number of these and I am not looking for a hand out so if the task is too daunting to assist with I understand.)
Due to formatting issues with the forum, I have made a google sheet with the information. There are 2 tabs for reference.
https://docs.google.com/spreadsheets/d/1iloaNLrdbjs4MM3o1puxNzlO1pyM2EnPY2U7TVnoays/edit?usp=sharing

Overall Goal:
Allow someone to turn in a class and slot specific armor piece for a class and slot specific pattern. The ARMOR that is turned in can be for ANY CLASS. The PATTERN that is rewarded should be for the players specific class and should be for the slot that was turned in.

utbbop
02-10-2015, 03:51 PM
This may work .. now that I know what you are asking for.

Place all rewards into the correct spot...
Place all possibly turn in items into @item_list...

This will ONLY work if they are single slot items and they match.. (helms give helms.. ect ect...)


Turning in any helm from the list of items will give you your class helm.. ect..


sub EVENT_ITEM {
my %rewards = ( #head arm bracer hands chest legs feet
"Warrior" => [4515, 4517, 4518, 4519, 4516, 4520, 4521], #All the cobalt set.. (for testing)
"Rogue" => [2828, 1001, 1002, 1003, 1004, 1005, 1006],
"Monk" => [2444, 1001, 1002, 1003, 1004, 1005, 1006],
"Berserker" => [2684, 1001, 1002, 1003, 1004, 1005, 1006],
"Shadowknight" => [1819, 1001, 1002, 1003, 1004, 1005, 1006],
"Paladin" => [1810, 1001, 1002, 1003, 1004, 1005, 1006],
"Ranger" => [2493, 1001, 1002, 1003, 1004, 1005, 1006],
"Bard" => [1846, 1001, 1002, 1003, 1004, 1005, 1006],
"Beastlord" => [2562, 1001, 1002, 1003, 1004, 1005, 1006],
"Cleric" => [1803, 1001, 1002, 1003, 1004, 1005, 1006],
"Druid" => [2434, 1001, 1002, 1003, 1004, 1005, 1006],
"Shaman" => [2665, 1001, 1002, 1003, 1004, 1005, 1006],
"Wizard" => [2422, 1001, 1002, 1003, 1004, 1005, 1006],
"Magician" => [2278, 1001, 1002, 1003, 1004, 1005, 1006],
"Enchanter" => [2561, 1001, 1002, 1003, 1004, 1005, 1006],
"Necromancer" => [2381, 1001, 1002, 1003, 1004, 1005, 1006]
);
my %reward_type = (
4 => 0, #Head
128 => 1, #Arm
1536 => 2, #Bracer
4096 => 3, #hands
131072 => 4, #chest
262144 => 5, #legs
524288 => 6 #feet
);

my @item_list = (1001, 1004, 1008, 1009, 1010, 1011, 1012); #THIS would be ALL items that are turned IN
my $item_turnin = 0;
if (grep { $_ == $item1 } @item_list) { $item_turnin = $item1; }
elsif (grep { $_ == $item2 } @item_list) { $item_turnin = $item2; }
elsif (grep { $_ == $item3 } @item_list) { $item_turnin = $item3; }
elsif (grep { $_ == $item4 } @item_list) { $item_turnin = $item4; }

if($item_turnin > 0) {
my $slots = $client->GetItemStat($item_turnin, "slots");
if (plugin::check_handin(\%itemcount, $item_turnin => 1)) {
quest::summonitem($rewards{$class}[$reward_type{$slots}]);
quest::emote("Works to make a piece of armor from the instructions you provided to him." );
quest::say ("Here you go $name.");
}
}

plugin::return_items(\%itemcount);
}


Ok, this may work.
I will give it a whirl and let you all know the results.

utbbop
02-10-2015, 04:32 PM
Ok, this may work.
I will give it a whirl and let you all know the results.

This appears to be working!

I am going to spend the rest of the evening testing and implementing and will let you all know if I could use more assistance.

As of right now, please hold off on any further assistance as I don't want anyone to waste their time if this does in fact solve all of my issues.

Thanks to EVERYONE for your help.