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

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2015, 10:42 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default AFK Credits - Yay!

If a PC/client is sitting and hasn't moved x,y,z coordinates (some damper to the z coordinate to account for those that would like to go around levitating people), they will earn credits.

Not a fan of this system, but different strokes for different folks and is simplistic enough that perhaps some can learn from it in some small way.

Code:
$AFKINCREMENTSNEEDED = 180;


sub EVENT_TIMER {
	if ($timer eq "activitycheck$charid") {
		my $cxcord = int($client->GetX());
		my $cycord = int($client->GetY());
		my $czcord = int($client->GetZ());
		my $oxcord = plugin::REV($client, "oxcord");
		my $oycord = plugin::REV($client, "oycord");
		my $ozcord = plugin::REV($client, "ozcord");
		my $afkcounter = plugin::REV($client, "afkcounter");
		
		if (($client->IsSitting()) 
		&& ($oxcord ~~ [$cxcord-5..$cxcord+5])
		&& ($oycord ~~ [$cycord-5..$cycord+5])
		&& ($ozcord ~~ [$czcord-20..$czcord+20])) {
			++$afkcounter;
			plugin::SEV($client, "afkcounter", $afkcounter);
			if ($afkcounter == $AFKINCREMENTSNEEDED) { 
				$afkcounter = 0;
				plugin::SEV($client, "afkcounter", $afkcounter);
				$client->AddAlternateCurrencyValue(x, x);
				$client->Message (15, "You've earned an AFK Server Loyalty Credit!");
			}
		} else {
			$afkcounter = 0;
			plugin::SEV($client, "afkcounter", $afkcounter);
		}
		plugin::SEV($client, "oxcord", $cxcord);
		plugin::SEV($client, "oycord", $cycord);
		plugin::SEV($client, "ozcord", $czcord);
	}
}

sub EVENT_ENTERZONE {
		quest::settimer ("activitycheck$charid",10); ## activity check increment
}

sub EVENT_ZONE {
	quest::stoptimer ("activitycheck$charid");
}

sub EVENT_DISCONNECT {
	quest::stoptimer ("activitycheck$charid");
}
Put in the player.pl for a specific zone (or that is how its coded).
Reply With Quote
  #2  
Old 04-30-2015, 08:27 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

I am more tuned to give people some type of credit for writing guides, faqs, fixing issues or even reporting exploits.

I could see where some servers would want something like this so it is a good addition.
Reply With Quote
  #3  
Old 08-14-2017, 06:56 PM
Fridgecritter
Hill Giant
 
Join Date: Feb 2008
Posts: 189
Default

How would I modify this if I want to use this in the bazaar for traders? Just change the "IsSitting" part? and make it "IsStanding"? Like this?

Code:
$AFKINCREMENTSNEEDED = 180;


sub EVENT_TIMER {
	if ($timer eq "activitycheck$charid") {
		my $cxcord = int($client->GetX());
		my $cycord = int($client->GetY());
		my $czcord = int($client->GetZ());
		my $oxcord = plugin::REV($client, "oxcord");
		my $oycord = plugin::REV($client, "oycord");
		my $ozcord = plugin::REV($client, "ozcord");
		my $afkcounter = plugin::REV($client, "afkcounter");
		
		if (($client->IsStanding()) 
		&& ($oxcord ~~ [$cxcord-5..$cxcord+5])
		&& ($oycord ~~ [$cycord-5..$cycord+5])
		&& ($ozcord ~~ [$czcord-20..$czcord+20])) {
			++$afkcounter;
			plugin::SEV($client, "afkcounter", $afkcounter);
			if ($afkcounter == $AFKINCREMENTSNEEDED) { 
				$afkcounter = 0;
				plugin::SEV($client, "afkcounter", $afkcounter);
				$client->AddAlternateCurrencyValue(x, x);
				$client->Message (15, "You've earned an AFK Server Loyalty Credit!");
			}
		} else {
			$afkcounter = 0;
			plugin::SEV($client, "afkcounter", $afkcounter);
		}
		plugin::SEV($client, "oxcord", $cxcord);
		plugin::SEV($client, "oycord", $cycord);
		plugin::SEV($client, "ozcord", $czcord);
	}
}

sub EVENT_ENTERZONE {
		quest::settimer ("activitycheck$charid",10); ## activity check increment
}

sub EVENT_ZONE {
	quest::stoptimer ("activitycheck$charid");
}

sub EVENT_DISCONNECT {
	quest::stoptimer ("activitycheck$charid");
}
Reply With Quote
  #4  
Old 08-14-2017, 11:36 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,595
Default

There is no IsStanding(), use !$client->IsSitting().
Reply With Quote
  #5  
Old 08-15-2017, 07:11 AM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

You can use appearance i guess?


Code:
if ($client->GetAppearance() == 0) {
   #we are standing... 0 standing, 1 sitting, 2 ducking, 3 lieing down, 4 looting
}
Reply With Quote
Reply


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 12:58 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3