EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Quest Globals Question. (https://www.eqemulator.org/forums/showthread.php?t=36210)

kmra247 01-04-2013 04:50 PM

Quest Globals Question.
 
All right, I have a question about quest globals, if I wanted it to be an account global would it be like below?:

Code:

quest::setglobal(SpellReset$actd, 0, 5, "F");

joligario 01-04-2013 05:14 PM

Check at the bottom of http://www.eqemulator.net/wiki/wikka...=QuestTutorial

5 = this player (aka character)

If you have extra code to get acct id, I'm sure you could get it to work.

kmra247 01-04-2013 05:33 PM

So if I have this below I should be able to do it, 5 = NPC and Zone all.

Code:

my $actd = $client->AccountName();

c0ncrete 01-04-2013 07:12 PM

almost. you're not concatenating your string correctly in your first example.

you want something like this for the varname field of the qglobal:

Code:

#interpolation
my $aName = $client->AccountName();
my $qGlobal = "SpellReset$aName";

or

Code:

# concatenation
my $qGlobal = "SpellReset" . $client->AccountName();

you don't have to save the varname first. you could do it all in a single line like this:

Code:

quest::setglobal('SpellReset'.$client->AccountName(), 0, 5, 'F');
it's a style choice, really... but you likely want to save it if you intend to use it more than once for the same client in the script.

Akkadius 01-04-2013 07:36 PM

Quote:

Originally Posted by c0ncrete (Post 215954)
almost. you're not concatenating your string correctly in your first example.
Code:

quest::setglobal('SpellReset'.$client->AccountName(), 0, 5, 'F');
it's a style choice, really... but you likely want to save it if you intend to use it more than once for the same client in the script.

It is a style choice, however if you can get in the habit of doing it like the above, you will be better off.


All times are GMT -4. The time now is 01:48 PM.

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