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 01-17-2010, 09:41 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default anyone know if this works

quest::collectitems(item_id, remove)

it wont collect the item on my server heres what i use

Code:
sub EVENT_SAY { 

if($text=~/Hail/i) {
	
         quest::say("What kind Of Credit's Are you Trying to claim [1 ldon] Credit or [10 Ldon] Credits"); }
 

if($text=~/1/i)  { 
   quest::say("Heres your credits");   
   quest::collectitems(2434, remove);
   quest::addldonpoints(1,2); }


if($text=~/10/i)  {    
   quest::collectitems(2435, remove);
   quest::addldonpoints(10,2); }
}
Reply With Quote
  #2  
Old 01-17-2010, 09:51 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default

on my code i changed the remove to a 0 and it still doesnt work
Reply With Quote
  #3  
Old 01-17-2010, 10:35 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I think you are supposed to use it like this:

Code:
quest::collectitems(2434, 1);
Where the second argument should be 1 or 0 for true or false on whether to remove the item or not. I think you setting that to 0 was meaning not to remove it, so you should try setting it to 1. I haven't really messed with it much.

Instead, you might want to try this:

Code:
$client->NukeItem(2434);
You should read through the Quest Tutorial here a bit more thoroughly too:

http://www.eqemulator.net/wiki/wikka...=QuestTutorial

Especially this section:
Quote:
Text Response
All speaking responses are included in a $text variable:
if ($text=~/Hail/i)
Note the /i. This means it is case insensitive. It is always better to include this.

$text =~/Hello/ - Would match "Hello", but not "hello".
$text =~/hello/ - Would match "hello", but not "Hello".
$text =~/hello/i - Would match "Hello" and "hello".
$text =~/me/ - Would match the "me" in name.
$text =~/\bme\b/ - Would not match the "me" in name. The "\b" means there must not be text next to the match so "me" must be by itself.
$text =~/^me$/i - Would only match if me is the only text said. The "^" tells it it must be the first thing said and the "$" tells it it must be the last thing.
The reason I mention that is because your posted script here has them check for the word "1" for one result and "10" for another result. But, "1" exists within the "10", so if you said 1, you would get both responses. To avoid that, you might want to change those to be "/\b1\b/" and "/\b10\b/".
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 01-17-2010, 10:40 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default

kk ill fix that but atm i got it so they take the item and give one credit but if i have 2 of the items it takes both and still only 1 credit
Reply With Quote
  #5  
Old 01-18-2010, 12:45 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

I think you're looking for this, I had this on my server...

The syntax you'll notice has for example $coinages * 10 or 100 or etc, that is the item * whatever value you want it to hold when you want it to return into how many LDON points it returns back to you.

Code:
sub EVENT_SAY
{
   my $coinages = quest::collectitems(1381,0);
   my $coinages1 = quest::collectitems(1384,0);
   my $coinages2 = quest::collectitems(1385,0);
   my $link1 = quest::saylink("exchange", 1);
   my $link2 = quest::saylink("Tokens of Reborn", 1);
   my $link3 = quest::saylink("Small Tokens", 1);
   my $link4 = quest::saylink("Dark Tokens", 1);
   my $link5 = quest::saylink("Dark Tokens of Rebirth", 1);
      if($text=~/hail/i)
            {
            quest::say("Hello $name! are you here to [$link1] your [$link2] for points?.");
            }
      if($text=~/Tokens of Reborn/i)
            {
            quest::say("Yes, there are many ways to find the Dark Tokens, they are scattered out in the lands");
            }
		if($text=~/exchange/i)
            {
            quest::say("Yes, I can exchange [$link3], [$link4], and [$link5].");
            }	
			
      if($text=~/Dark Tokens of Rebirth/i && $coinages > 0) ####DARK TOKENS OF REBIRTH####

				{
               quest::collectitems(1381,1);
               quest::addldonpoints($coinages * 100,2);
               quest::say("$coinages Dark Tokens of Rebirth? Very well, I have embedded Mir in your soul.");
				}
				elsif($text=~/Dark Tokens of Rebirth/i && $coinages < 1)
				{
				quest::say("Are you trying to cheat me you ridiculous $race? You don't have any Tokens!");
				}
		if($text=~/Small Tokens/i && $coinages1 > 0)  ####SMALL TOKENS####
				{
               quest::collectitems(1384,1);
               quest::addldonpoints($coinages1 * 1,2);
               quest::say("$coinages1 Small Tokens? Very well, I have embedded Mir in your soul.");
			  
				}
					elsif($text=~/Small Tokens/i && $coinages1 < 1)
						{
						quest::say("Are you trying to cheat me you ridiculous $race? You don't have any Tokens!");
						}
		if($text=~/Dark Tokens/i && $coinages2 > 0) ####DARK TOKENS####
				{
               quest::collectitems(1385,1);
               quest::addldonpoints($coinages2 * 10,2);
               quest::say("$coinages2 Dark Tokens? Very well, I have embedded Mir in your soul.");
				}
      elsif($text=~/Dark Tokens/i && $coinages2 < 1)
        {
        quest::say("Are you trying to cheat me you ridiculous $race? You don't have any Tokens!");
        }
      }

sub EVENT_ITEM
{		my $numcoins = $itemcount{1381};
		my $numcoins1 = $itemcount{1384};
		my $numcoins2 = $itemcount{1385};
		  my $link1 = quest::saylink("exchange", 1);
         if ($numcoins > 0)
            {
               quest::summonitem(1381,$numcoins);
               quest::say("Well I appreciate the tokens, but why don't you try saying [$link1] to me instead.");
            }
			if ($numcoins1 > 0)
            {
               quest::summonitem(1384,$numcoins1);
               quest::say("Well I appreciate the tokens, but why don't you try saying [$link1] to me instead.");
            }
			if ($numcoins2 > 0)
            {
               quest::summonitem(1385,$numcoins2);
               quest::say("Well I appreciate the tokens, but why don't you try saying [$link1] to me instead.");
            }
				 
				  }
I apologize for how some of my code is structured it's a little sloppy in some areas, that should help!
Reply With Quote
  #6  
Old 01-18-2010, 01:27 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default

thank you so very much akkadius was exactly what i neede
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 11:42 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