Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-04-2004, 04:50 PM
sotonin
Demi-God
 
Join Date: May 2004
Posts: 1,177
Default Nice quest npcs?

Has anybody discovered a way to make questgivers more like live. As in if you hand in an item that is not in any way a quest item, it says no thanks i dont need that and hands it back to you?

Because i've noticed that you have to hand in ALL items for a quest at once, else the questgivers just keep your stuff. So it would be very cool to somehow stop them from eating items.
Reply With Quote
  #2  
Old 08-04-2004, 05:26 PM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

try
Code:
sub EVENT_ITEM{
if($itemcount{itemid} == 0 && $item1 > 0) {quest::say("I'm sorry, I don't need that item, $name. Here, you can have it back."); quest::summonitem("$item1");}
}
You'll need to expand it if you require multiple items for a turnin so that it returns all items in the turnin, obviously, but I've tested it and that does indeed work.
__________________
Xeldan
Lead Content Designer
Shards of Dalaya
Reply With Quote
  #3  
Old 08-04-2004, 05:35 PM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

expanded for convenience sake, enjoy:

Code:
sub EVENT_ITEM{
if($itemcount{itemid} == 0){
quest::say("I'm sorry, I don't need that item, $name. Here, you can have it back.");
if($item1 > 0){quest::summonitem("$item1");}
if($item2 > 0){quest::summonitem("$item2");}
if($item3 > 0){quest::summonitem("$item3");}
if($item4 > 0){quest::summonitem("$item4");}}
}
Just add as many $itemcount checks as you have items for the quest.
__________________
Xeldan
Lead Content Designer
Shards of Dalaya
Reply With Quote
  #4  
Old 08-04-2004, 11:02 PM
Charmy
Discordant
 
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
Default

In all my quests i add similar code like that to a seperate sub, that way if the mob is involved in quests, you can use the effect several times without having to retype it.

e.g
Code:
sub EVENT_ITEM
 {
   if($itemcount {xx} && $itemcount {xxxx} == 1)
     {
       quest::say("Thanks for the stuff i needed $name.");
      }
      else
       {
         NoNeed();
        }
      if($itemcount {xx} && $itemcount {xxxx} == 1)
       {
         quest::say('thanks for this name);
        }
        else
         {
           NoNeed();
          }
         }

sub NoNeed
 {
   if($item1 != "")
    {
      quest::summonitem($item1,0);
     }
   if($item2 != "")
    {
      quest::summonitem($item2,0);
     }
   if($item3 != "")
    {
      quest::summonitem($item3,0);
     }
   if($item4 != "")
    {
      quest::summonitem($item4,0);
     }
   if($platnium != 0 || $gold != 0 || $silver != 0 || $copper != 0)
     {
       quest::givecash($platnium, $gold,$silver,$copper);
    }
You Could also just make the second if an elsif, that way you only need one call of the NoNeed. but this was just a simple example.
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
Reply With Quote
  #5  
Old 08-04-2004, 11:25 PM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

Hmm, charges set to 0 still summons an item? Or did you just put 0 there as an example?
__________________
Xeldan
Lead Content Designer
Shards of Dalaya
Reply With Quote
  #6  
Old 08-05-2004, 02:24 AM
cofruben
Old-EQEmu Developer
 
Join Date: Oct 2002
Location: Spain
Posts: 323
Default

sub EVENT_ITEM
{
if($item1==30){ quest::say("thanks"); }
else if($item1==23){ quest::say("thanks"); }
else if($item1==55){ quest::say("thanks"); }
else { quest::say("sorry i dont need this"); quest::summonitem($itemid); }
}
for example
Reply With Quote
  #7  
Old 08-05-2004, 02:33 AM
sotonin
Demi-God
 
Join Date: May 2004
Posts: 1,177
Default

hmmm interesting.

here's the problem though. I want the npc to
A) return item to player if they only hand in a single item from a multi-item turn in.
B) return any non-quest related item handed to him

