|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
06-28-2009, 11:28 AM
|
|
Demi-God
|
|
Join Date: Nov 2007
Posts: 2,175
|
|
Should a quest NPC hand money back ?
In live when you gave an NPC the incorrect items for a quest would they eat your money ?
I was working on the Lodizal quest, it is still not working properly and he eats our money, and the quest code is written that way it seems. Was that by design ?
|
06-28-2009, 11:44 AM
|
|
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
back in my days it did. One extra coin and entire quest was wasted
|
06-28-2009, 11:52 AM
|
|
Demi-God
|
|
Join Date: Nov 2007
Posts: 2,175
|
|
Thanks ! That will help. I also see what my player is doing, the Russian Otter wants 10,000 gold, not 1,000 plat
|
06-28-2009, 12:24 PM
|
|
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
I would advise you to get rid of all "cash" quests.
The common practice shows that players continusly mis read the quest text and turn in cash needed in plat, gold, copper, silver, 1 more, 1 less etc. I myself did this dozens of times.
If you want players to spend in X ammount of plat, make quest npc to ask for a Gem which cost that much. If no such gem available to buy normaly- make a new gem and set whatever price to it
|
06-28-2009, 12:47 PM
|
Developer
|
|
Join Date: Mar 2007
Location: Ohio
Posts: 648
|
|
Or we could change the quest to return any money above the required amount.
|
06-28-2009, 01:10 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
Yeah, my quest NPCs use a function similar to check_handin() that checks coins given, disregarding actual denominations used, and then they return unneeded extra coinage to the player as change as part of an upgraded return_items().
|
06-28-2009, 01:45 PM
|
|
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
Quote:
Originally Posted by Shendare
Yeah, my quest NPCs use a function similar to check_handin() that checks coins given, disregarding actual denominations used, and then they return unneeded extra coinage to the player as change as part of an upgraded return_items().
|
Would you mind sharing that so I can add it to the PEQ repo?
|
06-28-2009, 03:06 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
Yeah, I've been meaning to flesh it out, but I can post what I've got as soon as I do some cleanup.
|
06-28-2009, 05:20 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
I just started adding in a simple check to NPCs that take money like this:
Code:
sub EVENT_ITEM {
if($platinum == 10)
{
quest::summonitem(1001);
$platinum = undef;
}
else
{
if($platinum) {
$client->AddMoneyToPP(0, 0, 0, $platinum, updateclient);
quest::say ("That is not the required amount!");
$platinum = undef;
}
}
}
Works well and is simple enough.
|
06-28-2009, 06:12 PM
|
|
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
hmm Trev, does all measurment done in "copper" ?
for example npc wants "10" - I assume 10 in copper?
so player can give npc 1 silver or 10 copper and both will work?
if yes - then you have just solved entire cash return problem
|
06-28-2009, 06:39 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
No, each coin type has it's own variable. If you want to be able to use all coin types, you could do this:
Code:
sub EVENT_ITEM {
if($platinum == 10 || $gold == 100 || $silver == 1000 || $copper == 10000)
{
quest::summonitem(1001);
$platinum = undef;
$gold = undef;
$silver = undef;
$copper = undef;
}
else
{
if($platinum || $gold || $silver || $copper) {
$client->AddMoneyToPP($copper, $silver, $gold, $platinum, updateclient);
quest::say ("That is not the required amount!");
$platinum = undef;
$gold = undef;
$silver = undef;
$copper = undef;
}
}
}
I haven't tested that yet, but it should work fine I think.
|
06-28-2009, 06:59 PM
|
|
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
I see, I can try this out
but it would be MUCH easier if it would have read value of ANY coins given as "copper"
|
06-28-2009, 07:33 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
You could do conversions if you want, but you might have to play with it a bit to make sure they work properly.
Code:
sub EVENT_ITEM {
#Convert all coin turn-ins to copper and add them up
my $totalcoin = $platinum * 1000;
my $totalcoin = $totalcoin + $gold * 100;
my $totalcoin = $totalcoin + $silver * 10;
my $totalcoin = $totalcoin + $copper;
if($totalcoin == 10000) # 10 platinum
{
quest::summonitem(1001);
$platinum = undef;
$gold = undef;
$silver = undef;
$copper = undef;
}
else
{
if($platinum || $gold || $silver || $copper) {
$client->AddMoneyToPP($copper, $silver, $gold, $platinum, updateclient);
quest::say ("That is not the required amount!");
$platinum = undef;
$gold = undef;
$silver = undef;
$copper = undef;
}
}
}
Again, I haven't tested this yet, but it should work almost perfectly for what you are wanting to do.
Last edited by trevius; 06-29-2009 at 03:37 AM..
|
|
|
|
06-28-2009, 08:13 PM
|
|
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
we should post this as example into Custom Quest section before it gets lost =P
|
06-30-2009, 12:51 PM
|
|
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
Shendare, I am still interested in the plugin version of your code when you get a chance to clean it up
|
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 08:41 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|