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 03-10-2012, 04:11 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default Help Refunding

On Raid Addicts, the King npc would scribe peoples spells for 150,000 then I changed it to 15,000. Now i'm making it so they have to collect Guk Award Coins and hand those in for the spells instead.

What I am trying to figure out is how to refund the plat they have given the previous quest npc.

The quest globals were set as "spellspent" , then the value would be how much plat they gave it.

IE., (ID, CHARID, 0, 0, 'spellspent', '150000', NULL);

What would be the easiest way to refund their plat back to them?

Mort
Reply With Quote
  #2  
Old 03-10-2012, 07:46 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

write a script to let them hail a guy who reads the variable value and gives them that much plat. then the npc deletes the variable or sets it to 0 or something
Reply With Quote
  #3  
Old 03-11-2012, 02:53 AM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Yeah I don't know how to do it exactly. If you could show me would be appreciated.
Reply With Quote
  #4  
Old 03-11-2012, 03:09 AM
chrsschb's Avatar
chrsschb
Dragon
 
Join Date: Nov 2008
Location: GA
Posts: 904
Default

Roughly something like this?

Code:
sub EVENT_SAY
  {
  if($text=~/hail/i)
    {
    if(defined $qglobals{spellspent} == 150000)
      {
      quest::givecash(150000,0,0,0);
      quest::delglobal("spellspent");
      }
    else
      {
      plugin::Whisper("You've either already completed this refund script or you were never entitled to a refund");
      }
    }
  }
Reply With Quote
  #5  
Old 03-11-2012, 03:35 AM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Ok that's great, (and thank you for your reply) but what I mean is, say they have 150,000, or say they have 139,702....

I need it to be able to extract the amount, then refund them the same amount and delete the global afterward. That is the part I got stuck with seems pretty tricky to me.

Appreciate all your help in advance.
Morty
Reply With Quote
  #6  
Old 03-11-2012, 06:53 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Untested and assuming the amount is set in cp:

Code:
if (defined($qglobals{spellspent})) {
  $total = $qglobals{spellspent};

  $pp = int($total / 1000);
  $remainder = $total - $pp * 1000;

  $gp = int($remainder / 100);
  $remainder = $remainder % 100;

  $sp = int($remainder / 10);
  $remainder = $remainder % 10;

  $cp = $remainder;

  quest::givecash($cp, $sp, $gp, $pp);
}
Reply With Quote
  #7  
Old 03-11-2012, 03:12 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

This is what I have it setup as:

Quote:
sub EVENT_SAY
{

if($text=~/Refund/i)
{
if (defined($qglobals{spellspent})) {
$total = $qglobals{spellspent};

$pp = int($total / 1000);
$remainder = $total - $pp * 1000;

$gp = int($remainder / 100);
$remainder = $remainder % 100;

$sp = int($remainder / 10);
$remainder = $remainder % 10;

$cp = $remainder;

quest::givecash($cp, $sp, $gp, $pp);
}
}
}
Anyway the Test Char i used has "150,000" plat on his spellspent.. Said "Refund" and the npc gave him 150 plat.

So very close Once again thank you for your assistance, I'm not sure how to make it give the proper amount any ideas?
Reply With Quote
  #8  
Old 03-11-2012, 04:12 PM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 269
Default

The answer is right in front of you. He's converting the value from CP, except it's being stored in PP, so the conversion isn't necessary. This is not even a programming issue, it's just math and you've already been given the answers.

This exchange is reminiscent of how quite a few players seem to handle quests that have any form of subtlety or require some small degree of thought.
ZOMG, totally lost, HE DROPPED A BOOK! What do these words mean? "Feel the steely kiss of me blade", are we supposed to make out, what is the client command for smooching?!

Code:
quest::givecash(0, 0, 0, $total);
Reply With Quote
  #9  
Old 03-11-2012, 04:33 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Thank you, I'll admit I have never been that great with the PERL stuff.. My expertise lays in Content Creation and Spell Design and Class Balancing etc. Just got done creating just over 2,300 custom spells from levels 88-100. But yeah PERL stuff has always been something I just had a hard time with ..

Anyway the script works now and I greatly appreciate the help

Mort
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:05 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