EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   New and need a little help with a quest. (https://www.eqemulator.org/forums/showthread.php?t=36001)

Mylz17 11-16-2012 02:34 AM

New and need a little help with a quest.
 
Hi all. First off, I just want to say THANK YOU for everything. This site, the wiki, and all the work put into this project is amazing. I have learned so much, and have been able to do a lot on my own using the wealth of information that is available.

I'm reaching out for some help here. Maybe it's too late and I just can't find what I am looking for. Anyway, I am working on making a simple quest/task. I have already created the task in the tasks and activities tables of my database and now I need to implement the task into the game, but I don't want the task to just show up on a hail, I want it to only start when an item is handed in, and most importantly, given back to the player.

So basically its...
Hail NPC.
NPC responds that they won't speak with you unless you hand in a item.
Hand in item.
NPC returns item.
Task pops up.

Can someone please point me in the right direction? Also, is there a tool that simplifies creating tasks, because editing the task and activity tables to create a new task (and hopefully those are the only 2) was painful. I can only imagine making 1 error and having to go back to figure out what it was!

Thanks.

Dunge0nMastr 11-16-2012 02:52 AM

its pretty easy to do that.

You would want to use sub EVENT ITEM for the item handin, and a sub event say for the hail part:

so it would look something liek this:

Code:

sub EVENT_SAY {
if ($text =~/hail/i) {
        quest::say("Sorry $name i wont talk to you unless you have something for me");
        }
}

sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, XXXX => 1)) { #checks item, XXXX = item_id, and the => points to the # of items, so => 2, would be two of the items etc
        quest::summonitem(xxxx); #item id that was turned in, to return, i think you can use plugin::return_items(\%itemcount) as well
        quest::assigntask(xx); #task id goes in XX
        }
}

As far as programs for task editing, i know there are a few out there, PEQ Editor will allow you to create tasks, and there also a program called TaskMaster that i used, i know its buried around here on the forums thats worth checking, worked well for me.

Mylz17 11-16-2012 03:15 AM

Thank you!!! I was kinda-sorta on my way to figuring it out, at least the fact that I just needed to summonitem back to the player, other than that, I was lost.

THANK YOU! This was one big hurdle for me, I'm still all very new to this. Now I can get to writing more tasks.

Dunge0nMastr 11-16-2012 03:18 AM

my pleasure :P something that really helped me along was just looking at quests in the Quest folder that i was familiar with how they worked in game, and basically just starting working backwards for things. Its relatively simple once you get a good grasp of things :P

c0ncrete 11-16-2012 12:14 PM

check_handin() will delete required items from the %itemcount hash when it finds them (but only if it finds all of the items listed). so yes, you'll need to use summonitem() to get the turned in item(s) back to the client.

Dunge0nMastr 11-16-2012 01:02 PM

ah thanks i had never bothered testing that and was wondering if my way was redundant or not. good to know im not 100% crazy :)


All times are GMT -4. The time now is 07:53 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.