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 02-14-2015, 12:20 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,604
Default

Here's a re-written version of Ghanja's script that uses a hash instead to make it simpler, rather than several conditional based assignments:
Code:
sub EVENT_SAY {
    if ($text=~/Hail/i) {
        plugin::Whisper("Oh.. it's you.  Yeah, so I've been demoted from the Priest of all things Evil to an item butler. Do you want a " . quest::saylink("bag", 1) . " to put your junk in or do you want your " . quest::saylink("items, 1") . " now?");
    } elsif ($text=~/bag/i) {
        quest::summonitem(17969);
    } elsif ($text=~/items/i) {
        my %hash = ("Warrior" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Cleric" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Paladin" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Ranger" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Shadowknight" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Druid" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Monk" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Bard" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Rogue" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Shaman" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Necromancer" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Wizard" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Magician" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Enchanter" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Beastlord" => [1, 2, 3, 4, 5, 6, 7, 8, 9],
        "Berserker" => [1, 2, 3, 4, 5, 6, 7, 8, 9]);
        foreach my $item (@{$hash{$class}}) {
            if (!plugin::check_hasitem($client, $item)) {
                quest::summonitem($item);
            }
        }
    }
}
Reply With Quote
  #2  
Old 02-14-2015, 02:28 AM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by Kingly_Krab View Post
Here's a re-written version of Ghanja's script that uses a hash instead to make it simpler, rather than several conditional based assignments:
I've been optimized.

I did state I would have used a hash, however, simpler to whom? Not sure if the layman's approach is a hash. But hey, options are good.
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 07:12 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