I can't seem to find the original but here is my copy
use this as a base but convert from using plat to using items and giving items instead of casting spells
credit card system
Code:
sub EVENT_SAY {
if($text=~/Hail/i){
quest::say("Hello, $name. Are you interested in [buffs] or would you like to know your [Credit Info]?");
}
if($text=~/Credit Info/i){
quest::say("Would you like to know how to [obtain] credit, your current [credit value], or available [buffs]?");
}
if($text=~/obtain/i){
quest::say("For every platinum you bring me you shall receive one credit. These credits can be redeemed for buffs at your request.");
}
if($text=~/buffs/i || $text=~/yes/i) { #### What buffs does he offer and how much credit?
quest::say("I have the following to offer you:");
quest::say("[Cleanse] --full health and mana restore-- - FREE");
quest::say("[Temperance] - 25p");
quest::say("[Virtue] - 50p");
quest::say("[C1] - 5p");
quest::say("[C2] - 25p");
quest::say("[C3] - 75p");
}
if($text=~/credit value/){
if ($buffbot >= 1) {
quest::say("Your current credit is $buffbot");
$buffbot = undef;
}
else {
quest::say("You have 0 credit. Would you like to know how much you need to donate obtain [buffs]?");
$buffbot = undef;
}
}
#cleanse
if($text=~/cleanse/i){ #### Restores Mana and Health. I use this as an alternative to simply casting a spell
$client->Heal();
$client->SetMana($client->GetMaxMana());
quest::say("As you wish!");
}
#buffs begins
#buff 1- Temperance
if($text=~/Temperance/i){
if ($buffbot >= 25) {
quest::selfcast(3692);
quest::say("As you wish!");
quest::setglobal("buffbot", $buffbot-25, 0, "Y9");
$buffbot = undef;
}
else {
quest::say("You need more credits!");
$buffbot = undef;
}
}
#temperance ends
#virtue
if($text=~/virtue/i){
if ($buffbot >= 50) {
quest::selfcast(3467);
quest::say("As you wish!");
quest::setglobal("buffbot", $buffbot-50, 0, "Y9");
$buffbot = undef;
}
else {
quest::say("You need more credits!");
$buffbot = undef;
}
}
#c1
if($text=~/c1/i){
if ($buffbot >= 5) {
quest::selfcast(174);
quest::say("As you wish!");
quest::setglobal("buffbot", $buffbot-5, 0, "Y9");
$buffbot = undef;
}
else {
quest::say("You need more credits!");
$buffbot = undef;
}
}
#c2
if($text=~/c2/i){
if ($buffbot >= 25) {
quest::selfcast(1693);
quest::say("As you wish!");
quest::setglobal("buffbot", $buffbot-25, 0, "Y9");
$buffbot = undef;
}
else {
quest::say("You need more credits!");
$buffbot = undef;
}
}
#c3
if($text=~/c3/i){
if ($buffbot >= 75) {
quest::selfcast(2570);
quest::say("As you wish!");
quest::setglobal("buffbot", $buffbot-75, 0, "Y9");
$buffbot = undef;
}
else {
quest::say("You need more credits!");
$buffbot = undef;
}
}
}
sub EVENT_ITEM {
#give a plat, get a credit. Takes any platinum over 1.
if($platinum >= 1){
quest::setglobal("buffbot", $buffbot+$platinum, 0, "Y9");
quest::say("Your credit has been increased by $platinum.");
$buffbot = undef;
quest::settimer(1,1);
}
else {
quest::say("I only accept platinum.");
$buffbot = undef;
}
plugin::return_items(\%itemcount);
}
sub EVENT_TIMER {
if ($timer == 1) {
quest::say("Would you like to know your total [credit value]?");
quest::stoptimer(1);
}
}