View Single Post
  #1  
Old 03-17-2008, 04:30 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Lost Love (Timers, Signals, Proximity, Quest Globals and Follow)

This quest is called "Lost Love" and the description of the quest sounds very simple, but it actually took some thinking to get everything to work perfectly.

Quest Outline:
A Human named Marvin has lost his wife, a Human named Serra, somewhere in the Estate of Unrest.

Little does Marvin know that his wife was killed and came back as a Zombie due to the magical properties of Unrest.

Marvin will hint that Serra is in the underwater cave in Unrest.

When Undead Serra is found, she tells the player to go back to Marvin and tell him that they found her.

Once told, Marvin will follow the player back to Undead Serra.

Upon arrival, Marvin freaks out not knowing that the Zombie they brought him to is his Undead Wife.

Marvin gives the player an unlimited invis to undead potion and runs away in fright and suggests that the player do the same.

A few seconds after Marvin runs away, Undead Serra tells the player she is still in need of their help.

When hailed this time, Undead Serra tells the player of a possible cure that was discovered by a Gnome named Khrix.

Undead Serra hints that Krix isn't very brave so he is probably hiding in a corner (he is in a closet) somewhere in the Estate itself.

Undead Serra asks that the player find the cure and bring it back to her.

The player finds Khrix and kills him, because he isn't willing to share his cure and is pretty aggressive about it.

The player returns the cure (Gnomish Potion of Regeneration) to Undead Serra.

Upon drinking the cure potion, Undead Serra despawns and instantly respawns as a Human Female version of herself.

The freshly cured Serra then says she is going back to Marvin and walks back towards him and despawns.

The End

The quest has 4 NPCs involved, and 3 items. It would be easy to customize to anyone's liking for any zone with any NPCs and any rewards.

I have verified that all parts of this quest are working as intended. It took quite a bit of work to perfect it as I haven't used some of these systems before.

Onto the quests (4 quests in 2 posts due to length):

Undead Serra's Quest:
Code:
#############
#Quest Name: Lost Love (Undead_Serra Portion)
#Author: Trevius of Storm Haven
#NPC's Involved: Undead_Serra, Marvin, Serra, Khrix
#Items Involved: Potion of Unlimited Invisibily, Potion of Infinite Invis to Undead, Gnomish Potion of Regeneration
#############
###NPC 1
#Name: Undead_Serra
#Race 70 (Zombie), Texture 0, Size 5, gender 1, body type 3
#Location: -283, 688, 2.6 of the Estate of Unrest (In the underwater Cave)
#level: 25
#Type: Quest NPC
#Loot: N/A
#############
###Item 1
#Name: Potion of Unlimited Invisibily
#Item ID: 2420 (Custom Made Item)
#Stats: MAGIC, LORE, NO DROP, click effect Invisibility, maxcharges -1, cast time 1 second
#Attained From: Undead_Serra rewards this when she is given the cure (Gnomish Potion of Regeneration)
#############
###Item 2
#Name: Potion of Infinite Invis to Undead
#Item ID: 2421 (Custom Made Item)
#Stats: MAGIC, LORE, NO DROP, click effect Invis vs undead, maxcharges -1, cast time 1 second
#Attained From: Undead_Serra rewards this when Marvin is brought to her, but it appears like Marvin gave it to you
#############
###Item 3
#Name: Gnomish Potion of Regeneration
#Item ID: 2831 (Custom Made Item)
#Stats: MAGIC, LORE, NO DROP
#Attained From: Killing and looting Khrix
#############

#Set a small proximity when spawned for use later on in the quest
sub EVENT_SPAWN {

my $x;
my $y;
my $z;
my $h;

$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
$h = $npc->GetHeading();

    quest::set_proximity( $x-8,$x+8,$y-8,$y+8,$z-8,$z+8);

}


#If player with global find_serra 2 enters the proximity, reward them and signal Marvin to run away
sub EVENT_ENTER {

  if ($find_serra == 2) {
    quest::say("There you are, my love!");
    quest::summonitem(2421);
    quest::exp(4500);
    quest::setglobal("find_serra", 3, 5, "F");
    quest::signalwith(2700412,1,2); }

    {
    $find_serra=undef;
    }

}


sub EVENT_SAY {

  if ($text=~/Hail/i && $find_serra == undef) {
    quest::say("H..h..hello? Can you help me? I have been killed...err hurt badly and I know that my [Marvin] must be worried sick about me."); }

#Set global find_serra to 1 so Marvin will have a new response when hailed
  if ($text=~/marvin/i && $find_serra == undef) {
    quest::say("Marvin is my husband, and I have been lost for quite a while now.  If you see him, let him know that you found me.");
    quest::setglobal("find_serra", 1, 5, "F"); }

#Reminder response if person forgets what they are supposed to be doing
  if ($text=~/Hail/i && $find_serra == 1) {
    quest::say("Find my husband and bring him to me, please."); }

#This response should never be seen, but added it just in case
  if ($text=~/Hail/i && $find_serra == 2) {
    quest::say("Find my husband and bring him to me, please."); }

#These are the responses after Marvin is brought to Serra and runs away
  if ($text=~/Hail/i && $find_serra == 3) {
    quest::say("I can't believe he didn't even recognize me.  Am I really that disgusting now?  Maybe there is a [cure]."); }

  if ($text=~/cure/i && $find_serra == 3) {
    quest::say("I have heard rumors that a gnome named [Khrix] has discovered a way to bring the undead back to life and restore them to their prior selves."); }

  if ($text=~/khrix/i && $find_serra == 3) {
    quest::say("Last I heard, Khrix was planning to run some experiments in the Estate itself.  But he isn't the brave type, so he is probably cowering in a corner somewhere right about now.  If you find the cure, please bring it to me."); }

#This is a generic response after all quests are completed
  if ($text=~/Hail/i && $find_serra == 4) {
    quest::say("Thank you!"); }

    {
    $find_serra=undef;
    }
   
}


#After Marvin runs away, he sends this signal so Serra can tell the player there is more to do
sub EVENT_SIGNAL {

  if ($signal == 2) {
    quest::settimer("serra_say",5); }

}


#Serra says she needs more help a few seconds after Marvin leaves so they know to hail her again
sub EVENT_TIMER {

  if ($timer eq "serra_say") {
    quest::stoptimer("serra_say");
    quest::say ("Oh no!  Please don't leave yet. I am going to need more help for sure!"); }

}


#When the cure is given, Undead_Serra despawns the Zombie version of herself and respawns a human version
sub EVENT_ITEM {

#Give quest reward, set global to find_serra 4 so all quests are completed, and spawn Human Serra on a grid to walk back to Marvin
  if (plugin::check_handin(\%itemcount, 2831 => 1)) {
    quest::say("Oh! you found it!");
    quest::emote("drinks the potion.");
    quest::exp(4500);
    quest::setglobal("find_serra", 4, 5, "F");
    quest::summonitem(2420);
    quest::spawn2(2700414,36,0,-283,688,2.6,136.5);
    quest::depop(); }
 
  else {
    plugin::return_items(\%itemcount);
       }
 
    {
    $find_serra=undef;
    }
   
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 03-18-2008 at 12:33 AM..
Reply With Quote