I spawned a Scarecrow in PoK who hands out neat little rings with the spell Illusion: Scarecrow for a halloween event. He requests three items dropped from scarecrows in W. Karana and in return gives the ring as a reward. Even has the script to port players straight to the hunting grounds.
I think it's a little clunky, but it functions just right. I submit it for your review (and possible corrections to make it flow better).
Code:
sub EVENT_SAY
{
if($text=~/hail/i)
{
quest::say("BOO! Did I scare you? No? Oh, well, maybe you would have better [luck] if you looked like a [scarecrow] too.");
}
if($text=~/luck/i)
{
quest::say("Oh? You think you can do better? Then I challenge you to a scare-off! Wait a minute... you don't look scary at all. This won't do. You'll need a [costume] if you have any hope of beating me.");
}
if($text=~/costume/i)
{
quest::say("Well, I shouldn't help the competition, but I'm feeling generous. If you can [find] some hay as a base, a jack-o-lantern fungus for the essence, and a lock of scarecrow straw to hold it all together I can help you get dressed up all scary like!");
}
if($text=~/scarecrow/i)
{
quest::say("What's a scarecrow? Why I'm a scarecrow! Well, not really, I'm just dressed like one. Really I'm... an ogre!") ;
}
if($text=~/find/i)
{
quest::say("A good place to look would be the Miller's farm in West Karana. They're always overrun with scarecrows this time of year and usually have some spare hay laying around the place. I can [send] you straight there if you want.");
}
if($text=~/send/i)
{
quest::movepc(12, -5813,-2808,0);
}
}
sub EVENT_ITEM
{
if (plugin::check_handin(\%itemcount, 13990 => 1, 27411 => 1, 22122 => 1))
{
quest::emote("fashions the items into a costume and begins chanting a spell...but it explodes!");
quest::say("Oops! Not what I was going for... but you can have it anyway.");
quest::summonitem("1382"); #scary costume ring
}
else {
quest::say("What would I want with this?");
plugin::return_items(\%itemcount);
}
}
# PoK Halloween Event NPCID:202483
For the new admins who want to use this just do the following.
(1) Create an item (mask, ring, anything) with clicky effect Illusion: Scarecrow (spell ID 6107 by PEQ default). Write down the item ID!
(2) Copy the above code and save it in your quests\zonename folder as Halloween_Man.pl ... also replace the item ID with the one you created.
(3) Go in game and use the following commands to create the NPC:
>> #spawn Halloween_Man 82 70 1 15000 2 1 0 0 0 (NPC pops up)
>> #npcspawn create (after targeting new NPC)
(4) If done correctly everything should work. May require a server restart to function properly. So far the illusion works in all zones I've visited so I assume it's global.