Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Plugins & Mods

Quests::Plugins & Mods Completed plugins for public use as well as modifications.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-29-2011, 11:31 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default Plugins: Qglobal Credit System

I had made a credit system prior to this that I hacked up as a temporary thing. But I have updated the SVN with a Qglobal-based credit system that people can use that is much more flexible than the one I provided before, and even in some of the code I currently use.

This plugins file contains a credit system functionality that will allow you to store credits using the qglobal system. This system currently supports two types of credit storage:
1. Player Specific Credit - 0
2. Account Specific Credit - 1
3. Guild Specific Credit - 2

For each of these three types, there are three functions:
1. Check
###Usage: plugin::QCreditCheck("Creditname", 0=Player 1=Account 2=Guild);
2. Withdraw
###Usage: plugin::QCreditWithdraw("Creditname", Amount, 0=Player 1=Account 2=Guild, [1 = Give to Player], [0=Nothing 1=Show Window 2=Show Text 3=Show Both Window/Text]);
3. Deposit
###Usage: plugin::QCreditDeposit("Creditname", Cost, 0=Player 1=Account 2=Guild, [0=Nothing 1=Show Window 2=Show Text 3=Show Both Window/Text]);
You can use this credit system for text-based merchant scripts, or to hold credit for weightless or virtual Platinum systems. Or you can even have it remember whatever you need it to remember for anything related to credits.

NOTE: Qglobals must be enable on NPC's that the script is being initiated from.
NOTE: You must also have the following in globals.pl at line 62, or the plugins SVN:

Code:
if ($varName eq 'itemcount' || $varName eq 'qglobals')
Below shows how simple a script can be to utilize these plugins:
This example is using personal (player) specific credit, any other credit storage type (player/account/guild) would work the same way:

Code:
sub EVENT_SAY{
	my $CA = plugin::commify(plugin::QCreditCheck("BankCredit", 0));
	$client->Message(315, "You have $CA credit");
	if($text=~/deposit/i){
		plugin::QCreditDeposit("BankCredit", 100, 0, 3);
	}
	if($text=~/withdraw/i){
		plugin::QCreditWithdraw("BankCredit", 100, 0, 0, 3);
	}
}

*Note: The 4th argument for deposit and the 5th argument for Withdraw both establish what message type you want to have output the final amount of your credit after the deposit or withdraw. You could have a window or text, or both, or even none at all:

Quote:
[0=Nothing 1=Show Window 2=Show Text 3=Show Both Window/Text]

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