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

06-17-2019, 11:42 AM
|
 |
Dragon
|
|
Join Date: Nov 2008
Location: GA
Posts: 905
|
|
Quote:
Originally Posted by Almusious
Devoid of feedback on what I posted using your own hash, I'm afraid I cannot be of much more assistance.
|
I appreciate both responses, I simply have not yet had a chance to test anything. My response to Nate is based on research I had already done in the past. I'll let you know after I get a chance to test out your recommendations.
Just to clarify, in the dialogue, similar to what Nate posted, the user can choose what "type" of jewelry they are interested in and I want to pull those out of the hash so the dialogue response isn't a mile long.
|
 |
|
 |

06-17-2019, 12:06 PM
|
|
Fire Beetle
|
|
Join Date: Sep 2012
Posts: 25
|
|
Quote:
Originally Posted by chrsschb
I appreciate both responses, I simply have not yet had a chance to test anything. My response to Nate is based on research I had already done in the past. I'll let you know after I get a chance to test out your recommendations.
Just to clarify, in the dialogue, similar to what Nate posted, the user can choose what "type" of jewelry they are interested in and I want to pull those out of the hash so the dialogue response isn't a mile long.
|
Fair enough. How many items (total) do you suspect will be in the hash?
With the example I posted using your existing hash, so long as you utilize conditionals, it will "pull" the types requested, then display a link for the reward item.
The modified hash I posted is how I would roll myself, perhaps even making the moneyrequired and itemrequired keys hold array values (for flexibility), though it would of course require more code you're currently not comfortable with (though I suspect you will be in time).
Code:
%combines = (
"Rings" =>
[
{
rewarditem => 7171,
itemrequired1 => 1111,
itemrequired2 => 2222,
itemrequired3 => 3333,
itemrequired4 => 4444,
moneyrequiredplatinum => 2,
moneyrequiredgold => 0,
moneyrequiredsilver => 0,
moneyrequiredcopper => 0
},
{
rewarditem => 7171,
itemrequired1 => 1111,
itemrequired2 => 2222,
itemrequired3 => 3333,
itemrequired4 => 4444,
moneyrequiredplatinum => 2,
moneyrequiredgold => 0,
moneyrequiredsilver => 0,
moneyrequiredcopper => 0
},
],
"Veils" =>
[
{
rewarditem => 7171,
itemrequired1 => 1111,
itemrequired2 => 2222,
itemrequired3 => 3333,
itemrequired4 => 4444,
moneyrequiredplatinum => 2,
moneyrequiredgold => 0,
moneyrequiredsilver => 0,
moneyrequiredcopper => 0
},
],
"Shoulders" =>
[
{
rewarditem => 7171,
itemrequired1 => 1111,
itemrequired2 => 2222,
itemrequired3 => 3333,
itemrequired4 => 4444,
moneyrequiredplatinum => 2,
moneyrequiredgold => 0,
moneyrequiredsilver => 0,
moneyrequiredcopper => 0
},
],
);
sub EVENT_SAY
{
if ($text=~/Hail/i)
{
my @itemtypes_available = (sort keys %combines);
my $itemtypes_string = "";
my $n = 0;
foreach (@itemtypes_available)
{
if ($n < $#itemtypes_available)
{
if ($n == ($#itemtypes_available - 1))
{
$itemtypes_string .= quest::saylink($_, 1, "[".$_."]");
} else {
$itemtypes_string .= quest::saylink($_, 1, "[".$_."]") . ", ";
}
} else {
$itemtypes_string .= " and " . quest::saylink($_, 1, "[".$_."]");
}
$n++;
}
plugin::Whisper ("I have ".$itemtypes_string." to offer via quests!");
}
}
Not the prettiest method of concatenation, but, save for using pop, last, etc. in a loop, I believe the above way of going about it is the easier way for most folks to look at it (to see what is going on).
I'm heading out of town, so I cannot see my assistance through, but, you've got Nate's ears/eyes, you'll get it all worked out I have no doubt.
|
 |
|
 |

06-17-2019, 12:16 PM
|
 |
Dragon
|
|
Join Date: Nov 2008
Location: GA
Posts: 905
|
|
Quote:
Originally Posted by Almusious
Fair enough. How many items (total) do you suspect will be in the hash?
|
At least a hundred. This method will grow, evolve and be used for other npcs with similar functionalities.
|

06-17-2019, 12:28 PM
|
|
Fire Beetle
|
|
Join Date: Sep 2012
Posts: 25
|
|
Quote:
Originally Posted by chrsschb
At least a hundred. This method will grow, evolve and be used for other npcs with similar functionalities.
|
And will there be multiple/different methods of obtaining the same reward item? What I mean is for example:
1111 x 1,
2222 x 1,
3333 x 1,
4444 x 1,
2pp,0gp,0sp,0cp
Results in: 9999
But...
1111 x 1,
2222 x 1,
5555 x 1
20pp,0gp,0sp,0cp
Also results in: 9999
If not, then having arrays as the itemrequired and moneyrequired values wouldn't be necessary (which is where I imagined you going). Also with that, then you could just roll with a formatted array like in Nate's script. Im out, I look forward to revisiting this when I get back, have a good one.
|
| 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 07:00 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |