PDA

View Full Version : NPC ignores me!


Aldest
03-02-2009, 10:13 AM
I'm trying to design my first quest and running into trouble. My NPC basically turns to face you when you hail her but doesn't give the quest responses. Other NPCs in the same zone work just fine. Felicia just seems to be mute or rude.

Here is my quest:
sub EVENT_SAY {
if ($text=~/hail/i) {
quest::say ("Greetings young $race. If you have a [minute] I have something very important to ask you.");
}

if ($text=~/minute/i) {
quest::say ("I'm glad you had the time to speak to me as I'm certain you'll find this worth your while. It is fair to say I am not exactly from these lands but I know much about them. There is a great danger coming and I'm here to avert it. I cannot do it alone. Would you be willing to help me?");
}

if ($text=~/help you/i) {
quest::say ("Time is of the essence. I'm not sure how much longer we have left. To ensure this crisis does not occur I need you to seek out some items for me. Tell me, what is your profession?");
}

if ($text=~/cleric/i) {
quest:: say ("A cleric? How fortunate. I will need a Platinum Token from a lord who sits on a throne that is not his, a Royal Fang from a king that rules in the shadow of a lord, and a Tainted Flail from clerics who serve a dark god. Bring them to me and I will reward you.");
}
}

sub EVENT_ITEM
{
if (plugin::check_handin(\%itemcount, 16905 => 1, 16857 => 1, 10035 => 1))
{
quest::emote("removes a item from his pocket.");
quest::say("This is yours. Care for it well!");
quest::summonitem(10051); #gemmed crown
}
}

Can anyone spot something wrong with that?

Dibalamin
03-02-2009, 05:25 PM
Possible faction discrepency?

Syntax for the text part looks ok...

Aldest
03-02-2009, 05:34 PM
I tried setting her faction to the same faction as the npc that works but I will try it again.

One other thing.

I created the mob in the database and got one id.

When I did #npcspawn create it gave me a new id.

I deleted the "has quest" and reset it because I assumed it referenced the old id. Could that be it?

trevius
03-02-2009, 05:44 PM
Not sure what you mean by deleting the "has quest". When you spawn the NPC and use "#npcspawn create", it will create a new NPC that is a copy of that one. Really, the create option is for creating new NPCs that you spawned via the #spawn command to set their ID and save them in the zone. When you are just wanting to add a copy of a certain spawn ID to a zone, you should use "#npcspawn add" instead.

How are you naming the quest file? You can name them after the spawn ID or after the NPC name. The easiest way is just to name the files after the name of the NPC. If you use GeorgeS' quest editor, it will do them automatically and make sure they match up properly.

Also, after you create a new NPC, you will have to restart the zone (normally just zoning out and back in if you run dynamic zones) before the quest will be able to take effect. Also, you have to use #reloadquest in the zone before new quest changes take effect.

Let us know if you still have problems after trying some of this.

Derision
03-02-2009, 05:48 PM
If I save the quest as you posted it as test.pl and execute it from a command prompt, I get this:


syntax error at test.pl line 15, near "quest:: say "
Execution of test.pl aborted due to compilation errors.


Line 15 is:


quest:: say


There is a space between quest:: and say which is causing the syntax error.

Aldest
03-03-2009, 03:50 PM
I am using GeorgeS' quest editor to edit the quests so the name is the same as the NPCs. Thank you for the advice on the difference between create and add. I'll use add from now on.

Great catch on the syntax. I'll get back to you guys on whether or not it works shortly.

I appreciate the help!

Aldest
03-05-2009, 08:44 AM
It was the space! The quest works just fine now other than the fact she'll only take the three required items in the exact order they're given.

I'll work on making that not matter next.