Log in

View Full Version : Return Plat


reddogut
10-13-2009, 10:57 PM
Can an NPC return plat? For example, when I give the following NPC 10 platinum, but I don't meet the "Ranger" or >=20, he tells me that he is sorry and that he can't help me, but he doesn't give me back my money.

sub EVENT_ITEM
{
if($platinum == 10)
{
if ($class eq "Ranger" && $ulevel >= 20)
{
quest::say ("Good, stand still while I perform this task.");
quest::scribespells(20);
}
else
{
quest::say ("I am sorry $name, I can't help you.");
}
}
}

Shin Noir
10-13-2009, 11:34 PM
You want something like:
$client->AddMoneyToPP(0,0,0,10,true);
I think on the else statement... Maybe false, but most likely true.

trevius
10-14-2009, 02:07 AM
Here is a slightly modified script that I use for adding training points to players in case they used all of them and forgot to train something simple like meditate lol. This shows how to return money easy enough. I am sure you could add in $copper, $gold, and $silver in there as well if you wanted to be sure to return any form of money.

sub EVENT_ITEM {

if($platinum == 100) {
quest::say("Thank you! Here is your costly skill point. Use it wisely!");
my $cur_skill = $client->GetSkillPoints();
my $new_skill = ($cur_skill + 1);
$client->SetSkillPoints("$new_skill");
quest::say("You have gained 1 skill point. You must zone before you can use it.");
$platinum = undef;
}
else
{
if($platinum) {
$client->AddMoneyToPP(0, 0, 0, $platinum, updateclient);
quest::say("That is not the required amount!");
$platinum = undef;
}
}

}