Thread: Help Refunding
View Single Post
  #3  
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