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
  #1  
Old 11-26-2012, 08:52 AM
Gaflack
Fire Beetle
 
Join Date: Oct 2010
Posts: 18
Default check_hasitem issue or just bad Perl Code

The below quest works but has issues.

Quest purpose: give info on updated a item and then take items and update.

The quest works fine taking turn-ins and giving the updated item. The issue is checking to see which item the person has so the NPC responds with proper instuctions.

It works fine if the person has the 1st-3rd updated item, if they have the 4th udated item or higher it bugs the client so bad you have to kill it (mouse functions die etc).

So to many calls to "check_hasitem"?


Code:
###############################################
# NPC:  Ivy
# Zone:  POK
# Quest: Charm Upgrade
###############################################

sub EVENT_SAY { 

  if($text=~/hail/i && plugin::check_hasitem($client, 132535)) {
   quest::say("Hail, $name! Bring me your old charm and a Aviak Charm and I will upgrade your Charm");
  }
 elsif($text=~/hail/i && plugin::check_hasitem($client, 132538)) {
   quest::say("Hail, $name! Bring me your old charm and a Shadow Boot from the Evil Tower and I will upgrade your Charm");
}
 elsif($text=~/hail/i && plugin::check_hasitem($client, 132539)) {
   quest::say("Hail, $name! Bring me your old charm and a Growler Canine and I will upgrade your Charm");
 }
 elsif($text=~/hail/i && plugin::check_hasitem($client, 132540)) {
   quest::say("Hail, $name! Bring me your old charm and a Knights Eye from Sebilis and I will upgrade your Charm");
 }
 elsif($text=~/hail/i && plugin::check_hasitem($client, 132541)) {
   quest::say("Hail, $name! Bring me your old charm and a Spiders Eye from the Velks Icy World and I will upgrade your Charm");
 }
 elsif($text=~/hail/i && plugin::check_hasitem($client, 132542)) {
   quest::say("Hail, $name! Bring me your old charm and a Gem of the Void from 4 Arms and I will upgrade your Charm");
 }
 elsif($text=~/hail/i && plugin::check_hasitem($client, 132543)) {
   quest::say("Hail, $name! Bring me your old charm and a Bugs Eye from Soldiers in the Grove and I will upgrade your Charm");
}
 elsif($text=~/hail/i && plugin::check_hasitem($client, 132544)) {
   quest::say("Hail, $name! Bring me your old charm and a Western Waste Wyrm Eye and I will upgrade your Charm");
 }
 elsif($text=~/hail/i && plugin::check_hasitem($client, 132545)) {
   quest::say("Hail, $name! Bring me your old charm and a Undead Eye from the Umbral Skeletons and I will upgrade your Charm");
 }
 elsif($text=~/hail/i && plugin::check_hasitem($client, 132546)) {
   quest::say("Hail, $name! Bring me your old charm and a Valor Eye form those Cave Mobs in Valor and I will upgrade your Charm");
 }
}

sub EVENT_ITEM {
  if(plugin::check_handin(\%itemcount, 132535 => 1, 13737 => 1)) { #Happy's Charm Aviak Char
    quest::say("Very good!");
    quest::summonitem(132538); #Happy's Silver
  }
  elsif(plugin::check_handin(\%itemcount, 132538 => 1, 29220 => 1)) { #Happy's Silver Shadow Boots
    quest::say("Very Very good!");
    quest::summonitem(132539); #Happy's Gold
  }
  elsif(plugin::check_handin(\%itemcount, 132539 => 1, 12977 => 1)) { #Happy's Gold Growler Tooth
    quest::say("Ecellent!");
    quest::summonitem(132540); #Happy's Electrum
  }
  elsif(plugin::check_handin(\%itemcount, 132540 => 1, 132548 => 1)) { #Happy's Electrum Knights Eye
    quest::say("Happy Days!");
    quest::summonitem(132541); #Happy's Platinum
  }
  elsif(plugin::check_handin(\%itemcount, 132541 => 1, 132549 => 1)) { #Happy's Platinum Spiders Eye
    quest::say("Wonderfull!");
    quest::summonitem(132542); #Happy's Velium
  }
  elsif(plugin::check_handin(\%itemcount, 132542 => 1, 9053 => 1)) { #Happy's Velium Gem of the Void
    quest::say("Perfect!");
    quest::summonitem(132543); #Happy's Clear
  }
  elsif(plugin::check_handin(\%itemcount, 132543 => 1, 132550 => 1)) { #Happy's Clear Bug Eye
    quest::say("Fantanstic!");
    quest::summonitem(132544); #Happy's Jade
  }
  elsif(plugin::check_handin(\%itemcount, 132544 => 1, 132551 => 1)) { #Happy's Jade Wyrm Eye
    quest::say("Too Cool!");
    quest::summonitem(132545); #Happy's Opal
  }
  elsif(plugin::check_handin(\%itemcount, 132545 => 1, 132552 => 1)) { #Happy's Opal Undead Eye
    quest::say("Almost Done!");
    quest::summonitem(132546); #Happy's Ruby
  }
  elsif(plugin::check_handin(\%itemcount, 132546 => 1, 132553 => 1)) { #Happy's Ruby Valor Eye
    quest::say("Finished!");
    quest::summonitem(132547); #Happy's Diamond
  }
  
  else {
    #Return items if incorrect
    plugin::return_items(\%itemcount);
  }
}
#END of FILE
Thanks for any input,

Gaf
Reply With Quote
 


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 02:59 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