here's what i have going so far, lemme know if i screwed anything up. I was thinking if there was some way to make a temporary variable. i could set a variable to true or 1 or whatever if any of the successful item turn in's are used. (item1 2 and 3 for quest are turned in, so set variable to true.) then below all the checks, do a if variable != true say "i dont need this, blah blah" and return all items in all 4 slots to the player.

Code:
sub EVENT_ITEM {
	if($item1 > 0 || $item2 > 0 || $item3 > 0 || $item4 > 0){
		if($itemcount{19001} == 1 && $itemcount{19002} == 1 && $itemcount{16507} == 1){
			quest::say("Wear this with pride!");
			quest::summonitem("4921");
		}
		if($itemcount{19003} == 1 && $itemcount{19004} == 1 && $itemcount{19047} == 1){
			quest::say("Wear this with pride!");
			quest::summonitem("4922");
		}
		if($itemcount{19005} == 1 && $itemcount{19006} == 1 && $itemcount{19048} == 1){
			quest::say("Wear this with pride!");
			quest::summonitem("4923");
		}
		if($itemcount{19007} == 1 && $itemcount{19008} == 1 && $itemcount{19049} == 1){
			quest::say("Wear this with pride!");
			quest::summonitem("4924");
		}
	}
}
i don't know exact perl syntax for this but here's my best complete guess

Code:
sub EVENT_ITEM {
	if($item1 > 0 || $item2 > 0 || $item3 > 0 || $item4 > 0){
		if($itemcount{19001} == 1 && $itemcount{19002} == 1 && $itemcount{16507} == 1){
			quest::say("Wear this with pride!");
			quest::summonitem("4921");
			$var1=true;
		}
		if($itemcount{19003} == 1 && $itemcount{19004} == 1 && $itemcount{19047} == 1){
			quest::say("Wear this with pride!");
			quest::summonitem("4922");
			$var1=true;
		}
		if($itemcount{19005} == 1 && $itemcount{19006} == 1 && $itemcount{19048} == 1){
			quest::say("Wear this with pride!");
			quest::summonitem("4923");
			$var1=true;
		}
		if($itemcount{19007} == 1 && $itemcount{19008} == 1 && $itemcount{19049} == 1){
			quest::say("Wear this with pride!");
			quest::summonitem("4924");
			$var1=true;
		}
		if ($var1!='true'){
			if($item1 > 0){
				quest::say("I don't need this.");
				quest::summonitem("$item1");
			}
			if($item2 > 0){
				quest::say("I don't need this.");
				quest::summonitem("$item2");
			}
			if($item3 > 0){
				quest::say("I don't need this.");
				quest::summonitem("$item3");
			}
			if($item4 > 0){
				quest::say("I don't need this.");
				quest::summonitem("$item4");
			}
		}
	}
}
Reply With Quote
  #8  
Old 08-05-2004, 02:48 AM
sotonin
Demi-God
 
Join Date: May 2004
Posts: 1,177
Default

ya, i think i'm stupid.

i shortened it i think. )

Any glaring problems with this?

Code:
sub EVENT_ITEM {
	if($itemcount{19001} == 1 && $itemcount{19002} == 1 && $itemcount{16507} == 1){
		quest::say("Wear this with pride!");
		quest::summonitem("4921");
	} else 
	if($itemcount{19003} == 1 && $itemcount{19004} == 1 && $itemcount{19047} == 1){
		quest::say("Wear this with pride!");
		quest::summonitem("4922");
	} else 
	if($itemcount{19005} == 1 && $itemcount{19006} == 1 && $itemcount{19048} == 1){
		quest::say("Wear this with pride!");
		quest::summonitem("4923");
	} else 
	if($itemcount{19007} == 1 && $itemcount{19008} == 1 && $itemcount{19049} == 1){
		quest::say("Wear this with pride!");
		quest::summonitem("4924");
	} else {
		quest::say("I don't need this...");
		if($item1 > 0){quest::summonitem("$item1");} 
		if($item2 > 0){quest::summonitem("$item2");} 
		if($item3 > 0){quest::summonitem("$item3");} 
		if($item4 > 0){quest::summonitem("$item4");}
	}
}
Reply With Quote
  #9  
