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

06-16-2019, 04:39 PM
|
|
Fire Beetle
|
|
Join Date: Sep 2012
Posts: 25
|
|
I -believe- this is what you're looking for (i.e. how to access/use a key in a hash of a hash):
Code:
%combine_1 = (
1 => { "item1" => 1234, "item2" => 1111, "type" => 1, "reward" => 11111 }, # Ring
2 => { "item1" => 1234, "item2" => 2222, "type" => 4, "reward" => 22222 }, # Veil
3 => { "item1" => 1234, "item2" => 3333, "type" => 3, "reward" => 33333 }, # Earring
4 => { "item1" => 1234, "item2" => 4444, "type" => 1, "reward" => 44444 }, # Ring
5 => { "item1" => 1234, "item2" => 5555, "type" => 2, "reward" => 55555 }, # Necklace
);
{
foreach my $key (sort keys %combine_1)
## could be shortened: foreach (sort keys $combine_1)
{
if ($combine_1{$key}->{type} == 1)
## if above shortened: if ($combine_1{$_}->{type} == 1)
{
my $itemlink = quest::varlink($combine_1{$key}->{reward});
## my $itemlink = quest::varlink($combine_1{$_}->{reward});
$client->Message(15, $itemlink);
}
}
}
?
|
 |
|
 |

06-17-2019, 10:34 PM
|
 |
Dragon
|
|
Join Date: Nov 2008
Location: GA
Posts: 907
|
|
Quote:
Originally Posted by Almusious
I -believe- this is what you're looking for (i.e. how to access/use a key in a hash of a hash):
Code:
%combine_1 = (
1 => { "item1" => 1234, "item2" => 1111, "type" => 1, "reward" => 11111 }, # Ring
2 => { "item1" => 1234, "item2" => 2222, "type" => 4, "reward" => 22222 }, # Veil
3 => { "item1" => 1234, "item2" => 3333, "type" => 3, "reward" => 33333 }, # Earring
4 => { "item1" => 1234, "item2" => 4444, "type" => 1, "reward" => 44444 }, # Ring
5 => { "item1" => 1234, "item2" => 5555, "type" => 2, "reward" => 55555 }, # Necklace
);
{
foreach my $key (sort keys %combine_1)
## could be shortened: foreach (sort keys $combine_1)
{
if ($combine_1{$key}->{type} == 1)
## if above shortened: if ($combine_1{$_}->{type} == 1)
{
my $itemlink = quest::varlink($combine_1{$key}->{reward});
## my $itemlink = quest::varlink($combine_1{$_}->{reward});
$client->Message(15, $itemlink);
}
}
}
?
|
^ this method is working great for what I'm trying to do. This should get my dialog responses down to 6-10 depending on the category, which is much better and I can filter further if needed.
|
 |
|
 |
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 03:31 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |