Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 01-22-2013, 09:39 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default shared script example

this way, when you change one, the the other is changed.

additional customizations included and commented.

guildlobby\A_Priest_of_Luclin.pl
Code:
# get current working directory from full path to script
# note: linux users may be able to use relative path
( my $cwd = $0 ) =~ s/(?:(?!\\)\S)+$//;

# execute other script
do "${cwd}A_Priestess_of_Luclin.pl";
guildlobby\A_Priestess_of_Luclin.pl
Code:
sub EVENT_SAY {

    # only respond to hail (not technically accurate)
    return unless $text =~ /hail/i;

    # response
    quest::emote( "continues to chant towards the altar as you approach. 'If y"
          . "ou are in need of our aid, speak to the disciple and bring me one"
          . " of the soulstones that he sells. I must continue to delve into t"
          . "he twilight of our world in search of lost souls.'" );

}

sub EVENT_ITEM {

    # aww...
    my $no_help =
        "A focus powerful enough to assist someone of your stature has not yet"
      . " been discovered.";

    # yeah, right!
    my $under_powered =
        "This focus is not powerful enough to summon the remnants of your form"
      . "er self. The Disciples of Luclin can help you select an appropriate f"
      . "ocus.";

    # wtf, srsly?!
    my $wasted_time =
        "thrusts the soulstone back at you with a cold stare. 'Do not waste my"
      . " time, $race! Leave me to my work!'";

    # valid soulstone item ids and the maximum level they are effective
    my $soulstone = {
        76013 => 20,    # Minor Soulstone
        76014 => 30,    # Lesser Soulstone
        76015 => 40,    # Soulstone
        76016 => 50,    # Greater Soulstone
        76017 => 55,    # Faceted Soulstone
        76018 => 70,    # Pristine Soulstone
        76019 => 75,    # Glowing Soulstone
        76048 => 80,    # Primstic Soulstone
        76065 => 85,    # Iridescent Soulstone
        76274 => 90,    # Phantasmal Soulstone
        76275 => 95     # Luminous Soulstone
    };

    # don't check items if client is over level 95
    if ( $ulevel > 95 ) {
        quest::say($no_help);
    }

    # check items
    else {

        # iterate over items that were handed in
        foreach $itemID ( keys %itemcount ) {

            # skip items that do not have entries in soulstone hashref
            next unless $itemID and defined $soulstone->{$itemID};

            # verify current soulstone will work for client's level
            # note: over-powered soulstones WILL work
            my $max_level = $soulstone->{$itemID};
            unless ( $ulevel <= $max_level ) {
                quest::say($under_powered);
                next;
            }

            # don't use soulstone if client has no corpses
            if ( $client->GetCorpseCount() < 1 ) {
                quest::emote($wasted_time);
                last;
            }

            # consume first appropriate soulstone found and summon corpses
            if ( plugin::check_handin( \%itemcount, $itemID => 1 ) ) {
                SummonCorpses();
                last;
            }
        }

    }

    # vary item return text, based on the number of items to be returned
    # note: do not count soulstones as we've already sent text for those
    if ( my $quantity = grep { $_ && !$soulstone->{$_} } keys %itemcount ) {
        quest::say( sprintf "I do not need th%s.",
            $quantity > 1 ? "ese" : "is" );
    }

    # return unused items
    plugin::return_items( \%itemcount );

}

# does what it says on the tin
sub SummonCorpses {

    my $x = $client->GetX();
    my $y = $client->GetY();
    my $z = $client->GetZ();

    # spooky flavor
    quest::emote( "takes your stone and places it on the altar.  Shadows begin"
          . " to drift across the floor and over the altar and finally onto th"
          . "e soulstone.  The priest's voice chants with intensity and is soo"
          . "n joined with several others as the shadows slowly coalesce into "
          . "a wispy mass that feels familiar.  The two candles near the altar"
          . " explode with light and there, before you, appears all that remai"
          . "ns of your former life." );

    quest::summonallplayercorpses( $client->CharacterID(), $x, $y, $z, 0 );

}
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #2  
Old 01-22-2013, 11:01 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

small tweak

change this
Code:
    # don't check items if client is over level 95
    if ( $ulevel > 95 ) {
        quest::say($no_help);
    }
to this
Code:
   # don't check items if client is over level 95 and has turned in a soulstone
    if ( $ulevel > 95 && grep { $soulstone->{$_} } keys %itemcount ) {
        quest::say($no_help);
    }
that way, the client will only get the $no_help message if he/she is over level 95 and has turned in a soulstone.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #3  
Old 01-22-2013, 11:07 AM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 270
Default

In linux you can just make symbolic link.

Code:
ln -s A_Priest_of_Luclin.pl A_Priestess_of_Luclin.pl
I gather this can be done in newer versions of windows also, but I've never had to mess with it.
http://en.wikipedia.org/wiki/NTFS_symbolic_link
Reply With Quote
  #4  
Old 01-22-2013, 11:11 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

good point. that makes things even more efficient.

thanks for the feedback.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #5  
Old 01-22-2013, 11:32 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

this should be a platform-independent match so things should work without worrying about symlinks, junctions, etc (i'm working with xp here...)

Code:
( my $cwd = $0 ) =~ s/(?:(?!\\|/)\S)+$//;
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #6  
Old 01-22-2013, 01:49 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Or you can put the script in the default.pl and make some checks that look for either NPC name to load the appropriate script.
Reply With Quote
  #7  
Old 01-22-2013, 05:05 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i'm having issues today... :|

forgot to escape something in the updated regex

Code:
( my $cwd = $0 ) =~ s/(?:(?!\\|\/)\S)+$//;
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
Reply


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 05:25 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3