The best and easiest way to do this is via quest globals. First, you will need to set the NPC porter to have the qglobal setting by changing it in the NPC_Types table from 0 to 1 in the qglobal column. You can also use GeorgeS latest NPC Loot Editor tool to make this change. You will need to restart the zone for the changes to take effect.
Once that is set, all you need to do is put the qglobals in your quest. They work by adding a "flag" to the qglobal table for that character. There are a few options to setting these, but it is actually pretty simple once you get the hang of it.
Basically, you would want to do this:
Code:
sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 1212=>1)) {
quest::say("Oh the heat! I am feeling better already!");
$client->Message(6, "Rizon Char stores the scroll away within his armor." );
quest::exp(9999999);
$client->Message(15, "You have received a flag to access Solusek Ro's Tower!");
quest::setglobal("solroaccess", 1, 5, "F");
}
else {
plugin::return_items(\%itemcount);
quest::say ("I have no use for this item, $name.");
}
{
$solroaccess=undef;
}
}
Then, you can do the same thing as they progress by changing just the item turn in and the flag received and only need to adjust the 1 number in bold here:
Code:
quest::setglobal("solroaccess", 2, 5, "F");
This will overwrite the previous entry by setting the flag to 2. If you look at your qglobals table, you can figure out how this works pretty easily once you start using it. Basically, you can make up any name you want and it will put that name in the qglobals table. The next number is the value of the qglobal and is the most important part to change if you want to up flags. After that the number (which I have set to 5) is an option to tell the server who will recognize this global. Using 5 is the most common, because that sets it so all NPCs in all zones can see this flag for this one character. You can also set it so just the one NPC recognizes it, or many other options by changing that number. More info on that can be found in the quest wiki page. The last setting there (set to "F") describes how long the global lasts for. Setting it to F makes it last forever. You can also specify M, H, D, Y for minute, hour, day, or year and then set a number like this; "M10" would make it last for 10 minutes and then remove the flag. Most of the time, you would want to just set that to F.
To check for the flag for porting, you would want to use something similar to the following:
Code:
sub EVENT_SAY
{
if ($text =~/Hail/i && $solroaccess == undef) {
quest::say ("The Proving Grounds are a place to test your skill limits. If you are interested, I can tell you [more] about it."); }
if ($text =~/Hail/i && $solroaccess == 1) {
quest::say ("You have access to the [first] boss. I will send you and your group there whenever you like.");
$solroaccess=undef; }
if ($text =~/First/i && $solroaccess >= 1) {
quest::say ("For the first few, you will likely find little difficulty, but beware of the tougher ones!");
$client->Message(6, "Kez Sollar stomps on the ground and the tremors rumble you to the core sending your body out of phase and to another place.");
quest::movegrp(304, 0,0,0);
quest::movepc(304, 0,0,0);
$solroaccess=undef; }
if ($text =~/Hail/i && $solroaccess == 2) {
quest::say ("You have access to the [first] and [second] bosses. I will send you and your group there whenever you like.");
$solroaccess=undef; }
if ($text =~/second/i && $solroaccess >= 2) {
quest::say ("For the first few, you will likely find little difficulty, but beware of the tougher ones!");
$client->Message(6, "Kez Sollar stomps on the ground and the tremors rumble you to the core sending your body out of phase and to another place.");
quest::movegrp(305, 0,0,0);
quest::movepc(305, 0,0,0);
$solroaccess=undef; }
if ($text =~/Hail/i && $solroaccess == 3) {
quest::say ("You have access to the [first], [second] and [third] bosses. I will send you and your group there whenever you like.");
$solroaccess=undef; }
}
That should give you a pretty good idea on how to use qglobals. These are all just examples from a quest I have on my server. I edited the quest slightly for posting here (some from solrotower and some from MPG), but they should have all of the important information you need to understand qglobals. You don't need to use the movegrp option. I just added that to move the player and the group at the same time so only 1 person needs the flag in the group to get in.