Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2009, 04:06 PM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 506
Default Very simple task system quest

I know there's an awesome quest wiki walkthrough, but I wrote this to streamline the quest NPC process for simple Kill X things and report back tasks. He also gives SoW once task is completed.

First for DB entries:
#Step 1: Find Latest Task ID handed out.
SELECT * FROM tasks ORDER BY id DESC LIMIT 1;
#take ID value and increment it by 1, for this example I will use the value 666. Startzone can be found in your EQEmuServer/common/ZoneNumbers.h if you have source. I use 118 for my zonenumber.

#Step 2: Insert new task, title.
insert into tasks (id, duration, title, description, reward, rewardid, cashreward, xpreward, rewardmethod, startzone, minlevel, maxlevel, repeatable) VALUES(666, 0, 'Snow Orc Hunt!', '', 'Experience', 0, 0, 0, 2, 118, 0, 0, 0);

#Step 3: Add activities.
#Step 3.1: Make kill X things activity entry.
insert into activities (taskid, activityid, step, activitytype, text1, goalcount, zoneid, goalid, goalmethod ) VALUES(666, 0, 0, 2, "Snow Orcs", 20, 118, 666, 1);

#Step 3.2: Make return to NPC activity entry.
insert into activities (taskid, activityid, step, activitytype, text1, goalcount, zoneid) VALUES(666, 1, 1, 4, "Bob Barker", 1, 118 );

#Now you notice I added a goalid of 666, and goalmethod of 1. This is to populate a list of potential goal ID's in the goallist that reward the task. You can use this syntax to add goals:

#Step 4: Add goallists. entry is the NPCTypeID. So e.g. change 118018 to your npcid, you can list as many as needed here. These are the NPC's that trigger the quest counters.
INSERT INTO goallists (listid, entry) VALUES (666, 118018 ), (666, 118019), (666, 118020), (666, 118021);

Then you write the quest dialog, found in the <emuroot>\quests\zone\NPC_NAME.pl file.

Code:
#Put the ItemID/NPC name of your NPC here.
sub EVENT_SAY {
    $tmptask = 666; # Change #tmptask accordingly.
    if ($text=~/hail/i)
    {
        if (quest::istaskcompleted($tmptask) > 0)
        { #Completed Task Already.
            quest::say("Feel free to ask for [blessings] from me now that you have helped me.");
        }
        elsif ($text=~/hail/i && quest::istaskactivityactive($tmptask,1))
        { #Killed Tasks..
            quest::say("Well done, my friend. Here is the reward as I noted. Feel free to ask for [blessings].");
            quest::exp(123456); #give EXP.
            quest::updatetaskactivity($tmptask,1); #finish task.
        }
        elsif ($text=~/hail/i && quest::istaskactive($tmptask))
        { #Reminder Dialog about active task
            quest::say("These snow orcs need to die. Care to help me with this? Kill 20 and I'll be satisfied.");
        }
        else
        { #Initial task assignment.
            quest::say("Hi $name. These snow orcs need to die. Care to help me with this? Kill 20 and I'll be satisfied.");
            quest::assigntask($tmptask);
        }
    }
    elsif($text=~/bless/i)
    {
        if (!quest::istaskcompleted($tmptask))
        { #If task isn't done, reject request.
            quest::say("First deem yourself worthy for blessings, and I'll consider it.");
        }
        elsif ($ulevel < 40)
        { #if they are lower than lvl 40, buff them with Sow.
            quest::say("Take this blessing from me.");
            $npc->CastSpell(278,$userid, 10, 0, 0);
        }
        else
        { #Otherwise, tell them too high.
            quest::say("You seem too powerful to need my blessings anymore, $name");
        }
    }

}
That's it. All I didn't cover was adding a new NPC, but if you're adding tasks I assume you should understand that.
__________________

~Shin Noir
DungeonEQ.com
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 04:37 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