|
|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
| Quests::Q&A This is the quest support section |

02-09-2015, 09:23 PM
|
|
Sarnak
|
|
Join Date: May 2009
Location: Mentor
Posts: 58
|
|
Also, it appears that its not checking the turn in item... I am able to turn in anything and get the rewards...
:(
|
 |
|
 |

02-10-2015, 11:11 AM
|
|
Sarnak
|
|
Join Date: May 2009
Location: Mentor
Posts: 58
|
|
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...
Code:
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);
}
}
}
|
 |
|
 |
 |
|
 |

02-10-2015, 12:08 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
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.
Code:
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);
}
Last edited by trevius; 02-10-2015 at 12:15 PM..
|
 |
|
 |
 |
|
 |

02-10-2015, 01:06 PM
|
|
Sarnak
|
|
Join Date: May 2009
Location: Mentor
Posts: 58
|
|
Quote:
Originally Posted by trevius
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.
Code:
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.
|
 |
|
 |
 |
|
 |

02-10-2015, 01:17 PM
|
|
Sarnak
|
|
Join Date: May 2009
Location: Mentor
Posts: 58
|
|
Okay, got a question for ya Trev.
Code:
# 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...
Code:
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...
|
 |
|
 |
| Thread Tools |
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 02:33 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |