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 08-28-2006, 01:58 PM
jeffpuff
Fire Beetle
 
Join Date: Jul 2006
Posts: 20
Default PC input into quest

Is there a way I can use and item number spoken by a pc as the input for quest::summonitem() example:

Code:
sub EVENT_ITEM
{
   if ((itemcount, 99999 = 1))
    {
      quest:say("Very well, tell me the item you desire")
    }
      quest::summonitem(this is where I want the PC input));
    }
}
Jeff
Reply With Quote
  #2  
Old 08-29-2006, 11:36 AM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

Hmm. Interesting concept. You could try quest::summonitem($text); carefully nested inside an if(condition) since I believe "$text" holds the value of what you /say to the targetted NPC... Try it, let us know.
Reply With Quote
  #3  
Old 08-29-2006, 01:11 PM
ylosh
Sarnak
 
Join Date: Jan 2006
Posts: 39
Default

Code:
  sub EVENT_SAY {
    if($text=~/.*/i) {
  	quest::summonitem($text);
    }
  }
Reply With Quote
  #4  
Old 08-29-2006, 01:19 PM
jeffpuff
Fire Beetle
 
Join Date: Jul 2006
Posts: 20
Default Thank you

Awesome, thanks guys... will try it out after I get home from work.


Next question is can I lock this inside an item turn in? I only want the PC to be able to trigger this after they turn in an item.

Code:
sub EVENT_ITEM
{
   if ((itemcount, 99999 = 1))
    {
      quest:say("Very well, tell me the item you desire")
sub EVENT_SAY {
    if($text=~/.*/i) {
  	quest::summonitem($text);
    }
}
Would this lock away the EVEN_SAY behind the EVENT_ITEM, or is this wrong all together on having both sub events in there?
Reply With Quote
  #5  
Old 08-29-2006, 07:50 PM
ylosh
Sarnak
 
Join Date: Jan 2006
Posts: 39
Default

no, you can only have one event_say in the file.

you can set a temporary variable to have the npc summon the item when whatever key item is handed in..

Code:
sub EVENT_SPAWN {
  $variable = 0;
}

sub EVENT_SAY {
  if ($variable == 1) {
	if ($text=~/.*/i) {
	  quest::summonitem($text);
	  $variable = 0;
	}
  }
  elsif ($text=~/hail/i) { #all other dialogue
	quest::say("hello");
  }
  elsif ($text=~/something else/i) {
	quest::say("more dialogue");
  }
}

sub EVENT_ITEM {
  if (plugin::check_handin(\%itemcount, 1001 => 1)) {
	quest::say("blah blah give me an item id number");
	$variable = 1;
  }
  plugin::return_items(\%itemcount);
}
Reply With Quote
  #6  
Old 08-30-2006, 01:53 AM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

Quote:
Originally Posted by ylosh
Code:
sub EVENT_SAY {
    if($text=~/.*/i) {
  	quest::summonitem($text);
    }
  }
Holy crap. You mean I was right? Damn, I must have accidentally learned something.

Thx Ylosh!
Reply With Quote
  #7  
Old 08-30-2006, 03:37 PM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

Code:
  sub EVENT_SAY {
    if($text=~/[0-9]+/i) {
  	quest::summonitem($text);
    }
  }
would be more accurate, as quest::summonitem("joe") or quest::summonitem("Hail, Slut"), etx arnt all that meaningful
Reply With Quote
  #8  
Old 08-30-2006, 05:41 PM
ylosh
Sarnak
 
Join Date: Jan 2006
Posts: 39
Default

heh, thanks fnw..
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 09:39 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