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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 11-12-2012, 03:32 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

it's got to be an issue with the definition of the arrays or iterating over the elements, but i don't completely follow why it would be problematic. the following script gets to the end of the file and prints PASSED (even with the original regexp patterns):

Code:
use strict;
no strict 'vars';
use warnings;

# matches named and generic gloomingdeep kobolds
my $kobolds = '(?=^(#([bopt]|s(e|l[ai]|p))|(a_)?gloomi))';
# matches named and generic gloom/fang spiders (not queen)
my $spiders = '(?=^(#v|a_gloom[_f]))';
# matches named and generic rats
my $rats    = '(?=^(#r[au]|a_(cave|diseased)_r))';

sub EVENT_SAY
{
    if ( !$npc || $npc->GetOwnerID() || $npc->GetSwarmOwner() ) {
        return;
    }
    if ( $text =~ /hail/i ) {
        quest::say("Shh! I think I hear the kobolds...");
    }
}

sub EVENT_ITEM
{
   if ( !$npc || $npc->GetOwnerID() || $npc->GetSwarmOwner() ) {
      plugin::GivePetItems();
      return;
   }
   plugin::return_items(\%itemcount);
}

sub EVENT_COMBAT
{
    if ( $combat_state ) {
        if ( $mname =~ /$kobolds/i ) {
            quest::emote("brandishes razor sharp claws and circles inward.");
        }
        elsif ( $mname =~ /$spiders/i ) {
            quest::emote("scuttles forward to attack.");
        }
        elsif ( $mname =~ /#queen/i ) {
            quest::emote("brandishes razor sharp fangs and attacks!");
        }
        elsif ( $mname =~ /$rats/i ) {
            quest::emote("races forward to attack.");
        }
    }
}

sub EVENT_DEATH
{
    if ( $mname =~ /$kobolds/i ) {
        quest::emote("unleashes a lupine yelp as it collapses on the floor.");
    }
    elsif ( $mname =~ /$spiders/i ) {
        quest::emote("collapses in a heap of broken legs.");
    }
    elsif ( $mname =~ /#queen/i ) {
        quest::emote("'s corpse unleashes a chittering keen as it falls backward.");
    }
    elsif ( $mname =~ /$rats/i ) {
        quest::emote("'s corpse stops moving.");
    }
}

print "PASSED\n";
i'll be testing in-game to make sure it works as expected.
Reply With Quote
 

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 09:19 AM.


 

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