Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Completed

Quests::Completed This is where Completed quests are.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 02-01-2008, 04:28 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

I prefer using a global system for buff 'credit'.

Code:
sub EVENT_SPAWN
{
quest::settimer(1,1);
}

sub EVENT_SAY 
{
	my $cost = 500;
	
	my $credit = $qglobals{buffcredit} ? $qglobals{buffcredit} : 0;

	if ($text =~ /hail/i)
	{
		quest::say("If you want some [buffs] say the keyword.. They will cost $cost plat.");
		$npc->SetAppearance(0);
		quest::settimer(1,10);
	}
	elsif ($text =~ /buffs/i)
	{
		if ($credit < $cost)
		{
			quest::say("No can do sir. You need ".($cost - $credit)." more plat!");
		}
		else
		{
			quest::selfcast(2112);
			quest::selfcast(2517);
			quest::selfcast(8199);
			quest::selfcast(1939);
			quest::selfcast(2517);
			if ($cost > 0)
			{
				$credit -= $cost;
				quest::setglobal('buffcredit', "$credit", 5, 'F');
				quest::say("Thanks $name!  You lost $cost and now have $credit.");
			}
		}
	}
}
 
sub EVENT_ITEM
{
	my $credit = $qglobals{buffcredit} ? $qglobals{buffcredit} : 0;
	
	if ($platinum > 0)
	{
		$credit += $platinum;
		quest::setglobal('buffcredit', "$credit", 5, 'F');
		quest::say("Thanks $name! You now have $credit in credit!");
	}
	else 
		{
		plugin::return_items(\%itemcount);
    		}
}

sub EVENT_TIMER
{
	if($timer eq "1")
		{
		$npc->SetAppearance(1);
		quest::stoptimer(1);
		quest::settimer(1,5);
		}
}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:31 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3