PDA

View Full Version : Help creating "quest"


herold
03-30-2007, 05:17 AM
I want to make a newbie "quest" for my server and, after looking over the Quest Tutorial (http://www.eqemulator.net/wiki/wikka.php?wakka=QuestTutorial), I decided that I have no hope of doing it myself ... so I am hoping that someone here will assist me.

I need a NPC to

1. React to a hail with "Greetings friend and welcome to the world of Norrath. Are [you interested in some gear] to help you get started?"
2. Respond to "i am interested in some gear" with something like "Here you go my friend. Now please don't loose these precious items, as I will not assist you any further." - and two items and a flag that denies the player from doing the quest again (items can be any 2 items, I can change the ID's later on)
3. If possible, the reaction to a player using the phrase "i am interested in some gear", should be something like "You again. - I told you not to ask me for any further assistance. I cannot help you, now go away."

Kind regards
herold

Slayden
03-30-2007, 05:40 AM
I'm going to take a swing at this, though I'm still rather new & trying to teach myself how to write quests and etc. If someone more experienced than I could correct me, please do.


sub EVENT_SAY {
if ($text~= /Hail/) { quest::say("Greetings friend and welcome to the world of Norrath. Are [you interested in some gear] to help you get started?"); }
if($text=~/i am interested in some gear/i){
quest::say("Here you go my friend. Now please don't loose these precious items, as I will not assist you any further.");
quest::summonitem(#####);}
}
quest::summonitem(#####);}
}


(Replace the ##### with the item numbers of your choice)
I don't know yet (if possible) how to flag a character for non-repeat.
I hope this helps.

herold
03-30-2007, 06:08 AM
It looks right, but as I have no coding experience, I may not be the one to say.

With regards to the flag, I dont know if it is actually possible ... If it is not, can it be added to the script, that you can only do the quest if you are at lvl 1 and not above? I would prefer the flag though.

Angelox
03-30-2007, 06:45 AM
It looks right, but as I have no coding experience, I may not be the one to say.

With regards to the flag, I dont know if it is actually possible ... If it is not, can it be added to the script, that you can only do the quest if you are at lvl 1 and not above? I would prefer the flag though.
There's a few ways to flag - I like to use quest_globals. Do you have my quest pack? if so, look in tutorialb quests - there are a few examples there that are similar to what you want, and use quest globals.
If not you can find it (quests) at a link on my web page.

herold
03-30-2007, 08:51 AM
I checked the TutB quest folder and found Vahlara.pl file ... it contained something interesting ...

if (($text=~/hail/i)&&(${$name}!=2)){
quest::delglobal("$name");
quest::setglobal("$name",2,3,"F");
$name=undef;
quest::summonitem(59943);
quest::say("I have something that might save you from the same fate. Take this kobold charm. May it bring you good luck, $name.");
}

That code has something to do with flags, yes?

>>EDIT<<

I tried modifying the script and this is what I came up with, so far ...

sub EVENT_SAY{
if (($text=~/hail/i)&&(${$name}==2)){
quest::say("Greetings friend and welcome to the world of Norrath. Are [you interested in some gear] to help you get started?");
}

if (($text=~/i am interested in some gear/i)&&(${$name}!=2)){
quest::delglobal("$name");
quest::setglobal("$name",2,0,"F");
$name=undef;
quest::summonitem(xxxxx);
quest::summonitem(xxxxx);
quest::say("Here you go, $name. Now please don't loose these precious items, as I will not assist you any further.");
}

I know it isn't complete yet, still need the code in case someone tries a second time (if it is possible) and I have absolutely no diea if the code is even near correct ... but, I am confused about a small number of things:

1. line 2 - the number "2" ???
2. line 6 - the number "2" again ???
3. line 7 - all of it ... why "delglobal" ???
4. line 8 - the number "2" here defines "value" = "this/all/this" and the number "0" defines "options" = "this/this/this" and it should only pertain to that NPC for that PLAYER in that ZONE ?!?
I changed to the number "0" from a "3". The "F" defines "duration" and I set this to "F" as it should last forever.

Any further advice and/or corrections? As I don't imagine this script is complete ...