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 06-22-2008, 05:14 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default y is this not working return item

Code:
sub EVENT_ITEM
{
if (plugin::check_handin(\%itemcount, 1389 => 1) && $epic15 == 3)
{
quest::say("Good report to Sergeant Zind and see if he needs any help. Here you hang onto the jewel for safekeeping.");
quest::summonitem("1389"); 
quest::setglobal("epic15", 4, 5, "F");
}
else
{
quest::say ("Hang on to this");
plugin::return_items(\%itemcount);
}
}
it should take an item with id 1389 if you have the quest and give it back and if you don't have the quest give it back say he don't need it and if you already done the quest give it back then if you give him an item he don't need he should give it back.

i have tried it 4 diff ways he takes the item if you have the quest and gives it back if you give him the wrong item he gives it back but if you give him the quest item and you have already don't the quest or are not at this point yet he will not give it back.

with the way it is above he don't even say anything just takes the item if you don't have the quest.

whats up?
Reply With Quote
  #2  
Old 06-22-2008, 05:28 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

i got it

Code:
sub EVENT_ITEM
{
if (plugin::check_handin(\%itemcount, 1389 => 1))
{
if($epic15 == 3)
{
quest::say("Good report to Sergeant Zind and see if he needs any help. Here you hang onto the jewel for safekeeping.");
quest::summonitem("1389"); 
quest::setglobal("epic15", 4, 5, "F");
}
elsif($epic15 != 3)
{
quest::say ("Hang on to this, till its needed again");
quest::summonitem("1389");
}
}
else
{
quest::say ("Hang on to this");
plugin::return_items(\%itemcount);
}
}
Reply With Quote
  #3  
Old 06-22-2008, 06:04 PM
xxarthurxx
Hill Giant
 
Join Date: Jun 2006
Location: San Jo, Cali
Posts: 180
Default

Nice, i was about to reply but you fixed it yourself before i could get it posted
__________________
Tinimus Minimus Da Captain - Warrior of MMOs
Lead Admin and Server Op of Da Pirate's Cove, a Custom Classic Legit Progression Server
Reply With Quote
  #4  
Old 06-22-2008, 06:06 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Perhaps a better way to write that would be the following:

Code:
sub EVENT_ITEM {

  if (plugin::check_handin(\%itemcount, 1389 => 1)) {

    if (defined($qglobals{epic15})) {

      if($qglobals{epic15} == 3) {

        quest::say("Good report to Sergeant Zind and see if he needs any help. Here you hang onto the jewel for safekeeping.");
        plugin::return_items(\%itemcount); 
        quest::setglobal("epic15",4,5,"F"); }

      else {
        quest::say ("Hang on to this, till its needed once again.");
        plugin::return_items(\%itemcount); }

    }

    else {
      quest::say ("Hang on to this, till its needed once again.");
      plugin::return_items(\%itemcount); }

  }

  else {
    quest::say ("I have no use for this item, $name.");
    plugin::return_items(\%itemcount); }

}
This will first check if the player turned in the correct item. If not, it will return it. Then, it checks if the player has the quest global defined at all (if they have even started the quest line) and if not, it returns the item but tells them to hang on to it. Finally, it checks if the player has the 3 value for the global and if not, it returns the item and tells them to hang onto it.

I haven't tested this, but I think it should work. You might have to adjust it slightly to get it working in case I missed something. But, this should probably be the best way to do it. The only part I am not sure about is all of the elses for returning items. You might not need all of them. I have had issues in the past where it will do all of the elses for some reason, when I think it should really only be doing 1 of them. You can tell if that is happening easily by testing to see if you get multiple return messages. If that happens, you should be able to just remove some of the quest::say's in the else returns.

I also wanted to mention that I changed the format so that it is easier to read. It is hard to tell what is going on when all of the brackets are on the left side and all of the lines are lined up as well.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
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 04:04 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3