Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2011, 08:44 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

You should explain why you want to do it.

In regards to task reloadall from perl, I can't think of any reason why you would want that. If you have a valid reason then Im sure somebody will help you but if its not then you will most likely be pointed in the direction you should be going.
Reply With Quote
  #2  
Old 11-01-2011, 06:02 PM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default

I've got a SQL stored procedure that takes the PCs level, and then randomly chooses a NPC_ID from the spawn_entry table near the PCs level so a quest can be assigned to kill this random creature. Well, what I need is a way of determining when the PC actually kills this randomly assigned MOB so that when they return I can reward them. (I can put the npc_type id in a qglobal, but I still have no way of knowing when or whether they killed the monster.) So I know the task system can identify when a MOB dies, so as a part of getting the quest I used SQL to dynamically create a new task (with all the appropriate activities etc.) that can be assigned to the PC (it is actually another stored procedure but that is irrelevant). Problem is that the running server does not recognize the newly created task...unless/until I use the gm command #task reloadall; then the Perl code can just do a #quest::assigntask(@taskID[0]); and it works just fine.

So I need to either:
A) Somehow track a kill--sorta like the task system does--when the PC kills a randomly assigned MOB somehow flag that
OR
B) Once the task is dynamically created with the sproc, do a GM "#task reloadall" in the Perl script so that I can just quest::assigntask the task
Reply With Quote
  #3  
Old 11-01-2011, 08:08 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

The biggest flaw in your idea(imo) is that you are going to be creating hundreds of tasks automatically, even more if you do this on a popular server and the task is repeatable. If you had this capability, you would probably use it again, then you have thousands of tasks that are only ever used once, unless the code also checks each task to see if the target matches the random mob.

I doubt that would affect anything besides the load time on taskmaster however its pretty sloppy design and could lead to performance issues.

If I was going to do this I would set a global for the NPCType and then add a sub EVENT_DEATH check for the global in the default.pl in templates, if the global matches the player and zone then updatetaskactivity. This is not an ideal solution as it won't work for mobs with scripts that have a death event and its still pretty sloppy imo. It would also require a custom perl command as you would need to set the zone field to the zone you wish the mob killed in as opposed to the zone that the npc setting the global is in(and I figure if you are in there adding that, you would probably just be adding the reloadall).

So I guess in the end I was no help, pretty usual.
Reply With Quote
  #4  
Old 11-03-2011, 12:09 AM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default

Quote:
Originally Posted by Caryatis View Post
The biggest flaw in your idea(imo) is that you are going to be creating hundreds of tasks automatically, even more if you do this on a popular server and the task is repeatable. If you had this capability, you would probably use it again, then you have thousands of tasks that are only ever used once,
Yeah, if I had gotten this to actual work I was going to delete the task from the database once the player completed it. Using the task system was only a means to an end--to track when the kill was made.

Quote:
Originally Posted by Caryatis View Post
unless the code also checks each task to see if the target matches the random mob.
This actually is a really good idea except here I read that "the maximum task id is 9999," thus what I said about clearing them out.

Quote:
Originally Posted by Caryatis View Post
If I was going to do this I would set a global for the NPCType and then add a sub EVENT_DEATH check for the global in the default.pl in templates, if the global matches the player and zone then updatetaskactivity. This is not an ideal solution as it won't work for mobs with scripts that have a death event and its still pretty sloppy imo. It would also require a custom perl command as you would need to set the zone field to the zone you wish the mob killed in as opposed to the zone that the npc setting the global is in(and I figure if you are in there adding that, you would probably just be adding the reloadall).
This is really some good thinking. I appreciate you taking the time to talk it out. I need to think through some similar scenarios and I believe that eventually I'll figure out something that will work.

Quote:
Originally Posted by Caryatis View Post
So I guess in the end I was no help, pretty usual.
Actually you provided a lot of food for thought which is half the fun for me, thanks.

An alternative route might be to randomly select an item dropped by the random MOB and then use that as a turn in. Easy to store. Easy to track. There are loopholes, the PC could just get the item from somewhere else and never kill the assigned MOB, but maybe I'll just call that a feature rather than a bug.
Reply With Quote
  #5  
Old 11-04-2011, 12:16 AM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default

So back to the original issue, executing a GM command from Perl script. Can anyone offer some direction or advice on how easy or hard this would be to write some custom code that does it or allows it? Are they closely related, or miles apart?
Reply With Quote
Reply

Thread Tools
Display Modes

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 10:55 AM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3