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 05-28-2004, 11:03 AM
x-scythe
Discordant
 
Join Date: Jun 2003
Posts: 449
Default first quest...

Code:
sub EVENT_SAY
{
 if($text~=/Hail/i){quest::say("Why hello there $name! My name is
Triton. I used to be the most famed metal shaper in all the lands. 
That is, until I lost my [Blue Jade Shard].");}
 if($text~=/blue jade shard/i){quest::say("Yes, it created a powerfulsubstance which I added to everything I crafted. Without it...I ama doomed man...would you go and [retrieve] it for me? You would behighly rewarded of course.");}

 if($text~=/retrieve/i){quest::say("Really?! Well...let me tell you 
where it is then you can decide if you really want to go get it for me.
Let me tell you a [story].");}

 if($text~=/story/i){quest::emote("Triton takes a deep breath and 
begins his story");
 quest::say("A few weeks ago I was traveling in a vast cave that wasinhabited by kobolds, or so I thought it was. I was looking for a newtype of metal that may increase the strength of my armors even more.As I traveled deeper and deeper, I began to see a change in the texture of the cave. I didn't think anything of it at the time, until the cave suddenly expanded above my head and it appeared to have been carved out into a passageway. Me, being curious, traveled deeper still. Thats when I ran into the Fire Giants. I snuck past them and went deeper into the fire giant layer. Then I saw it, like nothing else I'd ever encountered. A fire dragon. I thought since I has hidden the dragon wouldn't be able to see me, boy was I wrong. It raised its wings and blew a huge fire ball in my direction, I was so scared I ran out of the cavern and by the time I was finally above ground again I realized I had left my blue jade shard behind the dragon where I was hiding. So, knowing you will have to get past giants and slay a dragon, are you still willing to go on this quest for me?");}
 
 if($text~=/yes/i)quest::say("Wow! Thank you! You will be GREATLY rewarded, this I promise you. The entrance to the cavern is in the Lavastorm Mountains on a narrow rock ledge on the side of a great crater filled with lava. Good luck!");}
}
sub EVENT_ITEM
{
 if($item1==xxxx){quest::say("WOW! THANK YOU! YOU'VE RETURNED IT TO ME! HERE IS THE REWARD I PROMISED YOU!");
 quest::summonitem(xxxx);
 quest::exp(1000);
}
aight thats it...i had some questions tho as to if i did things right, this is my first quest like the subject says so it might not be %100 great...

when you turn in an item to finish the quest is this the proper code?
Code:
{ if($item1==xxxx)
any input would be greatly appreciated

EDIT: forgot to mention i purposely left the item# as "xxxx" since i do not run a server of my own and the item does not exist hehe
Reply With Quote
  #2  
Old 05-28-2004, 11:25 AM
Dave987
Discordant
 
Join Date: Jun 2003
Location: England
Posts: 267
Default

It's better to use itemcount

Code:
 if ((itemcount{xxxx} == 2))
That makes it so that the item can be turned in with any slot , only really useful for multi-turn in items, if the quest is only with 1 item to and in, then if ($item 1) is fine.

Nice first quest, keep it up!
__________________
;o)
Reply With Quote
  #3  
Old 05-28-2004, 11:28 AM
x-scythe
Discordant
 
Join Date: Jun 2003
Posts: 449
Default

thanks for the input. i was wondering about the itemcount command but i wasnt sure how to use it
i do have one question about it tho...why does it use double parenthesis?
Reply With Quote
  #4  
Old 05-28-2004, 02:17 PM
animepimp
Dragon
 
Join Date: Jan 2004
Posts: 860
Default

The only problem I see with your quest is that some of the quest::says are way too long. Each one should be only one sentence, possibly two at most. They can cause problems if they are too long. Just break each one up into multiple quest::says and it will be a lot better. And for your question about parenthesis, it doesn't have to use double ones, thats probably just his coding style and in this case completely unnecessary.
Reply With Quote
  #5  
Old 05-28-2004, 04:35 PM
Swampdog
Hill Giant
 
Join Date: May 2004
Posts: 106
Default

Quote:
Originally Posted by animepimp
The only problem I see with your quest is that some of the quest::says are way too long. Each one should be only one sentence, possibly two at most. They can cause problems if they are too long. Just break each one up into multiple quest::says and it will be a lot better.
I don't necessarilly agree that they need to be one or two sentences, but agree it needs to be chunked out. You need to keep in mind there is a buffer for says. This seems to hold true with what NPCs say as well. Maybe one of the eqemu devs can comment on how long it can be. I've found that I can have around 5 or 6 lines of text in a single quest::say without the server bombing out with a buffer error. Probably best to keep it at 4 lines (by lines I'm talking about notepad open fullscreen on a 1024x768 monitor with wordwrap on..) Again, I wouldn't hold this as gospel, but my personal feeling is breaking it down by sentence takes away from the output... And again, that is only my personal preference.

I think you did good for your first quest.. Quickly skimming it, the large say was the only thing I noticed potentially wrong with it.
__________________
Kukthar
Discord Aftermath (alpha) LAN Party Server [Custom Legit] - Op/Dev
Temporarilly on hold due to time constraints
Damn rl interupting fun anyways.. :P
Reply With Quote
  #6  
Old 05-28-2004, 06:54 PM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

After all the parsing is done it looks like max chars would be 999.
Reply With Quote
  #7  
Old 05-28-2004, 08:33 PM
cofruben
Old-EQEmu Developer
 
Join Date: Oct 2002
Location: Spain
Posts: 323
Default

I think if($text~=/Hail/i){ should be if($text=~/Hail/i){,not sure but try it,it is =~,not ~=.
Reply With Quote
  #8  
Old 05-29-2004, 04:04 AM
Swampdog
Hill Giant
 
Join Date: May 2004
Posts: 106
Default

Ahh.. You are right cofruben.. I missed that. I keep meaning to throw a comment on the how-to for the perl quests. The one has a lot of them backwards like that in the examples. I made the same mistake with my first quests... :P
__________________
Kukthar
Discord Aftermath (alpha) LAN Party Server [Custom Legit] - Op/Dev
Temporarilly on hold due to time constraints
Damn rl interupting fun anyways.. :P
Reply With Quote
  #9  
Old 05-29-2004, 11:55 AM
x-scythe
Discordant
 
Join Date: Jun 2003
Posts: 449
Default

thanks for all the input. ill keep in mind to make the says shorter and change the ~= to =~
Reply With Quote
  #10  
Old 05-30-2004, 10:46 AM
Dave987
Discordant
 
Join Date: Jun 2003
Location: England
Posts: 267
Default

Quote:
Originally Posted by animepimp
And for your question about parenthesis, it doesn't have to use double ones, thats probably just his coding style and in this case completely unnecessary.
Yep , whenever I do a calculation , such as if ($itemcount{xx} == 2 ) && ($itemcount{xy} == 1) I always write it like:

Code:
((($itemcount{xx} == 2 )) && (($itemcount{xy} == 1)))
Just the way I write .
__________________
;o)
Reply With Quote
  #11  
Old 05-31-2004, 05:21 PM
Charmy
Discordant
 
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
Default

Code:
((($itemcount{xx} == 2 )) && (($itemcount{xy} == 1)))

You will notice if you use the parentesis like you have them you will actually see if you turn in item XX without item xy the quest will still execute becuase you have the item XX closing out before the && and it won't need to check, if you however only hand in xy it won't work without XX.

Code:
sub EVENT_ITEM
 {
   if(($itemcount{xx} && $itemcount{xy} ==1))
    {
      quest::say("Joly Good.");
     }
    }
this will make sure that both item XX and XY are turned in and only 1 of each is turned in. one thing that i have added to all my quests, (hopefully over on EQA we will get global scripts working sooner than later.) but in every script i write after any item turnin i always add.

Code:
sub EVENT_ITEM
 {
   if(($itemcount{xx} && $itemcount{xy} ==1))
    {
      quest::say("Joly Good.");
     }
    else
    {
      NoNeed();
     }
    }

sub NoNeed
 {
   quest::say("I don't need this item $name, you can have it back.");
   if($item1 != "" )
    {
      quest::summonitem($item1,0);
     }
 if($item2 != "" )
    {
      quest::summonitem($item2,0);
     }
 if($item3 != "" )
    {
      quest::summonitem($item3,0);
     }
 if($item4 != "" )
    {
      quest::summonitem($item4,0);
     }
    }
Note that the NoNeed sub is not in all my scripts, right now i just include the code in the else command, or if the mob doesn't take turn-ins for quests i just put it under the EVENT_ITEM sub, however as soon as our server starts working correctly with "gaggle" scripts then you can put the NoNeed sub in your "gaggle" script and then call it each time. anyway just wanted to add that.


Code:
 if($text~=/yes/i)quest::say("Wow! Thank you! You will be GREATLY rewarded, this I promise you. The entrance to the cavern is in the Lavastorm Mountains on a narrow rock ledge on the side of a great crater filled with lava. Good luck!");}
Missing Curly ended bracket after if($text=~/yes/i). won't compile so you should catch this upon trying to run it, but thats one thing i noticed. dunno if anyone else posted about it i am to tired to look. anyway. good luck with the quests =).
__________________
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
  #12  
Old 06-01-2004, 03:27 AM
Dave987
Discordant
 
Join Date: Jun 2003
Location: England
Posts: 267
Default

I like that NoNeed idea, and looking at the time I posted that, I was damn tired ... give me a break :(

Heh ... anywho ..
__________________
;o)
Reply With Quote
  #13  
Old 06-01-2004, 04:11 AM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

Quote:
Originally Posted by Charmy
Note that the NoNeed sub is not in all my scripts...
I have not tried this, but it seems like you would be able to put this elsewhere and call it. For example, in the default script:

Code:
sub NoNeed {
...
}
Then call it from another script:

Code:
else {
  qstdefault::NoNeed ();
}
Again, not tried it out, but seems like it could work.. takers?
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 02:07 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