Old 08-05-2004, 12:43 PM
sotonin
Demi-God
 
Join Date: May 2004
Posts: 1,177
Default

Welp. i found a biggy wrong with it. Seems cofruben's little example wasnt proper perl syntax. i changed it and it started working )

Code:
sub EVENT_ITEM {
	if($itemcount{19001} == 1 && $itemcount{19002} == 1 && $itemcount{16507} == 1){
		quest::say("Wear this with pride!");
		quest::summonitem("4921");
	} elsif($itemcount{19003} == 1 && $itemcount{19004} == 1 && $itemcount{19047} == 1){
		quest::say("Wear this with pride!");
		quest::summonitem("4922");
	} elsif($itemcount{19005} == 1 && $itemcount{19006} == 1 && $itemcount{19048} == 1){
		quest::say("Wear this with pride!");
		quest::summonitem("4923");
	} elsif($itemcount{19007} == 1 && $itemcount{19008} == 1 && $itemcount{19049} == 1){
		quest::say("Wear this with pride!");
		quest::summonitem("4924");
	} else {
		quest::say("I don't need this.");
		if($item1 > 0){quest::summonitem("$item1");} 
		if($item2 > 0){quest::summonitem("$item2");} 
		if($item3 > 0){quest::summonitem("$item3");} 
		if($item4 > 0){quest::summonitem("$item4");}
	}
}
The } elseif portion is what was screwing up before when it was }else if {
Reply With Quote
  #10  
Old 08-05-2004, 12:45 PM
Charmy
Discordant
 
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
Default

elseif isn't part of perl, its elsif, you will get complie errors if you use elseif.
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
Reply With Quote
  #11  
Old 08-05-2004, 12:46 PM
sotonin
Demi-God
 
Join Date: May 2004
Posts: 1,177
Default

oops sorry didnt read close enough.

yep typo on last part for me. code has it right though elsif
Reply With Quote
  #12  
Old 08-05-2004, 04:18 PM
animepimp
Dragon
 
Join Date: Jan 2004
Posts: 860
Default

Code:
if($item1 > 0){quest::summonitem("$item1");} 
if($item2 > 0){quest::summonitem("$item2");} 
if($item3 > 0){quest::summonitem("$item3");} 
if($item4 > 0){quest::summonitem("$item4");}
This part is wrong. You need to remove the quotes in the method calls, like quest::summonitem($item4); Or it will try to find "$item4" in a Db instead of the number stored in item4.
Reply With Quote
  #13  
Old 08-05-2004, 05:25 PM
sotonin
Demi-God
 
Join Date: May 2004
Posts: 1,177
Default

well it seems to work fine.... i use ""'s on all of my summonitems and they put the item on your cursor.

isn't that how summonitem is supposed to work? I tested all the quests and they all use quotes.
Reply With Quote
  #14  
Old 08-06-2004, 03:23 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Quote:
Originally Posted by sotonin
well it seems to work fine.... i use ""'s on all of my summonitems and they put the item on your cursor.

isn't that how summonitem is supposed to work? I tested all the quests and they all use quotes.
I always do quest::summonitem(0000); and it puts it on the cursor fine. If it doesnt there's a problem with the code above it.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote
  #15  
Old 08-06-2004, 03:40 AM
sotonin
Demi-God
 
Join Date: May 2004
Posts: 1,177
Default

aye. i use quest::summonitem("00000");

it puts the item on my cursor as well. So i guess animepimp is wrong about this syntax being wrong. =)
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 01:30 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