EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Return Plat (https://www.eqemulator.org/forums/showthread.php?t=29791)

reddogut 10-13-2009 10:57 PM

Return Plat
 
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.

Code:

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.

Code:

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;
                }
        }

}



All times are GMT -4. The time now is 02:03 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.