Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2011, 03:54 PM
LordAdakos
Sarnak
 
Join Date: Dec 2007
Posts: 60
Default Credit Management

I was looking for a platinum sink, and figured that the translocator was much too free. So like the good capitalist I am, I decided to make people PAY to use him!

I want to charge 100pp per port, but I want the NPC to be able to take money in advance and hold it for the player, and keep a running total. I've seen this on other servers, but I cannot for the life of my figure out how to implement it.

I'm guessing I assign a global variable with the characters name and the amount they deposited - and then check that, subtract as necessary ....


But does anyone have an example of a credit system/ using global variables I could look at as an example? Even something simple?
Reply With Quote
  #2  
Old 10-17-2011, 07:24 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Use quest globals.

Code:
sub EVENT_ITEM {
  my $cash = $platinum * 1000 + $gold * 100 + $silver * 10 + $copper;

  if ($cash > 0) {
    if (defined($qglobals{credit})) {
      quest::setglobal("credit",$qglobals{credit}+$cash,0,"F");
    }
    else {
      quest::setglobal("credit",$cash,0,"F");
    }
  }
  else {
    plugin::return_items(\%itemcount);
  }
}
Didn't test or check this for errors, but it is something you can start with.
Reply With Quote
  #3  
Old 10-17-2011, 08:12 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

http://www.eqemulator.org/forums/showthread.php?t=33661
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 04:41 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