PDA

View Full Version : Using Qglobals for Turn in


Maceblade
12-22-2013, 08:54 PM
Basically my objective is;
1. Turn in item, be assigned a qglobal with a value ie 1
2. NPC then, based on qglobal value, offers you a list of items via varlink
3. I would like for you to click on item, it summons it for you and deducts the value of your qglobal almost as in alternate currency. so setting you back to 0.

My question is, is this an efficient way to do this? If not what other alternatives do I have? Could I use radiant crystals instead and how would they deduct them? And is it possible to quest::summonitem based on the click of the varlink?

sub EVENT_SAY {

my $varlink = quest::saylink("Let me see a varlink, please.", 0, "varlink");
my $itemlink = quest::saylink("Let me see an itemlink, please.", 0, "itemlink");
my $artifact = quest::varlink(1119);
my $artifact1 = quest::varlink(1261);
my $artifact2 = quest::varlink(5532);
my $artifact3 = quest::varlink(8495);
my $NPCName = $npc->GetCleanName();

if ($text=~/Hail/i && $epic1 == undef)
{
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I can show you an Artifact using $varlink or $itemlink if you are interested in it.'");

}
if ($text =~/varlink/i && $qglobals{epic1 == 1})
{
$client->Message(315, "$NPCName whispers to you, 'Great job! To claim your reward say the number... $artifact (0), $artifact1 (1), $artifact2 (2), $artifact3 (3).'");}

if ($text =~/0/i && $epic1 == 1){

quest::summonitem(1119);
$client->SetGlobal("epic1", 0, 5, "F");}

if ($text =~/1/i && $epic1 == 1){
quest::summonitem(1261);
$client->SetGlobal("epic1", 0, 5, "F");
}
}
sub EVENT_ITEM {
#Handin: cipher of veeshan sets your qglobal for epic selection
if(plugin::check_handin(\%itemcount, 69311 => 1)){
quest::setglobal("epic1", 1, 5, "F");
quest::say("this worked");}
}

Its incomplete and does not function as intended bc of my qglobals. I was in the middle of tinkering with it when I decided to ask for help.

nenelan
12-23-2013, 10:43 AM
This can work, I've mocked up something in the past, but I think I'd have to dig it off of my old HD.

I think there actually may be a post around here with an example somewhere that someone else has done, but I CBA to look it up. But yeah, qglobal as a currency can work well. You could do radiants or ebons or LDoN points as well, end result should be similar, but with LDoN and Radiant/Ebon, you get that nice interface to work with rather than text in your chat box (which can be spammed, but can be worked around with popups).

Maceblade
12-23-2013, 04:21 PM
Thanks Nen :-) would you mind sharing a sample of how to give and take away from the globals?

nenelan
12-23-2013, 05:56 PM
I'll see what I can dig up when I get home in ~1hr or so. I can't promise anything, since that HD more or less kicked it, but I'll try to recover what I can.

Maceblade
12-23-2013, 05:59 PM
np bro if ya cant thats fine lol KingKrab got me up and running thanks man!

nenelan
12-23-2013, 07:35 PM
Perfect, glad he could. That thing ain't booting, and I don't have any old backups. Glad to hear it worked!