Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2017, 10:59 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Several ways, varying in complexity and/or "work".

1. Likely the easiest unless you want to go at the source to add a new export, is:
Code:
sub EVENT_ENTERZONE {
    my @noncombatzones = ("freeportn", "runnyeye", "nexus");
    if ($zonesn ~~ @noncombatzones) {
          ## do nothing
    } else {
          ## do something
    }
}
Or some variance of the above. I chose non-combat zones in case there are fewer of them than combat zones.

2. Read from the DB using DBI (though this would of course create a potential for many calls to the DB):

Code:
sub readcombat {
    my $read_zone = $_[0];
    $connect = plugin::MySQL_Connect();
    $query = "
        SELECT `cancombat`
        FROM zone
        WHERE `short_name` = ? LIMIT 1
    ";
    $qh = $connect->prepare($query);
    $qh->execute($read_zone);
    while (@row = $qh->fetchrow_array()){
        return $row[0];
    }
    return;
}

return 1;
Tossing the above in either an existing plugin file or creating its own. Using it:

Code:
sub EVENT_ENTERZONE {
    if (plugin::readcombat($zonesn)) {
       ## do this when combat is 1 (aka true)
    } else {
       ## do this when combat is 0 (aka false)
    }
}
3. Edit the source to add an LUA/Perl export and, I've been away again too long from C++ to do this on the spot and I wasn't nearly as proficient at it as some others (Akka, Kingly, demon, hell any of the dev team)

So there's a start I hope.
Reply With Quote
  #2  
Old 08-16-2017, 01:53 AM
The_Beast's Avatar
The_Beast
Discordant
 
Join Date: May 2016
Location: Under a rock
Posts: 290
Default

Quote:
Originally Posted by ghanja View Post
Several ways, varying in complexity and/or "work".

1. Likely the easiest unless you want to go at the source to add a new export, is:
Code:
sub EVENT_ENTERZONE {
    my @noncombatzones = ("freeportn", "runnyeye", "nexus");
    if ($zonesn ~~ @noncombatzones) {
          ## do nothing
    } else {
          ## do something
    }
}
Or some variance of the above. I chose non-combat zones in case there are fewer of them than combat zones.
Wow, thank you so much. This number 1. looks like an easy work, if it can work. There is definately not many
non-combat zones. Just the regular common ones, GH, GL, PoK, Nexus, etc., so this would make it more simplified.
I will check it tomorrow and let you know
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

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


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3