EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Adding qglobal point (https://www.eqemulator.org/forums/showthread.php?t=28945)

Randymarsh9 07-19-2009 04:34 PM

Adding qglobal point
 
I am just trying to make something where if a monster dies and that person's qglobals are in the right range, it will increase it by 1. I check to make sure the monster has qglobals set to 1. This quest doesn't seem to do anything as the value just stays the same

Code:

sub EVENT_KILLED_MERIT{
  if ($qglobals{mmed} >=3 && $qglobals{mmed}) <=6){
  quest::setglobal("mmed", $qglobals{mmed}+1, 5, "F");
  }
 }


joligario 07-19-2009 06:35 PM

Make sure the NPC being killed has qglobals enabled in the database.

Oh, and get rid of the extra close parenthesis.

Capheus 07-19-2009 09:51 PM

It might be having problems recalculating the new value when setting the global itself. I tested the script below in sub EVENT_SAY and it works fine. If it doesn't work in sub EVENT_KILLED_MERIT then there is something not working with that event. And as joligario said, make sure you have qglobals set to 1 on this NPC in the database.

Code:

sub EVENT_KILLED_MERIT {

  if (($qglobals{mmed}>=3) && ($qglobals{mmed}<=6)){
      $new = $qglobals{mmed}+1;
      quest::setglobal("mmed", $new, 5, "F");
  }

}



All times are GMT -4. The time now is 10:59 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.